summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/repository
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-05 15:08:48 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-05 15:08:48 +0000
commiteabf8fd774fef6a54903e5141138f47bdafeb331 (patch)
treec74ff99fa6765cbe091767e9827374ce44b0df50 /app/assets/javascripts/repository
parent20d564f1064622ef0623434372ac3ceb03173331 (diff)
downloadgitlab-ce-eabf8fd774fef6a54903e5141138f47bdafeb331.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/repository')
-rw-r--r--app/assets/javascripts/repository/index.js20
-rw-r--r--app/assets/javascripts/repository/mixins/preload.js4
-rw-r--r--app/assets/javascripts/repository/router.js4
3 files changed, 14 insertions, 14 deletions
diff --git a/app/assets/javascripts/repository/index.js b/app/assets/javascripts/repository/index.js
index a26acbbe301..aefbef5467d 100644
--- a/app/assets/javascripts/repository/index.js
+++ b/app/assets/javascripts/repository/index.js
@@ -28,8 +28,8 @@ export default function setupVueRepositoryList() {
},
});
- router.afterEach(({ params: { pathMatch } }) => {
- setTitle(pathMatch, ref, fullName);
+ router.afterEach(({ params: { path } }) => {
+ setTitle(path, ref, fullName);
});
const breadcrumbEl = document.getElementById('js-repo-breadcrumb');
@@ -48,9 +48,9 @@ export default function setupVueRepositoryList() {
newDirPath,
} = breadcrumbEl.dataset;
- router.afterEach(({ params: { pathMatch = '/' } }) => {
- updateFormAction('.js-upload-blob-form', uploadPath, pathMatch);
- updateFormAction('.js-create-dir-form', newDirPath, pathMatch);
+ router.afterEach(({ params: { path = '/' } }) => {
+ updateFormAction('.js-upload-blob-form', uploadPath, path);
+ updateFormAction('.js-create-dir-form', newDirPath, path);
});
// eslint-disable-next-line no-new
@@ -61,7 +61,7 @@ export default function setupVueRepositoryList() {
render(h) {
return h(Breadcrumbs, {
props: {
- currentPath: this.$route.params.pathMatch,
+ currentPath: this.$route.params.path,
canCollaborate: parseBoolean(canCollaborate),
canEditTree: parseBoolean(canEditTree),
newBranchPath,
@@ -84,7 +84,7 @@ export default function setupVueRepositoryList() {
render(h) {
return h(LastCommit, {
props: {
- currentPath: this.$route.params.pathMatch,
+ currentPath: this.$route.params.path,
},
});
},
@@ -100,7 +100,7 @@ export default function setupVueRepositoryList() {
render(h) {
return h(TreeActionLink, {
props: {
- path: historyLink + (this.$route.params.pathMatch || '/'),
+ path: `${historyLink}/${this.$route.params.path || ''}`,
text: __('History'),
},
});
@@ -117,7 +117,7 @@ export default function setupVueRepositoryList() {
render(h) {
return h(TreeActionLink, {
props: {
- path: webIDEUrl(`/${projectPath}/edit/${ref}/-${this.$route.params.pathMatch || '/'}`),
+ path: webIDEUrl(`/${projectPath}/edit/${ref}/-/${this.$route.params.path || ''}`),
text: __('Web IDE'),
cssClass: 'qa-web-ide-button',
},
@@ -134,7 +134,7 @@ export default function setupVueRepositoryList() {
el: directoryDownloadLinks,
router,
render(h) {
- const currentPath = this.$route.params.pathMatch || '/';
+ const currentPath = this.$route.params.path || '/';
if (currentPath !== '/') {
return h(DirectoryDownloadLinks, {
diff --git a/app/assets/javascripts/repository/mixins/preload.js b/app/assets/javascripts/repository/mixins/preload.js
index e68996245a8..cb6c2294679 100644
--- a/app/assets/javascripts/repository/mixins/preload.js
+++ b/app/assets/javascripts/repository/mixins/preload.js
@@ -13,10 +13,10 @@ export default {
return { projectPath: '', loadingPath: null };
},
beforeRouteUpdate(to, from, next) {
- this.preload(to.params.pathMatch, next);
+ this.preload(to.params.path, next);
},
methods: {
- preload(path, next) {
+ preload(path = '/', next) {
this.loadingPath = path.replace(/^\//, '');
return this.$apollo
diff --git a/app/assets/javascripts/repository/router.js b/app/assets/javascripts/repository/router.js
index 6c31c9bae82..2386773699c 100644
--- a/app/assets/javascripts/repository/router.js
+++ b/app/assets/javascripts/repository/router.js
@@ -12,11 +12,11 @@ export default function createRouter(base, baseRef) {
base: joinPaths(gon.relative_url_root || '', base),
routes: [
{
- path: `/-/tree/${escape(baseRef)}(/.*)?`,
+ path: `(/-)?/tree/${escape(baseRef)}/:path*`,
name: 'treePath',
component: TreePage,
props: route => ({
- path: route.params.pathMatch && (route.params.pathMatch.replace(/^\//, '') || '/'),
+ path: route.params.path?.replace(/^\//, '') || '/',
}),
},
{