diff --git a/GITLAB_KAS_VERSION b/GITLAB_KAS_VERSION index 30fcc89d48f..65a154b8d3a 100644 --- a/GITLAB_KAS_VERSION +++ b/GITLAB_KAS_VERSION @@ -1 +1 @@ -27b3a74b0ac39329e049167a7a1d7109c344f441 +1a16fa05c2645a0abba4e2f028e1fdbe5d85be2f diff --git a/app/assets/javascripts/editor/schema/ci.json b/app/assets/javascripts/editor/schema/ci.json index 676c9fc0824..78a47f46887 100644 --- a/app/assets/javascripts/editor/schema/ci.json +++ b/app/assets/javascripts/editor/schema/ci.json @@ -256,7 +256,7 @@ }, "reports": { "type": "object", - "markdownDescription": "Reports will be uploaded as artifacts, and often displayed in the Gitlab UI, such as in Merge Requests. [Learn More](https://docs.gitlab.com/ee/ci/yaml/#artifactsreports).", + "markdownDescription": "Reports will be uploaded as artifacts, and often displayed in the Gitlab UI, such as in merge requests. [Learn More](https://docs.gitlab.com/ee/ci/yaml/#artifactsreports).", "additionalProperties": false, "properties": { "junit": { @@ -290,7 +290,8 @@ "coverage_format": { "description": "Code coverage format used by the test framework.", "enum": [ - "cobertura", "jacoco" + "cobertura", + "jacoco" ] }, "path": { diff --git a/app/assets/javascripts/ide/init_gitlab_web_ide.js b/app/assets/javascripts/ide/init_gitlab_web_ide.js index 1ade6433d63..5b99a6ecb3d 100644 --- a/app/assets/javascripts/ide/init_gitlab_web_ide.js +++ b/app/assets/javascripts/ide/init_gitlab_web_ide.js @@ -7,6 +7,7 @@ import { getOAuthConfig, setupRootElement, handleTracking, + handleUpdateUrl, } from './lib/gitlab_web_ide'; import { GITLAB_WEB_IDE_FEEDBACK_ISSUE } from './constants'; import { renderWebIdeError } from './render_web_ide_error'; @@ -84,6 +85,7 @@ export const initGitlabWebIDE = async (el) => { editorFont, extensionsGallerySettings, codeSuggestionsEnabled, + handleContextUpdate: handleUpdateUrl, handleTracking, // See https://gitlab.com/gitlab-org/gitlab-web-ide/-/blob/main/packages/web-ide-types/src/config.ts#L86 telemetryEnabled: Tracking.enabled(), diff --git a/app/assets/javascripts/ide/lib/gitlab_web_ide/handle_update_url.js b/app/assets/javascripts/ide/lib/gitlab_web_ide/handle_update_url.js new file mode 100644 index 00000000000..c27d658ce92 --- /dev/null +++ b/app/assets/javascripts/ide/lib/gitlab_web_ide/handle_update_url.js @@ -0,0 +1,28 @@ +import { joinPaths, webIDEUrl } from '~/lib/utils/url_utility'; + +function withPrevious(fn) { + let prev; + + return (arg) => { + fn(arg, prev); + prev = arg; + }; +} + +function getWebIdeUrl(projectPath, branchName) { + return webIDEUrl(joinPaths('/', projectPath, 'edit', branchName, '-/')); +} + +export const handleUpdateUrl = withPrevious(({ projectPath, ref }, previous) => { + if (!previous) { + return; + } + + if (previous.ref === ref) { + return; + } + + const newUrl = getWebIdeUrl(projectPath, ref); + + window.history.replaceState(null, '', newUrl); +}); diff --git a/app/assets/javascripts/ide/lib/gitlab_web_ide/index.js b/app/assets/javascripts/ide/lib/gitlab_web_ide/index.js index 87e0002c8c8..bdf0a3d2db4 100644 --- a/app/assets/javascripts/ide/lib/gitlab_web_ide/index.js +++ b/app/assets/javascripts/ide/lib/gitlab_web_ide/index.js @@ -2,3 +2,4 @@ export * from './get_base_config'; export * from './get_oauth_config'; export * from './handle_tracking_event'; export * from './setup_root_element'; +export * from './handle_update_url'; diff --git a/app/assets/javascripts/merge_request_dashboard/components/app.vue b/app/assets/javascripts/merge_request_dashboard/components/app.vue index 9584300db8d..7e364856ed8 100644 --- a/app/assets/javascripts/merge_request_dashboard/components/app.vue +++ b/app/assets/javascripts/merge_request_dashboard/components/app.vue @@ -25,7 +25,7 @@ export default {