diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-03 09:09:31 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-03 09:09:31 +0000 |
commit | 04baa85554ff13bdd4d6f4e6bb24119d17608fee (patch) | |
tree | 7cb9c0977e09d97da340f48703d79b2dbd3579a0 | |
parent | 42f41de46525ce0065f02ee07c1a79f5669526a0 (diff) | |
download | gitlab-ce-04baa85554ff13bdd4d6f4e6bb24119d17608fee.tar.gz |
Add latest changes from gitlab-org/gitlab@master
166 files changed, 1147 insertions, 740 deletions
@@ -1,127 +0,0 @@ -import { shallowMount } from '@vue/test-utils'; -import Popover from '~/blob/suggest_gitlab_ci_yml/components/popover.vue'; -import { mockTracking, unmockTracking, triggerEvent } from 'helpers/tracking_helper'; -import * as utils from '~/lib/utils/common_utils'; -import { GlButton } from '@gitlab/ui'; - -jest.mock('~/lib/utils/common_utils', () => ({ - ...jest.requireActual('~/lib/utils/common_utils'), - scrollToElement: jest.fn(), -})); - -const target = 'gitlab-ci-yml-selector'; -const dismissKey = '99'; -const defaultTrackLabel = 'suggest_gitlab_ci_yml'; -const commitTrackLabel = 'suggest_commit_first_project_gitlab_ci_yml'; - -const dismissCookie = 'suggest_gitlab_ci_yml_99'; -const humanAccess = 'owner'; - -describe('Suggest gitlab-ci.yml Popover', () => { - let wrapper; - - function createWrapper(trackLabel) { - wrapper = shallowMount(Popover, { - propsData: { - target, - trackLabel, - dismissKey, - humanAccess, - }, - stubs: { - GlButton, - GlIcon - } - slots: { - title: '<gl-button><gl-icon /> </gl-button>', - } - }); - } - - afterEach(() => { - wrapper.destroy(); - wrapper = null; - }); - - describe('when no dismiss cookie is set', () => { - beforeEach(() => { - createWrapper(defaultTrackLabel); - }); - - it('sets popoverDismissed to false', () => { - expect(wrapper.vm.popoverDismissed).toEqual(false); - }); - }); - - describe('when the dismiss cookie is set', () => { - beforeEach(() => { - utils.setCookie(dismissCookie, true); - - createWrapper(defaultTrackLabel); - }); - - it('sets popoverDismissed to true', () => { - expect(wrapper.vm.popoverDismissed).toEqual(true); - }); - - afterEach(() => { - utils.removeCookie(dismissCookie); - }); - }); - - describe('tracking', () => { - let trackingSpy; - - beforeEach(() => { - createWrapper(commitTrackLabel); - trackingSpy = mockTracking('_category_', wrapper.element, jest.spyOn); - }); - - afterEach(() => { - unmockTracking(); - }); - - it('sends a tracking event with the expected properties for the popover being viewed', () => { - const expectedCategory = undefined; - const expectedAction = undefined; - const expectedLabel = 'suggest_commit_first_project_gitlab_ci_yml'; - const expectedProperty = 'owner'; - - document.body.dataset.page = 'projects:blob:new'; - - wrapper.vm.trackOnShow(); - - expect(trackingSpy).toHaveBeenCalledWith(expectedCategory, expectedAction, { - label: expectedLabel, - property: expectedProperty, - }); - }); - - it('sends a tracking event when the popover is dismissed', () => { - const expectedLabel = commitTrackLabel; - const expectedProperty = 'owner'; - const expectedValue = '10'; - const dismissButton = wrapper.find(GlButton); - -console.log(wrapper.html()); - - triggerEvent(dismissButton.element); - - expect(trackingSpy).toHaveBeenCalledWith('_category_', 'click_button', { - label: expectedLabel, - property: expectedProperty, - value: expectedValue, - }); - }); - }); - - describe('when the popover is mounted with the trackLabel of the Confirm button popover at the bottom of the page', () => { - it('calls scrollToElement so that the Confirm button and popover will be in sight', () => { - const scrollToElementSpy = jest.spyOn(utils, 'scrollToElement'); - - createWrapper(commitTrackLabel); - - expect(scrollToElementSpy).toHaveBeenCalled(); - }); - }); -}); diff --git a/.rubocop.yml b/.rubocop.yml index 6b8fb30b961..ee840476c8a 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -329,13 +329,6 @@ RSpec/LeakyConstantDeclaration: Exclude: - 'spec/**/*.rb' - 'qa/spec/**/*.rb' - - 'ee/spec/presenters/security/vulnerable_project_presenter_spec.rb' - - 'ee/spec/serializers/vulnerable_project_entity_spec.rb' - - 'ee/spec/services/clusters/applications/check_upgrade_progress_service_spec.rb' - - 'ee/spec/services/dashboard/projects/list_service_spec.rb' - - 'ee/spec/services/metrics/dashboard/clone_dashboard_service_spec.rb' - - 'ee/spec/support/shared_contexts/epic_aggregate_constants.rb' - - 'ee/spec/workers/elastic_namespace_rollout_worker_spec.rb' RSpec/EmptyLineAfterHook: Enabled: false @@ -387,6 +380,13 @@ Cop/BanCatchThrow: Performance/ReadlinesEach: Enabled: true +Performance/ChainArrayAllocation: + Enabled: true + Include: + - 'lib/gitlab/import_export/**/*' + - 'ee/lib/gitlab/import_export/**/*' + - 'ee/lib/ee/gitlab/import_export/**/*' + # https://gitlab.com/gitlab-org/gitlab/-/issues/212541 RSpec/RepeatedExample: Exclude: @@ -400,7 +400,6 @@ RSpec/RepeatedExample: - 'spec/lib/gitlab/closing_issue_extractor_spec.rb' - 'spec/lib/gitlab/danger/changelog_spec.rb' - 'spec/lib/gitlab/import_export/project/relation_factory_spec.rb' - - 'spec/models/project_services/chat_message/pipeline_message_spec.rb' - 'spec/routing/admin_routing_spec.rb' - 'spec/rubocop/cop/migration/update_large_table_spec.rb' - 'spec/services/notification_service_spec.rb' diff --git a/app/assets/javascripts/alerts_service_settings/components/alerts_service_form.vue b/app/assets/javascripts/alerts_service_settings/components/alerts_service_form.vue index 5e16f6f3873..1c7a181e3e6 100644 --- a/app/assets/javascripts/alerts_service_settings/components/alerts_service_form.vue +++ b/app/assets/javascripts/alerts_service_settings/components/alerts_service_form.vue @@ -1,5 +1,11 @@ <script> -import { GlButton, GlFormGroup, GlFormInput, GlModal, GlModalDirective } from '@gitlab/ui'; +import { + GlDeprecatedButton, + GlFormGroup, + GlFormInput, + GlModal, + GlModalDirective, +} from '@gitlab/ui'; import _ from 'underscore'; import ClipboardButton from '~/vue_shared/components/clipboard_button.vue'; import ToggleButton from '~/vue_shared/components/toggle_button.vue'; @@ -11,7 +17,7 @@ export default { COPY_TO_CLIPBOARD: __('Copy'), RESET_KEY: __('Reset key'), components: { - GlButton, + GlDeprecatedButton, GlFormGroup, GlFormInput, GlModal, @@ -149,7 +155,9 @@ export default { <clipboard-button :text="authorizationKey" :title="$options.COPY_TO_CLIPBOARD" /> </span> </div> - <gl-button v-gl-modal.authKeyModal class="mt-2">{{ $options.RESET_KEY }}</gl-button> + <gl-deprecated-button v-gl-modal.authKeyModal class="mt-2">{{ + $options.RESET_KEY + }}</gl-deprecated-button> <gl-modal modal-id="authKeyModal" :title="$options.RESET_KEY" diff --git a/app/assets/javascripts/blob/components/blob_edit_content.vue b/app/assets/javascripts/blob/components/blob_edit_content.vue index 83303a373f3..9a30ed93330 100644 --- a/app/assets/javascripts/blob/components/blob_edit_content.vue +++ b/app/assets/javascripts/blob/components/blob_edit_content.vue @@ -5,7 +5,8 @@ export default { props: { value: { type: String, - required: true, + required: false, + default: '', }, fileName: { type: String, @@ -15,7 +16,6 @@ export default { }, data() { return { - content: this.value, editor: null, }; }, @@ -28,14 +28,12 @@ export default { this.editor = initEditorLite({ el: this.$refs.editor, blobPath: this.fileName, - blobContent: this.content, + blobContent: this.value, }); }, methods: { triggerFileChange() { - const val = this.editor.getValue(); - this.content = val; - this.$emit('input', val); + this.$emit('input', this.editor.getValue()); }, }, }; @@ -43,7 +41,7 @@ export default { <template> <div class="file-content code"> <pre id="editor" ref="editor" data-editor-loading @focusout="triggerFileChange">{{ - content + value }}</pre> </div> </template> diff --git a/app/assets/javascripts/blob/components/blob_embeddable.vue b/app/assets/javascripts/blob/components/blob_embeddable.vue index 26bd0208309..00b915ec8bd 100644 --- a/app/assets/javascripts/blob/components/blob_embeddable.vue +++ b/app/assets/javascripts/blob/components/blob_embeddable.vue @@ -1,11 +1,11 @@ <script> -import { GlFormInputGroup, GlButton, GlIcon } from '@gitlab/ui'; +import { GlFormInputGroup, GlDeprecatedButton, GlIcon } from '@gitlab/ui'; import { __ } from '~/locale'; export default { components: { GlFormInputGroup, - GlButton, + GlDeprecatedButton, GlIcon, }, props: { @@ -33,9 +33,9 @@ export default { select-on-click > <template #append> - <gl-button new-style data-clipboard-target="#embeddable-text"> + <gl-deprecated-button new-style data-clipboard-target="#embeddable-text"> <gl-icon name="copy-to-clipboard" :title="__('Copy')" /> - </gl-button> + </gl-deprecated-button> </template> </gl-form-input-group> </template> diff --git a/app/assets/javascripts/blob/components/blob_header_default_actions.vue b/app/assets/javascripts/blob/components/blob_header_default_actions.vue index 6b38b871606..63ae70a37f4 100644 --- a/app/assets/javascripts/blob/components/blob_header_default_actions.vue +++ b/app/assets/javascripts/blob/components/blob_header_default_actions.vue @@ -1,5 +1,5 @@ <script> -import { GlButton, GlButtonGroup, GlIcon, GlTooltipDirective } from '@gitlab/ui'; +import { GlDeprecatedButton, GlButtonGroup, GlIcon, GlTooltipDirective } from '@gitlab/ui'; import { BTN_COPY_CONTENTS_TITLE, BTN_DOWNLOAD_TITLE, @@ -12,7 +12,7 @@ export default { components: { GlIcon, GlButtonGroup, - GlButton, + GlDeprecatedButton, }, directives: { GlTooltip: GlTooltipDirective, @@ -43,7 +43,7 @@ export default { </script> <template> <gl-button-group> - <gl-button + <gl-deprecated-button v-gl-tooltip.hover :aria-label="$options.BTN_COPY_CONTENTS_TITLE" :title="$options.BTN_COPY_CONTENTS_TITLE" @@ -51,8 +51,8 @@ export default { data-clipboard-target="#blob-code-content" > <gl-icon name="copy-to-clipboard" :size="14" /> - </gl-button> - <gl-button + </gl-deprecated-button> + <gl-deprecated-button v-gl-tooltip.hover :aria-label="$options.BTN_RAW_TITLE" :title="$options.BTN_RAW_TITLE" @@ -60,8 +60,8 @@ export default { target="_blank" > <gl-icon name="doc-code" :size="14" /> - </gl-button> - <gl-button + </gl-deprecated-button> + <gl-deprecated-button v-gl-tooltip.hover :aria-label="$options.BTN_DOWNLOAD_TITLE" :title="$options.BTN_DOWNLOAD_TITLE" @@ -69,6 +69,6 @@ export default { target="_blank" > <gl-icon name="download" :size="14" /> - </gl-button> + </gl-deprecated-button> </gl-button-group> </template> diff --git a/app/assets/javascripts/blob/components/blob_header_viewer_switcher.vue b/app/assets/javascripts/blob/components/blob_header_viewer_switcher.vue index 689fa7638f0..7155a1d35b1 100644 --- a/app/assets/javascripts/blob/components/blob_header_viewer_switcher.vue +++ b/app/assets/javascripts/blob/components/blob_header_viewer_switcher.vue @@ -1,5 +1,5 @@ <script> -import { GlButton, GlButtonGroup, GlIcon, GlTooltipDirective } from '@gitlab/ui'; +import { GlDeprecatedButton, GlButtonGroup, GlIcon, GlTooltipDirective } from '@gitlab/ui'; import { RICH_BLOB_VIEWER, RICH_BLOB_VIEWER_TITLE, @@ -11,7 +11,7 @@ export default { components: { GlIcon, GlButtonGroup, - GlButton, + GlDeprecatedButton, }, directives: { GlTooltip: GlTooltipDirective, @@ -46,7 +46,7 @@ export default { </script> <template> <gl-button-group class="js-blob-viewer-switcher ml-2"> - <gl-button + <gl-deprecated-button v-gl-tooltip.hover :aria-label="$options.SIMPLE_BLOB_VIEWER_TITLE" :title="$options.SIMPLE_BLOB_VIEWER_TITLE" @@ -55,8 +55,8 @@ export default { @click="switchToViewer($options.SIMPLE_BLOB_VIEWER)" > <gl-icon name="code" :size="14" /> - </gl-button> - <gl-button + </gl-deprecated-button> + <gl-deprecated-button v-gl-tooltip.hover :aria-label="$options.RICH_BLOB_VIEWER_TITLE" :title="$options.RICH_BLOB_VIEWER_TITLE" @@ -65,6 +65,6 @@ export default { @click="switchToViewer($options.RICH_BLOB_VIEWER)" > <gl-icon name="document" :size="14" /> - </gl-button> + </gl-deprecated-button> </gl-button-group> </template> diff --git a/app/assets/javascripts/blob/suggest_gitlab_ci_yml/components/popover.vue b/app/assets/javascripts/blob/suggest_gitlab_ci_yml/components/popover.vue index 7418ca9edfc..e191bfd79cb 100644 --- a/app/assets/javascripts/blob/suggest_gitlab_ci_yml/components/popover.vue +++ b/app/assets/javascripts/blob/suggest_gitlab_ci_yml/components/popover.vue @@ -1,5 +1,5 @@ <script> -import { GlPopover, GlSprintf, GlButton, GlIcon } from '@gitlab/ui'; +import { GlPopover, GlSprintf, GlDeprecatedButton, GlIcon } from '@gitlab/ui'; import { parseBoolean, scrollToElement, setCookie, getCookie } from '~/lib/utils/common_utils'; import { s__ } from '~/locale'; import { glEmojiTag } from '~/emoji'; @@ -27,7 +27,7 @@ export default { GlPopover, GlSprintf, GlIcon, - GlButton, + GlDeprecatedButton, }, mixins: [trackingMixin], props: { @@ -109,9 +109,9 @@ export default { <template #title> <span v-html="suggestTitle"></span> <span class="ml-auto"> - <gl-button :aria-label="__('Close')" class="btn-blank" @click="onDismiss"> + <gl-deprecated-button :aria-label="__('Close')" class="btn-blank" @click="onDismiss"> <gl-icon name="close" aria-hidden="true" /> - </gl-button> + </gl-deprecated-button> </span> </template> diff --git a/app/assets/javascripts/boards/components/board.js b/app/assets/javascripts/boards/components/board.js index 48f5614cefe..ac02c229a07 100644 --- a/app/assets/javascripts/boards/components/board.js +++ b/app/assets/javascripts/boards/components/board.js @@ -1,7 +1,7 @@ import $ from 'jquery'; import Sortable from 'sortablejs'; import Vue from 'vue'; -import { GlButtonGroup, GlButton, GlLabel, GlTooltip } from '@gitlab/ui'; +import { GlButtonGroup, GlDeprecatedButton, GlLabel, GlTooltip } from '@gitlab/ui'; import isWipLimitsOn from 'ee_else_ce/boards/mixins/is_wip_limits'; import { s__, __, sprintf } from '~/locale'; import Icon from '~/vue_shared/components/icon.vue'; @@ -32,7 +32,7 @@ export default Vue.extend({ Icon, GlButtonGroup, IssueCount, - GlButton, + GlDeprecatedButton, GlLabel, GlTooltip, }, diff --git a/app/assets/javascripts/boards/components/board_column.vue b/app/assets/javascripts/boards/components/board_column.vue index 693b1f9d7b1..10c855675db 100644 --- a/app/assets/javascripts/boards/components/board_column.vue +++ b/app/assets/javascripts/boards/components/board_column.vue @@ -1,7 +1,7 @@ <script> import $ from 'jquery'; import Sortable from 'sortablejs'; -import { GlButtonGroup, GlButton, GlLabel, GlTooltip, GlIcon } from '@gitlab/ui'; +import { GlButtonGroup, GlDeprecatedButton, GlLabel, GlTooltip, GlIcon } from '@gitlab/ui'; import isWipLimitsOn from 'ee_else_ce/boards/mixins/is_wip_limits'; import { s__, __, sprintf } from '~/locale'; import Tooltip from '~/vue_shared/directives/tooltip'; @@ -24,7 +24,7 @@ export default { BoardList, GlButtonGroup, IssueCount, - GlButton, + GlDeprecatedButton, GlLabel, GlTooltip, GlIcon, @@ -333,7 +333,7 @@ export default { v-if="isNewIssueShown || isSettingsShown" class="board-list-button-group pl-2" > - <gl-button + <gl-deprecated-button v-if="isNewIssueShown" ref="newIssueBtn" :class="{ @@ -346,10 +346,10 @@ export default { @click="showNewIssueForm" > <i aria-hidden="true" data-hidden="true" class="fa fa-plus"></i> - </gl-button> + </gl-deprecated-button> <gl-tooltip :target="() => $refs.newIssueBtn">{{ __('New Issue') }}</gl-tooltip> - <gl-button + <gl-deprecated-button v-if="isSettingsShown" ref="settingsBtn" :aria-label="__(`List settings`)" @@ -359,7 +359,7 @@ export default { @click="openSidebarSettings" > <gl-icon name="settings" /> - </gl-button> + </gl-deprecated-button> <gl-tooltip :target="() => $refs.settingsBtn">{{ __('List settings') }}</gl-tooltip> </gl-button-group> </h3> diff --git a/app/assets/javascripts/boards/components/board_new_issue.vue b/app/assets/javascripts/boards/components/board_new_issue.vue index f9a08f151c5..deebe122109 100644 --- a/app/assets/javascripts/boards/components/board_new_issue.vue +++ b/app/assets/javascripts/boards/components/board_new_issue.vue @@ -1,6 +1,6 @@ <script> import $ from 'jquery'; -import { GlButton } from '@gitlab/ui'; +import { GlDeprecatedButton } from '@gitlab/ui'; import { getMilestone } from 'ee_else_ce/boards/boards_util'; import ListIssue from 'ee_else_ce/boards/models/issue'; import eventHub from '../eventhub'; @@ -11,7 +11,7 @@ export default { name: 'BoardNewIssue', components: { ProjectSelect, - GlButton, + GlDeprecatedButton, }, props: { groupId: { @@ -120,17 +120,21 @@ export default { /> <project-select v-if="groupId" :group-id="groupId" :list="list" /> <div class="clearfix prepend-top-10"> - <gl-button + <gl-deprecated-button ref="submit-button" :disabled="disabled" class="float-left" variant="success" type="submit" - >{{ __('Submit issue') }}</gl-button + >{{ __('Submit issue') }}</gl-deprecated-button + > + <gl-deprecated-button + class="float-right" + type="button" + variant="default" + @click="cancel" + >{{ __('Cancel') }}</gl-deprecated-button > - <gl-button class="float-right" type="button" variant="default" @click="cancel">{{ - __('Cancel') - }}</gl-button> </div> </form> </div> diff --git a/app/assets/javascripts/ci_variable_list/components/ci_variable_modal.vue b/app/assets/javascripts/ci_variable_list/components/ci_variable_modal.vue index 0460181558b..32fe841f16e 100644 --- a/app/assets/javascripts/ci_variable_list/components/ci_variable_modal.vue +++ b/app/assets/javascripts/ci_variable_list/components/ci_variable_modal.vue @@ -4,7 +4,7 @@ import { mapActions, mapState } from 'vuex'; import { ADD_CI_VARIABLE_MODAL_ID } from '../constants'; import CiEnvironmentsDropdown from './ci_environments_dropdown.vue'; import { - GlButton, + GlDeprecatedButton, GlModal, GlFormSelect, GlFormGroup, @@ -19,7 +19,7 @@ export default { modalId: ADD_CI_VARIABLE_MODAL_ID, components: { CiEnvironmentsDropdown, - GlButton, + GlDeprecatedButton, GlModal, GlFormSelect, GlFormGroup, @@ -212,22 +212,22 @@ export default { </gl-form-group> </form> <template #modal-footer> - <gl-button @click="hideModal">{{ __('Cancel') }}</gl-button> - <gl-button + <gl-deprecated-button @click="hideModal">{{ __('Cancel') }}</gl-deprecated-button> + <gl-deprecated-button v-if="variableBeingEdited" ref="deleteCiVariable" category="secondary" variant="danger" @click="deleteVarAndClose" - >{{ __('Delete variable') }}</gl-button + >{{ __('Delete variable') }}</gl-deprecated-button > - <gl-button + <gl-deprecated-button ref="updateOrAddVariable" :disabled="!canSubmit" variant="success" @click="updateOrAddVariable" >{{ modalActionText }} - </gl-button> + </gl-deprecated-button> </template> </gl-modal> </template> diff --git a/app/assets/javascripts/ci_variable_list/components/ci_variable_popover.vue b/app/assets/javascripts/ci_variable_list/components/ci_variable_popover.vue index c4b1bc18f5a..07b0d55bd4c 100644 --- a/app/assets/javascripts/ci_variable_list/components/ci_variable_popover.vue +++ b/app/assets/javascripts/ci_variable_list/components/ci_variable_popover.vue @@ -1,12 +1,12 @@ <script> -import { GlPopover, GlIcon, GlButton, GlTooltipDirective } from '@gitlab/ui'; +import { GlPopover, GlIcon, GlDeprecatedButton, GlTooltipDirective } from '@gitlab/ui'; export default { maxTextLength: 95, components: { GlPopover, GlIcon, - GlButton, + GlDeprecatedButton, }, directives: { GlTooltip: GlTooltipDirective, @@ -41,14 +41,14 @@ export default { <gl-popover :target="target" triggers="hover" placement="top" container="popover-container"> <div class="d-flex justify-content-between position-relative"> <div class="pr-5 w-100 ci-popover-value">{{ displayValue }}</div> - <gl-button + <gl-deprecated-button v-gl-tooltip class="btn-transparent btn-clipboard position-absolute position-top-0 position-right-0" :title="tooltipText" :data-clipboard-text="value" > <gl-icon name="copy-to-clipboard" /> - </gl-button> + </gl-deprecated-button> </div> </gl-popover> </div> diff --git a/app/assets/javascripts/ci_variable_list/components/ci_variable_table.vue b/app/assets/javascripts/ci_variable_list/components/ci_variable_table.vue index 806fa3e1191..b374d950c1f 100644 --- a/app/assets/javascripts/ci_variable_list/components/ci_variable_table.vue +++ b/app/assets/javascripts/ci_variable_list/components/ci_variable_table.vue @@ -1,5 +1,5 @@ <script> -import { GlTable, GlButton, GlModalDirective, GlIcon } from '@gitlab/ui'; +import { GlTable, GlDeprecatedButton, GlModalDirective, GlIcon } from '@gitlab/ui'; import { s__, __ } from '~/locale'; import { mapState, mapActions } from 'vuex'; import { ADD_CI_VARIABLE_MODAL_ID } from '../constants'; @@ -52,7 +52,7 @@ export default { ], components: { GlTable, - GlButton, + GlDeprecatedButton, GlIcon, CiVariablePopover, }, @@ -147,13 +147,13 @@ export default { </div> </template> <template #cell(actions)="{ item }"> - <gl-button + <gl-deprecated-button ref="edit-ci-variable" v-gl-modal-directive="$options.modalId" @click="editVariable(item)" > <gl-icon :size="$options.iconSize" name="pencil" /> - </gl-button> + </gl-deprecated-button> </template> <template #empty> <p ref="empty-variables" class="text-center empty-variables text-plain"> @@ -165,20 +165,20 @@ export default { class="ci-variable-actions d-flex justify-content-end" :class="{ 'justify-content-center': !tableIsNotEmpty }" > - <gl-button + <gl-deprecated-button v-if="tableIsNotEmpty" ref="secret-value-reveal-button" data-qa-selector="reveal_ci_variable_value" class="append-right-8" @click="toggleValues(!valuesHidden)" - >{{ valuesButtonText }}</gl-button + >{{ valuesButtonText }}</gl-deprecated-button > - <gl-button + <gl-deprecated-button ref="add-ci-variable" v-gl-modal-directive="$options.modalId" data-qa-selector="add_ci_variable" variant="success" - >{{ __('Add Variable') }}</gl-button + >{{ __('Add Variable') }}</gl-deprecated-button > </div> </div> diff --git a/app/assets/javascripts/clusters/components/ingress_modsecurity_settings.vue b/app/assets/javascripts/clusters/components/ingress_modsecurity_settings.vue index e4bc00fc102..95eb427a49c 100644 --- a/app/assets/javascripts/clusters/components/ingress_modsecurity_settings.vue +++ b/app/assets/javascripts/clusters/components/ingress_modsecurity_settings.vue @@ -7,7 +7,7 @@ import { GlSprintf, GlLink, GlToggle, - GlButton, + GlDeprecatedButton, GlDropdown, GlDropdownItem, GlIcon, @@ -25,7 +25,7 @@ export default { GlSprintf, GlLink, GlToggle, - GlButton, + GlDeprecatedButton, GlDropdown, GlDropdownItem, GlIcon, @@ -235,17 +235,17 @@ export default { </div> </div> <div v-if="showButtons" class="mt-3"> - <gl-button + <gl-deprecated-button class="btn-success inline mr-1" :loading="saving" :disabled="saveButtonDisabled" @click="updateApplication" > {{ saveButtonLabel }} - </gl-button> - <gl-button :disabled="saveButtonDisabled" @click="resetStatus"> + </gl-deprecated-button> + <gl-deprecated-button :disabled="saveButtonDisabled" @click="resetStatus"> {{ __('Cancel') }} - </gl-button> + </gl-deprecated-button> </div> </div> </div> diff --git a/app/assets/javascripts/clusters/components/remove_cluster_confirmation.vue b/app/assets/javascripts/clusters/components/remove_cluster_confirmation.vue index bdbaf2ed558..b35adae3352 100644 --- a/app/assets/javascripts/clusters/components/remove_cluster_confirmation.vue +++ b/app/assets/javascripts/clusters/components/remove_cluster_confirmation.vue @@ -1,7 +1,7 @@ <script> import { escape as esc } from 'lodash'; import SplitButton from '~/vue_shared/components/split_button.vue'; -import { GlModal, GlButton, GlFormInput } from '@gitlab/ui'; +import { GlModal, GlDeprecatedButton, GlFormInput } from '@gitlab/ui'; import { s__, sprintf } from '~/locale'; import csrf from '~/lib/utils/csrf'; @@ -27,7 +27,7 @@ export default { components: { SplitButton, GlModal, - GlButton, + GlDeprecatedButton, GlFormInput, }, props: { @@ -148,19 +148,24 @@ export default { }}</span> </template> <template slot="modal-footer"> - <gl-button variant="secondary" @click="handleCancel">{{ s__('Cancel') }}</gl-button> + <gl-deprecated-button variant="secondary" @click="handleCancel">{{ + s__('Cancel') + }}</gl-deprecated-button> <template v-if="confirmCleanup"> - <gl-button :disabled="!canSubmit" variant="warning" @click="handleSubmit">{{ + <gl-deprecated-button :disabled="!canSubmit" variant="warning" @click="handleSubmit">{{ s__('ClusterIntegration|Remove integration') - }}</gl-button> - <gl-button :disabled="!canSubmit" variant="danger" @click="handleSubmit(true)">{{ - s__('ClusterIntegration|Remove integration and resources') - }}</gl-button> + }}</gl-deprecated-button> + <gl-deprecated-button + :disabled="!canSubmit" + variant="danger" + @click="handleSubmit(true)" + >{{ s__('ClusterIntegration|Remove integration and resources') }}</gl-deprecated-button + > </template> <template v-else> - <gl-button :disabled="!canSubmit" variant="danger" @click="handleSubmit">{{ + <gl-deprecated-button :disabled="!canSubmit" variant="danger" @click="handleSubmit">{{ s__('ClusterIntegration|Remove integration') - }}</gl-button> + }}</gl-deprecated-button> </template> </template> </gl-modal> diff --git a/app/assets/javascripts/code_navigation/components/popover.vue b/app/assets/javascripts/code_navigation/components/popover.vue index f216a4c6e6f..b4d9bc7b181 100644 --- a/app/assets/javascripts/code_navigation/components/popover.vue +++ b/app/assets/javascripts/code_navigation/components/popover.vue @@ -1,9 +1,9 @@ <script> -import { GlButton } from '@gitlab/ui'; +import { GlDeprecatedButton } from '@gitlab/ui'; export default { components: { - GlButton, + GlDeprecatedButton, }, props: { position: { @@ -77,9 +77,9 @@ export default { </p> </div> <div v-if="definitionPath" class="popover-body"> - <gl-button :href="definitionPath" target="_blank" class="w-100" variant="default"> + <gl-deprecated-button :href="definitionPath" target="_blank" class="w-100" variant="default"> {{ __('Go to definition') }} - </gl-button> + </gl-deprecated-button> </div> </div> </template> diff --git a/app/assets/javascripts/commit/pipelines/pipelines_table.vue b/app/assets/javascripts/commit/pipelines/pipelines_table.vue index cd9aea85f4d..23a842fab4c 100644 --- a/app/assets/javascripts/commit/pipelines/pipelines_table.vue +++ b/app/assets/javascripts/commit/pipelines/pipelines_table.vue @@ -1,5 +1,5 @@ <script> -import { GlButton, GlLoadingIcon } from '@gitlab/ui'; +import { GlDeprecatedButton, GlLoadingIcon } from '@gitlab/ui'; import { GlBreakpointInstance as bp } from '@gitlab/ui/dist/utils'; import PipelinesService from '~/pipelines/services/pipelines_service'; import PipelineStore from '~/pipelines/stores/pipelines_store'; @@ -12,7 +12,7 @@ import CIPaginationMixin from '~/vue_shared/mixins/ci_pagination_api_mixin'; export default { components: { TablePagination, - GlButton, + GlDeprecatedButton, GlLoadingIcon, }, mixins: [pipelinesMixin, CIPaginationMixin], @@ -171,7 +171,7 @@ export default { <div v-else-if="shouldRenderTable" class="table-holder"> <div v-if="canRenderPipelineButton" class="nav justify-content-end"> - <gl-button + <gl-deprecated-button v-if="canRenderPipelineButton" variant="success" class="js-run-mr-pipeline prepend-top-10 btn-wide-on-xs" @@ -180,7 +180,7 @@ export default { > <gl-loading-icon v-if="state.isRunningMergeRequestPipeline" inline /> {{ s__('Pipelines|Run Pipeline') }} - </gl-button> + </gl-deprecated-button> </div> <pipelines-table-component diff --git a/app/assets/javascripts/diffs/components/compare_versions.vue b/app/assets/javascripts/diffs/components/compare_versions.vue index 3a2146147cc..34716c214c6 100644 --- a/app/assets/javascripts/diffs/components/compare_versions.vue +++ b/app/assets/javascripts/diffs/components/compare_versions.vue @@ -1,6 +1,6 @@ <script> import { mapActions, mapGetters, mapState } from 'vuex'; -import { GlTooltipDirective, GlLink, GlButton, GlSprintf } from '@gitlab/ui'; +import { GlTooltipDirective, GlLink, GlDeprecatedButton, GlSprintf } from '@gitlab/ui'; import { __ } from '~/locale'; import { polyfillSticky } from '~/lib/utils/sticky'; import Icon from '~/vue_shared/components/icon.vue'; @@ -14,7 +14,7 @@ export default { CompareVersionsDropdown, Icon, GlLink, - GlButton, + GlDeprecatedButton, GlSprintf, SettingsDropdown, DiffStats, @@ -140,16 +140,20 @@ export default { :added-lines="addedLines" :removed-lines="removedLines" /> - <gl-button + <gl-deprecated-button v-if="commit || startVersion" :href="latestVersionPath" class="append-right-8 js-latest-version" > {{ __('Show latest version') }} - </gl-button> - <gl-button v-show="hasCollapsedFile" class="append-right-8" @click="expandAllFiles"> + </gl-deprecated-button> + <gl-deprecated-button + v-show="hasCollapsedFile" + class="append-right-8" + @click="expandAllFiles" + > {{ __('Expand all') }} - </gl-button> + </gl-deprecated-button> <settings-dropdown /> </div> </div> diff --git a/app/assets/javascripts/diffs/components/diff_file_header.vue b/app/assets/javascripts/diffs/components/diff_file_header.vue index c51f711fb81..d601c3769a3 100644 --- a/app/assets/javascripts/diffs/components/diff_file_header.vue +++ b/app/assets/javascripts/diffs/components/diff_file_header.vue @@ -1,7 +1,7 @@ <script> import { escape as esc } from 'lodash'; import { mapActions, mapGetters } from 'vuex'; -import { GlButton, GlTooltipDirective, GlLoadingIcon } from '@gitlab/ui'; +import { GlDeprecatedButton, GlTooltipDirective, GlLoadingIcon } from '@gitlab/ui'; import { polyfillSticky } from '~/lib/utils/sticky'; import ClipboardButton from '~/vue_shared/components/clipboard_button.vue'; import Icon from '~/vue_shared/components/icon.vue'; @@ -16,7 +16,7 @@ import { scrollToElement } from '~/lib/utils/common_utils'; export default { components: { GlLoadingIcon, - GlButton, + GlDeprecatedButton, ClipboardButton, EditButton, Icon, @@ -229,7 +229,7 @@ export default { <div class="btn-group" role="group"> <template v-if="diffFile.blob && diffFile.blob.readable_text"> <span v-gl-tooltip.hover :title="s__('MergeRequests|Toggle comments for this file')"> - <gl-button + <gl-deprecated-button ref="toggleDiscussionsButton" :disabled="!diffHasDiscussions(diffFile)" :class="{ active: diffHasExpandedDiscussions(diffFile) }" @@ -242,7 +242,7 @@ export default { @click="toggleFileDiscussionWrappers(diffFile)" > <icon name="comment" /> - </gl-button> + </gl-deprecated-button> </span> <edit-button @@ -265,7 +265,7 @@ export default { v-html="viewReplacedFileButtonText" > </a> - <gl-button + <gl-deprecated-button v-if="!diffFile.is_fully_expanded" ref="expandDiffToFullFileButton" v-gl-tooltip.hover @@ -279,8 +279,8 @@ export default { <gl-loading-icon v-if="diffFile.isLoadingFullFile" color="dark" inline /> <icon v-else-if="diffFile.isShowingFullFile" name="doc-changes" /> <icon v-else name="doc-expand" /> - </gl-button> - <gl-button + </gl-deprecated-button> + <gl-deprecated-button ref="viewButton" v-gl-tooltip.hover :href="diffFile.view_path" @@ -292,7 +292,7 @@ export default { :title="viewFileButtonText" > <icon name="doc-text" /> - </gl-button> + </gl-deprecated-button> <a v-if="diffFile.external_url" diff --git a/app/assets/javascripts/diffs/components/edit_button.vue b/app/assets/javascripts/diffs/components/edit_button.vue index dcb79cd5e16..91e296f8572 100644 --- a/app/assets/javascripts/diffs/components/edit_button.vue +++ b/app/assets/javascripts/diffs/components/edit_button.vue @@ -1,10 +1,10 @@ <script> -import { GlTooltipDirective, GlButton } from '@gitlab/ui'; +import { GlTooltipDirective, GlDeprecatedButton } from '@gitlab/ui'; import Icon from '~/vue_shared/components/icon.vue'; export default { components: { - GlButton, + GlDeprecatedButton, Icon, }, directives: { @@ -37,7 +37,7 @@ export default { </script> <template> - <gl-button + <gl-deprecated-button v-gl-tooltip.top :href="editPath" :title="__('Edit file')" @@ -45,5 +45,5 @@ export default { @click.native="handleEditClick" > <icon name="pencil" /> - </gl-button> + </gl-deprecated-button> </template> diff --git a/app/assets/javascripts/diffs/components/no_changes.vue b/app/assets/javascripts/diffs/components/no_changes.vue index 09cb542c3dc..5fd68471094 100644 --- a/app/assets/javascripts/diffs/components/no_changes.vue +++ b/app/assets/javascripts/diffs/components/no_changes.vue @@ -1,12 +1,12 @@ <script> import { mapGetters } from 'vuex'; import { escape as esc } from 'lodash'; -import { GlButton } from '@gitlab/ui'; +import { GlDeprecatedButton } from '@gitlab/ui'; import { __, sprintf } from '~/locale'; export default { components: { - GlButton, + GlDeprecatedButton, }, props: { changesEmptyStateIllustration: { @@ -43,9 +43,9 @@ export default { <div class="text-content text-center"> <span v-html="emptyStateText"></span> <div class="text-center"> - <gl-button :href="getNoteableData.new_blob_path" variant="success">{{ + <gl-deprecated-button :href="getNoteableData.new_blob_path" variant="success">{{ __('Create commit') - }}</gl-button> + }}</gl-deprecated-button> </div> </div> </div> diff --git a/app/assets/javascripts/diffs/components/settings_dropdown.vue b/app/assets/javascripts/diffs/components/settings_dropdown.vue index 08e991c4791..c45de481a17 100644 --- a/app/assets/javascripts/diffs/components/settings_dropdown.vue +++ b/app/assets/javascripts/diffs/components/settings_dropdown.vue @@ -1,11 +1,11 @@ <script> import { mapActions, mapGetters, mapState } from 'vuex'; -import { GlButton } from '@gitlab/ui'; +import { GlDeprecatedButton } from '@gitlab/ui'; import Icon from '~/vue_shared/components/icon.vue'; export default { components: { - GlButton, + GlDeprecatedButton, Icon, }, computed: { @@ -37,26 +37,26 @@ export default { <div> <span class="bold d-block mb-1">{{ __('File browser') }}</span> <div class="btn-group d-flex"> - <gl-button + <gl-deprecated-button :class="{ active: !renderTreeList }" class="w-100 js-list-view" @click="setRenderTreeList(false)" > {{ __('List view') }} - </gl-button> - <gl-button + </gl-deprecated-button> + <gl-deprecated-button :class="{ active: renderTreeList }" class="w-100 js-tree-view" @click="setRenderTreeList(true)" > {{ __('Tree view') }} - </gl-button> + </gl-deprecated-button> </div> </div> <div class="mt-2"> <span class="bold d-block mb-1">{{ __('Compare changes') }}</span> <div class="btn-group d-flex js-diff-view-buttons"> - <gl-button + <gl-deprecated-button id="inline-diff-btn" :class="{ active: isInlineView }" class="w-100 js-inline-diff-button" @@ -64,8 +64,8 @@ export default { @click="setInlineDiffViewType" > {{ __('Inline') }} - </gl-button> - <gl-button + </gl-deprecated-button> + <gl-deprecated-button id="parallel-diff-btn" :class="{ active: isParallelView }" class="w-100 js-parallel-diff-button" @@ -73,7 +73,7 @@ export default { @click="setParallelDiffViewType" > {{ __('Side-by-side') }} - </gl-button> + </gl-deprecated-button> </div> </div> <div class="mt-2"> diff --git a/app/assets/javascripts/environments/components/enable_review_app_button.vue b/app/assets/javascripts/environments/components/enable_review_app_button.vue index 8fbbc5189bf..f86072696c2 100644 --- a/app/assets/javascripts/environments/components/enable_review_app_button.vue +++ b/app/assets/javascripts/environments/components/enable_review_app_button.vue @@ -1,11 +1,11 @@ <script> -import { GlButton, GlModal, GlModalDirective, GlLink, GlSprintf } from '@gitlab/ui'; +import { GlDeprecatedButton, GlModal, GlModalDirective, GlLink, GlSprintf } from '@gitlab/ui'; import ModalCopyButton from '~/vue_shared/components/modal_copy_button.vue'; import { s__ } from '~/locale'; export default { components: { - GlButton, + GlDeprecatedButton, GlLink, GlModal, GlSprintf, @@ -44,7 +44,7 @@ export default { </script> <template> <div> - <gl-button + <gl-deprecated-button v-gl-modal="$options.modalInfo.id" variant="info" category="secondary" @@ -52,7 +52,7 @@ export default { class="js-enable-review-app-button" > {{ s__('Environments|Enable review app') }} - </gl-button> + </gl-deprecated-button> <gl-modal :modal-id="$options.modalInfo.id" :title="$options.modalInfo.title" diff --git a/app/assets/javascripts/environments/components/environment_monitoring.vue b/app/assets/javascripts/environments/components/environment_monitoring.vue index 7b4b633dc7f..bd6feb14319 100644 --- a/app/assets/javascripts/environments/components/environment_monitoring.vue +++ b/app/assets/javascripts/environments/components/environment_monitoring.vue @@ -1,5 +1,5 @@ <script> -import { GlButton, GlTooltipDirective } from '@gitlab/ui'; +import { GlDeprecatedButton, GlTooltipDirective } from '@gitlab/ui'; import { __ } from '~/locale'; /** * Renders the Monitoring (Metrics) link in environments table. @@ -9,7 +9,7 @@ import Icon from '~/vue_shared/components/icon.vue'; export default { components: { Icon, - GlButton, + GlDeprecatedButton, }, directives: { GlTooltip: GlTooltipDirective, @@ -28,7 +28,7 @@ export default { }; </script> <template> - <gl-button + <gl-deprecated-button v-gl-tooltip :href="monitoringUrl" :title="title" @@ -38,5 +38,5 @@ export default { variant="default" > <icon name="chart" /> - </gl-button> + </gl-deprecated-button> </template> diff --git a/app/assets/javascripts/environments/components/environment_pin.vue b/app/assets/javascripts/environments/components/environment_pin.vue index 7908928a7ac..3a219e98b08 100644 --- a/app/assets/javascripts/environments/components/environment_pin.vue +++ b/app/assets/javascripts/environments/components/environment_pin.vue @@ -3,7 +3,7 @@ * Renders a prevent auto-stop button. * Used in environments table. */ -import { GlButton, GlTooltipDirective } from '@gitlab/ui'; +import { GlDeprecatedButton, GlTooltipDirective } from '@gitlab/ui'; import Icon from '~/vue_shared/components/icon.vue'; import { __ } from '~/locale'; import eventHub from '../event_hub'; @@ -11,7 +11,7 @@ import eventHub from '../event_hub'; export default { components: { Icon, - GlButton, + GlDeprecatedButton, }, directives: { GlTooltip: GlTooltipDirective, @@ -31,7 +31,12 @@ export default { }; </script> <template> - <gl-button v-gl-tooltip :title="$options.title" :aria-label="$options.title" @click="onPinClick"> + <gl-deprecated-button + v-gl-tooltip + :title="$options.title" + :aria-label="$options.title" + @click="onPinClick" + > <icon name="thumbtack" /> - </gl-button> + </gl-deprecated-button> </template> diff --git a/app/assets/javascripts/environments/components/environment_rollback.vue b/app/assets/javascripts/environments/components/environment_rollback.vue index 577e480d210..7a728961b37 100644 --- a/app/assets/javascripts/environments/components/environment_rollback.vue +++ b/app/assets/javascripts/environments/components/environment_rollback.vue @@ -5,7 +5,12 @@ * * Makes a post request when the button is clicked. */ -import { GlTooltipDirective, GlLoadingIcon, GlModalDirective, GlButton } from '@gitlab/ui'; +import { + GlTooltipDirective, + GlLoadingIcon, + GlModalDirective, + GlDeprecatedButton, +} from '@gitlab/ui'; import { s__ } from '~/locale'; import Icon from '~/vue_shared/components/icon.vue'; import eventHub from '../event_hub'; @@ -14,7 +19,7 @@ export default { components: { Icon, GlLoadingIcon, - GlButton, + GlDeprecatedButton, }, directives: { GlTooltip: GlTooltipDirective, @@ -68,7 +73,7 @@ export default { }; </script> <template> - <gl-button + <gl-deprecated-button v-gl-tooltip v-gl-modal.confirm-rollback-modal :disabled="isLoading" @@ -78,5 +83,5 @@ export default { > <icon v-if="isLastDeployment" name="repeat" /> <icon v-else name="redo" /> <gl-loading-icon v-if="isLoading" /> - </gl-button> + </gl-deprecated-button> </template> diff --git a/app/assets/javascripts/environments/components/environments_app.vue b/app/assets/javascripts/environments/components/environments_app.vue index cc1d86d06ed..0cc6f3df2d7 100644 --- a/app/assets/javascripts/environments/components/environments_app.vue +++ b/app/assets/javascripts/environments/components/environments_app.vue @@ -1,5 +1,5 @@ <script> -import { GlButton } from '@gitlab/ui'; +import { GlDeprecatedButton } from '@gitlab/ui'; import envrionmentsAppMixin from 'ee_else_ce/environments/mixins/environments_app_mixin'; import Flash from '~/flash'; import { s__ } from '~/locale'; @@ -17,7 +17,7 @@ export default { ConfirmRollbackModal, emptyState, EnableReviewAppButton, - GlButton, + GlDeprecatedButton, StopEnvironmentModal, DeleteEnvironmentModal, }, @@ -105,14 +105,14 @@ export default { <div class="nav-controls"> <enable-review-app-button v-if="state.reviewAppDetails.can_setup_review_app" class="mr-2" /> - <gl-button + <gl-deprecated-button v-if="canCreateEnvironment && !isLoading" :href="newEnvironmentPath" category="primary" variant="success" > {{ s__('Environments|New environment') }} - </gl-button> + </gl-deprecated-button> </div> </div> diff --git a/app/assets/javascripts/error_tracking/components/error_details.vue b/app/assets/javascripts/error_tracking/components/error_details.vue index 6c4f59eb49f..a8103c80da0 100644 --- a/app/assets/javascripts/error_tracking/components/error_details.vue +++ b/app/assets/javascripts/error_tracking/components/error_details.vue @@ -3,7 +3,7 @@ import { mapActions, mapGetters, mapState } from 'vuex'; import dateFormat from 'dateformat'; import createFlash from '~/flash'; import { - GlButton, + GlDeprecatedButton, GlFormInput, GlLink, GlLoadingIcon, @@ -29,7 +29,7 @@ const SENTRY_TIMEOUT = 10000; export default { components: { - GlButton, + GlDeprecatedButton, GlFormInput, GlLink, GlLoadingIcon, @@ -257,22 +257,22 @@ export default { </div> <div class="error-details-actions"> <div class="d-inline-flex bv-d-sm-down-none"> - <gl-button + <gl-deprecated-button :loading="updatingIgnoreStatus" data-qa-selector="update_ignore_status_button" @click="onIgnoreStatusUpdate" > {{ ignoreBtnLabel }} - </gl-button> - <gl-button + </gl-deprecated-button> + <gl-deprecated-button class="btn-outline-info ml-2" :loading="updatingResolveStatus" data-qa-selector="update_resolve_status_button" @click="onResolveStatusUpdate" > {{ resolveBtnLabel }} - </gl-button> - <gl-button + </gl-deprecated-button> + <gl-deprecated-button v-if="error.gitlabIssuePath" class="ml-2" data-qa-selector="view_issue_button" @@ -280,7 +280,7 @@ export default { variant="success" > {{ __('View issue') }} - </gl-button> + </gl-deprecated-button> <form ref="sentryIssueForm" :action="projectIssuesPath" @@ -295,7 +295,7 @@ export default { name="issue[sentry_issue_attributes][sentry_issue_identifier]" /> <gl-form-input :value="csrfToken" class="hidden" name="authenticity_token" /> - <gl-button + <gl-deprecated-button v-if="!error.gitlabIssuePath" class="btn-success" :loading="issueCreationInProgress" @@ -303,7 +303,7 @@ export default { @click="createIssue" > {{ __('Create issue') }} - </gl-button> + </gl-deprecated-button> </form> </div> <gl-dropdown diff --git a/app/assets/javascripts/error_tracking/components/error_tracking_actions.vue b/app/assets/javascripts/error_tracking/components/error_tracking_actions.vue index 49eb04e331b..0e3fd70b17b 100644 --- a/app/assets/javascripts/error_tracking/components/error_tracking_actions.vue +++ b/app/assets/javascripts/error_tracking/components/error_tracking_actions.vue @@ -1,5 +1,5 @@ <script> -import { GlButton, GlIcon, GlButtonGroup, GlTooltipDirective } from '@gitlab/ui'; +import { GlDeprecatedButton, GlIcon, GlButtonGroup, GlTooltipDirective } from '@gitlab/ui'; import { __ } from '~/locale'; const IGNORED = 'ignored'; @@ -10,7 +10,7 @@ const statusValidation = [IGNORED, RESOLVED, UNRESOLVED]; export default { components: { - GlButton, + GlDeprecatedButton, GlIcon, GlButtonGroup, }, @@ -45,7 +45,7 @@ export default { <template> <div> <gl-button-group class="flex-column flex-md-row ml-0 ml-md-n4"> - <gl-button + <gl-deprecated-button :key="ignoreBtn.status" :ref="`${ignoreBtn.title.toLowerCase()}Error`" v-gl-tooltip.hover @@ -55,8 +55,8 @@ export default { > <gl-icon class="d-none d-md-inline m-0" :name="ignoreBtn.icon" :size="12" /> <span class="d-md-none">{{ ignoreBtn.title }}</span> - </gl-button> - <gl-button + </gl-deprecated-button> + <gl-deprecated-button :key="resolveBtn.status" :ref="`${resolveBtn.title.toLowerCase()}Error`" v-gl-tooltip.hover @@ -66,15 +66,15 @@ export default { > <gl-icon class="d-none d-md-inline m-0" :name="resolveBtn.icon" :size="12" /> <span class="d-md-none">{{ resolveBtn.title }}</span> - </gl-button> + </gl-deprecated-button> </gl-button-group> - <gl-button + <gl-deprecated-button :href="detailsLink" category="secondary" variant="info" class="d-block d-md-none mb-2 mb-md-0" > {{ __('More details') }} - </gl-button> + </gl-deprecated-button> </div> </template> diff --git a/app/assets/javascripts/error_tracking/components/error_tracking_list.vue b/app/assets/javascripts/error_tracking/components/error_tracking_list.vue index ea0baaf4569..3d700f4d216 100644 --- a/app/assets/javascripts/error_tracking/components/error_tracking_list.vue +++ b/app/assets/javascripts/error_tracking/components/error_tracking_list.vue @@ -2,7 +2,7 @@ import { mapActions, mapState } from 'vuex'; import { GlEmptyState, - GlButton, + GlDeprecatedButton, GlIcon, GlLink, GlLoadingIcon, @@ -69,7 +69,7 @@ export default { }, components: { GlEmptyState, - GlButton, + GlDeprecatedButton, GlDropdown, GlDropdownItem, GlDropdownDivider, @@ -250,7 +250,7 @@ export default { /> </div> <div class="gl-search-box-by-type-right-icons"> - <gl-button + <gl-deprecated-button v-if="errorSearchQuery.length > 0" v-gl-tooltip.hover :title="__('Clear')" @@ -259,7 +259,7 @@ export default { @click="errorSearchQuery = ''" > <gl-icon name="close" :size="12" /> - </gl-button> + </gl-deprecated-button> </div> </div> </div> diff --git a/app/assets/javascripts/error_tracking_settings/components/app.vue b/app/assets/javascripts/error_tracking_settings/components/app.vue index 786abc8ce49..7ae847e6105 100644 --- a/app/assets/javascripts/error_tracking_settings/components/app.vue +++ b/app/assets/javascripts/error_tracking_settings/components/app.vue @@ -1,11 +1,11 @@ <script> import { mapActions, mapGetters, mapState } from 'vuex'; -import { GlButton } from '@gitlab/ui'; +import { GlDeprecatedButton } from '@gitlab/ui'; import ProjectDropdown from './project_dropdown.vue'; import ErrorTrackingForm from './error_tracking_form.vue'; export default { - components: { ProjectDropdown, ErrorTrackingForm, GlButton }, + components: { ProjectDropdown, ErrorTrackingForm, GlDeprecatedButton }, props: { initialApiHost: { type: String, @@ -92,13 +92,13 @@ export default { @select-project="updateSelectedProject" /> </div> - <gl-button + <gl-deprecated-button :disabled="settingsLoading" class="js-error-tracking-button" variant="success" @click="handleSubmit" > {{ __('Save changes') }} - </gl-button> + </gl-deprecated-button> </div> </template> diff --git a/app/assets/javascripts/grafana_integration/components/grafana_integration.vue b/app/assets/javascripts/grafana_integration/components/grafana_integration.vue index 22cafd50bf3..5295b2197d5 100644 --- a/app/assets/javascripts/grafana_integration/components/grafana_integration.vue +++ b/app/assets/javascripts/grafana_integration/components/grafana_integration.vue @@ -1,11 +1,11 @@ <script> -import { GlButton, GlFormGroup, GlFormInput, GlFormCheckbox } from '@gitlab/ui'; +import { GlDeprecatedButton, GlFormGroup, GlFormInput, GlFormCheckbox } from '@gitlab/ui'; import { mapState, mapActions } from 'vuex'; import Icon from '~/vue_shared/components/icon.vue'; export default { components: { - GlButton, + GlDeprecatedButton, GlFormCheckbox, GlFormGroup, GlFormInput, @@ -58,7 +58,7 @@ export default { <h3 class="js-section-header h4"> {{ s__('GrafanaIntegration|Grafana Authentication') }} </h3> - <gl-button class="js-settings-toggle">{{ __('Expand') }}</gl-button> + <gl-deprecated-button class="js-settings-toggle">{{ __('Expand') }}</gl-deprecated-button> <p class="js-section-sub-header"> {{ s__('GrafanaIntegration|Embed Grafana charts in GitLab issues.') }} </p> @@ -93,9 +93,9 @@ export default { </a> </p> </gl-form-group> - <gl-button variant="success" @click="updateGrafanaIntegration"> + <gl-deprecated-button variant="success" @click="updateGrafanaIntegration"> {{ __('Save Changes') }} - </gl-button> + </gl-deprecated-button> </form> </div> </section> diff --git a/app/assets/javascripts/ide/components/ide.vue b/app/assets/javascripts/ide/components/ide.vue index 6ed863c9c2e..7ebcacc530f 100644 --- a/app/assets/javascripts/ide/components/ide.vue +++ b/app/assets/javascripts/ide/components/ide.vue @@ -1,7 +1,7 @@ <script> import Vue from 'vue'; import { mapActions, mapGetters, mapState } from 'vuex'; -import { GlButton, GlLoadingIcon } from '@gitlab/ui'; +import { GlDeprecatedButton, GlLoadingIcon } from '@gitlab/ui'; import { __ } from '~/locale'; import FindFile from '~/vue_shared/components/file_finder/index.vue'; import NewModal from './new_dropdown/modal.vue'; @@ -23,7 +23,7 @@ export default { FindFile, ErrorMessage, CommitEditorHeader, - GlButton, + GlDeprecatedButton, GlLoadingIcon, }, props: { @@ -121,14 +121,14 @@ export default { ) }} </p> - <gl-button + <gl-deprecated-button variant="success" :title="__('New file')" :aria-label="__('New file')" @click="openNewEntryModal({ type: 'blob' })" > {{ __('New file') }} - </gl-button> + </gl-deprecated-button> </template> <gl-loading-icon v-else-if="!currentTree || currentTree.loading" size="md" /> <p v-else> diff --git a/app/assets/javascripts/jobs/components/job_log_controllers.vue b/app/assets/javascripts/jobs/components/job_log_controllers.vue index 156735441ca..bcec83a7aee 100644 --- a/app/assets/javascripts/jobs/components/job_log_controllers.vue +++ b/app/assets/javascripts/jobs/components/job_log_controllers.vue @@ -1,5 +1,5 @@ <script> -import { GlTooltipDirective, GlLink, GlButton } from '@gitlab/ui'; +import { GlTooltipDirective, GlLink, GlDeprecatedButton } from '@gitlab/ui'; import { polyfillSticky } from '~/lib/utils/sticky'; import Icon from '~/vue_shared/components/icon.vue'; import { numberToHumanSize } from '~/lib/utils/number_utils'; @@ -10,7 +10,7 @@ export default { components: { Icon, GlLink, - GlButton, + GlDeprecatedButton, }, directives: { GlTooltip: GlTooltipDirective, @@ -111,18 +111,18 @@ export default { <!-- scroll buttons --> <div v-gl-tooltip :title="s__('Job|Scroll to top')" class="controllers-buttons"> - <gl-button + <gl-deprecated-button :disabled="isScrollTopDisabled" type="button" class="js-scroll-top btn-scroll btn-transparent btn-blank" @click="handleScrollToTop" > <icon name="scroll_up" /> - </gl-button> + </gl-deprecated-button> </div> <div v-gl-tooltip :title="s__('Job|Scroll to bottom')" class="controllers-buttons"> - <gl-button + <gl-deprecated-button :disabled="isScrollBottomDisabled" class="js-scroll-bottom btn-scroll btn-transparent btn-blank" :class="{ animate: isScrollingDown }" diff --git a/app/assets/javascripts/jobs/components/manual_variables_form.vue b/app/assets/javascripts/jobs/components/manual_variables_form.vue index a23f30d571a..d4aab5c7faf 100644 --- a/app/assets/javascripts/jobs/components/manual_variables_form.vue +++ b/app/assets/javascripts/jobs/components/manual_variables_form.vue @@ -1,14 +1,14 @@ <script> import { uniqueId } from 'lodash'; import { mapActions } from 'vuex'; -import { GlButton } from '@gitlab/ui'; +import { GlDeprecatedButton } from '@gitlab/ui'; import { s__, sprintf } from '~/locale'; import Icon from '~/vue_shared/components/icon.vue'; export default { name: 'ManualVariablesForm', components: { - GlButton, + GlDeprecatedButton, Icon, }, props: { @@ -137,9 +137,12 @@ export default { <div class="table-section section-10"> <div class="table-mobile-header" role="rowheader"></div> <div class="table-mobile-content justify-content-end"> - <gl-button class="btn-transparent btn-blank w-25" @click="deleteVariable(variable.id)"> + <gl-deprecated-button + class="btn-transparent btn-blank w-25" + @click="deleteVariable(variable.id)" + > <icon name="clear" /> - </gl-button> + </gl-deprecated-button> </div> </div> </div> @@ -173,9 +176,9 @@ export default { <p class="text-muted" v-html="helpText"></p> </div> <div class="d-flex justify-content-center"> - <gl-button variant="primary" @click="triggerManualJob(variables)"> + <gl-deprecated-button variant="primary" @click="triggerManualJob(variables)"> {{ action.button_title }} - </gl-button> + </gl-deprecated-button> </div> </div> </template> diff --git a/app/assets/javascripts/jobs/components/sidebar.vue b/app/assets/javascripts/jobs/components/sidebar.vue index f1683bc2195..83ba528cfa2 100644 --- a/app/assets/javascripts/jobs/components/sidebar.vue +++ b/app/assets/javascripts/jobs/components/sidebar.vue @@ -1,7 +1,7 @@ <script> import { isEmpty } from 'lodash'; import { mapActions, mapState } from 'vuex'; -import { GlLink, GlButton } from '@gitlab/ui'; +import { GlLink, GlDeprecatedButton } from '@gitlab/ui'; import { __, sprintf } from '~/locale'; import timeagoMixin from '~/vue_shared/mixins/timeago'; import { timeIntervalInWords } from '~/lib/utils/datetime_utility'; @@ -24,7 +24,7 @@ export default { StagesDropdown, JobsContainer, GlLink, - GlButton, + GlDeprecatedButton, }, mixins: [timeagoMixin], props: { @@ -133,14 +133,14 @@ export default { > </div> - <gl-button + <gl-deprecated-button :aria-label="__('Toggle Sidebar')" type="button" class="btn btn-blank gutter-toggle float-right d-block d-md-none js-sidebar-build-toggle" @click="toggleSidebar" > <i aria-hidden="true" data-hidden="true" class="fa fa-angle-double-right"></i> - </gl-button> + </gl-deprecated-button> </div> <div v-if="job.terminal_path || job.new_issue_path" class="block retry-link"> diff --git a/app/assets/javascripts/jobs/components/trigger_block.vue b/app/assets/javascripts/jobs/components/trigger_block.vue index 5edb8ff555b..7c9b2824a43 100644 --- a/app/assets/javascripts/jobs/components/trigger_block.vue +++ b/app/assets/javascripts/jobs/components/trigger_block.vue @@ -1,12 +1,12 @@ <script> -import { GlButton } from '@gitlab/ui'; +import { GlDeprecatedButton } from '@gitlab/ui'; import { __ } from '~/locale'; const HIDDEN_VALUE = '••••••'; export default { components: { - GlButton, + GlDeprecatedButton, }, props: { trigger: { @@ -55,11 +55,11 @@ export default { <p class="trigger-variables-btn-container d-flex"> <span class="font-weight-bold">{{ __('Trigger variables:') }}</span> - <gl-button + <gl-deprecated-button v-if="hasValues" class="btn-sm group js-reveal-variables trigger-variables-btn" @click="toggleValues" - >{{ getToggleButtonText }}</gl-button + >{{ getToggleButtonText }}</gl-deprecated-button > </p> diff --git a/app/assets/javascripts/logs/components/log_control_buttons.vue b/app/assets/javascripts/logs/components/log_control_buttons.vue index 170d0474447..3f5de4c22e0 100644 --- a/app/assets/javascripts/logs/components/log_control_buttons.vue +++ b/app/assets/javascripts/logs/components/log_control_buttons.vue @@ -1,11 +1,11 @@ <script> -import { GlButton, GlTooltipDirective } from '@gitlab/ui'; +import { GlDeprecatedButton, GlTooltipDirective } from '@gitlab/ui'; import Icon from '~/vue_shared/components/icon.vue'; export default { components: { Icon, - GlButton, + GlDeprecatedButton, }, directives: { GlTooltip: GlTooltipDirective, @@ -51,14 +51,14 @@ export default { :title="__('Scroll to top')" aria-labelledby="scroll-to-top" > - <gl-button + <gl-deprecated-button id="scroll-to-top" class="btn-blank js-scroll-to-top" :aria-label="__('Scroll to top')" :disabled="scrollUpButtonDisabled" @click="handleScrollUp()" ><icon name="scroll_up" - /></gl-button> + /></gl-deprecated-button> </div> <div v-if="scrollDownAvailable" @@ -68,7 +68,7 @@ export default { :title="__('Scroll to bottom')" aria-labelledby="scroll-to-bottom" > - <gl-button + <gl-deprecated-button id="scroll-to-bottom" class="btn-blank js-scroll-to-bottom" :aria-label="__('Scroll to bottom')" @@ -76,9 +76,9 @@ export default { :disabled="scrollDownButtonDisabled" @click="handleScrollDown()" ><icon name="scroll_down" - /></gl-button> + /></gl-deprecated-button> </div> - <gl-button + <gl-deprecated-button id="refresh-log" v-gl-tooltip class="ml-1 px-2 js-refresh-log" @@ -87,6 +87,6 @@ export default { @click="handleRefreshClick" > <icon name="retry" /> - </gl-button> + </gl-deprecated-button> </div> </template> diff --git a/app/assets/javascripts/maintenance_mode_settings/components/app.vue b/app/assets/javascripts/maintenance_mode_settings/components/app.vue index 47150c9dc95..7798c443914 100644 --- a/app/assets/javascripts/maintenance_mode_settings/components/app.vue +++ b/app/assets/javascripts/maintenance_mode_settings/components/app.vue @@ -1,5 +1,5 @@ <script> -import { GlToggle, GlFormGroup, GlFormTextarea, GlButton } from '@gitlab/ui'; +import { GlToggle, GlFormGroup, GlFormTextarea, GlDeprecatedButton } from '@gitlab/ui'; export default { name: 'MaintenanceModeSettingsApp', @@ -7,7 +7,7 @@ export default { GlToggle, GlFormGroup, GlFormTextarea, - GlButton, + GlDeprecatedButton, }, data() { return { @@ -38,7 +38,7 @@ export default { /> </gl-form-group> <div class="mt-4"> - <gl-button variant="success">{{ __('Save changes') }}</gl-button> + <gl-deprecated-button variant="success">{{ __('Save changes') }}</gl-deprecated-button> </div> </article> </template> diff --git a/app/assets/javascripts/monitoring/components/charts/time_series.vue b/app/assets/javascripts/monitoring/components/charts/time_series.vue index ca416650f34..0ddd690ce0c 100644 --- a/app/assets/javascripts/monitoring/components/charts/time_series.vue +++ b/app/assets/javascripts/monitoring/components/charts/time_series.vue @@ -1,6 +1,6 @@ <script> import { omit, throttle } from 'lodash'; -import { GlLink, GlButton, GlTooltip, GlResizeObserverDirective } from '@gitlab/ui'; +import { GlLink, GlDeprecatedButton, GlTooltip, GlResizeObserverDirective } from '@gitlab/ui'; import { GlAreaChart, GlLineChart, GlChartSeriesLabel } from '@gitlab/ui/dist/charts'; import dateFormat from 'dateformat'; import { s__, __ } from '~/locale'; @@ -41,7 +41,7 @@ export default { GlAreaChart, GlLineChart, GlTooltip, - GlButton, + GlDeprecatedButton, GlChartSeriesLabel, GlLink, Icon, diff --git a/app/assets/javascripts/monitoring/components/dashboard.vue b/app/assets/javascripts/monitoring/components/dashboard.vue index cebe501139c..2229b6d8292 100644 --- a/app/assets/javascripts/monitoring/components/dashboard.vue +++ b/app/assets/javascripts/monitoring/components/dashboard.vue @@ -3,7 +3,7 @@ import { debounce, pickBy } from 'lodash'; import { mapActions, mapState, mapGetters } from 'vuex'; import VueDraggable from 'vuedraggable'; import { - GlButton, + GlDeprecatedButton, GlDropdown, GlDropdownItem, GlDropdownHeader, @@ -44,7 +44,7 @@ export default { VueDraggable, PanelType, Icon, - GlButton, + GlDeprecatedButton, GlDropdown, GlLoadingIcon, GlDropdownItem, @@ -471,7 +471,7 @@ export default { </gl-form-group> <gl-form-group class="col-sm-2 col-md-2 col-lg-1 refresh-dashboard-button"> - <gl-button + <gl-deprecated-button ref="refreshDashboardBtn" v-gl-tooltip variant="default" @@ -479,7 +479,7 @@ export default { @click="refreshDashboard" > <icon name="repeat" /> - </gl-button> + </gl-deprecated-button> </gl-form-group> <gl-form-group @@ -488,22 +488,22 @@ export default { class="dropdown-buttons col-md d-md-flex col-lg d-lg-flex align-items-end" > <div id="prometheus-graphs-dropdown-buttons"> - <gl-button + <gl-deprecated-button v-if="showRearrangePanelsBtn" :pressed="isRearrangingPanels" variant="default" class="mr-2 mt-1 js-rearrange-button" @click="toggleRearrangingPanels" - >{{ __('Arrange charts') }}</gl-button + >{{ __('Arrange charts') }}</gl-deprecated-button > - <gl-button + <gl-deprecated-button v-if="addingMetricsAvailable" ref="addMetricBtn" v-gl-modal="$options.addMetric.modalId" variant="outline-success" data-qa-selector="add_metric_button" class="mr-2 mt-1" - >{{ $options.addMetric.title }}</gl-button + >{{ $options.addMetric.title }}</gl-deprecated-button > <gl-modal v-if="addingMetricsAvailable" @@ -519,27 +519,29 @@ export default { /> </form> <div slot="modal-footer"> - <gl-button @click="hideAddMetricModal">{{ __('Cancel') }}</gl-button> - <gl-button + <gl-deprecated-button @click="hideAddMetricModal">{{ + __('Cancel') + }}</gl-deprecated-button> + <gl-deprecated-button ref="submitCustomMetricsFormBtn" v-track-event="getAddMetricTrackingOptions()" :disabled="!formIsValid" variant="success" @click="submitCustomMetricsForm" - >{{ __('Save changes') }}</gl-button + >{{ __('Save changes') }}</gl-deprecated-button > </div> </gl-modal> - <gl-button + <gl-deprecated-button v-if="selectedDashboard.can_edit" class="mt-1 js-edit-link" :href="selectedDashboard.project_blob_path" data-qa-selector="edit_dashboard_button" - >{{ __('Edit dashboard') }}</gl-button + >{{ __('Edit dashboard') }}</gl-deprecated-button > - <gl-button + <gl-deprecated-button v-if="externalDashboardUrl.length" class="mt-1 js-external-dashboard-link" variant="primary" @@ -549,7 +551,7 @@ export default { > {{ __('View full dashboard') }} <icon name="external-link" /> - </gl-button> + </gl-deprecated-button> </div> </gl-form-group> </div> diff --git a/app/assets/javascripts/monitoring/components/embeds/embed_group.vue b/app/assets/javascripts/monitoring/components/embeds/embed_group.vue index b8562afe441..b60c87fee82 100644 --- a/app/assets/javascripts/monitoring/components/embeds/embed_group.vue +++ b/app/assets/javascripts/monitoring/components/embeds/embed_group.vue @@ -1,14 +1,14 @@ <script> import { mapState, mapActions, mapGetters } from 'vuex'; import sum from 'lodash/sum'; -import { GlButton, GlCard, GlIcon } from '@gitlab/ui'; +import { GlDeprecatedButton, GlCard, GlIcon } from '@gitlab/ui'; import { n__ } from '~/locale'; import { monitoringDashboard } from '~/monitoring/stores'; import MetricEmbed from './metric_embed.vue'; export default { components: { - GlButton, + GlDeprecatedButton, GlCard, GlIcon, MetricEmbed, @@ -78,7 +78,7 @@ export default { :body-class="bodyClass" > <template #header> - <gl-button + <gl-deprecated-button class="collapsible-card-btn d-flex text-decoration-none" :aria-label="buttonLabel" variant="link" @@ -86,7 +86,7 @@ export default { > <gl-icon class="mr-1" :name="arrowIconName" /> {{ buttonLabel }} - </gl-button> + </gl-deprecated-button> </template> <div class="d-flex flex-wrap"> <metric-embed diff --git a/app/assets/javascripts/mr_tabs_popover/components/popover.vue b/app/assets/javascripts/mr_tabs_popover/components/popover.vue index f8293d2a473..30455709149 100644 --- a/app/assets/javascripts/mr_tabs_popover/components/popover.vue +++ b/app/assets/javascripts/mr_tabs_popover/components/popover.vue @@ -1,12 +1,12 @@ <script> -import { GlPopover, GlButton, GlLink } from '@gitlab/ui'; +import { GlPopover, GlDeprecatedButton, GlLink } from '@gitlab/ui'; import Icon from '~/vue_shared/components/icon.vue'; import axios from '~/lib/utils/axios_utils'; export default { components: { GlPopover, - GlButton, + GlDeprecatedButton, GlLink, Icon, }, @@ -57,13 +57,13 @@ export default { <icon name="external-link" :size="10" /> </gl-link> </p> - <gl-button + <gl-deprecated-button variant="primary" size="sm" data-qa-selector="dismiss_popover_button" @click="onDismiss" > {{ __('Got it') }} - </gl-button> + </gl-deprecated-button> </gl-popover> </template> diff --git a/app/assets/javascripts/notes/components/discussion_filter_note.vue b/app/assets/javascripts/notes/components/discussion_filter_note.vue index 8dc4b43d69a..25ff49fbd0f 100644 --- a/app/assets/javascripts/notes/components/discussion_filter_note.vue +++ b/app/assets/javascripts/notes/components/discussion_filter_note.vue @@ -1,5 +1,5 @@ <script> -import { GlButton } from '@gitlab/ui'; +import { GlDeprecatedButton } from '@gitlab/ui'; import Icon from '~/vue_shared/components/icon.vue'; import { __, sprintf } from '~/locale'; @@ -7,7 +7,7 @@ import notesEventHub from '../event_hub'; export default { components: { - GlButton, + GlDeprecatedButton, Icon, }, computed: { @@ -40,12 +40,12 @@ export default { <div class="timeline-content"> <div ref="timelineContent" v-html="timelineContent"></div> <div class="discussion-filter-actions mt-2"> - <gl-button ref="showAllActivity" variant="default" @click="selectFilter(0)"> + <gl-deprecated-button ref="showAllActivity" variant="default" @click="selectFilter(0)"> {{ __('Show all activity') }} - </gl-button> - <gl-button ref="showComments" variant="default" @click="selectFilter(1)"> + </gl-deprecated-button> + <gl-deprecated-button ref="showComments" variant="default" @click="selectFilter(1)"> {{ __('Show comments only') }} - </gl-button> + </gl-deprecated-button> </div> </div> </li> diff --git a/app/assets/javascripts/notes/components/discussion_resolve_with_issue_button.vue b/app/assets/javascripts/notes/components/discussion_resolve_with_issue_button.vue index 1d1529bfa5b..e5f78b1c7de 100644 --- a/app/assets/javascripts/notes/components/discussion_resolve_with_issue_button.vue +++ b/app/assets/javascripts/notes/components/discussion_resolve_with_issue_button.vue @@ -1,12 +1,12 @@ <script> -import { GlTooltipDirective, GlButton } from '@gitlab/ui'; +import { GlTooltipDirective, GlDeprecatedButton } from '@gitlab/ui'; import Icon from '~/vue_shared/components/icon.vue'; export default { name: 'ResolveWithIssueButton', components: { Icon, - GlButton, + GlDeprecatedButton, }, directives: { GlTooltip: GlTooltipDirective, @@ -22,13 +22,13 @@ export default { <template> <div class="btn-group" role="group"> - <gl-button + <gl-deprecated-button v-gl-tooltip :href="url" :title="s__('MergeRequests|Resolve this thread in a new issue')" class="new-issue-for-discussion discussion-create-issue-btn" > <icon name="issue-new" /> - </gl-button> + </gl-deprecated-button> </div> </template> diff --git a/app/assets/javascripts/notes/components/note_actions/reply_button.vue b/app/assets/javascripts/notes/components/note_actions/reply_button.vue index 20551279aec..30cb7967c34 100644 --- a/app/assets/javascripts/notes/components/note_actions/reply_button.vue +++ b/app/assets/javascripts/notes/components/note_actions/reply_button.vue @@ -1,12 +1,12 @@ <script> -import { GlTooltipDirective, GlButton } from '@gitlab/ui'; +import { GlTooltipDirective, GlDeprecatedButton } from '@gitlab/ui'; import Icon from '~/vue_shared/components/icon.vue'; export default { name: 'ReplyButton', components: { Icon, - GlButton, + GlDeprecatedButton, }, directives: { GlTooltip: GlTooltipDirective, @@ -16,7 +16,7 @@ export default { <template> <div class="note-actions-item"> - <gl-button + <gl-deprecated-button ref="button" v-gl-tooltip class="note-action-button" @@ -27,6 +27,6 @@ export default { @click="$emit('startReplying')" > <icon name="comment" class="link-highlight" /> - </gl-button> + </gl-deprecated-button> </div> </template> diff --git a/app/assets/javascripts/operation_settings/components/external_dashboard.vue b/app/assets/javascripts/operation_settings/components/external_dashboard.vue index 3594e30bd69..e9c7d7c5d56 100644 --- a/app/assets/javascripts/operation_settings/components/external_dashboard.vue +++ b/app/assets/javascripts/operation_settings/components/external_dashboard.vue @@ -1,10 +1,10 @@ <script> import { mapState, mapActions } from 'vuex'; -import { GlButton, GlFormGroup, GlFormInput, GlLink } from '@gitlab/ui'; +import { GlDeprecatedButton, GlFormGroup, GlFormInput, GlLink } from '@gitlab/ui'; export default { components: { - GlButton, + GlDeprecatedButton, GlFormGroup, GlFormInput, GlLink, @@ -36,7 +36,7 @@ export default { <h3 class="js-section-header h4"> {{ s__('ExternalMetrics|External Dashboard') }} </h3> - <gl-button class="js-settings-toggle">{{ __('Expand') }}</gl-button> + <gl-deprecated-button class="js-settings-toggle">{{ __('Expand') }}</gl-deprecated-button> <p class="js-section-sub-header"> {{ s__( @@ -63,9 +63,9 @@ export default { /> <!-- eslint-enable @gitlab/vue-require-i18n-attribute-strings --> </gl-form-group> - <gl-button variant="success" @click="updateExternalDashboardUrl"> + <gl-deprecated-button variant="success" @click="updateExternalDashboardUrl"> {{ __('Save Changes') }} - </gl-button> + </gl-deprecated-button> </form> </div> </section> diff --git a/app/assets/javascripts/pages/admin/users/components/delete_user_modal.vue b/app/assets/javascripts/pages/admin/users/components/delete_user_modal.vue index 831a3ca1658..5b7c8141084 100644 --- a/app/assets/javascripts/pages/admin/users/components/delete_user_modal.vue +++ b/app/assets/javascripts/pages/admin/users/components/delete_user_modal.vue @@ -1,12 +1,12 @@ <script> import { escape as esc } from 'lodash'; -import { GlModal, GlButton, GlFormInput } from '@gitlab/ui'; +import { GlModal, GlDeprecatedButton, GlFormInput } from '@gitlab/ui'; import { s__, sprintf } from '~/locale'; export default { components: { GlModal, - GlButton, + GlDeprecatedButton, GlFormInput, }, props: { @@ -122,11 +122,15 @@ export default { </form> </template> <template slot="modal-footer"> - <gl-button variant="secondary" @click="onCancel">{{ s__('Cancel') }}</gl-button> - <gl-button :disabled="!canSubmit" variant="warning" @click="onSecondaryAction"> + <gl-deprecated-button variant="secondary" @click="onCancel">{{ + s__('Cancel') + }}</gl-deprecated-button> + <gl-deprecated-button :disabled="!canSubmit" variant="warning" @click="onSecondaryAction"> {{ secondaryAction }} - </gl-button> - <gl-button :disabled="!canSubmit" variant="danger" @click="onSubmit">{{ action }}</gl-button> + </gl-deprecated-button> + <gl-deprecated-button :disabled="!canSubmit" variant="danger" @click="onSubmit">{{ + action + }}</gl-deprecated-button> </template> </gl-modal> </template> diff --git a/app/assets/javascripts/pipelines/components/empty_state.vue b/app/assets/javascripts/pipelines/components/empty_state.vue index d16f49f981c..74ada6a4d15 100644 --- a/app/assets/javascripts/pipelines/components/empty_state.vue +++ b/app/assets/javascripts/pipelines/components/empty_state.vue @@ -1,10 +1,10 @@ <script> -import { GlButton } from '@gitlab/ui'; +import { GlDeprecatedButton } from '@gitlab/ui'; export default { name: 'PipelinesEmptyState', components: { - GlButton, + GlDeprecatedButton, }, props: { helpPagePath: { @@ -43,9 +43,13 @@ export default { </p> <div class="text-center"> - <gl-button :href="helpPagePath" variant="primary" class="js-get-started-pipelines"> + <gl-deprecated-button + :href="helpPagePath" + variant="primary" + class="js-get-started-pipelines" + > {{ s__('Pipelines|Get started with Pipelines') }} - </gl-button> + </gl-deprecated-button> </div> </template> diff --git a/app/assets/javascripts/pipelines/components/graph/action_component.vue b/app/assets/javascripts/pipelines/components/graph/action_component.vue index fd59a580961..c5e95036f4f 100644 --- a/app/assets/javascripts/pipelines/components/graph/action_component.vue +++ b/app/assets/javascripts/pipelines/components/graph/action_component.vue @@ -1,5 +1,5 @@ <script> -import { GlTooltipDirective, GlButton, GlLoadingIcon } from '@gitlab/ui'; +import { GlTooltipDirective, GlDeprecatedButton, GlLoadingIcon } from '@gitlab/ui'; import axios from '~/lib/utils/axios_utils'; import { dasherize } from '~/lib/utils/text_utility'; import { __ } from '~/locale'; @@ -19,7 +19,7 @@ import Icon from '~/vue_shared/components/icon.vue'; export default { components: { Icon, - GlButton, + GlDeprecatedButton, GlLoadingIcon, }, directives: { @@ -82,7 +82,7 @@ export default { }; </script> <template> - <gl-button + <gl-deprecated-button :id="`js-ci-action-${link}`" v-gl-tooltip="{ boundary: 'viewport' }" :title="tooltipText" @@ -93,5 +93,5 @@ export default { > <gl-loading-icon v-if="isLoading" class="js-action-icon-loading" /> <icon v-else :name="actionIcon" /> - </gl-button> + </gl-deprecated-button> </template> diff --git a/app/assets/javascripts/pipelines/components/graph/linked_pipeline.vue b/app/assets/javascripts/pipelines/components/graph/linked_pipeline.vue index d929398b6dc..550b9daa521 100644 --- a/app/assets/javascripts/pipelines/components/graph/linked_pipeline.vue +++ b/app/assets/javascripts/pipelines/components/graph/linked_pipeline.vue @@ -1,5 +1,5 @@ <script> -import { GlLoadingIcon, GlTooltipDirective, GlButton } from '@gitlab/ui'; +import { GlLoadingIcon, GlTooltipDirective, GlDeprecatedButton } from '@gitlab/ui'; import CiStatus from '~/vue_shared/components/ci_icon.vue'; import { __ } from '~/locale'; @@ -10,7 +10,7 @@ export default { components: { CiStatus, GlLoadingIcon, - GlButton, + GlDeprecatedButton, }, props: { pipeline: { @@ -78,7 +78,7 @@ export default { class="linked-pipeline build" :class="{ 'child-pipeline': childPipeline }" > - <gl-button + <gl-deprecated-button :id="buttonId" v-gl-tooltip :title="tooltipText" @@ -104,6 +104,6 @@ export default { >{{ label }}</span > </div> - </gl-button> + </gl-deprecated-button> </li> </template> diff --git a/app/assets/javascripts/pipelines/components/nav_controls.vue b/app/assets/javascripts/pipelines/components/nav_controls.vue index 5e4147f8805..4f6c9d2bd90 100644 --- a/app/assets/javascripts/pipelines/components/nav_controls.vue +++ b/app/assets/javascripts/pipelines/components/nav_controls.vue @@ -1,12 +1,12 @@ <script> -import { GlButton } from '@gitlab/ui'; +import { GlDeprecatedButton } from '@gitlab/ui'; import LoadingButton from '../../vue_shared/components/loading_button.vue'; export default { name: 'PipelineNavControls', components: { LoadingButton, - GlButton, + GlDeprecatedButton, }, props: { newPipelinePath: { @@ -42,14 +42,14 @@ export default { </script> <template> <div class="nav-controls"> - <gl-button + <gl-deprecated-button v-if="newPipelinePath" :href="newPipelinePath" variant="success" class="js-run-pipeline" > {{ s__('Pipelines|Run Pipeline') }} - </gl-button> + </gl-deprecated-button> <loading-button v-if="resetCachePath" @@ -59,8 +59,8 @@ export default { @click="onClickResetCache" /> - <gl-button v-if="ciLintPath" :href="ciLintPath" class="js-ci-lint"> + <gl-deprecated-button v-if="ciLintPath" :href="ciLintPath" class="js-ci-lint"> {{ s__('Pipelines|CI Lint') }} - </gl-button> + </gl-deprecated-button> </div> </template> diff --git a/app/assets/javascripts/pipelines/components/pipelines_actions.vue b/app/assets/javascripts/pipelines/components/pipelines_actions.vue index 9764e32955c..7d4276e8d2e 100644 --- a/app/assets/javascripts/pipelines/components/pipelines_actions.vue +++ b/app/assets/javascripts/pipelines/components/pipelines_actions.vue @@ -1,5 +1,5 @@ <script> -import { GlButton, GlTooltipDirective, GlLoadingIcon } from '@gitlab/ui'; +import { GlDeprecatedButton, GlTooltipDirective, GlLoadingIcon } from '@gitlab/ui'; import axios from '~/lib/utils/axios_utils'; import flash from '~/flash'; import { s__, __, sprintf } from '~/locale'; @@ -14,7 +14,7 @@ export default { components: { Icon, GlCountdown, - GlButton, + GlDeprecatedButton, GlLoadingIcon, }, props: { @@ -94,7 +94,7 @@ export default { <ul class="dropdown-menu dropdown-menu-right"> <li v-for="action in actions" :key="action.path"> - <gl-button + <gl-deprecated-button :class="{ disabled: isActionDisabled(action) }" :disabled="isActionDisabled(action)" class="js-pipeline-action-link no-btn btn d-flex align-items-center justify-content-between flex-wrap" @@ -105,7 +105,7 @@ export default { <icon name="clock" /> <gl-countdown :end-date-string="action.scheduled_at" /> </span> - </gl-button> + </gl-deprecated-button> </li> </ul> </div> diff --git a/app/assets/javascripts/pipelines/components/test_reports/test_summary.vue b/app/assets/javascripts/pipelines/components/test_reports/test_summary.vue index 2fa3fa41eed..9739ef76867 100644 --- a/app/assets/javascripts/pipelines/components/test_reports/test_summary.vue +++ b/app/assets/javascripts/pipelines/components/test_reports/test_summary.vue @@ -1,5 +1,5 @@ <script> -import { GlButton, GlProgressBar } from '@gitlab/ui'; +import { GlDeprecatedButton, GlProgressBar } from '@gitlab/ui'; import { __ } from '~/locale'; import { formatTime, secondsToMilliseconds } from '~/lib/utils/datetime_utility'; import Icon from '~/vue_shared/components/icon.vue'; @@ -7,7 +7,7 @@ import Icon from '~/vue_shared/components/icon.vue'; export default { name: 'TestSummary', components: { - GlButton, + GlDeprecatedButton, GlProgressBar, Icon, }, @@ -62,14 +62,14 @@ export default { <div> <div class="row"> <div class="col-12 d-flex prepend-top-8 align-items-center"> - <gl-button + <gl-deprecated-button v-if="showBack" size="sm" class="append-right-default js-back-button" @click="onBackClick" > <icon name="angle-left" /> - </gl-button> + </gl-deprecated-button> <h4>{{ heading }}</h4> </div> diff --git a/app/assets/javascripts/prometheus_alerts/components/reset_key.vue b/app/assets/javascripts/prometheus_alerts/components/reset_key.vue index 3a03cd409a6..15b6a29e5cf 100644 --- a/app/assets/javascripts/prometheus_alerts/components/reset_key.vue +++ b/app/assets/javascripts/prometheus_alerts/components/reset_key.vue @@ -1,5 +1,11 @@ <script> -import { GlButton, GlFormGroup, GlFormInput, GlModal, GlModalDirective } from '@gitlab/ui'; +import { + GlDeprecatedButton, + GlFormGroup, + GlFormInput, + GlModal, + GlModalDirective, +} from '@gitlab/ui'; import ClipboardButton from '~/vue_shared/components/clipboard_button.vue'; import axios from '~/lib/utils/axios_utils'; import { __, sprintf } from '~/locale'; @@ -8,7 +14,7 @@ import createFlash from '~/flash'; export default { copyToClipboard: __('Copy'), components: { - GlButton, + GlDeprecatedButton, GlFormGroup, GlFormInput, GlModal, @@ -112,13 +118,13 @@ export default { ) }} </gl-modal> - <gl-button v-gl-modal.authKeyModal class="js-reset-auth-key">{{ + <gl-deprecated-button v-gl-modal.authKeyModal class="js-reset-auth-key">{{ __('Reset key') - }}</gl-button> + }}</gl-deprecated-button> </template> - <gl-button v-else class="js-reset-auth-key" @click="resetKey">{{ + <gl-deprecated-button v-else class="js-reset-auth-key" @click="resetKey">{{ __('Generate key') - }}</gl-button> + }}</gl-deprecated-button> </div> </div> </template> diff --git a/app/assets/javascripts/registry/explorer/pages/details.vue b/app/assets/javascripts/registry/explorer/pages/details.vue index b558ed51a5b..6afd4d1107a 100644 --- a/app/assets/javascripts/registry/explorer/pages/details.vue +++ b/app/assets/javascripts/registry/explorer/pages/details.vue @@ -3,7 +3,7 @@ import { mapState, mapActions, mapGetters } from 'vuex'; import { GlTable, GlFormCheckbox, - GlButton, + GlDeprecatedButton, GlIcon, GlTooltipDirective, GlPagination, @@ -41,7 +41,7 @@ export default { components: { GlTable, GlFormCheckbox, - GlButton, + GlDeprecatedButton, GlIcon, ClipboardButton, GlPagination, @@ -250,7 +250,7 @@ export default { /> </template> <template #head(actions)> - <gl-button + <gl-deprecated-button ref="bulkDeleteButton" v-gl-tooltip :disabled="!selectedItems || selectedItems.length === 0" @@ -261,7 +261,7 @@ export default { @click="deleteMultipleItems()" > <gl-icon name="remove" /> - </gl-button> + </gl-deprecated-button> </template> <template #cell(checkbox)="{index}"> @@ -304,7 +304,7 @@ export default { </span> </template> <template #cell(actions)="{index, item}"> - <gl-button + <gl-deprecated-button ref="singleDeleteButton" :title="s__('ContainerRegistry|Remove tag')" :aria-label="s__('ContainerRegistry|Remove tag')" @@ -314,7 +314,7 @@ export default { @click="deleteSingleItem(index)" > <gl-icon name="remove" /> - </gl-button> + </gl-deprecated-button> </template> <template #empty> diff --git a/app/assets/javascripts/registry/explorer/pages/list.vue b/app/assets/javascripts/registry/explorer/pages/list.vue index 1ed24fbb59f..7204cbd90eb 100644 --- a/app/assets/javascripts/registry/explorer/pages/list.vue +++ b/app/assets/javascripts/registry/explorer/pages/list.vue @@ -4,7 +4,7 @@ import { GlEmptyState, GlPagination, GlTooltipDirective, - GlButton, + GlDeprecatedButton, GlIcon, GlModal, GlSprintf, @@ -30,7 +30,7 @@ export default { ProjectPolicyAlert, ClipboardButton, QuickstartDropdown, - GlButton, + GlDeprecatedButton, GlIcon, GlModal, GlSprintf, @@ -201,7 +201,7 @@ export default { class="d-none d-sm-block" :title="$options.i18n.deleteButtonDisabled" > - <gl-button + <gl-deprecated-button ref="deleteImageButton" v-gl-tooltip :disabled="!listItem.destroy_path" @@ -212,7 +212,7 @@ export default { @click="deleteImage(listItem)" > <gl-icon name="remove" /> - </gl-button> + </gl-deprecated-button> </div> </div> <gl-pagination diff --git a/app/assets/javascripts/registry/settings/components/settings_form.vue b/app/assets/javascripts/registry/settings/components/settings_form.vue index cab3c7fff85..afd502109bf 100644 --- a/app/assets/javascripts/registry/settings/components/settings_form.vue +++ b/app/assets/javascripts/registry/settings/components/settings_form.vue @@ -1,6 +1,6 @@ <script> import { mapActions, mapState, mapGetters } from 'vuex'; -import { GlCard, GlButton, GlLoadingIcon } from '@gitlab/ui'; +import { GlCard, GlDeprecatedButton, GlLoadingIcon } from '@gitlab/ui'; import Tracking from '~/tracking'; import { UPDATE_SETTINGS_ERROR_MESSAGE, @@ -12,7 +12,7 @@ import ExpirationPolicyFields from '../../shared/components/expiration_policy_fi export default { components: { GlCard, - GlButton, + GlDeprecatedButton, GlLoadingIcon, ExpirationPolicyFields, }, @@ -73,15 +73,15 @@ export default { </template> <template #footer> <div class="d-flex justify-content-end"> - <gl-button + <gl-deprecated-button ref="cancel-button" type="reset" class="mr-2 d-block" :disabled="isCancelButtonDisabled" > {{ __('Cancel') }} - </gl-button> - <gl-button + </gl-deprecated-button> + <gl-deprecated-button ref="save-button" type="submit" :disabled="isSubmitButtonDisabled" @@ -90,7 +90,7 @@ export default { > {{ __('Save expiration policy') }} <gl-loading-icon v-if="isLoading" class="ml-2" /> - </gl-button> + </gl-deprecated-button> </div> </template> </gl-card> diff --git a/app/assets/javascripts/releases/components/app_edit.vue b/app/assets/javascripts/releases/components/app_edit.vue index 4fa0e96217a..e90adcd0e25 100644 --- a/app/assets/javascripts/releases/components/app_edit.vue +++ b/app/assets/javascripts/releases/components/app_edit.vue @@ -1,6 +1,6 @@ <script> import { mapState, mapActions } from 'vuex'; -import { GlButton, GlLink, GlFormInput, GlFormGroup } from '@gitlab/ui'; +import { GlDeprecatedButton, GlLink, GlFormInput, GlFormGroup } from '@gitlab/ui'; import { escape as esc } from 'lodash'; import { __, sprintf } from '~/locale'; import MarkdownField from '~/vue_shared/components/markdown/field.vue'; @@ -15,7 +15,7 @@ export default { components: { GlFormInput, GlFormGroup, - GlButton, + GlDeprecatedButton, GlLink, MarkdownField, AssetLinksForm, @@ -163,14 +163,14 @@ export default { <asset-links-form v-if="showAssetLinksForm" /> <div class="d-flex pt-3"> - <gl-button + <gl-deprecated-button class="mr-auto js-submit-button" variant="success" type="submit" :aria-label="__('Save changes')" > {{ __('Save changes') }} - </gl-button> + </gl-deprecated-button> <gl-link :href="cancelPath" class="js-cancel-button btn btn-default"> {{ __('Cancel') }} </gl-link> diff --git a/app/assets/javascripts/releases/components/asset_links_form.vue b/app/assets/javascripts/releases/components/asset_links_form.vue index f4c92477775..7299fd24ec5 100644 --- a/app/assets/javascripts/releases/components/asset_links_form.vue +++ b/app/assets/javascripts/releases/components/asset_links_form.vue @@ -4,7 +4,7 @@ import { GlSprintf, GlLink, GlFormGroup, - GlButton, + GlDeprecatedButton, GlIcon, GlTooltipDirective, GlFormInput, @@ -12,7 +12,7 @@ import { export default { name: 'AssetLinksForm', - components: { GlSprintf, GlLink, GlFormGroup, GlButton, GlIcon, GlFormInput }, + components: { GlSprintf, GlLink, GlFormGroup, GlDeprecatedButton, GlIcon, GlFormInput }, directives: { GlTooltip: GlTooltipDirective }, computed: { ...mapState('detail', ['release', 'releaseAssetsDocsPath']), @@ -106,7 +106,7 @@ export default { /> </gl-form-group> - <gl-button + <gl-deprecated-button v-gl-tooltip class="mb-5 mb-sm-3 flex-grow-0 flex-shrink-0 remove-button" :aria-label="__('Remove asset link')" @@ -115,10 +115,14 @@ export default { > <gl-icon class="m-0" name="remove" /> <span class="d-inline d-sm-none">{{ __('Remove asset link') }}</span> - </gl-button> + </gl-deprecated-button> </div> - <gl-button variant="link" class="align-self-end mb-5 mb-sm-0" @click="onAddAnotherClicked"> + <gl-deprecated-button + variant="link" + class="align-self-end mb-5 mb-sm-0" + @click="onAddAnotherClicked" + > {{ __('Add another link') }} - </gl-button> + </gl-deprecated-button> </div> </template> diff --git a/app/assets/javascripts/releases/components/release_block_milestone_info.vue b/app/assets/javascripts/releases/components/release_block_milestone_info.vue index d9fbd2884b7..01ad0cbf732 100644 --- a/app/assets/javascripts/releases/components/release_block_milestone_info.vue +++ b/app/assets/javascripts/releases/components/release_block_milestone_info.vue @@ -3,7 +3,7 @@ import { GlProgressBar, GlLink, GlBadge, - GlButton, + GlDeprecatedButton, GlTooltipDirective, GlSprintf, } from '@gitlab/ui'; @@ -17,7 +17,7 @@ export default { GlProgressBar, GlLink, GlBadge, - GlButton, + GlDeprecatedButton, GlSprintf, }, directives: { @@ -134,9 +134,13 @@ export default { <span :key="'bullet-' + milestone.id" class="append-right-4">•</span> </template> <template v-if="shouldRenderShowMoreLink(index)"> - <gl-button :key="'more-button-' + milestone.id" variant="link" @click="toggleShowAll"> + <gl-deprecated-button + :key="'more-button-' + milestone.id" + variant="link" + @click="toggleShowAll" + > {{ moreText }} - </gl-button> + </gl-deprecated-button> </template> </template> </div> diff --git a/app/assets/javascripts/repository/components/last_commit.vue b/app/assets/javascripts/repository/components/last_commit.vue index 71c3e15ba49..a13f8ac65cf 100644 --- a/app/assets/javascripts/repository/components/last_commit.vue +++ b/app/assets/javascripts/repository/components/last_commit.vue @@ -1,5 +1,5 @@ <script> -import { GlTooltipDirective, GlLink, GlButton, GlLoadingIcon } from '@gitlab/ui'; +import { GlTooltipDirective, GlLink, GlDeprecatedButton, GlLoadingIcon } from '@gitlab/ui'; import defaultAvatarUrl from 'images/no_avatar.png'; import { sprintf, s__ } from '~/locale'; import Icon from '../../vue_shared/components/icon.vue'; @@ -19,7 +19,7 @@ export default { ClipboardButton, CiIcon, GlLink, - GlButton, + GlDeprecatedButton, GlLoadingIcon, }, directives: { @@ -124,7 +124,7 @@ export default { > {{ commit.title }} </gl-link> - <gl-button + <gl-deprecated-button v-if="commit.description" :class="{ open: showDescription }" :aria-label="__('Show commit description')" @@ -132,7 +132,7 @@ export default { @click="toggleShowDescription" > <icon name="ellipsis_h" :size="10" /> - </gl-button> + </gl-deprecated-button> <div class="committer"> <gl-link v-if="commit.author" diff --git a/app/assets/javascripts/self_monitor/components/self_monitor_form.vue b/app/assets/javascripts/self_monitor/components/self_monitor_form.vue index 1e203d332db..adc7d3c5ebd 100644 --- a/app/assets/javascripts/self_monitor/components/self_monitor_form.vue +++ b/app/assets/javascripts/self_monitor/components/self_monitor_form.vue @@ -1,6 +1,6 @@ <script> import Vue from 'vue'; -import { GlFormGroup, GlButton, GlModal, GlToast, GlToggle } from '@gitlab/ui'; +import { GlFormGroup, GlDeprecatedButton, GlModal, GlToast, GlToggle } from '@gitlab/ui'; import { mapState, mapActions } from 'vuex'; import { __, s__, sprintf } from '~/locale'; import { visitUrl, getBaseURL } from '~/lib/utils/url_utility'; @@ -10,7 +10,7 @@ Vue.use(GlToast); export default { components: { GlFormGroup, - GlButton, + GlDeprecatedButton, GlModal, GlToggle, }, @@ -122,7 +122,7 @@ export default { <h4 class="js-section-header"> {{ s__('SelfMonitoring|Self monitoring') }} </h4> - <gl-button class="js-settings-toggle">{{ __('Expand') }}</gl-button> + <gl-deprecated-button class="js-settings-toggle">{{ __('Expand') }}</gl-deprecated-button> <p class="js-section-sub-header"> {{ s__('SelfMonitoring|Enable or disable instance self monitoring') }} </p> diff --git a/app/assets/javascripts/serverless/components/missing_prometheus.vue b/app/assets/javascripts/serverless/components/missing_prometheus.vue index 6c19434f202..6c29f7c89ff 100644 --- a/app/assets/javascripts/serverless/components/missing_prometheus.vue +++ b/app/assets/javascripts/serverless/components/missing_prometheus.vue @@ -1,10 +1,10 @@ <script> -import { GlButton, GlLink } from '@gitlab/ui'; +import { GlDeprecatedButton, GlLink } from '@gitlab/ui'; import { s__ } from '../../locale'; export default { components: { - GlButton, + GlDeprecatedButton, GlLink, }, props: { @@ -53,9 +53,9 @@ export default { </p> <div v-if="!missingData" class="text-left"> - <gl-button :href="clustersPath" variant="success"> + <gl-deprecated-button :href="clustersPath" variant="success"> {{ s__('ServerlessDetails|Install Prometheus') }} - </gl-button> + </gl-deprecated-button> </div> </div> </div> diff --git a/app/assets/javascripts/snippets/components/snippet_blob_edit.vue b/app/assets/javascripts/snippets/components/snippet_blob_edit.vue index 624ca18eec9..ae6f451df18 100644 --- a/app/assets/javascripts/snippets/components/snippet_blob_edit.vue +++ b/app/assets/javascripts/snippets/components/snippet_blob_edit.vue @@ -1,23 +1,30 @@ <script> import BlobHeaderEdit from '~/blob/components/blob_edit_header.vue'; import BlobContentEdit from '~/blob/components/blob_edit_content.vue'; +import { GlLoadingIcon } from '@gitlab/ui'; export default { components: { BlobHeaderEdit, BlobContentEdit, + GlLoadingIcon, }, inheritAttrs: false, props: { + value: { + type: String, + required: false, + default: '', + }, fileName: { type: String, required: false, default: '', }, - }, - methods: { - emitFileNameChange(newFileName) { - this.$emit('name-change', newFileName); + isLoading: { + type: Boolean, + required: false, + default: true, }, }, }; @@ -26,8 +33,19 @@ export default { <div class="form-group file-editor"> <label>{{ s__('Snippets|File') }}</label> <div class="file-holder snippet"> - <blob-header-edit :value="fileName" @input="emitFileNameChange" /> - <blob-content-edit v-bind="$attrs" :file-name="fileName" v-on="$listeners" /> + <blob-header-edit :value="fileName" @input="$emit('name-change', $event)" /> + <gl-loading-icon + v-if="isLoading" + :label="__('Loading snippet')" + :size="2" + class="loading-animation prepend-top-20 append-bottom-20" + /> + <blob-content-edit + v-else + :value="value" + :file-name="fileName" + @input="$emit('input', $event)" + /> </div> </div> </template> diff --git a/app/assets/javascripts/snippets/components/snippet_header.vue b/app/assets/javascripts/snippets/components/snippet_header.vue index 7f8781fcc49..c280096b2bf 100644 --- a/app/assets/javascripts/snippets/components/snippet_header.vue +++ b/app/assets/javascripts/snippets/components/snippet_header.vue @@ -4,7 +4,7 @@ import { GlAvatar, GlIcon, GlSprintf, - GlButton, + GlDeprecatedButton, GlModal, GlAlert, GlLoadingIcon, @@ -22,7 +22,7 @@ export default { GlAvatar, GlIcon, GlSprintf, - GlButton, + GlDeprecatedButton, GlModal, GlAlert, GlLoadingIcon, @@ -189,7 +189,7 @@ export default { <div class="detail-page-header-actions"> <div class="d-none d-sm-block"> <template v-for="(action, index) in personalSnippetActions"> - <gl-button + <gl-deprecated-button v-if="action.condition" :key="index" :variant="action.variant" @@ -198,7 +198,7 @@ export default { @click="action.click ? action.click() : undefined" > {{ action.text }} - </gl-button> + </gl-deprecated-button> </template> </div> <div class="d-block d-sm-none dropdown"> @@ -228,8 +228,8 @@ export default { </gl-sprintf> <template #modal-footer> - <gl-button @click="closeDeleteModal">{{ __('Cancel') }}</gl-button> - <gl-button + <gl-deprecated-button @click="closeDeleteModal">{{ __('Cancel') }}</gl-deprecated-button> + <gl-deprecated-button variant="danger" :disabled="isDeleting" data-qa-selector="delete_snippet_button" @@ -237,7 +237,7 @@ export default { > <gl-loading-icon v-if="isDeleting" inline /> {{ __('Delete snippet') }} - </gl-button> + </gl-deprecated-button> </template> </gl-modal> </div> diff --git a/app/assets/javascripts/static_site_editor/components/edit_area.vue b/app/assets/javascripts/static_site_editor/components/edit_area.vue new file mode 100644 index 00000000000..921d93669c5 --- /dev/null +++ b/app/assets/javascripts/static_site_editor/components/edit_area.vue @@ -0,0 +1,18 @@ +<script> +import { GlFormTextarea } from '@gitlab/ui'; + +export default { + components: { + GlFormTextarea, + }, + props: { + value: { + type: String, + required: true, + }, + }, +}; +</script> +<template> + <gl-form-textarea :value="value" v-on="$listeners" /> +</template> diff --git a/app/assets/javascripts/static_site_editor/components/static_site_editor.vue b/app/assets/javascripts/static_site_editor/components/static_site_editor.vue index 7b8b46cb048..4a0e153eb33 100644 --- a/app/assets/javascripts/static_site_editor/components/static_site_editor.vue +++ b/app/assets/javascripts/static_site_editor/components/static_site_editor.vue @@ -1,3 +1,37 @@ +<script> +import { mapState, mapActions } from 'vuex'; +import { GlSkeletonLoader } from '@gitlab/ui'; + +import EditArea from './edit_area.vue'; + +export default { + components: { + EditArea, + GlSkeletonLoader, + }, + computed: { + ...mapState(['content', 'isContentLoaded', 'isLoadingContent']), + }, + mounted() { + this.loadContent(); + }, + methods: { + ...mapActions(['loadContent']), + }, +}; +</script> <template> - <div></div> + <div class="d-flex justify-content-center h-100"> + <div v-if="isLoadingContent" class="w-50 h-50 mt-2"> + <gl-skeleton-loader :width="500" :height="102"> + <rect width="500" height="16" rx="4" /> + <rect y="20" width="375" height="16" rx="4" /> + <rect x="380" y="20" width="120" height="16" rx="4" /> + <rect y="40" width="250" height="16" rx="4" /> + <rect x="255" y="40" width="150" height="16" rx="4" /> + <rect x="410" y="40" width="90" height="16" rx="4" /> + </gl-skeleton-loader> + </div> + <edit-area v-if="isContentLoaded" class="w-75 h-100 shadow-none" :value="content" /> + </div> </template> diff --git a/app/assets/javascripts/static_site_editor/store/state.js b/app/assets/javascripts/static_site_editor/store/state.js index 512967cc3d9..68a7f95760c 100644 --- a/app/assets/javascripts/static_site_editor/store/state.js +++ b/app/assets/javascripts/static_site_editor/store/state.js @@ -1,4 +1,7 @@ const createState = (initialState = {}) => ({ + isLoadingContent: false, + isContentLoaded: false, + content: '', ...initialState, }); diff --git a/app/assets/javascripts/vue_merge_request_widget/components/deployment/deployment_action_button.vue b/app/assets/javascripts/vue_merge_request_widget/components/deployment/deployment_action_button.vue index 45798fbc9dc..996e54a1183 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/deployment/deployment_action_button.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/deployment/deployment_action_button.vue @@ -1,12 +1,12 @@ <script> -import { GlTooltipDirective, GlButton } from '@gitlab/ui'; +import { GlTooltipDirective, GlDeprecatedButton } from '@gitlab/ui'; import { __ } from '~/locale'; import { RUNNING } from './constants'; export default { name: 'DeploymentActionButton', components: { - GlButton, + GlDeprecatedButton, }, directives: { GlTooltip: GlTooltipDirective, @@ -59,7 +59,7 @@ export default { <template> <span v-gl-tooltip :title="actionInProgressTooltip" class="d-inline-block" tabindex="0"> - <gl-button + <gl-deprecated-button v-gl-tooltip :title="buttonTitle" :loading="isLoading" @@ -70,6 +70,6 @@ export default { <span class="d-inline-flex align-items-baseline"> <slot> </slot> </span> - </gl-button> + </gl-deprecated-button> </span> </template> diff --git a/app/assets/javascripts/vue_merge_request_widget/components/mr_collapsible_extension.vue b/app/assets/javascripts/vue_merge_request_widget/components/mr_collapsible_extension.vue index 96603d23374..ba8da46d207 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/mr_collapsible_extension.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/mr_collapsible_extension.vue @@ -1,11 +1,11 @@ <script> -import { GlButton, GlLoadingIcon } from '@gitlab/ui'; +import { GlDeprecatedButton, GlLoadingIcon } from '@gitlab/ui'; import { __ } from '~/locale'; import Icon from '~/vue_shared/components/icon.vue'; export default { components: { - GlButton, + GlDeprecatedButton, GlLoadingIcon, Icon, }, @@ -58,7 +58,7 @@ export default { </div> <template v-else> - <gl-button + <gl-deprecated-button class="btn-blank btn s32 square append-right-default" :aria-label="ariaLabel" :disabled="isLoading" @@ -66,8 +66,8 @@ export default { > <gl-loading-icon v-if="isLoading" /> <icon v-else :name="arrowIconName" class="js-icon" /> - </gl-button> - <gl-button + </gl-deprecated-button> + <gl-deprecated-button variant="link" class="js-title" :disabled="isLoading" @@ -76,7 +76,7 @@ export default { > <template v-if="isCollapsed">{{ title }}</template> <template v-else>{{ __('Collapse') }}</template> - </gl-button> + </gl-deprecated-button> </template> </div> diff --git a/app/assets/javascripts/vue_merge_request_widget/components/states/commits_header.vue b/app/assets/javascripts/vue_merge_request_widget/components/states/commits_header.vue index 266c07ead25..dcf02a29f52 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/states/commits_header.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/states/commits_header.vue @@ -1,5 +1,5 @@ <script> -import { GlButton } from '@gitlab/ui'; +import { GlDeprecatedButton } from '@gitlab/ui'; import { escape as esc } from 'lodash'; import { __, n__, sprintf, s__ } from '~/locale'; import Icon from '~/vue_shared/components/icon.vue'; @@ -7,7 +7,7 @@ import Icon from '~/vue_shared/components/icon.vue'; export default { components: { Icon, - GlButton, + GlDeprecatedButton, }, props: { isSquashEnabled: { @@ -80,20 +80,20 @@ export default { class="js-mr-widget-commits-count mr-widget-extension clickable d-flex align-items-center px-3 py-2" @click="toggle()" > - <gl-button + <gl-deprecated-button :aria-label="ariaLabel" variant="blank" class="commit-edit-toggle square s24 append-right-default" @click.stop="toggle()" > <icon :name="collapseIcon" :size="16" /> - </gl-button> + </gl-deprecated-button> <span v-if="expanded">{{ __('Collapse') }}</span> <span v-else> <span class="vertical-align-middle" v-html="message"></span> - <gl-button variant="link" class="modify-message-button"> + <gl-deprecated-button variant="link" class="modify-message-button"> {{ modifyLinkMessage }} - </gl-button> + </gl-deprecated-button> </span> </div> <div v-show="expanded"><slot></slot></div> diff --git a/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_pipeline_tour.vue b/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_pipeline_tour.vue index f2d7e86a85e..01a195049ba 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_pipeline_tour.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_pipeline_tour.vue @@ -1,6 +1,6 @@ <script> import { s__, sprintf } from '~/locale'; -import { GlPopover, GlButton } from '@gitlab/ui'; +import { GlPopover, GlDeprecatedButton } from '@gitlab/ui'; import Icon from '~/vue_shared/components/icon.vue'; import Cookies from 'js-cookie'; import { parseBoolean } from '~/lib/utils/common_utils'; @@ -29,7 +29,7 @@ export default { ), components: { GlPopover, - GlButton, + GlDeprecatedButton, Icon, }, mixins: [trackingMixin], @@ -111,7 +111,7 @@ export default { <img :src="pipelineSvgPath" /> </div> <p v-html="$options.popoverContent"></p> - <gl-button + <gl-deprecated-button ref="ok" category="primary" class="mt-2 mb-0" @@ -124,8 +124,8 @@ export default { :data-track-label="trackLabel" > {{ __('Show me how') }} - </gl-button> - <gl-button + </gl-deprecated-button> + <gl-deprecated-button ref="no-thanks" category="secondary" class="mt-2 mb-0" @@ -138,6 +138,6 @@ export default { @click="dismissPopover" > {{ __("No thanks, don't show this again") }} - </gl-button> + </gl-deprecated-button> </gl-popover> </template> 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 e34060c3393..360a75c3946 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 @@ -1,6 +1,6 @@ <script> import { isEmpty } from 'lodash'; -import { GlIcon, GlButton } from '@gitlab/ui'; +import { GlIcon, GlDeprecatedButton } from '@gitlab/ui'; import successSvg from 'icons/_icon_status_success.svg'; import warningSvg from 'icons/_icon_status_warning.svg'; import readyToMergeMixin from 'ee_else_ce/vue_merge_request_widget/mixins/ready_to_merge'; @@ -26,7 +26,7 @@ export default { CommitEdit, CommitMessageDropdown, GlIcon, - GlButton, + GlDeprecatedButton, MergeImmediatelyConfirmationDialog: () => import( 'ee_component/vue_merge_request_widget/components/merge_immediately_confirmation_dialog.vue' @@ -263,7 +263,7 @@ export default { <div class="media-body"> <div class="mr-widget-body-controls media space-children"> <span class="btn-group"> - <gl-button + <gl-deprecated-button size="sm" class="qa-merge-button accept-merge-request" :variant="mergeButtonVariant" @@ -272,7 +272,7 @@ export default { @click="handleMergeButtonClick(isAutoMergeAvailable)" > {{ mergeButtonText }} - </gl-button> + </gl-deprecated-button> <button v-if="shouldShowMergeImmediatelyDropdown" :disabled="isMergeButtonDisabled" diff --git a/app/assets/javascripts/vue_merge_request_widget/components/states/work_in_progress.vue b/app/assets/javascripts/vue_merge_request_widget/components/states/work_in_progress.vue index e52ad9156d5..118caac84b9 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/states/work_in_progress.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/states/work_in_progress.vue @@ -1,6 +1,6 @@ <script> import $ from 'jquery'; -import { GlButton } from '@gitlab/ui'; +import { GlDeprecatedButton } from '@gitlab/ui'; import { __, s__ } from '~/locale'; import createFlash from '~/flash'; import StatusIcon from '../mr_widget_status_icon.vue'; @@ -11,7 +11,7 @@ export default { name: 'WorkInProgress', components: { StatusIcon, - GlButton, + GlDeprecatedButton, }, directives: { tooltip, @@ -66,7 +66,7 @@ export default { > </i> </span> - <gl-button + <gl-deprecated-button v-if="mr.removeWIPPath" size="sm" variant="default" @@ -76,7 +76,7 @@ export default { @click="handleRemoveWIP" > {{ s__('mrWidget|Resolve WIP status') }} - </gl-button> + </gl-deprecated-button> </div> </div> </template> diff --git a/app/assets/javascripts/vue_shared/components/clipboard_button.vue b/app/assets/javascripts/vue_shared/components/clipboard_button.vue index 3ff1d9cf48a..d38dd258ce6 100644 --- a/app/assets/javascripts/vue_shared/components/clipboard_button.vue +++ b/app/assets/javascripts/vue_shared/components/clipboard_button.vue @@ -12,7 +12,7 @@ * css-class="btn-transparent" * /> */ -import { GlButton, GlTooltipDirective, GlIcon } from '@gitlab/ui'; +import { GlDeprecatedButton, GlTooltipDirective, GlIcon } from '@gitlab/ui'; export default { name: 'ClipboardButton', @@ -20,7 +20,7 @@ export default { GlTooltip: GlTooltipDirective, }, components: { - GlButton, + GlDeprecatedButton, GlIcon, }, props: { @@ -65,12 +65,12 @@ export default { </script> <template> - <gl-button + <gl-deprecated-button v-gl-tooltip="{ placement: tooltipPlacement, container: tooltipContainer }" :class="cssClass" :title="title" :data-clipboard-text="clipboardText" > <gl-icon name="copy-to-clipboard" /> - </gl-button> + </gl-deprecated-button> </template> diff --git a/app/assets/javascripts/vue_shared/components/date_time_picker/date_time_picker.vue b/app/assets/javascripts/vue_shared/components/date_time_picker/date_time_picker.vue index 7b09337eb15..cdcd5cdef7f 100644 --- a/app/assets/javascripts/vue_shared/components/date_time_picker/date_time_picker.vue +++ b/app/assets/javascripts/vue_shared/components/date_time_picker/date_time_picker.vue @@ -1,5 +1,5 @@ <script> -import { GlButton, GlDropdown, GlDropdownItem, GlFormGroup } from '@gitlab/ui'; +import { GlDeprecatedButton, GlDropdown, GlDropdownItem, GlFormGroup } from '@gitlab/ui'; import { __, sprintf } from '~/locale'; import { convertToFixedRange, isEqualTimeRanges, findTimeRange } from '~/lib/utils/datetime_range'; @@ -28,7 +28,7 @@ export default { TooltipOnTruncate, DateTimePickerInput, GlFormGroup, - GlButton, + GlDeprecatedButton, GlDropdown, GlDropdownItem, }, @@ -192,10 +192,10 @@ export default { /> </div> <gl-form-group> - <gl-button @click="closeDropdown">{{ __('Cancel') }}</gl-button> - <gl-button variant="success" :disabled="!isValid" @click="setFixedRange()"> + <gl-deprecated-button @click="closeDropdown">{{ __('Cancel') }}</gl-deprecated-button> + <gl-deprecated-button variant="success" :disabled="!isValid" @click="setFixedRange()"> {{ __('Apply') }} - </gl-button> + </gl-deprecated-button> </gl-form-group> </gl-form-group> <gl-form-group label-for="group-id-dropdown" class="col-md-5 gl-pl-1 gl-pr-1 m-0"> diff --git a/app/assets/javascripts/vue_shared/components/droplab_dropdown_button.vue b/app/assets/javascripts/vue_shared/components/droplab_dropdown_button.vue index 9aca210c1fb..e1f336f5250 100644 --- a/app/assets/javascripts/vue_shared/components/droplab_dropdown_button.vue +++ b/app/assets/javascripts/vue_shared/components/droplab_dropdown_button.vue @@ -1,11 +1,11 @@ <script> -import { GlButton } from '@gitlab/ui'; +import { GlDeprecatedButton } from '@gitlab/ui'; import Icon from './icon.vue'; export default { components: { Icon, - GlButton, + GlDeprecatedButton, }, props: { size: { @@ -59,9 +59,13 @@ export default { <template> <div class="btn-group droplab-dropdown comment-type-dropdown"> - <gl-button :class="primaryButtonClass" :size="size" @click.prevent="handlePrimaryActionClick"> + <gl-deprecated-button + :class="primaryButtonClass" + :size="size" + @click.prevent="handlePrimaryActionClick" + > {{ selectedActionTitle }} - </gl-button> + </gl-deprecated-button> <button :class="buttonSizeClass" type="button" @@ -74,13 +78,13 @@ export default { <ul :class="dropdownClass" class="dropdown-menu dropdown-open-top"> <template v-for="(action, index) in actions"> <li :key="index" :class="{ 'droplab-item-selected': selectedAction === index }"> - <gl-button class="btn-transparent" @click.prevent="handleActionClick(index)"> + <gl-deprecated-button class="btn-transparent" @click.prevent="handleActionClick(index)"> <i aria-hidden="true" class="fa fa-check icon"> </i> <div class="description"> <strong>{{ action.title }}</strong> <p>{{ action.description }}</p> </div> - </gl-button> + </gl-deprecated-button> </li> <li v-if="index === 0" :key="`${index}-separator`" class="divider droplab-item-ignore"></li> </template> diff --git a/app/assets/javascripts/vue_shared/components/expand_button.vue b/app/assets/javascripts/vue_shared/components/expand_button.vue index e2a6e92081f..1f904cd3c6c 100644 --- a/app/assets/javascripts/vue_shared/components/expand_button.vue +++ b/app/assets/javascripts/vue_shared/components/expand_button.vue @@ -1,5 +1,5 @@ <script> -import { GlButton } from '@gitlab/ui'; +import { GlDeprecatedButton } from '@gitlab/ui'; import { __ } from '~/locale'; import Icon from '~/vue_shared/components/icon.vue'; @@ -16,7 +16,7 @@ import Icon from '~/vue_shared/components/icon.vue'; export default { name: 'ExpandButton', components: { - GlButton, + GlDeprecatedButton, Icon, }, data() { @@ -41,7 +41,7 @@ export default { </script> <template> <span> - <gl-button + <gl-deprecated-button v-show="isCollapsed" :aria-label="ariaLabel" type="button" @@ -49,10 +49,10 @@ export default { @click="onClick" > <icon :size="12" name="ellipsis_h" /> - </gl-button> + </gl-deprecated-button> <span v-if="isCollapsed"> <slot name="short"></slot> </span> <span v-if="!isCollapsed"> <slot name="expanded"></slot> </span> - <gl-button + <gl-deprecated-button v-show="!isCollapsed" :aria-label="ariaLabel" type="button" @@ -60,6 +60,6 @@ export default { @click="onClick" > <icon :size="12" name="ellipsis_h" /> - </gl-button> + </gl-deprecated-button> </span> </template> diff --git a/app/assets/javascripts/vue_shared/components/filtered_search_dropdown.vue b/app/assets/javascripts/vue_shared/components/filtered_search_dropdown.vue index 20bcceeb477..58afcebb7b3 100644 --- a/app/assets/javascripts/vue_shared/components/filtered_search_dropdown.vue +++ b/app/assets/javascripts/vue_shared/components/filtered_search_dropdown.vue @@ -1,6 +1,6 @@ <script> import $ from 'jquery'; -import { GlButton } from '@gitlab/ui'; +import { GlDeprecatedButton } from '@gitlab/ui'; import { __ } from '~/locale'; import Icon from '~/vue_shared/components/icon.vue'; /** @@ -15,7 +15,7 @@ export default { name: 'FilteredSearchDropdown', components: { Icon, - GlButton, + GlDeprecatedButton, }, props: { title: { @@ -141,10 +141,10 @@ export default { <div v-if="shouldRenderCreateButton" class="dropdown-footer"> <slot name="footer" :filter="filter"> - <gl-button + <gl-deprecated-button class="js-dropdown-create-button btn-transparent" @click="$emit('createItem', filter)" - >{{ computedCreateButtonText }}</gl-button + >{{ computedCreateButtonText }}</gl-deprecated-button > </slot> </div> diff --git a/app/assets/javascripts/vue_shared/components/header_ci_component.vue b/app/assets/javascripts/vue_shared/components/header_ci_component.vue index 876eb7b899c..2665bb4aa92 100644 --- a/app/assets/javascripts/vue_shared/components/header_ci_component.vue +++ b/app/assets/javascripts/vue_shared/components/header_ci_component.vue @@ -1,5 +1,5 @@ <script> -import { GlTooltipDirective, GlLink, GlButton } from '@gitlab/ui'; +import { GlTooltipDirective, GlLink, GlDeprecatedButton } from '@gitlab/ui'; import { __, sprintf } from '~/locale'; import CiIconBadge from './ci_badge_link.vue'; import TimeagoTooltip from './time_ago_tooltip.vue'; @@ -18,7 +18,7 @@ export default { TimeagoTooltip, UserAvatarImage, GlLink, - GlButton, + GlDeprecatedButton, }, directives: { GlTooltip: GlTooltipDirective, @@ -108,7 +108,7 @@ export default { <section v-if="$slots.default" class="header-action-buttons"> <slot></slot> </section> - <gl-button + <gl-deprecated-button v-if="hasSidebarButton" id="toggleSidebar" class="d-block d-sm-none @@ -116,6 +116,6 @@ sidebar-toggle-btn js-sidebar-build-toggle js-sidebar-build-toggle-header" @click="onClickSidebarButton" > <i class="fa fa-angle-double-left" aria-hidden="true" aria-labelledby="toggleSidebar"> </i> - </gl-button> + </gl-deprecated-button> </header> </template> diff --git a/app/assets/javascripts/vue_shared/components/loading_button.vue b/app/assets/javascripts/vue_shared/components/loading_button.vue index c9286e22f82..3508c557289 100644 --- a/app/assets/javascripts/vue_shared/components/loading_button.vue +++ b/app/assets/javascripts/vue_shared/components/loading_button.vue @@ -2,7 +2,7 @@ import { GlLoadingIcon } from '@gitlab/ui'; /* eslint-disable vue/require-default-prop */ /* -This component will be deprecated in favor of gl-button. +This component will be deprecated in favor of gl-deprecated-button. https://gitlab-org.gitlab.io/gitlab-ui/?path=/story/base-button--loading-button https://gitlab.com/gitlab-org/gitlab/issues/207412 */ diff --git a/app/assets/javascripts/vue_shared/components/markdown/header.vue b/app/assets/javascripts/vue_shared/components/markdown/header.vue index bf25ed96f35..665637f3b9e 100644 --- a/app/assets/javascripts/vue_shared/components/markdown/header.vue +++ b/app/assets/javascripts/vue_shared/components/markdown/header.vue @@ -1,6 +1,6 @@ <script> import $ from 'jquery'; -import { GlPopover, GlButton, GlTooltipDirective } from '@gitlab/ui'; +import { GlPopover, GlDeprecatedButton, GlTooltipDirective } from '@gitlab/ui'; import ToolbarButton from './toolbar_button.vue'; import Icon from '../icon.vue'; @@ -9,7 +9,7 @@ export default { ToolbarButton, Icon, GlPopover, - GlButton, + GlDeprecatedButton, }, directives: { GlTooltip: GlTooltipDirective, @@ -142,9 +142,9 @@ export default { ) }} </p> - <gl-button variant="primary" size="sm" @click="handleSuggestDismissed"> + <gl-deprecated-button variant="primary" size="sm" @click="handleSuggestDismissed"> {{ __('Got it') }} - </gl-button> + </gl-deprecated-button> </gl-popover> </template> <toolbar-button tag="`" tag-block="```" :button-title="__('Insert code')" icon="code" /> diff --git a/app/assets/javascripts/vue_shared/components/markdown/suggestion_diff_header.vue b/app/assets/javascripts/vue_shared/components/markdown/suggestion_diff_header.vue index 8a8cf09194c..af438ce5619 100644 --- a/app/assets/javascripts/vue_shared/components/markdown/suggestion_diff_header.vue +++ b/app/assets/javascripts/vue_shared/components/markdown/suggestion_diff_header.vue @@ -1,9 +1,9 @@ <script> -import { GlButton, GlLoadingIcon, GlTooltipDirective } from '@gitlab/ui'; +import { GlDeprecatedButton, GlLoadingIcon, GlTooltipDirective } from '@gitlab/ui'; import Icon from '~/vue_shared/components/icon.vue'; export default { - components: { Icon, GlButton, GlLoadingIcon }, + components: { Icon, GlDeprecatedButton, GlLoadingIcon }, directives: { 'gl-tooltip': GlTooltipDirective }, props: { canApply: { @@ -52,7 +52,7 @@ export default { <gl-loading-icon class="d-flex-center mr-2" /> <span>{{ __('Applying suggestion') }}</span> </div> - <gl-button + <gl-deprecated-button v-else-if="canApply" v-gl-tooltip.viewport="__('This also resolves the discussion')" class="btn-inverted js-apply-btn" @@ -61,6 +61,6 @@ export default { @click="applySuggestion" > {{ __('Apply suggestion') }} - </gl-button> + </gl-deprecated-button> </div> </template> diff --git a/app/assets/javascripts/vue_shared/components/modal_copy_button.vue b/app/assets/javascripts/vue_shared/components/modal_copy_button.vue index 271a375ade2..69ba5cb97e2 100644 --- a/app/assets/javascripts/vue_shared/components/modal_copy_button.vue +++ b/app/assets/javascripts/vue_shared/components/modal_copy_button.vue @@ -1,13 +1,13 @@ <script> import $ from 'jquery'; -import { GlButton, GlTooltipDirective } from '@gitlab/ui'; +import { GlDeprecatedButton, GlTooltipDirective } from '@gitlab/ui'; import Clipboard from 'clipboard'; import { __ } from '~/locale'; import Icon from '~/vue_shared/components/icon.vue'; export default { components: { - GlButton, + GlDeprecatedButton, Icon, }, @@ -113,7 +113,7 @@ export default { }; </script> <template> - <gl-button + <gl-deprecated-button v-gl-tooltip="{ placement: tooltipPlacement, container: tooltipContainer }" :class="cssClasses" :data-clipboard-target="target" @@ -123,5 +123,5 @@ export default { <slot> <icon name="copy-to-clipboard" /> </slot> - </gl-button> + </gl-deprecated-button> </template> diff --git a/app/assets/javascripts/vue_shared/components/notes/system_note.vue b/app/assets/javascripts/vue_shared/components/notes/system_note.vue index 4ad382ed888..ec7d7e94e5c 100644 --- a/app/assets/javascripts/vue_shared/components/notes/system_note.vue +++ b/app/assets/javascripts/vue_shared/components/notes/system_note.vue @@ -18,7 +18,7 @@ */ import $ from 'jquery'; import { mapGetters, mapActions, mapState } from 'vuex'; -import { GlButton, GlSkeletonLoading, GlTooltipDirective } from '@gitlab/ui'; +import { GlDeprecatedButton, GlSkeletonLoading, GlTooltipDirective } from '@gitlab/ui'; import descriptionVersionHistoryMixin from 'ee_else_ce/notes/mixins/description_version_history'; import noteHeader from '~/notes/components/note_header.vue'; import Icon from '~/vue_shared/components/icon.vue'; @@ -35,7 +35,7 @@ export default { Icon, noteHeader, TimelineEntryItem, - GlButton, + GlDeprecatedButton, GlSkeletonLoading, }, directives: { @@ -131,7 +131,7 @@ export default { <gl-skeleton-loading /> </pre> <pre v-else class="wrapper mt-2" v-html="descriptionVersion"></pre> - <gl-button + <gl-deprecated-button v-if="canDeleteDescriptionVersion" ref="deleteDescriptionVersionButton" v-gl-tooltip @@ -140,7 +140,7 @@ export default { @click="deleteDescriptionVersion" > <icon name="remove" /> - </gl-button> + </gl-deprecated-button> </div> </div> </div> diff --git a/app/assets/javascripts/vue_shared/components/project_selector/project_list_item.vue b/app/assets/javascripts/vue_shared/components/project_selector/project_list_item.vue index a51b2a3ab6d..3d52f4176db 100644 --- a/app/assets/javascripts/vue_shared/components/project_selector/project_list_item.vue +++ b/app/assets/javascripts/vue_shared/components/project_selector/project_list_item.vue @@ -1,5 +1,5 @@ <script> -import { GlButton } from '@gitlab/ui'; +import { GlDeprecatedButton } from '@gitlab/ui'; import { isString } from 'lodash'; import Icon from '~/vue_shared/components/icon.vue'; import ProjectAvatar from '~/vue_shared/components/project_avatar/default.vue'; @@ -11,7 +11,7 @@ export default { components: { Icon, ProjectAvatar, - GlButton, + GlDeprecatedButton, }, props: { project: { @@ -45,7 +45,7 @@ export default { }; </script> <template> - <gl-button + <gl-deprecated-button class="d-flex align-items-center btn pt-1 pb-1 border-0 project-list-item" @click="onClick" > @@ -70,5 +70,5 @@ export default { v-html="highlightedProjectName" ></div> </div> - </gl-button> + </gl-deprecated-button> </template> diff --git a/app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/dropdown_button.vue b/app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/dropdown_button.vue index b9c611d2764..55fa1e4ef9c 100644 --- a/app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/dropdown_button.vue +++ b/app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/dropdown_button.vue @@ -1,10 +1,10 @@ <script> import { mapGetters } from 'vuex'; -import { GlButton, GlIcon } from '@gitlab/ui'; +import { GlDeprecatedButton, GlIcon } from '@gitlab/ui'; export default { components: { - GlButton, + GlDeprecatedButton, GlIcon, }, computed: { @@ -14,8 +14,8 @@ export default { </script> <template> - <gl-button class="labels-select-dropdown-button w-100 text-left"> + <gl-deprecated-button class="labels-select-dropdown-button w-100 text-left"> <span class="dropdown-toggle-text">{{ dropdownButtonText }}</span> <gl-icon name="chevron-down" class="pull-right" /> - </gl-button> + </gl-deprecated-button> </template> diff --git a/app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/dropdown_contents_create_view.vue b/app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/dropdown_contents_create_view.vue index 842b2fdbc43..6bb77f6b6f3 100644 --- a/app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/dropdown_contents_create_view.vue +++ b/app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/dropdown_contents_create_view.vue @@ -2,7 +2,7 @@ import { mapState, mapActions } from 'vuex'; import { GlTooltipDirective, - GlButton, + GlDeprecatedButton, GlIcon, GlFormInput, GlLink, @@ -11,7 +11,7 @@ import { export default { components: { - GlButton, + GlDeprecatedButton, GlIcon, GlFormInput, GlLink, @@ -60,7 +60,7 @@ export default { <template> <div class="labels-select-contents-create js-labels-create"> <div class="dropdown-title d-flex align-items-center pt-0 pb-2"> - <gl-button + <gl-deprecated-button :aria-label="__('Go back')" variant="link" size="sm" @@ -68,9 +68,9 @@ export default { @click="toggleDropdownContentsCreateView" > <gl-icon name="arrow-left" /> - </gl-button> + </gl-deprecated-button> <span class="flex-grow-1">{{ labelsCreateTitle }}</span> - <gl-button + <gl-deprecated-button :aria-label="__('Close')" variant="link" size="sm" @@ -78,7 +78,7 @@ export default { @click="toggleDropdownContents" > <gl-icon name="close" /> - </gl-button> + </gl-deprecated-button> </div> <div class="dropdown-input"> <gl-form-input @@ -107,7 +107,7 @@ export default { </div> </div> <div class="dropdown-actions clearfix pt-2 px-2"> - <gl-button + <gl-deprecated-button :disabled="disableCreate" variant="primary" class="pull-left d-flex align-items-center" @@ -115,10 +115,13 @@ export default { > <gl-loading-icon v-show="labelCreateInProgress" :inline="true" class="mr-1" /> {{ __('Create') }} - </gl-button> - <gl-button class="pull-right js-btn-cancel-create" @click="toggleDropdownContentsCreateView"> + </gl-deprecated-button> + <gl-deprecated-button + class="pull-right js-btn-cancel-create" + @click="toggleDropdownContentsCreateView" + > {{ __('Cancel') }} - </gl-button> + </gl-deprecated-button> </div> </div> </template> diff --git a/app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/dropdown_contents_labels_view.vue b/app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/dropdown_contents_labels_view.vue index a3494a9e38f..a8e48bfe1a1 100644 --- a/app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/dropdown_contents_labels_view.vue +++ b/app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/dropdown_contents_labels_view.vue @@ -1,13 +1,13 @@ <script> import { mapState, mapGetters, mapActions } from 'vuex'; -import { GlLoadingIcon, GlButton, GlIcon, GlSearchBoxByType, GlLink } from '@gitlab/ui'; +import { GlLoadingIcon, GlDeprecatedButton, GlIcon, GlSearchBoxByType, GlLink } from '@gitlab/ui'; import { UP_KEY_CODE, DOWN_KEY_CODE, ENTER_KEY_CODE, ESC_KEY_CODE } from '~/lib/utils/keycodes'; export default { components: { GlLoadingIcon, - GlButton, + GlDeprecatedButton, GlIcon, GlSearchBoxByType, GlLink, @@ -125,7 +125,7 @@ export default { /> <div class="dropdown-title d-flex align-items-center pt-0 pb-2"> <span class="flex-grow-1">{{ labelsListTitle }}</span> - <gl-button + <gl-deprecated-button :aria-label="__('Close')" variant="link" size="sm" @@ -133,7 +133,7 @@ export default { @click="toggleDropdownContents" > <gl-icon name="close" /> - </gl-button> + </gl-deprecated-button> </div> <div class="dropdown-input"> <gl-search-box-by-type v-model="searchKey" :autofocus="true" /> @@ -160,11 +160,11 @@ export default { <div class="dropdown-footer"> <ul class="list-unstyled"> <li> - <gl-button + <gl-deprecated-button variant="link" class="d-flex w-100 flex-row text-break-word label-item" @click="toggleDropdownContentsCreateView" - >{{ footerCreateLabelTitle }}</gl-button + >{{ footerCreateLabelTitle }}</gl-deprecated-button > </li> <li> diff --git a/app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/dropdown_title.vue b/app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/dropdown_title.vue index 57f7962dfe1..081c892e09f 100644 --- a/app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/dropdown_title.vue +++ b/app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/dropdown_title.vue @@ -1,10 +1,10 @@ <script> import { mapState, mapActions } from 'vuex'; -import { GlButton, GlLoadingIcon } from '@gitlab/ui'; +import { GlDeprecatedButton, GlLoadingIcon } from '@gitlab/ui'; export default { components: { - GlButton, + GlDeprecatedButton, GlLoadingIcon, }, props: { @@ -27,12 +27,12 @@ export default { {{ __('Labels') }} <template v-if="allowLabelEdit"> <gl-loading-icon v-show="labelsSelectInProgress" inline /> - <gl-button + <gl-deprecated-button variant="link" class="pull-right js-sidebar-dropdown-toggle" data-qa-selector="labels_edit_button" @click="toggleDropdownContents" - >{{ __('Edit') }}</gl-button + >{{ __('Edit') }}</gl-deprecated-button > </template> </div> diff --git a/app/assets/javascripts/vue_shared/components/user_avatar/user_avatar_list.vue b/app/assets/javascripts/vue_shared/components/user_avatar/user_avatar_list.vue index 8eaf8386b99..db378d6f977 100644 --- a/app/assets/javascripts/vue_shared/components/user_avatar/user_avatar_list.vue +++ b/app/assets/javascripts/vue_shared/components/user_avatar/user_avatar_list.vue @@ -1,12 +1,12 @@ <script> -import { GlButton } from '@gitlab/ui'; +import { GlDeprecatedButton } from '@gitlab/ui'; import { sprintf, __ } from '~/locale'; import UserAvatarLink from './user_avatar_link.vue'; export default { components: { UserAvatarLink, - GlButton, + GlDeprecatedButton, }, props: { items: { @@ -82,8 +82,12 @@ export default { :img-size="imgSize" /> <template v-if="hasBreakpoint"> - <gl-button v-if="hasHiddenItems" variant="link" @click="expand"> {{ expandText }} </gl-button> - <gl-button v-else variant="link" @click="collapse"> {{ __('show less') }} </gl-button> + <gl-deprecated-button v-if="hasHiddenItems" variant="link" @click="expand"> + {{ expandText }} + </gl-deprecated-button> + <gl-deprecated-button v-else variant="link" @click="collapse"> + {{ __('show less') }} + </gl-deprecated-button> </template> </div> </template> diff --git a/app/assets/stylesheets/page_bundles/ide.scss b/app/assets/stylesheets/page_bundles/ide.scss index 0daf81628d3..024c1781bf8 100644 --- a/app/assets/stylesheets/page_bundles/ide.scss +++ b/app/assets/stylesheets/page_bundles/ide.scss @@ -967,7 +967,7 @@ $ide-commit-header-height: 48px; } .ide-nav-form { - li { + .nav-links li { width: 50%; padding-left: 0; padding-right: 0; diff --git a/app/controllers/projects/grafana_api_controller.rb b/app/controllers/projects/grafana_api_controller.rb index 380a18818ab..c9870f1be2b 100644 --- a/app/controllers/projects/grafana_api_controller.rb +++ b/app/controllers/projects/grafana_api_controller.rb @@ -9,7 +9,7 @@ class Projects::GrafanaApiController < Projects::ApplicationController project, params[:datasource_id], params[:proxy_path], - query_params.to_h + prometheus_params ).execute return continue_polling_response if result.nil? @@ -25,6 +25,15 @@ class Projects::GrafanaApiController < Projects::ApplicationController end def query_params - params.permit(:query, :start, :end, :step) + params.permit(:query, :start_time, :end_time, :step) + end + + def prometheus_params + query_params.to_h + .except(:start_time, :end_time) + .merge( + start: query_params[:start_time], + end: query_params[:end_time] + ) end end diff --git a/app/services/award_emojis/add_service.rb b/app/services/award_emojis/add_service.rb index db465dcaf7e..ceb7a38cead 100644 --- a/app/services/award_emojis/add_service.rb +++ b/app/services/award_emojis/add_service.rb @@ -37,7 +37,8 @@ module AwardEmojis awardable.noteable unless awardable.for_personal_snippet? when MergeRequest, Issue awardable - when Snippet + else + # No todos for all other awardables nil end end diff --git a/app/views/shared/boards/components/_board.html.haml b/app/views/shared/boards/components/_board.html.haml index f3f2c09ea61..ffb406ac35b 100644 --- a/app/views/shared/boards/components/_board.html.haml +++ b/app/views/shared/boards/components/_board.html.haml @@ -58,7 +58,7 @@ = render_if_exists "shared/boards/components/list_weight" %gl-button-group.board-list-button-group.pl-2{ "v-if" => "isNewIssueShown || isSettingsShown" } - %gl-button.issue-count-badge-add-button.no-drag{ type: "button", + %gl-deprecated-button.issue-count-badge-add-button.no-drag{ type: "button", "@click" => "showNewIssueForm", "v-if" => "isNewIssueShown", ":class": "{ 'd-none': !list.isExpanded, 'rounded-right': isNewIssueShown && !isSettingsShown }", diff --git a/app/workers/gitlab/jira_import/stage/start_import_worker.rb b/app/workers/gitlab/jira_import/stage/start_import_worker.rb index ae4864064e4..80f0221c53d 100644 --- a/app/workers/gitlab/jira_import/stage/start_import_worker.rb +++ b/app/workers/gitlab/jira_import/stage/start_import_worker.rb @@ -16,7 +16,7 @@ module Gitlab return unless start_import - Gitlab::Import::SetAsyncJid.set_jid(project) + Gitlab::Import::SetAsyncJid.set_jid(project.import_state) Gitlab::JiraImport::Stage::ImportLabelsWorker.perform_async(project.id) end diff --git a/changelogs/unreleased/19128-add-system-note-metadata-for-import-export.yml b/changelogs/unreleased/19128-add-system-note-metadata-for-import-export.yml new file mode 100644 index 00000000000..c7bef94515f --- /dev/null +++ b/changelogs/unreleased/19128-add-system-note-metadata-for-import-export.yml @@ -0,0 +1,5 @@ +--- +title: "Add support for system note metadata in project Import/Export" +merge_request: 27853 +author: Melvin Vermeeren +type: added diff --git a/changelogs/unreleased/213307-fix-ide-scss-regression.yml b/changelogs/unreleased/213307-fix-ide-scss-regression.yml new file mode 100644 index 00000000000..2b86ebb93fc --- /dev/null +++ b/changelogs/unreleased/213307-fix-ide-scss-regression.yml @@ -0,0 +1,5 @@ +--- +title: Fix styling of MR dropdown in Web IDE +merge_request: 28746 +author: +type: fixed diff --git a/changelogs/unreleased/pipeline-message-spec.yml b/changelogs/unreleased/pipeline-message-spec.yml new file mode 100644 index 00000000000..278e1033b04 --- /dev/null +++ b/changelogs/unreleased/pipeline-message-spec.yml @@ -0,0 +1,5 @@ +--- +title: Remove duplicate specs in pipeline message spec +merge_request: 28664 +author: Rajendra Kadam +type: added diff --git a/db/structure.sql b/db/structure.sql index 0d25712e0b4..d9062b0f3e1 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -4391,12 +4391,12 @@ CREATE TABLE public.packages_package_files ( file_sha1 bytea, file_name character varying NOT NULL, file text NOT NULL, + file_sha256 bytea, verification_retry_at timestamp with time zone, verified_at timestamp with time zone, verification_checksum character varying(255), verification_failure character varying(255), - verification_retry_count integer, - file_sha256 bytea + verification_retry_count integer ); CREATE SEQUENCE public.packages_package_files_id_seq diff --git a/doc/api/api_resources.md b/doc/api/api_resources.md index fea30a2721a..34d2c40d1f9 100644 --- a/doc/api/api_resources.md +++ b/doc/api/api_resources.md @@ -120,7 +120,7 @@ The following API resources are available outside of project and group contexts | [Events](events.md) | `/events`, `/users/:id/events` (also available for projects) | | [Feature flags](features.md) | `/features` | | [Geo Nodes](geo_nodes.md) **(PREMIUM ONLY)** | `/geo_nodes` | -| [Group Activity Analytics](group_activity_analytics.md) **(STARTER)** | `/analytics/group_activity/{issues_count | merge_requests_count}` | +| [Group Activity Analytics](group_activity_analytics.md) **(STARTER)** | `/analytics/group_activity/{issues_count | merge_requests_count | new_members_count }` | | [Import repository from GitHub](import.md) | `/import/github` | | [Issues](issues.md) | `/issues` (also available for groups and projects) | | [Issues Statistics](issues_statistics.md) | `/issues_statistics` (also available for groups and projects) | diff --git a/doc/api/group_activity_analytics.md b/doc/api/group_activity_analytics.md index 23dcb46dbc5..a211097e30b 100644 --- a/doc/api/group_activity_analytics.md +++ b/doc/api/group_activity_analytics.md @@ -49,3 +49,27 @@ Example response: ```json { "merge_requests_count": 10 } ``` + +## Get count of members recently added to group + +```plaintext +GET /analytics/group_activity/new_members_count +``` + +Parameters: + +| Attribute | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `group_path` | string | yes | Group path | + +Example request: + +```shell +curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/analytics/group_activity/new_members_count?group_path=gitlab-org +``` + +Example response: + +```json +{ "new_members_count": 10 } +``` diff --git a/doc/development/database_review.md b/doc/development/database_review.md index 650c6fc7936..d95fd7a38f6 100644 --- a/doc/development/database_review.md +++ b/doc/development/database_review.md @@ -80,6 +80,7 @@ the following preparations into account. - Add the output of the migration(s) to the MR description. - Add tests for the migration in `spec/migrations` if necessary. See [Testing Rails migrations at GitLab](testing_guide/testing_migrations_guide.md) for more details. - When [high-traffic](https://gitlab.com/gitlab-org/gitlab/-/blob/master/rubocop/migration_helpers.rb#L12) tables are involved in the migration, use the [`with_lock_retries`](migration_style_guide.md#retry-mechanism-when-acquiring-database-locks) helper method. Review the relevant [examples in our documentation](migration_style_guide.md#examples) for use cases and solutions. +- Ensure RuboCop checks are not disabled unless there's a valid reason to. #### Preparation when adding or modifying queries diff --git a/doc/development/documentation/styleguide.md b/doc/development/documentation/styleguide.md index c3f134b569d..8f58eb62fdd 100644 --- a/doc/development/documentation/styleguide.md +++ b/doc/development/documentation/styleguide.md @@ -28,7 +28,7 @@ It also informs decisions about the kinds of content we include in our documenta Include problem-solving actions that may address rare cases or be considered 'risky', so long as proper context is provided in the form of fully detailed warnings and caveats. This kind of content should be included as it could be helpful to others and, when properly explained, its benefits outweigh the risks. If you think you have found an exception to this rule, contact the Technical Writing team. We will add all troubleshooting information to the documentation, no matter how unlikely a user is to encounter a situation. -For the Troubleshooting sections, people in GitLab Support can merge additions themselves. +For the [Troubleshooting sections](#troubleshooting), people in GitLab Support can merge additions themselves. ### All media types @@ -83,7 +83,7 @@ We employ a **docs-first methodology** to help ensure that the docs remain a com New information that would be useful toward the future usage or troubleshooting of GitLab should not be written directly in a forum or other messaging system, but added to a docs MR and then referenced, as described above. Note that among any other doc changes, you can either: -- Add a Troubleshooting section to a doc if none exists. +- Add a [Troubleshooting section](#troubleshooting) to a doc if none exists. - Un-comment and use the placeholder Troubleshooting section included as part of our [doc template](structure.md#template-for-new-docs), if present. The more we reflexively add useful information to the docs, the more (and more successfully) the docs will be used to efficiently accomplish tasks and solve problems. @@ -1374,6 +1374,16 @@ In this case: - Different highlighting languages are used for each config in the code block. - The [GitLab Restart](#gitlab-restart) section is used to explain a required restart/reconfigure of GitLab. +### Troubleshooting + +For troubleshooting sections, you should provide as much context as possible so +users can identify the problem they are facing and resolve it on their own. You +can facilitate this by making sure the troubleshooting content addresses: + +1. The problem the user needs to solve. +1. How the user can confirm they have the problem. +1. Steps the user can take towards resolution of the problem. + ## Feature flags Sometimes features are shipped with feature flags, either: diff --git a/lib/gitlab/github_import/parallel_importer.rb b/lib/gitlab/github_import/parallel_importer.rb index cdd2abaeb4c..8fb99c996b3 100644 --- a/lib/gitlab/github_import/parallel_importer.rb +++ b/lib/gitlab/github_import/parallel_importer.rb @@ -31,7 +31,7 @@ module Gitlab end def execute - Gitlab::Import::SetAsyncJid.set_jid(project) + Gitlab::Import::SetAsyncJid.set_jid(project.import_state) Stage::ImportRepositoryWorker .perform_async(project.id) diff --git a/lib/gitlab/import/set_async_jid.rb b/lib/gitlab/import/set_async_jid.rb index 584d24045ee..3b11c92fb56 100644 --- a/lib/gitlab/import/set_async_jid.rb +++ b/lib/gitlab/import/set_async_jid.rb @@ -10,17 +10,18 @@ module Gitlab module Import module SetAsyncJid - def self.set_jid(project) - jid = generate_jid(project) + def self.set_jid(import_state) + jid = generate_jid(import_state) Gitlab::SidekiqStatus .set(jid, StuckImportJobsWorker::IMPORT_JOBS_EXPIRATION) - project.import_state.update_column(:jid, jid) + import_state.update_column(:jid, jid) end - def self.generate_jid(project) - "async-import/#{project.id}" + def self.generate_jid(import_state) + importer_name = import_state.class.name.underscore.dasherize + "async-import/#{importer_name}/#{import_state.project_id}" end end end diff --git a/lib/gitlab/import_export/attributes_finder.rb b/lib/gitlab/import_export/attributes_finder.rb index 28d48ce6dfe..bab473741b1 100644 --- a/lib/gitlab/import_export/attributes_finder.rb +++ b/lib/gitlab/import_export/attributes_finder.rb @@ -38,7 +38,7 @@ module Gitlab def resolve_preloads(model_key, model_tree) model_tree .map { |submodel_key, submodel_tree| resolve_preload(model_key, submodel_key, submodel_tree) } - .compact + .tap { |entries| entries.compact! } .to_h .deep_merge(@preloads[model_key].to_h) .presence diff --git a/lib/gitlab/import_export/fast_hash_serializer.rb b/lib/gitlab/import_export/fast_hash_serializer.rb index c5fb00ed741..e5d52f945b5 100644 --- a/lib/gitlab/import_export/fast_hash_serializer.rb +++ b/lib/gitlab/import_export/fast_hash_serializer.rb @@ -100,7 +100,7 @@ module Gitlab includes .map(&method(:serialize_include_definition)) - .compact + .tap { |entries| entries.compact! } .to_h end diff --git a/lib/gitlab/import_export/project/import_export.yml b/lib/gitlab/import_export/project/import_export.yml index 56f7ffbe4f8..06d7dd6f897 100644 --- a/lib/gitlab/import_export/project/import_export.yml +++ b/lib/gitlab/import_export/project/import_export.yml @@ -17,6 +17,7 @@ tree: - notes: - :author - :award_emoji + - :system_note_metadata - events: - :push_event_payload - label_links: @@ -47,6 +48,7 @@ tree: - notes: - :author - :award_emoji + - :system_note_metadata - events: - :push_event_payload - :suggestions @@ -323,6 +325,9 @@ excluded_attributes: epic_issue: - :epic_id - :issue_id + system_note_metadata: + - :description_version_id + - :note_id methods: notes: - :type diff --git a/lib/gitlab/import_export/relation_tree_restorer.rb b/lib/gitlab/import_export/relation_tree_restorer.rb index 7f25222ba41..78ed365cea0 100644 --- a/lib/gitlab/import_export/relation_tree_restorer.rb +++ b/lib/gitlab/import_export/relation_tree_restorer.rb @@ -142,9 +142,9 @@ module Gitlab end def build_relations(relation_key, relation_definition, data_hashes) - data_hashes.map do |data_hash| - build_relation(relation_key, relation_definition, data_hash) - end.compact + data_hashes + .map { |data_hash| build_relation(relation_key, relation_definition, data_hash) } + .tap { |entries| entries.compact! } end def build_relation(relation_key, relation_definition, data_hash) diff --git a/lib/gitlab/phabricator_import/importer.rb b/lib/gitlab/phabricator_import/importer.rb index c1797f4027e..ac85b96de08 100644 --- a/lib/gitlab/phabricator_import/importer.rb +++ b/lib/gitlab/phabricator_import/importer.rb @@ -18,7 +18,7 @@ module Gitlab end def execute - Gitlab::Import::SetAsyncJid.set_jid(project) + Gitlab::Import::SetAsyncJid.set_jid(project.import_state) schedule_first_tasks_page true diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 9dc66b5b27a..3de227fba99 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -11878,13 +11878,13 @@ msgstr "" msgid "LicenseCompliance|License Compliance" msgstr "" -msgid "LicenseCompliance|License Compliance detected %d license for the source branch only" -msgid_plural "LicenseCompliance|License Compliance detected %d licenses for the source branch only" +msgid "LicenseCompliance|License Compliance detected %d license and policy violation for the source branch only; approval required" +msgid_plural "LicenseCompliance|License Compliance detected %d licenses and policy violations for the source branch only; approval required" msgstr[0] "" msgstr[1] "" -msgid "LicenseCompliance|License Compliance detected %d license for the source branch only; approval required" -msgid_plural "LicenseCompliance|License Compliance detected %d licenses for the source branch only; approval required" +msgid "LicenseCompliance|License Compliance detected %d license for the source branch only" +msgid_plural "LicenseCompliance|License Compliance detected %d licenses for the source branch only" msgstr[0] "" msgstr[1] "" @@ -11893,8 +11893,8 @@ msgid_plural "LicenseCompliance|License Compliance detected %d new licenses" msgstr[0] "" msgstr[1] "" -msgid "LicenseCompliance|License Compliance detected %d new license; approval required" -msgid_plural "LicenseCompliance|License Compliance detected %d new licenses; approval required" +msgid "LicenseCompliance|License Compliance detected %d new license and policy violation; approval required" +msgid_plural "LicenseCompliance|License Compliance detected %d new licenses and policy violations; approval required" msgstr[0] "" msgstr[1] "" @@ -18342,6 +18342,9 @@ msgstr "" msgid "Should you ever lose your phone or access to your one time password secret, each of these recovery codes can be used one time each to regain access to your account. Please save them in a safe place, or you %{b_start}will%{b_end} lose access to your account." msgstr "" +msgid "Show all %{issuable_type}." +msgstr "" + msgid "Show all activity" msgstr "" diff --git a/package.json b/package.json index 3132009ee2b..e0c0bf3161b 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "@babel/preset-env": "^7.8.4", "@gitlab/at.js": "1.5.5", "@gitlab/svgs": "1.116.0", - "@gitlab/ui": "10.1.2", + "@gitlab/ui": "11.0.0", "@gitlab/visual-review-tools": "1.5.1", "@sentry/browser": "^5.10.2", "@sourcegraph/code-host-integration": "0.0.34", diff --git a/spec/controllers/projects/grafana_api_controller_spec.rb b/spec/controllers/projects/grafana_api_controller_spec.rb index 0ef96514961..c62baa30fde 100644 --- a/spec/controllers/projects/grafana_api_controller_spec.rb +++ b/spec/controllers/projects/grafana_api_controller_spec.rb @@ -20,8 +20,8 @@ describe Projects::GrafanaApiController do proxy_path: 'api/v1/query_range', datasource_id: '1', query: 'rate(relevant_metric)', - start: '1570441248', - end: '1570444848', + start_time: '1570441248', + end_time: '1570444848', step: '900' } end @@ -50,7 +50,10 @@ describe Projects::GrafanaApiController do expect(Grafana::ProxyService) .to have_received(:new) .with(project, '1', 'api/v1/query_range', - params.slice(:query, :start, :end, :step).stringify_keys) + { 'query' => params[:query], + 'start' => params[:start_time], + 'end' => params[:end_time], + 'step' => params[:step] }) expect(response).to have_gitlab_http_status(:ok) expect(json_response).to eq({}) diff --git a/spec/features/markdown/metrics_spec.rb b/spec/features/markdown/metrics_spec.rb index 6ef4f6ddecc..0d8858a7afd 100644 --- a/spec/features/markdown/metrics_spec.rb +++ b/spec/features/markdown/metrics_spec.rb @@ -34,6 +34,8 @@ describe 'Metrics rendering', :js, :use_clean_rails_memory_store_caching, :sidek before do import_common_metrics stub_any_prometheus_request_with_response + + allow(Prometheus::ProxyService).to receive(:new).and_call_original end it 'shows embedded metrics' do @@ -42,6 +44,12 @@ describe 'Metrics rendering', :js, :use_clean_rails_memory_store_caching, :sidek expect(page).to have_css('div.prometheus-graph') expect(page).to have_text('Memory Usage (Total)') expect(page).to have_text('Core Usage (Total)') + + # Ensure that the FE is calling the BE with expected params + expect(Prometheus::ProxyService) + .to have_received(:new) + .with(environment, 'GET', 'query_range', hash_including('start', 'end', 'step')) + .at_least(:once) end context 'when dashboard params are in included the url' do @@ -61,6 +69,12 @@ describe 'Metrics rendering', :js, :use_clean_rails_memory_store_caching, :sidek expect(page).to have_css('div.prometheus-graph') expect(page).to have_text(chart_params[:title]) expect(page).to have_text(chart_params[:y_label]) + + # Ensure that the FE is calling the BE with expected params + expect(Prometheus::ProxyService) + .to have_received(:new) + .with(environment, 'GET', 'query_range', hash_including('start', 'end', 'step')) + .at_least(:once) end context 'when two dashboard urls are included' do @@ -83,6 +97,12 @@ describe 'Metrics rendering', :js, :use_clean_rails_memory_store_caching, :sidek expect(page).to have_text(chart_params[:y_label]) expect(page).to have_text(chart_params_2[:title]) expect(page).to have_text(chart_params_2[:y_label]) + + # Ensure that the FE is calling the BE with expected params + expect(Prometheus::ProxyService) + .to have_received(:new) + .with(environment, 'GET', 'query_range', hash_including('start', 'end', 'step')) + .at_least(:once) end end end @@ -97,6 +117,8 @@ describe 'Metrics rendering', :js, :use_clean_rails_memory_store_caching, :sidek stub_dashboard_request(grafana_base_url) stub_datasource_request(grafana_base_url) stub_all_grafana_proxy_requests(grafana_base_url) + + allow(Grafana::ProxyService).to receive(:new).and_call_original end it 'shows embedded metrics' do @@ -105,6 +127,12 @@ describe 'Metrics rendering', :js, :use_clean_rails_memory_store_caching, :sidek expect(page).to have_css('div.prometheus-graph') expect(page).to have_text('Expired / Evicted') expect(page).to have_text('expired - test-attribute-value') + + # Ensure that the FE is calling the BE with expected params + expect(Grafana::ProxyService) + .to have_received(:new) + .with(project, anything, anything, hash_including('query', 'start', 'end', 'step')) + .at_least(:once) end end diff --git a/spec/fixtures/lib/gitlab/import_export/complex/project.json b/spec/fixtures/lib/gitlab/import_export/complex/project.json index 97baf5cdd39..4bf72fe6912 100644 --- a/spec/fixtures/lib/gitlab/import_export/complex/project.json +++ b/spec/fixtures/lib/gitlab/import_export/complex/project.json @@ -2493,6 +2493,84 @@ "merge_commit_sha": null, "notes": [ { + "id": 669, + "note": "added 3 commits\n\n<ul><li>16ea4e20...074a2a32 - 2 commits from branch <code>master</code></li><li>ca223a02 - readme: fix typos</li></ul>\n\n[Compare with previous version](/group/project/merge_requests/1/diffs?diff_id=1189&start_sha=16ea4e207fb258fe4e9c73185a725207c9a4f3e1)", + "noteable_type": "MergeRequest", + "author_id": 26, + "created_at": "2020-03-28T12:47:33.461Z", + "updated_at": "2020-03-28T12:47:33.461Z", + "project_id": 5, + "attachment": { + "url": null + }, + "line_code": null, + "commit_id": null, + "system": true, + "st_diff": null, + "updated_by_id": null, + "position": null, + "original_position": null, + "resolved_at": null, + "resolved_by_id": null, + "discussion_id": null, + "change_position": null, + "resolved_by_push": null, + "confidential": null, + "type": null, + "author": { + "name": "User 4" + }, + "award_emoji": [], + "system_note_metadata": { + "id": 4789, + "commit_count": 3, + "action": "commit", + "created_at": "2020-03-28T12:47:33.461Z", + "updated_at": "2020-03-28T12:47:33.461Z" + }, + "events": [], + "suggestions": [] + }, + { + "id": 670, + "note": "unmarked as a **Work In Progress**", + "noteable_type": "MergeRequest", + "author_id": 26, + "created_at": "2020-03-28T12:48:36.951Z", + "updated_at": "2020-03-28T12:48:36.951Z", + "project_id": 5, + "attachment": { + "url": null + }, + "line_code": null, + "commit_id": null, + "system": true, + "st_diff": null, + "updated_by_id": null, + "position": null, + "original_position": null, + "resolved_at": null, + "resolved_by_id": null, + "discussion_id": null, + "change_position": null, + "resolved_by_push": null, + "confidential": null, + "type": null, + "author": { + "name": "User 4" + }, + "award_emoji": [], + "system_note_metadata": { + "id": 4790, + "commit_count": null, + "action": "title", + "created_at": "2020-03-28T12:48:36.951Z", + "updated_at": "2020-03-28T12:48:36.951Z" + }, + "events": [], + "suggestions": [] + }, + { "id": 671, "note": "Sit voluptatibus eveniet architecto quidem.", "note_html": "<p>something else entirely</p>", diff --git a/spec/fixtures/lib/gitlab/import_export/light/project.json b/spec/fixtures/lib/gitlab/import_export/light/project.json index ad0fc59326b..eaed8565a18 100644 --- a/spec/fixtures/lib/gitlab/import_export/light/project.json +++ b/spec/fixtures/lib/gitlab/import_export/light/project.json @@ -98,6 +98,46 @@ "priorities": [] } } + ], + "notes": [ + { + "id": 20, + "note": "created merge request !1 to address this issue", + "noteable_type": "Issue", + "author_id": 1, + "created_at": "2020-03-28T01:37:42.307Z", + "updated_at": "2020-03-28T01:37:42.307Z", + "project_id": 8, + "attachment": { + "url": null + }, + "line_code": null, + "commit_id": null, + "system": true, + "st_diff": null, + "updated_by_id": null, + "position": null, + "original_position": null, + "resolved_at": null, + "resolved_by_id": null, + "discussion_id": null, + "change_position": null, + "resolved_by_push": null, + "confidential": null, + "type": null, + "author": { + "name": "Author" + }, + "award_emoji": [], + "system_note_metadata": { + "id": 21, + "commit_count": null, + "action": "merge", + "created_at": "2020-03-28T01:37:42.307Z", + "updated_at": "2020-03-28T01:37:42.307Z" + }, + "events": [] + } ] } ], diff --git a/spec/frontend/blob/components/blob_edit_content_spec.js b/spec/frontend/blob/components/blob_edit_content_spec.js index eff53fe7ce9..189d2629efa 100644 --- a/spec/frontend/blob/components/blob_edit_content_spec.js +++ b/spec/frontend/blob/components/blob_edit_content_spec.js @@ -12,11 +12,12 @@ describe('Blob Header Editing', () => { const value = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.'; const fileName = 'lorem.txt'; - function createComponent() { + function createComponent(props = {}) { wrapper = shallowMount(BlobEditContent, { propsData: { value, fileName, + ...props, }, }); } @@ -40,6 +41,14 @@ describe('Blob Header Editing', () => { }); describe('functionality', () => { + it('does not fail without content', () => { + const spy = jest.spyOn(global.console, 'error'); + createComponent({ value: undefined }); + + expect(spy).not.toHaveBeenCalled(); + expect(wrapper.contains('#editor')).toBe(true); + }); + it('initialises Editor Lite', () => { const el = wrapper.find({ ref: 'editor' }).element; expect(initEditorLite).toHaveBeenCalledWith({ diff --git a/spec/frontend/blob/components/blob_header_default_actions_spec.js b/spec/frontend/blob/components/blob_header_default_actions_spec.js index 39d627e71c5..684840afe1c 100644 --- a/spec/frontend/blob/components/blob_header_default_actions_spec.js +++ b/spec/frontend/blob/components/blob_header_default_actions_spec.js @@ -6,7 +6,7 @@ import { BTN_RAW_TITLE, RICH_BLOB_VIEWER, } from '~/blob/components/constants'; -import { GlButtonGroup, GlButton } from '@gitlab/ui'; +import { GlButtonGroup, GlDeprecatedButton } from '@gitlab/ui'; import { Blob } from './mock_data'; describe('Blob Header Default Actions', () => { @@ -27,7 +27,7 @@ describe('Blob Header Default Actions', () => { beforeEach(() => { createComponent(); btnGroup = wrapper.find(GlButtonGroup); - buttons = wrapper.findAll(GlButton); + buttons = wrapper.findAll(GlDeprecatedButton); }); afterEach(() => { @@ -62,7 +62,7 @@ describe('Blob Header Default Actions', () => { createComponent({ activeViewer: RICH_BLOB_VIEWER, }); - buttons = wrapper.findAll(GlButton); + buttons = wrapper.findAll(GlDeprecatedButton); expect(buttons.at(0).attributes('disabled')).toBeTruthy(); }); diff --git a/spec/frontend/blob/components/blob_header_viewer_switcher_spec.js b/spec/frontend/blob/components/blob_header_viewer_switcher_spec.js index f1a7ac8b21a..0f34d6419d3 100644 --- a/spec/frontend/blob/components/blob_header_viewer_switcher_spec.js +++ b/spec/frontend/blob/components/blob_header_viewer_switcher_spec.js @@ -6,7 +6,7 @@ import { SIMPLE_BLOB_VIEWER, SIMPLE_BLOB_VIEWER_TITLE, } from '~/blob/components/constants'; -import { GlButtonGroup, GlButton } from '@gitlab/ui'; +import { GlButtonGroup, GlDeprecatedButton } from '@gitlab/ui'; describe('Blob Header Viewer Switcher', () => { let wrapper; @@ -35,7 +35,7 @@ describe('Blob Header Viewer Switcher', () => { beforeEach(() => { createComponent(); btnGroup = wrapper.find(GlButtonGroup); - buttons = wrapper.findAll(GlButton); + buttons = wrapper.findAll(GlDeprecatedButton); }); it('renders gl-button-group component', () => { @@ -57,7 +57,7 @@ describe('Blob Header Viewer Switcher', () => { function factory(propsData = {}) { createComponent(propsData); - buttons = wrapper.findAll(GlButton); + buttons = wrapper.findAll(GlDeprecatedButton); simpleBtn = buttons.at(0); richBtn = buttons.at(1); diff --git a/spec/frontend/ci_variable_list/components/ci_variable_modal_spec.js b/spec/frontend/ci_variable_list/components/ci_variable_modal_spec.js index 058aca16ea0..70edd36669b 100644 --- a/spec/frontend/ci_variable_list/components/ci_variable_modal_spec.js +++ b/spec/frontend/ci_variable_list/components/ci_variable_modal_spec.js @@ -1,6 +1,6 @@ import Vuex from 'vuex'; import { createLocalVue, shallowMount } from '@vue/test-utils'; -import { GlButton } from '@gitlab/ui'; +import { GlDeprecatedButton } from '@gitlab/ui'; import CiVariableModal from '~/ci_variable_list/components/ci_variable_modal.vue'; import createStore from '~/ci_variable_list/store'; import mockData from '../services/mock_data'; @@ -27,11 +27,11 @@ describe('Ci variable modal', () => { const findModal = () => wrapper.find(ModalStub); const addOrUpdateButton = index => findModal() - .findAll(GlButton) + .findAll(GlDeprecatedButton) .at(index); const deleteVariableButton = () => findModal() - .findAll(GlButton) + .findAll(GlDeprecatedButton) .at(1); beforeEach(() => { diff --git a/spec/frontend/ci_variable_list/components/ci_variable_popover_spec.js b/spec/frontend/ci_variable_list/components/ci_variable_popover_spec.js index 5d37f059161..46f77a6f11e 100644 --- a/spec/frontend/ci_variable_list/components/ci_variable_popover_spec.js +++ b/spec/frontend/ci_variable_list/components/ci_variable_popover_spec.js @@ -1,5 +1,5 @@ import { shallowMount } from '@vue/test-utils'; -import { GlButton } from '@gitlab/ui'; +import { GlDeprecatedButton } from '@gitlab/ui'; import CiVariablePopover from '~/ci_variable_list/components/ci_variable_popover.vue'; import mockData from '../services/mock_data'; @@ -18,7 +18,7 @@ describe('Ci Variable Popover', () => { }); }; - const findButton = () => wrapper.find(GlButton); + const findButton = () => wrapper.find(GlDeprecatedButton); beforeEach(() => { createComponent(); diff --git a/spec/frontend/code_navigation/components/__snapshots__/popover_spec.js.snap b/spec/frontend/code_navigation/components/__snapshots__/popover_spec.js.snap index dda6d68018e..c1534022242 100644 --- a/spec/frontend/code_navigation/components/__snapshots__/popover_spec.js.snap +++ b/spec/frontend/code_navigation/components/__snapshots__/popover_spec.js.snap @@ -23,7 +23,7 @@ exports[`Code navigation popover component renders popover 1`] = ` <div class="popover-body" > - <gl-button-stub + <gl-deprecated-button-stub class="w-100" href="http://test.com" size="md" @@ -33,7 +33,7 @@ exports[`Code navigation popover component renders popover 1`] = ` Go to definition - </gl-button-stub> + </gl-deprecated-button-stub> </div> </div> `; diff --git a/spec/frontend/contributors/component/__snapshots__/contributors_spec.js.snap b/spec/frontend/contributors/component/__snapshots__/contributors_spec.js.snap index a4a0b98de1b..fafffcb6e0c 100644 --- a/spec/frontend/contributors/component/__snapshots__/contributors_spec.js.snap +++ b/spec/frontend/contributors/component/__snapshots__/contributors_spec.js.snap @@ -15,6 +15,7 @@ exports[`Contributors charts should render charts when loading completed and the <div> <glareachart-stub + annotations="" data="[object Object]" height="264" includelegendavgmax="true" @@ -42,6 +43,7 @@ exports[`Contributors charts should render charts when loading completed and the <div> <glareachart-stub + annotations="" data="[object Object]" height="216" includelegendavgmax="true" diff --git a/spec/frontend/environments/environment_pin_spec.js b/spec/frontend/environments/environment_pin_spec.js index d1d6735fa38..486f6db7366 100644 --- a/spec/frontend/environments/environment_pin_spec.js +++ b/spec/frontend/environments/environment_pin_spec.js @@ -1,5 +1,5 @@ import { shallowMount } from '@vue/test-utils'; -import { GlButton } from '@gitlab/ui'; +import { GlDeprecatedButton } from '@gitlab/ui'; import Icon from '~/vue_shared/components/icon.vue'; import eventHub from '~/environments/event_hub'; import PinComponent from '~/environments/components/environment_pin.vue'; @@ -37,7 +37,7 @@ describe('Pin Component', () => { it('should emit onPinClick when clicked', () => { const eventHubSpy = jest.spyOn(eventHub, '$emit'); - const button = wrapper.find(GlButton); + const button = wrapper.find(GlDeprecatedButton); button.vm.$emit('click'); diff --git a/spec/frontend/environments/environment_rollback_spec.js b/spec/frontend/environments/environment_rollback_spec.js index fb62a096c3d..f25e05f9cd8 100644 --- a/spec/frontend/environments/environment_rollback_spec.js +++ b/spec/frontend/environments/environment_rollback_spec.js @@ -1,5 +1,5 @@ import { shallowMount, mount } from '@vue/test-utils'; -import { GlButton } from '@gitlab/ui'; +import { GlDeprecatedButton } from '@gitlab/ui'; import eventHub from '~/environments/event_hub'; import RollbackComponent from '~/environments/components/environment_rollback.vue'; @@ -40,7 +40,7 @@ describe('Rollback Component', () => { }, }, }); - const button = wrapper.find(GlButton); + const button = wrapper.find(GlDeprecatedButton); button.vm.$emit('click'); diff --git a/spec/frontend/error_tracking/components/error_details_spec.js b/spec/frontend/error_tracking/components/error_details_spec.js index 72b0466a1f0..adbbc04ce78 100644 --- a/spec/frontend/error_tracking/components/error_details_spec.js +++ b/spec/frontend/error_tracking/components/error_details_spec.js @@ -3,7 +3,7 @@ import Vuex from 'vuex'; import { __ } from '~/locale'; import createFlash from '~/flash'; import { - GlButton, + GlDeprecatedButton, GlLoadingIcon, GlLink, GlBadge, @@ -38,7 +38,7 @@ describe('ErrorDetails', () => { function mountComponent() { wrapper = shallowMount(ErrorDetails, { - stubs: { GlButton, GlSprintf }, + stubs: { GlDeprecatedButton, GlSprintf }, localVue, store, mocks, @@ -178,7 +178,7 @@ describe('ErrorDetails', () => { expect(wrapper.find(GlLoadingIcon).exists()).toBe(true); expect(wrapper.find(Stacktrace).exists()).toBe(false); expect(wrapper.find(GlBadge).exists()).toBe(false); - expect(wrapper.findAll(GlButton).length).toBe(3); + expect(wrapper.findAll(GlDeprecatedButton).length).toBe(3); }); describe('unsafe chars for culprit field', () => { diff --git a/spec/frontend/error_tracking/components/error_tracking_actions_spec.js b/spec/frontend/error_tracking/components/error_tracking_actions_spec.js index b22805f5227..1ea92883e54 100644 --- a/spec/frontend/error_tracking/components/error_tracking_actions_spec.js +++ b/spec/frontend/error_tracking/components/error_tracking_actions_spec.js @@ -1,5 +1,5 @@ import { shallowMount } from '@vue/test-utils'; -import { GlButton } from '@gitlab/ui'; +import { GlDeprecatedButton } from '@gitlab/ui'; import ErrorTrackingActions from '~/error_tracking/components/error_tracking_actions.vue'; describe('Error Tracking Actions', () => { @@ -20,7 +20,7 @@ describe('Error Tracking Actions', () => { }, ...props, }, - stubs: { GlButton }, + stubs: { GlDeprecatedButton }, }); } @@ -34,7 +34,7 @@ describe('Error Tracking Actions', () => { } }); - const findButtons = () => wrapper.findAll(GlButton); + const findButtons = () => wrapper.findAll(GlDeprecatedButton); describe('when error status is unresolved', () => { it('renders the correct actions buttons to allow ignore and resolve', () => { diff --git a/spec/frontend/error_tracking/components/error_tracking_list_spec.js b/spec/frontend/error_tracking/components/error_tracking_list_spec.js index 3bea1d343be..a6cb074f481 100644 --- a/spec/frontend/error_tracking/components/error_tracking_list_spec.js +++ b/spec/frontend/error_tracking/components/error_tracking_list_spec.js @@ -241,7 +241,7 @@ describe('ErrorTrackingList', () => { stubs: { GlTable: false, GlLink: false, - GlButton: false, + GlDeprecatedButton: false, }, }); }); @@ -280,7 +280,7 @@ describe('ErrorTrackingList', () => { stubs: { GlTable: false, GlLink: false, - GlButton: false, + GlDeprecatedButton: false, }, }); }); diff --git a/spec/frontend/grafana_integration/components/__snapshots__/grafana_integration_spec.js.snap b/spec/frontend/grafana_integration/components/__snapshots__/grafana_integration_spec.js.snap index 09977ecc7a3..1595f6c9fff 100644 --- a/spec/frontend/grafana_integration/components/__snapshots__/grafana_integration_spec.js.snap +++ b/spec/frontend/grafana_integration/components/__snapshots__/grafana_integration_spec.js.snap @@ -16,13 +16,13 @@ exports[`grafana integration component default state to match the default snapsh </h3> - <gl-button-stub + <gl-deprecated-button-stub class="js-settings-toggle" size="md" variant="secondary" > Expand - </gl-button-stub> + </gl-deprecated-button-stub> <p class="js-section-sub-header" @@ -90,14 +90,14 @@ exports[`grafana integration component default state to match the default snapsh </p> </gl-form-group-stub> - <gl-button-stub + <gl-deprecated-button-stub size="md" variant="success" > Save Changes - </gl-button-stub> + </gl-deprecated-button-stub> </form> </div> </section> diff --git a/spec/frontend/grafana_integration/components/grafana_integration_spec.js b/spec/frontend/grafana_integration/components/grafana_integration_spec.js index 92754ada64f..3df200a98e4 100644 --- a/spec/frontend/grafana_integration/components/grafana_integration_spec.js +++ b/spec/frontend/grafana_integration/components/grafana_integration_spec.js @@ -1,5 +1,5 @@ import { mount, shallowMount } from '@vue/test-utils'; -import { GlButton } from '@gitlab/ui'; +import { GlDeprecatedButton } from '@gitlab/ui'; import { TEST_HOST } from 'helpers/test_constants'; import GrafanaIntegration from '~/grafana_integration/components/grafana_integration.vue'; import { createStore } from '~/grafana_integration/store'; @@ -51,7 +51,7 @@ describe('grafana integration component', () => { it('renders as an expand button by default', () => { wrapper = shallowMount(GrafanaIntegration, { store }); - const button = wrapper.find(GlButton); + const button = wrapper.find(GlDeprecatedButton); expect(button.text()).toBe('Expand'); }); @@ -77,7 +77,8 @@ describe('grafana integration component', () => { }); describe('submit button', () => { - const findSubmitButton = () => wrapper.find('.settings-content form').find(GlButton); + const findSubmitButton = () => + wrapper.find('.settings-content form').find(GlDeprecatedButton); const endpointRequest = [ operationsSettingsEndpoint, diff --git a/spec/frontend/logs/components/log_control_buttons_spec.js b/spec/frontend/logs/components/log_control_buttons_spec.js index 38e568f569f..85fc5a040d6 100644 --- a/spec/frontend/logs/components/log_control_buttons_spec.js +++ b/spec/frontend/logs/components/log_control_buttons_spec.js @@ -1,5 +1,5 @@ import { shallowMount } from '@vue/test-utils'; -import { GlButton } from '@gitlab/ui'; +import { GlDeprecatedButton } from '@gitlab/ui'; import LogControlButtons from '~/logs/components/log_control_buttons.vue'; describe('LogControlButtons', () => { @@ -31,9 +31,9 @@ describe('LogControlButtons', () => { expect(wrapper.isVueInstance()).toBe(true); expect(wrapper.isEmpty()).toBe(false); - expect(findScrollToTop().is(GlButton)).toBe(true); - expect(findScrollToBottom().is(GlButton)).toBe(true); - expect(findRefreshBtn().is(GlButton)).toBe(true); + expect(findScrollToTop().is(GlDeprecatedButton)).toBe(true); + expect(findScrollToBottom().is(GlDeprecatedButton)).toBe(true); + expect(findRefreshBtn().is(GlDeprecatedButton)).toBe(true); }); it('emits a `refresh` event on click on `refresh` button', () => { diff --git a/spec/frontend/maintenance_mode_settings/components/app_spec.js b/spec/frontend/maintenance_mode_settings/components/app_spec.js index a67bc63cfe1..0453354b008 100644 --- a/spec/frontend/maintenance_mode_settings/components/app_spec.js +++ b/spec/frontend/maintenance_mode_settings/components/app_spec.js @@ -1,6 +1,6 @@ import { shallowMount } from '@vue/test-utils'; import MaintenanceModeSettingsApp from '~/maintenance_mode_settings/components/app.vue'; -import { GlToggle, GlFormTextarea, GlButton } from '@gitlab/ui'; +import { GlToggle, GlFormTextarea, GlDeprecatedButton } from '@gitlab/ui'; describe('MaintenanceModeSettingsApp', () => { let wrapper; @@ -16,7 +16,7 @@ describe('MaintenanceModeSettingsApp', () => { const findMaintenanceModeSettingsContainer = () => wrapper.find('article'); const findGlToggle = () => wrapper.find(GlToggle); const findGlFormTextarea = () => wrapper.find(GlFormTextarea); - const findGlButton = () => wrapper.find(GlButton); + const findGlButton = () => wrapper.find(GlDeprecatedButton); describe('template', () => { beforeEach(() => { @@ -35,7 +35,7 @@ describe('MaintenanceModeSettingsApp', () => { expect(findGlFormTextarea().exists()).toBe(true); }); - it('renders the GlButton', () => { + it('renders the GlDeprecatedButton', () => { expect(findGlButton().exists()).toBe(true); }); }); diff --git a/spec/frontend/monitoring/components/__snapshots__/dashboard_template_spec.js.snap b/spec/frontend/monitoring/components/__snapshots__/dashboard_template_spec.js.snap index c61ac0fb175..f7e15d4a5c4 100644 --- a/spec/frontend/monitoring/components/__snapshots__/dashboard_template_spec.js.snap +++ b/spec/frontend/monitoring/components/__snapshots__/dashboard_template_spec.js.snap @@ -90,7 +90,7 @@ exports[`Dashboard template matches the default snapshot 1`] = ` <gl-form-group-stub class="col-sm-2 col-md-2 col-lg-1 refresh-dashboard-button" > - <gl-button-stub + <gl-deprecated-button-stub size="md" title="Reload this page" variant="default" @@ -99,7 +99,7 @@ exports[`Dashboard template matches the default snapshot 1`] = ` name="repeat" size="16" /> - </gl-button-stub> + </gl-deprecated-button-stub> </gl-form-group-stub> <!----> diff --git a/spec/frontend/monitoring/components/dashboard_spec.js b/spec/frontend/monitoring/components/dashboard_spec.js index ec25c9e169a..f2c3b199481 100644 --- a/spec/frontend/monitoring/components/dashboard_spec.js +++ b/spec/frontend/monitoring/components/dashboard_spec.js @@ -1,5 +1,5 @@ import { shallowMount, createLocalVue, mount } from '@vue/test-utils'; -import { GlDropdownItem, GlButton } from '@gitlab/ui'; +import { GlDropdownItem, GlDeprecatedButton } from '@gitlab/ui'; import VueDraggable from 'vuedraggable'; import MockAdapter from 'axios-mock-adapter'; import axios from '~/lib/utils/axios_utils'; @@ -234,7 +234,7 @@ describe('Dashboard', () => { const refreshBtn = wrapper.findAll({ ref: 'refreshDashboardBtn' }); expect(refreshBtn).toHaveLength(1); - expect(refreshBtn.is(GlButton)).toBe(true); + expect(refreshBtn.is(GlDeprecatedButton)).toBe(true); }); }); @@ -517,7 +517,7 @@ describe('Dashboard', () => { const externalDashboardButton = wrapper.find('.js-external-dashboard-link'); expect(externalDashboardButton.exists()).toBe(true); - expect(externalDashboardButton.is(GlButton)).toBe(true); + expect(externalDashboardButton.is(GlDeprecatedButton)).toBe(true); expect(externalDashboardButton.text()).toContain('View full dashboard'); }); }); diff --git a/spec/frontend/monitoring/components/embeds/embed_group_spec.js b/spec/frontend/monitoring/components/embeds/embed_group_spec.js index 54d21def603..49c10483c45 100644 --- a/spec/frontend/monitoring/components/embeds/embed_group_spec.js +++ b/spec/frontend/monitoring/components/embeds/embed_group_spec.js @@ -1,6 +1,6 @@ import { createLocalVue, mount, shallowMount } from '@vue/test-utils'; import Vuex from 'vuex'; -import { GlButton, GlCard } from '@gitlab/ui'; +import { GlDeprecatedButton, GlCard } from '@gitlab/ui'; import { TEST_HOST } from 'helpers/test_constants'; import EmbedGroup from '~/monitoring/components/embeds/embed_group.vue'; import MetricEmbed from '~/monitoring/components/embeds/metric_embed.vue'; @@ -80,7 +80,7 @@ describe('Embed Group', () => { metricsWithDataGetter.mockReturnValue([1]); mountComponent({ shallow: false, stubs: { MetricEmbed: '<div />' } }); - wrapper.find(GlButton).trigger('click'); + wrapper.find(GlDeprecatedButton).trigger('click'); wrapper.vm.$nextTick(() => { expect(wrapper.find('.card-body').classes()).toContain('d-none'); @@ -150,14 +150,14 @@ describe('Embed Group', () => { metricsWithDataGetter.mockReturnValue([1]); mountComponent({ shallow: false, stubs: { MetricEmbed: '<div />' } }); - expect(wrapper.find(GlButton).text()).toBe('Hide chart'); + expect(wrapper.find(GlDeprecatedButton).text()).toBe('Hide chart'); }); it('has a plural label when there are multiple embeds', () => { metricsWithDataGetter.mockReturnValue([2]); mountComponent({ shallow: false, stubs: { MetricEmbed: '<div />' } }); - expect(wrapper.find(GlButton).text()).toBe('Hide charts'); + expect(wrapper.find(GlDeprecatedButton).text()).toBe('Hide charts'); }); }); }); diff --git a/spec/frontend/notes/components/discussion_resolve_with_issue_button_spec.js b/spec/frontend/notes/components/discussion_resolve_with_issue_button_spec.js index 4348445f7ca..e62fb5db2c0 100644 --- a/spec/frontend/notes/components/discussion_resolve_with_issue_button_spec.js +++ b/spec/frontend/notes/components/discussion_resolve_with_issue_button_spec.js @@ -1,4 +1,4 @@ -import { GlButton } from '@gitlab/ui'; +import { GlDeprecatedButton } from '@gitlab/ui'; import { shallowMount, createLocalVue } from '@vue/test-utils'; import { TEST_HOST } from 'spec/test_constants'; import ResolveWithIssueButton from '~/notes/components/discussion_resolve_with_issue_button.vue'; @@ -23,7 +23,7 @@ describe('ResolveWithIssueButton', () => { }); it('it should have a link with the provided link property as href', () => { - const button = wrapper.find(GlButton); + const button = wrapper.find(GlDeprecatedButton); expect(button.attributes().href).toBe(url); }); diff --git a/spec/frontend/operation_settings/components/external_dashboard_spec.js b/spec/frontend/operation_settings/components/external_dashboard_spec.js index 89db03378db..19214d1d954 100644 --- a/spec/frontend/operation_settings/components/external_dashboard_spec.js +++ b/spec/frontend/operation_settings/components/external_dashboard_spec.js @@ -1,5 +1,5 @@ import { mount, shallowMount } from '@vue/test-utils'; -import { GlButton, GlLink, GlFormGroup, GlFormInput } from '@gitlab/ui'; +import { GlDeprecatedButton, GlLink, GlFormGroup, GlFormInput } from '@gitlab/ui'; import { TEST_HOST } from 'helpers/test_constants'; import ExternalDashboard from '~/operation_settings/components/external_dashboard.vue'; import store from '~/operation_settings/store'; @@ -49,7 +49,7 @@ describe('operation settings external dashboard component', () => { describe('expand/collapse button', () => { it('renders as an expand button by default', () => { - const button = wrapper.find(GlButton); + const button = wrapper.find(GlDeprecatedButton); expect(button.text()).toBe('Expand'); }); @@ -115,7 +115,8 @@ describe('operation settings external dashboard component', () => { }); describe('submit button', () => { - const findSubmitButton = () => wrapper.find('.settings-content form').find(GlButton); + const findSubmitButton = () => + wrapper.find('.settings-content form').find(GlDeprecatedButton); const endpointRequest = [ operationsSettingsEndpoint, diff --git a/spec/frontend/pages/admin/users/components/__snapshots__/delete_user_modal_spec.js.snap b/spec/frontend/pages/admin/users/components/__snapshots__/delete_user_modal_spec.js.snap index 9b723ccc3dc..ea3bedf59e0 100644 --- a/spec/frontend/pages/admin/users/components/__snapshots__/delete_user_modal_spec.js.snap +++ b/spec/frontend/pages/admin/users/components/__snapshots__/delete_user_modal_spec.js.snap @@ -38,14 +38,14 @@ exports[`User Operation confirmation modal renders modal with form included 1`] /> </form> - <gl-button-stub + <gl-deprecated-button-stub size="md" variant="secondary" > Cancel - </gl-button-stub> + </gl-deprecated-button-stub> - <gl-button-stub + <gl-deprecated-button-stub disabled="true" size="md" variant="warning" @@ -53,14 +53,14 @@ exports[`User Operation confirmation modal renders modal with form included 1`] secondaryAction - </gl-button-stub> + </gl-deprecated-button-stub> - <gl-button-stub + <gl-deprecated-button-stub disabled="true" size="md" variant="danger" > action - </gl-button-stub> + </gl-deprecated-button-stub> </div> `; diff --git a/spec/frontend/pages/admin/users/components/delete_user_modal_spec.js b/spec/frontend/pages/admin/users/components/delete_user_modal_spec.js index 3efefa8137f..16b0bd305cd 100644 --- a/spec/frontend/pages/admin/users/components/delete_user_modal_spec.js +++ b/spec/frontend/pages/admin/users/components/delete_user_modal_spec.js @@ -1,5 +1,5 @@ import { shallowMount } from '@vue/test-utils'; -import { GlButton, GlFormInput } from '@gitlab/ui'; +import { GlDeprecatedButton, GlFormInput } from '@gitlab/ui'; import DeleteUserModal from '~/pages/admin/users/components/delete_user_modal.vue'; import ModalStub from './stubs/modal_stub'; @@ -13,7 +13,7 @@ describe('User Operation confirmation modal', () => { const findButton = variant => wrapper - .findAll(GlButton) + .findAll(GlDeprecatedButton) .filter(w => w.attributes('variant') === variant) .at(0); const findForm = () => wrapper.find('form'); diff --git a/spec/frontend/projects/pipelines/charts/components/__snapshots__/pipelines_area_chart_spec.js.snap b/spec/frontend/projects/pipelines/charts/components/__snapshots__/pipelines_area_chart_spec.js.snap index c15971912dd..3222b92d23f 100644 --- a/spec/frontend/projects/pipelines/charts/components/__snapshots__/pipelines_area_chart_spec.js.snap +++ b/spec/frontend/projects/pipelines/charts/components/__snapshots__/pipelines_area_chart_spec.js.snap @@ -10,6 +10,7 @@ exports[`PipelinesAreaChart matches the snapshot 1`] = ` <div> <glareachart-stub + annotations="" data="[object Object],[object Object]" height="300" legendaveragetext="Avg" diff --git a/spec/frontend/releases/components/release_block_milestone_info_spec.js b/spec/frontend/releases/components/release_block_milestone_info_spec.js index 0e79c45b337..0b65b6cab96 100644 --- a/spec/frontend/releases/components/release_block_milestone_info_spec.js +++ b/spec/frontend/releases/components/release_block_milestone_info_spec.js @@ -1,5 +1,5 @@ import { mount } from '@vue/test-utils'; -import { GlProgressBar, GlLink, GlBadge, GlButton } from '@gitlab/ui'; +import { GlProgressBar, GlLink, GlBadge, GlDeprecatedButton } from '@gitlab/ui'; import { trimText } from 'helpers/text_helper'; import ReleaseBlockMilestoneInfo from '~/releases/components/release_block_milestone_info.vue'; import { milestones as originalMilestones } from '../mock_data'; @@ -106,7 +106,7 @@ describe('Release block milestone info', () => { const clickShowMoreFewerButton = () => { milestoneListContainer() - .find(GlButton) + .find(GlDeprecatedButton) .trigger('click'); return wrapper.vm.$nextTick(); diff --git a/spec/frontend/self_monitor/components/__snapshots__/self_monitor_form_spec.js.snap b/spec/frontend/self_monitor/components/__snapshots__/self_monitor_form_spec.js.snap index 955716ccbca..f7a9827a9ad 100644 --- a/spec/frontend/self_monitor/components/__snapshots__/self_monitor_form_spec.js.snap +++ b/spec/frontend/self_monitor/components/__snapshots__/self_monitor_form_spec.js.snap @@ -15,13 +15,13 @@ exports[`self monitor component When the self monitor project has not been creat </h4> - <gl-button-stub + <gl-deprecated-button-stub class="js-settings-toggle" size="md" variant="secondary" > Expand - </gl-button-stub> + </gl-deprecated-button-stub> <p class="js-section-sub-header" diff --git a/spec/frontend/self_monitor/components/self_monitor_form_spec.js b/spec/frontend/self_monitor/components/self_monitor_form_spec.js index 6532c6ed2c7..0e6abba08f3 100644 --- a/spec/frontend/self_monitor/components/self_monitor_form_spec.js +++ b/spec/frontend/self_monitor/components/self_monitor_form_spec.js @@ -1,5 +1,5 @@ import { shallowMount } from '@vue/test-utils'; -import { GlButton } from '@gitlab/ui'; +import { GlDeprecatedButton } from '@gitlab/ui'; import SelfMonitor from '~/self_monitor/components/self_monitor_form.vue'; import { createStore } from '~/self_monitor/store'; @@ -41,7 +41,7 @@ describe('self monitor component', () => { it('renders as an expand button by default', () => { wrapper = shallowMount(SelfMonitor, { store }); - const button = wrapper.find(GlButton); + const button = wrapper.find(GlDeprecatedButton); expect(button.text()).toBe('Expand'); }); diff --git a/spec/frontend/serverless/components/missing_prometheus_spec.js b/spec/frontend/serverless/components/missing_prometheus_spec.js index 896dc5b43e1..90730765f7c 100644 --- a/spec/frontend/serverless/components/missing_prometheus_spec.js +++ b/spec/frontend/serverless/components/missing_prometheus_spec.js @@ -1,4 +1,4 @@ -import { GlButton } from '@gitlab/ui'; +import { GlDeprecatedButton } from '@gitlab/ui'; import { shallowMount } from '@vue/test-utils'; import missingPrometheusComponent from '~/serverless/components/missing_prometheus.vue'; @@ -26,7 +26,7 @@ describe('missingPrometheusComponent', () => { 'Function invocation metrics require Prometheus to be installed first.', ); - expect(wrapper.find(GlButton).attributes('variant')).toBe('success'); + expect(wrapper.find(GlDeprecatedButton).attributes('variant')).toBe('success'); }); it('should render no prometheus data message', () => { diff --git a/spec/frontend/snippets/components/snippet_blob_edit_spec.js b/spec/frontend/snippets/components/snippet_blob_edit_spec.js index 334fe7196a4..75688e61892 100644 --- a/spec/frontend/snippets/components/snippet_blob_edit_spec.js +++ b/spec/frontend/snippets/components/snippet_blob_edit_spec.js @@ -1,6 +1,7 @@ import SnippetBlobEdit from '~/snippets/components/snippet_blob_edit.vue'; import BlobHeaderEdit from '~/blob/components/blob_edit_header.vue'; import BlobContentEdit from '~/blob/components/blob_edit_content.vue'; +import { GlLoadingIcon } from '@gitlab/ui'; import { shallowMount } from '@vue/test-utils'; import { nextTick } from 'vue'; @@ -13,11 +14,13 @@ describe('Snippet Blob Edit component', () => { const findHeader = () => wrapper.find(BlobHeaderEdit); const findContent = () => wrapper.find(BlobContentEdit); - function createComponent() { + function createComponent(props = {}) { wrapper = shallowMount(SnippetBlobEdit, { propsData: { value, fileName, + isLoading: false, + ...props, }, }); } @@ -39,9 +42,23 @@ describe('Snippet Blob Edit component', () => { expect(findHeader().exists()).toBe(true); expect(findContent().exists()).toBe(true); }); + + it('renders loader if isLoading equals true', () => { + createComponent({ isLoading: true }); + expect(wrapper.contains(GlLoadingIcon)).toBe(true); + expect(findContent().exists()).toBe(false); + }); }); describe('functionality', () => { + it('does not fail without content', () => { + const spy = jest.spyOn(global.console, 'error'); + createComponent({ value: undefined }); + + expect(spy).not.toHaveBeenCalled(); + expect(findContent().exists()).toBe(true); + }); + it('emits "name-change" event when the file name gets changed', () => { expect(wrapper.emitted('name-change')).toBeUndefined(); const newFilename = 'foo.bar'; @@ -51,5 +68,15 @@ describe('Snippet Blob Edit component', () => { expect(wrapper.emitted('name-change')[0]).toEqual([newFilename]); }); }); + + it('emits "input" event when the file content gets changed', () => { + expect(wrapper.emitted('input')).toBeUndefined(); + const newValue = 'foo.bar'; + findContent().vm.$emit('input', newValue); + + return nextTick().then(() => { + expect(wrapper.emitted('input')[0]).toEqual([newValue]); + }); + }); }); }); diff --git a/spec/frontend/snippets/components/snippet_header_spec.js b/spec/frontend/snippets/components/snippet_header_spec.js index 16a66c70d6a..878baab9cac 100644 --- a/spec/frontend/snippets/components/snippet_header_spec.js +++ b/spec/frontend/snippets/components/snippet_header_spec.js @@ -1,7 +1,7 @@ import SnippetHeader from '~/snippets/components/snippet_header.vue'; import DeleteSnippetMutation from '~/snippets/mutations/deleteSnippet.mutation.graphql'; import { ApolloMutation } from 'vue-apollo'; -import { GlButton, GlModal } from '@gitlab/ui'; +import { GlDeprecatedButton, GlModal } from '@gitlab/ui'; import { shallowMount } from '@vue/test-utils'; describe('Snippet header component', () => { @@ -89,7 +89,7 @@ describe('Snippet header component', () => { updateSnippet: false, }, }); - expect(wrapper.findAll(GlButton).length).toEqual(0); + expect(wrapper.findAll(GlDeprecatedButton).length).toEqual(0); createComponent({ permissions: { @@ -97,7 +97,7 @@ describe('Snippet header component', () => { updateSnippet: false, }, }); - expect(wrapper.findAll(GlButton).length).toEqual(1); + expect(wrapper.findAll(GlDeprecatedButton).length).toEqual(1); createComponent({ permissions: { @@ -105,7 +105,7 @@ describe('Snippet header component', () => { updateSnippet: true, }, }); - expect(wrapper.findAll(GlButton).length).toEqual(2); + expect(wrapper.findAll(GlDeprecatedButton).length).toEqual(2); createComponent({ permissions: { @@ -117,7 +117,7 @@ describe('Snippet header component', () => { canCreateSnippet: true, }); return wrapper.vm.$nextTick().then(() => { - expect(wrapper.findAll(GlButton).length).toEqual(3); + expect(wrapper.findAll(GlDeprecatedButton).length).toEqual(3); }); }); diff --git a/spec/frontend/static_site_editor/components/static_site_editor_spec.js b/spec/frontend/static_site_editor/components/static_site_editor_spec.js new file mode 100644 index 00000000000..919763ce9fe --- /dev/null +++ b/spec/frontend/static_site_editor/components/static_site_editor_spec.js @@ -0,0 +1,82 @@ +import Vuex from 'vuex'; +import { shallowMount, createLocalVue } from '@vue/test-utils'; + +import { GlSkeletonLoader } from '@gitlab/ui'; + +import createState from '~/static_site_editor/store/state'; + +import StaticSiteEditor from '~/static_site_editor/components/static_site_editor.vue'; +import EditArea from '~/static_site_editor/components/edit_area.vue'; + +const localVue = createLocalVue(); + +localVue.use(Vuex); + +describe('StaticSiteEditor', () => { + let wrapper; + let store; + let loadContentActionMock; + + const buildStore = (initialState = {}) => { + loadContentActionMock = jest.fn(); + + store = new Vuex.Store({ + state: createState(initialState), + actions: { + loadContent: loadContentActionMock, + }, + }); + }; + + const buildWrapper = () => { + wrapper = shallowMount(StaticSiteEditor, { + localVue, + store, + }); + }; + + const findEditArea = () => wrapper.find(EditArea); + + beforeEach(() => { + buildStore(); + buildWrapper(); + }); + + afterEach(() => { + wrapper.destroy(); + }); + + describe('when content is not loaded', () => { + it('does not render edit area', () => { + expect(findEditArea().exists()).toBe(false); + }); + }); + + describe('when content is loaded', () => { + const content = 'edit area content'; + + beforeEach(() => { + buildStore({ content, isContentLoaded: true }); + buildWrapper(); + }); + + it('renders the edit area', () => { + expect(findEditArea().exists()).toBe(true); + }); + + it('passes page content to edit area', () => { + expect(findEditArea().props('value')).toBe(content); + }); + }); + + it('displays skeleton loader while loading content', () => { + buildStore({ isLoadingContent: true }); + buildWrapper(); + + expect(wrapper.find(GlSkeletonLoader).exists()).toBe(true); + }); + + it('dispatches load content action', () => { + expect(loadContentActionMock).toHaveBeenCalled(); + }); +}); diff --git a/spec/frontend/vue_mr_widget/deployment/deployment_action_button_spec.js b/spec/frontend/vue_mr_widget/deployment/deployment_action_button_spec.js index 1b14ee694fe..6adf4975414 100644 --- a/spec/frontend/vue_mr_widget/deployment/deployment_action_button_spec.js +++ b/spec/frontend/vue_mr_widget/deployment/deployment_action_button_spec.js @@ -1,5 +1,5 @@ import { mount } from '@vue/test-utils'; -import { GlIcon, GlLoadingIcon, GlButton } from '@gitlab/ui'; +import { GlIcon, GlLoadingIcon, GlDeprecatedButton } from '@gitlab/ui'; import DeploymentActionButton from '~/vue_merge_request_widget/components/deployment/deployment_action_button.vue'; import { CREATED, @@ -75,7 +75,7 @@ describe('Deployment action button', () => { it('is disabled and shows the loading icon', () => { expect(wrapper.find(GlLoadingIcon).exists()).toBe(true); - expect(wrapper.find(GlButton).props('disabled')).toBe(true); + expect(wrapper.find(GlDeprecatedButton).props('disabled')).toBe(true); }); }); @@ -90,7 +90,7 @@ describe('Deployment action button', () => { }); it('is disabled and does not show the loading icon', () => { expect(wrapper.find(GlLoadingIcon).exists()).toBe(false); - expect(wrapper.find(GlButton).props('disabled')).toBe(true); + expect(wrapper.find(GlDeprecatedButton).props('disabled')).toBe(true); }); }); @@ -106,7 +106,7 @@ describe('Deployment action button', () => { }); it('is disabled and does not show the loading icon', () => { expect(wrapper.find(GlLoadingIcon).exists()).toBe(false); - expect(wrapper.find(GlButton).props('disabled')).toBe(true); + expect(wrapper.find(GlDeprecatedButton).props('disabled')).toBe(true); }); }); @@ -118,7 +118,7 @@ describe('Deployment action button', () => { }); it('is not disabled nor does it show the loading icon', () => { expect(wrapper.find(GlLoadingIcon).exists()).toBe(false); - expect(wrapper.find(GlButton).props('disabled')).toBe(false); + expect(wrapper.find(GlDeprecatedButton).props('disabled')).toBe(false); }); }); }); diff --git a/spec/frontend/vue_shared/components/clipboard_button_spec.js b/spec/frontend/vue_shared/components/clipboard_button_spec.js index 07ff86828e7..7f0b7ba8cf8 100644 --- a/spec/frontend/vue_shared/components/clipboard_button_spec.js +++ b/spec/frontend/vue_shared/components/clipboard_button_spec.js @@ -1,5 +1,5 @@ import { shallowMount } from '@vue/test-utils'; -import { GlButton, GlIcon } from '@gitlab/ui'; +import { GlDeprecatedButton, GlIcon } from '@gitlab/ui'; import ClipboardButton from '~/vue_shared/components/clipboard_button.vue'; describe('clipboard button', () => { @@ -26,7 +26,7 @@ describe('clipboard button', () => { }); it('renders a button for clipboard', () => { - expect(wrapper.find(GlButton).exists()).toBe(true); + expect(wrapper.find(GlDeprecatedButton).exists()).toBe(true); expect(wrapper.attributes('data-clipboard-text')).toBe('copy me'); expect(wrapper.find(GlIcon).props('name')).toBe('copy-to-clipboard'); }); diff --git a/spec/frontend/vue_shared/components/sidebar/labels_select_vue/dropdown_button_spec.js b/spec/frontend/vue_shared/components/sidebar/labels_select_vue/dropdown_button_spec.js index d996f48f9cc..e2d31a41e82 100644 --- a/spec/frontend/vue_shared/components/sidebar/labels_select_vue/dropdown_button_spec.js +++ b/spec/frontend/vue_shared/components/sidebar/labels_select_vue/dropdown_button_spec.js @@ -35,7 +35,7 @@ describe('DropdownButton', () => { describe('template', () => { it('renders component container element', () => { - expect(wrapper.is('gl-button-stub')).toBe(true); + expect(wrapper.is('gl-deprecated-button-stub')).toBe(true); }); it('renders button text element', () => { diff --git a/spec/frontend/vue_shared/components/sidebar/labels_select_vue/dropdown_contents_create_view_spec.js b/spec/frontend/vue_shared/components/sidebar/labels_select_vue/dropdown_contents_create_view_spec.js index 9bc01d8723f..d7ca7ce30a9 100644 --- a/spec/frontend/vue_shared/components/sidebar/labels_select_vue/dropdown_contents_create_view_spec.js +++ b/spec/frontend/vue_shared/components/sidebar/labels_select_vue/dropdown_contents_create_view_spec.js @@ -1,7 +1,7 @@ import Vuex from 'vuex'; import { shallowMount, createLocalVue } from '@vue/test-utils'; -import { GlButton, GlIcon, GlFormInput, GlLink, GlLoadingIcon } from '@gitlab/ui'; +import { GlDeprecatedButton, GlIcon, GlFormInput, GlLink, GlLoadingIcon } from '@gitlab/ui'; import DropdownContentsCreateView from '~/vue_shared/components/sidebar/labels_select_vue/dropdown_contents_create_view.vue'; import labelSelectModule from '~/vue_shared/components/sidebar/labels_select_vue/store'; @@ -127,7 +127,7 @@ describe('DropdownContentsCreateView', () => { it('renders dropdown back button element', () => { const backBtnEl = wrapper .find('.dropdown-title') - .findAll(GlButton) + .findAll(GlDeprecatedButton) .at(0); expect(backBtnEl.exists()).toBe(true); @@ -145,7 +145,7 @@ describe('DropdownContentsCreateView', () => { it('renders dropdown close button element', () => { const closeBtnEl = wrapper .find('.dropdown-title') - .findAll(GlButton) + .findAll(GlDeprecatedButton) .at(1); expect(closeBtnEl.exists()).toBe(true); @@ -192,7 +192,7 @@ describe('DropdownContentsCreateView', () => { it('renders create button element', () => { const createBtnEl = wrapper .find('.dropdown-actions') - .findAll(GlButton) + .findAll(GlDeprecatedButton) .at(0); expect(createBtnEl.exists()).toBe(true); @@ -213,7 +213,7 @@ describe('DropdownContentsCreateView', () => { it('renders cancel button element', () => { const cancelBtnEl = wrapper .find('.dropdown-actions') - .findAll(GlButton) + .findAll(GlDeprecatedButton) .at(1); expect(cancelBtnEl.exists()).toBe(true); diff --git a/spec/frontend/vue_shared/components/sidebar/labels_select_vue/dropdown_contents_labels_view_spec.js b/spec/frontend/vue_shared/components/sidebar/labels_select_vue/dropdown_contents_labels_view_spec.js index 487b917852e..3e6dbdb7ecb 100644 --- a/spec/frontend/vue_shared/components/sidebar/labels_select_vue/dropdown_contents_labels_view_spec.js +++ b/spec/frontend/vue_shared/components/sidebar/labels_select_vue/dropdown_contents_labels_view_spec.js @@ -1,7 +1,7 @@ import Vuex from 'vuex'; import { shallowMount, createLocalVue } from '@vue/test-utils'; -import { GlButton, GlLoadingIcon, GlIcon, GlSearchBoxByType, GlLink } from '@gitlab/ui'; +import { GlDeprecatedButton, GlLoadingIcon, GlIcon, GlSearchBoxByType, GlLink } from '@gitlab/ui'; import { UP_KEY_CODE, DOWN_KEY_CODE, ENTER_KEY_CODE, ESC_KEY_CODE } from '~/lib/utils/keycodes'; import DropdownContentsLabelsView from '~/vue_shared/components/sidebar/labels_select_vue/dropdown_contents_labels_view.vue'; @@ -199,7 +199,7 @@ describe('DropdownContentsLabelsView', () => { }); it('renders dropdown close button element', () => { - const closeButtonEl = wrapper.find('.dropdown-title').find(GlButton); + const closeButtonEl = wrapper.find('.dropdown-title').find(GlDeprecatedButton); expect(closeButtonEl.exists()).toBe(true); expect(closeButtonEl.find(GlIcon).exists()).toBe(true); @@ -253,7 +253,7 @@ describe('DropdownContentsLabelsView', () => { }); it('renders footer list items', () => { - const createLabelBtn = wrapper.find('.dropdown-footer').find(GlButton); + const createLabelBtn = wrapper.find('.dropdown-footer').find(GlDeprecatedButton); const manageLabelsLink = wrapper.find('.dropdown-footer').find(GlLink); expect(createLabelBtn.exists()).toBe(true); diff --git a/spec/frontend/vue_shared/components/sidebar/labels_select_vue/dropdown_title_spec.js b/spec/frontend/vue_shared/components/sidebar/labels_select_vue/dropdown_title_spec.js index c1d9be7393c..0717fd829a0 100644 --- a/spec/frontend/vue_shared/components/sidebar/labels_select_vue/dropdown_title_spec.js +++ b/spec/frontend/vue_shared/components/sidebar/labels_select_vue/dropdown_title_spec.js @@ -1,7 +1,7 @@ import Vuex from 'vuex'; import { shallowMount, createLocalVue } from '@vue/test-utils'; -import { GlButton, GlLoadingIcon } from '@gitlab/ui'; +import { GlDeprecatedButton, GlLoadingIcon } from '@gitlab/ui'; import DropdownTitle from '~/vue_shared/components/sidebar/labels_select_vue/dropdown_title.vue'; import labelsSelectModule from '~/vue_shared/components/sidebar/labels_select_vue/store'; @@ -42,7 +42,7 @@ describe('DropdownTitle', () => { }); it('renders edit link', () => { - const editBtnEl = wrapper.find(GlButton); + const editBtnEl = wrapper.find(GlDeprecatedButton); expect(editBtnEl.exists()).toBe(true); expect(editBtnEl.text()).toBe('Edit'); diff --git a/spec/frontend/vue_shared/components/user_avatar/user_avatar_list_spec.js b/spec/frontend/vue_shared/components/user_avatar/user_avatar_list_spec.js index 6f66d1cafb9..1db1114f9ba 100644 --- a/spec/frontend/vue_shared/components/user_avatar/user_avatar_list_spec.js +++ b/spec/frontend/vue_shared/components/user_avatar/user_avatar_list_spec.js @@ -1,5 +1,5 @@ import { shallowMount } from '@vue/test-utils'; -import { GlButton } from '@gitlab/ui'; +import { GlDeprecatedButton } from '@gitlab/ui'; import { TEST_HOST } from 'spec/test_constants'; import UserAvatarList from '~/vue_shared/components/user_avatar/user_avatar_list.vue'; import UserAvatarLink from '~/vue_shared/components/user_avatar/user_avatar_link.vue'; @@ -37,7 +37,7 @@ describe('UserAvatarList', () => { }; const clickButton = () => { - const button = wrapper.find(GlButton); + const button = wrapper.find(GlDeprecatedButton); button.vm.$emit('click'); }; @@ -112,7 +112,7 @@ describe('UserAvatarList', () => { it('does not show button', () => { factory(); - expect(wrapper.find(GlButton).exists()).toBe(false); + expect(wrapper.find(GlDeprecatedButton).exists()).toBe(false); }); }); diff --git a/spec/javascripts/jobs/components/manual_variables_form_spec.js b/spec/javascripts/jobs/components/manual_variables_form_spec.js index 547f146cf88..82fd73ef033 100644 --- a/spec/javascripts/jobs/components/manual_variables_form_spec.js +++ b/spec/javascripts/jobs/components/manual_variables_form_spec.js @@ -1,5 +1,5 @@ import { shallowMount, createLocalVue } from '@vue/test-utils'; -import { GlButton } from '@gitlab/ui'; +import { GlDeprecatedButton } from '@gitlab/ui'; import Form from '~/jobs/components/manual_variables_form.vue'; const localVue = createLocalVue(); @@ -95,7 +95,7 @@ describe('Manual Variables Form', () => { }); it('removes the variable row', () => { - wrapper.find(GlButton).vm.$emit('click'); + wrapper.find(GlDeprecatedButton).vm.$emit('click'); expect(wrapper.vm.variables.length).toBe(0); }); diff --git a/spec/lib/gitlab/github_import/parallel_importer_spec.rb b/spec/lib/gitlab/github_import/parallel_importer_spec.rb index a9b7d3d388c..a8d5cc58bd5 100644 --- a/spec/lib/gitlab/github_import/parallel_importer_spec.rb +++ b/spec/lib/gitlab/github_import/parallel_importer_spec.rb @@ -27,7 +27,7 @@ describe Gitlab::GithubImport::ParallelImporter do end it 'sets the JID in Redis' do - expect(Gitlab::Import::SetAsyncJid).to receive(:set_jid).with(project).and_call_original + expect(Gitlab::Import::SetAsyncJid).to receive(:set_jid).with(project.import_state).and_call_original importer.execute end diff --git a/spec/lib/gitlab/import/set_async_jid_spec.rb b/spec/lib/gitlab/import/set_async_jid_spec.rb index 51397280138..f1ae23a4a6a 100644 --- a/spec/lib/gitlab/import/set_async_jid_spec.rb +++ b/spec/lib/gitlab/import/set_async_jid_spec.rb @@ -8,16 +8,16 @@ describe Gitlab::Import::SetAsyncJid do it 'sets the JID in Redis' do expect(Gitlab::SidekiqStatus) .to receive(:set) - .with("async-import/#{project.id}", StuckImportJobsWorker::IMPORT_JOBS_EXPIRATION) + .with("async-import/project-import-state/#{project.id}", StuckImportJobsWorker::IMPORT_JOBS_EXPIRATION) .and_call_original - described_class.set_jid(project) + described_class.set_jid(project.import_state) end it 'updates the import JID of the project' do - described_class.set_jid(project) + described_class.set_jid(project.import_state) - expect(project.import_state.reload.jid).to eq("async-import/#{project.id}") + expect(project.import_state.reload.jid).to eq("async-import/project-import-state/#{project.id}") end end end diff --git a/spec/lib/gitlab/import_export/all_models.yml b/spec/lib/gitlab/import_export/all_models.yml index 9abc8a5d88f..1579a6ce2df 100644 --- a/spec/lib/gitlab/import_export/all_models.yml +++ b/spec/lib/gitlab/import_export/all_models.yml @@ -38,6 +38,7 @@ issues: - vulnerability_links - related_vulnerabilities - user_mentions +- system_note_metadata events: - author - project @@ -152,6 +153,7 @@ merge_requests: - deployment_merge_requests - deployments - user_mentions +- system_note_metadata external_pull_requests: - project merge_request_diff: @@ -620,3 +622,6 @@ epic: epic_issue: - epic - issue +system_note_metadata: +- note +- description_version diff --git a/spec/lib/gitlab/import_export/project/tree_restorer_spec.rb b/spec/lib/gitlab/import_export/project/tree_restorer_spec.rb index e7edbc7690d..247d455fecc 100644 --- a/spec/lib/gitlab/import_export/project/tree_restorer_spec.rb +++ b/spec/lib/gitlab/import_export/project/tree_restorer_spec.rb @@ -2,6 +2,10 @@ require 'spec_helper' +def match_mr1_note(content_regex) + MergeRequest.find_by(title: 'MR1').notes.select { |n| n.note.match(/#{content_regex}/)}.first +end + describe Gitlab::ImportExport::Project::TreeRestorer do include ImportExport::CommonUtil @@ -74,10 +78,30 @@ describe Gitlab::ImportExport::Project::TreeRestorer do context 'for a Merge Request' do it 'does not import note_html' do note_content = 'Sit voluptatibus eveniet architecto quidem' - merge_request_note = MergeRequest.find_by(title: 'MR1').notes.select { |n| n.note.match(/#{note_content}/)}.first + merge_request_note = match_mr1_note(note_content) expect(merge_request_note.note_html).to match(/#{note_content}/) end + + context 'merge request system note metadata' do + it 'restores title action for unmark wip' do + merge_request_note = match_mr1_note('unmarked as a \\*\\*Work In Progress\\*\\*') + + expect(merge_request_note.noteable_type).to eq('MergeRequest') + expect(merge_request_note.system).to eq(true) + expect(merge_request_note.system_note_metadata.action).to eq('title') + expect(merge_request_note.system_note_metadata.commit_count).to be_nil + end + + it 'restores commit action and commit count for pushing 3 commits' do + merge_request_note = match_mr1_note('added 3 commits') + + expect(merge_request_note.noteable_type).to eq('MergeRequest') + expect(merge_request_note.system).to eq(true) + expect(merge_request_note.system_note_metadata.action).to eq('commit') + expect(merge_request_note.system_note_metadata.commit_count).to eq(3) + end + end end end @@ -373,7 +397,8 @@ describe Gitlab::ImportExport::Project::TreeRestorer do context 'notes' do it 'has award emoji' do - award_emoji = MergeRequest.find_by_title('MR1').notes.first.award_emoji.first + merge_request_note = match_mr1_note('Sit voluptatibus eveniet architecto quidem') + award_emoji = merge_request_note.award_emoji.first expect(award_emoji.name).to eq('tada') end @@ -507,6 +532,16 @@ describe Gitlab::ImportExport::Project::TreeRestorer do first_issue_labels: 1, services: 1 + it 'issue system note metadata restored successfully' do + note_content = 'created merge request !1 to address this issue' + note = project.issues.first.notes.select { |n| n.note.match(/#{note_content}/)}.first + + expect(note.noteable_type).to eq('Issue') + expect(note.system).to eq(true) + expect(note.system_note_metadata.action).to eq('merge') + expect(note.system_note_metadata.commit_count).to be_nil + end + context 'when there is an existing build with build token' do before do create(:ci_build, token: 'abcd') diff --git a/spec/lib/gitlab/import_export/project/tree_saver_spec.rb b/spec/lib/gitlab/import_export/project/tree_saver_spec.rb index 23360b725b9..c910ee5430b 100644 --- a/spec/lib/gitlab/import_export/project/tree_saver_spec.rb +++ b/spec/lib/gitlab/import_export/project/tree_saver_spec.rb @@ -113,6 +113,12 @@ describe Gitlab::ImportExport::Project::TreeSaver do expect(saved_project_json['issues'].first['notes'].first['author']).not_to be_empty end + it 'has system note metadata on issue comments' do + metadata = saved_project_json['issues'].first['notes'].first['system_note_metadata'] + + expect(metadata['action']).to eq('description') + end + it 'has project members' do expect(saved_project_json['project_members']).not_to be_empty end @@ -137,6 +143,13 @@ describe Gitlab::ImportExport::Project::TreeSaver do expect(saved_project_json['merge_requests'].first['notes'].first['author']).not_to be_empty end + it 'has system note metadata on merge requests comments' do + metadata = saved_project_json['merge_requests'].first['notes'].first['system_note_metadata'] + + expect(metadata['commit_count']).to eq(1) + expect(metadata['action']).to eq('commit') + end + it 'has pipeline stages' do expect(saved_project_json.dig('ci_pipelines', 0, 'stages')).not_to be_empty end @@ -314,14 +327,17 @@ describe Gitlab::ImportExport::Project::TreeSaver do create(:commit_status, project: project, pipeline: ci_build.pipeline) create(:milestone, project: project) - create(:discussion_note, noteable: issue, project: project) - create(:note, noteable: merge_request, project: project) + discussion_note = create(:discussion_note, noteable: issue, project: project) + mr_note = create(:note, noteable: merge_request, project: project) create(:note, noteable: snippet, project: project) create(:note_on_commit, author: user, project: project, commit_id: ci_build.pipeline.sha) + create(:system_note_metadata, action: 'description', note: discussion_note) + create(:system_note_metadata, commit_count: 1, action: 'commit', note: mr_note) + create(:resource_label_event, label: project_label, issue: issue) create(:resource_label_event, label: group_label, merge_request: merge_request) diff --git a/spec/lib/gitlab/import_export/safe_model_attributes.yml b/spec/lib/gitlab/import_export/safe_model_attributes.yml index 533458afd73..7190d84573e 100644 --- a/spec/lib/gitlab/import_export/safe_model_attributes.yml +++ b/spec/lib/gitlab/import_export/safe_model_attributes.yml @@ -848,3 +848,9 @@ Epic: EpicIssue: - id - relative_position +SystemNoteMetadata: + - id + - commit_count + - action + - created_at + - updated_at diff --git a/spec/models/project_services/chat_message/pipeline_message_spec.rb b/spec/models/project_services/chat_message/pipeline_message_spec.rb index 366ef01924e..4210b52a8b9 100644 --- a/spec/models/project_services/chat_message/pipeline_message_spec.rb +++ b/spec/models/project_services/chat_message/pipeline_message_spec.rb @@ -447,14 +447,6 @@ describe ChatMessage::PipelineMessage do end end - it "returns the stage name and link as the attachment's second field property" do - expect(subject.attachments.first[:fields][1]).to eq({ - title: "Commit", - value: "<http://example.com/commit|A test commit message>", - short: true - }) - end - it "returns the project's name as the attachment's footer property" do expect(subject.attachments.first[:footer]).to eq("project_name") end diff --git a/yarn.lock b/yarn.lock index 31e2ddb32d8..2c0afb67e8d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -786,10 +786,10 @@ resolved "https://registry.yarnpkg.com/@gitlab/svgs/-/svgs-1.116.0.tgz#a3c89f950bb256c2e109444c9a85fecdd261292c" integrity sha512-sZLn3acu0IyrSnZRU1rE3UjxF6FlwvBNfjKQgn0qclxdbe8Ya6cGNVq4aGdCEkHwvb9rFpKbfHBujVgVKNkxSA== -"@gitlab/ui@10.1.2": - version "10.1.2" - resolved "https://registry.yarnpkg.com/@gitlab/ui/-/ui-10.1.2.tgz#027f86f69ef08fb90cab5c69545adf37e20c6ceb" - integrity sha512-xTvLIHrBqvvvHLVPMGdktBv3hNL7FPGPSFbAC3IURrVa/9FIJbzkIYFGlUIbLu/QX1i0CJN+MLmyHhLtzhKgtA== +"@gitlab/ui@11.0.0": + version "11.0.0" + resolved "https://registry.yarnpkg.com/@gitlab/ui/-/ui-11.0.0.tgz#2dc6c4e92201911b80c1c24ff4ea6c5247810451" + integrity sha512-Cu50RQMbNGxEfMIxr3iv6i09hNs3deRS01CnkxNEdxmmokyKr86a2TItHwrAKyacjkb8IEfkn0Q/yoBMTpfPAw== dependencies: "@babel/standalone" "^7.0.0" "@gitlab/vue-toasted" "^1.3.0" |