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
426ac043
Commit
426ac043
authored
Nov 06, 2018
by
Filipa Lacerda
Committed by
Phil Hughes
Nov 06, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ee port: Renders a warning block for archived job
parent
55913e7a
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
113 additions
and
6 deletions
+113
-6
app/assets/javascripts/jobs/components/job_app.vue
app/assets/javascripts/jobs/components/job_app.vue
+27
-5
app/assets/javascripts/jobs/components/job_log_controllers.vue
...ssets/javascripts/jobs/components/job_log_controllers.vue
+1
-1
app/assets/stylesheets/pages/builds.scss
app/assets/stylesheets/pages/builds.scss
+43
-0
changelogs/unreleased/53535-sticky-archived.yml
changelogs/unreleased/53535-sticky-archived.yml
+5
-0
locale/gitlab.pot
locale/gitlab.pot
+3
-0
spec/javascripts/jobs/components/job_app_spec.js
spec/javascripts/jobs/components/job_app_spec.js
+34
-0
No files found.
app/assets/javascripts/jobs/components/job_app.vue
View file @
426ac043
...
...
@@ -3,12 +3,14 @@ import _ from 'underscore';
import
{
mapGetters
,
mapState
,
mapActions
}
from
'
vuex
'
;
import
{
GlLoadingIcon
}
from
'
@gitlab-org/gitlab-ui
'
;
import
{
isScrolledToBottom
}
from
'
~/lib/utils/scroll_utils
'
;
import
{
polyfillSticky
}
from
'
~/lib/utils/sticky
'
;
import
bp
from
'
~/breakpoints
'
;
import
CiHeader
from
'
~/vue_shared/components/header_ci_component.vue
'
;
import
Callout
from
'
~/vue_shared/components/callout.vue
'
;
// ee-only start
import
SharedRunner
from
'
ee/jobs/components/shared_runner_limit_block.vue
'
;
// ee-only end
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
import
createStore
from
'
../store
'
;
import
EmptyState
from
'
./empty_state.vue
'
;
import
EnvironmentsBlock
from
'
./environments_block.vue
'
;
...
...
@@ -28,6 +30,7 @@ export default {
EnvironmentsBlock
,
ErasedBlock
,
GlLoadingIcon
,
Icon
,
Log
,
LogTopBar
,
StuckBlock
,
...
...
@@ -102,6 +105,14 @@ export default {
if
(
_
.
isEmpty
(
oldVal
)
&&
!
_
.
isEmpty
(
newVal
.
pipeline
))
{
this
.
fetchStages
();
}
if
(
newVal
.
archived
)
{
this
.
$nextTick
(()
=>
{
if
(
this
.
$refs
.
sticky
)
{
polyfillSticky
(
this
.
$refs
.
sticky
);
}
});
}
},
},
created
()
{
...
...
@@ -119,16 +130,13 @@ export default {
window
.
addEventListener
(
'
resize
'
,
this
.
onResize
);
window
.
addEventListener
(
'
scroll
'
,
this
.
updateScroll
);
},
mounted
()
{
this
.
updateSidebar
();
},
destroyed
()
{
window
.
removeEventListener
(
'
resize
'
,
this
.
onResize
);
window
.
removeEventListener
(
'
scroll
'
,
this
.
updateScroll
);
},
methods
:
{
...
mapActions
([
'
setJobEndpoint
'
,
...
...
@@ -231,14 +239,28 @@ export default {
:erased-at=
"job.erased_at"
/>
<div
v-if=
"job.archived"
ref=
"sticky"
class=
"js-archived-job prepend-top-default archived-sticky sticky-top"
>
<icon
name=
"lock"
class=
"align-text-bottom"
/>
{{
__
(
'
This job is archived. Only the complete pipeline can be retried.
'
)
}}
</div>
<!--job log -->
<div
v-if=
"hasTrace"
class=
"build-trace-container prepend-top-default"
>
class=
"build-trace-container"
>
<log-top-bar
:class=
"
{
'sidebar-expanded': isSidebarOpen,
'sidebar-collapsed': !isSidebarOpen
'sidebar-collapsed': !isSidebarOpen,
'has-archived-block': job.archived
}"
:erase-path="job.erase_path"
:size="traceSize"
...
...
app/assets/javascripts/jobs/components/job_log_controllers.vue
View file @
426ac043
...
...
@@ -69,7 +69,7 @@ export default {
};
</
script
>
<
template
>
<div
class=
"top-bar
affix
"
>
<div
class=
"top-bar"
>
<!-- truncate information -->
<div
class=
"js-truncated-info truncated-info d-none d-sm-block float-left"
>
<template
v-if=
"isTraceSizeVisible"
>
...
...
app/assets/stylesheets/pages/builds.scss
View file @
426ac043
...
...
@@ -54,9 +54,52 @@
@include
build-trace
();
}
.archived-sticky
{
top
:
$header-height
;
border-radius
:
2px
2px
0
0
;
color
:
$orange-600
;
background-color
:
$orange-100
;
border
:
1px
solid
$border-gray-normal
;
border-bottom
:
0
;
padding
:
3px
12px
;
margin
:
auto
;
align-items
:
center
;
.with-performance-bar
&
{
top
:
$header-height
+
$performance-bar-height
;
}
}
.top-bar
{
@include
build-trace-top-bar
(
35px
);
&
.has-archived-block
{
top
:
$header-height
+
$performance-bar-height
+
28px
;
}
&
.affix
{
top
:
$header-height
;
// with sidebar
&
.sidebar-expanded
{
right
:
306px
;
left
:
16px
;
}
// without sidebar
&
.sidebar-collapsed
{
right
:
16px
;
left
:
16px
;
}
}
&
.affix-top
{
position
:
absolute
;
right
:
0
;
left
:
0
;
top
:
0
;
}
.truncated-info
{
.truncated-info-size
{
margin
:
0
5px
;
...
...
changelogs/unreleased/53535-sticky-archived.yml
0 → 100644
View file @
426ac043
---
title
:
Renders warning info when job is archieved
merge_request
:
author
:
type
:
added
locale/gitlab.pot
View file @
426ac043
...
...
@@ -8031,6 +8031,9 @@ msgstr ""
msgid "This job is an out-of-date deployment to %{environmentLink}. View the most recent deployment %{deploymentLink}."
msgstr ""
msgid "This job is archived. Only the complete pipeline can be retried."
msgstr ""
msgid "This job is creating a deployment to %{environmentLink} and will overwrite the %{deploymentLink}."
msgstr ""
...
...
spec/javascripts/jobs/components/job_app_spec.js
View file @
426ac043
...
...
@@ -423,6 +423,40 @@ describe('Job App ', () => {
});
});
describe
(
'
archived job
'
,
()
=>
{
beforeEach
(()
=>
{
mock
.
onGet
(
props
.
endpoint
).
reply
(
200
,
Object
.
assign
({},
job
,
{
archived
:
true
}),
{});
vm
=
mountComponentWithStore
(
Component
,
{
props
,
store
,
});
});
it
(
'
renders warning about job being archived
'
,
done
=>
{
setTimeout
(()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.js-archived-job
'
)).
not
.
toBeNull
();
done
();
},
0
);
});
});
describe
(
'
non-archived job
'
,
()
=>
{
beforeEach
(()
=>
{
mock
.
onGet
(
props
.
endpoint
).
reply
(
200
,
job
,
{});
vm
=
mountComponentWithStore
(
Component
,
{
props
,
store
,
});
});
it
(
'
does not warning about job being archived
'
,
done
=>
{
setTimeout
(()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.js-archived-job
'
)).
toBeNull
();
done
();
},
0
);
});
});
describe
(
'
trace output
'
,
()
=>
{
beforeEach
(()
=>
{
mock
.
onGet
(
props
.
endpoint
).
reply
(
200
,
job
,
{});
...
...
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