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
9789068e
Commit
9789068e
authored
Sep 07, 2020
by
Gilang Gumilar
Committed by
Martin Wortschack
Sep 07, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add the artifact expiration help url
parent
bc886f7f
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
51 additions
and
3 deletions
+51
-3
app/assets/javascripts/jobs/components/artifacts_block.vue
app/assets/javascripts/jobs/components/artifacts_block.vue
+14
-1
app/assets/javascripts/jobs/components/job_app.vue
app/assets/javascripts/jobs/components/job_app.vue
+6
-0
app/assets/javascripts/jobs/components/sidebar.vue
app/assets/javascripts/jobs/components/sidebar.vue
+6
-1
app/assets/javascripts/jobs/index.js
app/assets/javascripts/jobs/index.js
+2
-0
app/helpers/ci/jobs_helper.rb
app/helpers/ci/jobs_helper.rb
+1
-0
changelogs/unreleased/233425-add-artifact-expiration-help-url.yml
...gs/unreleased/233425-add-artifact-expiration-help-url.yml
+5
-0
spec/frontend/jobs/components/artifacts_block_spec.js
spec/frontend/jobs/components/artifacts_block_spec.js
+16
-1
spec/frontend/jobs/components/job_app_spec.js
spec/frontend/jobs/components/job_app_spec.js
+1
-0
No files found.
app/assets/javascripts/jobs/components/artifacts_block.vue
View file @
9789068e
<
script
>
<
script
>
import
{
GlLink
}
from
'
@gitlab/ui
'
;
import
{
Gl
Icon
,
Gl
Link
}
from
'
@gitlab/ui
'
;
import
TimeagoTooltip
from
'
~/vue_shared/components/time_ago_tooltip.vue
'
;
import
TimeagoTooltip
from
'
~/vue_shared/components/time_ago_tooltip.vue
'
;
import
timeagoMixin
from
'
~/vue_shared/mixins/timeago
'
;
import
timeagoMixin
from
'
~/vue_shared/mixins/timeago
'
;
export
default
{
export
default
{
components
:
{
components
:
{
TimeagoTooltip
,
TimeagoTooltip
,
GlIcon
,
GlLink
,
GlLink
,
},
},
mixins
:
[
timeagoMixin
],
mixins
:
[
timeagoMixin
],
...
@@ -14,6 +15,10 @@ export default {
...
@@ -14,6 +15,10 @@ export default {
type
:
Object
,
type
:
Object
,
required
:
true
,
required
:
true
,
},
},
helpUrl
:
{
type
:
String
,
required
:
true
,
},
},
},
computed
:
{
computed
:
{
isExpired
()
{
isExpired
()
{
...
@@ -40,6 +45,14 @@ export default {
...
@@ -40,6 +45,14 @@ export default {
<span
v-if=
"isExpired"
>
{{
s__
(
'
Job|The artifacts were removed
'
)
}}
</span>
<span
v-if=
"isExpired"
>
{{
s__
(
'
Job|The artifacts were removed
'
)
}}
</span>
<span
v-if=
"willExpire"
>
{{
s__
(
'
Job|The artifacts will be removed
'
)
}}
</span>
<span
v-if=
"willExpire"
>
{{
s__
(
'
Job|The artifacts will be removed
'
)
}}
</span>
<timeago-tooltip
v-if=
"artifact.expire_at"
:time=
"artifact.expire_at"
/>
<timeago-tooltip
v-if=
"artifact.expire_at"
:time=
"artifact.expire_at"
/>
<gl-link
:href=
"helpUrl"
target=
"_blank"
rel=
"noopener noreferrer nofollow"
data-testid=
"artifact-expired-help-link"
>
<gl-icon
name=
"question"
/>
</gl-link>
</p>
</p>
<p
v-else-if=
"isLocked"
class=
"build-detail-row"
>
<p
v-else-if=
"isLocked"
class=
"build-detail-row"
>
<span
data-testid=
"job-locked-message"
>
{{
<span
data-testid=
"job-locked-message"
>
{{
...
...
app/assets/javascripts/jobs/components/job_app.vue
View file @
9789068e
...
@@ -38,6 +38,11 @@ export default {
...
@@ -38,6 +38,11 @@ export default {
},
},
mixins
:
[
delayedJobMixin
],
mixins
:
[
delayedJobMixin
],
props
:
{
props
:
{
artifactHelpUrl
:
{
type
:
String
,
required
:
false
,
default
:
''
,
},
runnerSettingsUrl
:
{
runnerSettingsUrl
:
{
type
:
String
,
type
:
String
,
required
:
false
,
required
:
false
,
...
@@ -319,6 +324,7 @@ export default {
...
@@ -319,6 +324,7 @@ export default {
'right-sidebar-expanded': isSidebarOpen,
'right-sidebar-expanded': isSidebarOpen,
'right-sidebar-collapsed': !isSidebarOpen,
'right-sidebar-collapsed': !isSidebarOpen,
}"
}"
:artifact-help-url=
"artifactHelpUrl"
:runner-help-url=
"runnerHelpUrl"
:runner-help-url=
"runnerHelpUrl"
data-testid=
"job-sidebar"
data-testid=
"job-sidebar"
/>
/>
...
...
app/assets/javascripts/jobs/components/sidebar.vue
View file @
9789068e
...
@@ -29,6 +29,11 @@ export default {
...
@@ -29,6 +29,11 @@ export default {
},
},
mixins
:
[
timeagoMixin
],
mixins
:
[
timeagoMixin
],
props
:
{
props
:
{
artifactHelpUrl
:
{
type
:
String
,
required
:
false
,
default
:
''
,
},
runnerHelpUrl
:
{
runnerHelpUrl
:
{
type
:
String
,
type
:
String
,
required
:
false
,
required
:
false
,
...
@@ -208,7 +213,7 @@ export default {
...
@@ -208,7 +213,7 @@ export default {
</p>
</p>
</div>
</div>
<artifacts-block
v-if=
"hasArtifact"
:artifact=
"job.artifact"
/>
<artifacts-block
v-if=
"hasArtifact"
:artifact=
"job.artifact"
:help-url=
"artifactHelpUrl"
/>
<trigger-block
v-if=
"hasTriggers"
:trigger=
"job.trigger"
/>
<trigger-block
v-if=
"hasTriggers"
:trigger=
"job.trigger"
/>
<commit-block
<commit-block
:is-last-block=
"hasStages"
:is-last-block=
"hasStages"
...
...
app/assets/javascripts/jobs/index.js
View file @
9789068e
...
@@ -18,6 +18,7 @@ export default () => {
...
@@ -18,6 +18,7 @@ export default () => {
},
},
render
(
createElement
)
{
render
(
createElement
)
{
const
{
const
{
artifactHelpUrl
,
deploymentHelpUrl
,
deploymentHelpUrl
,
runnerHelpUrl
,
runnerHelpUrl
,
runnerSettingsUrl
,
runnerSettingsUrl
,
...
@@ -32,6 +33,7 @@ export default () => {
...
@@ -32,6 +33,7 @@ export default () => {
return
createElement
(
'
job-app
'
,
{
return
createElement
(
'
job-app
'
,
{
props
:
{
props
:
{
artifactHelpUrl
,
deploymentHelpUrl
,
deploymentHelpUrl
,
runnerHelpUrl
,
runnerHelpUrl
,
runnerSettingsUrl
,
runnerSettingsUrl
,
...
...
app/helpers/ci/jobs_helper.rb
View file @
9789068e
...
@@ -6,6 +6,7 @@ module Ci
...
@@ -6,6 +6,7 @@ module Ci
{
{
"endpoint"
=>
project_job_path
(
@project
,
@build
,
format: :json
),
"endpoint"
=>
project_job_path
(
@project
,
@build
,
format: :json
),
"project_path"
=>
@project
.
full_path
,
"project_path"
=>
@project
.
full_path
,
"artifact_help_url"
=>
help_page_path
(
'user/gitlab_com/index.html'
,
anchor:
'gitlab-cicd'
),
"deployment_help_url"
=>
help_page_path
(
'user/project/clusters/index.html'
,
anchor:
'troubleshooting'
),
"deployment_help_url"
=>
help_page_path
(
'user/project/clusters/index.html'
,
anchor:
'troubleshooting'
),
"runner_help_url"
=>
help_page_path
(
'ci/runners/README.html'
,
anchor:
'set-maximum-job-timeout-for-a-runner'
),
"runner_help_url"
=>
help_page_path
(
'ci/runners/README.html'
,
anchor:
'set-maximum-job-timeout-for-a-runner'
),
"runner_settings_url"
=>
project_runners_path
(
@build
.
project
,
anchor:
'js-runners-settings'
),
"runner_settings_url"
=>
project_runners_path
(
@build
.
project
,
anchor:
'js-runners-settings'
),
...
...
changelogs/unreleased/233425-add-artifact-expiration-help-url.yml
0 → 100644
View file @
9789068e
---
title
:
Add the artifact expiration help url
merge_request
:
39546
author
:
Gilang Gumilar
type
:
added
spec/frontend/jobs/components/artifacts_block_spec.js
View file @
9789068e
...
@@ -8,7 +8,10 @@ describe('Artifacts block', () => {
...
@@ -8,7 +8,10 @@ describe('Artifacts block', () => {
const
createWrapper
=
propsData
=>
const
createWrapper
=
propsData
=>
mount
(
ArtifactsBlock
,
{
mount
(
ArtifactsBlock
,
{
propsData
,
propsData
:
{
helpUrl
:
'
help-url
'
,
...
propsData
,
},
});
});
const
findArtifactRemoveElt
=
()
=>
wrapper
.
find
(
'
[data-testid="artifacts-remove-timeline"]
'
);
const
findArtifactRemoveElt
=
()
=>
wrapper
.
find
(
'
[data-testid="artifacts-remove-timeline"]
'
);
...
@@ -68,6 +71,12 @@ describe('Artifacts block', () => {
...
@@ -68,6 +71,12 @@ describe('Artifacts block', () => {
expect
(
trimText
(
findArtifactRemoveElt
().
text
())).
toBe
(
expect
(
trimText
(
findArtifactRemoveElt
().
text
())).
toBe
(
`The artifacts were removed
${
formattedDate
}
`
,
`The artifacts were removed
${
formattedDate
}
`
,
);
);
expect
(
findArtifactRemoveElt
()
.
find
(
'
[data-testid="artifact-expired-help-link"]
'
)
.
attributes
(
'
href
'
),
).
toBe
(
'
help-url
'
);
});
});
it
(
'
does not show the keep button
'
,
()
=>
{
it
(
'
does not show the keep button
'
,
()
=>
{
...
@@ -94,6 +103,12 @@ describe('Artifacts block', () => {
...
@@ -94,6 +103,12 @@ describe('Artifacts block', () => {
expect
(
trimText
(
findArtifactRemoveElt
().
text
())).
toBe
(
expect
(
trimText
(
findArtifactRemoveElt
().
text
())).
toBe
(
`The artifacts will be removed
${
formattedDate
}
`
,
`The artifacts will be removed
${
formattedDate
}
`
,
);
);
expect
(
findArtifactRemoveElt
()
.
find
(
'
[data-testid="artifact-expired-help-link"]
'
)
.
attributes
(
'
href
'
),
).
toBe
(
'
help-url
'
);
});
});
it
(
'
renders the keep button
'
,
()
=>
{
it
(
'
renders the keep button
'
,
()
=>
{
...
...
spec/frontend/jobs/components/job_app_spec.js
View file @
9789068e
...
@@ -33,6 +33,7 @@ describe('Job App', () => {
...
@@ -33,6 +33,7 @@ describe('Job App', () => {
};
};
const
props
=
{
const
props
=
{
artifactHelpUrl
:
'
help/artifact
'
,
runnerHelpUrl
:
'
help/runner
'
,
runnerHelpUrl
:
'
help/runner
'
,
deploymentHelpUrl
:
'
help/deployment
'
,
deploymentHelpUrl
:
'
help/deployment
'
,
runnerSettingsUrl
:
'
settings/ci-cd/runners
'
,
runnerSettingsUrl
:
'
settings/ci-cd/runners
'
,
...
...
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