diff options
25 files changed, 93 insertions, 85 deletions
diff --git a/.gitlab/ci/qa-common/main.gitlab-ci.yml b/.gitlab/ci/qa-common/main.gitlab-ci.yml index e729e2d354e..836f1559264 100644 --- a/.gitlab/ci/qa-common/main.gitlab-ci.yml +++ b/.gitlab/ci/qa-common/main.gitlab-ci.yml @@ -15,7 +15,7 @@ include: gitlab_auth_token_variable_name: "PROJECT_TOKEN_FOR_CI_SCRIPTS_API_USAGE" allure_job_name: "${QA_RUN_TYPE}" - project: gitlab-org/quality/pipeline-common - ref: 8.1.1 + ref: 8.2.0 file: - /ci/base.gitlab-ci.yml - /ci/knapsack-report.yml diff --git a/app/assets/javascripts/content_editor/extensions/copy_paste.js b/app/assets/javascripts/content_editor/extensions/copy_paste.js index d29a407c5ca..23f2da7bc28 100644 --- a/app/assets/javascripts/content_editor/extensions/copy_paste.js +++ b/app/assets/javascripts/content_editor/extensions/copy_paste.js @@ -149,21 +149,26 @@ export default Extension.create({ const { clipboardData } = event; const gfmContent = clipboardData.getData(GFM_FORMAT); - - if (gfmContent) { - return this.editor.commands.pasteContent(gfmContent, true); - } - const textContent = clipboardData.getData(TEXT_FORMAT); const htmlContent = clipboardData.getData(HTML_FORMAT); const { from, to } = view.state.selection; + const isCodeBlockActive = CODE_BLOCK_NODE_TYPES.some((type) => + this.editor.isActive(type), + ); - if (pasteRaw) { - this.editor.commands.insertContentAt( - { from, to }, - textContent.replace(/^\s+|\s+$/gm, ''), - ); + if (pasteRaw || isCodeBlockActive) { + const isMarkdownCodeBlockActive = this.editor.isActive(CodeBlockHighlight.name, { + language: 'markdown', + }); + + const contentToInsert = isMarkdownCodeBlockActive + ? gfmContent || textContent + : textContent.replace(/^\s+|\s+$/gm, ''); + + if (!contentToInsert) return false; + + this.editor.commands.insertContentAt({ from, to }, contentToInsert); return true; } @@ -172,11 +177,6 @@ export default Extension.create({ const vsCodeMeta = hasVsCode ? JSON.parse(clipboardData.getData(VS_CODE_FORMAT)) : {}; const language = vsCodeMeta.mode; - // if a code block is active, paste as plain text - if (!textContent || CODE_BLOCK_NODE_TYPES.some((type) => this.editor.isActive(type))) { - return false; - } - if (hasVsCode) { return this.editor.commands.pasteContent( language === 'markdown' ? textContent : `\`\`\`${language}\n${textContent}\n\`\`\``, @@ -184,6 +184,10 @@ export default Extension.create({ ); } + if (gfmContent) { + return this.editor.commands.pasteContent(gfmContent, true); + } + const preStartRegex = /^<pre[^>]*lang="markdown"[^>]*>/; const preEndRegex = /<\/pre>$/; const htmlContentWithoutMeta = htmlContent?.replace(/^<meta[^>]*>/, ''); diff --git a/doc/administration/backup_restore/backup_gitlab.md b/doc/administration/backup_restore/backup_gitlab.md index cf653b108ef..f38358810e3 100644 --- a/doc/administration/backup_restore/backup_gitlab.md +++ b/doc/administration/backup_restore/backup_gitlab.md @@ -1843,9 +1843,9 @@ Truncate the file names in the `uploads` table: SELECT u.id, u.path, - -- Current filename + -- Current file name (regexp_match(u.path, '[^\\/:*?"<>|\r\n]+$'))[1] AS current_filename, - -- New filename + -- New file name CONCAT( LEFT(SPLIT_PART((regexp_match(u.path, '[^\\/:*?"<>|\r\n]+$'))[1], '.', 1), 242), COALESCE(SUBSTRING((regexp_match(u.path, '[^\\/:*?"<>|\r\n]+$'))[1] FROM '\.(?:.(?!\.))+$')) @@ -1875,8 +1875,8 @@ Truncate the file names in the `uploads` table: Where: - - `current_filename`: a filename that is currently more than 246 characters long. - - `new_filename`: a filename that has been truncated to 246 characters maximum. + - `current_filename`: a file name that is currently more than 246 characters long. + - `new_filename`: a file name that has been truncated to 246 characters maximum. - `new_path`: new path considering the `new_filename` (truncated). After you validate the batch results, you must change the batch size (`row_id`) using the following sequence of numbers (10000 to 20000). Repeat this process until you reach the last record in the `uploads` table. diff --git a/doc/administration/monitoring/prometheus/index.md b/doc/administration/monitoring/prometheus/index.md index a1d31377901..bd3f2a20006 100644 --- a/doc/administration/monitoring/prometheus/index.md +++ b/doc/administration/monitoring/prometheus/index.md @@ -102,7 +102,7 @@ prometheus['scrape_configs'] = [ 'metrics_path': '/probe', 'params' => { 'param_a' => ['test'], - 'param_b' => ['additional_test'] + 'param_b' => ['additional_test'], }, 'static_configs' => [ 'targets' => ['1.1.1.1:8060'], @@ -240,7 +240,7 @@ To use an external Prometheus server: nginx['status']['options'] = { "server_tokens" => "off", "access_log" => "off", - "allow" => ["192.168.0.1", "192.168.0.2"] + "allow" => ["192.168.0.1", "192.168.0.2"], "deny" => "all", } ``` diff --git a/doc/api/packages/debian.md b/doc/api/packages/debian.md index 4a4a4f0bddd..30ac9175feb 100644 --- a/doc/api/packages/debian.md +++ b/doc/api/packages/debian.md @@ -94,7 +94,7 @@ GET projects/:id/packages/debian/pool/:distribution/:letter/:package_name/:packa | `letter` | string | yes | The Debian Classification (first-letter or lib-first-letter). | | `package_name` | string | yes | The source package name. | | `package_version` | string | yes | The source package version. | -| `file_name` | string | yes | The filename. | +| `file_name` | string | yes | The file name. | ```shell curl --header "Private-Token: <personal_access_token>" "https://gitlab.example.com/api/v4/projects/1/packages/debian/pool/my-distro/a/my-pkg/1.0.0/example_1.0.0~alpha2_amd64.deb" @@ -108,7 +108,7 @@ curl --header "Private-Token: <personal_access_token>" \ --remote-name ``` -This writes the downloaded file using the remote filename in the current directory. +This writes the downloaded file using the remote file name in the current directory. ## Route prefix @@ -166,7 +166,7 @@ curl --header "Private-Token: <personal_access_token>" \ --remote-name ``` -This writes the downloaded file using the remote filename in the current directory. +This writes the downloaded file using the remote file name in the current directory. ## Download a signed distribution Release file @@ -194,7 +194,7 @@ curl --header "Private-Token: <personal_access_token>" \ --remote-name ``` -This writes the downloaded file using the remote filename in the current directory. +This writes the downloaded file using the remote file name in the current directory. ## Download a release file signature @@ -222,7 +222,7 @@ curl --header "Private-Token: <personal_access_token>" \ --remote-name ``` -This writes the downloaded file using the remote filename in the current directory. +This writes the downloaded file using the remote file name in the current directory. ## Download a packages index @@ -252,7 +252,7 @@ curl --header "Private-Token: <personal_access_token>" \ --remote-name ``` -This writes the downloaded file using the remote filename in the current directory. +This writes the downloaded file using the remote file name in the current directory. ## Download a packages index by hash @@ -283,7 +283,7 @@ curl --header "Private-Token: <personal_access_token>" \ --remote-name ``` -This writes the downloaded file using the remote filename in the current directory. +This writes the downloaded file using the remote file name in the current directory. ## Download a Debian Installer packages index @@ -313,7 +313,7 @@ curl --header "Private-Token: <personal_access_token>" \ --remote-name ``` -This writes the downloaded file using the remote filename in the current directory. +This writes the downloaded file using the remote file name in the current directory. ## Download a Debian Installer packages index by hash @@ -343,7 +343,7 @@ curl --header "Private-Token: <personal_access_token>" \ --remote-name ``` -This writes the downloaded file using the remote filename in the current directory. +This writes the downloaded file using the remote file name in the current directory. ## Download a source packages index @@ -372,7 +372,7 @@ curl --header "Private-Token: <personal_access_token>" \ --remote-name ``` -This writes the downloaded file using the remote filename in the current directory. +This writes the downloaded file using the remote file name in the current directory. ## Download a source packages index by hash @@ -401,4 +401,4 @@ curl --header "Private-Token: <personal_access_token>" \ --remote-name ``` -This writes the downloaded file using the remote filename in the current directory. +This writes the downloaded file using the remote file name in the current directory. diff --git a/doc/api/packages/helm.md b/doc/api/packages/helm.md index 11b94928905..f4c5b315f24 100644 --- a/doc/api/packages/helm.md +++ b/doc/api/packages/helm.md @@ -63,7 +63,7 @@ GET projects/:id/packages/helm/:channel/charts/:file_name.tgz | ----------- | ------ | -------- | ----------- | | `id` | string | yes | The ID or full path of the project. | | `channel` | string | yes | Helm repository channel. | -| `file_name` | string | yes | Chart filename. | +| `file_name` | string | yes | Chart file name. | ```shell curl --user <username>:<personal_access_token> \ diff --git a/doc/api/packages/pypi.md b/doc/api/packages/pypi.md index a77dd596cb3..ee4ae4fff66 100644 --- a/doc/api/packages/pypi.md +++ b/doc/api/packages/pypi.md @@ -152,7 +152,7 @@ GET projects/:id/packages/pypi/files/:sha256/:file_identifier | --------- | ---- | -------- | ----------- | | `id` | string | yes | The ID or full path of the project. | | `sha256` | string | yes | PyPI package file sha256 check sum. | -| `file_identifier` | string | yes | The PyPI package filename. | +| `file_identifier` | string | yes | The PyPI package file name. | ```shell curl --user <username>:<personal_access_token> "https://gitlab.example.com/api/v4/projects/1/packages/pypi/files/5y57017232013c8ac80647f4ca153k3726f6cba62d055cd747844ed95b3c65ff/my.pypi.package-0.0.1.tar.gz" diff --git a/doc/architecture/blueprints/ci_pipeline_components/index.md b/doc/architecture/blueprints/ci_pipeline_components/index.md index 681f5db5fae..9a225c9cd97 100644 --- a/doc/architecture/blueprints/ci_pipeline_components/index.md +++ b/doc/architecture/blueprints/ci_pipeline_components/index.md @@ -189,7 +189,7 @@ a file `mydir/file.yml` in `gitlab-org/dast` project would be expanded to: gitlab.com/gitlab-org/dast/mydir/path/to/component@<CURRENT_SHA> ``` -The component YAML file follows the filename convention `<type>.yml` where component type is one of: +The component YAML file follows the file name convention `<type>.yml` where component type is one of: | Component type | Context | | -------------- | ------- | @@ -206,7 +206,7 @@ For example: A component YAML file: - Must have a **name** to be referenced to. -- Must specify its **type** in the filename, which defines how it can be used (raw configuration to be `include`d, child pipeline workflow, job step). +- Must specify its **type** in the file name, which defines how it can be used (raw configuration to be `include`d, child pipeline workflow, job step). - Must define its **content** based on the type. - Must specify **input parameters** that it accepts. Components should depend on input parameters for dynamic values and not environment variables. - Should be **validated statically** (for example: using JSON schema validators). diff --git a/doc/ci/cloud_deployment/index.md b/doc/ci/cloud_deployment/index.md index b0482c6c3d9..14149aa6446 100644 --- a/doc/ci/cloud_deployment/index.md +++ b/doc/ci/cloud_deployment/index.md @@ -101,7 +101,7 @@ To deploy to your ECS cluster: | `CI_AWS_ECS_CLUSTER` | The name of the AWS ECS cluster that you're targeting for your deployments. | | `CI_AWS_ECS_SERVICE` | The name of the targeted service tied to your AWS ECS cluster. Ensure that this variable is scoped to the appropriate environment (`production`, `staging`, `review/*`). | | `CI_AWS_ECS_TASK_DEFINITION` | If the task definition is in ECS, the name of the task definition tied to the service. | - | `CI_AWS_ECS_TASK_DEFINITION_FILE` | If the task definition is a JSON file in GitLab, the filename, including the path. For example, `ci/aws/my_task_definition.json`. If the name of the task definition in your JSON file is the same name as an existing task definition in ECS, then a new revision is created when CI/CD runs. Otherwise, a brand new task definition is created, starting at revision 1. | + | `CI_AWS_ECS_TASK_DEFINITION_FILE` | If the task definition is a JSON file in GitLab, the file name, including the path. For example, `ci/aws/my_task_definition.json`. If the name of the task definition in your JSON file is the same name as an existing task definition in ECS, then a new revision is created when CI/CD runs. Otherwise, a brand new task definition is created, starting at revision 1. | WARNING: If you define both `CI_AWS_ECS_TASK_DEFINITION_FILE` and `CI_AWS_ECS_TASK_DEFINITION`, diff --git a/doc/ci/jobs/job_artifacts_troubleshooting.md b/doc/ci/jobs/job_artifacts_troubleshooting.md index 3145ea46f4c..0b7777d2d82 100644 --- a/doc/ci/jobs/job_artifacts_troubleshooting.md +++ b/doc/ci/jobs/job_artifacts_troubleshooting.md @@ -29,7 +29,7 @@ If job artifacts are using too much disk space, see the This message appears in job logs when a the runner can't find the file to upload. Either the path to the file is incorrect, or the file was not created. You can check the job -log for other errors or warnings that specify the filename and why it wasn't +log for other errors or warnings that specify the file name and why it wasn't generated. For more detailed job logs, you can [enable CI/CD debug logging](../variables/index.md#enable-debug-logging) diff --git a/doc/ci/pipelines/settings.md b/doc/ci/pipelines/settings.md index 22ff98fe449..09bfe3ac195 100644 --- a/doc/ci/pipelines/settings.md +++ b/doc/ci/pipelines/settings.md @@ -125,14 +125,14 @@ To change the permissions to cancel pipelines or jobs: > Support for external `.gitlab-ci.yml` locations [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/14376) in GitLab 12.6. GitLab expects to find the CI/CD configuration file (`.gitlab-ci.yml`) in the project's root -directory. However, you can specify an alternate filename path, including locations outside the project. +directory. However, you can specify an alternate file name path, including locations outside the project. To customize the path: 1. On the left sidebar, select **Search or go to** and find your project. 1. Select **Settings > CI/CD**. 1. Expand **General pipelines**. -1. In the **CI/CD configuration file** field, enter the filename. If the file: +1. In the **CI/CD configuration file** field, enter the file name. If the file: - Is not in the root directory, include the path. - Is in a different project, include the group and project name. - Is on an external site, enter the full URL. diff --git a/doc/ci/runners/configure_runners.md b/doc/ci/runners/configure_runners.md index aded5cd9abd..3b21d865d8b 100644 --- a/doc/ci/runners/configure_runners.md +++ b/doc/ci/runners/configure_runners.md @@ -910,7 +910,7 @@ variables: NOTE: Zip archives are the only supported artifact type. Follow [the issue for details](https://gitlab.com/gitlab-org/gitlab/-/issues/367203). -GitLab Runner can generate and produce attestation metadata for all build artifacts. To enable this feature, you must set the `RUNNER_GENERATE_ARTIFACTS_METADATA` environment variable to `true`. This variable can either be set globally or it can be set for individual jobs. The metadata is in rendered in a plain text `.json` file that's stored with the artifact. The filename is as follows: `{ARTIFACT_NAME}-metadata.json` where `ARTIFACT_NAME` is what was defined as the [name for the artifact](../jobs/job_artifacts.md#with-a-dynamically-defined-name) in the CI file. The filename, however, defaults to `artifacts-metadata.json` if no name was given to the build artifacts. +GitLab Runner can generate and produce attestation metadata for all build artifacts. To enable this feature, you must set the `RUNNER_GENERATE_ARTIFACTS_METADATA` environment variable to `true`. This variable can either be set globally or it can be set for individual jobs. The metadata is in rendered in a plain text `.json` file that's stored with the artifact. The file name is as follows: `{ARTIFACT_NAME}-metadata.json` where `ARTIFACT_NAME` is what was defined as the [name for the artifact](../jobs/job_artifacts.md#with-a-dynamically-defined-name) in the CI file. The file name, however, defaults to `artifacts-metadata.json` if no name was given to the build artifacts. ### Attestation format @@ -919,7 +919,7 @@ The attestation metadata is generated in the [in-toto attestation format](https: | Field | Value | | ------ | ------ | | `_type` | `https://in-toto.io/Statement/v0.1` | -| `subject.name` | The filename of the artifact. | +| `subject.name` | The file name of the artifact. | | `subject.digest.sha256` | The artifact's `sha256` checksum. | | `predicateType` | `https://slsa.dev/provenance/v0.2` | | `predicate.buildType` | `https://gitlab.com/gitlab-org/gitlab-runner/-/blob/{GITLAB_RUNNER_VERSION}/PROVENANCE.md`. For example v15.0.0 | diff --git a/doc/ci/testing/code_quality.md b/doc/ci/testing/code_quality.md index 4155666ca24..23ae615eeb2 100644 --- a/doc/ci/testing/code_quality.md +++ b/doc/ci/testing/code_quality.md @@ -552,7 +552,7 @@ You should configure Code Quality checks to run on your worker as documented in A common issue is that the terms `Code Quality` (GitLab specific) and `Code Climate` (Engine used by GitLab) are very similar. You must add a **`.codeclimate.yml`** file to change the default configuration, **not** a `.codequality.yml` file. If you use -the wrong filename, the [default `.codeclimate.yml`](https://gitlab.com/gitlab-org/ci-cd/codequality/-/blob/master/codeclimate_defaults/.codeclimate.yml.template) +the wrong file name, the [default `.codeclimate.yml`](https://gitlab.com/gitlab-org/ci-cd/codequality/-/blob/master/codeclimate_defaults/.codeclimate.yml.template) is still used. ### No Code Quality report is displayed in a merge request diff --git a/doc/integration/mattermost/index.md b/doc/integration/mattermost/index.md index e08a8e4a210..689b9305dac 100644 --- a/doc/integration/mattermost/index.md +++ b/doc/integration/mattermost/index.md @@ -359,7 +359,7 @@ Below is a list of Mattermost version changes for GitLab 14.0 and later: | GitLab version | Mattermost version | Notes | | :------------- | :----------------- | ---------------------------------------------------------------------------------------- | -| 16.7 | 9.2 | | +| 16.7 | 9.3 | | | 16.6 | 9.1 | | | 16.5 | 9.0 | | | 16.4 | 8.1 | | diff --git a/package.json b/package.json index bf04ee43de5..40cd531113a 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "@gitlab/favicon-overlay": "2.0.0", "@gitlab/fonts": "^1.3.0", "@gitlab/svgs": "3.72.0", - "@gitlab/ui": "^71.11.0", + "@gitlab/ui": "^71.11.1", "@gitlab/visual-review-tools": "1.7.3", "@gitlab/web-ide": "^0.0.1-dev-20231211152737", "@mattiasbuelens/web-streams-adapter": "^0.1.0", diff --git a/spec/frontend/ci/runner/components/runner_managers_detail_spec.js b/spec/frontend/ci/runner/components/runner_managers_detail_spec.js index 3435292394f..6db9bb1d091 100644 --- a/spec/frontend/ci/runner/components/runner_managers_detail_spec.js +++ b/spec/frontend/ci/runner/components/runner_managers_detail_spec.js @@ -85,7 +85,7 @@ describe('RunnerJobs', () => { }); it('is collapsed', () => { - expect(findCollapse().attributes('visible')).toBeUndefined(); + expect(findCollapse().props('visible')).toBe(false); }); describe('when expanded', () => { @@ -99,7 +99,7 @@ describe('RunnerJobs', () => { }); it('shows loading state', () => { - expect(findCollapse().attributes('visible')).toBe('true'); + expect(findCollapse().props('visible')).toBe(true); expect(findSkeletonLoader().exists()).toBe(true); }); @@ -156,14 +156,14 @@ describe('RunnerJobs', () => { }); it('shows rows', () => { - expect(findCollapse().attributes('visible')).toBe('true'); + expect(findCollapse().props('visible')).toBe(true); expect(findRunnerManagersTable().props('items')).toEqual(mockRunnerManagers); }); it('collapses when clicked', async () => { await findHideDetails().trigger('click'); - expect(findCollapse().attributes('visible')).toBeUndefined(); + expect(findCollapse().props('visible')).toBe(false); }); }); }); diff --git a/spec/frontend/clusters/agents/components/integration_status_spec.js b/spec/frontend/clusters/agents/components/integration_status_spec.js index 28a59391578..0f3da3e02be 100644 --- a/spec/frontend/clusters/agents/components/integration_status_spec.js +++ b/spec/frontend/clusters/agents/components/integration_status_spec.js @@ -58,7 +58,7 @@ describe('IntegrationStatus', () => { }); it('sets collapse component as invisible by default', () => { - expect(findCollapse().props('visible')).toBeUndefined(); + expect(findCollapse().props('visible')).toBe(false); }); }); @@ -73,7 +73,7 @@ describe('IntegrationStatus', () => { }); it('sets collapse component as visible', () => { - expect(findCollapse().attributes('visible')).toBe('true'); + expect(findCollapse().props('visible')).toBe(true); }); }); diff --git a/spec/frontend/content_editor/extensions/copy_paste_spec.js b/spec/frontend/content_editor/extensions/copy_paste_spec.js index e290b4e5137..6969f4985a1 100644 --- a/spec/frontend/content_editor/extensions/copy_paste_spec.js +++ b/spec/frontend/content_editor/extensions/copy_paste_spec.js @@ -20,12 +20,6 @@ import waitForPromises from 'helpers/wait_for_promises'; import MarkdownSerializer from '~/content_editor/services/markdown_serializer'; import { createTestEditor, createDocBuilder, waitUntilNextDocTransaction } from '../test_utils'; -const CODE_BLOCK_HTML = '<pre class="js-syntax-highlight" lang="javascript">var a = 2;</pre>'; -const CODE_SUGGESTION_HTML = - '<pre data-lang-params="-0+0" class="js-syntax-highlight language-suggestion" lang="suggestion">Suggested code</pre>'; -const DIAGRAM_HTML = - '<img data-diagram="nomnoml" data-diagram-src="data:text/plain;base64,WzxmcmFtZT5EZWNvcmF0b3IgcGF0dGVybl0=">'; -const FRONTMATTER_HTML = '<pre lang="yaml" data-lang-params="frontmatter">key: value</pre>'; const PARAGRAPH_HTML = '<p dir="auto">Some text with <strong>bold</strong> and <em>italic</em> text.</p>'; @@ -123,19 +117,6 @@ describe('content_editor/extensions/copy_paste', () => { expect(await triggerPasteEventHandler(buildClipboardEvent({ types, data }))).toBe(true); }); - it.each` - nodeType | html | handled | desc - ${'codeBlock'} | ${CODE_BLOCK_HTML} | ${false} | ${'does not handle'} - ${'codeSuggestion'} | ${CODE_SUGGESTION_HTML} | ${false} | ${'does not handle'} - ${'diagram'} | ${DIAGRAM_HTML} | ${false} | ${'does not handle'} - ${'frontmatter'} | ${FRONTMATTER_HTML} | ${false} | ${'does not handle'} - ${'paragraph'} | ${PARAGRAPH_HTML} | ${true} | ${'handles'} - `('$desc paste if currently a `$nodeType` is in focus', async ({ html, handled }) => { - tiptapEditor.commands.insertContent(html); - - expect(await triggerPasteEventHandler(buildClipboardEvent())).toBe(handled); - }); - describe.each` eventName | expectedDoc ${'cut'} | ${() => doc(p())} diff --git a/spec/frontend/environments/deploy_board_wrapper_spec.js b/spec/frontend/environments/deploy_board_wrapper_spec.js index 49eed68fa11..fec5032e31b 100644 --- a/spec/frontend/environments/deploy_board_wrapper_spec.js +++ b/spec/frontend/environments/deploy_board_wrapper_spec.js @@ -56,7 +56,7 @@ describe('~/environments/components/deploy_board_wrapper.vue', () => { }); it('is collapsed by default', () => { - expect(collapse.attributes('visible')).toBeUndefined(); + expect(collapse.props('visible')).toBe(false); expect(icon.props('name')).toBe('chevron-lg-right'); }); @@ -64,7 +64,7 @@ describe('~/environments/components/deploy_board_wrapper.vue', () => { const button = await expandCollapsedSection(); expect(button.attributes('aria-label')).toBe(__('Collapse')); - expect(collapse.attributes('visible')).toBe('visible'); + expect(collapse.props('visible')).toBe(true); expect(icon.props('name')).toBe('chevron-lg-down'); const deployBoard = findDeployBoard(); diff --git a/spec/frontend/environments/environment_folder_spec.js b/spec/frontend/environments/environment_folder_spec.js index 1973613897d..e21e0f280ec 100644 --- a/spec/frontend/environments/environment_folder_spec.js +++ b/spec/frontend/environments/environment_folder_spec.js @@ -79,7 +79,7 @@ describe('~/environments/components/environments_folder.vue', () => { it('is collapsed by default', () => { const link = findLink(); - expect(collapse.attributes('visible')).toBeUndefined(); + expect(collapse.props('visible')).toBe(false); const iconNames = icons.wrappers.map((i) => i.props('name')).slice(0, 2); expect(iconNames).toEqual(['chevron-lg-right', 'folder-o']); expect(folderName.classes('gl-font-weight-bold')).toBe(false); @@ -96,7 +96,7 @@ describe('~/environments/components/environments_folder.vue', () => { const link = findLink(); expect(button.attributes('aria-label')).toBe(__('Collapse')); - expect(collapse.attributes('visible')).toBe('visible'); + expect(collapse.props('visible')).toBe(true); const iconNames = icons.wrappers.map((i) => i.props('name')).slice(0, 2); expect(iconNames).toEqual(['chevron-lg-down', 'folder-open']); expect(folderName.classes('gl-font-weight-bold')).toBe(true); diff --git a/spec/frontend/environments/kubernetes_overview_spec.js b/spec/frontend/environments/kubernetes_overview_spec.js index 9f4a7518c47..e00cabd1066 100644 --- a/spec/frontend/environments/kubernetes_overview_spec.js +++ b/spec/frontend/environments/kubernetes_overview_spec.js @@ -74,7 +74,7 @@ describe('~/environments/components/kubernetes_overview.vue', () => { }); it('is collapsed by default', () => { - expect(findCollapse().props('visible')).toBeUndefined(); + expect(findCollapse().props('visible')).toBe(false); expect(findCollapseButton().attributes('aria-label')).toBe(KubernetesOverview.i18n.expand); expect(findCollapseButton().props('icon')).toBe('chevron-right'); }); @@ -88,7 +88,7 @@ describe('~/environments/components/kubernetes_overview.vue', () => { findCollapseButton().vm.$emit('click'); await nextTick(); - expect(findCollapse().attributes('visible')).toBe('true'); + expect(findCollapse().props('visible')).toBe(true); expect(findCollapseButton().attributes('aria-label')).toBe(KubernetesOverview.i18n.collapse); expect(findCollapseButton().props('icon')).toBe('chevron-down'); }); diff --git a/spec/frontend/environments/new_environment_item_spec.js b/spec/frontend/environments/new_environment_item_spec.js index e586bbfc59d..552c44fe197 100644 --- a/spec/frontend/environments/new_environment_item_spec.js +++ b/spec/frontend/environments/new_environment_item_spec.js @@ -382,7 +382,7 @@ describe('~/environments/components/new_environment_item.vue', () => { }); it('is collapsed by default', () => { - expect(collapse.attributes('visible')).toBeUndefined(); + expect(collapse.props('visible')).toBe(false); expect(icon.props('name')).toBe('chevron-lg-right'); expect(environmentName.classes('gl-font-weight-bold')).toBe(false); }); @@ -394,7 +394,7 @@ describe('~/environments/components/new_environment_item.vue', () => { expect(button.attributes('aria-label')).toBe(__('Collapse')); expect(button.props('category')).toBe('secondary'); - expect(collapse.attributes('visible')).toBe('visible'); + expect(collapse.props('visible')).toBe(true); expect(icon.props('name')).toBe('chevron-lg-down'); expect(environmentName.classes('gl-font-weight-bold')).toBe(true); expect(findDeployment().isVisible()).toBe(true); diff --git a/spec/frontend/vue_merge_request_widget/components/mr_widget_expandable_section_spec.js b/spec/frontend/vue_merge_request_widget/components/mr_widget_expandable_section_spec.js index 8eaed998eb5..5a5d29d3194 100644 --- a/spec/frontend/vue_merge_request_widget/components/mr_widget_expandable_section_spec.js +++ b/spec/frontend/vue_merge_request_widget/components/mr_widget_expandable_section_spec.js @@ -39,7 +39,7 @@ describe('MrWidgetExpanableSection', () => { const collapse = findCollapse(); expect(collapse.exists()).toBe(true); - expect(collapse.attributes('visible')).toBeUndefined(); + expect(collapse.props('visible')).toBe(false); }); }); @@ -60,7 +60,7 @@ describe('MrWidgetExpanableSection', () => { const collapse = findCollapse(); expect(collapse.exists()).toBe(true); - expect(collapse.attributes('visible')).toBe('true'); + expect(collapse.props('visible')).toBe(true); }); }); }); diff --git a/spec/support/shared_examples/features/content_editor_shared_examples.rb b/spec/support/shared_examples/features/content_editor_shared_examples.rb index 0a71658c9e7..d0b2d0c9cae 100644 --- a/spec/support/shared_examples/features/content_editor_shared_examples.rb +++ b/spec/support/shared_examples/features/content_editor_shared_examples.rb @@ -449,6 +449,9 @@ RSpec.shared_examples 'edits content using the content editor' do |params = { before do switch_to_content_editor + type_in_content_editor [modifier_key, 'a'] + type_in_content_editor :delete + type_in_content_editor "Some **rich** _text_ ~~content~~ [link](https://gitlab.com)" type_in_content_editor [modifier_key, 'a'] @@ -488,6 +491,26 @@ RSpec.shared_examples 'edits content using the content editor' do |params = { end end + it 'pastes raw markdown with formatting when pasting inside a markdown code block' do + type_in_content_editor '```md' + type_in_content_editor :enter + type_in_content_editor [modifier_key, 'v'] + + page.within content_editor_testid do + expect(page).to have_selector('pre', text: 'Some **rich** _text_ ~~content~~ [link](https://gitlab.com)') + end + end + + it 'pastes raw markdown without formatting when pasting inside a plaintext code block' do + type_in_content_editor '```' + type_in_content_editor :enter + type_in_content_editor [modifier_key, 'v'] + + page.within content_editor_testid do + expect(page).to have_selector('pre', text: 'Some rich text content link') + end + end + it 'pastes raw text without formatting, stripping whitespaces, if shift + ctrl + v is pressed' do type_in_content_editor " Some **rich**" type_in_content_editor :enter diff --git a/yarn.lock b/yarn.lock index 2f396efe5e9..2b12f06abe5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1274,10 +1274,10 @@ resolved "https://registry.yarnpkg.com/@gitlab/svgs/-/svgs-3.72.0.tgz#5daaa7366913b52ea89439305067e030f967c8a5" integrity sha512-VbSdwXxu9Y6NAXNFTROjZa83e2b8QeDAO7byqjJ0z+2Y3gGGXdw+HclAzz0Ns8B0+DMV5mV7dtmTlv/1xAXXYQ== -"@gitlab/ui@^71.11.0": - version "71.11.0" - resolved "https://registry.yarnpkg.com/@gitlab/ui/-/ui-71.11.0.tgz#08826d0bd2f6fdc3c4d447e0ba2718d70651d753" - integrity sha512-qM7VALWrEMxaoA3ij1D52+fjwWaCs46sdRf+Pm0heLMezj9dWr5AE/ojUV5tLVTvHa7EaiDLsAcxDf0vPdIchQ== +"@gitlab/ui@^71.11.1": + version "71.11.1" + resolved "https://registry.yarnpkg.com/@gitlab/ui/-/ui-71.11.1.tgz#8ce051fdfa6b564830b26e440fa5b394581bfbac" + integrity sha512-59JZOwDOIl3kijD3Yr6pNUUP7wvTWMltOoLm3ySbZNPozuSUVYZqMNt/LS1s/SxMODiAgmJEoOO9p3j21P2T0A== dependencies: "@floating-ui/dom" "1.2.9" bootstrap-vue "2.23.1" |