diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2019-03-07 12:50:36 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2019-03-07 12:50:36 +0300 |
commit | be70cb79123ab49759e9c05ee3abc430748a8dea (patch) | |
tree | c705f55f01428e74b046b1bf0c3d79972a294523 /app/assets | |
parent | ca402c1aef1d0bce81eed57b5c4ea27a9e2afba8 (diff) |
Moves shared quota getter into CE
In jobs store, moves the check for
`shouldRenderSharedRunnerLimitWarning` to the CE
codebase.
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/jobs/components/job_app.vue | 10 | ||||
-rw-r--r-- | app/assets/javascripts/jobs/store/getters.js | 11 |
2 files changed, 21 insertions, 0 deletions
diff --git a/app/assets/javascripts/jobs/components/job_app.vue b/app/assets/javascripts/jobs/components/job_app.vue index d473d6a482d..dbadd224251 100644 --- a/app/assets/javascripts/jobs/components/job_app.vue +++ b/app/assets/javascripts/jobs/components/job_app.vue @@ -34,6 +34,7 @@ export default { StuckBlock, Sidebar, GlLoadingIcon, + SharedRunner: () => import('ee_component/jobs/components/shared_runner_limit_block.vue'), }, mixins: [delayedJobMixin], props: { @@ -84,6 +85,7 @@ export default { 'shouldRenderCalloutMessage', 'shouldRenderTriggeredLabel', 'hasEnvironment', + 'shouldRenderSharedRunnerLimitWarning', 'hasTrace', 'emptyStateIllustration', 'isScrollingDown', @@ -221,6 +223,14 @@ export default { :runners-path="runnerSettingsUrl" /> + <shared-runner + v-if="shouldRenderSharedRunnerLimitWarning" + class="js-shared-runner-limit" + :quota-used="job.runners.quota.used" + :quota-limit="job.runners.quota.limit" + :runners-path="runnerHelpUrl" + /> + <environments-block v-if="hasEnvironment" class="js-job-environment" diff --git a/app/assets/javascripts/jobs/store/getters.js b/app/assets/javascripts/jobs/store/getters.js index 98911717381..73c1cbc3a99 100644 --- a/app/assets/javascripts/jobs/store/getters.js +++ b/app/assets/javascripts/jobs/store/getters.js @@ -28,6 +28,17 @@ export const emptyStateIllustration = state => export const emptyStateAction = state => (state.job && state.job.status && state.job.status.action) || null; +/** + * Shared runners limit is only rendered when + * used quota is bigger or equal than the limit + * + * @returns {Boolean} + */ +export const shouldRenderSharedRunnerLimitWarning = state => + !_.isEmpty(state.job.runners) && + !_.isEmpty(state.job.runners.quota) && + state.job.runners.quota.used >= state.job.runners.quota.limit; + export const isScrollingDown = state => isScrolledToBottom() && !state.isTraceComplete; export const hasRunnersForProject = state => |