diff options
-rw-r--r-- | app/assets/javascripts/reports/components/modal_open_name.vue | 22 | ||||
-rw-r--r-- | doc/api/README.md | 12 | ||||
-rw-r--r-- | doc/api/instance_level_ci_variables.md | 6 | ||||
-rw-r--r-- | doc/api/jobs.md | 6 | ||||
-rw-r--r-- | doc/api/lint.md | 6 | ||||
-rw-r--r-- | doc/api/pipeline_schedules.md | 6 | ||||
-rw-r--r-- | doc/api/pipeline_triggers.md | 6 | ||||
-rw-r--r-- | doc/api/pipelines.md | 6 | ||||
-rw-r--r-- | doc/api/project_level_variables.md | 6 | ||||
-rw-r--r-- | doc/api/templates/gitlab_ci_ymls.md | 17 | ||||
-rw-r--r-- | doc/api/visual_review_discussions.md | 6 | ||||
-rw-r--r-- | doc/ci/pipelines/index.md | 1 | ||||
-rw-r--r-- | doc/development/documentation/index.md | 2 | ||||
-rw-r--r-- | locale/gitlab.pot | 3 | ||||
-rw-r--r-- | spec/frontend/design_management_legacy/utils/error_messages_spec.js | 2 | ||||
-rw-r--r-- | spec/frontend/monitoring/components/dashboard_header_spec.js | 58 | ||||
-rw-r--r-- | spec/frontend/monitoring/components/dashboard_spec.js | 79 |
17 files changed, 146 insertions, 98 deletions
diff --git a/app/assets/javascripts/reports/components/modal_open_name.vue b/app/assets/javascripts/reports/components/modal_open_name.vue index 4f81cee2a38..78e1fcb205b 100644 --- a/app/assets/javascripts/reports/components/modal_open_name.vue +++ b/app/assets/javascripts/reports/components/modal_open_name.vue @@ -1,7 +1,12 @@ <script> +import { GlTooltipDirective, GlResizeObserverDirective } from '@gitlab/ui'; import { mapActions } from 'vuex'; export default { + directives: { + GlTooltip: GlTooltipDirective, + GlResizeObserverDirective, + }, props: { issue: { type: Object, @@ -13,19 +18,32 @@ export default { required: true, }, }, + data: () => ({ + tooltipTitle: '', + }), + mounted() { + this.updateTooltipTitle(); + }, methods: { ...mapActions(['openModal']), handleIssueClick() { const { issue, status, openModal } = this; openModal({ issue, status }); }, + updateTooltipTitle() { + // Only show the tooltip if the text is truncated with an ellipsis. + this.tooltipTitle = this.$el.offsetWidth < this.$el.scrollWidth ? this.issue.title : ''; + }, }, }; </script> <template> <button - type="button" - class="btn-link btn-blank text-left break-link vulnerability-name-button" + v-gl-tooltip="{ boundary: 'viewport' }" + v-gl-resize-observer-directive="updateTooltipTitle" + class="btn-link gl-text-truncate" + :aria-label="s__('Reports|Vulnerability Name')" + :title="tooltipTitle" @click="handleIssueClick()" > {{ issue.title }} diff --git a/doc/api/README.md b/doc/api/README.md index f640149b248..82cce57f47b 100644 --- a/doc/api/README.md +++ b/doc/api/README.md @@ -338,10 +338,10 @@ In the example below, we list 50 [namespaces](namespaces.md) per page. curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/namespaces?per_page=50" ``` -#### Pagination Link header +#### Pagination `Link` header -[Link headers](https://www.w3.org/wiki/LinkHeader) are sent back with each -response. They have `rel` set to prev/next/first/last and contain the relevant +[`Link` headers](https://www.w3.org/wiki/LinkHeader) are sent back with each +response. They have `rel` set to `prev`/`next`/`first`/`last` and contain the relevant URL. Please use these links instead of generating your own URLs. In the cURL example below, we limit the output to 3 items per page (`per_page=3`) @@ -424,12 +424,14 @@ Status: 200 OK ``` CAUTION: **Deprecation:** -The `Links` Header will be removed in GitLab 14.0 to be aligned with the [W3C `Link` specification](https://www.w3.org/wiki/LinkHeader) +The `Links` header will be removed in GitLab 14.0 to be aligned with the [W3C `Link` specification](https://www.w3.org/wiki/LinkHeader). +The `Link` header was [added in GitLab 13.1](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/33714) +and should be used instead. The link to the next page contains an additional filter `id_after=42` which excludes records we have retrieved already. Note the type of filter depends on the `order_by` option used and we may have more than one additional filter. -When the end of the collection has been reached and there are no additional records to retrieve, the `Links` header is absent and the resulting array is empty. +When the end of the collection has been reached and there are no additional records to retrieve, the `Link` header is absent and the resulting array is empty. We recommend using only the given link to retrieve the next page instead of building your own URL. Apart from the headers shown, we don't expose additional pagination headers. diff --git a/doc/api/instance_level_ci_variables.md b/doc/api/instance_level_ci_variables.md index a9663eedc3b..755ebf576b1 100644 --- a/doc/api/instance_level_ci_variables.md +++ b/doc/api/instance_level_ci_variables.md @@ -1,3 +1,9 @@ +--- +stage: Verify +group: Continuous Integration +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers +--- + # Instance-level CI/CD variables API > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/14108) in GitLab 13.0 diff --git a/doc/api/jobs.md b/doc/api/jobs.md index 3b23c6a7917..054260794c7 100644 --- a/doc/api/jobs.md +++ b/doc/api/jobs.md @@ -1,3 +1,9 @@ +--- +stage: Verify +group: Continuous Integration +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers +--- + # Jobs API ## List project jobs diff --git a/doc/api/lint.md b/doc/api/lint.md index b5889884e48..f4d8a0bc011 100644 --- a/doc/api/lint.md +++ b/doc/api/lint.md @@ -1,3 +1,9 @@ +--- +stage: Verify +group: Continuous Integration +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers +--- + # Validate the `.gitlab-ci.yml` (API) > [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/5953) in GitLab 8.12. diff --git a/doc/api/pipeline_schedules.md b/doc/api/pipeline_schedules.md index dc16157ef4b..1faa6ef56db 100644 --- a/doc/api/pipeline_schedules.md +++ b/doc/api/pipeline_schedules.md @@ -1,3 +1,9 @@ +--- +stage: Verify +group: Continuous Integration +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers +--- + # Pipeline schedules API You can read more about [pipeline schedules](../ci/pipelines/schedules.md). diff --git a/doc/api/pipeline_triggers.md b/doc/api/pipeline_triggers.md index 1a63a04be71..c46992de51b 100644 --- a/doc/api/pipeline_triggers.md +++ b/doc/api/pipeline_triggers.md @@ -1,3 +1,9 @@ +--- +stage: Verify +group: Continuous Integration +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers +--- + # Pipeline triggers API You can read more about [triggering pipelines through the API](../ci/triggers/README.md). diff --git a/doc/api/pipelines.md b/doc/api/pipelines.md index bdf18c53708..46178dfed82 100644 --- a/doc/api/pipelines.md +++ b/doc/api/pipelines.md @@ -1,3 +1,9 @@ +--- +stage: Verify +group: Continuous Integration +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers +--- + # Pipelines API ## Single Pipeline Requests diff --git a/doc/api/project_level_variables.md b/doc/api/project_level_variables.md index e8d4641bf6a..07835b318f4 100644 --- a/doc/api/project_level_variables.md +++ b/doc/api/project_level_variables.md @@ -1,7 +1,7 @@ --- -stage: Create -group: Source Code -info: "To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers" +stage: Verify +group: Continuous Integration +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers type: reference, api --- diff --git a/doc/api/templates/gitlab_ci_ymls.md b/doc/api/templates/gitlab_ci_ymls.md index 816061c6235..dfe22fc453e 100644 --- a/doc/api/templates/gitlab_ci_ymls.md +++ b/doc/api/templates/gitlab_ci_ymls.md @@ -1,4 +1,7 @@ --- +stage: Verify +group: Continuous Integration +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers type: reference --- @@ -8,9 +11,9 @@ In GitLab, there is an API endpoint available to work with GitLab CI/CD YMLs. Fo information on CI/CD pipeline configuration in GitLab, see the [configuration reference documentation](../../ci/yaml/README.md). -## List GitLab CI YML templates +## List GitLab CI YAML templates -Get all GitLab CI/CD YML templates. +Get all GitLab CI/CD YAML templates. ```plaintext GET /templates/gitlab_ci_ymls @@ -19,7 +22,7 @@ GET /templates/gitlab_ci_ymls Example request: ```shell -curl https://gitlab.example.com/api/v4/templates/gitlab_ci_ymls +curl "https://gitlab.example.com/api/v4/templates/gitlab_ci_ymls" ``` Example response: @@ -109,9 +112,9 @@ Example response: ] ``` -## Single GitLab CI YML template +## Single GitLab CI YAML template -Get a single GitLab CI/CD YML template. +Get a single GitLab CI/CD YAML template. ```plaintext GET /templates/gitlab_ci_ymls/:key @@ -119,12 +122,12 @@ GET /templates/gitlab_ci_ymls/:key | Attribute | Type | Required | Description | | ---------- | ------ | -------- | ------------------------------------- | -| `key` | string | yes | The key of the GitLab CI/CD YML template | +| `key` | string | yes | The key of the GitLab CI/CD YAML template | Example request: ```shell -curl https://gitlab.example.com/api/v4/templates/gitlab_ci_ymls/Ruby +curl "https://gitlab.example.com/api/v4/templates/gitlab_ci_ymls/Ruby" ``` Example response: diff --git a/doc/api/visual_review_discussions.md b/doc/api/visual_review_discussions.md index 12a4c20539c..c9863784038 100644 --- a/doc/api/visual_review_discussions.md +++ b/doc/api/visual_review_discussions.md @@ -1,7 +1,7 @@ --- -stage: Create -group: Source Code -info: "To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers" +stage: Verify +group: Testing +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers type: reference, api --- diff --git a/doc/ci/pipelines/index.md b/doc/ci/pipelines/index.md index 18b3fe10bec..0f3b325c02b 100644 --- a/doc/ci/pipelines/index.md +++ b/doc/ci/pipelines/index.md @@ -252,6 +252,7 @@ on that specific branch: - Run manual pipelines (using the [Web UI](#run-a-pipeline-manually) or [pipelines API](#pipelines-api)). - Run scheduled pipelines. - Run pipelines using triggers. +- Run on-demand DAST scan. - Trigger manual actions on existing pipelines. - Retry or cancel existing jobs (using the Web UI or pipelines API). diff --git a/doc/development/documentation/index.md b/doc/development/documentation/index.md index cc492cc2d1a..ad9ad8c64cc 100644 --- a/doc/development/documentation/index.md +++ b/doc/development/documentation/index.md @@ -693,11 +693,13 @@ To configure markdownlint within your editor, install one of the following as ap - [Sublime Text](https://packagecontrol.io/packages/SublimeLinter-contrib-markdownlint) - [Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint) - [Atom](https://atom.io/packages/linter-node-markdownlint) +- [Vim](https://github.com/dense-analysis/ale) To configure Vale within your editor, install one of the following as appropriate: - The Sublime Text [`SublimeLinter-contrib-vale` plugin](https://packagecontrol.io/packages/SublimeLinter-contrib-vale) - The Visual Studio Code [`testthedocs.vale` extension](https://marketplace.visualstudio.com/items?itemName=testthedocs.vale) +- [Vim](https://github.com/dense-analysis/ale) We don't use [Vale Server](https://errata-ai.github.io/vale/#using-vale-with-a-text-editor-or-another-third-party-application). diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 4376a041c7f..f66c000e58f 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -20245,6 +20245,9 @@ msgstr "" msgid "Reports|Vulnerability" msgstr "" +msgid "Reports|Vulnerability Name" +msgstr "" + msgid "Reports|no changed test results" msgstr "" diff --git a/spec/frontend/design_management_legacy/utils/error_messages_spec.js b/spec/frontend/design_management_legacy/utils/error_messages_spec.js index f503fe36c76..489ac23da4e 100644 --- a/spec/frontend/design_management_legacy/utils/error_messages_spec.js +++ b/spec/frontend/design_management_legacy/utils/error_messages_spec.js @@ -55,7 +55,7 @@ describe('Error message', () => { 'Upload skipped. Some of the designs you tried uploading did not change: 1.jpg, 2.jpg, 3.jpg, 4.jpg, 5.jpg, and 2 more.', ], ])('designUploadSkippedWarning', (uploadedFiles, skippedFiles, expected) => { - test('returns expected warning message', () => { + it('returns expected warning message', () => { expect(designUploadSkippedWarning(uploadedFiles, skippedFiles)).toBe(expected); }); }); diff --git a/spec/frontend/monitoring/components/dashboard_header_spec.js b/spec/frontend/monitoring/components/dashboard_header_spec.js index d67848aa0c0..cad2a2c396c 100644 --- a/spec/frontend/monitoring/components/dashboard_header_spec.js +++ b/spec/frontend/monitoring/components/dashboard_header_spec.js @@ -2,6 +2,8 @@ import { shallowMount } from '@vue/test-utils'; import { createStore } from '~/monitoring/stores'; import * as types from '~/monitoring/stores/mutation_types'; import { GlDeprecatedDropdownItem, GlSearchBoxByType, GlLoadingIcon } from '@gitlab/ui'; +import DateTimePicker from '~/vue_shared/components/date_time_picker/date_time_picker.vue'; +import RefreshButton from '~/monitoring/components/refresh_button.vue'; import DashboardHeader from '~/monitoring/components/dashboard_header.vue'; import DashboardsDropdown from '~/monitoring/components/dashboards_dropdown.vue'; import DuplicateDashboardModal from '~/monitoring/components/duplicate_dashboard_modal.vue'; @@ -35,6 +37,9 @@ describe('Dashboard header', () => { const findEnvsDropdownSearchMsg = () => wrapper.find({ ref: 'monitorEnvironmentsDropdownMsg' }); const findEnvsDropdownLoadingIcon = () => findEnvsDropdown().find(GlLoadingIcon); + const findDateTimePicker = () => wrapper.find(DateTimePicker); + const findRefreshButton = () => wrapper.find(RefreshButton); + const findActionsMenu = () => wrapper.find('[data-testid="actions-menu"]'); const findCreateDashboardMenuItem = () => findActionsMenu().find('[data-testid="action-create-dashboard"]'); @@ -205,6 +210,59 @@ describe('Dashboard header', () => { }); }); + describe('date time picker', () => { + beforeEach(() => { + createShallowWrapper(); + }); + + it('is rendered', () => { + expect(findDateTimePicker().exists()).toBe(true); + }); + + describe('timezone setting', () => { + const setupWithTimezone = value => { + store = createStore({ dashboardTimezone: value }); + createShallowWrapper(); + }; + + describe('local timezone is enabled by default', () => { + it('shows the data time picker in local timezone', () => { + expect(findDateTimePicker().props('utc')).toBe(false); + }); + }); + + describe('when LOCAL timezone is enabled', () => { + beforeEach(() => { + setupWithTimezone('LOCAL'); + }); + + it('shows the data time picker in local timezone', () => { + expect(findDateTimePicker().props('utc')).toBe(false); + }); + }); + + describe('when UTC timezone is enabled', () => { + beforeEach(() => { + setupWithTimezone('UTC'); + }); + + it('shows the data time picker in UTC format', () => { + expect(findDateTimePicker().props('utc')).toBe(true); + }); + }); + }); + }); + + describe('refresh button', () => { + beforeEach(() => { + createShallowWrapper(); + }); + + it('is rendered', () => { + expect(findRefreshButton().exists()).toBe(true); + }); + }); + describe('when a dashboard has been duplicated in the duplicate dashboard modal', () => { beforeEach(() => { store.state.monitoringDashboard.projectPath = 'root/sandbox'; diff --git a/spec/frontend/monitoring/components/dashboard_spec.js b/spec/frontend/monitoring/components/dashboard_spec.js index 66a894b1479..85497ccec40 100644 --- a/spec/frontend/monitoring/components/dashboard_spec.js +++ b/spec/frontend/monitoring/components/dashboard_spec.js @@ -10,8 +10,6 @@ import { dashboardEmptyStates, metricStates } from '~/monitoring/constants'; import Dashboard from '~/monitoring/components/dashboard.vue'; import DashboardHeader from '~/monitoring/components/dashboard_header.vue'; -import RefreshButton from '~/monitoring/components/refresh_button.vue'; -import DateTimePicker from '~/vue_shared/components/date_time_picker/date_time_picker.vue'; import CustomMetricsFormFields from '~/custom_metrics/components/custom_metrics_form_fields.vue'; import EmptyState from '~/monitoring/components/empty_state.vue'; import GroupEmptyState from '~/monitoring/components/group_empty_state.vue'; @@ -449,7 +447,7 @@ describe('Dashboard', () => { }); describe('star dashboards', () => { - const findToggleStar = () => wrapper.find(DashboardHeader).find({ ref: 'toggleStarBtn' }); + const findToggleStar = () => findDashboardHeader().find({ ref: 'toggleStarBtn' }); const findToggleStarIcon = () => findToggleStar().find(GlIcon); beforeEach(() => { @@ -527,28 +525,6 @@ describe('Dashboard', () => { }); }); - it('renders the datetimepicker dropdown', () => { - createMountedWrapper({ hasMetrics: true }); - - setupStoreWithData(store); - - return wrapper.vm.$nextTick().then(() => { - expect(wrapper.find(DateTimePicker).exists()).toBe(true); - }); - }); - - it('renders the refresh dashboard button', () => { - createMountedWrapper({ hasMetrics: true }); - - setupStoreWithData(store); - - return wrapper.vm.$nextTick().then(() => { - const refreshBtn = wrapper.find(DashboardHeader).find(RefreshButton); - - expect(refreshBtn.exists()).toBe(true); - }); - }); - describe('variables section', () => { beforeEach(() => { createShallowWrapper({ hasMetrics: true }); @@ -806,57 +782,6 @@ describe('Dashboard', () => { }); }); - describe('dashboard timezone', () => { - const setupWithTimezone = value => { - store = createStore({ dashboardTimezone: value }); - setupStoreWithData(store); - createShallowWrapper({ hasMetrics: true }); - return wrapper.vm.$nextTick; - }; - - describe('local timezone is enabled by default', () => { - beforeEach(() => { - return setupWithTimezone(); - }); - - it('shows the data time picker in local timezone', () => { - expect( - findDashboardHeader() - .find(DateTimePicker) - .props('utc'), - ).toBe(false); - }); - }); - - describe('when LOCAL timezone is enabled', () => { - beforeEach(() => { - return setupWithTimezone('LOCAL'); - }); - - it('shows the data time picker in local timezone', () => { - expect( - findDashboardHeader() - .find(DateTimePicker) - .props('utc'), - ).toBe(false); - }); - }); - - describe('when UTC timezone is enabled', () => { - beforeEach(() => { - return setupWithTimezone('UTC'); - }); - - it('shows the data time picker in UTC format', () => { - expect( - findDashboardHeader() - .find(DateTimePicker) - .props('utc'), - ).toBe(true); - }); - }); - }); - describe('cluster health', () => { beforeEach(() => { createShallowWrapper({ hasMetrics: true, showHeader: false }); @@ -1039,7 +964,7 @@ describe('Dashboard', () => { }); describe('add custom metrics', () => { - const findAddMetricButton = () => wrapper.find(DashboardHeader).find({ ref: 'addMetricBtn' }); + const findAddMetricButton = () => findDashboardHeader().find({ ref: 'addMetricBtn' }); describe('when not available', () => { beforeEach(() => { |