2019-04-02 16:08:03 +00:00
|
|
|
<template>
|
|
|
|
|
<div>
|
|
|
|
|
<projectvars :variables="variables" :allvariables="allvariables"/>
|
2019-05-11 13:12:10 +00:00
|
|
|
<hr>
|
|
|
|
|
<div>
|
|
|
|
|
<h4 class="title is-4">Delete This Project Group</h4>
|
|
|
|
|
|
|
|
|
|
<div class="message is-danger">
|
|
|
|
|
<div class="message-body">
|
|
|
|
|
This operation
|
|
|
|
|
<strong>CANNOT</strong> be undone.
|
|
|
|
|
This operation will remove
|
|
|
|
|
<strong>{{projectGroupPath}}</strong>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<label class="label">
|
|
|
|
|
Please type the project group name for confirmation:
|
|
|
|
|
<span
|
|
|
|
|
class="has-text-danger"
|
|
|
|
|
>{{ projectGroupName }}</span>
|
|
|
|
|
</label>
|
|
|
|
|
<div class="field">
|
|
|
|
|
<input
|
|
|
|
|
v-model="projectGroupNameToDelete"
|
|
|
|
|
class="input"
|
|
|
|
|
type="email"
|
|
|
|
|
placeholder="Project Group name to delete"
|
|
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
|
<button
|
|
|
|
|
class="button is-danger"
|
|
|
|
|
@click="deleteProjectGroup()"
|
|
|
|
|
:disabled="!deleteButtonEnabled"
|
|
|
|
|
>Delete Project Group</button>
|
|
|
|
|
</div>
|
2019-04-02 16:08:03 +00:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2019-05-11 13:12:10 +00:00
|
|
|
import { fetchVariables, deleteProjectGroup } from "@/util/data.js";
|
|
|
|
|
|
|
|
|
|
import { projectGroupLink } from "@/util/link.js";
|
2019-04-02 16:08:03 +00:00
|
|
|
|
|
|
|
|
import projectvars from "@/components/projectvars";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
components: { projectvars },
|
|
|
|
|
name: "projectgroupsettings",
|
|
|
|
|
props: {
|
|
|
|
|
ownertype: String,
|
|
|
|
|
ownername: String,
|
|
|
|
|
projectgroupref: Array
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
variables: [],
|
2019-05-11 13:12:10 +00:00
|
|
|
allvariables: [],
|
|
|
|
|
projectGroupNameToDelete: ""
|
2019-04-02 16:08:03 +00:00
|
|
|
};
|
|
|
|
|
},
|
2019-05-11 13:12:10 +00:00
|
|
|
computed: {
|
|
|
|
|
projectGroupName: function() {
|
|
|
|
|
return this.projectgroupref[this.projectgroupref.length - 1];
|
|
|
|
|
},
|
|
|
|
|
projectGroupPath: function() {
|
|
|
|
|
return ["", this.ownertype, this.ownername, ...this.projectgroupref].join(
|
|
|
|
|
"/"
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
deleteButtonEnabled: function() {
|
|
|
|
|
return this.projectGroupNameToDelete == this.projectGroupName;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
async deleteProjectGroup() {
|
|
|
|
|
let projectgroupref = [
|
|
|
|
|
this.ownertype,
|
|
|
|
|
this.ownername,
|
|
|
|
|
...this.projectgroupref
|
|
|
|
|
].join("/");
|
|
|
|
|
|
|
|
|
|
if (this.projectGroupNameToDelete == this.projectGroupName) {
|
|
|
|
|
let res = await deleteProjectGroup(projectgroupref);
|
|
|
|
|
this.$router.push(
|
|
|
|
|
projectGroupLink(
|
|
|
|
|
this.ownertype,
|
|
|
|
|
this.ownername,
|
|
|
|
|
this.projectgroupref.slice(0, -1)
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
2019-04-02 16:08:03 +00:00
|
|
|
created: async function() {
|
|
|
|
|
this.variables = await fetchVariables(
|
|
|
|
|
"projectgroup",
|
|
|
|
|
[this.ownertype, this.ownername, ...this.projectgroupref].join("/"),
|
|
|
|
|
false
|
|
|
|
|
);
|
|
|
|
|
this.allvariables = await fetchVariables(
|
|
|
|
|
"projectgroup",
|
|
|
|
|
[this.ownertype, this.ownername, ...this.projectgroupref].join("/"),
|
|
|
|
|
true
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
@import "@/css/_variables.scss";
|
|
|
|
|
</style>
|
|
|
|
|
|