From 3388ed5d0c87528ad559cbbf842a075a813ea29e Mon Sep 17 00:00:00 2001 From: CarliPinell Date: Tue, 8 Oct 2024 12:35:42 -0400 Subject: [PATCH] Saving progress 1 --- src/components/index.js | 2 + .../inspector/collection-records-list.vue | 6 + .../renderer/form-collection-view-control.vue | 235 ++++++++++++++++++ src/components/renderer/index.js | 1 + src/form-builder-controls.js | 41 +++ 5 files changed, 285 insertions(+) create mode 100644 src/components/renderer/form-collection-view-control.vue diff --git a/src/components/index.js b/src/components/index.js index 8f9d3fd0e..47e262f68 100644 --- a/src/components/index.js +++ b/src/components/index.js @@ -50,6 +50,7 @@ import VariableNameGenerator from "@/components/VariableNameGenerator"; import { LinkButton } from "./renderer"; import "../assets/css/tabs.css"; import FormCollectionRecordControl from "./renderer/form-collection-record-control.vue"; +import FormCollectionViewControl from "./renderer/form-collection-view-control.vue"; const rendererComponents = { ...renderer, @@ -165,6 +166,7 @@ export default { Vue.component("FormListTable", FormListTable); Vue.component("LinkButton", LinkButton); Vue.component("FormCollectionRecordControl", FormCollectionRecordControl); + Vue.component("FormCollectionViewControl", FormCollectionViewControl); const store = new Vuex.Store({ modules: { globalErrorsModule, diff --git a/src/components/inspector/collection-records-list.vue b/src/components/inspector/collection-records-list.vue index 61a73575e..15a4abe69 100644 --- a/src/components/inspector/collection-records-list.vue +++ b/src/components/inspector/collection-records-list.vue @@ -9,6 +9,12 @@ data-cy="inspector-collection" /> + diff --git a/src/components/renderer/form-collection-view-control.vue b/src/components/renderer/form-collection-view-control.vue new file mode 100644 index 000000000..2b935eeaf --- /dev/null +++ b/src/components/renderer/form-collection-view-control.vue @@ -0,0 +1,235 @@ + + + + + diff --git a/src/components/renderer/index.js b/src/components/renderer/index.js index fd8d4d664..dc0a61768 100755 --- a/src/components/renderer/index.js +++ b/src/components/renderer/index.js @@ -20,3 +20,4 @@ export { default as FormRequests } from "./form-requests.vue"; export { default as FormTasks } from "./form-tasks.vue"; export { default as LinkButton } from "./link-button.vue"; export { default as FormCollectionRecordControl } from "./form-collection-record-control.vue"; +export { default as FormCollectionViewControl } from "./form-collection-view-control.vue"; diff --git a/src/form-builder-controls.js b/src/form-builder-controls.js index 509a3af38..ae236b80a 100755 --- a/src/form-builder-controls.js +++ b/src/form-builder-controls.js @@ -12,6 +12,7 @@ import FileDownload from './components/renderer/file-download'; import FormListTable from './components/renderer/form-list-table'; import FormAnalyticsChart from "./components/renderer/form-analytics-chart"; import FormCollectionRecordControl from './components/renderer/form-collection-record-control.vue'; +import FormCollectionViewControl from './components/renderer/form-collection-view-control.vue'; import {DataTypeProperty, DataFormatProperty, DataTypeDateTimeProperty} from './VariableDataTypeProperties'; import { FormInput, @@ -1124,5 +1125,45 @@ export default [ }, ], }, + }, + { + editorComponent: FormCollectionViewControl, + editorBinding: 'FormCollectionViewControl', + rendererComponent: FormCollectionViewControl, + rendererBinding: 'FormCollectionViewControl', + control: { + popoverContent: "Create a Collection View Control", + order: 7.0, + group: 'Content Fields', + label: 'Collection Record View', + component: 'FormCollectionViewControl', + 'editor-component': 'FormCollectionViewControl', + 'editor-control': 'FormCollectionViewControl', + config: { + name: 'Collection View Control', + icon: 'fas fa-database', + label: 'Collection View Control', + }, + inspector: [ + { + type: "collectionRecordsList", + field: "collection", + config: { + label: 'Collection Name', + helper: 'Select a collection', + value: '', + } + }, + { + type: 'FormInput', + field: 'record', + config: { + label: 'Record ID', + helper: 'Supports Mustache Variable and the Collection Record', + value: '', + }, + } + ], + }, } ];