diff options
author | Phil Hughes <me@iamphill.com> | 2018-10-19 11:13:17 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-10-19 11:13:17 +0000 |
commit | cdfc2378e5e30ac87479ef839dbc20f3bdaf1af0 (patch) | |
tree | b9cca5eb84bce3cf4863aec9b008f4c4c5938430 | |
parent | c45de884be8a1517ef0daa6c02339e7ec992f1ad (diff) | |
parent | 02719344cc0482c2ca15bfaa7388ed2be6fdf979 (diff) | |
download | gitlab-ce-cdfc2378e5e30ac87479ef839dbc20f3bdaf1af0.tar.gz |
Merge branch 'revert-62d8b906' into 'master'
Revert "Merge branch 'winh-prettier-job-app' into 'master'"
See merge request gitlab-org/gitlab-ce!22489
-rw-r--r-- | app/assets/javascripts/jobs/components/job_app.vue | 290 |
1 files changed, 145 insertions, 145 deletions
diff --git a/app/assets/javascripts/jobs/components/job_app.vue b/app/assets/javascripts/jobs/components/job_app.vue index 355eadb512f..ba14aaeed2c 100644 --- a/app/assets/javascripts/jobs/components/job_app.vue +++ b/app/assets/javascripts/jobs/components/job_app.vue @@ -1,164 +1,164 @@ <script> -import _ from 'underscore'; -import { mapGetters, mapState, mapActions } from 'vuex'; -import { isScrolledToBottom } from '~/lib/utils/scroll_utils'; -import bp from '~/breakpoints'; -import CiHeader from '~/vue_shared/components/header_ci_component.vue'; -import Callout from '~/vue_shared/components/callout.vue'; -import createStore from '../store'; -import EmptyState from './empty_state.vue'; -import EnvironmentsBlock from './environments_block.vue'; -import ErasedBlock from './erased_block.vue'; -import Log from './job_log.vue'; -import LogTopBar from './job_log_controllers.vue'; -import StuckBlock from './stuck_block.vue'; -import Sidebar from './sidebar.vue'; + import _ from 'underscore'; + import { mapGetters, mapState, mapActions } from 'vuex'; + import { isScrolledToBottom } from '~/lib/utils/scroll_utils'; + import bp from '~/breakpoints'; + import CiHeader from '~/vue_shared/components/header_ci_component.vue'; + import Callout from '~/vue_shared/components/callout.vue'; + import createStore from '../store'; + import EmptyState from './empty_state.vue'; + import EnvironmentsBlock from './environments_block.vue'; + import ErasedBlock from './erased_block.vue'; + import Log from './job_log.vue'; + import LogTopBar from './job_log_controllers.vue'; + import StuckBlock from './stuck_block.vue'; + import Sidebar from './sidebar.vue'; -export default { - name: 'JobPageApp', - store: createStore(), - components: { - CiHeader, - Callout, - EmptyState, - EnvironmentsBlock, - ErasedBlock, - Log, - LogTopBar, - StuckBlock, - Sidebar, - }, - props: { - runnerSettingsUrl: { - type: String, - required: false, - default: null, + export default { + name: 'JobPageApp', + store: createStore(), + components: { + CiHeader, + Callout, + EmptyState, + EnvironmentsBlock, + ErasedBlock, + Log, + LogTopBar, + StuckBlock, + Sidebar, }, - runnerHelpUrl: { - type: String, - required: false, - default: null, + props: { + runnerSettingsUrl: { + type: String, + required: false, + default: null, + }, + runnerHelpUrl: { + type: String, + required: false, + default: null, + }, + endpoint: { + type: String, + required: true, + }, + terminalPath: { + type: String, + required: false, + default: null, + }, + pagePath: { + type: String, + required: true, + }, + logState: { + type: String, + required: true, + }, }, - endpoint: { - type: String, - required: true, - }, - terminalPath: { - type: String, - required: false, - default: null, - }, - pagePath: { - type: String, - required: true, - }, - logState: { - type: String, - required: true, - }, - }, - computed: { - ...mapState([ - 'isLoading', - 'job', - 'isSidebarOpen', - 'trace', - 'isTraceComplete', - 'traceSize', - 'isTraceSizeVisible', - 'isScrollBottomDisabled', - 'isScrollTopDisabled', - 'isScrolledToBottomBeforeReceivingTrace', - 'hasError', - ]), - ...mapGetters([ - 'headerActions', - 'headerTime', - 'shouldRenderCalloutMessage', - 'shouldRenderTriggeredLabel', - 'hasEnvironment', - 'isJobStuck', - 'hasTrace', - 'emptyStateIllustration', - 'isScrollingDown', - 'emptyStateAction', - ]), + computed: { + ...mapState([ + 'isLoading', + 'job', + 'isSidebarOpen', + 'trace', + 'isTraceComplete', + 'traceSize', + 'isTraceSizeVisible', + 'isScrollBottomDisabled', + 'isScrollTopDisabled', + 'isScrolledToBottomBeforeReceivingTrace', + 'hasError', + ]), + ...mapGetters([ + 'headerActions', + 'headerTime', + 'shouldRenderCalloutMessage', + 'shouldRenderTriggeredLabel', + 'hasEnvironment', + 'isJobStuck', + 'hasTrace', + 'emptyStateIllustration', + 'isScrollingDown', + 'emptyStateAction', + ]), - shouldRenderContent() { - return !this.isLoading && !this.hasError; - }, - }, - watch: { - // Once the job log is loaded, - // fetch the stages for the dropdown on the sidebar - job(newVal, oldVal) { - if (_.isEmpty(oldVal) && !_.isEmpty(newVal.pipeline)) { - this.fetchStages(); + shouldRenderContent() { + return !this.isLoading && !this.hasError; } }, - }, - created() { - this.throttled = _.throttle(this.toggleScrollButtons, 100); - - this.setJobEndpoint(this.endpoint); - this.setTraceOptions({ - logState: this.logState, - pagePath: this.pagePath, - }); - - this.fetchJob(); - this.fetchTrace(); + watch: { + // Once the job log is loaded, + // fetch the stages for the dropdown on the sidebar + job(newVal, oldVal) { + if (_.isEmpty(oldVal) && !_.isEmpty(newVal.pipeline)) { + this.fetchStages(); + } + }, + }, + created() { + this.throttled = _.throttle(this.toggleScrollButtons, 100); - window.addEventListener('resize', this.onResize); - window.addEventListener('scroll', this.updateScroll); - }, + this.setJobEndpoint(this.endpoint); + this.setTraceOptions({ + logState: this.logState, + pagePath: this.pagePath, + }); - mounted() { - this.updateSidebar(); - }, + this.fetchJob(); + this.fetchTrace(); - destroyed() { - window.removeEventListener('resize', this.onResize); - window.removeEventListener('scroll', this.updateScroll); - }, + window.addEventListener('resize', this.onResize); + window.addEventListener('scroll', this.updateScroll); + }, - methods: { - ...mapActions([ - 'setJobEndpoint', - 'setTraceOptions', - 'fetchJob', - 'fetchStages', - 'hideSidebar', - 'showSidebar', - 'toggleSidebar', - 'fetchTrace', - 'scrollBottom', - 'scrollTop', - 'toggleScrollButtons', - 'toggleScrollAnimation', - ]), - onResize() { + mounted() { this.updateSidebar(); - this.updateScroll(); }, - updateSidebar() { - if (bp.getBreakpointSize() === 'xs') { - this.hideSidebar(); - } else if (!this.isSidebarOpen) { - this.showSidebar(); - } + + destroyed() { + window.removeEventListener('resize', this.onResize); + window.removeEventListener('scroll', this.updateScroll); }, - updateScroll() { - if (!isScrolledToBottom()) { - this.toggleScrollAnimation(false); - } else if (this.isScrollingDown) { - this.toggleScrollAnimation(true); - } - this.throttled(); + methods: { + ...mapActions([ + 'setJobEndpoint', + 'setTraceOptions', + 'fetchJob', + 'fetchStages', + 'hideSidebar', + 'showSidebar', + 'toggleSidebar', + 'fetchTrace', + 'scrollBottom', + 'scrollTop', + 'toggleScrollButtons', + 'toggleScrollAnimation', + ]), + onResize() { + this.updateSidebar(); + this.updateScroll(); + }, + updateSidebar() { + if (bp.getBreakpointSize() === 'xs') { + this.hideSidebar(); + } else if (!this.isSidebarOpen) { + this.showSidebar(); + } + }, + updateScroll() { + if (!isScrolledToBottom()) { + this.toggleScrollAnimation(false); + } else if (this.isScrollingDown) { + this.toggleScrollAnimation(true); + } + + this.throttled(); + }, }, - }, -}; + }; </script> <template> <div> |