@raclettejs/workbench 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/README.md +1 -0
  2. package/config/compositions.js +282 -0
  3. package/config/interactionLinks.js +164 -0
  4. package/i18n/de-DE.json +245 -0
  5. package/i18n/en-EU.json +245 -0
  6. package/i18n/sk-SK.json +245 -0
  7. package/package.json +63 -0
  8. package/packages.json +33 -0
  9. package/plugins/pacifico__compositions/frontend/components/compositionConfiguration/CompositionConfiguration.vue +140 -0
  10. package/plugins/pacifico__compositions/frontend/components/compositionConfiguration/CompositionIntegration.vue +3 -0
  11. package/plugins/pacifico__compositions/frontend/components/compositionConfiguration/CompositionWidgetsLayout.vue +129 -0
  12. package/plugins/pacifico__compositions/frontend/components/compositionConfiguration/widgetsLayout/WidgetContextMenu.vue +53 -0
  13. package/plugins/pacifico__compositions/frontend/components/compositionConfiguration/widgetsLayout/WidgetIcon.vue +99 -0
  14. package/plugins/pacifico__compositions/frontend/components/compositionConfiguration/widgetsLayout/WidgetList.vue +122 -0
  15. package/plugins/pacifico__compositions/frontend/components/compositionConfiguration/widgetsLayout/WidgetRenderer.vue +65 -0
  16. package/plugins/pacifico__compositions/frontend/components/compositionConfiguration/widgetsLayout/WidgetSettings.vue +96 -0
  17. package/plugins/pacifico__compositions/frontend/widgets/CompositionCreateWidget.vue +51 -0
  18. package/plugins/pacifico__compositions/frontend/widgets/CompositionEditWidget.vue +66 -0
  19. package/plugins/pacifico__compositions/frontend/widgets/CompositionListWidget.vue +132 -0
  20. package/plugins/pacifico__compositions/raclette.plugin.ts +8 -0
  21. package/plugins/pacifico__core/backend/index.ts +25 -0
  22. package/plugins/pacifico__core/backend/routes.ts +220 -0
  23. package/plugins/pacifico__core/raclette.plugin.ts +9 -0
  24. package/plugins/pacifico__interactionLinks/frontend/components/InteractionLinkConfiguration.vue +145 -0
  25. package/plugins/pacifico__interactionLinks/frontend/widgets/InteractionLinkCreateWidget.vue +48 -0
  26. package/plugins/pacifico__interactionLinks/frontend/widgets/InteractionLinkEditWidget.vue +66 -0
  27. package/plugins/pacifico__interactionLinks/frontend/widgets/InteractionLinkListWidget.vue +126 -0
  28. package/plugins/pacifico__interactionLinks/raclette.plugin.ts +8 -0
  29. package/plugins/pacifico__plugins/frontend/index.ts +42 -0
  30. package/plugins/pacifico__plugins/frontend/widgets/PluginDetailWidget.vue +26 -0
  31. package/plugins/pacifico__plugins/frontend/widgets/PluginListWidget.vue +59 -0
  32. package/plugins/pacifico__plugins/raclette.plugin.ts +8 -0
  33. package/plugins/pacifico__tags/frontend/components/TagConfiguration.vue +99 -0
  34. package/plugins/pacifico__tags/frontend/widgets/TagCreateWidget.vue +43 -0
  35. package/plugins/pacifico__tags/frontend/widgets/TagEditWidget.vue +64 -0
  36. package/plugins/pacifico__tags/frontend/widgets/TagListWidget.vue +71 -0
  37. package/plugins/pacifico__tags/raclette.plugin.ts +8 -0
  38. package/plugins/pacifico__users/frontend/components/UserConfiguration.vue +110 -0
  39. package/plugins/pacifico__users/frontend/widgets/UserCreateWidget.vue +48 -0
  40. package/plugins/pacifico__users/frontend/widgets/UserEditWidget.vue +64 -0
  41. package/plugins/pacifico__users/frontend/widgets/UserListWidget.vue +86 -0
  42. package/plugins/pacifico__users/raclette.plugin.ts +8 -0
  43. package/raclette.config.js +150 -0
  44. package/services/frontend/.DS_Store +0 -0
  45. package/services/frontend/public/favicon.png +0 -0
  46. package/services/frontend/public/home-icon.png +0 -0
  47. package/services/frontend/public/logo.png +0 -0
  48. package/services/frontend/src/app/.DS_Store +0 -0
  49. package/services/frontend/src/app/components/BaseDataTable.vue +284 -0
  50. package/services/frontend/src/app/components/dynamicForm/DynamicForm.vue +207 -0
  51. package/services/frontend/src/app/components/dynamicForm/DynamicFormTypes.ts +63 -0
  52. package/services/frontend/src/app/components/dynamicForm/DynamicInput.vue +344 -0
  53. package/services/frontend/src/app/components/dynamicForm/TextDivider.vue +13 -0
  54. package/services/frontend/src/app/components/dynamicForm/testing/DynamicFormInputTesting.vue +477 -0
  55. package/services/frontend/src/app/components/dynamicForm/typedInputs/CheckboxInput.vue +16 -0
  56. package/services/frontend/src/app/components/dynamicForm/typedInputs/ColorInput.vue +52 -0
  57. package/services/frontend/src/app/components/dynamicForm/typedInputs/CompositionInput.vue +32 -0
  58. package/services/frontend/src/app/components/dynamicForm/typedInputs/IconInput.vue +40 -0
  59. package/services/frontend/src/app/components/dynamicForm/typedInputs/ListInput.vue +51 -0
  60. package/services/frontend/src/app/components/dynamicForm/typedInputs/LocalizedInput.vue +51 -0
  61. package/services/frontend/src/app/components/dynamicForm/typedInputs/PasswordInput.vue +23 -0
  62. package/services/frontend/src/app/components/dynamicForm/typedInputs/RecordInput.vue +91 -0
  63. package/services/frontend/src/app/components/dynamicForm/typedInputs/SwitchInput.vue +17 -0
  64. package/services/frontend/src/app/components/dynamicForm/typedInputs/TagsInput.vue +58 -0
  65. package/services/frontend/src/app/components/dynamicForm/typedInputs/TriggerInput.vue +159 -0
  66. package/services/frontend/src/app/components/dynamicForm/typedInputs/UserInput.vue +63 -0
  67. package/services/frontend/src/app/components/dynamicForm/typedInputs/mdi-icons.ts +7002 -0
  68. package/services/frontend/src/app/components/dynamicForm/validators.ts +19 -0
  69. package/services/frontend/src/app/components/stepNavigator/StepNavigator.vue +331 -0
  70. package/services/frontend/src/app/components/stepNavigator/StepNavigatorTypes.ts +12 -0
  71. package/services/frontend/src/app/composables/useUserHelper.ts +254 -0
  72. package/services/frontend/src/app/composables/useVantaFog.ts +37 -0
  73. package/services/frontend/src/app/composables/useWorkbenchPlugins.ts +44 -0
  74. package/services/frontend/src/orchestrator/.DS_Store +0 -0
  75. package/services/frontend/src/orchestrator/LoginApp.vue +62 -0
  76. package/services/frontend/src/orchestrator/WelcomeScreen.vue +39 -0
  77. package/services/frontend/src/orchestrator/assets/styles/themes/dark.ts +39 -0
  78. package/services/frontend/src/orchestrator/assets/styles/themes/highContrast.ts +39 -0
  79. package/services/frontend/src/orchestrator/assets/styles/themes/light.ts +39 -0
  80. package/services/frontend/src/orchestrator/components/InitProjectScreen.vue +298 -0
  81. package/services/frontend/src/orchestrator/components/LoginScreen.vue +73 -0
  82. package/services/frontend/src/orchestrator/components/RacletteAdCorner.vue +313 -0
  83. package/services/frontend/src/orchestrator/components/layout/AppButton.vue +109 -0
  84. package/services/frontend/src/orchestrator/components/layout/AppHeadline.vue +46 -0
  85. package/services/frontend/src/orchestrator/components/layout/AppLabelledInput.vue +94 -0
  86. package/services/frontend/src/orchestrator/components/layout/AppModal.vue +28 -0
  87. package/services/frontend/src/orchestrator/components/layout/SvgButtonArrow.vue +14 -0
  88. package/services/frontend/src/orchestrator/composables/useWelcomeScreen.ts +19 -0
  89. package/yarn.lock +3435 -0
@@ -0,0 +1,145 @@
1
+ <template>
2
+ <StepNavigator
3
+ :steps
4
+ :is-saving="disabled"
5
+ :show-save-button="isEditing"
6
+ @save="$emit('save')"
7
+ @save-and-finish="$emit('save-and-finish')"
8
+ >
9
+ <!-- @vue-generic {InteractionLinkCreate | InteractionLinkUpdate} -->
10
+ <DynamicForm
11
+ ref="dynamicFormRef"
12
+ v-model="interactionLink"
13
+ :data="inputFields"
14
+ :disabled
15
+ :title="
16
+ isEditing
17
+ ? $t('workbench.interactionLinkEdit.title')
18
+ : $t('workbench.interactionLinkCreate.title')
19
+ "
20
+ route-back-interaction-link-id="interactionLinkListInteractionLink"
21
+ />
22
+ </StepNavigator>
23
+ </template>
24
+
25
+ <script setup lang="ts">
26
+ import type {
27
+ InteractionLinkCreate,
28
+ InteractionLinkUpdate,
29
+ } from "@raclettejs/core"
30
+ import DynamicForm from "@app/components/dynamicForm/DynamicForm.vue"
31
+ import type { DynamicFormItem } from "@app/components/dynamicForm/DynamicFormTypes"
32
+ import { useI18n } from "vue-i18n"
33
+ import { computed, useTemplateRef } from "vue"
34
+ import { Step } from "@app/components/stepNavigator/StepNavigatorTypes"
35
+ import StepNavigator from "@app/components/stepNavigator/StepNavigator.vue"
36
+ import {
37
+ DEFAULT_SLOT_NAME,
38
+ DEFAULT_MODAL_SLOT_NAME,
39
+ } from "@raclettejs/core/orchestrator/router/routeParserHelper"
40
+
41
+ defineProps<{ disabled?: boolean; isEditing?: boolean }>()
42
+
43
+ defineEmits<{
44
+ (e: "save"): void
45
+ (e: "save-and-finish"): void
46
+ }>()
47
+
48
+ const interactionLink = defineModel<
49
+ InteractionLinkCreate | InteractionLinkUpdate
50
+ >({ required: true })
51
+
52
+ const dynamicFormRef = useTemplateRef("dynamicFormRef")
53
+
54
+ const { t } = useI18n()
55
+
56
+ const inputFields = computed<
57
+ DynamicFormItem<InteractionLinkCreate | InteractionLinkUpdate>[]
58
+ >(() => [
59
+ { divider: t("workbench.interactionLinkConfiguration.dividers.general") },
60
+ {
61
+ title: t("workbench.interactionLinkConfiguration.composition.title"),
62
+ description: t(
63
+ "workbench.interactionLinkConfiguration.composition.description",
64
+ ),
65
+ inputType: "composition",
66
+ field: "composition",
67
+ prependIcon: "file-document",
68
+ validation: { required: true },
69
+ },
70
+ {
71
+ title: t("workbench.interactionLinkConfiguration.description.title"),
72
+ description: t(
73
+ "workbench.interactionLinkConfiguration.description.description",
74
+ ),
75
+ inputType: "textarea",
76
+ field: "description",
77
+ prependIcon: "text",
78
+ },
79
+ {
80
+ title: t("workbench.interactionLinkConfiguration.tags.title"),
81
+ description: t("workbench.interactionLinkConfiguration.tags.description"),
82
+ inputType: "tags",
83
+ field: "tags",
84
+ prependIcon: "tag-multiple",
85
+ },
86
+ {
87
+ divider: t("workbench.interactionLinkConfiguration.dividers.behavior"),
88
+ },
89
+ {
90
+ title: t("workbench.interactionLinkConfiguration.slotType.title"),
91
+ description: t(
92
+ "workbench.interactionLinkConfiguration.slotType.description",
93
+ ),
94
+ inputType: "select",
95
+ field: "slotType",
96
+ selectItems: [DEFAULT_SLOT_NAME, DEFAULT_MODAL_SLOT_NAME],
97
+ prependIcon: "dock-window",
98
+ validation: {
99
+ required: true,
100
+ },
101
+ },
102
+ {
103
+ title: t("workbench.interactionLinkConfiguration.triggers.title"),
104
+ description: t(
105
+ "workbench.interactionLinkConfiguration.triggers.description",
106
+ ),
107
+ inputType: "triggers",
108
+ field: "triggers",
109
+ },
110
+ {
111
+ title: t("workbench.interactionLinkConfiguration.queryParameters.title"),
112
+ description: t(
113
+ "workbench.interactionLinkConfiguration.queryParameters.description",
114
+ ),
115
+ inputType: "list",
116
+ field: "queryParameters",
117
+ },
118
+ {
119
+ title: t("workbench.interactionLinkConfiguration.isLandingPage.title"),
120
+ description: t(
121
+ "workbench.interactionLinkConfiguration.isLandingPage.description",
122
+ ),
123
+ inputType: "switch",
124
+ field: "isLandingPage",
125
+ },
126
+ ])
127
+
128
+ const validateForm = (): boolean => {
129
+ const validateAllFields = dynamicFormRef.value?.validateAllFields
130
+
131
+ if (validateAllFields) {
132
+ const isValid = !!validateAllFields()
133
+
134
+ return isValid
135
+ }
136
+ return true
137
+ }
138
+
139
+ const steps = computed<Step[]>(() => [
140
+ {
141
+ id: "config",
142
+ validator: validateForm,
143
+ },
144
+ ])
145
+ </script>
@@ -0,0 +1,48 @@
1
+ <template>
2
+ <InteractionLinkConfiguration
3
+ v-model="newInteractionLink"
4
+ :disabled="isLoading"
5
+ @save-and-finish="onSubmit"
6
+ />
7
+ </template>
8
+
9
+ <script setup lang="ts">
10
+ import { ref } from "vue"
11
+ import InteractionLinkConfiguration from "../components/InteractionLinkConfiguration.vue"
12
+ import { InteractionLinkCreate } from "@raclettejs/core"
13
+ import {
14
+ useRouteState,
15
+ usePluginApi,
16
+ } from "@raclettejs/core/orchestrator/composables"
17
+ import { DEFAULT_SLOT_NAME } from "@raclettejs/core/orchestrator/router/routeParserHelper"
18
+
19
+ const props = defineProps<{
20
+ uuid: string
21
+ }>()
22
+
23
+ const { $data } = usePluginApi("raclette__core")
24
+ const { triggerInteractionLinkById } = useRouteState()
25
+
26
+ const { execute, isLoading, error } = $data.interactionLink.create()
27
+
28
+ const newInteractionLink = ref<InteractionLinkCreate>({
29
+ composition: "",
30
+ description: "",
31
+ slotType: DEFAULT_SLOT_NAME,
32
+ triggers: [],
33
+ tags: [],
34
+ queryParameters: [],
35
+ isLandingPage: false,
36
+ })
37
+
38
+ const navigateBack = () =>
39
+ triggerInteractionLinkById("interactionLinkListInteractionLink")
40
+
41
+ const onSubmit = async () => {
42
+ await execute(newInteractionLink.value)
43
+
44
+ if (!error.value) {
45
+ navigateBack()
46
+ }
47
+ }
48
+ </script>
@@ -0,0 +1,66 @@
1
+ <template>
2
+ <InteractionLinkConfiguration
3
+ v-if="editableInteractionLink"
4
+ v-model="editableInteractionLink"
5
+ :disabled="isLoading"
6
+ is-editing
7
+ @save="onSubmit"
8
+ />
9
+ </template>
10
+
11
+ <script setup lang="ts">
12
+ import { clone } from "ramda"
13
+ import type { InteractionLink } from "@raclettejs/core"
14
+ import {
15
+ usePluginApi,
16
+ useRouteState,
17
+ } from "@raclettejs/core/orchestrator/composables"
18
+ import { computed, ref, toRaw } from "vue"
19
+ import InteractionLinkConfiguration from "../components/InteractionLinkConfiguration.vue"
20
+ import { DEFAULT_SLOT_NAME } from "@raclettejs/core/orchestrator/router/routeParserHelper"
21
+
22
+ const props = defineProps<{
23
+ uuid: string
24
+ }>()
25
+
26
+ const { compositionSlots, triggerInteractionLinkById } = useRouteState()
27
+ const { $data } = usePluginApi("raclette__core")
28
+
29
+ const id = computed(
30
+ () =>
31
+ compositionSlots.value.find((slot) => slot.slotName === DEFAULT_SLOT_NAME)
32
+ ?.slotParams?.id,
33
+ )
34
+
35
+ const { data } = $data.interactionLink.get({
36
+ params: { _id: id.value },
37
+ options: {
38
+ immediate: true,
39
+ cb: () => {
40
+ if (!interactionLink.value) {
41
+ return navigateBack()
42
+ }
43
+
44
+ editableInteractionLink.value = clone(interactionLink.value)
45
+ },
46
+ },
47
+ })
48
+
49
+ const { execute: executeUpdate, isLoading } = $data.interactionLink.update()
50
+
51
+ const editableInteractionLink = ref<InteractionLink>()
52
+
53
+ const interactionLink = computed<InteractionLink | undefined>(() => {
54
+ if (!id.value) {
55
+ return undefined
56
+ }
57
+
58
+ return data.value?.[id.value]
59
+ })
60
+
61
+ const navigateBack = () =>
62
+ triggerInteractionLinkById("interactionLinkListInteractionLink")
63
+
64
+ const onSubmit = async () =>
65
+ await executeUpdate(toRaw(editableInteractionLink.value))
66
+ </script>
@@ -0,0 +1,126 @@
1
+ <template>
2
+ <BaseDataTable
3
+ :items="parsedInteractionLinks"
4
+ :loading="interactionLinksLoading || tagsLoading"
5
+ :headers="headers"
6
+ create-interaction-link-id="interactionLinkCreateInteractionLink"
7
+ edit-interaction-link-id="interactionLinkEditInteractionLink"
8
+ :data-name="$t('workbench.interactionLinkList.dataName')"
9
+ :data-article="$t('workbench.interactionLinkList.dataArticle')"
10
+ @delete="deleteInteractionLink"
11
+ >
12
+ <!-- Custom triggers column -->
13
+ <template #item.triggers="{ item }">
14
+ <span class="tw:flex tw:gap-2">
15
+ <span>{{ item.triggers }}</span>
16
+ <v-icon icon="mdi-link" />
17
+ </span>
18
+ </template>
19
+ </BaseDataTable>
20
+ </template>
21
+
22
+ <script setup lang="ts">
23
+ import BaseDataTable from "@app/components/BaseDataTable.vue"
24
+ import { InteractionLink } from "@raclettejs/core"
25
+ import { usePluginApi } from "@raclettejs/core/orchestrator/composables"
26
+ import { formatDistance } from "date-fns"
27
+ import { computed } from "vue"
28
+ import { useI18n } from "vue-i18n"
29
+
30
+ const { t } = useI18n()
31
+
32
+ const headers = computed<{ title: string; key: keyof InteractionLink }[]>(
33
+ () => [
34
+ {
35
+ title: t("workbench.interactionLinkList.tableHeaders.composition"),
36
+ key: "composition",
37
+ },
38
+ {
39
+ title: t("workbench.interactionLinkList.tableHeaders.tags"),
40
+ key: "tags",
41
+ },
42
+ {
43
+ title: t("workbench.interactionLinkList.tableHeaders.lastEditor"),
44
+ key: "lastEditor",
45
+ },
46
+ {
47
+ title: t("workbench.interactionLinkList.tableHeaders.slotType"),
48
+ key: "slotType",
49
+ },
50
+ {
51
+ title: t("workbench.interactionLinkList.tableHeaders.triggers"),
52
+ key: "triggers",
53
+ },
54
+ {
55
+ title: t("workbench.interactionLinkList.tableHeaders.author"),
56
+ key: "author",
57
+ },
58
+ {
59
+ title: t("workbench.interactionLinkList.tableHeaders.updatedAt"),
60
+ key: "updatedAt",
61
+ },
62
+ ],
63
+ )
64
+
65
+ const props = defineProps<{
66
+ uuid: string
67
+ }>()
68
+
69
+ const { $data, $socket } = usePluginApi("raclette__core")
70
+
71
+ const {
72
+ data: interactionLinks,
73
+ execute,
74
+ isLoading: interactionLinksLoading,
75
+ } = $data.interactionLink.getAll({
76
+ options: { immediate: true },
77
+ })
78
+
79
+ const { data: tags, isLoading: tagsLoading } = $data.tag.getAll({
80
+ options: { immediate: true },
81
+ })
82
+
83
+ const { data: users } = $data.user.getAll({
84
+ options: { immediate: true },
85
+ })
86
+
87
+ const { data: compositions } = $data.composition.getAll({
88
+ options: { immediate: true },
89
+ })
90
+
91
+ const { execute: executeDelete } = $data.interactionLink.delete({
92
+ options: { cb: () => execute() },
93
+ })
94
+
95
+ const parsedInteractionLinks = computed(() => {
96
+ if (interactionLinks.value && tags.value) {
97
+ return Object.values(
98
+ interactionLinks.value as { [key: string]: InteractionLink },
99
+ ).map((interactionLink) => {
100
+ return {
101
+ ...interactionLink,
102
+ composition: compositions.value?.[interactionLink.composition]?.title,
103
+ tags: interactionLink.tags.map((tag) => tags.value?.[tag]),
104
+ lastEditor: users.value?.[interactionLink.author]?.email,
105
+ author: users.value?.[interactionLink.author]?.email,
106
+ triggers: interactionLink.triggers.length,
107
+ createdAt: formatDistance(
108
+ new Date(interactionLink.createdAt),
109
+ new Date(),
110
+ ),
111
+ updatedAt: formatDistance(
112
+ new Date(interactionLink.updatedAt),
113
+ new Date(),
114
+ ),
115
+ }
116
+ })
117
+ }
118
+
119
+ return []
120
+ })
121
+
122
+ const deleteInteractionLink = async (interactionLink: InteractionLink) =>
123
+ await executeDelete({ _id: interactionLink._id })
124
+
125
+ $socket.on("interactionLinkCreated", () => execute())
126
+ </script>
@@ -0,0 +1,8 @@
1
+ export default {
2
+ name: "interactionLinks",
3
+ author: "pacifico",
4
+ version: "0.0.1",
5
+ description: "A plugin for interactionLinks",
6
+ // Specify where the main frontend and backend entry points are
7
+ frontendDir: "./frontend",
8
+ }
@@ -0,0 +1,42 @@
1
+ import { defineRaclettePluginFrontend } from "@raclettejs/core/frontend"
2
+
3
+ export default defineRaclettePluginFrontend({
4
+ i18n: {
5
+ de: {
6
+ pluginList: {
7
+ dataName: "Plugin",
8
+ dataArticle: "das",
9
+ tableHeaders: {
10
+ name: "Name",
11
+ author: "Autor",
12
+ version: "Version",
13
+ description: "Beschreibung",
14
+ },
15
+ },
16
+ },
17
+ en: {
18
+ pluginList: {
19
+ dataName: "Plugin",
20
+ dataArticle: "the",
21
+ tableHeaders: {
22
+ name: "Name",
23
+ author: "Author",
24
+ version: "Version",
25
+ description: "Description",
26
+ },
27
+ },
28
+ },
29
+ sk: {
30
+ pluginList: {
31
+ dataName: "Plugin",
32
+ dataArticle: "",
33
+ tableHeaders: {
34
+ name: "Názov",
35
+ author: "Autor",
36
+ version: "Verzia",
37
+ description: "Popis",
38
+ },
39
+ },
40
+ },
41
+ },
42
+ })
@@ -0,0 +1,26 @@
1
+ <template>
2
+ <WorkbenchPluginComponent v-if="WorkbenchPluginComponent" />
3
+ </template>
4
+
5
+ <script setup lang="ts">
6
+ import useWorkbenchPlugins from "@app/composables/useWorkbenchPlugins"
7
+ import { useRouteState } from "@raclettejs/core/orchestrator/composables"
8
+ import { computed } from "vue"
9
+ import { DEFAULT_SLOT_NAME } from "@raclettejs/core/orchestrator/router/routeParserHelper"
10
+
11
+ const { compositionSlots, triggerInteractionLinkById } = useRouteState()
12
+ const { getWorkbenchPlugin } = useWorkbenchPlugins()
13
+ const params = computed(
14
+ () =>
15
+ compositionSlots.value.find((slot) => slot.slotName === DEFAULT_SLOT_NAME)
16
+ ?.slotParams as { author: string; name: string } | undefined,
17
+ )
18
+
19
+ const navigateBack = () =>
20
+ triggerInteractionLinkById("pluginListInteractionLink")
21
+
22
+ if (!params.value) {
23
+ navigateBack()
24
+ }
25
+ const WorkbenchPluginComponent = await getWorkbenchPlugin(params.value)
26
+ </script>
@@ -0,0 +1,59 @@
1
+ <template>
2
+ <BaseDataTable
3
+ :items="pluginMetadataFiles"
4
+ :headers
5
+ :data-name="$i18n.t('pluginList.dataName')"
6
+ :data-article="$i18n.t('pluginList.dataArticle')"
7
+ :show-create-button="false"
8
+ :show-delete-action="false"
9
+ :show-actions-column="false"
10
+ :row-click-handler="onRowClick"
11
+ >
12
+ </BaseDataTable>
13
+ </template>
14
+
15
+ <script setup lang="ts">
16
+ import useWorkbenchPlugins from "@app/composables/useWorkbenchPlugins"
17
+ import BaseDataTable from "@app/components/BaseDataTable.vue"
18
+ import type { PluginMetadata } from "@raclettejs/core"
19
+ import { computed } from "vue"
20
+ import {
21
+ usePluginApi,
22
+ useRouteState,
23
+ } from "@raclettejs/core/orchestrator/composables"
24
+ import { DEFAULT_SLOT_NAME } from "@raclettejs/core/orchestrator/router/routeParserHelper"
25
+
26
+ const { pluginMetadataFiles, hasPluginSettingsWidget } = useWorkbenchPlugins()
27
+
28
+ const { $i18n } = usePluginApi()
29
+ const { triggerInteractionLinkById } = useRouteState()
30
+
31
+ const headers = computed<
32
+ { title: string; key: keyof PluginMetadata | "actions" }[]
33
+ >(() => [
34
+ {
35
+ title: $i18n.t("pluginList.tableHeaders.name"),
36
+ key: "name",
37
+ },
38
+ {
39
+ title: $i18n.t("pluginList.tableHeaders.author"),
40
+ key: "author",
41
+ },
42
+ {
43
+ title: $i18n.t("pluginList.tableHeaders.version"),
44
+ key: "version",
45
+ },
46
+ {
47
+ title: $i18n.t("pluginList.tableHeaders.description"),
48
+ key: "description",
49
+ },
50
+ ])
51
+
52
+ const onRowClick = (item: PluginMetadata) => {
53
+ if (item.pluginKey && hasPluginSettingsWidget(item.pluginKey)) {
54
+ triggerInteractionLinkById("pluginDetailInteractionLink", {
55
+ pluginKey: item.pluginKey,
56
+ })
57
+ }
58
+ }
59
+ </script>
@@ -0,0 +1,8 @@
1
+ export default {
2
+ name: "plugins",
3
+ author: "pacifico",
4
+ version: "0.0.1",
5
+ description: "A plugin for plugin configuration",
6
+ // Specify where the main frontend and backend entry points are
7
+ frontendDir: "./frontend",
8
+ }
@@ -0,0 +1,99 @@
1
+ <template>
2
+ <StepNavigator
3
+ :steps
4
+ :is-saving="disabled"
5
+ :show-save-button="isEditing"
6
+ @save="$emit('save')"
7
+ @save-and-finish="$emit('save-and-finish')"
8
+ >
9
+ <!-- @vue-generic {TagCreate | TagUpdate} -->
10
+ <DynamicForm
11
+ ref="dynamicFormRef"
12
+ v-model="tag"
13
+ :data="inputFields"
14
+ :disabled="props.disabled"
15
+ :title="
16
+ isEditing
17
+ ? $t('workbench.tagEdit.title')
18
+ : $t('workbench.tagCreate.title')
19
+ "
20
+ route-back-interaction-link-id="tagListInteractionLink"
21
+ />
22
+ </StepNavigator>
23
+ </template>
24
+
25
+ <script setup lang="ts">
26
+ import type { TagCreate, TagUpdate } from "@raclettejs/core"
27
+ import { useI18n } from "vue-i18n"
28
+ import { tagTypes } from "@shared/types/dataTypes/tags"
29
+ import DynamicForm from "@app/components/dynamicForm/DynamicForm.vue"
30
+ import type { DynamicFormItem } from "@app/components/dynamicForm/DynamicFormTypes"
31
+ import { computed, useTemplateRef } from "vue"
32
+ import { Step } from "@app/components/stepNavigator/StepNavigatorTypes"
33
+ import StepNavigator from "@app/components/stepNavigator/StepNavigator.vue"
34
+
35
+ const props = defineProps<{ disabled?: boolean; isEditing?: boolean }>()
36
+
37
+ defineEmits<{
38
+ (e: "save"): void
39
+ (e: "save-and-finish"): void
40
+ }>()
41
+
42
+ const tag = defineModel<TagCreate | TagUpdate>({ required: true })
43
+
44
+ const dynamicFormRef = useTemplateRef("dynamicFormRef")
45
+
46
+ const { t } = useI18n()
47
+
48
+ const inputFields: DynamicFormItem<TagCreate | TagUpdate>[] = [
49
+ {
50
+ divider: t("workbench.tagConfiguration.dividers.general"),
51
+ },
52
+ {
53
+ title: t("workbench.tagConfiguration.title.title"),
54
+
55
+ inputType: "text",
56
+ field: "title",
57
+ prependIcon: "text-short",
58
+ validation: {
59
+ required: true,
60
+ maxLength: 200,
61
+ },
62
+ },
63
+ {
64
+ title: t("workbench.tagConfiguration.color.title"),
65
+ inputType: "color",
66
+ field: "color",
67
+ prependIcon: "palette-outline",
68
+ },
69
+ {
70
+ title: t("workbench.tagConfiguration.type.title"),
71
+ description: t("workbench.tagConfiguration.type.description"),
72
+ inputType: "select",
73
+ selectItems: [...tagTypes],
74
+ field: "type",
75
+ prependIcon: "label-variant-outline",
76
+ validation: {
77
+ required: true,
78
+ },
79
+ },
80
+ ]
81
+
82
+ const validateForm = (): boolean => {
83
+ const validateAllFields = dynamicFormRef.value?.validateAllFields
84
+
85
+ if (validateAllFields) {
86
+ const isValid = !!validateAllFields()
87
+
88
+ return isValid
89
+ }
90
+ return true
91
+ }
92
+
93
+ const steps = computed<Step[]>(() => [
94
+ {
95
+ id: "config",
96
+ validator: validateForm,
97
+ },
98
+ ])
99
+ </script>
@@ -0,0 +1,43 @@
1
+ <template>
2
+ <TagConfiguration
3
+ v-model="newTag"
4
+ :disabled="isLoading"
5
+ @save-and-finish="onSubmit"
6
+ />
7
+ </template>
8
+
9
+ <script setup lang="ts">
10
+ import { ref } from "vue"
11
+ import TagConfiguration from "../components/TagConfiguration.vue"
12
+ import { TagCreate } from "@raclettejs/core"
13
+ import {
14
+ useRouteState,
15
+ usePluginApi,
16
+ } from "@raclettejs/core/orchestrator/composables"
17
+ import { DEFAULT_SLOT_NAME } from "@raclettejs/core/orchestrator/router/routeParserHelper"
18
+
19
+ const props = defineProps<{
20
+ uuid: string
21
+ }>()
22
+
23
+ const { $data } = usePluginApi("raclette__core")
24
+ const { triggerInteractionLinkById } = useRouteState()
25
+
26
+ const { execute, isLoading, error } = $data.tag.create()
27
+
28
+ const newTag = ref<TagCreate>({
29
+ title: "",
30
+ color: "#FFFFFF",
31
+ type: "",
32
+ })
33
+
34
+ const navigateBack = () => triggerInteractionLinkById("tagListInteractionLink")
35
+
36
+ const onSubmit = async () => {
37
+ await execute(newTag.value)
38
+
39
+ if (!error.value) {
40
+ navigateBack()
41
+ }
42
+ }
43
+ </script>