From 1d71a994772bd650f742031178420d5561334f47 Mon Sep 17 00:00:00 2001 From: James Chang Date: Thu, 11 Nov 2021 18:28:08 -0500 Subject: [PATCH] Resolve #28: Add embeddable iframe for sharing PB Cards --- .../interface/viewPbCardInterface.vue | 26 +++++ frontend/layouts/lite.vue | 78 +++++++++++++ frontend/pages/pb-card.vue | 105 ++++++++++++++++++ 3 files changed, 209 insertions(+) create mode 100644 frontend/layouts/lite.vue create mode 100644 frontend/pages/pb-card.vue diff --git a/frontend/components/interface/viewPbCardInterface.vue b/frontend/components/interface/viewPbCardInterface.vue index 963caf6..3b4ed25 100644 --- a/frontend/components/interface/viewPbCardInterface.vue +++ b/frontend/components/interface/viewPbCardInterface.vue @@ -13,6 +13,13 @@ > mdi-share-variant + + mdi-code-tags + mdi-refresh @@ -312,6 +319,25 @@ export default { copyToClipboard(this, shareUrl) }, + // links to a version of the page that can be embedded in an iframe + copyEmbedLink() { + const createdById = this.lockedFilters.find( + (ele) => ele.field === 'createdBy.id' + )?.value + + if (!createdById) return + + const embedUrl = + window.location.origin + + this.$router.resolve({ + name: 'pb-card', + query: { + id: createdById, + }, + }).href + copyToClipboard(this, embedUrl) + }, + openAddRecordDialog(eventId, key) { const initializedRecord = { 'event.id': eventId, diff --git a/frontend/layouts/lite.vue b/frontend/layouts/lite.vue new file mode 100644 index 0000000..49cf7d3 --- /dev/null +++ b/frontend/layouts/lite.vue @@ -0,0 +1,78 @@ + + + diff --git a/frontend/pages/pb-card.vue b/frontend/pages/pb-card.vue new file mode 100644 index 0000000..f9cf140 --- /dev/null +++ b/frontend/pages/pb-card.vue @@ -0,0 +1,105 @@ + + +