@open-commune/web 0.2.13 → 0.2.15
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.
- package/app.config.ts +13 -0
- package/assets/css/main.css +119 -0
- package/components/data/lists/data-table.vue +203 -0
- package/components/data/lists/row-actions.vue +41 -0
- package/components/elements/badges/status-badge.vue +23 -0
- package/components/elements/media/media-image.vue +26 -0
- package/components/forms/fields/input-files-media.vue +87 -0
- package/components/forms/{inputs → fields}/input-filter-status.vue +2 -2
- package/components/forms/{inputs → fields}/input-search.vue +8 -2
- package/components/forms/fields/input-text-area.vue +86 -0
- package/components/forms/fields/input-text.vue +47 -0
- package/components/forms/fields/select-enum.vue +69 -0
- package/components/forms/handlers/handler-collections.vue +100 -170
- package/components/forms/handlers/handler-list.vue +187 -0
- package/components/forms/handlers/handler-members.vue +171 -0
- package/components/forms/handlers/handler-password-reset.vue +45 -0
- package/components/forms/handlers/handler-roles.vue +28 -166
- package/components/forms/handlers/handler-sessions.vue +77 -0
- package/components/forms/handlers/handler-tokens.vue +54 -69
- package/components/forms/layouts/form-default.vue +99 -0
- package/components/forms/layouts/form.vue +4 -0
- package/components/forms/layouts/forms-layout.vue +236 -0
- package/components/forms/layouts/forms-section.vue +186 -0
- package/components/forms/layouts/layout.vue +4 -0
- package/components/forms/layouts/modal.vue +4 -0
- package/components/forms/layouts/section.vue +4 -0
- package/components/layout/entrance-mark.vue +18 -0
- package/components/layout/navigations/primary/dropdown-publish.vue +6 -4
- package/components/layout/shell/shell-account-menu.vue +63 -0
- package/components/layout/shell/shell-header.vue +99 -0
- package/composables/core/domains/use-api-tokens.ts +80 -0
- package/composables/core/domains/use-auth.ts +162 -0
- package/composables/core/domains/use-definitions.ts +18 -5
- package/composables/core/domains/use-entries.ts +113 -3
- package/composables/core/domains/use-media.ts +24 -1
- package/composables/core/domains/use-members.ts +68 -0
- package/composables/core/domains/use-organization.ts +53 -0
- package/composables/use-models.js +1 -9
- package/constants/errors.ts +28 -0
- package/constants/forms/account.ts +62 -0
- package/constants/forms/collections.ts +39 -0
- package/constants/forms/members.ts +40 -0
- package/constants/forms/organization.ts +188 -0
- package/constants/forms/tokens.ts +15 -0
- package/constants/roles.ts +57 -0
- package/constants/settings.ts +26 -0
- package/constants/statuses.ts +8 -5
- package/layouts/default.vue +1 -2
- package/layouts/entrance.vue +1 -6
- package/layouts/record.vue +1 -2
- package/middleware/00.light-mode.global.ts +8 -0
- package/nuxt.config.ts +8 -0
- package/package.json +5 -3
- package/pages/[collection]/index.vue +92 -79
- package/pages/account.vue +40 -0
- package/pages/index/index.vue +54 -62
- package/pages/index/password/define/[token].vue +44 -68
- package/pages/index/password/recover/index.vue +43 -54
- package/pages/index/welcome/[token].vue +42 -79
- package/pages/index.vue +6 -37
- package/pages/settings.vue +26 -181
- package/plugins/00.appearance.client.ts +7 -0
- package/plugins/01.validation.client.ts +23 -0
- package/store/layout/workspace.js +4 -28
- package/utils/colors.ts +26 -0
- package/utils/errors.ts +13 -0
- package/utils/forms.ts +67 -0
- package/utils/list-columns.ts +90 -0
- package/utils/settings.ts +38 -0
- package/utils/statuses.ts +4 -0
- package/components/layout/navigations/primary.vue +0 -132
- package/models/entrance.js +0 -42
- package/models/role.js +0 -66
- package/models/token.js +0 -56
- package/models/user.js +0 -97
- package/pages/management/index.vue +0 -15
- package/pages/management/members.vue +0 -176
- package/pages/management/organizations.vue +0 -192
- package/pages/management/roles.vue +0 -183
- package/public/logo-black.svg +0 -1
- package/public/logo-white.svg +0 -1
- /package/components/forms/{inputs → fields}/input-filter.vue +0 -0
|
@@ -2,10 +2,6 @@ import Organization from '~/models/organization'
|
|
|
2
2
|
import Collection from '~/models/collection'
|
|
3
3
|
import Media from '~/models/media'
|
|
4
4
|
import Record from '~/models/record'
|
|
5
|
-
import Role from '~/models/role'
|
|
6
|
-
import Token from '~/models/token'
|
|
7
|
-
import User from '~/models/user'
|
|
8
|
-
import Entrance from '~/models/entrance'
|
|
9
5
|
|
|
10
6
|
// @review on pourrait pas déplacer le dossier models dans le dossier composables pour ajouter plus de clareté ? Aussi cette factory me semble un peu alambiquée, pourquoi a t on besoin de passer le model + api url dans un objet exporté par le model lui meme
|
|
11
7
|
// bref, je pense que qu'il y a de l'overengineering ici aussi non ?
|
|
@@ -18,10 +14,6 @@ export default () => {
|
|
|
18
14
|
Organization: new Organization.api(Organization.model, apiURL),
|
|
19
15
|
Collection: new Collection.api(Collection.model, apiURL),
|
|
20
16
|
Media: new Media.api(Media.model, apiURL),
|
|
21
|
-
Record: new Record.api(Record.model, apiURL)
|
|
22
|
-
Role: new Role.api(Role.model, apiURL),
|
|
23
|
-
Token: new Token.api(Token.model, apiURL),
|
|
24
|
-
User: new User.api(User.model, apiURL),
|
|
25
|
-
Entrance: new Entrance.api(Entrance.model, apiURL)
|
|
17
|
+
Record: new Record.api(Record.model, apiURL)
|
|
26
18
|
}
|
|
27
19
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ERROR_TYPES, type ErrorType } from '@open-commune/core/dtos';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The core's refusals, worded. A domain error travels as a `type` and never
|
|
5
|
+
* as a sentence: the core identifies, the interface says. The keys are the
|
|
6
|
+
* core's own catalogue and the record is exhaustive: a refusal the core adds
|
|
7
|
+
* stops this file compiling until it has its sentence.
|
|
8
|
+
*/
|
|
9
|
+
export const REFUSALS: Record<ErrorType, string> = {
|
|
10
|
+
[ERROR_TYPES.COLLECTION_NOT_FOUND]: "Cette collection n'existe plus.",
|
|
11
|
+
[ERROR_TYPES.ENTRY_NOT_FOUND]: "Cette entrée n'existe plus.",
|
|
12
|
+
[ERROR_TYPES.INVALID_ENTRY_DATA]:
|
|
13
|
+
'Certaines valeurs ne correspondent pas aux champs de la collection.',
|
|
14
|
+
[ERROR_TYPES.DUPLICATE_SLUG]: 'Cet identifiant (slug) est déjà utilisé. Choisissez-en un autre.',
|
|
15
|
+
[ERROR_TYPES.MEDIA_NOT_FOUND]: "Ce fichier n'existe plus.",
|
|
16
|
+
[ERROR_TYPES.UNSUPPORTED_MIME]: "Ce type de fichier n'est pas accepté.",
|
|
17
|
+
[ERROR_TYPES.UPLOAD_INCOMPLETE]: "Le fichier n'a pas été reçu en entier. Réessayez.",
|
|
18
|
+
[ERROR_TYPES.ORGANIZATION_NOT_INITIALIZED]: "Cette instance n'est pas encore initialisée.",
|
|
19
|
+
[ERROR_TYPES.ORGANIZATION_ALREADY_INITIALIZED]: 'Cette instance est déjà initialisée.',
|
|
20
|
+
[ERROR_TYPES.DEPLOY_HOOK_MISSING]:
|
|
21
|
+
"La publication du site n'est pas configurée sur cette instance.",
|
|
22
|
+
[ERROR_TYPES.DEPLOY_FAILED]: 'La publication du site a échoué. Réessayez dans un instant.',
|
|
23
|
+
[ERROR_TYPES.USER_NOT_FOUND]: "Ce compte n'existe plus.",
|
|
24
|
+
[ERROR_TYPES.SESSION_NOT_FOUND]: "Cette session n'existe plus.",
|
|
25
|
+
[ERROR_TYPES.INVITATION_INVALID]: "Cette invitation n'est plus valide.",
|
|
26
|
+
[ERROR_TYPES.CANNOT_REMOVE_SELF]: 'Vous ne pouvez pas retirer votre propre compte.',
|
|
27
|
+
[ERROR_TYPES.TOO_MANY_ATTEMPTS]: 'Trop de tentatives. Réessayez dans quelques minutes.',
|
|
28
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { FormTab } from '~/types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The account screen, described the way the settings are — same envelope,
|
|
5
|
+
* same `forms-layout` rendering it.
|
|
6
|
+
*
|
|
7
|
+
* Three sections, two of which save nothing: they host a control managing its
|
|
8
|
+
* own data, which `noAction` already names.
|
|
9
|
+
*
|
|
10
|
+
* One TAB per section, not one tab holding three: the account has its own rail
|
|
11
|
+
* now (it left the settings on the 27/08), and a rail lists what it can reach.
|
|
12
|
+
* Stacked in a single tab, the three sections scrolled past one another and
|
|
13
|
+
* the rail had nothing to point at.
|
|
14
|
+
*/
|
|
15
|
+
export const ACCOUNT_FORM: { layout: FormTab[] } = {
|
|
16
|
+
layout: [
|
|
17
|
+
{
|
|
18
|
+
title: 'Profil',
|
|
19
|
+
sections: [
|
|
20
|
+
{
|
|
21
|
+
componentOptions: {
|
|
22
|
+
title: 'Votre nom',
|
|
23
|
+
description: 'Il apparaît dans votre menu de compte et dans la liste des membres.',
|
|
24
|
+
attributes: [
|
|
25
|
+
{
|
|
26
|
+
property: 'name',
|
|
27
|
+
component: 'input-text',
|
|
28
|
+
componentOptions: { name: 'name', label: 'Nom affiché' },
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
title: 'Mot de passe',
|
|
37
|
+
sections: [
|
|
38
|
+
{
|
|
39
|
+
componentOptions: {
|
|
40
|
+
title: 'Mot de passe',
|
|
41
|
+
description: 'Nous vous envoyons un lien pour en choisir un nouveau.',
|
|
42
|
+
noAction: true,
|
|
43
|
+
attributes: [{ componentOptions: {}, component: 'handler-password-reset' }],
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
title: 'Appareils connectés',
|
|
50
|
+
sections: [
|
|
51
|
+
{
|
|
52
|
+
componentOptions: {
|
|
53
|
+
title: 'Appareils connectés',
|
|
54
|
+
description: 'Les sessions ouvertes avec votre compte.',
|
|
55
|
+
noAction: true,
|
|
56
|
+
attributes: [{ componentOptions: {}, component: 'handler-sessions' }],
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { FormControl } from '~/types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The collection modal, described the way the other forms are.
|
|
5
|
+
*
|
|
6
|
+
* Creating and editing a collection ask for the SAME five fields — only the
|
|
7
|
+
* title and the buttons change with the gesture, and those the handler builds
|
|
8
|
+
* from the action it was given.
|
|
9
|
+
*/
|
|
10
|
+
export const COLLECTION_FORM: FormControl[] = [
|
|
11
|
+
{
|
|
12
|
+
property: 'name',
|
|
13
|
+
component: 'input-text',
|
|
14
|
+
componentOptions: { name: 'name', label: 'Titre de la collection' },
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
property: 'slug',
|
|
18
|
+
component: 'input-text',
|
|
19
|
+
componentOptions: { name: 'slug', label: 'Slug de la collection' },
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
property: 'description',
|
|
23
|
+
component: 'input-text-area',
|
|
24
|
+
componentOptions: { name: 'description', label: 'Description de la collection' },
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
// `fields` is what the server knows (`definitionCreateDto` requires at
|
|
28
|
+
// least one) — the legacy model called this `attributes`, and the stale
|
|
29
|
+
// name made every create fail and every field edit a silent no-op.
|
|
30
|
+
property: 'fields',
|
|
31
|
+
component: 'input-text-area',
|
|
32
|
+
componentOptions: { format: 'json', name: 'fields', label: 'Champ(s) de la collection' },
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
property: 'editor',
|
|
36
|
+
component: 'input-text-area',
|
|
37
|
+
componentOptions: { format: 'json', name: 'editor', label: 'Editeur de la collection' },
|
|
38
|
+
},
|
|
39
|
+
];
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { FormControl } from '~/types';
|
|
2
|
+
import { ROLES } from '~/constants/roles';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The two member modals: inviting somebody, and editing somebody already here.
|
|
6
|
+
*
|
|
7
|
+
* They differ by their FIRST field — an address to write to, or a display name
|
|
8
|
+
* to correct — which is why they are two descriptions and not one with a
|
|
9
|
+
* condition.
|
|
10
|
+
*
|
|
11
|
+
* The offered roles come from the frozen list, never from a table copied here.
|
|
12
|
+
*/
|
|
13
|
+
const ROLE_CONTROL: FormControl = {
|
|
14
|
+
property: 'role',
|
|
15
|
+
component: 'select-enum',
|
|
16
|
+
componentOptions: {
|
|
17
|
+
name: 'role',
|
|
18
|
+
label: 'Rôle',
|
|
19
|
+
items: ROLES.map(({ id }) => id),
|
|
20
|
+
object: false,
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const MEMBER_INVITE_FORM: FormControl[] = [
|
|
25
|
+
{
|
|
26
|
+
property: 'email',
|
|
27
|
+
component: 'input-text',
|
|
28
|
+
componentOptions: { name: 'email', type: 'email', autoComplete: 'off', label: 'Adresse mail' },
|
|
29
|
+
},
|
|
30
|
+
ROLE_CONTROL,
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
export const MEMBER_UPDATE_FORM: FormControl[] = [
|
|
34
|
+
{
|
|
35
|
+
property: 'name',
|
|
36
|
+
component: 'input-text',
|
|
37
|
+
componentOptions: { name: 'name', label: "Nom d'affichage" },
|
|
38
|
+
},
|
|
39
|
+
ROLE_CONTROL,
|
|
40
|
+
];
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import type { FormTab } from '~/types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The organization form, as the settings screen renders it — the same shape a
|
|
5
|
+
* collection's stored `editor` has, written by hand because the organization
|
|
6
|
+
* is not a collection.
|
|
7
|
+
*
|
|
8
|
+
* It lives here rather than inside the page because it is DATA: a hundred
|
|
9
|
+
* lines of layout that change when a setting is added, not when the screen
|
|
10
|
+
* behaves differently.
|
|
11
|
+
*/
|
|
12
|
+
export const ORGANIZATION_FORM: { layout: FormTab[] } = {
|
|
13
|
+
layout: [
|
|
14
|
+
{
|
|
15
|
+
icon: '',
|
|
16
|
+
sections: [
|
|
17
|
+
{
|
|
18
|
+
componentOptions: {
|
|
19
|
+
title: "Logo de l'organisation",
|
|
20
|
+
description: 'Cliquez sur votre logo pour ajouter une image depuis vos fichiers.',
|
|
21
|
+
attributes: [
|
|
22
|
+
{
|
|
23
|
+
property: 'logo',
|
|
24
|
+
componentOptions: {
|
|
25
|
+
name: 'cover',
|
|
26
|
+
limit: 1,
|
|
27
|
+
label: "Logo de l'organisation",
|
|
28
|
+
},
|
|
29
|
+
component: 'input-files-media',
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
component: 'form-section-default',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
componentOptions: {
|
|
37
|
+
title: "Nom de l'organisation",
|
|
38
|
+
description:
|
|
39
|
+
'Ces informations seront visibles publiquement, soyez donc attentif avec ce que vous partagerez.',
|
|
40
|
+
attributes: [
|
|
41
|
+
{
|
|
42
|
+
property: 'name',
|
|
43
|
+
componentOptions: {
|
|
44
|
+
previewSlug: false,
|
|
45
|
+
editableSlug: false,
|
|
46
|
+
trim: true,
|
|
47
|
+
placeHolder: "Nom de l'organisation",
|
|
48
|
+
required: true,
|
|
49
|
+
},
|
|
50
|
+
component: 'input-text',
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
component: 'form-section-default',
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
title: 'General',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
icon: '',
|
|
61
|
+
sections: [
|
|
62
|
+
{
|
|
63
|
+
componentOptions: {
|
|
64
|
+
title: 'Collections',
|
|
65
|
+
description: 'Les types de contenu du site et leurs champs.',
|
|
66
|
+
attributes: [
|
|
67
|
+
{
|
|
68
|
+
property: 'collections',
|
|
69
|
+
componentOptions: {},
|
|
70
|
+
component: 'handler-collections',
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
noAction: true,
|
|
74
|
+
},
|
|
75
|
+
component: 'form-section-default',
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
title: 'Collections',
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
icon: '',
|
|
82
|
+
sections: [
|
|
83
|
+
{
|
|
84
|
+
componentOptions: {
|
|
85
|
+
title: 'Paramètres de déploiement',
|
|
86
|
+
description: 'Renseignez la définition du déploiement.',
|
|
87
|
+
attributes: [
|
|
88
|
+
{
|
|
89
|
+
property: 'deployment',
|
|
90
|
+
componentOptions: {
|
|
91
|
+
format: 'json',
|
|
92
|
+
label: 'Paramètres de déploiement',
|
|
93
|
+
name: 'deployment',
|
|
94
|
+
},
|
|
95
|
+
component: 'input-text-area',
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
},
|
|
99
|
+
component: 'form-section-default',
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
componentOptions: {
|
|
103
|
+
title: 'Tokens de déploiement',
|
|
104
|
+
description:
|
|
105
|
+
"Ces tokens permettent d'autres applications à accéder à un contenu restreint de cette organisation.Soyez attentif!",
|
|
106
|
+
attributes: [
|
|
107
|
+
{
|
|
108
|
+
componentOptions: {},
|
|
109
|
+
component: 'handler-tokens',
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
noAction: true,
|
|
113
|
+
},
|
|
114
|
+
component: 'form-section-default',
|
|
115
|
+
},
|
|
116
|
+
],
|
|
117
|
+
title: 'Déploiement',
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
icon: '',
|
|
121
|
+
sections: [
|
|
122
|
+
{
|
|
123
|
+
componentOptions: {
|
|
124
|
+
title: "Configuration de l'injecteur",
|
|
125
|
+
description: 'Définissez les différentes pipelines de données ici',
|
|
126
|
+
attributes: [
|
|
127
|
+
{
|
|
128
|
+
property: 'injector',
|
|
129
|
+
componentOptions: {
|
|
130
|
+
format: 'json',
|
|
131
|
+
label: "Définition de l'injecteur",
|
|
132
|
+
name: 'injector',
|
|
133
|
+
},
|
|
134
|
+
component: 'input-text-area',
|
|
135
|
+
},
|
|
136
|
+
],
|
|
137
|
+
},
|
|
138
|
+
component: 'form-section-default',
|
|
139
|
+
},
|
|
140
|
+
],
|
|
141
|
+
title: 'Synchronisation des données',
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
icon: '',
|
|
145
|
+
sections: [
|
|
146
|
+
{
|
|
147
|
+
componentOptions: {
|
|
148
|
+
title: 'Membres',
|
|
149
|
+
description: "Les comptes ayant accès à cet espace d'administration.",
|
|
150
|
+
attributes: [
|
|
151
|
+
{
|
|
152
|
+
componentOptions: {},
|
|
153
|
+
component: 'handler-members',
|
|
154
|
+
},
|
|
155
|
+
],
|
|
156
|
+
noAction: true,
|
|
157
|
+
},
|
|
158
|
+
component: 'form-section-default',
|
|
159
|
+
},
|
|
160
|
+
],
|
|
161
|
+
title: 'Membres',
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
icon: '',
|
|
165
|
+
sections: [
|
|
166
|
+
{
|
|
167
|
+
componentOptions: {
|
|
168
|
+
title: 'Rôles',
|
|
169
|
+
description:
|
|
170
|
+
'Deux rôles, en consultation : ils sont fixés par Commun et ne se modifient pas depuis cet écran.',
|
|
171
|
+
attributes: [
|
|
172
|
+
{
|
|
173
|
+
componentOptions: {},
|
|
174
|
+
component: 'handler-roles',
|
|
175
|
+
},
|
|
176
|
+
],
|
|
177
|
+
noAction: true,
|
|
178
|
+
// `handler-roles` draws its own cards: a framed section would sit
|
|
179
|
+
// them inside a second one.
|
|
180
|
+
frameless: true,
|
|
181
|
+
},
|
|
182
|
+
component: 'form-section-default',
|
|
183
|
+
},
|
|
184
|
+
],
|
|
185
|
+
title: 'Rôles',
|
|
186
|
+
},
|
|
187
|
+
],
|
|
188
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { FormControl } from '~/types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The token modal: a name, and nothing else.
|
|
5
|
+
*
|
|
6
|
+
* The token itself is never asked for — the server draws it, and hands the
|
|
7
|
+
* plaintext back once, in the creation answer.
|
|
8
|
+
*/
|
|
9
|
+
export const TOKEN_FORM: FormControl[] = [
|
|
10
|
+
{
|
|
11
|
+
property: 'name',
|
|
12
|
+
component: 'input-text',
|
|
13
|
+
componentOptions: { name: 'name', placeHolder: 'ex : site public, application mobile…' },
|
|
14
|
+
},
|
|
15
|
+
];
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { Capability, RoleDefinition } from '~/types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The roles of the admin space.
|
|
5
|
+
*
|
|
6
|
+
* Configurable roles gave way to a FIXED model: two roles, decided here and
|
|
7
|
+
* never in the database. This is not data anyone fetches — hence no composable
|
|
8
|
+
* for it.
|
|
9
|
+
*/
|
|
10
|
+
export const ROLES: readonly RoleDefinition[] = [
|
|
11
|
+
{
|
|
12
|
+
id: 'admin',
|
|
13
|
+
name: 'Administrateur',
|
|
14
|
+
description: 'Accès complet : contenus, médias, membres et réglages.',
|
|
15
|
+
permissions: ['manage:all'],
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
id: 'redacteur',
|
|
19
|
+
name: 'Rédacteur',
|
|
20
|
+
description: 'Les contenus, les médias et la publication du site.',
|
|
21
|
+
// Exactly the legacy « Éditeur de contenu » every commune agent carried:
|
|
22
|
+
// contents, their publication, the media library and publishing the site.
|
|
23
|
+
permissions: [
|
|
24
|
+
'entrance:self',
|
|
25
|
+
'read:organizations',
|
|
26
|
+
'read:collections',
|
|
27
|
+
'read:records',
|
|
28
|
+
'create:records',
|
|
29
|
+
'update:records',
|
|
30
|
+
'delete:records',
|
|
31
|
+
'publish:records',
|
|
32
|
+
'read:media',
|
|
33
|
+
'create:media',
|
|
34
|
+
'update:media',
|
|
35
|
+
'delete:media',
|
|
36
|
+
'read:deployments',
|
|
37
|
+
'create:deployments',
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
];
|
|
41
|
+
|
|
42
|
+
export const roleNamed = (id: string): RoleDefinition | undefined =>
|
|
43
|
+
ROLES.find((role) => role.id === id);
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* What a role opens, said in the words of the job rather than in CASL.
|
|
47
|
+
*
|
|
48
|
+
* Each line names the ability that actually decides it, so a change to the
|
|
49
|
+
* permissions above shows up on the roles screen on its own — the screen READS
|
|
50
|
+
* the model, it does not describe it a second time.
|
|
51
|
+
*/
|
|
52
|
+
export const CAPABILITIES: readonly Capability[] = [
|
|
53
|
+
{ label: 'Tout le contenu, publication comprise', ability: 'update:records' },
|
|
54
|
+
{ label: 'Publication du site (déploiement)', ability: 'create:deployments' },
|
|
55
|
+
{ label: 'Membres et invitations', ability: 'admin:organization' },
|
|
56
|
+
{ label: 'Paramètres, collections, synchronisation', ability: 'manage:all' },
|
|
57
|
+
];
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { SettingsSection } from '~/types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The settings area, as one screen: the organization form's sections, each
|
|
5
|
+
* addressable by URL so a section can be bookmarked or linked. Members and
|
|
6
|
+
* roles, which used to live under /management, are two of them.
|
|
7
|
+
*
|
|
8
|
+
* Thematics left the settings: they are content, not configuration —
|
|
9
|
+
* written, published, referenced by entries — and the collection `labels`
|
|
10
|
+
* already gave them a screen with filters, search, counts and the publication
|
|
11
|
+
* chain. Two doors onto the same rows, the poorer one being the settings.
|
|
12
|
+
* `title` matches the section title declared in the organization form layout.
|
|
13
|
+
*/
|
|
14
|
+
export const SETTINGS_SECTIONS: readonly SettingsSection[] = [
|
|
15
|
+
{ title: 'General', label: 'Général', slug: '' },
|
|
16
|
+
{ title: 'Collections', label: 'Collections', slug: 'collections' },
|
|
17
|
+
{ title: 'Déploiement', label: 'Déploiement', slug: 'deploiement' },
|
|
18
|
+
{
|
|
19
|
+
title: 'Synchronisation des données',
|
|
20
|
+
|
|
21
|
+
label: 'Synchronisation',
|
|
22
|
+
slug: 'synchronisation',
|
|
23
|
+
},
|
|
24
|
+
{ title: 'Membres', label: 'Membres', slug: 'membres' },
|
|
25
|
+
{ title: 'Rôles', label: 'Rôles', slug: 'roles' },
|
|
26
|
+
];
|
package/constants/statuses.ts
CHANGED
|
@@ -5,7 +5,10 @@ import {
|
|
|
5
5
|
|
|
6
6
|
interface Presentation {
|
|
7
7
|
label: string;
|
|
8
|
+
/** Paints the filter dots. */
|
|
8
9
|
color: string;
|
|
10
|
+
/** The Nuxt UI colour the badge wears. */
|
|
11
|
+
ui: 'neutral' | 'warning' | 'info' | 'primary' | 'success';
|
|
9
12
|
}
|
|
10
13
|
|
|
11
14
|
/**
|
|
@@ -14,11 +17,11 @@ interface Presentation {
|
|
|
14
17
|
* quietly ignores it.
|
|
15
18
|
*/
|
|
16
19
|
const PRESENTATION: Record<PublicationStatus, Presentation> = {
|
|
17
|
-
draft: { label: 'Brouillon', color: '#9ca3af' },
|
|
18
|
-
waiting: { label: 'À valider', color: '#facc15' },
|
|
19
|
-
ready: { label: 'Prêt', color: '#60a5fa' },
|
|
20
|
-
scheduled: { label: 'Programmé', color: '#c4b5fd' },
|
|
21
|
-
published: { label: 'Publié', color: '#34d399' },
|
|
20
|
+
draft: { label: 'Brouillon', color: '#9ca3af', ui: 'neutral' },
|
|
21
|
+
waiting: { label: 'À valider', color: '#facc15', ui: 'warning' },
|
|
22
|
+
ready: { label: 'Prêt', color: '#60a5fa', ui: 'info' },
|
|
23
|
+
scheduled: { label: 'Programmé', color: '#c4b5fd', ui: 'primary' },
|
|
24
|
+
published: { label: 'Publié', color: '#34d399', ui: 'success' },
|
|
22
25
|
};
|
|
23
26
|
|
|
24
27
|
export const STATUSES = PUBLICATION_STATUSES.map((value) => ({
|
package/layouts/default.vue
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="min-h-screen">
|
|
3
3
|
<!-- <NuxtLoadingIndicator /> -->
|
|
4
|
-
<
|
|
4
|
+
<layout-shell-header />
|
|
5
5
|
<headings-collection />
|
|
6
6
|
<main class="py-8 max-w-3xl mx-auto px-4 sm:px-6 lg:max-w-7xl lg:px-8 h-full">
|
|
7
7
|
<section>
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
</template>
|
|
15
15
|
|
|
16
16
|
<script setup>
|
|
17
|
-
import primaryNavigation from '~/components/layout/navigations/primary'
|
|
18
17
|
import headingsCollection from '~/components/layout/headings/headings-collection'
|
|
19
18
|
import formModal from '~/components/forms/layouts/modal'
|
|
20
19
|
import notificationsList from '~/components/layout/notifications/notifications-list'
|
package/layouts/entrance.vue
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="min-w-screen min-h-screen">
|
|
2
|
+
<div class="min-w-screen min-h-screen bg-default text-default">
|
|
3
3
|
<slot />
|
|
4
|
-
<notifications-list />
|
|
5
4
|
</div>
|
|
6
5
|
</template>
|
|
7
|
-
|
|
8
|
-
<script setup>
|
|
9
|
-
import notificationsList from '~/components/layout/notifications/notifications-list'
|
|
10
|
-
</script>
|
package/layouts/record.vue
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="min-h-screen">
|
|
3
3
|
<!-- <NuxtLoadingIndicator /> -->
|
|
4
|
-
<
|
|
4
|
+
<layout-shell-header />
|
|
5
5
|
<headings-record />
|
|
6
6
|
<main class="py-8 max-w-3xl mx-auto px-4 sm:px-6 lg:max-w-7xl lg:px-8 h-full">
|
|
7
7
|
<section>
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
</template>
|
|
15
15
|
|
|
16
16
|
<script setup>
|
|
17
|
-
import primaryNavigation from '~/components/layout/navigations/primary'
|
|
18
17
|
import headingsRecord from '~/components/layout/headings/headings-record'
|
|
19
18
|
import formModal from '~/components/forms/layouts/modal'
|
|
20
19
|
import notificationsList from '~/components/layout/notifications/notifications-list'
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// The admin is held to the light mode for now: the screens not yet ported were
|
|
2
|
+
// never drawn for a dark ground (hard-coded greys and whites), and a half-dark
|
|
3
|
+
// admin reads worse than a light one. The colour-mode module reads this meta
|
|
4
|
+
// after each navigation. Dark mode comes back, following the reader's scheme,
|
|
5
|
+
// with the last ported screen.
|
|
6
|
+
export default defineNuxtRouteMiddleware((to) => {
|
|
7
|
+
to.meta.colorMode = 'light'
|
|
8
|
+
})
|
package/nuxt.config.ts
CHANGED
|
@@ -76,6 +76,14 @@ export default defineNuxtConfig({
|
|
|
76
76
|
apiURL: process.env.NUXT_ENV_API_URL ?? '',
|
|
77
77
|
baseURL: process.env.NUXT_ENV_BASE_URL || 'http://localhost:3000',
|
|
78
78
|
mapBoxToken: process.env.NUXT_ENV_MAPBOX_TOKEN,
|
|
79
|
+
// The look of the admin: empty for the default (paper and ink), or
|
|
80
|
+
// `plain` for Nuxt UI as it ships. Read at runtime from
|
|
81
|
+
// NUXT_PUBLIC_APPEARANCE, so one image serves every instance.
|
|
82
|
+
appearance: '',
|
|
83
|
+
// Where someone locked out asks for help. Empty by default: the product
|
|
84
|
+
// is self-hosted, and its installer's support is not ours. Set through
|
|
85
|
+
// NUXT_PUBLIC_SUPPORT_URL, it brings the link up on the sign-in screen.
|
|
86
|
+
supportUrl: '',
|
|
79
87
|
},
|
|
80
88
|
},
|
|
81
89
|
// Le build du site est déclenché chaque nuit à 00:30 (heure LOCALE du
|
package/package.json
CHANGED
|
@@ -14,11 +14,13 @@
|
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@casl/ability": "^7.0.2",
|
|
17
|
+
"@fontsource-variable/inter": "^5.3.0",
|
|
18
|
+
"@fontsource-variable/source-serif-4": "^5.3.0",
|
|
17
19
|
"@iconify/vue": "^5.0.3",
|
|
18
20
|
"@nuxt/kit": "^4.6.1",
|
|
19
21
|
"@nuxt/ui": "^4.12.0",
|
|
20
|
-
"@open-commune/core": "^0.2.
|
|
21
|
-
"@open-commune/editor": "^0.2.
|
|
22
|
+
"@open-commune/core": "^0.2.15",
|
|
23
|
+
"@open-commune/editor": "^0.2.15",
|
|
22
24
|
"@pinia-orm/nuxt": "^2.0.0",
|
|
23
25
|
"@pinia/nuxt": "^1.0.3",
|
|
24
26
|
"@tanstack/vue-query": "^5.104.3",
|
|
@@ -40,7 +42,7 @@
|
|
|
40
42
|
},
|
|
41
43
|
"description": "The Open Commune application: the admin interface and the server, on a single origin.",
|
|
42
44
|
"license": "AGPL-3.0-or-later",
|
|
43
|
-
"version": "0.2.
|
|
45
|
+
"version": "0.2.15",
|
|
44
46
|
"type": "module",
|
|
45
47
|
"main": "./nuxt.config.ts",
|
|
46
48
|
"files": [
|