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
0db03666
Commit
0db03666
authored
Oct 18, 2018
by
Winnie Hellmann
Committed by
Clement Ho
Oct 18, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make app/assets/javascripts/jobs/components/job_app.vue prettier (EE-port)
parent
04e60018
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
150 additions
and
150 deletions
+150
-150
app/assets/javascripts/jobs/components/job_app.vue
app/assets/javascripts/jobs/components/job_app.vue
+150
-150
No files found.
app/assets/javascripts/jobs/components/job_app.vue
View file @
0db03666
<
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
'
;
// ee-only start
import
SharedRunner
from
'
ee/jobs/components/shared_runner_limit_block.vue
'
;
// ee-only end
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
'
;
// ee-only start
import
SharedRunner
from
'
ee/jobs/components/shared_runner_limit_block.vue
'
;
// ee-only end
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
,
SharedRunner
,
Sidebar
,
export
default
{
name
:
'
JobPageApp
'
,
store
:
createStore
(),
components
:
{
CiHeader
,
Callout
,
EmptyState
,
EnvironmentsBlock
,
ErasedBlock
,
Log
,
LogTopBar
,
StuckBlock
,
SharedRunner
,
Sidebar
,
},
props
:
{
runnerSettingsUrl
:
{
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
,
},
runnerHelpUrl
:
{
type
:
String
,
required
:
false
,
default
:
null
,
},
computed
:
{
...
mapState
([
'
isLoading
'
,
'
job
'
,
'
isSidebarOpen
'
,
'
trace
'
,
'
isTraceComplete
'
,
'
traceSize
'
,
'
isTraceSizeVisible
'
,
'
isScrollBottomDisabled
'
,
'
isScrollTopDisabled
'
,
'
isScrolledToBottomBeforeReceivingTrace
'
,
'
hasError
'
,
]),
...
mapGetters
([
'
headerActions
'
,
'
headerTime
'
,
'
shouldRenderCalloutMessage
'
,
'
shouldRenderTriggeredLabel
'
,
'
hasEnvironment
'
,
'
isJobStuck
'
,
'
shouldRenderSharedRunnerLimitWarning
'
,
'
hasTrace
'
,
'
emptyStateIllustration
'
,
'
isScrollingDown
'
,
'
emptyStateAction
'
,
]),
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
'
,
'
shouldRenderSharedRunnerLimitWarning
'
,
'
hasTrace
'
,
'
emptyStateIllustration
'
,
'
isScrollingDown
'
,
'
emptyStateAction
'
,
]),
shouldRenderContent
()
{
return
!
this
.
isLoading
&&
!
this
.
hasError
;
}
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
();
}
}
,
},
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
);
},
created
()
{
this
.
throttled
=
_
.
throttle
(
this
.
toggleScrollButtons
,
100
);
this
.
setJobEndpoint
(
this
.
endpoint
);
this
.
setTraceOptions
({
logState
:
this
.
logState
,
pagePath
:
this
.
pagePath
,
});
this
.
setJobEndpoint
(
this
.
endpoint
);
this
.
setTraceOptions
({
logState
:
this
.
logState
,
pagePath
:
this
.
pagePath
,
});
this
.
fetchJob
();
this
.
fetchTrace
();
this
.
fetchJob
();
this
.
fetchTrace
();
window
.
addEventListener
(
'
resize
'
,
this
.
onResize
);
window
.
addEventListener
(
'
scroll
'
,
this
.
updateScroll
);
},
window
.
addEventListener
(
'
resize
'
,
this
.
onResize
);
window
.
addEventListener
(
'
scroll
'
,
this
.
updateScroll
);
},
mounted
()
{
mounted
()
{
this
.
updateSidebar
();
},
destroyed
()
{
window
.
removeEventListener
(
'
resize
'
,
this
.
onResize
);
window
.
removeEventListener
(
'
scroll
'
,
this
.
updateScroll
);
},
methods
:
{
...
mapActions
([
'
setJobEndpoint
'
,
'
setTraceOptions
'
,
'
fetchJob
'
,
'
fetchStages
'
,
'
hideSidebar
'
,
'
showSidebar
'
,
'
toggleSidebar
'
,
'
fetchTrace
'
,
'
scrollBottom
'
,
'
scrollTop
'
,
'
toggleScrollButtons
'
,
'
toggleScrollAnimation
'
,
]),
onResize
()
{
this
.
updateSidebar
();
this
.
updateScroll
();
},
destroyed
()
{
window
.
removeEventListener
(
'
resize
'
,
this
.
onResize
);
window
.
removeEventListener
(
'
scroll
'
,
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
);
}
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
();
},
this
.
throttled
();
},
};
},
};
</
script
>
<
template
>
<div>
...
...
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