498 lines
11 KiB
Vue
498 lines
11 KiB
Vue
<template>
|
|
<n-config-provider :theme="useNBTheme(theme)">
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<ul
|
|
id="misc_module_tabs"
|
|
class="nav nav-tabs"
|
|
role="tablist"
|
|
>
|
|
<!-- GROUPS AND USERS -->
|
|
<!-- Don't need to show to requirement items - as permissions are gained from parent requirement -->
|
|
<li
|
|
v-if="destination !== 'requirement_item'"
|
|
class="nav-item"
|
|
role="presentation"
|
|
>
|
|
<button
|
|
id="group-and-user-tab"
|
|
class="nav-link active"
|
|
data-bs-toggle="tab"
|
|
data-bs-target="#group-and-users"
|
|
type="button"
|
|
role="tab"
|
|
aria-controls="home"
|
|
aria-selected="true"
|
|
>
|
|
Groups and Users
|
|
</button>
|
|
</li>
|
|
|
|
<!-- REQUIREMENT ITEMS -->
|
|
<li
|
|
v-if="destination === 'requirement'"
|
|
class="nav-item"
|
|
role="presentation"
|
|
>
|
|
<button
|
|
id="requirement-item-tab"
|
|
class="nav-link"
|
|
data-bs-toggle="tab"
|
|
data-bs-target="#requirement-items"
|
|
type="button"
|
|
role="tab"
|
|
aria-controls="home"
|
|
aria-selected="false"
|
|
>
|
|
Requirement Item
|
|
</button>
|
|
</li>
|
|
|
|
<!-- REQUIREMENT LINKS -->
|
|
<li
|
|
v-if="destination === 'requirement'"
|
|
class="nav-item"
|
|
role="presentation"
|
|
>
|
|
<button
|
|
id="requirement-link-tab"
|
|
class="nav-link"
|
|
data-bs-toggle="tab"
|
|
data-bs-target="#requirement-links"
|
|
type="button"
|
|
role="tab"
|
|
aria-controls="home"
|
|
aria-selected="false"
|
|
>
|
|
Requirement Links
|
|
</button>
|
|
</li>
|
|
|
|
<!-- REQUIREMENT ITEM LINKS -->
|
|
<li
|
|
v-if="destination === 'requirement_item'"
|
|
class="nav-item"
|
|
role="presentation"
|
|
>
|
|
<button
|
|
id="requirement-item-link-tab"
|
|
class="nav-link"
|
|
data-bs-toggle="tab"
|
|
data-bs-target="#requirement-item-links"
|
|
type="button"
|
|
role="tab"
|
|
aria-controls="home"
|
|
aria-selected="false"
|
|
>
|
|
Links
|
|
</button>
|
|
</li>
|
|
|
|
<!-- DOCUMENTS -->
|
|
<li
|
|
class="nav-item"
|
|
role="presentation"
|
|
>
|
|
<button
|
|
id="documents-tab"
|
|
class="nav-link"
|
|
data-bs-toggle="tab"
|
|
data-bs-target="#documents"
|
|
type="button"
|
|
role="tab"
|
|
aria-controls="home"
|
|
aria-selected="false"
|
|
>
|
|
Documents
|
|
</button>
|
|
</li>
|
|
|
|
<!-- LINKED OBJECTS -->
|
|
<li
|
|
v-if="
|
|
destination !== 'requirement' &&
|
|
destination !== 'requirement_item'
|
|
"
|
|
class="nav-item"
|
|
role="presentation"
|
|
>
|
|
<button
|
|
id="object-link-tabs"
|
|
class="nav-link"
|
|
data-bs-toggle="tab"
|
|
data-bs-target="#object-links"
|
|
type="button"
|
|
role="tab"
|
|
aria-controls="home"
|
|
aria-selected="false"
|
|
>
|
|
Linked Objects
|
|
</button>
|
|
</li>
|
|
|
|
<!-- CUSTOMERS -->
|
|
<!-- Customers are not needed by requirement items as the parent requirements take care of this -->
|
|
<li
|
|
v-if="destination !== 'requirement_item'"
|
|
class="nav-item"
|
|
role="presentation"
|
|
>
|
|
<button
|
|
id="customer-tab"
|
|
class="nav-link"
|
|
data-bs-toggle="tab"
|
|
data-bs-target="#customers"
|
|
type="button"
|
|
role="tab"
|
|
aria-controls="home"
|
|
aria-selected="false"
|
|
>
|
|
Customers
|
|
</button>
|
|
</li>
|
|
|
|
<!-- SPRINTS -->
|
|
<li
|
|
class="nav-item"
|
|
role="presentation"
|
|
>
|
|
<button
|
|
id="sprints-tab"
|
|
class="nav-link"
|
|
data-bs-toggle="tab"
|
|
data-bs-target="#sprints"
|
|
type="button"
|
|
role="tab"
|
|
aria-controls="home"
|
|
aria-selected="false"
|
|
>
|
|
Sprints
|
|
</button>
|
|
</li>
|
|
|
|
<!-- MISC -->
|
|
<li
|
|
class="nav-item"
|
|
role="presentation"
|
|
>
|
|
<button
|
|
id="misc-tab"
|
|
class="nav-link"
|
|
data-bs-toggle="tab"
|
|
data-bs-target="#misc"
|
|
type="button"
|
|
role="tab"
|
|
aria-controls="home"
|
|
aria-selected="false"
|
|
>
|
|
Misc
|
|
</button>
|
|
</li>
|
|
|
|
<!-- Notes -->
|
|
<li
|
|
class="nav-item"
|
|
role="presentation"
|
|
>
|
|
<button
|
|
id="notes-tab"
|
|
class="nav-link"
|
|
data-bs-toggle="tab"
|
|
data-bs-target="#notes"
|
|
type="button"
|
|
role="tab"
|
|
aria-controls="home"
|
|
aria-select="false"
|
|
>
|
|
Notes
|
|
</button>
|
|
</li>
|
|
|
|
<!-- ADMIN -->
|
|
<li
|
|
v-if="userLevel === 4"
|
|
class="nav-item"
|
|
role="presentation"
|
|
>
|
|
<button
|
|
id="admin-tab"
|
|
class="nav-link"
|
|
data-bs-toggle="tab"
|
|
data-bs-target="#admin"
|
|
type="button"
|
|
role="tab"
|
|
aria-controls="home"
|
|
aria-select="false"
|
|
>
|
|
Admin
|
|
</button>
|
|
</li>
|
|
</ul>
|
|
<hr/>
|
|
|
|
<div
|
|
id="misc_module_content"
|
|
class="tab-content"
|
|
>
|
|
<div
|
|
v-if="destination !== 'requirement_item'"
|
|
id="group-and-users"
|
|
class="tab-pane fade show active"
|
|
role="tabpanel"
|
|
aria-labelledby="contact-tab"
|
|
>
|
|
<groups-and-users-module></groups-and-users-module>
|
|
</div>
|
|
<div
|
|
v-if="destination === 'requirement'"
|
|
id="requirement-items"
|
|
class="tab-pane fade"
|
|
role="tabpanel"
|
|
aria-labelledby="home-tab"
|
|
>
|
|
<requirement-items-module></requirement-items-module>
|
|
</div>
|
|
<div
|
|
v-if="destination === 'requirement'"
|
|
id="requirement-links"
|
|
class="tab-pane fade"
|
|
role="tabpanel"
|
|
aria-labelledby="profile-tab"
|
|
>
|
|
<requirement-links-module></requirement-links-module>
|
|
</div>
|
|
<div
|
|
v-else-if="destination === 'requirement_item'"
|
|
id="requirement-item-links"
|
|
class="tab-pane fade"
|
|
role="tabpanel"
|
|
aria-labelledby="profile-tab"
|
|
>
|
|
<requirement-item-links-module></requirement-item-links-module>
|
|
</div>
|
|
|
|
<div
|
|
id="documents"
|
|
class="tab-pane fade"
|
|
role="tabpanel"
|
|
aria-labelledby="contact-tab"
|
|
>
|
|
<documents-module></documents-module>
|
|
|
|
<upload-document-wizard></upload-document-wizard>
|
|
|
|
<add-folder-wizard
|
|
:destination="destination"
|
|
:location-id="locationId"
|
|
></add-folder-wizard>
|
|
|
|
<add-link-wizard
|
|
:destination="destination"
|
|
:location-id="locationId"
|
|
></add-link-wizard>
|
|
|
|
<confirm-file-delete-vue></confirm-file-delete-vue>
|
|
<confirm-folder-delete></confirm-folder-delete>
|
|
</div>
|
|
<div
|
|
id="object-links"
|
|
class="tab-pane fade"
|
|
role="tabpanel"
|
|
aria-labelledby="contact-tab"
|
|
>
|
|
<object-links></object-links>
|
|
</div>
|
|
<div
|
|
id="customers"
|
|
class="tab-pane fade"
|
|
role="tabpanel"
|
|
aria-labelledby="contact-tab"
|
|
>
|
|
<customers-module></customers-module>
|
|
</div>
|
|
<div
|
|
id="sprints"
|
|
class="tab-pane fade"
|
|
role="tabpanel"
|
|
aria-labelledby="tabpanel"
|
|
>
|
|
<list-sprints></list-sprints>
|
|
</div>
|
|
<div
|
|
id="misc"
|
|
class="tab-pane fade"
|
|
role="tabpanel"
|
|
aria-labelledby="contact-tab"
|
|
>
|
|
<misc-module></misc-module>
|
|
<confirm-public-link-delete></confirm-public-link-delete>
|
|
</div>
|
|
<div
|
|
id="notes"
|
|
class="tab-pane fade"
|
|
role="tabpanel"
|
|
aria-labelledby="contact-tab"
|
|
>
|
|
<notes-module></notes-module>
|
|
|
|
<!-- Modals for Notes section -->
|
|
<edit-history-note-wizard></edit-history-note-wizard>
|
|
|
|
<new-history-note-wizard
|
|
:location-id="locationId"
|
|
:destination="destination"
|
|
></new-history-note-wizard>
|
|
|
|
<confirm-note-delete></confirm-note-delete>
|
|
</div>
|
|
<div
|
|
v-if="userLevel === 4"
|
|
id="admin"
|
|
class="tab-pane fade bg-danger"
|
|
role="tabpanel"
|
|
aria-labelledby="contact-tab"
|
|
>
|
|
<delete-object></delete-object>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</n-config-provider>
|
|
</template>
|
|
|
|
<script>
|
|
import GroupsAndUsersModule from "./sub_modules/GroupsAndUsersModule.vue";
|
|
import RequirementItemsModule from "./sub_modules/RequirementItemsModule.vue";
|
|
import RequirementItemLinksModule from "./sub_modules/RequirementItemLinksModule.vue";
|
|
import RequirementLinksModule from "./sub_modules/RequirementLinksModule.vue";
|
|
import DocumentsModule from "./sub_modules/DocumentsModule.vue";
|
|
import ObjectLinks from "./sub_modules/ObjectLinks.vue";
|
|
import CustomersModule from "./sub_modules/CustomersModule.vue";
|
|
import MiscModule from "./sub_modules/MiscModule.vue";
|
|
import NotesModule from "./sub_modules/NotesModule.vue";
|
|
import UploadDocumentWizard from "./wizards/UploadDocumentWizard.vue";
|
|
import AddLinkWizard from "./wizards/AddLinkWizard.vue";
|
|
import ConfirmFileDeleteVue from "./wizards/ConfirmFileDelete.vue";
|
|
import ConfirmFolderDelete from "./wizards/ConfirmFolderDelete.vue";
|
|
import AddFolderWizard from "./wizards/AddFolderWizard.vue";
|
|
import ListSprints from "./sub_modules/ListSprints.vue";
|
|
import EditHistoryNoteWizard from "./wizards/EditHistoryNoteWizard.vue";
|
|
import NewHistoryNoteWizard from "./wizards/NewHistoryNoteWizard.vue";
|
|
|
|
//Components
|
|
import ConfirmNoteDelete from "./wizards/ConfirmNoteDelete.vue";
|
|
|
|
//Composables
|
|
import {useNBTheme} from "Composables/theme/useNBTheme";
|
|
import ConfirmPublicLinkDelete from "./wizards/ConfirmPublicLinkDelete.vue";
|
|
import DeleteObject from "./sub_modules/DeleteObject.vue";
|
|
|
|
export default {
|
|
name: "ParentModules",
|
|
components: {
|
|
DeleteObject,
|
|
ConfirmPublicLinkDelete,
|
|
ConfirmNoteDelete,
|
|
AddFolderWizard,
|
|
ConfirmFileDeleteVue,
|
|
AddLinkWizard,
|
|
ConfirmFolderDelete,
|
|
CustomersModule,
|
|
DocumentsModule,
|
|
EditHistoryNoteWizard,
|
|
GroupsAndUsersModule,
|
|
ListSprints,
|
|
NewHistoryNoteWizard,
|
|
NotesModule,
|
|
ObjectLinks,
|
|
RequirementItemLinksModule,
|
|
RequirementItemsModule,
|
|
RequirementLinksModule,
|
|
UploadDocumentWizard,
|
|
MiscModule,
|
|
},
|
|
props: {
|
|
destination: {
|
|
type: String,
|
|
default: "",
|
|
}, //Which object we are looking at, i.e. requirement
|
|
isReadOnly: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
locationId: {
|
|
type: Number,
|
|
default: 0,
|
|
}, //The ID of the object we are looking at.
|
|
rootUrl: {
|
|
type: String,
|
|
default: "/",
|
|
},
|
|
staticUrl: {
|
|
type: String,
|
|
default: "/",
|
|
},
|
|
theme: {
|
|
type: String,
|
|
default: "",
|
|
},
|
|
userExtraPermissions: {
|
|
type: Array,
|
|
default: () => {
|
|
return [];
|
|
},
|
|
},
|
|
userLevel: {
|
|
type: Number,
|
|
default: 0,
|
|
},
|
|
},
|
|
data() {
|
|
return {};
|
|
},
|
|
async beforeMount() {
|
|
await this.$store.dispatch("processThemeUpdate", {
|
|
theme: this.theme,
|
|
});
|
|
},
|
|
mounted() {
|
|
//Send data to required VueX states
|
|
this.$store.commit({
|
|
type: "updateDestination",
|
|
destination: this.destination,
|
|
locationId: this.locationId,
|
|
});
|
|
this.$store.commit({
|
|
type: "updateUrl",
|
|
rootUrl: this.rootUrl,
|
|
staticUrl: this.staticUrl,
|
|
});
|
|
|
|
//If is read only is true, we drop the user level to 1.
|
|
//If not read only, we send the correct userLevel up to VueX, as well as the extra permissions
|
|
if (this.isReadOnly) {
|
|
//Set everything as read only :)
|
|
this.$store.commit({
|
|
type: "updateUserLevel",
|
|
userLevel: 1,
|
|
});
|
|
} else {
|
|
//Use the user level
|
|
this.$store.commit({
|
|
type: "updateUserLevel",
|
|
userLevel: this.userLevel,
|
|
});
|
|
|
|
//Send extra permissions upstream
|
|
this.$store.commit({
|
|
type: "updateUserExtraPermissions",
|
|
userExtraPermissions: this.userExtraPermissions,
|
|
});
|
|
}
|
|
},
|
|
methods: {useNBTheme},
|
|
};
|
|
</script>
|
|
|
|
|