Revert to Draft
@@ -96,11 +96,10 @@ const emit = defineEmits<{
}>()
const router = useRouter()
-
const { informationSharingAgreementId } = toRefs(props)
-const { informationSharingAgreement, isLoading } = useInformationSharingAgreement(
- informationSharingAgreementId
-)
+
+const { informationSharingAgreement, isLoading: isLoadingInformationSharingAgreement } =
+ useInformationSharingAgreement(informationSharingAgreementId)
const hasSignedConfidentialityReceipt = computed(() => {
if (isNil(informationSharingAgreement.value)) {
@@ -117,12 +116,13 @@ const informationSharingAgreementArchiveItemsQuery = computed(() => ({
},
perPage: 1,
}))
-const { informationSharingAgreementArchiveItems } = useInformationSharingAgreementArchiveItems(
- informationSharingAgreementArchiveItemsQuery
-)
-const archiveItemId = computed(
- () => informationSharingAgreementArchiveItems.value?.at(0)?.archiveItemId
+const { informationSharingAgreementArchiveItems, isLoading: isLoadingKnowledgeItems } =
+ useInformationSharingAgreementArchiveItems(informationSharingAgreementArchiveItemsQuery)
+const isLoading = computed(
+ () => isLoadingInformationSharingAgreement.value || isLoadingKnowledgeItems.value
)
+const knowledgeItem = computed(() => informationSharingAgreementArchiveItems.value.at(0))
+const hasKnowledgeItems = computed(() => !isNil(knowledgeItem.value))
const informationSharingAgreementArchiveItemCreateDialogRef = useTemplateRef(
"informationSharingAgreementArchiveItemCreateDialogRef"
)
@@ -132,13 +132,14 @@ function openCreateArchiveItemDialog() {
}
const primaryButtonAttributes = computed(() => {
- if (!isNil(archiveItemId.value)) {
+ if (!isNil(knowledgeItem.value)) {
return {
primaryButtonText: "View Knowledge Item",
primaryButtonTo: {
- name: "archive-items/ArchiveItemInformationSharingAgreementsPage",
+ name: "information-sharing-agreements/InformationSharingAgreementKnowledgeItemPage",
params: {
- archiveItemId: archiveItemId.value,
+ informationSharingAgreementId: props.informationSharingAgreementId,
+ informationSharingAgreementArchiveItemId: knowledgeItem.value.id,
},
},
}
diff --git a/web/src/pages/DashboardPage.vue b/web/src/pages/DashboardPage.vue
index 20dbdb7c..73ae9a7f 100644
--- a/web/src/pages/DashboardPage.vue
+++ b/web/src/pages/DashboardPage.vue
@@ -10,8 +10,8 @@
The Vault provides layers of secure storage for Yukon First Nations and Indigenous
Governments to share their Traditional Knowledge with the Yukon Government. An
- Information Sharing Agreement sets the terms of the sharing, and Traditional Knowledge is
- then added under that agreement.
+ Information Sharing Agreement sets the terms of the sharing, and Traditional Knowledge
+ is then added under that agreement.
diff --git a/web/src/pages/NotificationsPage.vue b/web/src/pages/NotificationsPage.vue
index 5706358c..f874e267 100644
--- a/web/src/pages/NotificationsPage.vue
+++ b/web/src/pages/NotificationsPage.vue
@@ -35,6 +35,7 @@ import { computed } from "vue"
import { stringTransformer } from "@/utils/use-route-query-transformers"
+import useBreadcrumbs, { BASE_CRUMB } from "@/use/use-breadcrumbs"
import { NotificationWhereOptions } from "@/use/use-notifications"
import AppCard from "@/components/common/AppCard.vue"
@@ -53,4 +54,14 @@ const where = computed(() => {
return {}
})
+
+useBreadcrumbs("Notifications", [
+ BASE_CRUMB,
+ {
+ title: "Notifications",
+ to: {
+ name: "NotificationsPage",
+ },
+ },
+])
diff --git a/web/src/pages/administration/GroupsPage.vue b/web/src/pages/administration/GroupsPage.vue
index d69026cd..dbeee67e 100644
--- a/web/src/pages/administration/GroupsPage.vue
+++ b/web/src/pages/administration/GroupsPage.vue
@@ -46,5 +46,13 @@ const filters = computed(() => {
const { isSystemAdmin } = useCurrentUser()
-useBreadcrumbs("Groups", [ADMIN_CRUMB])
+useBreadcrumbs("Groups", [
+ ADMIN_CRUMB,
+ {
+ title: "Groups",
+ to: {
+ name: "administration/GroupsPage",
+ },
+ },
+])
diff --git a/web/src/pages/administration/information-sharing-agreements/InformationSharingAgreementPage.vue b/web/src/pages/administration/information-sharing-agreements/InformationSharingAgreementPage.vue
index d9562210..1683139c 100644
--- a/web/src/pages/administration/information-sharing-agreements/InformationSharingAgreementPage.vue
+++ b/web/src/pages/administration/information-sharing-agreements/InformationSharingAgreementPage.vue
@@ -115,5 +115,14 @@ useBreadcrumbs(pageTitle, [
name: "administration/InformationSharingAgreementsPage",
},
},
+ {
+ title: formatInformationSharingAgreementNumber(informationSharingAgreementIdAsNumber.value),
+ to: {
+ name: "administration/information-sharing-agreements/InformationSharingAgreementPage",
+ params: {
+ informationSharingAgreementId: props.informationSharingAgreementId,
+ },
+ },
+ },
])
diff --git a/web/src/pages/archive-items/ArchiveItemListPage.vue b/web/src/pages/archive-items/ArchiveItemListPage.vue
index b38b7514..f6b72073 100644
--- a/web/src/pages/archive-items/ArchiveItemListPage.vue
+++ b/web/src/pages/archive-items/ArchiveItemListPage.vue
@@ -142,7 +142,15 @@ const headers = [
{ title: "Attachments", value: "archiveItemFileCount" },
]
-useBreadcrumbs("Knowledge Items", [BASE_CRUMB])
+useBreadcrumbs("Knowledge Items", [
+ BASE_CRUMB,
+ {
+ title: "Knowledge Items",
+ to: {
+ name: "archive-items/ArchiveItemListPage",
+ },
+ },
+])
function updatePage(newPage: number) {
if (isLoading.value) return
diff --git a/web/src/pages/information-sharing-agreements/InformationSharingAgreementKnowledgeItemInformationSharingAgreementsPage.vue b/web/src/pages/information-sharing-agreements/InformationSharingAgreementKnowledgeItemInformationSharingAgreementsPage.vue
new file mode 100644
index 00000000..df9f276a
--- /dev/null
+++ b/web/src/pages/information-sharing-agreements/InformationSharingAgreementKnowledgeItemInformationSharingAgreementsPage.vue
@@ -0,0 +1,76 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/web/src/pages/information-sharing-agreements/InformationSharingAgreementKnowledgeItemPage.vue b/web/src/pages/information-sharing-agreements/InformationSharingAgreementKnowledgeItemPage.vue
new file mode 100644
index 00000000..e572feb1
--- /dev/null
+++ b/web/src/pages/information-sharing-agreements/InformationSharingAgreementKnowledgeItemPage.vue
@@ -0,0 +1,149 @@
+
+
+
+
+
+
+
+
+
+
+ Information Sharing Agreements
+
+
+ Users with Access
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/web/src/pages/information-sharing-agreements/InformationSharingAgreementKnowledgeItemUsersWithAccessPage.vue b/web/src/pages/information-sharing-agreements/InformationSharingAgreementKnowledgeItemUsersWithAccessPage.vue
new file mode 100644
index 00000000..68eac1de
--- /dev/null
+++ b/web/src/pages/information-sharing-agreements/InformationSharingAgreementKnowledgeItemUsersWithAccessPage.vue
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
diff --git a/web/src/pages/information-sharing-agreements/InformationSharingAgreementPage.vue b/web/src/pages/information-sharing-agreements/InformationSharingAgreementPage.vue
index 9b54ac4e..df45a927 100644
--- a/web/src/pages/information-sharing-agreements/InformationSharingAgreementPage.vue
+++ b/web/src/pages/information-sharing-agreements/InformationSharingAgreementPage.vue
@@ -115,5 +115,14 @@ useBreadcrumbs(pageTitle, [
name: "InformationSharingAgreementsPage",
},
},
+ {
+ title: formatInformationSharingAgreementNumber(informationSharingAgreementIdAsNumber.value),
+ to: {
+ name: "information-sharing-agreements/InformationSharingAgreementPage",
+ params: {
+ informationSharingAgreementId: props.informationSharingAgreementId,
+ },
+ },
+ },
])
diff --git a/web/src/pages/users/UsersPage.vue b/web/src/pages/users/UsersPage.vue
index 1171efec..3f4d9fd6 100644
--- a/web/src/pages/users/UsersPage.vue
+++ b/web/src/pages/users/UsersPage.vue
@@ -59,5 +59,13 @@ const filters = computed(() => {
}
})
-useBreadcrumbs("Users", [ADMIN_CRUMB])
+useBreadcrumbs("Users", [
+ ADMIN_CRUMB,
+ {
+ title: "Users",
+ to: {
+ name: "users/UsersPage",
+ },
+ },
+])
diff --git a/web/src/routes.ts b/web/src/routes.ts
index 6844be2d..04f55761 100644
--- a/web/src/routes.ts
+++ b/web/src/routes.ts
@@ -42,32 +42,61 @@ const routes: RouteRecordRaw[] = [
},
},
{
- path: "information-sharing-agreements",
+ path: "sharing-agreements",
name: "InformationSharingAgreementsPage",
component: () => import("@/pages/InformationSharingAgreementsPage.vue"),
},
{
- path: "information-sharing-agreements/new",
+ path: "sharing-agreements/new",
name: "information-sharing-agreements/InformationSharingAgreementNewPage",
component: () =>
import("@/pages/information-sharing-agreements/InformationSharingAgreementNewPage.vue"),
},
{
- path: "information-sharing-agreements/:informationSharingAgreementId",
+ path: "sharing-agreements/:informationSharingAgreementId",
name: "information-sharing-agreements/InformationSharingAgreementPage",
component: () =>
import("@/pages/information-sharing-agreements/InformationSharingAgreementPage.vue"),
props: true,
},
{
- path: "information-sharing-agreements/:informationSharingAgreementId/sign",
+ path: "sharing-agreements/:informationSharingAgreementId/knowledge-items/:informationSharingAgreementArchiveItemId",
+ component: () =>
+ import("@/pages/information-sharing-agreements/InformationSharingAgreementKnowledgeItemPage.vue"),
+ props: true,
+ children: [
+ {
+ path: "",
+ name: "information-sharing-agreements/InformationSharingAgreementKnowledgeItemPage",
+ redirect: {
+ name: "information-sharing-agreements/InformationSharingAgreementKnowledgeItemInformationSharingAgreementsPage",
+ },
+ },
+ {
+ path: "sharing-agreements",
+ name: "information-sharing-agreements/InformationSharingAgreementKnowledgeItemInformationSharingAgreementsPage",
+ component: () =>
+ import("@/pages/information-sharing-agreements/InformationSharingAgreementKnowledgeItemInformationSharingAgreementsPage.vue"),
+ props: true,
+ },
+ {
+ path: "users-with-access",
+ name: "information-sharing-agreements/InformationSharingAgreementKnowledgeItemUsersWithAccessPage",
+ component: () =>
+ import("@/pages/information-sharing-agreements/InformationSharingAgreementKnowledgeItemUsersWithAccessPage.vue"),
+ props: true,
+ },
+ ],
+ },
+ {
+ path: "sharing-agreements/:informationSharingAgreementId/sign",
name: "information-sharing-agreements/InformationSharingAgreementSignPage",
component: () =>
import("@/pages/information-sharing-agreements/InformationSharingAgreementSignPage.vue"),
props: true,
},
{
- path: "information-sharing-agreements/:informationSharingAgreementId/edit",
+ path: "sharing-agreements/:informationSharingAgreementId/edit",
component: () => import("@/layouts/InformationSharingAgreementEditLayout.vue"),
props: true,
children: [
@@ -202,12 +231,12 @@ const routes: RouteRecordRaw[] = [
props: true,
},
{
- path: "information-sharing-agreements",
+ path: "sharing-agreements",
name: "administration/InformationSharingAgreementsPage",
component: () => import("@/pages/administration/InformationSharingAgreementsPage.vue"),
},
{
- path: "information-sharing-agreements/:informationSharingAgreementId",
+ path: "sharing-agreements/:informationSharingAgreementId",
component: () =>
import("@/pages/administration/information-sharing-agreements/InformationSharingAgreementPage.vue"),
props: true,
@@ -284,20 +313,20 @@ const routes: RouteRecordRaw[] = [
],
},
{
- path: "archive-items",
+ path: "knowledge-items",
name: "archive-items/ArchiveItemListPage",
component: () => import("@/pages/archive-items/ArchiveItemListPage.vue"),
meta: { title: "Traditional Knowledge" },
props: true,
},
{
- path: "archive-items/new",
+ path: "knowledge-items/new",
name: "archive-items/ArchiveItemNewPage",
component: () => import("@/pages/archive-items/ArchiveItemNewPage.vue"),
props: true,
},
{
- path: "archive-items/:archiveItemId",
+ path: "knowledge-items/:archiveItemId",
component: () => import("@/pages/archive-items/ArchiveItemPage.vue"),
props: true,
children: [
@@ -308,9 +337,8 @@ const routes: RouteRecordRaw[] = [
name: "archive-items/ArchiveItemInformationSharingAgreementsPage",
},
},
-
{
- path: "information-sharing-agreements",
+ path: "sharing-agreements",
name: "archive-items/ArchiveItemInformationSharingAgreementsPage",
component: () =>
import("@/pages/archive-items/ArchiveItemInformationSharingAgreementsPage.vue"),
diff --git a/web/src/use/use-breadcrumbs.ts b/web/src/use/use-breadcrumbs.ts
index 2c54b4bf..1fcf7f4b 100644
--- a/web/src/use/use-breadcrumbs.ts
+++ b/web/src/use/use-breadcrumbs.ts
@@ -10,7 +10,7 @@ export type Breadcrumb = {
}
export const BASE_CRUMB: Breadcrumb = {
- title: "Traditional Knowledge",
+ title: "Home",
disabled: false,
to: {
name: "DashboardPage",
diff --git a/web/src/use/use-information-sharing-agreement-archive-item.ts b/web/src/use/use-information-sharing-agreement-archive-item.ts
new file mode 100644
index 00000000..16d5e254
--- /dev/null
+++ b/web/src/use/use-information-sharing-agreement-archive-item.ts
@@ -0,0 +1,62 @@
+import { type Ref, reactive, toRefs, unref, watch } from "vue"
+import { isNil } from "lodash"
+
+import informationSharingAgreementArchiveItemsApi, {
+ type InformationSharingAgreementArchiveItem,
+} from "@/api/information-sharing-agreement-archive-items-api"
+
+export { type InformationSharingAgreementArchiveItem }
+
+export function useInformationSharingAgreementArchiveItem(
+ id: Ref
+) {
+ const state = reactive<{
+ informationSharingAgreementArchiveItem: InformationSharingAgreementArchiveItem | null
+ isLoading: boolean
+ isErrored: boolean
+ }>({
+ informationSharingAgreementArchiveItem: null,
+ isLoading: false,
+ isErrored: false,
+ })
+
+ async function fetch(): Promise {
+ const staticId = unref(id)
+ if (isNil(staticId)) {
+ throw new Error("id is required")
+ }
+
+ state.isLoading = true
+ try {
+ const { informationSharingAgreementArchiveItem } =
+ await informationSharingAgreementArchiveItemsApi.get(staticId)
+ state.isErrored = false
+ state.informationSharingAgreementArchiveItem = informationSharingAgreementArchiveItem
+ return informationSharingAgreementArchiveItem
+ } catch (error) {
+ console.error("Failed to fetch information sharing agreement knowledge item:", error)
+ state.isErrored = true
+ throw error
+ } finally {
+ state.isLoading = false
+ }
+ }
+
+ watch(
+ () => unref(id),
+ async (newId) => {
+ if (isNil(newId)) return
+
+ await fetch()
+ },
+ { immediate: true }
+ )
+
+ return {
+ ...toRefs(state),
+ fetch,
+ refresh: fetch,
+ }
+}
+
+export default useInformationSharingAgreementArchiveItem