diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-14 09:10:12 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-14 09:10:12 +0300 |
commit | bfa9edfd26edc8800556399ebb4c52c5f61a69a6 (patch) | |
tree | e7969cdb4bba6b44581858627b0df6938e97f1c1 | |
parent | f5a8ebd6b7da5501100d66b43050be7b26b04665 (diff) |
Add latest changes from gitlab-org/gitlab@master
25 files changed, 235 insertions, 130 deletions
diff --git a/app/assets/javascripts/boards/components/sidebar/remove_issue.vue b/app/assets/javascripts/boards/components/sidebar/remove_issue.vue index 71e5d8058da..9b292f18e50 100644 --- a/app/assets/javascripts/boards/components/sidebar/remove_issue.vue +++ b/app/assets/javascripts/boards/components/sidebar/remove_issue.vue @@ -3,8 +3,12 @@ import axios from '~/lib/utils/axios_utils'; import Flash from '../../../flash'; import { __ } from '../../../locale'; import boardsStore from '../../stores/boards_store'; +import { GlButton } from '@gitlab/ui'; export default { + components: { + GlButton, + }, props: { issue: { type: Object, @@ -75,8 +79,8 @@ export default { </script> <template> <div class="block list"> - <button class="btn btn-default btn-block" type="button" @click="removeIssue"> + <gl-button variant="default" category="secondary" block="block" @click="removeIssue"> {{ __('Remove from board') }} - </button> + </gl-button> </div> </template> diff --git a/app/assets/javascripts/design_management/components/delete_button.vue b/app/assets/javascripts/design_management/components/delete_button.vue index 77e1b97a227..83a3cb56b83 100644 --- a/app/assets/javascripts/design_management/components/delete_button.vue +++ b/app/assets/javascripts/design_management/components/delete_button.vue @@ -1,7 +1,7 @@ <script> import { GlButton, GlModal, GlModalDirective } from '@gitlab/ui'; import { uniqueId } from 'lodash'; -import { s__ } from '~/locale'; +import { s__, __ } from '~/locale'; export default { name: 'DeleteButton', @@ -28,6 +28,16 @@ export default { required: false, default: 'info', }, + buttonCategory: { + type: String, + required: false, + default: 'primary', + }, + buttonIcon: { + type: String, + required: false, + default: undefined, + }, buttonSize: { type: String, required: false, @@ -38,6 +48,11 @@ export default { required: false, default: true, }, + loading: { + type: Boolean, + required: false, + default: false, + }, }, data() { return { @@ -45,13 +60,13 @@ export default { }; }, modal: { - title: s__('DesignManagement|Delete designs confirmation'), + title: s__('DesignManagement|Are you sure you want to archive the selected designs?'), actionPrimary: { - text: s__('Delete'), - attributes: { variant: 'danger' }, + text: s__('DesignManagement|Archive designs'), + attributes: { variant: 'warning' }, }, actionCancel: { - text: s__('Cancel'), + text: __('Cancel'), }, }, }; @@ -66,14 +81,23 @@ export default { :action-cancel="$options.modal.actionCancel" @ok="$emit('deleteSelectedDesigns')" > - <p>{{ s__('DesignManagement|Are you sure you want to delete the selected designs?') }}</p> + <p> + {{ + s__( + 'DesignManagement|Archived designs will still be available in previous versions of the design collection.', + ) + }} + </p> </gl-modal> <gl-button v-gl-modal-directive="modalId" :variant="buttonVariant" + :category="buttonCategory" :size="buttonSize" :class="buttonClass" :disabled="isDeleting || !hasSelectedDesigns" + :loading="loading" + :icon="buttonIcon" > <slot></slot> </gl-button> diff --git a/app/assets/javascripts/design_management/components/list/item.vue b/app/assets/javascripts/design_management/components/list/item.vue index 8dc562b3252..292b6e09055 100644 --- a/app/assets/javascripts/design_management/components/list/item.vue +++ b/app/assets/javascripts/design_management/components/list/item.vue @@ -74,7 +74,7 @@ export default { deletion: { name: 'file-deletion-solid', classes: 'text-danger-500', - tooltip: __('Deleted in this version'), + tooltip: __('Archived in this version'), }, }; diff --git a/app/assets/javascripts/design_management/components/toolbar/index.vue b/app/assets/javascripts/design_management/components/toolbar/index.vue index 0b51035e83e..3b113320aa5 100644 --- a/app/assets/javascripts/design_management/components/toolbar/index.vue +++ b/app/assets/javascripts/design_management/components/toolbar/index.vue @@ -1,7 +1,6 @@ <script> -import { GlDeprecatedButton } from '@gitlab/ui'; +import { GlButton, GlIcon } from '@gitlab/ui'; import { __, sprintf } from '~/locale'; -import Icon from '~/vue_shared/components/icon.vue'; import timeagoMixin from '~/vue_shared/mixins/timeago'; import Pagination from './pagination.vue'; import DeleteButton from '../delete_button.vue'; @@ -10,10 +9,10 @@ import { DESIGNS_ROUTE_NAME } from '../../router/constants'; export default { components: { - Icon, + GlIcon, Pagination, DeleteButton, - GlDeprecatedButton, + GlButton, }, mixins: [timeagoMixin], props: { @@ -92,33 +91,39 @@ export default { </script> <template> - <header class="d-flex p-2 bg-white align-items-center js-design-header"> - <router-link - :to="{ - name: $options.DESIGNS_ROUTE_NAME, - query: $route.query, - }" - :aria-label="s__('DesignManagement|Go back to designs')" - data-testid="close-design" - class="mr-3 text-plain d-flex justify-content-center align-items-center" - > - <icon :size="18" name="close" /> - </router-link> - <div class="overflow-hidden d-flex align-items-center"> - <h2 class="m-0 str-truncated-100 gl-font-base">{{ filename }}</h2> - <small v-if="updatedAt" class="text-secondary">{{ updatedText }}</small> + <header + class="gl-display-flex gl-align-items-center gl-justify-content-space-between gl-bg-white gl-py-4 gl-pl-4 js-design-header" + > + <div class="gl-display-flex gl-align-items-center"> + <router-link + :to="{ + name: $options.DESIGNS_ROUTE_NAME, + query: $route.query, + }" + :aria-label="s__('DesignManagement|Go back to designs')" + data-testid="close-design" + class="gl-mr-5 gl-display-flex gl-align-items-center gl-justify-content-center text-plain" + > + <gl-icon name="close" /> + </router-link> + <div class="overflow-hidden d-flex align-items-center"> + <h2 class="m-0 str-truncated-100 gl-font-base">{{ filename }}</h2> + <small v-if="updatedAt" class="text-secondary">{{ updatedText }}</small> + </div> + </div> + + <div class="gl-display-flex gl-align-items-center"> + <pagination :id="id" class="gl-mr-3 gl-flex-shrink-0" /> + <gl-button :href="image" icon="download" /> + <delete-button + v-if="isLatestVersion && canDeleteDesign" + class="gl-ml-3" + :is-deleting="isDeleting" + button-variant="warning" + button-icon="archive" + button-category="secondary" + @deleteSelectedDesigns="$emit('delete')" + /> </div> - <pagination :id="id" class="ml-auto flex-shrink-0" /> - <gl-deprecated-button :href="image" class="mr-2"> - <icon :size="18" name="download" /> - </gl-deprecated-button> - <delete-button - v-if="isLatestVersion && canDeleteDesign" - :is-deleting="isDeleting" - button-variant="danger" - @deleteSelectedDesigns="$emit('delete')" - > - <icon :size="18" name="remove" /> - </delete-button> </header> </template> diff --git a/app/assets/javascripts/design_management/components/toolbar/pagination.vue b/app/assets/javascripts/design_management/components/toolbar/pagination.vue index bf62a8f66a6..222f9051a11 100644 --- a/app/assets/javascripts/design_management/components/toolbar/pagination.vue +++ b/app/assets/javascripts/design_management/components/toolbar/pagination.vue @@ -65,7 +65,7 @@ export default { <template> <div v-if="designsCount" class="d-flex align-items-center"> {{ paginationText }} - <div class="btn-group ml-3 mr-3"> + <div class="btn-group gl-ml-3"> <pagination-button :design="previousDesign" :title="s__('DesignManagement|Go to previous design')" diff --git a/app/assets/javascripts/design_management/pages/index.vue b/app/assets/javascripts/design_management/pages/index.vue index 6e130b7c741..1864b848f83 100644 --- a/app/assets/javascripts/design_management/pages/index.vue +++ b/app/assets/javascripts/design_management/pages/index.vue @@ -327,7 +327,7 @@ export default { v-if="isLatestVersion" variant="link" size="small" - class="gl-mr-2 js-select-all" + class="gl-mr-3 js-select-all" @click="toggleDesignsSelection" >{{ selectAllButtonText }} </gl-button> @@ -340,14 +340,15 @@ export default { <delete-button v-if="isLatestVersion" :is-deleting="loading" - button-variant="danger" - button-class="gl-mr-4" + button-variant="warning" + button-category="secondary" + button-class="gl-mr-3" button-size="small" + :loading="loading" :has-selected-designs="hasSelectedDesigns" @deleteSelectedDesigns="mutate()" > - {{ s__('DesignManagement|Delete selected') }} - <gl-loading-icon v-if="loading" inline class="ml-1" /> + {{ s__('DesignManagement|Archive selected') }} </delete-button> </design-destroyer> <upload-button v-if="canCreateDesign" :is-saving="isSaving" @upload="onUploadDesign" /> diff --git a/app/assets/javascripts/design_management/utils/error_messages.js b/app/assets/javascripts/design_management/utils/error_messages.js index 92526509d77..c815b11737d 100644 --- a/app/assets/javascripts/design_management/utils/error_messages.js +++ b/app/assets/javascripts/design_management/utils/error_messages.js @@ -73,7 +73,7 @@ const someDesignsSkippedMessage = skippedFiles => { export const designDeletionError = ({ singular = true } = {}) => { const design = singular ? __('a design') : __('designs'); - return sprintf(s__('Could not delete %{design}. Please try again.'), { + return sprintf(s__('Could not archive %{design}. Please try again.'), { design, }); }; diff --git a/app/assets/javascripts/integrations/edit/components/override_dropdown.vue b/app/assets/javascripts/integrations/edit/components/override_dropdown.vue index 0ae2f267434..61a8d809793 100644 --- a/app/assets/javascripts/integrations/edit/components/override_dropdown.vue +++ b/app/assets/javascripts/integrations/edit/components/override_dropdown.vue @@ -5,7 +5,7 @@ import { GlNewDropdown, GlNewDropdownItem } from '@gitlab/ui'; const dropdownOptions = [ { value: false, - text: s__('Integrations|Use instance level settings'), + text: s__('Integrations|Use default settings'), }, { value: true, @@ -48,7 +48,7 @@ export default { <div class="gl-display-flex gl-justify-content-space-between gl-align-items-baseline gl-py-4 gl-mt-5 gl-mb-6 gl-border-t-1 gl-border-t-solid gl-border-b-1 gl-border-b-solid gl-border-gray-100" > - <span>{{ s__('Integrations|This integration has multiple settings available.') }}</span> + <span>{{ s__('Integrations|Default settings are inherited from the instance level.') }}</span> <input name="service[inherit_from_id]" :value="override ? '' : inheritFromId" type="hidden" /> <gl-new-dropdown :text="selected.text"> <gl-new-dropdown-item diff --git a/app/assets/javascripts/vue_shared/components/filtered_search_bar/filtered_search_bar_root.vue b/app/assets/javascripts/vue_shared/components/filtered_search_bar/filtered_search_bar_root.vue index fe2e4c09618..32edbf1839a 100644 --- a/app/assets/javascripts/vue_shared/components/filtered_search_bar/filtered_search_bar_root.vue +++ b/app/assets/javascripts/vue_shared/components/filtered_search_bar/filtered_search_bar_root.vue @@ -121,7 +121,9 @@ export default { : __('Sort direction: Descending'); }, filteredRecentSearches() { - return this.recentSearches.filter(item => typeof item !== 'string'); + return this.recentSearchesStorageKey + ? this.recentSearches.filter(item => typeof item !== 'string') + : undefined; }, }, watch: { @@ -280,7 +282,7 @@ export default { <template #history-item="{ historyItem }"> <template v-for="(token, index) in historyItem"> <span v-if="typeof token === 'string'" :key="index" class="gl-px-1">"{{ token }}"</span> - <span v-else :key="`${token.type}-${token.value.data}`" class="gl-px-1"> + <span v-else :key="`${index}-${token.type}-${token.value.data}`" class="gl-px-1"> <span v-if="tokenTitles[token.type]" >{{ tokenTitles[token.type] }} :{{ token.value.operator }}</span > diff --git a/app/models/application_setting.rb b/app/models/application_setting.rb index a126b49cd9a..661b10019ad 100644 --- a/app/models/application_setting.rb +++ b/app/models/application_setting.rb @@ -275,7 +275,7 @@ class ApplicationSetting < ApplicationRecord numericality: { greater_than_or_equal_to: 0 } validates :snippet_size_limit, numericality: { only_integer: true, greater_than: 0 } - validates :wiki_page_max_content_bytes, numericality: { only_integer: true, greater_than: 0 } + validates :wiki_page_max_content_bytes, numericality: { only_integer: true, greater_than_or_equal_to: 1.kilobytes } validates :email_restrictions, untrusted_regexp: true diff --git a/app/views/projects/services/_form.html.haml b/app/views/projects/services/_form.html.haml index 2e49e74a9b3..24b47f6e4b6 100644 --- a/app/views/projects/services/_form.html.haml +++ b/app/views/projects/services/_form.html.haml @@ -3,7 +3,7 @@ .row.gl-mt-3.gl-mb-3 .col-lg-4 - %h4.gl-mt-0 + %h3.page-title.gl-mt-0 = @service.title - [true, false].each do |value| - hide_class = 'd-none' if @service.operating? != value diff --git a/app/views/shared/integrations/_form.html.haml b/app/views/shared/integrations/_form.html.haml index 4ec7f286c7a..5826cb280bd 100644 --- a/app/views/shared/integrations/_form.html.haml +++ b/app/views/shared/integrations/_form.html.haml @@ -1,14 +1,15 @@ - integration = local_assigns.fetch(:integration) -%h3.page-title - = integration.title - -%p= integration.description - -= form_for integration, as: :service, url: scoped_integration_path(integration), method: :put, html: { class: 'gl-show-field-errors fieldset-form integration-settings-form js-integration-settings-form', data: { 'can-test' => integration.can_test?, 'test-url' => scoped_test_integration_path(integration) } } do |form| - = render 'shared/service_settings', form: form, integration: integration - - - if integration.editable? - .footer-block.row-content-block - = service_save_button - = link_to _('Cancel'), scoped_integration_path(integration), class: 'btn btn-cancel' +.row.gl-mt-3 + .col-lg-4 + %h3.page-title.gl-mt-0 + = integration.title + + .col-lg-8 + = form_for integration, as: :service, url: scoped_integration_path(integration), method: :put, html: { class: 'gl-show-field-errors integration-settings-form js-integration-settings-form', data: { 'can-test' => integration.can_test?, 'test-url' => scoped_test_integration_path(integration) } } do |form| + = render 'shared/service_settings', form: form, integration: integration + + - if integration.editable? + .footer-block.row-content-block + = service_save_button + = link_to _('Cancel'), scoped_integration_path(integration), class: 'btn btn-cancel' diff --git a/changelogs/unreleased/220964-rename-design-delete-button.yml b/changelogs/unreleased/220964-rename-design-delete-button.yml new file mode 100644 index 00000000000..59e6747c90b --- /dev/null +++ b/changelogs/unreleased/220964-rename-design-delete-button.yml @@ -0,0 +1,5 @@ +--- +title: "Re-name \"Delete\" button to \"Archive\" in Design Management" +merge_request: 38446 +author: Getulio Valentin Sánchez @gvso +type: changed diff --git a/changelogs/unreleased/min_limit_wiki_page.yml b/changelogs/unreleased/min_limit_wiki_page.yml new file mode 100644 index 00000000000..58987dfee1b --- /dev/null +++ b/changelogs/unreleased/min_limit_wiki_page.yml @@ -0,0 +1,5 @@ +--- +title: Added minimum value of 1KB to wiki_page_max_content_bytes +merge_request: 38554 +author: Uday Aggarwal (uday.agg97) +type: changed diff --git a/doc/administration/wikis/index.md b/doc/administration/wikis/index.md index b6dfd07cab0..077b4f064dc 100644 --- a/doc/administration/wikis/index.md +++ b/doc/administration/wikis/index.md @@ -30,8 +30,8 @@ This setting is not available through the [Admin Area settings](../../user/admin In order to configure this setting, use either the Rails console or the [Application settings API](../../api/settings.md). -NOTE: **IMPORTANT:** -The value of the limit **must** be in bytes. +NOTE: **Note:** +The value of the limit **must** be in bytes. The minimum value is 1024 bytes. #### Through the Rails console diff --git a/doc/api/settings.md b/doc/api/settings.md index 208ef63de07..64c529b0222 100644 --- a/doc/api/settings.md +++ b/doc/api/settings.md @@ -375,4 +375,4 @@ are listed in the descriptions of the relevant settings. | `user_show_add_ssh_key_message` | boolean | no | When set to `false` disable the "You won't be able to pull or push project code via SSH" warning shown to users with no uploaded SSH key. | | `version_check_enabled` | boolean | no | Let GitLab inform you when an update is available. | | `web_ide_clientside_preview_enabled` | boolean | no | Live Preview (allow live previews of JavaScript projects in the Web IDE using CodeSandbox Live Preview). | -| `wiki_page_max_content_bytes` | integer | no | Max wiki page content size in **bytes**. Default: 52428800 Bytes (50MB).| +| `wiki_page_max_content_bytes` | integer | no | Maximum wiki page content size in **bytes**. Default: 52428800 Bytes (50 MB). The minimum value is 1024 bytes. | diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 299c5cc1008..23ae5515f11 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -3139,6 +3139,9 @@ msgstr "" msgid "Archived" msgstr "" +msgid "Archived in this version" +msgstr "" + msgid "Archived project! Repository and other project resources are read only" msgstr "" @@ -6901,6 +6904,9 @@ msgstr "" msgid "Could not add admins as members" msgstr "" +msgid "Could not archive %{design}. Please try again." +msgstr "" + msgid "Could not authorize chat nickname. Try again!" msgstr "" @@ -8322,6 +8328,18 @@ msgstr "" msgid "DesignManagement|Adding a design with the same filename replaces the file in a new version." msgstr "" +msgid "DesignManagement|Archive designs" +msgstr "" + +msgid "DesignManagement|Archive selected" +msgstr "" + +msgid "DesignManagement|Archived designs will still be available in previous versions of the design collection." +msgstr "" + +msgid "DesignManagement|Are you sure you want to archive the selected designs?" +msgstr "" + msgid "DesignManagement|Are you sure you want to cancel changes to this comment?" msgstr "" @@ -13102,6 +13120,9 @@ msgstr "" msgid "Integrations|Comment settings:" msgstr "" +msgid "Integrations|Default settings are inherited from the instance level." +msgstr "" + msgid "Integrations|Enable comments" msgstr "" @@ -13114,13 +13135,10 @@ msgstr "" msgid "Integrations|Standard" msgstr "" -msgid "Integrations|This integration has multiple settings available." -msgstr "" - msgid "Integrations|Use custom settings" msgstr "" -msgid "Integrations|Use instance level settings" +msgid "Integrations|Use default settings" msgstr "" msgid "Integrations|When a Jira issue is mentioned in a commit or merge request a remote link and comment (if enabled) will be created." diff --git a/spec/frontend/boards/components/sidebar/remove_issue_spec.js b/spec/frontend/boards/components/sidebar/remove_issue_spec.js new file mode 100644 index 00000000000..a33e4046724 --- /dev/null +++ b/spec/frontend/boards/components/sidebar/remove_issue_spec.js @@ -0,0 +1,28 @@ +import { shallowMount } from '@vue/test-utils'; +import { GlButton } from '@gitlab/ui'; + +import RemoveIssue from '~/boards/components/sidebar/remove_issue.vue'; + +describe('boards sidebar remove issue', () => { + let wrapper; + + const findButton = () => wrapper.find(GlButton); + + const createComponent = propsData => { + wrapper = shallowMount(RemoveIssue, { + propsData: { + issue: {}, + list: {}, + ...propsData, + }, + }); + }; + + beforeEach(() => { + createComponent(); + }); + + it('renders remove button', () => { + expect(findButton().exists()).toBe(true); + }); +}); diff --git a/spec/frontend/design_management/components/toolbar/__snapshots__/index_spec.js.snap b/spec/frontend/design_management/components/toolbar/__snapshots__/index_spec.js.snap index f251171ecda..aa914a8dff0 100644 --- a/spec/frontend/design_management/components/toolbar/__snapshots__/index_spec.js.snap +++ b/spec/frontend/design_management/components/toolbar/__snapshots__/index_spec.js.snap @@ -2,62 +2,64 @@ exports[`Design management toolbar component renders design and updated data 1`] = ` <header - class="d-flex p-2 bg-white align-items-center js-design-header" + class="gl-display-flex gl-align-items-center gl-justify-content-space-between gl-bg-white gl-py-4 gl-pl-4 js-design-header" > - <a - aria-label="Go back to designs" - class="mr-3 text-plain d-flex justify-content-center align-items-center" - data-testid="close-design" - > - <icon-stub - name="close" - size="18" - /> - </a> - <div - class="overflow-hidden d-flex align-items-center" + class="gl-display-flex gl-align-items-center" > - <h2 - class="m-0 str-truncated-100 gl-font-base" + <a + aria-label="Go back to designs" + class="gl-mr-5 gl-display-flex gl-align-items-center gl-justify-content-center text-plain" + data-testid="close-design" > - test.jpg - </h2> + <gl-icon-stub + name="close" + size="16" + /> + </a> - <small - class="text-secondary" + <div + class="overflow-hidden d-flex align-items-center" > - Updated 1 hour ago by Test Name - </small> + <h2 + class="m-0 str-truncated-100 gl-font-base" + > + test.jpg + </h2> + + <small + class="text-secondary" + > + Updated 1 hour ago by Test Name + </small> + </div> </div> - <pagination-stub - class="ml-auto flex-shrink-0" - id="1" - /> - - <gl-deprecated-button-stub - class="mr-2" - href="/-/designs/306/7f747adcd4693afadbe968d7ba7d983349b9012d" - size="md" - variant="secondary" + <div + class="gl-display-flex gl-align-items-center" > - <icon-stub - name="download" - size="18" + <pagination-stub + class="gl-mr-3 gl-flex-shrink-0" + id="1" /> - </gl-deprecated-button-stub> - - <delete-button-stub - buttonclass="" - buttonsize="medium" - buttonvariant="danger" - hasselecteddesigns="true" - > - <icon-stub - name="remove" - size="18" + + <gl-button-stub + category="tertiary" + href="/-/designs/306/7f747adcd4693afadbe968d7ba7d983349b9012d" + icon="download" + size="medium" + variant="default" /> - </delete-button-stub> + + <delete-button-stub + buttoncategory="secondary" + buttonclass="" + buttonicon="archive" + buttonsize="medium" + buttonvariant="warning" + class="gl-ml-3" + hasselecteddesigns="true" + /> + </div> </header> `; diff --git a/spec/frontend/design_management/components/toolbar/__snapshots__/pagination_spec.js.snap b/spec/frontend/design_management/components/toolbar/__snapshots__/pagination_spec.js.snap index 0197b4bff79..83b631cc86a 100644 --- a/spec/frontend/design_management/components/toolbar/__snapshots__/pagination_spec.js.snap +++ b/spec/frontend/design_management/components/toolbar/__snapshots__/pagination_spec.js.snap @@ -10,7 +10,7 @@ exports[`Design management pagination component renders pagination buttons 1`] = 0 of 2 <div - class="btn-group ml-3 mr-3" + class="btn-group gl-ml-3" > <pagination-button-stub class="js-previous-design" diff --git a/spec/frontend/design_management/components/toolbar/index_spec.js b/spec/frontend/design_management/components/toolbar/index_spec.js index 2910b2f62ba..6283a27df47 100644 --- a/spec/frontend/design_management/components/toolbar/index_spec.js +++ b/spec/frontend/design_management/components/toolbar/index_spec.js @@ -3,7 +3,7 @@ import VueRouter from 'vue-router'; import Toolbar from '~/design_management/components/toolbar/index.vue'; import DeleteButton from '~/design_management/components/delete_button.vue'; import { DESIGNS_ROUTE_NAME } from '~/design_management/router/constants'; -import { GlDeprecatedButton } from '@gitlab/ui'; +import { GlButton } from '@gitlab/ui'; const localVue = createLocalVue(); localVue.use(VueRouter); @@ -116,7 +116,7 @@ describe('Design management toolbar component', () => { }); it('renders download button with correct link', () => { - expect(wrapper.find(GlDeprecatedButton).attributes('href')).toBe( + expect(wrapper.find(GlButton).attributes('href')).toBe( '/-/designs/306/7f747adcd4693afadbe968d7ba7d983349b9012d', ); }); diff --git a/spec/frontend/design_management/pages/__snapshots__/index_spec.js.snap b/spec/frontend/design_management/pages/__snapshots__/index_spec.js.snap index 90423b40662..c3fcede5576 100644 --- a/spec/frontend/design_management/pages/__snapshots__/index_spec.js.snap +++ b/spec/frontend/design_management/pages/__snapshots__/index_spec.js.snap @@ -111,7 +111,7 @@ exports[`Design management index page designs renders designs list and header wi > <gl-button-stub category="tertiary" - class="gl-mr-2 js-select-all" + class="gl-mr-3 js-select-all" icon="" size="small" variant="link" @@ -122,14 +122,14 @@ exports[`Design management index page designs renders designs list and header wi <div> <delete-button-stub - buttonclass="gl-mr-4" + buttoncategory="secondary" + buttonclass="gl-mr-3" buttonsize="small" - buttonvariant="danger" + buttonvariant="warning" > - Delete selected - - <!----> + Archive selected + </delete-button-stub> </div> diff --git a/spec/frontend/design_management/utils/error_messages_spec.js b/spec/frontend/design_management/utils/error_messages_spec.js index 4c19d6b419f..f5072c3b6b7 100644 --- a/spec/frontend/design_management/utils/error_messages_spec.js +++ b/spec/frontend/design_management/utils/error_messages_spec.js @@ -10,8 +10,8 @@ const mockFilenames = n => describe('Error message', () => { describe('designDeletionError', () => { - const singularMsg = 'Could not delete a design. Please try again.'; - const pluralMsg = 'Could not delete designs. Please try again.'; + const singularMsg = 'Could not archive a design. Please try again.'; + const pluralMsg = 'Could not archive designs. Please try again.'; describe('when [singular=true]', () => { it.each([[undefined], [true]])('uses singular grammar', singularOption => { diff --git a/spec/frontend/vue_shared/components/filtered_search_bar/filtered_search_bar_root_spec.js b/spec/frontend/vue_shared/components/filtered_search_bar/filtered_search_bar_root_spec.js index c803b16f485..73dbecadd89 100644 --- a/spec/frontend/vue_shared/components/filtered_search_bar/filtered_search_bar_root_spec.js +++ b/spec/frontend/vue_shared/components/filtered_search_bar/filtered_search_bar_root_spec.js @@ -130,6 +130,16 @@ describe('FilteredSearchBarRoot', () => { expect(wrapper.vm.filteredRecentSearches).toHaveLength(1); expect(wrapper.vm.filteredRecentSearches[0]).toEqual({ foo: 'bar' }); }); + + it('returns undefined when recentSearchesStorageKey prop is not set on component', async () => { + wrapper.setProps({ + recentSearchesStorageKey: '', + }); + + await wrapper.vm.$nextTick(); + + expect(wrapper.vm.filteredRecentSearches).not.toBeDefined(); + }); }); }); diff --git a/spec/models/application_setting_spec.rb b/spec/models/application_setting_spec.rb index ae164aff426..bcd8eccd68f 100644 --- a/spec/models/application_setting_spec.rb +++ b/spec/models/application_setting_spec.rb @@ -72,7 +72,7 @@ RSpec.describe ApplicationSetting do it { is_expected.not_to allow_value(nil).for(:push_event_activities_limit) } it { is_expected.to validate_numericality_of(:snippet_size_limit).only_integer.is_greater_than(0) } - it { is_expected.to validate_numericality_of(:wiki_page_max_content_bytes).only_integer.is_greater_than(0) } + it { is_expected.to validate_numericality_of(:wiki_page_max_content_bytes).only_integer.is_greater_than_or_equal_to(1024) } it { is_expected.to validate_presence_of(:max_artifacts_size) } it { is_expected.to validate_numericality_of(:max_artifacts_size).only_integer.is_greater_than(0) } it { is_expected.to validate_presence_of(:max_pages_size) } |