diff --git a/components/Dataservices/AdminDataservicesPage.vue b/components/Dataservices/AdminDataservicesPage.vue index 855d3a58..785cfdb3 100644 --- a/components/Dataservices/AdminDataservicesPage.vue +++ b/components/Dataservices/AdminDataservicesPage.vue @@ -29,6 +29,12 @@

{{ t("Dataservices") }}

+
{ } }) -const { data: pageData, status } = await useAPI>('/api/1/dataservices/', { lazy: true, query: params }) +const { data: pageData, status, refresh } = await useAPI>('/api/1/dataservices/', { lazy: true, query: params }) diff --git a/components/Dataservices/AdminUpdateDataservicePage.vue b/components/Dataservices/AdminUpdateDataservicePage.vue index 4ed099d7..229721af 100644 --- a/components/Dataservices/AdminUpdateDataservicePage.vue +++ b/components/Dataservices/AdminUpdateDataservicePage.vue @@ -16,6 +16,11 @@
+ `/api/1/dataservices/${route.params.id}`) const { data: dataservice, refresh } = await useAPI(url, { lazy: true }) +const dataserviceSubject = computed(() => { + return { + ...dataservice.value, + page: dataservice.value.self_web_url, + } +}) const dataserviceForm = ref(null) watchEffect(() => { dataserviceForm.value = toForm(dataservice.value) diff --git a/components/LinkToSubject.vue b/components/LinkToSubject.vue index 2005c39b..9a30c726 100644 --- a/components/LinkToSubject.vue +++ b/components/LinkToSubject.vue @@ -16,15 +16,17 @@ diff --git a/components/Reuses/AdminUpdateReusePage.vue b/components/Reuses/AdminUpdateReusePage.vue index b82e4899..96d45868 100644 --- a/components/Reuses/AdminUpdateReusePage.vue +++ b/components/Reuses/AdminUpdateReusePage.vue @@ -15,45 +15,52 @@ {{ t("Save") }} - - {{ $t("Be careful, this action can't be reverse.") }} - + +
diff --git a/components/TransferBanner.vue b/components/TransferBanner.vue index 3fae2332..edc0d218 100644 --- a/components/TransferBanner.vue +++ b/components/TransferBanner.vue @@ -86,14 +86,14 @@ \ No newline at end of file +const transfersWithSubject = computed(() => transfers.value.map((transfer) => { + if (transfer.subject.class !== 'Dataservice') { + return transfer + } + return { + ...transfer, + subject: { + ...transfer.subject, + page: transfer.subject.self_web_url, + }, + } +})) + diff --git a/types/types.d.ts b/types/types.d.ts index 5794748a..77fdb592 100644 --- a/types/types.d.ts +++ b/types/types.d.ts @@ -254,12 +254,17 @@ export type ContactPoint = { export type NewContactPoint = Omit export type ContactPointInForm = ContactPoint | NewContactPoint +export type LinkToSubject = { + title: string + page: string +} + export type TransferRequest = { id: string user: User | null // TODO add this in API owner: (User & { class: 'User' }) | (Organization & { class: 'Organization' }) recipient: (User & { class: 'User' }) | (Organization & { class: 'Organization' }) - subject: (Dataset & { class: 'Dataset' }) | (Reuse & { class: 'Reuse' }) + subject: (Dataset & { class: 'Dataset' }) | (Reuse & { class: 'Reuse' }) | (LinkToSubject & Dataservice & { class: 'Dataservice' }) comment: string created: string status: 'pending' | 'accepted' | 'refused'