@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,62 @@
1
+ <template>
2
+ <v-app>
3
+ <v-main>
4
+ <InitProjectScreen v-if="noUsers" @finish="onSubmitLogin" />
5
+ <LoginScreen v-else @submit="onSubmitLogin" />
6
+
7
+ <SnackStack />
8
+ </v-main>
9
+ </v-app>
10
+ </template>
11
+
12
+ <script setup lang="ts">
13
+ import {
14
+ userNotifier,
15
+ type LoginResponse,
16
+ } from "@raclettejs/core/frontend"
17
+ import LoginScreen from "./components/LoginScreen.vue"
18
+ import { SnackStack } from "@raclettejs/core/orchestrator"
19
+ import { useTheme } from "vuetify"
20
+ import { defineAsyncComponent } from "vue"
21
+
22
+ const InitProjectScreen = defineAsyncComponent(
23
+ () => import("./components/InitProjectScreen.vue"),
24
+ )
25
+
26
+ const props = withDefaults(
27
+ defineProps<{
28
+ loginMethod?: ({
29
+ email,
30
+ password,
31
+ }: {
32
+ email: string
33
+ password: string
34
+ }) => Promise<LoginResponse>
35
+ noUsers: boolean
36
+ }>(),
37
+ { loginMethod: undefined },
38
+ )
39
+
40
+ useTheme().change("light")
41
+
42
+ const onSubmitLogin = async ({
43
+ email,
44
+ password,
45
+ }: {
46
+ email: string
47
+ password: string
48
+ }) => {
49
+ if (props.loginMethod) {
50
+ const { success, message, redirect } = await props.loginMethod({
51
+ email,
52
+ password,
53
+ })
54
+
55
+ if (success) {
56
+ redirect?.()
57
+ } else if (message) {
58
+ userNotifier.add(message, "error")
59
+ }
60
+ }
61
+ }
62
+ </script>
@@ -0,0 +1,39 @@
1
+ <template>
2
+ <div class="tw:p-4">
3
+ <h1 v-html="$t('workbench.welcomeScreen.title')"></h1>
4
+
5
+ <v-list density="compact" disabled>
6
+ <v-list-subheader
7
+ ><h3>
8
+ {{ $t("workbench.welcomeScreen.whatIsWhat") }}
9
+ </h3></v-list-subheader
10
+ >
11
+
12
+ <v-list-item
13
+ v-for="(item, i) in whatIsWhatItems"
14
+ :key="i"
15
+ :value="item"
16
+ color="primary"
17
+ >
18
+ <template #prepend>
19
+ <v-icon :icon="item.icon"></v-icon>
20
+ </template>
21
+
22
+ <v-list-item-title>
23
+ {{ $t("workbench.welcomeScreen." + item.i18nKey) }}
24
+ </v-list-item-title>
25
+ </v-list-item>
26
+ </v-list>
27
+ </div>
28
+ </template>
29
+
30
+ <script setup lang="ts">
31
+ import { ref } from "vue"
32
+ const whatIsWhatItems = ref([
33
+ { i18nKey: "compositionInfo", icon: "mdi-file-document" },
34
+ { i18nKey: "interactionLinkInfo", icon: "mdi-link-box-variant" },
35
+ { i18nKey: "userInfo", icon: "mdi-account-details" },
36
+ { i18nKey: "tagInfo", icon: "mdi-tag" },
37
+ { i18nKey: "pluginInfo", icon: "mdi-puzzle" },
38
+ ])
39
+ </script>
@@ -0,0 +1,39 @@
1
+ /**
2
+ * dark theme
3
+ */
4
+ export default {
5
+ background: "#212121",
6
+ surface: "#212121",
7
+ primary: "#DD8B41",
8
+ "primary-darken-1": "#C47A39",
9
+ "primary-darken-2": "#AB6A32",
10
+ "primary-darken-3": "#925A2B",
11
+ "primary-darken-4": "#784A24",
12
+ "primary-darken-5": "#5F3B1D",
13
+ "primary-darken-6": "#462B16",
14
+ "primary-darken-7": "#2D1C0F",
15
+ "primary-lighten-1": "#E39C5B",
16
+ "primary-lighten-2": "#E9AD76",
17
+ "primary-lighten-3": "#EEBE90",
18
+ "primary-lighten-4": "#F4CFAA",
19
+ "primary-lighten-5": "#F9E0C5",
20
+ "primary-lighten-6": "#FDF1DF",
21
+ "primary-lighten-7": "#FFFAF4",
22
+ secondary: "#3DB7E3",
23
+ "secondary-darken-1": "#2C99C1",
24
+ "secondary-darken-2": "#1F7A9D",
25
+ error: "#FF5252",
26
+ info: "#42A5F5",
27
+ success: "#3A823D",
28
+ warning: "#FFA726",
29
+ "surface-2": "#000",
30
+ "surface-3": "#333333",
31
+ "surface-4": "#666666",
32
+ "border-default": "#666666",
33
+ "signal-1": "#9aeba3",
34
+ "signal-2": "#dafdba",
35
+ "signal-3": "#a0c7d9",
36
+ "page-nav-bg": "#121212",
37
+ "page-nav-active": "#DD8B41",
38
+ "topbar-bg": "#FFEEDD",
39
+ }
@@ -0,0 +1,39 @@
1
+ /**
2
+ * dark theme
3
+ */
4
+ export default {
5
+ background: "#000000",
6
+ surface: "#0A0A0A",
7
+ primary: "#FF9E30",
8
+ "primary-darken-1": "#E38B00",
9
+ "primary-darken-2": "#C67800",
10
+ "primary-darken-3": "#A96600",
11
+ "primary-darken-4": "#8C5300",
12
+ "primary-darken-5": "#6F4200",
13
+ "primary-darken-6": "#523000",
14
+ "primary-darken-7": "#351F00",
15
+ "primary-lighten-1": "#FFB55F",
16
+ "primary-lighten-2": "#FFCA8E",
17
+ "primary-lighten-3": "#FFDCB4",
18
+ "primary-lighten-4": "#FFEDD9",
19
+ "primary-lighten-5": "#FFF6EC",
20
+ "primary-lighten-6": "#FFFBF5",
21
+ "primary-lighten-7": "#FFFFFF",
22
+ secondary: "#00D9FF",
23
+ "secondary-darken-1": "#00B8D9",
24
+ "secondary-darken-2": "#0097B3",
25
+ error: "#FF2929",
26
+ info: "#29B6FF",
27
+ success: "#1FE01F",
28
+ warning: "#FFBB00",
29
+ "surface-2": "#111111",
30
+ "surface-3": "#333333",
31
+ "surface-4": "#555555",
32
+ "border-default": "#FFFFFF",
33
+ "signal-1": "#00FF00",
34
+ "signal-2": "#FFFF00",
35
+ "signal-3": "#00FFFF",
36
+ "page-nav-bg": "#0A0A0A",
37
+ "page-nav-active": "#FF9E30",
38
+ "topbar-bg": "#FFEEDD",
39
+ }
@@ -0,0 +1,39 @@
1
+ /**
2
+ * light theme
3
+ */
4
+ export default {
5
+ background: "#F4F4F4",
6
+ surface: "#F4F4F4",
7
+ primary: "#DD8B41",
8
+ "primary-darken-1": "#B26F34",
9
+ "primary-darken-2": "#9D612E",
10
+ "primary-darken-3": "#875428",
11
+ "primary-darken-4": "#724622",
12
+ "primary-darken-5": "#5C391C",
13
+ "primary-darken-6": "#472C16",
14
+ "primary-darken-7": "#311F10",
15
+ "primary-lighten-1": "#E19D5D",
16
+ "primary-lighten-2": "#E6AE78",
17
+ "primary-lighten-3": "#EAC094",
18
+ "primary-lighten-4": "#EFD1B0",
19
+ "primary-lighten-5": "#F3E2CC",
20
+ "primary-lighten-6": "#F8F3E8",
21
+ "primary-lighten-7": "#FCF9F4",
22
+ secondary: "#2D9CCA",
23
+ "secondary-darken-1": "#247DA1",
24
+ "secondary-darken-2": "#1B5D78",
25
+ error: "#B00020",
26
+ info: "#2196F3",
27
+ success: "#3A823D",
28
+ warning: "#FB8C00",
29
+ "surface-2": "#F4F4F4",
30
+ "surface-3": "#CCCCCC",
31
+ "surface-4": "#888888",
32
+ "border-default": "#CCC",
33
+ "signal-1": "#9aeba3",
34
+ "signal-2": "#dafdba",
35
+ "signal-3": "#a0c7d9",
36
+ "page-nav-bg": "#F4F4F4",
37
+ "page-nav-active": "#DD8B41",
38
+ "topbar-bg": "#FFEEDD",
39
+ }
@@ -0,0 +1,298 @@
1
+ <template>
2
+ <StepNavigator
3
+ class="tw:h-full init-screen-gradient"
4
+ :steps
5
+ padding-top
6
+ :allow-free-navigation="false"
7
+ @save-and-finish="onFinish()"
8
+ >
9
+ <template #default="{ currentStep }">
10
+ <!-- Main Content -->
11
+ <AppModal>
12
+ <template #header>
13
+ <h1 class="tw:text-4xl tw:font-bold tw:text-gray-800 tw:mb-4">
14
+ {{ $t("workbench.welcomeScreen.wizard.title") }}
15
+ <span class="tw:font-bold tw:tracking-[1px] tw:font-[quicksand]">
16
+ raclette!
17
+ </span>
18
+ </h1>
19
+ </template>
20
+
21
+ <template #default>
22
+ <!-- Step Content -->
23
+ <template
24
+ v-if="
25
+ currentStep.id === 'application-name' ||
26
+ currentStep.id === 'register-admin'
27
+ "
28
+ >
29
+ <!-- @vue-generic {typeof newProject} -->
30
+ <DynamicForm
31
+ ref="dynamicFormRef"
32
+ v-model="newProject"
33
+ :data="getCurrentInputFields(currentStep.id)"
34
+ :validate-on-change="false"
35
+ :title="$t('workbench.welcomeScreen.wizard.setupTitle')"
36
+ />
37
+ </template>
38
+
39
+ <!-- Confirmation overview -->
40
+ <div v-else class="tw:space-y-8">
41
+ <div class="tw:text-center tw:mb-8">
42
+ <h2 class="tw:text-2xl tw:font-semibold tw:text-gray-700 tw:mb-2">
43
+ {{ $t("workbench.welcomeScreen.wizard.thatsIt") }}
44
+ </h2>
45
+ </div>
46
+
47
+ <div class="tw:space-y-6">
48
+ <div class="tw:bg-gray-50 tw:rounded-lg tw:p-6">
49
+ <h3
50
+ class="tw:text-lg tw:font-semibold tw:text-gray-800 tw:mb-4"
51
+ >
52
+ Summary of your configuration:
53
+ </h3>
54
+
55
+ <div class="tw:space-y-3">
56
+ <div
57
+ class="tw:flex tw:justify-between tw:items-center tw:py-2 tw:border-b tw:border-gray-200"
58
+ >
59
+ <span class="tw:text-gray-600">Application Name:</span>
60
+ <span class="tw:font-medium tw:text-gray-800">{{
61
+ newProject.projectTitle
62
+ }}</span>
63
+ </div>
64
+ <div
65
+ class="tw:flex tw:justify-between tw:items-center tw:py-2 tw:border-b tw:border-gray-200"
66
+ >
67
+ <span class="tw:text-gray-600">Admin Name:</span>
68
+ <span class="tw:font-medium tw:text-gray-800"
69
+ >{{ newProject.firstname }}
70
+ {{ newProject.lastname }}</span
71
+ >
72
+ </div>
73
+ <div
74
+ class="tw:flex tw:justify-between tw:items-center tw:py-2 tw:border-b tw:border-gray-200"
75
+ >
76
+ <span class="tw:text-gray-600">Admin Email:</span>
77
+ <span class="tw:font-medium tw:text-gray-800">{{
78
+ newProject.email
79
+ }}</span>
80
+ </div>
81
+ <div
82
+ class="tw:flex tw:justify-between tw:items-center tw:py-2"
83
+ >
84
+ <span class="tw:text-gray-600">Password:</span>
85
+ <div class="tw:flex tw:items-center tw:space-x-2">
86
+ <span class="tw:font-medium tw:text-gray-800">
87
+ {{
88
+ showConfirmPassword ? newProject.password : "••••••••"
89
+ }}
90
+ </span>
91
+ <button
92
+ type="button"
93
+ @click="showConfirmPassword = !showConfirmPassword"
94
+ class="tw:text-gray-500 hover:tw:text-gray-700 tw:transition-colors"
95
+ >
96
+ <svg
97
+ v-if="showConfirmPassword"
98
+ class="tw:w-4 tw:h-4"
99
+ fill="none"
100
+ stroke="currentColor"
101
+ viewBox="0 0 24 24"
102
+ >
103
+ <path
104
+ stroke-linecap="round"
105
+ stroke-linejoin="round"
106
+ stroke-width="2"
107
+ d="M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.878 9.878L8.464 8.464M9.878 9.878L8.464 11.05M14.12 14.12l1.415 1.415M14.12 14.12L15.536 15.536M14.12 14.12l1.415-1.415M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
108
+ ></path>
109
+ </svg>
110
+ <svg
111
+ v-else
112
+ class="tw:w-4 tw:h-4"
113
+ fill="none"
114
+ stroke="currentColor"
115
+ viewBox="0 0 24 24"
116
+ >
117
+ <path
118
+ stroke-linecap="round"
119
+ stroke-linejoin="round"
120
+ stroke-width="2"
121
+ d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"
122
+ ></path>
123
+ <path
124
+ stroke-linecap="round"
125
+ stroke-linejoin="round"
126
+ stroke-width="2"
127
+ d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"
128
+ ></path>
129
+ </svg>
130
+ </button>
131
+ </div>
132
+ </div>
133
+ </div>
134
+ </div>
135
+
136
+ <v-alert type="info" variant="tonal">
137
+ <p>
138
+ {{ $t("workbench.welcomeScreen.wizard.submitText") }}
139
+ </p>
140
+
141
+ <p>
142
+ {{ $t("workbench.welcomeScreen.wizard.loginWithAccount") }}
143
+ </p>
144
+ </v-alert>
145
+ </div>
146
+ </div>
147
+ </template>
148
+ </AppModal>
149
+ </template>
150
+ </StepNavigator>
151
+ </template>
152
+
153
+ <script setup lang="ts">
154
+ import DynamicForm from "@app/components/dynamicForm/DynamicForm.vue"
155
+ import { DynamicFormItem } from "@app/components/dynamicForm/DynamicFormTypes"
156
+ import StepNavigator from "@app/components/stepNavigator/StepNavigator.vue"
157
+ import { Step } from "@app/components/stepNavigator/StepNavigatorTypes"
158
+ import { computed, reactive, ref, useTemplateRef } from "vue"
159
+ import { useI18n } from "vue-i18n"
160
+ import AppModal from "./layout/AppModal.vue"
161
+ import useWelcomeScreen from "../composables/useWelcomeScreen"
162
+ import { userNotifier } from "@raclettejs/core/frontend"
163
+
164
+ type StepKey = "confirm" | "application-name" | "register-admin"
165
+ const emit = defineEmits<{ finish: [{ email: string; password: string }] }>()
166
+
167
+ const dynamicFormRef = useTemplateRef("dynamicFormRef")
168
+
169
+ const { initProject } = useWelcomeScreen()
170
+
171
+ const { t } = useI18n()
172
+
173
+ const newProject = reactive({
174
+ projectTitle: "",
175
+ email: "",
176
+ firstname: "",
177
+ lastname: "",
178
+ password: "",
179
+ })
180
+
181
+ const showConfirmPassword = ref(false)
182
+
183
+ const steps = computed<Step<StepKey>[]>(() => [
184
+ {
185
+ id: "application-name",
186
+ validator: validateConfigStep,
187
+ },
188
+ {
189
+ id: "register-admin",
190
+ validator: validateConfigStep,
191
+ },
192
+ {
193
+ id: "confirm",
194
+ },
195
+ ])
196
+
197
+ const validateConfigStep = (): boolean => {
198
+ const validateAllFields = dynamicFormRef.value?.validateAllFields
199
+
200
+ if (validateAllFields) {
201
+ const isValid = !!validateAllFields()
202
+
203
+ return isValid
204
+ }
205
+ return true
206
+ }
207
+
208
+ const inputFieldsStepApplicationName = computed<
209
+ DynamicFormItem<typeof newProject>[]
210
+ >(() => [
211
+ {
212
+ title: t("workbench.welcomeScreen.wizard.projectTitle_title"),
213
+ description: t("workbench.welcomeScreen.wizard.projectTitle_description"),
214
+ inputType: "text",
215
+ field: "projectTitle",
216
+ validation: {
217
+ required: true,
218
+ maxLength: 200,
219
+ },
220
+ },
221
+ ])
222
+
223
+ const inputFieldsStepRegisterAdmin = computed<
224
+ DynamicFormItem<typeof newProject>[]
225
+ >(() => [
226
+ {
227
+ title: t("workbench.welcomeScreen.wizard.yourFirstName"),
228
+ inputType: "text",
229
+ field: "firstname",
230
+ validation: {
231
+ required: true,
232
+ },
233
+ },
234
+ {
235
+ title: t("workbench.welcomeScreen.wizard.yourLastName"),
236
+ inputType: "text",
237
+ field: "lastname",
238
+ validation: {
239
+ required: true,
240
+ },
241
+ },
242
+ {
243
+ title: t("workbench.welcomeScreen.wizard.email_title"),
244
+ description: t("workbench.welcomeScreen.wizard.email_description"),
245
+ inputType: "text",
246
+ field: "email",
247
+ validation: {
248
+ required: true,
249
+ },
250
+ },
251
+ {
252
+ title: t("workbench.welcomeScreen.wizard.password"),
253
+ inputType: "password",
254
+ field: "password",
255
+ validation: {
256
+ required: true,
257
+ },
258
+ },
259
+ ])
260
+
261
+ const getCurrentInputFields = (stepId: string) => {
262
+ if (stepId === "application-name") {
263
+ return inputFieldsStepApplicationName.value
264
+ }
265
+ if (stepId === "register-admin") {
266
+ return inputFieldsStepRegisterAdmin.value
267
+ }
268
+ if (stepId === "confirm") {
269
+ }
270
+ }
271
+
272
+ const onFinish = async () => {
273
+ try {
274
+ await initProject({
275
+ title: newProject.projectTitle,
276
+ user: {
277
+ email: newProject.email,
278
+ password: newProject.password,
279
+ firstname: newProject.firstname,
280
+ lastname: newProject.lastname,
281
+ },
282
+ })
283
+ emit("finish", newProject)
284
+ } catch (error) {
285
+ console.error(error)
286
+ userNotifier.add(
287
+ error.response ? error.response?.data?.error : error.message,
288
+ "red",
289
+ )
290
+ }
291
+ }
292
+ </script>
293
+
294
+ <style scoped>
295
+ .init-screen-gradient {
296
+ background: linear-gradient(180deg, #ffeede 0%, #bc9979 100%);
297
+ }
298
+ </style>
@@ -0,0 +1,73 @@
1
+ <template>
2
+ <div ref="rootContainer" class="tw:h-full">
3
+ <AppModal :title="$t('workbench.loginScreen.title')">
4
+ <v-form ref="formRef" @submit.prevent="onClickSubmit()">
5
+ <v-text-field
6
+ v-model="loginData.email"
7
+ :label="$t('workbench.loginScreen.eMail')"
8
+ variant="outlined"
9
+ type="email"
10
+ :rules="emailRules"
11
+ required
12
+ class="tw:mb-4"
13
+ />
14
+
15
+ <v-text-field
16
+ v-model="loginData.password"
17
+ :label="$t('workbench.loginScreen.password')"
18
+ variant="outlined"
19
+ :type="showPassword ? 'text' : 'password'"
20
+ :rules="passwordRules"
21
+ :append-inner-icon="showPassword ? 'mdi-eye-off' : 'mdi-eye'"
22
+ @click:append-inner="showPassword = !showPassword"
23
+ required
24
+ class="tw:mb-4"
25
+ />
26
+
27
+ <AppButton class="tw:w-full" type="submit">
28
+ {{ $t("workbench.loginScreen.login") }}
29
+ </AppButton>
30
+ </v-form>
31
+ </AppModal>
32
+
33
+ <RacletteAdCorner />
34
+ </div>
35
+ </template>
36
+
37
+ <script setup lang="ts">
38
+ import AppButton from "./layout/AppButton.vue"
39
+ import { reactive, ref, useTemplateRef } from "vue"
40
+ import AppModal from "./layout/AppModal.vue"
41
+ import useVantaFog from "@app/composables/useVantaFog"
42
+ import RacletteAdCorner from "./RacletteAdCorner.vue"
43
+
44
+ const emit = defineEmits<{ submit: [{ email: string; password: string }] }>()
45
+
46
+ const rootContainer = useTemplateRef("rootContainer")
47
+ const formRef = ref()
48
+ const showPassword = ref(false)
49
+
50
+ useVantaFog(rootContainer)
51
+
52
+ const loginData = reactive({ email: "", password: "" })
53
+
54
+ const emailRules = [
55
+ (v: string) => !!v || "Email is required",
56
+ (v: string) => /.+@.+\..+/.test(v) || "Email must be valid",
57
+ ]
58
+
59
+ const passwordRules = [
60
+ (v: string) => !!v || "Password is required",
61
+ (v: string) => v.length >= 6 || "Password must be at least 6 characters",
62
+ ]
63
+
64
+ const onClickSubmit = async () => {
65
+ const { valid } = await formRef.value.validate()
66
+
67
+ if (!valid) {
68
+ return
69
+ }
70
+
71
+ emit("submit", loginData)
72
+ }
73
+ </script>