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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
96833a7b
Commit
96833a7b
authored
Jan 28, 2021
by
pburdette
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply reviewer feedback
Remove snapshots, use GlSprintf to transalte the username link.
parent
9d824900
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
103 deletions
+12
-103
app/assets/javascripts/jobs/components/erased_block.vue
app/assets/javascripts/jobs/components/erased_block.vue
+7
-3
changelogs/unreleased/pb-use-gl-alert-erased-block.yml
changelogs/unreleased/pb-use-gl-alert-erased-block.yml
+5
-0
spec/frontend/jobs/components/__snapshots__/erased_block_spec.js.snap
...d/jobs/components/__snapshots__/erased_block_spec.js.snap
+0
-92
spec/frontend/jobs/components/erased_block_spec.js
spec/frontend/jobs/components/erased_block_spec.js
+0
-8
No files found.
app/assets/javascripts/jobs/components/erased_block.vue
View file @
96833a7b
<
script
>
import
{
isEmpty
}
from
'
lodash
'
;
import
{
GlAlert
,
GlLink
}
from
'
@gitlab/ui
'
;
import
{
GlAlert
,
GlLink
,
GlSprintf
}
from
'
@gitlab/ui
'
;
import
TimeagoTooltip
from
'
~/vue_shared/components/time_ago_tooltip.vue
'
;
export
default
{
components
:
{
GlAlert
,
GlLink
,
GlSprintf
,
TimeagoTooltip
,
},
props
:
{
...
...
@@ -31,8 +32,11 @@ export default {
<div
class=
"gl-mt-3"
>
<gl-alert
variant=
"warning"
:dismissible=
"false"
>
<template
v-if=
"isErasedByUser"
>
{{
s__
(
'
Job|Job has been erased by
'
)
}}
<gl-link
:href=
"user.web_url"
>
{{
user
.
username
}}
</gl-link>
<gl-sprintf
:message=
"s__('Job|Job has been erased by %
{userLink}')">
<template
#userLink
>
<gl-link
:href=
"user.web_url"
target=
"_blank"
>
{{
user
.
username
}}
</gl-link>
</
template
>
</gl-sprintf>
</template>
<
template
v-else
>
...
...
changelogs/unreleased/pb-use-gl-alert-erased-block.yml
0 → 100644
View file @
96833a7b
---
title
:
Replace erase job log alert variant with correct variant
merge_request
:
52810
author
:
type
:
changed
spec/frontend/jobs/components/__snapshots__/erased_block_spec.js.snap
deleted
100644 → 0
View file @
9d824900
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Erased block with erased job renders alert with erased text and variant 1`] = `
<div
class="gl-mt-3"
>
<div
class="gl-alert gl-alert-warning"
role="alert"
>
<svg
aria-hidden="true"
class="gl-icon s16 gl-alert-icon gl-alert-icon-no-title"
data-testid="warning-icon"
>
<use
href="#warning"
/>
</svg>
<!---->
<!---->
<div
class="gl-alert-body"
>
Job has been erased
<time
class=""
datetime="2016-11-07T11:11:16.525Z"
title="Nov 7, 2016 11:11am GMT+0000"
>
4 years ago
</time>
</div>
<!---->
</div>
</div>
`;
exports[`Erased block with job erased by user renders alert with erased by text and variant 1`] = `
<div
class="gl-mt-3"
>
<div
class="gl-alert gl-alert-warning"
role="alert"
>
<svg
aria-hidden="true"
class="gl-icon s16 gl-alert-icon gl-alert-icon-no-title"
data-testid="warning-icon"
>
<use
href="#warning"
/>
</svg>
<!---->
<!---->
<div
class="gl-alert-body"
>
Job has been erased by
<a
class="gl-link"
href="gitlab.com/root"
>
root
</a>
<time
class=""
datetime="2016-11-07T11:11:16.525Z"
title="Nov 7, 2016 11:11am GMT+0000"
>
4 years ago
</time>
</div>
<!---->
</div>
</div>
`;
spec/frontend/jobs/components/erased_block_spec.js
View file @
96833a7b
...
...
@@ -33,10 +33,6 @@ describe('Erased block', () => {
});
});
it
(
'
renders alert with erased by text and variant
'
,
()
=>
{
expect
(
wrapper
.
element
).
toMatchSnapshot
();
});
it
(
'
renders username and link
'
,
()
=>
{
expect
(
findLink
().
attributes
(
'
href
'
)).
toEqual
(
'
gitlab.com/root
'
);
...
...
@@ -56,10 +52,6 @@ describe('Erased block', () => {
});
});
it
(
'
renders alert with erased text and variant
'
,
()
=>
{
expect
(
wrapper
.
element
).
toMatchSnapshot
();
});
it
(
'
renders username and link
'
,
()
=>
{
expect
(
wrapper
.
text
().
trim
()).
toContain
(
'
Job has been erased
'
);
});
...
...
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