Skip to content

Commit cdfc237

Browse files
committed
Merge branch 'revert-62d8b906' into 'master'
Revert "Merge branch 'winh-prettier-job-app' into 'master'" See merge request gitlab-org/gitlab-ce!22489
2 parents c45de88 + 0271934 commit cdfc237

File tree

1 file changed

+145
-145
lines changed

1 file changed

+145
-145
lines changed

app/assets/javascripts/jobs/components/job_app.vue

+145-145
Original file line numberDiff line numberDiff line change
@@ -1,164 +1,164 @@
11
<script>
2-
import _ from 'underscore';
3-
import { mapGetters, mapState, mapActions } from 'vuex';
4-
import { isScrolledToBottom } from '~/lib/utils/scroll_utils';
5-
import bp from '~/breakpoints';
6-
import CiHeader from '~/vue_shared/components/header_ci_component.vue';
7-
import Callout from '~/vue_shared/components/callout.vue';
8-
import createStore from '../store';
9-
import EmptyState from './empty_state.vue';
10-
import EnvironmentsBlock from './environments_block.vue';
11-
import ErasedBlock from './erased_block.vue';
12-
import Log from './job_log.vue';
13-
import LogTopBar from './job_log_controllers.vue';
14-
import StuckBlock from './stuck_block.vue';
15-
import Sidebar from './sidebar.vue';
2+
import _ from 'underscore';
3+
import { mapGetters, mapState, mapActions } from 'vuex';
4+
import { isScrolledToBottom } from '~/lib/utils/scroll_utils';
5+
import bp from '~/breakpoints';
6+
import CiHeader from '~/vue_shared/components/header_ci_component.vue';
7+
import Callout from '~/vue_shared/components/callout.vue';
8+
import createStore from '../store';
9+
import EmptyState from './empty_state.vue';
10+
import EnvironmentsBlock from './environments_block.vue';
11+
import ErasedBlock from './erased_block.vue';
12+
import Log from './job_log.vue';
13+
import LogTopBar from './job_log_controllers.vue';
14+
import StuckBlock from './stuck_block.vue';
15+
import Sidebar from './sidebar.vue';
1616
17-
export default {
18-
name: 'JobPageApp',
19-
store: createStore(),
20-
components: {
21-
CiHeader,
22-
Callout,
23-
EmptyState,
24-
EnvironmentsBlock,
25-
ErasedBlock,
26-
Log,
27-
LogTopBar,
28-
StuckBlock,
29-
Sidebar,
30-
},
31-
props: {
32-
runnerSettingsUrl: {
33-
type: String,
34-
required: false,
35-
default: null,
17+
export default {
18+
name: 'JobPageApp',
19+
store: createStore(),
20+
components: {
21+
CiHeader,
22+
Callout,
23+
EmptyState,
24+
EnvironmentsBlock,
25+
ErasedBlock,
26+
Log,
27+
LogTopBar,
28+
StuckBlock,
29+
Sidebar,
3630
},
37-
runnerHelpUrl: {
38-
type: String,
39-
required: false,
40-
default: null,
31+
props: {
32+
runnerSettingsUrl: {
33+
type: String,
34+
required: false,
35+
default: null,
36+
},
37+
runnerHelpUrl: {
38+
type: String,
39+
required: false,
40+
default: null,
41+
},
42+
endpoint: {
43+
type: String,
44+
required: true,
45+
},
46+
terminalPath: {
47+
type: String,
48+
required: false,
49+
default: null,
50+
},
51+
pagePath: {
52+
type: String,
53+
required: true,
54+
},
55+
logState: {
56+
type: String,
57+
required: true,
58+
},
4159
},
42-
endpoint: {
43-
type: String,
44-
required: true,
45-
},
46-
terminalPath: {
47-
type: String,
48-
required: false,
49-
default: null,
50-
},
51-
pagePath: {
52-
type: String,
53-
required: true,
54-
},
55-
logState: {
56-
type: String,
57-
required: true,
58-
},
59-
},
60-
computed: {
61-
...mapState([
62-
'isLoading',
63-
'job',
64-
'isSidebarOpen',
65-
'trace',
66-
'isTraceComplete',
67-
'traceSize',
68-
'isTraceSizeVisible',
69-
'isScrollBottomDisabled',
70-
'isScrollTopDisabled',
71-
'isScrolledToBottomBeforeReceivingTrace',
72-
'hasError',
73-
]),
74-
...mapGetters([
75-
'headerActions',
76-
'headerTime',
77-
'shouldRenderCalloutMessage',
78-
'shouldRenderTriggeredLabel',
79-
'hasEnvironment',
80-
'isJobStuck',
81-
'hasTrace',
82-
'emptyStateIllustration',
83-
'isScrollingDown',
84-
'emptyStateAction',
85-
]),
60+
computed: {
61+
...mapState([
62+
'isLoading',
63+
'job',
64+
'isSidebarOpen',
65+
'trace',
66+
'isTraceComplete',
67+
'traceSize',
68+
'isTraceSizeVisible',
69+
'isScrollBottomDisabled',
70+
'isScrollTopDisabled',
71+
'isScrolledToBottomBeforeReceivingTrace',
72+
'hasError',
73+
]),
74+
...mapGetters([
75+
'headerActions',
76+
'headerTime',
77+
'shouldRenderCalloutMessage',
78+
'shouldRenderTriggeredLabel',
79+
'hasEnvironment',
80+
'isJobStuck',
81+
'hasTrace',
82+
'emptyStateIllustration',
83+
'isScrollingDown',
84+
'emptyStateAction',
85+
]),
8686
87-
shouldRenderContent() {
88-
return !this.isLoading && !this.hasError;
89-
},
90-
},
91-
watch: {
92-
// Once the job log is loaded,
93-
// fetch the stages for the dropdown on the sidebar
94-
job(newVal, oldVal) {
95-
if (_.isEmpty(oldVal) && !_.isEmpty(newVal.pipeline)) {
96-
this.fetchStages();
87+
shouldRenderContent() {
88+
return !this.isLoading && !this.hasError;
9789
}
9890
},
99-
},
100-
created() {
101-
this.throttled = _.throttle(this.toggleScrollButtons, 100);
102-
103-
this.setJobEndpoint(this.endpoint);
104-
this.setTraceOptions({
105-
logState: this.logState,
106-
pagePath: this.pagePath,
107-
});
108-
109-
this.fetchJob();
110-
this.fetchTrace();
91+
watch: {
92+
// Once the job log is loaded,
93+
// fetch the stages for the dropdown on the sidebar
94+
job(newVal, oldVal) {
95+
if (_.isEmpty(oldVal) && !_.isEmpty(newVal.pipeline)) {
96+
this.fetchStages();
97+
}
98+
},
99+
},
100+
created() {
101+
this.throttled = _.throttle(this.toggleScrollButtons, 100);
111102
112-
window.addEventListener('resize', this.onResize);
113-
window.addEventListener('scroll', this.updateScroll);
114-
},
103+
this.setJobEndpoint(this.endpoint);
104+
this.setTraceOptions({
105+
logState: this.logState,
106+
pagePath: this.pagePath,
107+
});
115108
116-
mounted() {
117-
this.updateSidebar();
118-
},
109+
this.fetchJob();
110+
this.fetchTrace();
119111
120-
destroyed() {
121-
window.removeEventListener('resize', this.onResize);
122-
window.removeEventListener('scroll', this.updateScroll);
123-
},
112+
window.addEventListener('resize', this.onResize);
113+
window.addEventListener('scroll', this.updateScroll);
114+
},
124115
125-
methods: {
126-
...mapActions([
127-
'setJobEndpoint',
128-
'setTraceOptions',
129-
'fetchJob',
130-
'fetchStages',
131-
'hideSidebar',
132-
'showSidebar',
133-
'toggleSidebar',
134-
'fetchTrace',
135-
'scrollBottom',
136-
'scrollTop',
137-
'toggleScrollButtons',
138-
'toggleScrollAnimation',
139-
]),
140-
onResize() {
116+
mounted() {
141117
this.updateSidebar();
142-
this.updateScroll();
143118
},
144-
updateSidebar() {
145-
if (bp.getBreakpointSize() === 'xs') {
146-
this.hideSidebar();
147-
} else if (!this.isSidebarOpen) {
148-
this.showSidebar();
149-
}
119+
120+
destroyed() {
121+
window.removeEventListener('resize', this.onResize);
122+
window.removeEventListener('scroll', this.updateScroll);
150123
},
151-
updateScroll() {
152-
if (!isScrolledToBottom()) {
153-
this.toggleScrollAnimation(false);
154-
} else if (this.isScrollingDown) {
155-
this.toggleScrollAnimation(true);
156-
}
157124
158-
this.throttled();
125+
methods: {
126+
...mapActions([
127+
'setJobEndpoint',
128+
'setTraceOptions',
129+
'fetchJob',
130+
'fetchStages',
131+
'hideSidebar',
132+
'showSidebar',
133+
'toggleSidebar',
134+
'fetchTrace',
135+
'scrollBottom',
136+
'scrollTop',
137+
'toggleScrollButtons',
138+
'toggleScrollAnimation',
139+
]),
140+
onResize() {
141+
this.updateSidebar();
142+
this.updateScroll();
143+
},
144+
updateSidebar() {
145+
if (bp.getBreakpointSize() === 'xs') {
146+
this.hideSidebar();
147+
} else if (!this.isSidebarOpen) {
148+
this.showSidebar();
149+
}
150+
},
151+
updateScroll() {
152+
if (!isScrolledToBottom()) {
153+
this.toggleScrollAnimation(false);
154+
} else if (this.isScrollingDown) {
155+
this.toggleScrollAnimation(true);
156+
}
157+
158+
this.throttled();
159+
},
159160
},
160-
},
161-
};
161+
};
162162
</script>
163163
<template>
164164
<div>

0 commit comments

Comments
 (0)