@@ -84,6 +84,9 @@ export default {
},
deleteButtonEnabled: function() {
return this.projectGroupNameToDelete == this.projectGroupName;
+ },
+ isRootProjectGroup() {
+ return this.projectgroupref.length == 0;
}
},
methods: {
diff --git a/src/router.js b/src/router.js
index e5f2698..3f9c449 100644
--- a/src/router.js
+++ b/src/router.js
@@ -231,6 +231,12 @@ const router = new VueRouter({
component: orgmembers,
props: (route) => ({ orgname: route.params.orgname })
},
+ /* {
+ path: "settings",
+ name: "org settings",
+ component: orgsettings,
+ props: (route) => ({ username: route.params.username }),
+ }, */
{
path: "createprojectgroup",
name: "org create project group",
diff --git a/src/util/link.js b/src/util/link.js
index 5ff6459..85ffffc 100644
--- a/src/util/link.js
+++ b/src/util/link.js
@@ -1,5 +1,9 @@
export function parseRef(ref) {
ref = ref.replace(/\.proj/, "")
+ // return empty array or split return an array with the empty element
+ if (!ref) {
+ return []
+ }
return ref.split("/")
}
@@ -44,19 +48,16 @@ export function orgMembersLink(orgname) {
// escape it
export function projectGroupPath(ownertype, ownername, projectgroupref) {
let path = `/${ownertype}/${ownername}`
- if (Array.isArray(projectgroupref) && projectgroupref.length) {
- let projectgrouppath = (projectgroupref.join("/") + ".proj")
- path = `${path}/projectgroups/${projectgrouppath}`
- }
+ // root project group will have a .proj without a name
+ let projectgrouppath = (projectgroupref.join("/") + ".proj")
+ path = `${path}/projectgroups/${projectgrouppath}`
return path
}
export function projectPath(ownertype, ownername, projectref) {
let path = `/${ownertype}/${ownername}`
- if (Array.isArray(projectref) && projectref.length) {
- let projectpath = (projectref.join("/") + ".proj")
- path = `${path}/projects/${projectpath}`
- }
+ let projectpath = (projectref.join("/") + ".proj")
+ path = `${path}/projects/${projectpath}`
return path
}
@@ -105,8 +106,8 @@ export function projectRunTaskLink(ownertype, ownername, projectref, runid, task
}
export function projectGroupSettingsLink(ownertype, ownername, projectgroupref) {
- let projectgrouppath = (projectgroupref.join("/") + ".proj")
- return { path: `/${ownertype}/${ownername}/projectgroups/${projectgrouppath}/settings` }
+ let path = projectGroupPath(ownertype, ownername, projectgroupref)
+ return { path: `${path}/settings` }
}
export function projectSettingsLink(ownertype, ownername, projectref) {
diff --git a/src/views/Org.vue b/src/views/Org.vue
index 81eab03..511c54d 100644
--- a/src/views/Org.vue
+++ b/src/views/Org.vue
@@ -38,7 +38,15 @@
- -
+
-
+
+
+
+
+ Root Project Group Settings
+
+
+ -
@@ -60,7 +68,8 @@ import {
ownerSettingsLink,
orgMembersLink,
projectGroupCreateProjectGroupLink,
- projectGroupCreateProjectLink
+ projectGroupCreateProjectLink,
+ projectGroupSettingsLink
} from "@/util/link.js";
import createprojectbutton from "@/components/createprojectbutton.vue";
@@ -78,13 +87,16 @@ export default {
orgMembersLink: orgMembersLink,
projectGroupCreateProjectGroupLink: projectGroupCreateProjectGroupLink,
projectGroupCreateProjectLink: projectGroupCreateProjectLink,
+ projectGroupSettingsLink: projectGroupSettingsLink,
goToCreate(type) {
if (type == "project") {
- this.$router.push(projectGroupCreateProjectLink("org", this.orgname));
+ this.$router.push(
+ projectGroupCreateProjectLink("org", this.orgname, [])
+ );
return;
}
this.$router.push(
- projectGroupCreateProjectGroupLink("org", this.orgname)
+ projectGroupCreateProjectGroupLink("org", this.orgname, [])
);
}
}
diff --git a/src/views/ProjectGroup.vue b/src/views/ProjectGroup.vue
index a598f42..3ff860e 100644
--- a/src/views/ProjectGroup.vue
+++ b/src/views/ProjectGroup.vue
@@ -68,6 +68,9 @@ export default {
projectGroupCreateProjectGroupLink: projectGroupCreateProjectGroupLink,
projectGroupCreateProjectLink: projectGroupCreateProjectLink,
projectGroupName() {
+ if (!this.projectgroupref.length) {
+ return "Root Project Group";
+ }
return this.projectgroupref[this.projectgroupref.length - 1];
},
goToCreate(type) {
diff --git a/src/views/User.vue b/src/views/User.vue
index 0feb2d5..a648df7 100644
--- a/src/views/User.vue
+++ b/src/views/User.vue
@@ -71,6 +71,14 @@
+ -
+
+
+
+
+ Root Project Group Settings
+
+
-
@@ -95,7 +103,8 @@ import {
userLocalRunTaskLink,
ownerSettingsLink,
projectGroupCreateProjectGroupLink,
- projectGroupCreateProjectLink
+ projectGroupCreateProjectLink,
+ projectGroupSettingsLink
} from "@/util/link.js";
import { fetchRun } from "@/util/data.js";
@@ -135,13 +144,16 @@ export default {
ownerSettingsLink: ownerSettingsLink,
projectGroupCreateProjectGroupLink: projectGroupCreateProjectGroupLink,
projectGroupCreateProjectLink: projectGroupCreateProjectLink,
+ projectGroupSettingsLink: projectGroupSettingsLink,
goToCreate(type) {
if (type == "project") {
- this.$router.push(projectGroupCreateProjectLink("user", this.username));
+ this.$router.push(
+ projectGroupCreateProjectLink("user", this.username, [])
+ );
return;
}
this.$router.push(
- projectGroupCreateProjectGroupLink("user", this.username)
+ projectGroupCreateProjectGroupLink("user", this.username, [])
);
}
}