diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-25 09:10:52 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-25 09:10:52 +0000 |
commit | 326b4d3216d107b40142ee847c06f2c41a1ef220 (patch) | |
tree | f5190e9c606a92c0ed4ce606a52b49366055065e /app/assets/javascripts | |
parent | 92e4789eb069d5fe43025601c6b7839fddda3ad1 (diff) | |
download | gitlab-ce-326b4d3216d107b40142ee847c06f2c41a1ef220.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts')
8 files changed, 79 insertions, 9 deletions
diff --git a/app/assets/javascripts/incidents/list.js b/app/assets/javascripts/incidents/list.js index 8644ff3a249..6e6461cd7a9 100644 --- a/app/assets/javascripts/incidents/list.js +++ b/app/assets/javascripts/incidents/list.js @@ -24,7 +24,7 @@ export default () => { } = domEl.dataset; const apolloProvider = new VueApollo({ - defaultClient: createDefaultClient(), + defaultClient: createDefaultClient({}, { assumeImmutableResults: true }), }); return new Vue({ diff --git a/app/assets/javascripts/issue_show/components/app.vue b/app/assets/javascripts/issue_show/components/app.vue index b7e24a8b17e..2c9a512acdb 100644 --- a/app/assets/javascripts/issue_show/components/app.vue +++ b/app/assets/javascripts/issue_show/components/app.vue @@ -1,5 +1,5 @@ <script> -import { GlIcon, GlIntersectionObserver } from '@gitlab/ui'; +import { GlIcon, GlIntersectionObserver, GlTooltipDirective } from '@gitlab/ui'; import Visibility from 'visibilityjs'; import createFlash from '~/flash'; import Poll from '~/lib/utils/poll'; @@ -32,6 +32,9 @@ export default { formComponent, PinnedLinks, }, + directives: { + GlTooltip: GlTooltipDirective, + }, props: { endpoint: { required: true, @@ -183,6 +186,11 @@ export default { required: false, default: true, }, + isHidden: { + type: Boolean, + required: false, + default: false, + }, }, data() { const store = new Store({ @@ -508,6 +516,15 @@ export default { <span v-if="isConfidential" data-testid="confidential" class="issuable-warning-icon"> <gl-icon name="eye-slash" :aria-label="__('Confidential')" /> </span> + <span + v-if="isHidden" + v-gl-tooltip + :title="__('This issue is hidden because its author has been banned')" + data-testid="hidden" + class="issuable-warning-icon" + > + <gl-icon name="spam" /> + </span> <p class="gl-font-weight-bold gl-overflow-hidden gl-white-space-nowrap gl-text-overflow-ellipsis gl-my-0" :title="state.titleText" diff --git a/app/assets/javascripts/runner/components/runner_update_form.vue b/app/assets/javascripts/runner/components/runner_update_form.vue index a5bc1680852..9a6fc07f6dd 100644 --- a/app/assets/javascripts/runner/components/runner_update_form.vue +++ b/app/assets/javascripts/runner/components/runner_update_form.vue @@ -135,9 +135,9 @@ export default { </gl-form-checkbox> <gl-form-checkbox + v-if="canBeLockedToProject" v-model="model.locked" data-testid="runner-field-locked" - :disabled="!canBeLockedToProject" > {{ __('Lock to current projects') }} <template #help> diff --git a/app/assets/javascripts/vue_merge_request_widget/components/states/ready_to_merge.vue b/app/assets/javascripts/vue_merge_request_widget/components/states/ready_to_merge.vue index f33f4d3fda0..59010b773f0 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/states/ready_to_merge.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/states/ready_to_merge.vue @@ -28,6 +28,7 @@ import { CONFIRM, WARNING, MT_MERGE_STRATEGY, + PIPELINE_FAILED_STATE, } from '../../constants'; import eventHub from '../../event_hub'; import mergeRequestQueryVariablesMixin from '../../mixins/merge_request_query_variables'; @@ -39,7 +40,6 @@ import CommitsHeader from './commits_header.vue'; import SquashBeforeMerge from './squash_before_merge.vue'; const PIPELINE_RUNNING_STATE = 'running'; -const PIPELINE_FAILED_STATE = 'failed'; const PIPELINE_PENDING_STATE = 'pending'; const PIPELINE_SUCCESS_STATE = 'success'; @@ -105,6 +105,10 @@ export default { import( 'ee_component/vue_merge_request_widget/components/merge_immediately_confirmation_dialog.vue' ), + MergeTrainFailedPipelineConfirmationDialog: () => + import( + 'ee_component/vue_merge_request_widget/components/merge_train_failed_pipeline_confirmation_dialog.vue' + ), }, directives: { GlTooltip: GlTooltipDirective, @@ -125,6 +129,7 @@ export default { squashBeforeMerge: this.mr.squashIsSelected, isSquashReadOnly: this.mr.squashIsReadonly, squashCommitMessage: this.mr.squashCommitMessage, + isPipelineFailedModalVisible: false, }; }, computed: { @@ -327,7 +332,12 @@ export default { : this.mr.commitMessageWithDescription; this.commitMessage = includeDescription ? commitMessageWithDescription : commitMessage; }, - handleMergeButtonClick(useAutoMerge, mergeImmediately = false) { + handleMergeButtonClick(useAutoMerge, mergeImmediately = false, confirmationClicked = false) { + if (this.showFailedPipelineModal && !confirmationClicked) { + this.isPipelineFailedModalVisible = true; + return; + } + if (mergeImmediately) { this.isMergingImmediately = true; } @@ -522,6 +532,11 @@ export default { @mergeImmediately="onMergeImmediatelyConfirmation" /> </gl-dropdown> + <merge-train-failed-pipeline-confirmation-dialog + :visible="isPipelineFailedModalVisible" + @startMergeTrain="onStartMergeTrainConfirmation" + @cancel="isPipelineFailedModalVisible = false" + /> </gl-button-group> <div v-if="shouldShowMergeControls" diff --git a/app/assets/javascripts/vue_merge_request_widget/constants.js b/app/assets/javascripts/vue_merge_request_widget/constants.js index d067e531fad..f5710f46b7e 100644 --- a/app/assets/javascripts/vue_merge_request_widget/constants.js +++ b/app/assets/javascripts/vue_merge_request_widget/constants.js @@ -10,6 +10,8 @@ export const MWPS_MERGE_STRATEGY = 'merge_when_pipeline_succeeds'; export const MTWPS_MERGE_STRATEGY = 'add_to_merge_train_when_pipeline_succeeds'; export const MT_MERGE_STRATEGY = 'merge_train'; +export const PIPELINE_FAILED_STATE = 'failed'; + export const AUTO_MERGE_STRATEGIES = [MWPS_MERGE_STRATEGY, MTWPS_MERGE_STRATEGY, MT_MERGE_STRATEGY]; // SP - "Suggest Pipelines" diff --git a/app/assets/javascripts/vue_merge_request_widget/mixins/ready_to_merge.js b/app/assets/javascripts/vue_merge_request_widget/mixins/ready_to_merge.js index 23215982e6e..9d8e5d12d58 100644 --- a/app/assets/javascripts/vue_merge_request_widget/mixins/ready_to_merge.js +++ b/app/assets/javascripts/vue_merge_request_widget/mixins/ready_to_merge.js @@ -38,5 +38,13 @@ export default { pipelineId() { return this.pipeline.id; }, + showFailedPipelineModal() { + return false; + }, + }, + methods: { + onStartMergeTrainConfirmation() { + return false; + }, }, }; diff --git a/app/assets/javascripts/vue_shared/components/issuable/init_issuable_header_warning.js b/app/assets/javascripts/vue_shared/components/issuable/init_issuable_header_warning.js index 18bfcc268dc..28aa93d6680 100644 --- a/app/assets/javascripts/vue_shared/components/issuable/init_issuable_header_warning.js +++ b/app/assets/javascripts/vue_shared/components/issuable/init_issuable_header_warning.js @@ -1,10 +1,20 @@ import Vue from 'vue'; +import { parseBoolean } from '~/lib/utils/common_utils'; import IssuableHeaderWarnings from './issuable_header_warnings.vue'; export default function issuableHeaderWarnings(store) { + const el = document.getElementById('js-issuable-header-warnings'); + + if (!el) { + return false; + } + + const { hidden } = el.dataset; + return new Vue({ - el: document.getElementById('js-issuable-header-warnings'), + el, store, + provide: { hidden: parseBoolean(hidden) }, render(createElement) { return createElement(IssuableHeaderWarnings); }, diff --git a/app/assets/javascripts/vue_shared/components/issuable/issuable_header_warnings.vue b/app/assets/javascripts/vue_shared/components/issuable/issuable_header_warnings.vue index 56adbe8c606..82223ab9ef4 100644 --- a/app/assets/javascripts/vue_shared/components/issuable/issuable_header_warnings.vue +++ b/app/assets/javascripts/vue_shared/components/issuable/issuable_header_warnings.vue @@ -1,11 +1,16 @@ <script> -import { GlIcon } from '@gitlab/ui'; +import { GlIcon, GlTooltipDirective } from '@gitlab/ui'; import { mapGetters } from 'vuex'; +import { __ } from '~/locale'; export default { components: { GlIcon, }, + directives: { + GlTooltip: GlTooltipDirective, + }, + inject: ['hidden'], computed: { ...mapGetters(['getNoteableData']), isLocked() { @@ -26,6 +31,12 @@ export default { visible: this.isConfidential, dataTestId: 'confidential', }, + { + iconName: 'spam', + visible: this.hidden, + dataTestId: 'hidden', + tooltip: __('This issue is hidden because its author has been banned'), + }, ]; }, }, @@ -35,8 +46,15 @@ export default { <template> <div class="gl-display-inline-block"> <template v-for="meta in warningIconsMeta"> - <div v-if="meta.visible" :key="meta.iconName" class="issuable-warning-icon inline"> - <gl-icon :name="meta.iconName" :data-testid="meta.dataTestId" class="icon" /> + <div + v-if="meta.visible" + :key="meta.iconName" + v-gl-tooltip + :data-testid="meta.dataTestId" + :title="meta.tooltip || null" + class="issuable-warning-icon inline" + > + <gl-icon :name="meta.iconName" class="icon" /> </div> </template> </div> |