diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-08 03:10:07 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-08 03:10:07 +0300 |
commit | 6214ac71ff96ebd17254be4dfbebc94226da78e5 (patch) | |
tree | 40d06509e45b3a2d2af9b29b9bfa2b8f7f7c5aba | |
parent | 96135034f442825a54cea2812192133d376fbc4b (diff) |
Add latest changes from gitlab-org/gitlab@master
8 files changed, 56 insertions, 56 deletions
diff --git a/app/assets/javascripts/incidents/components/incidents_list.vue b/app/assets/javascripts/incidents/components/incidents_list.vue index 5638dc064d1..af99341b11f 100644 --- a/app/assets/javascripts/incidents/components/incidents_list.vue +++ b/app/assets/javascripts/incidents/components/incidents_list.vue @@ -10,7 +10,6 @@ import { GlIcon, GlEmptyState, } from '@gitlab/ui'; -import { convertToSnakeCase } from '~/lib/utils/text_utility'; import { visitUrl, mergeUrlParams, joinPaths } from '~/lib/utils/url_utility'; import { s__ } from '~/locale'; import { INCIDENT_SEVERITY } from '~/sidebar/components/severity/constants'; @@ -49,6 +48,7 @@ export default { label: s__('IncidentManagement|Severity'), thClass: `${thClass} w-15p`, tdClass: `${tdClass} sortable-cell`, + actualSortKey: 'SEVERITY', sortable: true, thAttr: TH_SEVERITY_TEST_ID, }, @@ -63,6 +63,7 @@ export default { label: s__('IncidentManagement|Date created'), thClass: `${thClass} gl-w-eighth`, tdClass: `${tdClass} sortable-cell`, + actualSortKey: 'CREATED', sortable: true, thAttr: TH_CREATED_AT_TEST_ID, }, @@ -72,7 +73,7 @@ export default { thClass: `gl-text-right gl-w-eighth`, tdClass: `${tdClass} gl-text-right`, thAttr: TH_INCIDENT_SLA_TEST_ID, - sortKey: 'SLA_DUE_AT', + actualSortKey: 'SLA_DUE_AT', sortable: true, sortDirection: 'asc', }, @@ -87,6 +88,7 @@ export default { label: s__('IncidentManagement|Published'), thClass: `${thClass} w-15p`, tdClass: `${tdClass} sortable-cell`, + actualSortKey: 'PUBLISHED', sortable: true, thAttr: TH_PUBLISHED_TEST_ID, }, @@ -174,8 +176,7 @@ export default { redirecting: false, incidents: {}, incidentsCount: {}, - sort: 'created_desc', - sortBy: 'createdAt', + sort: 'CREATED_DESC', sortDesc: true, statusFilter: '', filteredByStatus: '', @@ -256,20 +257,17 @@ export default { this.redirecting = true; }, fetchSortedData({ sortBy, sortDesc }) { - let sortKey; - // In bootstrap-vue v2.17.0, sortKey becomes natively supported and we can eliminate this function const field = this.availableFields.find(({ key }) => key === sortBy); const sortingDirection = sortDesc ? 'DESC' : 'ASC'; - // Use `sortKey` if provided, otherwise fall back to existing algorithm - if (field?.sortKey) { - sortKey = field.sortKey; - } else { - sortKey = convertToSnakeCase(sortBy).replace(/_.*/, '').toUpperCase(); - } - this.pagination = initialPaginationState; - this.sort = `${sortKey}_${sortingDirection}`; + + // BootstapVue natively supports a `sortKey` parameter, but using it results in the sorting + // icons not being updated properly in the header. We decided to fallback on `actualSortKey` + // to bypass BootstrapVue's behavior until the bug is addressed upstream. + // Related discussion: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/60926/diffs#note_568020482 + // Upstream issue: https://github.com/bootstrap-vue/bootstrap-vue/issues/6602 + this.sort = `${field.actualSortKey}_${sortingDirection}`; }, getSeverity(severity) { return INCIDENT_SEVERITY[severity]; @@ -334,14 +332,14 @@ export default { <gl-table :items="incidents.list || []" :fields="availableFields" - :show-empty="true" :busy="loading" stacked="md" :tbody-tr-class="tbodyTrClass" - :no-local-sorting="true" - :sort-direction="'desc'" + sort-direction="desc" :sort-desc.sync="sortDesc" - :sort-by.sync="sortBy" + sort-by="createdAt" + show-empty + no-local-sorting sort-icon-left fixed @row-clicked="navigateToIncidentDetails" diff --git a/app/views/layouts/_page_title.html.haml b/app/views/layouts/_page_title.html.haml deleted file mode 100644 index 54da5074763..00000000000 --- a/app/views/layouts/_page_title.html.haml +++ /dev/null @@ -1,2 +0,0 @@ -- if content_for?(:page-title) - = yield :page-title diff --git a/config/feature_flags/experiment/in_product_guidance_environments_webide.yml b/config/feature_flags/experiment/in_product_guidance_environments_webide.yml index 4eaf6e90b27..732294f7d96 100644 --- a/config/feature_flags/experiment/in_product_guidance_environments_webide.yml +++ b/config/feature_flags/experiment/in_product_guidance_environments_webide.yml @@ -1,7 +1,7 @@ --- name: in_product_guidance_environments_webide -introduced_by_url: -rollout_issue_url: +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/57160 +rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/330390 milestone: '13.12' type: experiment group: group::release diff --git a/package.json b/package.json index 535c39a23d1..81a221643f0 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "@gitlab/favicon-overlay": "2.0.0", "@gitlab/svgs": "1.192.0", "@gitlab/tributejs": "1.0.0", - "@gitlab/ui": "29.17.0", + "@gitlab/ui": "29.18.0", "@gitlab/visual-review-tools": "1.6.1", "@rails/actioncable": "^6.0.3-4", "@rails/ujs": "^6.0.3-4", diff --git a/spec/frontend/incidents/components/incidents_list_spec.js b/spec/frontend/incidents/components/incidents_list_spec.js index df681658081..c7286d70b94 100644 --- a/spec/frontend/incidents/components/incidents_list_spec.js +++ b/spec/frontend/incidents/components/incidents_list_spec.js @@ -270,22 +270,25 @@ describe('Incidents List', () => { const noneSort = 'none'; it.each` - selector | initialSort | firstSort | nextSort - ${TH_CREATED_AT_TEST_ID} | ${descSort} | ${ascSort} | ${descSort} - ${TH_SEVERITY_TEST_ID} | ${noneSort} | ${descSort} | ${ascSort} - ${TH_PUBLISHED_TEST_ID} | ${noneSort} | ${descSort} | ${ascSort} - ${TH_INCIDENT_SLA_TEST_ID} | ${noneSort} | ${ascSort} | ${descSort} - `('updates sort with new direction', async ({ selector, initialSort, firstSort, nextSort }) => { - const [[attr, value]] = Object.entries(selector); - const columnHeader = () => wrapper.find(`[${attr}="${value}"]`); - expect(columnHeader().attributes('aria-sort')).toBe(initialSort); - columnHeader().trigger('click'); - await wrapper.vm.$nextTick(); - expect(columnHeader().attributes('aria-sort')).toBe(firstSort); - columnHeader().trigger('click'); - await wrapper.vm.$nextTick(); - expect(columnHeader().attributes('aria-sort')).toBe(nextSort); - }); + description | selector | initialSort | firstSort | nextSort + ${'creation date'} | ${TH_CREATED_AT_TEST_ID} | ${descSort} | ${ascSort} | ${descSort} + ${'severity'} | ${TH_SEVERITY_TEST_ID} | ${noneSort} | ${descSort} | ${ascSort} + ${'publish date'} | ${TH_PUBLISHED_TEST_ID} | ${noneSort} | ${descSort} | ${ascSort} + ${'due date'} | ${TH_INCIDENT_SLA_TEST_ID} | ${noneSort} | ${ascSort} | ${descSort} + `( + 'updates sort with new direction when sorting by $description', + async ({ selector, initialSort, firstSort, nextSort }) => { + const [[attr, value]] = Object.entries(selector); + const columnHeader = () => wrapper.find(`[${attr}="${value}"]`); + expect(columnHeader().attributes('aria-sort')).toBe(initialSort); + columnHeader().trigger('click'); + await wrapper.vm.$nextTick(); + expect(columnHeader().attributes('aria-sort')).toBe(firstSort); + columnHeader().trigger('click'); + await wrapper.vm.$nextTick(); + expect(columnHeader().attributes('aria-sort')).toBe(nextSort); + }, + ); }); describe('Snowplow tracking', () => { diff --git a/spec/frontend/pages/projects/learn_gitlab/components/__snapshots__/learn_gitlab_a_spec.js.snap b/spec/frontend/pages/projects/learn_gitlab/components/__snapshots__/learn_gitlab_a_spec.js.snap index b9566741cfa..350669433f0 100644 --- a/spec/frontend/pages/projects/learn_gitlab/components/__snapshots__/learn_gitlab_a_spec.js.snap +++ b/spec/frontend/pages/projects/learn_gitlab/components/__snapshots__/learn_gitlab_a_spec.js.snap @@ -44,9 +44,7 @@ exports[`Learn GitLab Design A renders correctly 1`] = ` class="progress-bar" role="progressbar" style="width: 22.22222222222222%;" - > - <!----> - </div> + /> </div> </div> diff --git a/spec/frontend/pages/projects/learn_gitlab/components/__snapshots__/learn_gitlab_b_spec.js.snap b/spec/frontend/pages/projects/learn_gitlab/components/__snapshots__/learn_gitlab_b_spec.js.snap index 3161517c916..c9d8ab4566c 100644 --- a/spec/frontend/pages/projects/learn_gitlab/components/__snapshots__/learn_gitlab_b_spec.js.snap +++ b/spec/frontend/pages/projects/learn_gitlab/components/__snapshots__/learn_gitlab_b_spec.js.snap @@ -44,9 +44,7 @@ exports[`Learn GitLab Design B renders correctly 1`] = ` class="progress-bar" role="progressbar" style="width: 22.22222222222222%;" - > - <!----> - </div> + /> </div> </div> diff --git a/yarn.lock b/yarn.lock index 976e85e13d6..bb15c167213 100644 --- a/yarn.lock +++ b/yarn.lock @@ -907,14 +907,14 @@ resolved "https://registry.yarnpkg.com/@gitlab/tributejs/-/tributejs-1.0.0.tgz#672befa222aeffc83e7d799b0500a7a4418e59b8" integrity sha512-nmKw1+hB6MHvlmPz63yPwVs1qQkycHwsKgxpEbzmky16Y6mL4EJMk3w1b8QlOAF/AIAzjCERPhe/R4MJiohbZw== -"@gitlab/ui@29.17.0": - version "29.17.0" - resolved "https://registry.yarnpkg.com/@gitlab/ui/-/ui-29.17.0.tgz#405eb5448741f1b7ea17afd913d6e918d783cbce" - integrity sha512-BsHPEBD9wIq0LnewxgTmPYKDn0rE3b3aluN3hn9A7zVgnofifmA9c0Cn25u0ha3sOV13K1NNtDKlEgcwgOWgQQ== +"@gitlab/ui@29.18.0": + version "29.18.0" + resolved "https://registry.yarnpkg.com/@gitlab/ui/-/ui-29.18.0.tgz#c6ca04d9ef0b2e96ab0cd1e0570441e0d2accda7" + integrity sha512-CNa7eZn+8/j4/NzDBG5cdiIfyRZEb9J84WkEFTk7ZafZKdP2jtbdzys9eotQcS11kS1rf95rSVpQy0P6vebt1A== dependencies: "@babel/standalone" "^7.0.0" "@gitlab/vue-toasted" "^1.3.0" - bootstrap-vue "2.16.0" + bootstrap-vue "2.17.3" copy-to-clipboard "^3.0.8" dompurify "^2.2.8" echarts "^4.9.0" @@ -2740,22 +2740,27 @@ bonjour@^3.5.0: multicast-dns "^6.0.1" multicast-dns-service-types "^1.1.0" -bootstrap-vue@2.16.0: - version "2.16.0" - resolved "https://registry.yarnpkg.com/bootstrap-vue/-/bootstrap-vue-2.16.0.tgz#07e7032ec9ffdd576470dc437da54f398ec16ba5" - integrity sha512-gLETwPmeRHCe5WHmhGxzb5PtTEuKqQPGl0TFvZ2Odbkg/7UuIHdqIexrJRerpnomP4ZzDQ+qYGL91Ls9lcQsJQ== +bootstrap-vue@2.17.3: + version "2.17.3" + resolved "https://registry.yarnpkg.com/bootstrap-vue/-/bootstrap-vue-2.17.3.tgz#3d78b7b4ff992a8ad69d2ed1c7413fcfdcefaec7" + integrity sha512-upX5LktvsecbBsLnjwaSQoDCsYfneToOweOaERt+Cc/cT6P44zODzpxZa54HZEAbE5gSE5mJmDacUrs02qAR8g== dependencies: "@nuxt/opencollective" "^0.3.0" - bootstrap ">=4.5.0 <5.0.0" + bootstrap ">=4.5.2 <5.0.0" popper.js "^1.16.1" portal-vue "^2.1.7" vue-functional-data-merge "^3.1.0" -bootstrap@4.5.3, "bootstrap@>=4.5.0 <5.0.0": +bootstrap@4.5.3: version "4.5.3" resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-4.5.3.tgz#c6a72b355aaf323920be800246a6e4ef30997fe6" integrity sha512-o9ppKQioXGqhw8Z7mah6KdTYpNQY//tipnkxppWhPbiSWdD+1raYsnhwEZjkTHYbGee4cVQ0Rx65EhOY/HNLcQ== +"bootstrap@>=4.5.2 <5.0.0": + version "4.6.0" + resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-4.6.0.tgz#97b9f29ac98f98dfa43bf7468262d84392552fd7" + integrity sha512-Io55IuQY3kydzHtbGvQya3H+KorS/M9rSNyfCGCg9WZ4pyT/lCxIlpJgG1GXW/PswzC84Tr2fBYi+7+jFVQQBw== + boxen@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/boxen/-/boxen-4.2.0.tgz#e411b62357d6d6d36587c8ac3d5d974daa070e64" |