diff options
Diffstat (limited to 'app/assets')
11 files changed, 24 insertions, 15 deletions
diff --git a/app/assets/javascripts/pages/projects/settings/ci_cd/show/index.js b/app/assets/javascripts/pages/projects/settings/ci_cd/show/index.js index aeeef40fc6e..e08d0407245 100644 --- a/app/assets/javascripts/pages/projects/settings/ci_cd/show/index.js +++ b/app/assets/javascripts/pages/projects/settings/ci_cd/show/index.js @@ -3,7 +3,6 @@ import SecretValues from '~/behaviors/secret_values'; import AjaxVariableList from '~/ci_variable_list/ajax_variable_list'; import registrySettingsApp from '~/registry/settings/registry_settings_bundle'; import initVariableList from '~/ci_variable_list'; -import initDeployKeys from '~/deploy_keys'; document.addEventListener('DOMContentLoaded', () => { // Initialize expandable settings panels @@ -41,5 +40,4 @@ document.addEventListener('DOMContentLoaded', () => { }); registrySettingsApp(); - initDeployKeys(); }); diff --git a/app/assets/javascripts/pages/projects/settings/repository/form.js b/app/assets/javascripts/pages/projects/settings/repository/form.js index fa6d17f0729..3e02893f24c 100644 --- a/app/assets/javascripts/pages/projects/settings/repository/form.js +++ b/app/assets/javascripts/pages/projects/settings/repository/form.js @@ -3,6 +3,7 @@ import ProtectedTagCreate from '~/protected_tags/protected_tag_create'; import ProtectedTagEditList from '~/protected_tags/protected_tag_edit_list'; import initSettingsPanels from '~/settings_panels'; +import initDeployKeys from '~/deploy_keys'; import ProtectedBranchCreate from '~/protected_branches/protected_branch_create'; import ProtectedBranchEditList from '~/protected_branches/protected_branch_edit_list'; import DueDateSelectors from '~/due_date_select'; @@ -11,6 +12,7 @@ import fileUpload from '~/lib/utils/file_upload'; export default () => { new ProtectedTagCreate(); new ProtectedTagEditList(); + initDeployKeys(); initSettingsPanels(); new ProtectedBranchCreate(); new ProtectedBranchEditList(); diff --git a/app/assets/javascripts/repository/components/breadcrumbs.vue b/app/assets/javascripts/repository/components/breadcrumbs.vue index d78b2d9d962..886e9d76cca 100644 --- a/app/assets/javascripts/repository/components/breadcrumbs.vue +++ b/app/assets/javascripts/repository/components/breadcrumbs.vue @@ -108,14 +108,14 @@ export default { return acc.concat({ name, path, - to: `/-/tree/${joinPaths(escapeFileUrl(this.ref), path)}`, + to: `/-/tree/${joinPaths(this.escapedRef, path)}`, }); }, [ { name: this.projectShortPath, path: '/', - to: `/-/tree/${escapeFileUrl(this.ref)}/`, + to: `/-/tree/${this.escapedRef}/`, }, ], ); diff --git a/app/assets/javascripts/repository/components/table/index.vue b/app/assets/javascripts/repository/components/table/index.vue index 2ba170998e8..c8549180a25 100644 --- a/app/assets/javascripts/repository/components/table/index.vue +++ b/app/assets/javascripts/repository/components/table/index.vue @@ -81,7 +81,7 @@ export default { <tbody> <parent-row v-show="showParentRow" - :commit-ref="ref" + :commit-ref="escapedRef" :path="path" :loading-path="loadingPath" /> diff --git a/app/assets/javascripts/repository/components/table/parent_row.vue b/app/assets/javascripts/repository/components/table/parent_row.vue index 0a8ee5f2fc5..b4095e00884 100644 --- a/app/assets/javascripts/repository/components/table/parent_row.vue +++ b/app/assets/javascripts/repository/components/table/parent_row.vue @@ -1,6 +1,5 @@ <script> import { GlLoadingIcon } from '@gitlab/ui'; -import { escapeFileUrl } from '~/lib/utils/url_utility'; export default { components: { @@ -29,7 +28,7 @@ export default { return splitArray.map(p => encodeURIComponent(p)).join('/'); }, parentRoute() { - return { path: `/-/tree/${escapeFileUrl(this.commitRef)}/${this.parentPath}` }; + return { path: `/-/tree/${this.commitRef}/${this.parentPath}` }; }, }, methods: { diff --git a/app/assets/javascripts/repository/components/table/row.vue b/app/assets/javascripts/repository/components/table/row.vue index 6bd1c702a82..f741a6df5d9 100644 --- a/app/assets/javascripts/repository/components/table/row.vue +++ b/app/assets/javascripts/repository/components/table/row.vue @@ -99,7 +99,7 @@ export default { computed: { routerLinkTo() { return this.isFolder - ? { path: `/-/tree/${escapeFileUrl(this.ref)}/${escapeFileUrl(this.path)}` } + ? { path: `/-/tree/${this.escapedRef}/${escapeFileUrl(this.path)}` } : null; }, isFolder() { diff --git a/app/assets/javascripts/repository/index.js b/app/assets/javascripts/repository/index.js index 05783fc3b5d..6528e283372 100644 --- a/app/assets/javascripts/repository/index.js +++ b/app/assets/javascripts/repository/index.js @@ -15,14 +15,15 @@ import { __ } from '../locale'; export default function setupVueRepositoryList() { const el = document.getElementById('js-tree-list'); const { dataset } = el; - const { projectPath, projectShortPath, ref, fullName } = dataset; - const router = createRouter(projectPath, ref); + const { projectPath, projectShortPath, ref, escapedRef, fullName } = dataset; + const router = createRouter(projectPath, escapedRef); apolloProvider.clients.defaultClient.cache.writeData({ data: { projectPath, projectShortPath, ref, + escapedRef, vueFileListLfsBadge: gon.features?.vueFileListLfsBadge || false, commits: [], }, diff --git a/app/assets/javascripts/repository/log_tree.js b/app/assets/javascripts/repository/log_tree.js index 8cad4a14f31..cef17bf7acb 100644 --- a/app/assets/javascripts/repository/log_tree.js +++ b/app/assets/javascripts/repository/log_tree.js @@ -23,13 +23,13 @@ export function fetchLogsTree(client, path, offset, resolver = null) { if (fetchpromise) return fetchpromise; const { projectPath } = client.readQuery({ query: getProjectPath }); - const { ref } = client.readQuery({ query: getRef }); + const { escapedRef } = client.readQuery({ query: getRef }); fetchpromise = axios .get( - `${gon.relative_url_root}/${projectPath}/-/refs/${encodeURIComponent( - ref, - )}/logs_tree/${encodeURIComponent(path.replace(/^\//, ''))}`, + `${gon.relative_url_root}/${projectPath}/-/refs/${escapedRef}/logs_tree/${encodeURIComponent( + path.replace(/^\//, ''), + )}`, { params: { format: 'json', offset }, }, diff --git a/app/assets/javascripts/repository/mixins/get_ref.js b/app/assets/javascripts/repository/mixins/get_ref.js index a43e0e91bcf..99d19b77c35 100644 --- a/app/assets/javascripts/repository/mixins/get_ref.js +++ b/app/assets/javascripts/repository/mixins/get_ref.js @@ -4,11 +4,19 @@ export default { apollo: { ref: { query: getRef, + manual: true, + result({ data, loading }) { + if (!loading) { + this.ref = data.ref; + this.escapedRef = data.escapedRef; + } + }, }, }, data() { return { ref: '', + escapedRef: '', }; }, }; diff --git a/app/assets/javascripts/repository/queries/getRef.query.graphql b/app/assets/javascripts/repository/queries/getRef.query.graphql index 58c09844c3f..91afb751626 100644 --- a/app/assets/javascripts/repository/queries/getRef.query.graphql +++ b/app/assets/javascripts/repository/queries/getRef.query.graphql @@ -1,3 +1,4 @@ query getRef { ref @client + escapedRef @client } diff --git a/app/assets/javascripts/repository/router.js b/app/assets/javascripts/repository/router.js index b2636f910fe..49e024ca4ff 100644 --- a/app/assets/javascripts/repository/router.js +++ b/app/assets/javascripts/repository/router.js @@ -12,7 +12,7 @@ export default function createRouter(base, baseRef) { base: joinPaths(gon.relative_url_root || '', base), routes: [ { - path: `(/-)?/tree/(${encodeURIComponent(baseRef).replace(/%2F/g, '/')}|${baseRef})/:path*`, + path: `(/-)?/tree/${baseRef}/:path*`, name: 'treePath', component: TreePage, props: route => ({ |