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
6cdfd863
Commit
6cdfd863
authored
Sep 17, 2021
by
Payton Burdette
Committed by
Nicolò Maria Mezzopera
Sep 17, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use job name for primary identifier on ci header
parent
95cd8700
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
48 additions
and
21 deletions
+48
-21
app/assets/javascripts/jobs/components/job_app.vue
app/assets/javascripts/jobs/components/job_app.vue
+5
-3
app/assets/javascripts/pipelines/components/header_component.vue
...ets/javascripts/pipelines/components/header_component.vue
+1
-1
app/assets/javascripts/vue_shared/components/header_ci_component.vue
...javascripts/vue_shared/components/header_ci_component.vue
+11
-3
locale/gitlab.pot
locale/gitlab.pot
+3
-0
spec/features/projects/jobs/permissions_spec.rb
spec/features/projects/jobs/permissions_spec.rb
+1
-1
spec/features/projects/jobs/user_browses_job_spec.rb
spec/features/projects/jobs/user_browses_job_spec.rb
+1
-1
spec/frontend/jobs/components/job_app_spec.js
spec/frontend/jobs/components/job_app_spec.js
+2
-2
spec/frontend/pipelines/header_component_spec.js
spec/frontend/pipelines/header_component_spec.js
+1
-1
spec/frontend/vue_shared/components/header_ci_component_spec.js
...rontend/vue_shared/components/header_ci_component_spec.js
+23
-9
No files found.
app/assets/javascripts/jobs/components/job_app.vue
View file @
6cdfd863
...
@@ -5,7 +5,7 @@ import { throttle, isEmpty } from 'lodash';
...
@@ -5,7 +5,7 @@ import { throttle, isEmpty } from 'lodash';
import
{
mapGetters
,
mapState
,
mapActions
}
from
'
vuex
'
;
import
{
mapGetters
,
mapState
,
mapActions
}
from
'
vuex
'
;
import
CodeQualityWalkthrough
from
'
~/code_quality_walkthrough/components/step.vue
'
;
import
CodeQualityWalkthrough
from
'
~/code_quality_walkthrough/components/step.vue
'
;
import
{
isScrolledToBottom
}
from
'
~/lib/utils/scroll_utils
'
;
import
{
isScrolledToBottom
}
from
'
~/lib/utils/scroll_utils
'
;
import
{
sprintf
}
from
'
~/locale
'
;
import
{
__
,
sprintf
}
from
'
~/locale
'
;
import
CiHeader
from
'
~/vue_shared/components/header_ci_component.vue
'
;
import
CiHeader
from
'
~/vue_shared/components/header_ci_component.vue
'
;
import
delayedJobMixin
from
'
../mixins/delayed_job_mixin
'
;
import
delayedJobMixin
from
'
../mixins/delayed_job_mixin
'
;
import
EmptyState
from
'
./empty_state.vue
'
;
import
EmptyState
from
'
./empty_state.vue
'
;
...
@@ -126,6 +126,9 @@ export default {
...
@@ -126,6 +126,9 @@ export default {
shouldRenderCodeQualityWalkthrough
()
{
shouldRenderCodeQualityWalkthrough
()
{
return
this
.
job
.
status
.
group
===
'
failed-with-warnings
'
;
return
this
.
job
.
status
.
group
===
'
failed-with-warnings
'
;
},
},
itemName
()
{
return
sprintf
(
__
(
'
Job %{jobName}
'
),
{
jobName
:
this
.
job
.
name
});
},
},
},
watch
:
{
watch
:
{
// Once the job log is loaded,
// Once the job log is loaded,
...
@@ -205,12 +208,11 @@ export default {
...
@@ -205,12 +208,11 @@ export default {
<div
class=
"build-header top-area"
>
<div
class=
"build-header top-area"
>
<ci-header
<ci-header
:status=
"job.status"
:status=
"job.status"
:item-id=
"job.id"
:time=
"headerTime"
:time=
"headerTime"
:user=
"job.user"
:user=
"job.user"
:has-sidebar-button=
"true"
:has-sidebar-button=
"true"
:should-render-triggered-label=
"shouldRenderTriggeredLabel"
:should-render-triggered-label=
"shouldRenderTriggeredLabel"
:item-name=
"
__('Job')
"
:item-name=
"
itemName
"
@
clickedSidebarButton=
"toggleSidebar"
@
clickedSidebarButton=
"toggleSidebar"
/>
/>
</div>
</div>
...
...
app/assets/javascripts/pipelines/components/header_component.vue
View file @
6cdfd863
...
@@ -218,7 +218,7 @@ export default {
...
@@ -218,7 +218,7 @@ export default {
:status=
"pipeline.detailedStatus"
:status=
"pipeline.detailedStatus"
:time=
"pipeline.createdAt"
:time=
"pipeline.createdAt"
:user=
"pipeline.user"
:user=
"pipeline.user"
:item-id=
"
Number(pipelineId)
"
:item-id=
"
pipelineId
"
item-name=
"Pipeline"
item-name=
"Pipeline"
>
>
<gl-button
<gl-button
...
...
app/assets/javascripts/vue_shared/components/header_ci_component.vue
View file @
6cdfd863
...
@@ -37,8 +37,9 @@ export default {
...
@@ -37,8 +37,9 @@ export default {
required
:
true
,
required
:
true
,
},
},
itemId
:
{
itemId
:
{
type
:
Number
,
type
:
String
,
required
:
true
,
required
:
false
,
default
:
''
,
},
},
time
:
{
time
:
{
type
:
String
,
type
:
String
,
...
@@ -86,6 +87,13 @@ export default {
...
@@ -86,6 +87,13 @@ export default {
message
()
{
message
()
{
return
this
.
user
?.
status
?.
message
;
return
this
.
user
?.
status
?.
message
;
},
},
item
()
{
if
(
this
.
itemId
)
{
return
`
${
this
.
itemName
}
#
${
this
.
itemId
}
`
;
}
return
this
.
itemName
;
},
},
},
methods
:
{
methods
:
{
...
@@ -106,7 +114,7 @@ export default {
...
@@ -106,7 +114,7 @@ export default {
<section
class=
"header-main-content gl-mr-3"
>
<section
class=
"header-main-content gl-mr-3"
>
<ci-icon-badge
:status=
"status"
/>
<ci-icon-badge
:status=
"status"
/>
<strong
data-testid=
"ci-header-item-text"
>
{{
itemName
}}
#
{{
itemId
}}
</strong>
<strong
data-testid=
"ci-header-item-text"
>
{{
item
}}
</strong>
<template
v-if=
"shouldRenderTriggeredLabel"
>
{{
__
(
'
triggered
'
)
}}
</
template
>
<template
v-if=
"shouldRenderTriggeredLabel"
>
{{
__
(
'
triggered
'
)
}}
</
template
>
<
template
v-else
>
{{
__
(
'
created
'
)
}}
</
template
>
<
template
v-else
>
{{
__
(
'
created
'
)
}}
</
template
>
...
...
locale/gitlab.pot
View file @
6cdfd863
...
@@ -19351,6 +19351,9 @@ msgstr ""
...
@@ -19351,6 +19351,9 @@ msgstr ""
msgid "Job"
msgid "Job"
msgstr ""
msgstr ""
msgid "Job %{jobName}"
msgstr ""
msgid "Job Failed #%{build_id}"
msgid "Job Failed #%{build_id}"
msgstr ""
msgstr ""
...
...
spec/features/projects/jobs/permissions_spec.rb
View file @
6cdfd863
...
@@ -90,7 +90,7 @@ RSpec.describe 'Project Jobs Permissions' do
...
@@ -90,7 +90,7 @@ RSpec.describe 'Project Jobs Permissions' do
it_behaves_like
'recent job page details responds with status'
,
200
do
it_behaves_like
'recent job page details responds with status'
,
200
do
it
'renders job details'
,
:js
do
it
'renders job details'
,
:js
do
expect
(
page
).
to
have_content
"Job #
#{
job
.
id
}
"
expect
(
page
).
to
have_content
"Job
#
{
job
.
name
}
"
expect
(
page
).
to
have_css
'.log-line'
expect
(
page
).
to
have_css
'.log-line'
end
end
end
end
...
...
spec/features/projects/jobs/user_browses_job_spec.rb
View file @
6cdfd863
...
@@ -21,7 +21,7 @@ RSpec.describe 'User browses a job', :js do
...
@@ -21,7 +21,7 @@ RSpec.describe 'User browses a job', :js do
it
'erases the job log'
,
:js
do
it
'erases the job log'
,
:js
do
wait_for_requests
wait_for_requests
expect
(
page
).
to
have_content
(
"Job #
#{
build
.
id
}
"
)
expect
(
page
).
to
have_content
(
"Job
#
{
build
.
name
}
"
)
expect
(
page
).
to
have_css
(
'.job-log'
)
expect
(
page
).
to
have_css
(
'.job-log'
)
# scroll to the top of the page first
# scroll to the top of the page first
...
...
spec/frontend/jobs/components/job_app_spec.js
View file @
6cdfd863
...
@@ -140,7 +140,7 @@ describe('Job App', () => {
...
@@ -140,7 +140,7 @@ describe('Job App', () => {
it
(
'
should render provided job information
'
,
()
=>
{
it
(
'
should render provided job information
'
,
()
=>
{
expect
(
wrapper
.
find
(
'
.header-main-content
'
).
text
().
replace
(
/
\s
+/g
,
'
'
).
trim
()).
toContain
(
expect
(
wrapper
.
find
(
'
.header-main-content
'
).
text
().
replace
(
/
\s
+/g
,
'
'
).
trim
()).
toContain
(
'
passed Job
#4757
triggered 1 year ago by Root
'
,
'
passed Job
test
triggered 1 year ago by Root
'
,
);
);
});
});
...
@@ -154,7 +154,7 @@ describe('Job App', () => {
...
@@ -154,7 +154,7 @@ describe('Job App', () => {
setupAndMount
().
then
(()
=>
{
setupAndMount
().
then
(()
=>
{
expect
(
expect
(
wrapper
.
find
(
'
.header-main-content
'
).
text
().
replace
(
/
\s
+/g
,
'
'
).
trim
(),
wrapper
.
find
(
'
.header-main-content
'
).
text
().
replace
(
/
\s
+/g
,
'
'
).
trim
(),
).
toContain
(
'
passed Job
#4757
created 3 weeks ago by Root
'
);
).
toContain
(
'
passed Job
test
created 3 weeks ago by Root
'
);
}));
}));
});
});
});
});
...
...
spec/frontend/pipelines/header_component_spec.js
View file @
6cdfd863
...
@@ -24,7 +24,7 @@ describe('Pipeline details header', () => {
...
@@ -24,7 +24,7 @@ describe('Pipeline details header', () => {
const
findLoadingIcon
=
()
=>
wrapper
.
find
(
GlLoadingIcon
);
const
findLoadingIcon
=
()
=>
wrapper
.
find
(
GlLoadingIcon
);
const
defaultProvideOptions
=
{
const
defaultProvideOptions
=
{
pipelineId
:
14
,
pipelineId
:
'
14
'
,
pipelineIid
:
1
,
pipelineIid
:
1
,
paths
:
{
paths
:
{
pipelinesPath
:
'
/namespace/my-project/-/pipelines
'
,
pipelinesPath
:
'
/namespace/my-project/-/pipelines
'
,
...
...
spec/frontend/vue_shared/components/header_ci_component_spec.js
View file @
6cdfd863
...
@@ -16,8 +16,6 @@ describe('Header CI Component', () => {
...
@@ -16,8 +16,6 @@ describe('Header CI Component', () => {
text
:
'
failed
'
,
text
:
'
failed
'
,
details_path
:
'
path
'
,
details_path
:
'
path
'
,
},
},
itemName
:
'
job
'
,
itemId
:
123
,
time
:
'
2017-05-08T14:57:39.781Z
'
,
time
:
'
2017-05-08T14:57:39.781Z
'
,
user
:
{
user
:
{
web_url
:
'
path
'
,
web_url
:
'
path
'
,
...
@@ -55,17 +53,13 @@ describe('Header CI Component', () => {
...
@@ -55,17 +53,13 @@ describe('Header CI Component', () => {
describe
(
'
render
'
,
()
=>
{
describe
(
'
render
'
,
()
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
createComponent
();
createComponent
(
{
itemName
:
'
Pipeline
'
}
);
});
});
it
(
'
should render status badge
'
,
()
=>
{
it
(
'
should render status badge
'
,
()
=>
{
expect
(
findIconBadge
().
exists
()).
toBe
(
true
);
expect
(
findIconBadge
().
exists
()).
toBe
(
true
);
});
});
it
(
'
should render item name and id
'
,
()
=>
{
expect
(
findHeaderItemText
().
text
()).
toBe
(
'
job #123
'
);
});
it
(
'
should render timeago date
'
,
()
=>
{
it
(
'
should render timeago date
'
,
()
=>
{
expect
(
findTimeAgo
().
exists
()).
toBe
(
true
);
expect
(
findTimeAgo
().
exists
()).
toBe
(
true
);
});
});
...
@@ -83,9 +77,29 @@ describe('Header CI Component', () => {
...
@@ -83,9 +77,29 @@ describe('Header CI Component', () => {
});
});
});
});
describe
(
'
with item id
'
,
()
=>
{
beforeEach
(()
=>
{
createComponent
({
itemName
:
'
Pipeline
'
,
itemId
:
'
123
'
});
});
it
(
'
should render item name and id
'
,
()
=>
{
expect
(
findHeaderItemText
().
text
()).
toBe
(
'
Pipeline #123
'
);
});
});
describe
(
'
without item id
'
,
()
=>
{
beforeEach
(()
=>
{
createComponent
({
itemName
:
'
Job build_job
'
});
});
it
(
'
should render item name
'
,
()
=>
{
expect
(
findHeaderItemText
().
text
()).
toBe
(
'
Job build_job
'
);
});
});
describe
(
'
slot
'
,
()
=>
{
describe
(
'
slot
'
,
()
=>
{
it
(
'
should render header action buttons
'
,
()
=>
{
it
(
'
should render header action buttons
'
,
()
=>
{
createComponent
({},
{
slots
:
{
default
:
'
Test Actions
'
}
});
createComponent
({
itemName
:
'
Job build_job
'
},
{
slots
:
{
default
:
'
Test Actions
'
}
});
expect
(
findActionButtons
().
exists
()).
toBe
(
true
);
expect
(
findActionButtons
().
exists
()).
toBe
(
true
);
expect
(
findActionButtons
().
text
()).
toBe
(
'
Test Actions
'
);
expect
(
findActionButtons
().
text
()).
toBe
(
'
Test Actions
'
);
...
@@ -94,7 +108,7 @@ describe('Header CI Component', () => {
...
@@ -94,7 +108,7 @@ describe('Header CI Component', () => {
describe
(
'
shouldRenderTriggeredLabel
'
,
()
=>
{
describe
(
'
shouldRenderTriggeredLabel
'
,
()
=>
{
it
(
'
should render created keyword when the shouldRenderTriggeredLabel is false
'
,
()
=>
{
it
(
'
should render created keyword when the shouldRenderTriggeredLabel is false
'
,
()
=>
{
createComponent
({
shouldRenderTriggeredLabel
:
false
});
createComponent
({
shouldRenderTriggeredLabel
:
false
,
itemName
:
'
Job build_job
'
});
expect
(
wrapper
.
text
()).
toContain
(
'
created
'
);
expect
(
wrapper
.
text
()).
toContain
(
'
created
'
);
expect
(
wrapper
.
text
()).
not
.
toContain
(
'
triggered
'
);
expect
(
wrapper
.
text
()).
not
.
toContain
(
'
triggered
'
);
...
...
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