Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
cf12c3d2
Commit
cf12c3d2
authored
Aug 13, 2018
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Creates vue component for erased block on job view
parent
456a4dde
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
122 additions
and
0 deletions
+122
-0
app/assets/javascripts/jobs/components/erased_block.vue
app/assets/javascripts/jobs/components/erased_block.vue
+55
-0
changelogs/unreleased/50101-erased-block.yml
changelogs/unreleased/50101-erased-block.yml
+5
-0
locale/gitlab.pot
locale/gitlab.pot
+6
-0
spec/javascripts/jobs/erased_block_spec.js
spec/javascripts/jobs/erased_block_spec.js
+56
-0
No files found.
app/assets/javascripts/jobs/components/erased_block.vue
0 → 100644
View file @
cf12c3d2
<
script
>
import
TimeagoTooltip
from
'
~/vue_shared/components/time_ago_tooltip.vue
'
;
export
default
{
components
:
{
TimeagoTooltip
,
},
props
:
{
erasedByUser
:
{
type
:
Boolean
,
required
:
true
,
},
username
:
{
type
:
String
,
required
:
false
,
default
:
null
,
},
linkToUser
:
{
type
:
String
,
required
:
false
,
default
:
null
,
},
erasedAt
:
{
type
:
String
,
required
:
true
,
},
},
};
</
script
>
<
template
>
<div
class=
"prepend-top-default js-build-erased"
>
<div
class=
"erased alert alert-warning"
>
<template
v-if=
"erasedByUser"
>
{{
s__
(
"
Job|Job has been erased by
"
)
}}
<a
:href=
"linkToUser"
>
{{
username
}}
</a>
<timeago-tooltip
:time=
"erasedAt"
/>
</
template
>
<
template
v-else
>
{{
s__
(
"
Job|Job has been erased
"
)
}}
<timeago-tooltip
:time=
"erasedAt"
/>
</
template
>
</div>
</div>
</template>
changelogs/unreleased/50101-erased-block.yml
0 → 100644
View file @
cf12c3d2
---
title
:
Creates vue component for erased block on job view
merge_request
:
author
:
type
:
other
locale/gitlab.pot
View file @
cf12c3d2
...
...
@@ -3130,6 +3130,12 @@ msgstr ""
msgid "Jobs"
msgstr ""
msgid "Job|Job has been erased"
msgstr ""
msgid "Job|Job has been erased by"
msgstr ""
msgid "Jul"
msgstr ""
...
...
spec/javascripts/jobs/erased_block_spec.js
0 → 100644
View file @
cf12c3d2
import
Vue
from
'
vue
'
;
import
{
getTimeago
}
from
'
~/lib/utils/datetime_utility
'
;
import
component
from
'
~/jobs/components/erased_block.vue
'
;
import
mountComponent
from
'
../helpers/vue_mount_component_helper
'
;
describe
(
'
Erased block
'
,
()
=>
{
const
Component
=
Vue
.
extend
(
component
);
let
vm
;
const
erasedAt
=
'
2016-11-07T11:11:16.525Z
'
;
const
timeago
=
getTimeago
();
const
formatedDate
=
timeago
.
format
(
erasedAt
);
afterEach
(()
=>
{
vm
.
$destroy
();
});
describe
(
'
with job erased by user
'
,
()
=>
{
beforeEach
(()
=>
{
vm
=
mountComponent
(
Component
,
{
erasedByUser
:
true
,
username
:
'
root
'
,
linkToUser
:
'
gitlab.com/root
'
,
erasedAt
,
});
});
it
(
'
renders username and link
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
a
'
).
getAttribute
(
'
href
'
)).
toEqual
(
'
gitlab.com/root
'
);
expect
(
vm
.
$el
.
textContent
).
toContain
(
'
Job has been erased by
'
);
expect
(
vm
.
$el
.
textContent
).
toContain
(
'
root
'
);
});
it
(
'
renders erasedAt
'
,
()
=>
{
expect
(
vm
.
$el
.
textContent
).
toContain
(
formatedDate
);
});
});
describe
(
'
with erased job
'
,
()
=>
{
beforeEach
(()
=>
{
vm
=
mountComponent
(
Component
,
{
erasedByUser
:
false
,
erasedAt
,
});
});
it
(
'
renders username and link
'
,
()
=>
{
expect
(
vm
.
$el
.
textContent
).
toContain
(
'
Job has been erased
'
);
});
it
(
'
renders erasedAt
'
,
()
=>
{
expect
(
vm
.
$el
.
textContent
).
toContain
(
formatedDate
);
});
});
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment