From 9578c9f9e88421a5dc4d9215f40d932bd30cbabc Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 3 Mar 2021 18:11:16 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- .../design_management/components/delete_button.vue | 16 +-- .../components/design_destroyer.vue | 1 + .../design_management/components/toolbar/index.vue | 2 +- .../design_management/components/upload/button.vue | 2 +- .../javascripts/design_management/pages/index.vue | 5 +- .../components/graph/graph_component_wrapper.vue | 9 +- .../components/graph/linked_pipelines_column.vue | 7 +- .../pipelines/components/graph/utils.js | 21 ++- .../pipelines_list/pipeline_operations.vue | 119 ++++++++++++++++ .../pipelines_list/pipeline_triggerer.vue | 2 +- .../components/pipelines_list/pipeline_url.vue | 2 +- .../components/pipelines_list/pipelines_commit.vue | 85 +++++++++++ .../pipelines_list/pipelines_status_badge.vue | 37 +++++ .../components/pipelines_list/pipelines_table.vue | 155 +++++++++++++++++++-- app/assets/javascripts/pipelines/constants.js | 2 + .../ref/components/ref_results_section.vue | 8 +- .../javascripts/ref/components/ref_selector.vue | 58 +++++++- app/assets/javascripts/ref/constants.js | 5 + app/assets/javascripts/ref/stores/actions.js | 17 ++- .../javascripts/ref/stores/mutation_types.js | 2 + app/assets/javascripts/ref/stores/mutations.js | 3 + app/assets/javascripts/ref/stores/state.js | 25 ++-- .../projects/merge_requests_controller.rb | 1 + app/controllers/root_controller.rb | 2 + app/helpers/preferences_helper.rb | 1 + app/models/user.rb | 2 +- app/views/shared/milestones/_milestone.html.haml | 6 +- 27 files changed, 535 insertions(+), 60 deletions(-) create mode 100644 app/assets/javascripts/pipelines/components/pipelines_list/pipeline_operations.vue create mode 100644 app/assets/javascripts/pipelines/components/pipelines_list/pipelines_commit.vue create mode 100644 app/assets/javascripts/pipelines/components/pipelines_list/pipelines_status_badge.vue (limited to 'app') diff --git a/app/assets/javascripts/design_management/components/delete_button.vue b/app/assets/javascripts/design_management/components/delete_button.vue index 273fa3f6be2..fbcce22ec1e 100644 --- a/app/assets/javascripts/design_management/components/delete_button.vue +++ b/app/assets/javascripts/design_management/components/delete_button.vue @@ -73,21 +73,19 @@ export default { diff --git a/app/assets/javascripts/design_management/components/upload/button.vue b/app/assets/javascripts/design_management/components/upload/button.vue index d7b287f663b..394ccb3c483 100644 --- a/app/assets/javascripts/design_management/components/upload/button.vue +++ b/app/assets/javascripts/design_management/components/upload/button.vue @@ -50,7 +50,7 @@ export default { type="file" name="design_file" :accept="$options.VALID_DESIGN_FILE_MIMETYPE.mimetype" - class="hide" + class="gl-display-none" multiple @change="onFileUploadChange" /> diff --git a/app/assets/javascripts/design_management/pages/index.vue b/app/assets/javascripts/design_management/pages/index.vue index c73c8fb6ca4..99ac38fc554 100644 --- a/app/assets/javascripts/design_management/pages/index.vue +++ b/app/assets/javascripts/design_management/pages/index.vue @@ -365,7 +365,8 @@ export default { v-if="isLatestVersion" variant="link" size="small" - class="gl-mr-4 js-select-all" + class="gl-mr-3" + data-testid="select-all-designs-button" @click="toggleDesignsSelection" >{{ selectAllButtonText }} @@ -385,7 +386,7 @@ export default { data-qa-selector="archive_button" :loading="loading" :has-selected-designs="hasSelectedDesigns" - @deleteSelectedDesigns="mutate()" + @delete-selected-designs="mutate()" > {{ s__('DesignManagement|Archive selected') }} diff --git a/app/assets/javascripts/pipelines/components/graph/graph_component_wrapper.vue b/app/assets/javascripts/pipelines/components/graph/graph_component_wrapper.vue index 9c922f0ec13..fa0f959bce9 100644 --- a/app/assets/javascripts/pipelines/components/graph/graph_component_wrapper.vue +++ b/app/assets/javascripts/pipelines/components/graph/graph_component_wrapper.vue @@ -7,6 +7,7 @@ import PipelineGraph from './graph_component.vue'; import { getQueryHeaders, reportToSentry, + serializeGqlErr, toggleQueryPollingByVisibility, unwrapPipelineData, } from './utils'; @@ -60,8 +61,8 @@ export default { update(data) { return unwrapPipelineData(this.pipelineProjectPath, data); }, - error() { - this.reportFailure(LOAD_FAILURE); + error({ gqlError }) { + this.reportFailure(LOAD_FAILURE, serializeGqlErr(gqlError)); }, }, }, @@ -112,10 +113,10 @@ export default { refreshPipelineGraph() { this.$apollo.queries.pipeline.refetch(); }, - reportFailure(type) { + reportFailure(type, err = '') { this.showAlert = true; this.alertType = type; - reportToSentry(this.$options.name, this.alertType); + reportToSentry(this.$options.name, `type: ${this.alertType}, info: ${err}`); }, }, }; diff --git a/app/assets/javascripts/pipelines/components/graph/linked_pipelines_column.vue b/app/assets/javascripts/pipelines/components/graph/linked_pipelines_column.vue index 356207cbdd4..cccabf8619b 100644 --- a/app/assets/javascripts/pipelines/components/graph/linked_pipelines_column.vue +++ b/app/assets/javascripts/pipelines/components/graph/linked_pipelines_column.vue @@ -6,6 +6,7 @@ import LinkedPipeline from './linked_pipeline.vue'; import { getQueryHeaders, reportToSentry, + serializeGqlErr, toggleQueryPollingByVisibility, unwrapPipelineData, validateConfigPaths, @@ -99,12 +100,14 @@ export default { this.loadingPipelineId = null; this.$emit('scrollContainer'); }, - error(err, _vm, _key, type) { + error({ gqlError }, _vm, _key, type) { this.$emit('error', LOAD_FAILURE); reportToSentry( 'linked_pipelines_column', - `error type: ${LOAD_FAILURE}, error: ${err}, apollo error type: ${type}`, + `error type: ${LOAD_FAILURE}, error: ${serializeGqlErr( + gqlError, + )}, apollo error type: ${type}`, ); }, }); diff --git a/app/assets/javascripts/pipelines/components/graph/utils.js b/app/assets/javascripts/pipelines/components/graph/utils.js index 9e4936c1c24..81d8fe7f489 100644 --- a/app/assets/javascripts/pipelines/components/graph/utils.js +++ b/app/assets/javascripts/pipelines/components/graph/utils.js @@ -23,7 +23,6 @@ const getQueryHeaders = (etagResource) => { }, }; }; -/* eslint-enable @gitlab/require-i18n-strings */ const reportToSentry = (component, failureType) => { Sentry.withScope((scope) => { @@ -32,6 +31,25 @@ const reportToSentry = (component, failureType) => { }); }; +const serializeGqlErr = (gqlError) => { + if (!gqlError) { + return 'gqlError data not available.'; + } + + const { locations, message, path } = gqlError; + + return ` + ${message}. + Locations: ${locations + .flatMap((loc) => Object.entries(loc)) + .flat(2) + .join(' ')}. + Path: ${path.join(', ')}. + `; +}; + +/* eslint-enable @gitlab/require-i18n-strings */ + const toggleQueryPollingByVisibility = (queryRef, interval = 10000) => { const stopStartQuery = (query) => { if (!Visibility.hidden()) { @@ -82,6 +100,7 @@ const validateConfigPaths = (value) => value.graphqlResourceEtag?.length > 0; export { getQueryHeaders, reportToSentry, + serializeGqlErr, toggleQueryPollingByVisibility, unwrapPipelineData, validateConfigPaths, diff --git a/app/assets/javascripts/pipelines/components/pipelines_list/pipeline_operations.vue b/app/assets/javascripts/pipelines/components/pipelines_list/pipeline_operations.vue new file mode 100644 index 00000000000..81eeead2171 --- /dev/null +++ b/app/assets/javascripts/pipelines/components/pipelines_list/pipeline_operations.vue @@ -0,0 +1,119 @@ + + + diff --git a/app/assets/javascripts/pipelines/components/pipelines_list/pipeline_triggerer.vue b/app/assets/javascripts/pipelines/components/pipelines_list/pipeline_triggerer.vue index 6955b27cb22..c707b395192 100644 --- a/app/assets/javascripts/pipelines/components/pipelines_list/pipeline_triggerer.vue +++ b/app/assets/javascripts/pipelines/components/pipelines_list/pipeline_triggerer.vue @@ -29,7 +29,7 @@ export default { };