feat(#9): Nuxt 4 migration
This commit is contained in:
@@ -11,7 +11,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { ApplicationFormDto } from '~/.api-client'
|
import type { ApplicationFormDto } from '~~/.api-client'
|
||||||
|
|
||||||
defineEmits<{
|
defineEmits<{
|
||||||
(e: 'delete', id: string): void
|
(e: 'delete', id: string): void
|
||||||
@@ -28,10 +28,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { FormElementDto, FormOptionDto } from '~/.api-client'
|
import type { FormElementDto, FormOptionDto } from '~~/.api-client'
|
||||||
import { resolveComponent } from 'vue'
|
import { resolveComponent } from 'vue'
|
||||||
import TheComment from '~/components/TheComment.vue'
|
import TheComment from '~/components/TheComment.vue'
|
||||||
import type { DropdownMenuItem } from '@nuxt/ui'
|
import type { DropdownMenuItem } from '@nuxt/ui'
|
||||||
|
import { useCommentStore } from '~~/stores/useCommentStore'
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
modelValue: FormElementDto[]
|
modelValue: FormElementDto[]
|
||||||
@@ -62,7 +62,7 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { formatTimeAgo } from '@vueuse/core'
|
import { formatTimeAgo } from '@vueuse/core'
|
||||||
import type { NotificationDto } from '~/.api-client'
|
import type { NotificationDto } from '~~/.api-client'
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
'update:modelValue': [value: boolean]
|
'update:modelValue': [value: boolean]
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { CommentDto } from '~/.api-client'
|
import type { CommentDto } from '~~/.api-client'
|
||||||
import { useCommentTextarea } from '~/composables/comment/useCommentTextarea'
|
import { useCommentTextarea } from '~/composables/comment/useCommentTextarea'
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
@@ -61,4 +61,3 @@ function createChatMessageActions(comment: CommentDto) {
|
|||||||
return chatMessageActions
|
return chatMessageActions
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -31,6 +31,7 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { DropdownMenuItem } from '@nuxt/ui'
|
import type { DropdownMenuItem } from '@nuxt/ui'
|
||||||
|
import { useUserStore } from '~~/stores/useUserStore'
|
||||||
|
|
||||||
defineProps<{
|
defineProps<{
|
||||||
collapsed?: boolean
|
collapsed?: boolean
|
||||||
@@ -66,7 +67,6 @@ const { user: keyCloakUser } = storeToRefs(userStore)
|
|||||||
const user = ref({
|
const user = ref({
|
||||||
name: keyCloakUser.value.name,
|
name: keyCloakUser.value.name,
|
||||||
avatar: {
|
avatar: {
|
||||||
src: '/_nuxt/public/favicon.ico',
|
|
||||||
alt: keyCloakUser.value.name
|
alt: keyCloakUser.value.name
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
// import { FormElementType, type FormOptionDto, type FormElementDto } from '~/.api-client'
|
// import { FormElementType, type FormOptionDto, type FormElementDto } from '~~/.api-client'
|
||||||
// import { resolveComponent } from 'vue'
|
// import { resolveComponent } from 'vue'
|
||||||
|
|
||||||
// const props = defineProps<{
|
// const props = defineProps<{
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { FormOptionDto } from '~/.api-client'
|
import type { FormOptionDto } from '~~/.api-client'
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
formOptions: FormOptionDto[]
|
formOptions: FormOptionDto[]
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { FormOptionDto } from '~/.api-client'
|
import type { FormOptionDto } from '~~/.api-client'
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
label?: string
|
label?: string
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { FormOptionDto } from '~/.api-client'
|
import type { FormOptionDto } from '~~/.api-client'
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
label?: string
|
label?: string
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { FormOptionDto } from '~/.api-client'
|
import type { FormOptionDto } from '~~/.api-client'
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
label?: string
|
label?: string
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { FormOptionDto } from '~/.api-client'
|
import type { FormOptionDto } from '~~/.api-client'
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
formOptions: FormOptionDto[]
|
formOptions: FormOptionDto[]
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { FormOptionDto } from '~/.api-client'
|
import type { FormOptionDto } from '~~/.api-client'
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
formOptions: FormOptionDto[]
|
formOptions: FormOptionDto[]
|
||||||
@@ -3,7 +3,7 @@ import type {
|
|||||||
CreateFormElementDto,
|
CreateFormElementDto,
|
||||||
ApplicationFormDto,
|
ApplicationFormDto,
|
||||||
PagedApplicationFormDto
|
PagedApplicationFormDto
|
||||||
} from '~/.api-client'
|
} from '~~/.api-client'
|
||||||
import { useApplicationFormApi } from './useApplicationFormApi'
|
import { useApplicationFormApi } from './useApplicationFormApi'
|
||||||
|
|
||||||
export function useApplicationForm() {
|
export function useApplicationForm() {
|
||||||
@@ -5,7 +5,7 @@ import {
|
|||||||
type CreateFormElementDto,
|
type CreateFormElementDto,
|
||||||
type ApplicationFormDto,
|
type ApplicationFormDto,
|
||||||
type PagedApplicationFormDto
|
type PagedApplicationFormDto
|
||||||
} from '~/.api-client'
|
} from '~~/.api-client'
|
||||||
import { cleanDoubleSlashes, withoutTrailingSlash } from 'ufo'
|
import { cleanDoubleSlashes, withoutTrailingSlash } from 'ufo'
|
||||||
import { wrappedFetchWrap } from '~/utils/wrappedFetch'
|
import { wrappedFetchWrap } from '~/utils/wrappedFetch'
|
||||||
|
|
||||||
@@ -3,7 +3,7 @@ import {
|
|||||||
type ApplicationFormDto,
|
type ApplicationFormDto,
|
||||||
type PagedApplicationFormDto,
|
type PagedApplicationFormDto,
|
||||||
ResponseError
|
ResponseError
|
||||||
} from '~/.api-client'
|
} from '~~/.api-client'
|
||||||
import { useApplicationFormTemplateApi } from './useApplicationFormTemplateApi'
|
import { useApplicationFormTemplateApi } from './useApplicationFormTemplateApi'
|
||||||
|
|
||||||
const currentApplicationForm: Ref<ApplicationFormDto | undefined> = ref()
|
const currentApplicationForm: Ref<ApplicationFormDto | undefined> = ref()
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import { ApplicationFormTemplateApi, Configuration } from '../../.api-client'
|
import { ApplicationFormTemplateApi, Configuration } from '../../../.api-client'
|
||||||
import type { CreateApplicationFormDto, ApplicationFormDto, PagedApplicationFormDto } from '~/.api-client'
|
import type { CreateApplicationFormDto, ApplicationFormDto, PagedApplicationFormDto } from '~~/.api-client'
|
||||||
import { cleanDoubleSlashes, withoutTrailingSlash } from 'ufo'
|
import { cleanDoubleSlashes, withoutTrailingSlash } from 'ufo'
|
||||||
import { wrappedFetchWrap } from '~/utils/wrappedFetch'
|
import { wrappedFetchWrap } from '~/utils/wrappedFetch'
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { CommentApi, Configuration, type CommentDto, type CreateCommentDto, type PagedCommentDto } from '~/.api-client'
|
import { CommentApi, Configuration, type CommentDto, type CreateCommentDto, type PagedCommentDto } from '~~/.api-client'
|
||||||
import { cleanDoubleSlashes, withoutTrailingSlash } from 'ufo'
|
import { cleanDoubleSlashes, withoutTrailingSlash } from 'ufo'
|
||||||
import { wrappedFetchWrap } from '~/utils/wrappedFetch'
|
import { wrappedFetchWrap } from '~/utils/wrappedFetch'
|
||||||
|
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
import type { CreateCommentDto, CommentDto } from '~/.api-client'
|
import type { CreateCommentDto, CommentDto } from '~~/.api-client'
|
||||||
|
import { useCommentStore } from '~~/stores/useCommentStore'
|
||||||
|
import { useUserStore } from '~~/stores/useUserStore'
|
||||||
|
|
||||||
export function useCommentTextarea(applicationFormId: string) {
|
export function useCommentTextarea(applicationFormId: string) {
|
||||||
const commentStore = useCommentStore()
|
const commentStore = useCommentStore()
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { ComplianceStatus, EmployeeDataCategory, FormElementType, ProcessingPurpose } from '~/.api-client'
|
import { ComplianceStatus, EmployeeDataCategory, FormElementType, ProcessingPurpose } from '~~/.api-client'
|
||||||
|
|
||||||
export const complianceMap = new Map<ProcessingPurpose, Map<EmployeeDataCategory, ComplianceStatus>>([
|
export const complianceMap = new Map<ProcessingPurpose, Map<EmployeeDataCategory, ComplianceStatus>>([
|
||||||
[
|
[
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
import type { NotificationDto } from '~/.api-client'
|
import type { NotificationDto } from '~~/.api-client'
|
||||||
|
import { useUserStore } from '~~/stores/useUserStore'
|
||||||
|
|
||||||
export const useNotification = () => {
|
export const useNotification = () => {
|
||||||
const {
|
const {
|
||||||
@@ -4,7 +4,7 @@ import {
|
|||||||
type NotificationDto,
|
type NotificationDto,
|
||||||
type PagedNotificationDto,
|
type PagedNotificationDto,
|
||||||
type CreateNotificationDto
|
type CreateNotificationDto
|
||||||
} from '~/.api-client'
|
} from '~~/.api-client'
|
||||||
import { cleanDoubleSlashes, withoutTrailingSlash } from 'ufo'
|
import { cleanDoubleSlashes, withoutTrailingSlash } from 'ufo'
|
||||||
import { wrappedFetchWrap } from '~/utils/wrappedFetch'
|
import { wrappedFetchWrap } from '~/utils/wrappedFetch'
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { ComplianceStatus, type FormElementDto } from '~/.api-client'
|
import { ComplianceStatus, type FormElementDto } from '~~/.api-client'
|
||||||
import { complianceCheckableElementTypes, complianceMap } from './complianceMap'
|
import { complianceCheckableElementTypes, complianceMap } from './complianceMap'
|
||||||
import type { FormElementId } from '~/types/formElement'
|
import type { FormElementId } from '~~/types/formElement'
|
||||||
|
|
||||||
const formElementComplianceMap = ref(new Map<FormElementId, ComplianceStatus>())
|
const formElementComplianceMap = ref(new Map<FormElementId, ComplianceStatus>())
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { ApplicationFormDto, CreateFormElementDto, FormElementSectionDto } from '~/.api-client'
|
import type { ApplicationFormDto, CreateFormElementDto, FormElementSectionDto } from '~~/.api-client'
|
||||||
import type { MaybeRefOrGetter } from 'vue'
|
import type { MaybeRefOrGetter } from 'vue'
|
||||||
|
|
||||||
export function useFormElementManagement(
|
export function useFormElementManagement(
|
||||||
@@ -45,4 +45,3 @@ export function useFormElementManagement(
|
|||||||
addInputFormToApplicationForm
|
addInputFormToApplicationForm
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { FormElementSectionDto } from '~/.api-client'
|
import type { FormElementSectionDto } from '~~/.api-client'
|
||||||
import type { StepperItem } from '@nuxt/ui'
|
import type { StepperItem } from '@nuxt/ui'
|
||||||
import type { MaybeRefOrGetter } from 'vue'
|
import type { MaybeRefOrGetter } from 'vue'
|
||||||
|
|
||||||
@@ -55,4 +55,3 @@ export function useFormStepper(
|
|||||||
navigateStepper
|
navigateStepper
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
>
|
>
|
||||||
<template #header>
|
<template #header>
|
||||||
<NuxtLink to="/">
|
<NuxtLink to="/">
|
||||||
<img src="../public/favicon.ico" alt="Logo" />
|
<img src="@@/public/favicon.ico" alt="Logo" />
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -76,7 +76,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { ApplicationFormDto } from '~/.api-client'
|
import type { ApplicationFormDto } from '~~/.api-client'
|
||||||
|
import { useUserStore } from '~~/stores/useUserStore'
|
||||||
|
|
||||||
const { getApplicationFormById, updateApplicationForm, submitApplicationForm } = useApplicationForm()
|
const { getApplicationFormById, updateApplicationForm, submitApplicationForm } = useApplicationForm()
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
@@ -124,10 +125,7 @@ const { stepper, activeStepperItemIndex, stepperItems, currentFormElementSection
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
const { addInputFormToApplicationForm } = useFormElementManagement(
|
const { addInputFormToApplicationForm } = useFormElementManagement(currentFormElementSection, applicationForm.value?.id)
|
||||||
currentFormElementSection,
|
|
||||||
applicationForm.value?.id
|
|
||||||
)
|
|
||||||
|
|
||||||
async function handleAddInputForm(position: number) {
|
async function handleAddInputForm(position: number) {
|
||||||
const updatedForm = await addInputFormToApplicationForm(position)
|
const updatedForm = await addInputFormToApplicationForm(position)
|
||||||
@@ -72,9 +72,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ComplianceStatus, type PagedApplicationFormDto } from '~/.api-client'
|
import { ComplianceStatus, type PagedApplicationFormDto } from '~~/.api-client'
|
||||||
import { useApplicationFormValidator } from '~/composables/useApplicationFormValidator'
|
import { useApplicationFormValidator } from '~/composables/useApplicationFormValidator'
|
||||||
import type { FormElementId } from '~/types/formElement'
|
import type { FormElementId } from '~~/types/formElement'
|
||||||
|
import { useUserStore } from '~~/stores/useUserStore'
|
||||||
|
|
||||||
const { getAllApplicationFormTemplates } = await useApplicationFormTemplate()
|
const { getAllApplicationFormTemplates } = await useApplicationFormTemplate()
|
||||||
const { createApplicationForm, submitApplicationForm } = useApplicationForm()
|
const { createApplicationForm, submitApplicationForm } = useApplicationForm()
|
||||||
@@ -84,7 +85,7 @@ const userStore = useUserStore()
|
|||||||
const { selectedOrganization } = storeToRefs(userStore)
|
const { selectedOrganization } = storeToRefs(userStore)
|
||||||
const toast = useToast()
|
const toast = useToast()
|
||||||
|
|
||||||
const { data, error } = await useAsyncData<PagedApplicationFormDto>(async () => {
|
const { data, error } = await useAsyncData<PagedApplicationFormDto>('create-application-form', async () => {
|
||||||
return await getAllApplicationFormTemplates()
|
return await getAllApplicationFormTemplates()
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -77,8 +77,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { ApplicationFormDto, PagedApplicationFormDto } from '~/.api-client'
|
import type { ApplicationFormDto, PagedApplicationFormDto } from '~~/.api-client'
|
||||||
import type { Organization } from '~/types/keycloak'
|
import type { Organization } from '~~/types/keycloak'
|
||||||
|
import { useUserStore } from '~~/stores/useUserStore'
|
||||||
|
|
||||||
const { getAllApplicationForms, deleteApplicationFormById } = useApplicationForm()
|
const { getAllApplicationForms, deleteApplicationFormById } = useApplicationForm()
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
@@ -18,13 +18,13 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nuxt/ui-pro": "3.1.1",
|
"@nuxt/ui-pro": "3.1.1",
|
||||||
"@nuxtjs/i18n": "10.0.3",
|
"@nuxtjs/i18n": "10.0.3",
|
||||||
"@pinia/nuxt": "0.10.1",
|
"@pinia/nuxt": "0.11.2",
|
||||||
"@vueuse/core": "^13.6.0",
|
"@vueuse/core": "^13.6.0",
|
||||||
"h3": "1.15.4",
|
"h3": "1.15.4",
|
||||||
"jwt-decode": "4.0.0",
|
"jwt-decode": "4.0.0",
|
||||||
"nuxt": "3.16.1",
|
"nuxt": "4.2.0",
|
||||||
"nuxt-auth-utils": "0.5.25",
|
"nuxt-auth-utils": "0.5.25",
|
||||||
"pinia": "3.0.1",
|
"pinia": "3.0.3",
|
||||||
"resend": "^4.3.0",
|
"resend": "^4.3.0",
|
||||||
"vue": "latest",
|
"vue": "latest",
|
||||||
"vue-router": "latest"
|
"vue-router": "latest"
|
||||||
|
|||||||
4225
legalconsenthub/pnpm-lock.yaml
generated
4225
legalconsenthub/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
|||||||
import type { OAuthTokenResponse } from '~/types/oauth'
|
import type { OAuthTokenResponse } from '~~/types/oauth'
|
||||||
|
|
||||||
export default eventHandler(async (event) => {
|
export default eventHandler(async (event) => {
|
||||||
const config = useRuntimeConfig()
|
const config = useRuntimeConfig()
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { jwtDecode } from 'jwt-decode'
|
import { jwtDecode } from 'jwt-decode'
|
||||||
import type { KeycloakTokenPayload, Organization } from '~/types/keycloak'
|
import type { KeycloakTokenPayload, Organization } from '~~/types/keycloak'
|
||||||
|
|
||||||
export default defineOAuthKeycloakEventHandler({
|
export default defineOAuthKeycloakEventHandler({
|
||||||
async onSuccess(event, { user, tokens }) {
|
async onSuccess(event, { user, tokens }) {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
import { type CreateCommentDto, type CommentDto, ResponseError } from '~/.api-client'
|
import { type CreateCommentDto, type CommentDto, ResponseError } from '~~/.api-client'
|
||||||
import { useCommentApi } from '~/composables/comment/useCommentApi'
|
import { useCommentApi } from '~/composables/comment/useCommentApi'
|
||||||
|
|
||||||
export const useCommentStore = defineStore('Comment', () => {
|
export const useCommentStore = defineStore('Comment', () => {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { Organization } from '~/types/keycloak'
|
import type { Organization } from '~~/types/keycloak'
|
||||||
|
|
||||||
export const useUserStore = defineStore('Organization', () => {
|
export const useUserStore = defineStore('Organization', () => {
|
||||||
const { user } = useUserSession()
|
const { user } = useUserSession()
|
||||||
|
|||||||
Reference in New Issue
Block a user