diff --git a/api/config/type/schema.json b/api/config/type/schema.json index 2e0edfe5..24b4f66d 100644 --- a/api/config/type/schema.json +++ b/api/config/type/schema.json @@ -53,6 +53,9 @@ "publicUrl": { "type": "string" }, + "homePage": { + "type": "string" + }, "mongo": { "type": "object", "required": [ diff --git a/api/src/ui-config.ts b/api/src/ui-config.ts index 6a59202f..2d9b71ab 100644 --- a/api/src/ui-config.ts +++ b/api/src/ui-config.ts @@ -1,9 +1,7 @@ -import config, { type ApiConfig } from './config.ts' +import config from './config.ts' import { publicMessages } from '../i18n/index.ts' -export type UiConfig = { publicMessages: any, readonly: boolean } & Pick - -export const uiConfig: UiConfig = { +export const uiConfig = { publicMessages, readonly: config.storage.type !== 'mongo', publicUrl: config.publicUrl, @@ -13,6 +11,11 @@ export const uiConfig: UiConfig = { tosUrl: config.tosUrl, passwordless: config.passwordless, onlyCreateInvited: config.onlyCreateInvited, - maildev: config.maildev + maildev: config.maildev, + depAdminIsOrgAdmin: config.depAdminIsOrgAdmin, + anonymousContactForm: config.anonymousContactForm, + homePage: config.homePage, + alwaysAcceptInvitation: config.alwaysAcceptInvitation } +export type UiConfig = typeof uiConfig export default uiConfig diff --git a/api/src/utils/partners.ts b/api/src/utils/partners.ts index 78f5d19d..41d445ae 100644 --- a/api/src/utils/partners.ts +++ b/api/src/utils/partners.ts @@ -1,6 +1,6 @@ -import { type Organization, type Partner } from '#types' +import { type Organization, type Partner, type ShortenedPartnerInvitation } from '#types' -export const shortenPartnerInvitation = (partner: Pick, org: Organization, partnerId: string) => { +export const shortenPartnerInvitation = (partner: Pick, org: Organization, partnerId: string): ShortenedPartnerInvitation => { return { o: org.id, on: org.name, @@ -10,7 +10,7 @@ export const shortenPartnerInvitation = (partner: Pick) => { +export const unshortenPartnerInvitation = (partnerPayload: ShortenedPartnerInvitation) => { return { orgId: partnerPayload.o, partnerId: partnerPayload.p, diff --git a/api/types/index.ts b/api/types/index.ts index 75d1b2a2..22d50c9b 100644 --- a/api/types/index.ts +++ b/api/types/index.ts @@ -50,3 +50,11 @@ export type ActionPayload = { email: string, action: 'changePassword' | 'changeHost' } + +export type ShortenedPartnerInvitation = { + o: string, + on: string, + p: string, + n: string, + e: string +} diff --git a/package-lock.json b/package-lock.json index 60eb4e75..a1814101 100644 --- a/package-lock.json +++ b/package-lock.json @@ -841,9 +841,9 @@ "license": "MIT" }, "node_modules/@data-fair/lib-vue": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/@data-fair/lib-vue/-/lib-vue-1.9.1.tgz", - "integrity": "sha512-MWrU+7wlVfrjtLewvXWY/6pjMANwAGgtGpxDe/FW3N0T1PpPE7cgHg5Ke0XbnCHE7HSYOYMUCnwRherL6/dPog==", + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/@data-fair/lib-vue/-/lib-vue-1.9.2.tgz", + "integrity": "sha512-LBBgBa0JK/Upvh7UotXoR34HHY1iLwFtvwXQVy3yFl9Bje32jQfXKezyuD0Qezj9jFG+bAaG4gYWK3a7EWDEpA==", "license": "MIT", "dependencies": { "@data-fair/lib-common-types": "^1.1.0", @@ -12104,7 +12104,7 @@ "ui": { "version": "0.0.0", "dependencies": { - "@data-fair/lib-vue": "^1.9.1", + "@data-fair/lib-vue": "^1.9.2", "@data-fair/lib-vuetify": "^1.4.1", "@intlify/unplugin-vue-i18n": "^5.2.0", "@koumoul/v-iframe": "^2.4.4", diff --git a/ui/dts/auto-imports.d.ts b/ui/dts/auto-imports.d.ts index a1742c9a..deb7a2cf 100644 --- a/ui/dts/auto-imports.d.ts +++ b/ui/dts/auto-imports.d.ts @@ -13,10 +13,12 @@ declare global { const $siteUrl: typeof import('~/context')['$siteUrl'] const $uiConfig: typeof import('~/context')['$uiConfig'] const EffectScope: typeof import('vue')['EffectScope'] + const Organization: typeof import('#api/types')['Organization'] const addDepartmentMenu: typeof import('../src/components/add-department-menu.vue')['default'] const addMemberMenu: typeof import('../src/components/add-member-menu.vue')['default'] const addOrganizationMenu: typeof import('../src/components/add-organization-menu.vue')['default'] const addPartnerMenu: typeof import('../src/components/add-partner-menu.vue')['default'] + const authProvidersFetch: typeof import('../src/composables/use-store')['authProvidersFetch'] const authProvidersLoginLinks: typeof import('../src/components/auth-providers-login-links.vue')['default'] const cancelDeletion: typeof import('../src/components/cancel-deletion.vue')['default'] const changeHost: typeof import('../src/components/change-host.vue')['default'] @@ -41,6 +43,7 @@ declare global { const getCurrentInstance: typeof import('vue')['getCurrentInstance'] const getCurrentScope: typeof import('vue')['getCurrentScope'] const h: typeof import('vue')['h'] + const host: typeof import('../src/composables/use-store')['host'] const inject: typeof import('vue')['inject'] const injectHead: typeof import('@unhead/vue')['injectHead'] const isProxy: typeof import('vue')['isProxy'] @@ -48,12 +51,15 @@ declare global { const isReadonly: typeof import('vue')['isReadonly'] const isRef: typeof import('vue')['isRef'] const loadAvatar: typeof import('../src/components/load-avatar.vue')['default'] + const mainPublicUrl: typeof import('../src/composables/use-store')['mainPublicUrl'] + const mainRedirect: typeof import('../src/composables/use-store')['mainRedirect'] const markRaw: typeof import('vue')['markRaw'] const mdiAlertCircle: typeof import('@mdi/js')['mdiAlertCircle'] const mdiBell: typeof import('@mdi/js')['mdiBell'] const mdiCalendarRange: typeof import('@mdi/js')['mdiCalendarRange'] const mdiCancel: typeof import('@mdi/js')['mdiCancel'] const mdiCellphone: typeof import('@mdi/js')['mdiCellphone'] + const mdiCheck: typeof import('@mdi/js')['mdiCheck'] const mdiCheckCircle: typeof import('@mdi/js')['mdiCheckCircle'] const mdiDatabase: typeof import('@mdi/js')['mdiDatabase'] const mdiDelete: typeof import('@mdi/js')['mdiDelete'] @@ -61,6 +67,7 @@ declare global { const mdiDotsVertical: typeof import('@mdi/js')['mdiDotsVertical'] const mdiEmail: typeof import('@mdi/js')['mdiEmail'] const mdiImageSizeSelectSmall: typeof import('@mdi/js')['mdiImageSizeSelectSmall'] + const mdiPlus: typeof import('@mdi/js')['mdiPlus'] const mdiRefresh: typeof import('@mdi/js')['mdiRefresh'] const mdiRss: typeof import('@mdi/js')['mdiRss'] const mdiSend: typeof import('@mdi/js')['mdiSend'] @@ -89,9 +96,14 @@ declare global { const organizationStorage: typeof import('../src/components/organization-storage.vue')['default'] const parseSender: typeof import('../src/utils/sender-utils')['parseSender'] const partnerInvitation: typeof import('../src/components/partner-invitation.vue')['default'] + const patchOrganization: typeof import('../src/composables/use-store')['patchOrganization'] + const patchSite: typeof import('../src/composables/use-store')['patchSite'] + const postSite: typeof import('../src/composables/use-store')['postSite'] const provide: typeof import('vue')['provide'] const reactive: typeof import('vue')['reactive'] const readonly: typeof import('vue')['readonly'] + const redirect: typeof import('../src/composables/use-store')['redirect'] + const redirects: typeof import('../src/composables/use-store')['redirects'] const ref: typeof import('vue')['ref'] const resendInvitation: typeof import('../src/components/resend-invitation.vue')['default'] const resendPartnerInvitation: typeof import('../src/components/resend-partner-invitation.vue')['default'] @@ -103,6 +115,8 @@ declare global { const shallowRef: typeof import('vue')['shallowRef'] const sitePatch: typeof import('../src/components/site-patch.vue')['default'] const sitePost: typeof import('../src/components/site-post.vue')['default'] + const sitePublic: typeof import('../src/composables/use-store')['sitePublic'] + const sitesFetch: typeof import('../src/composables/use-store')['sitesFetch'] const subscribeWebhook: typeof import('../src/components/subscribe-webhook.vue')['default'] const toRaw: typeof import('vue')['toRaw'] const toRef: typeof import('vue')['toRef'] @@ -135,12 +149,14 @@ declare global { const useSession: typeof import('@data-fair/lib-vue/session.js')['useSession'] const useSessionAuthenticated: typeof import('@data-fair/lib-vue/session.js')['useSessionAuthenticated'] const useSlots: typeof import('vue')['useSlots'] + const useStore: typeof import('../src/composables/use-store')['default'] const useStringSearchParam: typeof import('@data-fair/lib-vue/reactive-search-params.js')['useStringSearchParam'] const useStringsArraySearchParam: typeof import('@data-fair/lib-vue/reactive-search-params.js')['useStringsArraySearchParam'] const useSubscriptions: typeof import('../src/composables/use-subscriptions')['default'] const useTemplateRef: typeof import('vue')['useTemplateRef'] const useUiNotif: typeof import('@data-fair/lib-vue/ui-notif.js')['useUiNotif'] const useWS: typeof import('@data-fair/lib-vue/ws.js')['useWS'] + const userDetailsFetch: typeof import('../src/composables/use-store')['userDetailsFetch'] const vJsf: typeof import('../src/components/v-jsf.vue')['default'] const watch: typeof import('vue')['watch'] const watchEffect: typeof import('vue')['watchEffect'] @@ -153,6 +169,9 @@ declare global { // @ts-ignore export type { Component, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue' import('vue') + // @ts-ignore + export type { Organization } from '#api/types' + import('#api/types') } // for vue template auto import import { UnwrapRef } from 'vue' @@ -190,11 +209,13 @@ declare module 'vue' { readonly mdiBell: UnwrapRef readonly mdiCancel: UnwrapRef readonly mdiCellphone: UnwrapRef + readonly mdiCheck: UnwrapRef readonly mdiCheckCircle: UnwrapRef readonly mdiDelete: UnwrapRef readonly mdiDevices: UnwrapRef readonly mdiDotsVertical: UnwrapRef readonly mdiEmail: UnwrapRef + readonly mdiPlus: UnwrapRef readonly mdiRefresh: UnwrapRef readonly mdiRss: UnwrapRef readonly mdiSend: UnwrapRef @@ -254,6 +275,7 @@ declare module 'vue' { readonly useSession: UnwrapRef readonly useSessionAuthenticated: UnwrapRef readonly useSlots: UnwrapRef + readonly useStore: UnwrapRef readonly useStringSearchParam: UnwrapRef readonly useStringsArraySearchParam: UnwrapRef readonly useTemplateRef: UnwrapRef diff --git a/ui/package.json b/ui/package.json index 2615bd8a..28a75ada 100644 --- a/ui/package.json +++ b/ui/package.json @@ -12,7 +12,7 @@ "lint-fix": "eslint --fix ." }, "dependencies": { - "@data-fair/lib-vue": "^1.9.1", + "@data-fair/lib-vue": "^1.9.2", "@data-fair/lib-vuetify": "^1.4.1", "@intlify/unplugin-vue-i18n": "^5.2.0", "@koumoul/v-iframe": "^2.4.4", diff --git a/ui/src/components/add-department-menu.vue b/ui/src/components/add-department-menu.vue index 31ede6ff..cae15a67 100644 --- a/ui/src/components/add-department-menu.vue +++ b/ui/src/components/add-department-menu.vue @@ -2,19 +2,16 @@ - diff --git a/ui/src/components/resend-invitation.vue b/ui/src/components/resend-invitation.vue index 4bf14902..888a5b53 100644 --- a/ui/src/components/resend-invitation.vue +++ b/ui/src/components/resend-invitation.vue @@ -2,7 +2,7 @@ -