From 346ee43872a5a859ea384d5359eb25863930ac37 Mon Sep 17 00:00:00 2001 From: Matthew White Date: Tue, 26 Nov 2024 14:43:31 -0500 Subject: [PATCH] Add hover card to show a form --- src/components/audit/row.vue | 10 ++-- src/components/form/link.vue | 41 ++++++++++++++ src/components/form/row.vue | 17 +++--- src/components/hover-card/form.vue | 45 ++++++++++++++++ src/components/hover-cards.vue | 7 +++ src/components/link-if-can.vue | 12 ++++- src/components/project/form-access/row.vue | 5 +- src/components/project/form-row.vue | 23 ++++---- test/components/audit/table.spec.js | 7 ++- test/components/project/form-row.spec.js | 63 +++++++--------------- 10 files changed, 158 insertions(+), 72 deletions(-) create mode 100644 src/components/form/link.vue create mode 100644 src/components/hover-card/form.vue diff --git a/src/components/audit/row.vue b/src/components/audit/row.vue index 5b4b7b3db..e95472334 100644 --- a/src/components/audit/row.vue +++ b/src/components/audit/row.vue @@ -53,6 +53,7 @@ import { pick } from 'ramda'; import ActorLink from '../actor-link.vue'; import DatasetLink from '../dataset/link.vue'; +import FormLink from '../form/link.vue'; import DateTime from '../date-time.vue'; import Selectable from '../selectable.vue'; @@ -93,7 +94,8 @@ const acteeSpeciesByCategory = { }, form: { title: (actee) => (actee.name != null ? actee.name : actee.xmlFormId), - path: (actee, { primaryFormPath }) => primaryFormPath(actee) + component: FormLink, + props: (actee) => ({ form: actee }) }, dataset: { title: (actee) => actee.name, @@ -114,7 +116,7 @@ acteeSpeciesByCategory.upgrade = acteeSpeciesByCategory.form; export default { name: 'AuditRow', - components: { ActorLink, DatasetLink, DateTime, Selectable }, + components: { ActorLink, DatasetLink, DateTime, FormLink, Selectable }, props: { audit: { type: Object, @@ -123,8 +125,8 @@ export default { }, setup() { const { actionMessage } = useAudit(); - const { projectPath, primaryFormPath, userPath } = useRoutes(); - return { actionMessage, projectPath, primaryFormPath, userPath }; + const { projectPath, userPath } = useRoutes(); + return { actionMessage, projectPath, userPath }; }, computed: { // When an audit log action has multiple parts/segments, we treat it as diff --git a/src/components/form/link.vue b/src/components/form/link.vue new file mode 100644 index 000000000..de81c7f70 --- /dev/null +++ b/src/components/form/link.vue @@ -0,0 +1,41 @@ + + + + diff --git a/src/components/form/row.vue b/src/components/form/row.vue index 1285b6b0e..bc910433f 100644 --- a/src/components/form/row.vue +++ b/src/components/form/row.vue @@ -12,9 +12,7 @@ except according to the terms contained in the LICENSE file.