diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-02 00:09:29 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-02 00:09:29 +0300 |
commit | 1f96548c39f3f9b03d1b2156e7cb707e748193d8 (patch) | |
tree | 119c750ef16ffcf90f82f0a62931de193ccc8699 /app/assets/javascripts/pipelines | |
parent | 102255f6d4209b9ee54c6f36d9391aae0a4b0dfb (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/pipelines')
3 files changed, 78 insertions, 3 deletions
diff --git a/app/assets/javascripts/pipelines/components/graph/job_group_dropdown.vue b/app/assets/javascripts/pipelines/components/graph/job_group_dropdown.vue index 38d48517bd6..258633e0125 100644 --- a/app/assets/javascripts/pipelines/components/graph/job_group_dropdown.vue +++ b/app/assets/javascripts/pipelines/components/graph/job_group_dropdown.vue @@ -47,7 +47,7 @@ export default { class="dropdown-menu-toggle build-content gl-build-content" > <div class="gl-display-flex gl-align-items-center gl-justify-content-space-between"> - <span class="gl-display-flex gl-align-items-center"> + <span class="gl-display-flex gl-align-items-center gl-w-90"> <ci-icon :status="group.status" :size="24" /> <span class="gl-text-truncate mw-70p gl-pl-3 gl-display-inline-block"> diff --git a/app/assets/javascripts/pipelines/components/pipelines_list/pipelines.vue b/app/assets/javascripts/pipelines/components/pipelines_list/pipelines.vue index 9ee427d01fd..ff27226b408 100644 --- a/app/assets/javascripts/pipelines/components/pipelines_list/pipelines.vue +++ b/app/assets/javascripts/pipelines/components/pipelines_list/pipelines.vue @@ -62,7 +62,7 @@ export default { type: String, required: true, }, - autoDevopsPath: { + autoDevopsHelpPath: { type: String, required: true, }, @@ -342,7 +342,7 @@ export default { :pipelines="state.pipelines" :pipeline-schedule-url="pipelineScheduleUrl" :update-graph-dropdown="updateGraphDropdown" - :auto-devops-help-path="autoDevopsPath" + :auto-devops-help-path="autoDevopsHelpPath" :view-type="viewType" /> </div> diff --git a/app/assets/javascripts/pipelines/pipelines_index.js b/app/assets/javascripts/pipelines/pipelines_index.js new file mode 100644 index 00000000000..4575a99f60f --- /dev/null +++ b/app/assets/javascripts/pipelines/pipelines_index.js @@ -0,0 +1,75 @@ +import Vue from 'vue'; +import { GlToast } from '@gitlab/ui'; +import { __ } from '~/locale'; +import { doesHashExistInUrl } from '~/lib/utils/url_utility'; +import { + parseBoolean, + historyReplaceState, + buildUrlWithCurrentLocation, +} from '~/lib/utils/common_utils'; +import Translate from '~/vue_shared/translate'; +import Pipelines from './components/pipelines_list/pipelines.vue'; +import PipelinesStore from './stores/pipelines_store'; + +Vue.use(Translate); +Vue.use(GlToast); + +export const initPipelinesIndex = (selector = '#pipelines-list-vue') => { + const el = document.querySelector(selector); + if (!el) { + return null; + } + + const { + endpoint, + pipelineScheduleUrl, + helpPagePath, + emptyStateSvgPath, + errorStateSvgPath, + noPipelinesSvgPath, + autoDevopsHelpPath, + newPipelinePath, + canCreatePipeline, + hasGitlabCi, + ciLintPath, + resetCachePath, + projectId, + params, + } = el.dataset; + + return new Vue({ + el, + data() { + return { + store: new PipelinesStore(), + }; + }, + created() { + if (doesHashExistInUrl('delete_success')) { + this.$toast.show(__('The pipeline has been deleted')); + historyReplaceState(buildUrlWithCurrentLocation()); + } + }, + render(createElement) { + return createElement(Pipelines, { + props: { + store: this.store, + endpoint, + pipelineScheduleUrl, + helpPagePath, + emptyStateSvgPath, + errorStateSvgPath, + noPipelinesSvgPath, + autoDevopsHelpPath, + newPipelinePath, + canCreatePipeline: parseBoolean(canCreatePipeline), + hasGitlabCi: parseBoolean(hasGitlabCi), + ciLintPath, + resetCachePath, + projectId, + params: JSON.parse(params), + }, + }); + }, + }); +}; |