diff --git a/front/package.json b/front/package.json index c66a7d387..400f93cd3 100644 --- a/front/package.json +++ b/front/package.json @@ -18,6 +18,7 @@ "postinstall": "yarn run fix-fomantic-css" }, "dependencies": { + "@vue/runtime-core": "^3.2.37", "@vueuse/core": "8.7.5", "@vueuse/integrations": "8.7.5", "axios": "0.27.2", diff --git a/front/src/components/admin/SettingsGroup.vue b/front/src/components/admin/SettingsGroup.vue index 9792290e5..a60a457f4 100644 --- a/front/src/components/admin/SettingsGroup.vue +++ b/front/src/components/admin/SettingsGroup.vue @@ -1,3 +1,99 @@ + + - - diff --git a/front/src/types.ts b/front/src/types.ts index 2c0f0eac6..e0132e5b0 100644 --- a/front/src/types.ts +++ b/front/src/types.ts @@ -1,8 +1,11 @@ import type { App } from 'vue' import type { Store } from 'vuex' -import { Router } from 'vue-router' -import { AxiosError } from 'axios' -import { RootState } from '~/store' +import type { Router } from 'vue-router' +import type { AxiosError } from 'axios' +import type { RootState } from '~/store' +import type { ComponentPublicInstance } from '@vue/runtime-core' + +export type FunctionRef = Element | ComponentPublicInstance | null declare global { interface Window { @@ -259,3 +262,39 @@ export interface Actor { is_local: boolean domain: string } + +// Settings stuff +export type SettingsId = 'instance' +export interface SettingsGroup { + label: string + id: SettingsId + settings: SettingsField[] +} + +export interface SettingsField { + name: string + fieldType?: 'markdown' + fieldParams?: { + charLimit: number | null + permissive: boolean + } +} + +export interface SettingsDataEntry { + identifier: string + fieldType: string + fieldParams: object + help_text: string + verbose_name: string + value: unknown + field: { + class: string + widget: { + class: string + } + } + + additional_data: { + choices: [string, string] + } +} \ No newline at end of file diff --git a/front/src/views/admin/Settings.vue b/front/src/views/admin/Settings.vue index a5f5414e9..1322f82e4 100644 --- a/front/src/views/admin/Settings.vue +++ b/front/src/views/admin/Settings.vue @@ -1,3 +1,163 @@ + + - - diff --git a/front/yarn.lock b/front/yarn.lock index 9fd787163..1edb9d9a7 100644 --- a/front/yarn.lock +++ b/front/yarn.lock @@ -1364,9 +1364,9 @@ "@babel/types" "^7.3.0" "@types/dompurify@^2.3.3": - version "2.3.3" - resolved "https://registry.yarnpkg.com/@types/dompurify/-/dompurify-2.3.3.tgz#c24c92f698f77ed9cc9d9fa7888f90cf2bfaa23f" - integrity sha512-nnVQSgRVuZ/843oAfhA25eRSNzUFcBPk/LOiw5gm8mD9/X7CNcbRkQu/OsjCewO8+VIYfPxUnXvPEVGenw14+w== + version "2.3.4" + resolved "https://registry.yarnpkg.com/@types/dompurify/-/dompurify-2.3.4.tgz#94e997e30338ea24d4c8d08beca91ce4dd17a1b4" + integrity sha512-EXzDatIb5EspL2eb/xPGmaC8pePcTHrkDCONjeisusLFrVfl38Pjea/R0YJGu3k9ZQadSvMqW0WXPI2hEo2Ajg== dependencies: "@types/trusted-types" "*" @@ -1870,7 +1870,7 @@ dependencies: "@vue/shared" "3.2.37" -"@vue/reactivity@^3.2.37": +"@vue/reactivity@3.2.38", "@vue/reactivity@^3.2.37": version "3.2.38" resolved "https://registry.yarnpkg.com/@vue/reactivity/-/reactivity-3.2.38.tgz#d576fdcea98eefb96a1f1ad456e289263e87292e" integrity sha512-6L4myYcH9HG2M25co7/BSo0skKFHpAN8PhkNPM4xRVkyGl1K5M3Jx4rp5bsYhvYze2K4+l+pioN4e6ZwFLUVtw== @@ -1885,6 +1885,14 @@ "@vue/reactivity" "3.2.37" "@vue/shared" "3.2.37" +"@vue/runtime-core@^3.2.37": + version "3.2.38" + resolved "https://registry.yarnpkg.com/@vue/runtime-core/-/runtime-core-3.2.38.tgz#d19cf591c210713f80e6a94ffbfef307c27aea06" + integrity sha512-kk0qiSiXUU/IKxZw31824rxmFzrLr3TL6ZcbrxWTKivadoKupdlzbQM4SlGo4MU6Zzrqv4fzyUasTU1jDoEnzg== + dependencies: + "@vue/reactivity" "3.2.38" + "@vue/shared" "3.2.38" + "@vue/runtime-dom@3.2.37": version "3.2.37" resolved "https://registry.yarnpkg.com/@vue/runtime-dom/-/runtime-dom-3.2.37.tgz#002bdc8228fa63949317756fb1e92cdd3f9f4bbd" @@ -2928,9 +2936,9 @@ domhandler@^5.0.1, domhandler@^5.0.2, domhandler@^5.0.3: domelementtype "^2.3.0" dompurify@^2.3.8: - version "2.3.8" - resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-2.3.8.tgz#224fe9ae57d7ebd9a1ae1ac18c1c1ca3f532226f" - integrity sha512-eVhaWoVibIzqdGYjwsBWodIQIaXFSB+cKDf4cfxLMsK0xiud6SE+/WCVx/Xw/UwQsa4cS3T2eITcdtmTg2UKcw== + version "2.4.0" + resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-2.4.0.tgz#c9c88390f024c2823332615c9e20a453cf3825dd" + integrity sha512-Be9tbQMZds4a3C6xTmz68NlMfeONA//4dOavl/1rNw50E+/QO0KVpbcU0PcaW0nsQxurXls9ZocqFxk8R2mWEA== domutils@^2.5.2, domutils@^2.8.0: version "2.8.0"