@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
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<section class="w-full">
|
|
3
|
-
<button-secondary label="Inviter un membre" class="mb-6" @click="_openModalForm('create')" />
|
|
4
|
-
<default-table
|
|
5
|
-
v-if="!$route.params.event"
|
|
6
|
-
:headers="TABLE_HEADERS"
|
|
7
|
-
:filters="filters"
|
|
8
|
-
:items="records"
|
|
9
|
-
:actions="abilities"
|
|
10
|
-
:pagination-size="limit"
|
|
11
|
-
display-search-bar
|
|
12
|
-
paginated-content
|
|
13
|
-
@fetch-more="_fetchMore"
|
|
14
|
-
@update="_openModalForm('update', $event)"
|
|
15
|
-
@remove="_handle('remove', $event)"
|
|
16
|
-
/>
|
|
17
|
-
</section>
|
|
18
|
-
</template>
|
|
19
|
-
|
|
20
|
-
<script setup>
|
|
21
|
-
import buttonSecondary from '~/components/elements/buttons/secondary'
|
|
22
|
-
import defaultTable from '~/components/data/lists/data-lists-table'
|
|
23
|
-
import { useModalStore } from '~/store/layout/modal'
|
|
24
|
-
import { useNotificationsStore } from '~/store/layout/notifications'
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
definePageMeta({
|
|
28
|
-
permissions: ['manage:all'],
|
|
29
|
-
preFetch: ['User'],
|
|
30
|
-
headings: {
|
|
31
|
-
title: 'Membres',
|
|
32
|
-
description: 'Retrouvez & managez ici toutes les membres de la plateforme.'
|
|
33
|
-
}
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
const { User } = useModels()
|
|
37
|
-
const $route = useRoute()
|
|
38
|
-
const $modalStore = useModalStore()
|
|
39
|
-
const notificationsStore = useNotificationsStore()
|
|
40
|
-
|
|
41
|
-
// Prepare constants
|
|
42
|
-
const TABLE_HEADERS = [
|
|
43
|
-
{
|
|
44
|
-
nestedValue: false,
|
|
45
|
-
componentOptions: {
|
|
46
|
-
titleKey: 'fullName',
|
|
47
|
-
descriptionKey: 'emailAddress',
|
|
48
|
-
},
|
|
49
|
-
component: 'data-summary'
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
title: 'Rôle',
|
|
53
|
-
property: 'role',
|
|
54
|
-
component: 'data-text'
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
component: "data-spacer",
|
|
58
|
-
grow: true
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
component: 'actions',
|
|
62
|
-
componentOptions: {
|
|
63
|
-
options: [{ label: 'Voir', action: 'read' }, { label: 'Modifier', action: 'update' }, { label: 'Supprimer', action: 'remove' }]
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
]
|
|
67
|
-
|
|
68
|
-
// Prepare reactive data
|
|
69
|
-
const limit = ref(25)
|
|
70
|
-
|
|
71
|
-
// Prepare computed
|
|
72
|
-
const records = computed(() => User.repo.all())
|
|
73
|
-
const filters = computed(() => [])
|
|
74
|
-
const abilities = computed(() => ['update', 'remove'])
|
|
75
|
-
|
|
76
|
-
// Prepare methods
|
|
77
|
-
const _fetchMore = async (skip = 0) => {
|
|
78
|
-
await User.list(undefined, undefined, { skip, limit: limit.value })
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// Prepare methods
|
|
82
|
-
const _handle = async (action, data = {}) => {
|
|
83
|
-
const { _id } = data
|
|
84
|
-
switch (action) {
|
|
85
|
-
case 'create': {
|
|
86
|
-
// Une INVITATION est émise : l'email part côté serveur, et le lien est
|
|
87
|
-
// copié au presse-papier comme second recours.
|
|
88
|
-
// L'origine vient du navigateur, jamais d'une URL cuite au build —
|
|
89
|
-
// l'image d'instance est commune à tous les clients.
|
|
90
|
-
const { token } = await User.create(data)
|
|
91
|
-
const link = `${window.location.origin}/welcome/${token}`
|
|
92
|
-
try {
|
|
93
|
-
await navigator.clipboard.writeText(link)
|
|
94
|
-
notificationsStore.add({
|
|
95
|
-
icon: 'iconoir:mail-out',
|
|
96
|
-
type: 'success',
|
|
97
|
-
title: 'Lien d\'invitation copié dans le presse-papier (valable 7 jours).'
|
|
98
|
-
})
|
|
99
|
-
} catch {
|
|
100
|
-
console.log('Lien d\'invitation :', link)
|
|
101
|
-
notificationsStore.add({
|
|
102
|
-
icon: 'iconoir:mail-out',
|
|
103
|
-
type: 'success',
|
|
104
|
-
title: 'Invitation créée — lien affiché dans la console (valable 7 jours).'
|
|
105
|
-
})
|
|
106
|
-
}
|
|
107
|
-
await User.list()
|
|
108
|
-
break
|
|
109
|
-
}
|
|
110
|
-
case 'update':
|
|
111
|
-
await User.update(_id, data)
|
|
112
|
-
break
|
|
113
|
-
case 'remove':
|
|
114
|
-
await User.remove(data._id)
|
|
115
|
-
break
|
|
116
|
-
default:
|
|
117
|
-
throw new Error('E_UNHANDLED')
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
const _openModalForm = (action, record) => {
|
|
122
|
-
$modalStore.open({
|
|
123
|
-
onSubmit: async (data) => _handle(action, data),
|
|
124
|
-
details: {
|
|
125
|
-
title: `${action === 'create' ? 'Inviter' : 'Modifier'} un membre`,
|
|
126
|
-
subTitle: action === 'create'
|
|
127
|
-
? 'Un lien d\'invitation sera généré pour ce nouveau membre.'
|
|
128
|
-
: 'Modifiez les informations du membre.',
|
|
129
|
-
acceptButton: `${action === 'create' ? 'Inviter' : 'Modifier'}`,
|
|
130
|
-
closeButton: 'Annuler'
|
|
131
|
-
},
|
|
132
|
-
attributes: action === 'create'
|
|
133
|
-
? [
|
|
134
|
-
{
|
|
135
|
-
property: 'emailAddress',
|
|
136
|
-
componentOptions: {
|
|
137
|
-
label: 'Adresse mail',
|
|
138
|
-
name: 'emailAddress'
|
|
139
|
-
},
|
|
140
|
-
component: 'input-text'
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
property: 'role',
|
|
144
|
-
componentOptions: {
|
|
145
|
-
label: 'Rôle',
|
|
146
|
-
name: 'role',
|
|
147
|
-
items: ['admin', 'redacteur'],
|
|
148
|
-
object: false
|
|
149
|
-
},
|
|
150
|
-
component: 'select-enum'
|
|
151
|
-
}
|
|
152
|
-
]
|
|
153
|
-
: [
|
|
154
|
-
{
|
|
155
|
-
property: 'firstName',
|
|
156
|
-
componentOptions: {
|
|
157
|
-
label: 'Nom d\'affichage',
|
|
158
|
-
name: 'firstName'
|
|
159
|
-
},
|
|
160
|
-
component: 'input-text'
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
property: 'role',
|
|
164
|
-
componentOptions: {
|
|
165
|
-
label: 'Rôle',
|
|
166
|
-
name: 'role',
|
|
167
|
-
items: ['admin', 'redacteur'],
|
|
168
|
-
object: false
|
|
169
|
-
},
|
|
170
|
-
component: 'select-enum'
|
|
171
|
-
}
|
|
172
|
-
],
|
|
173
|
-
record
|
|
174
|
-
})
|
|
175
|
-
}
|
|
176
|
-
</script>
|
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="relative block w-full">
|
|
3
|
-
<!-- Instance single-tenant : une seule collectivité par déploiement. -->
|
|
4
|
-
<p class="mb-6 rounded-md bg-amber-50 border border-amber-200 px-4 py-3 text-sm text-amber-800">
|
|
5
|
-
Cette instance héberge une seule collectivité — la création d'organisations n'est plus disponible.
|
|
6
|
-
</p>
|
|
7
|
-
|
|
8
|
-
<data-list :items="sortedOrganizations" :density="1" :density-children="2" :group-by="'type'" :item-value="'type'" class="space-y-4 bg-gray-50 p-2 rounded-md">
|
|
9
|
-
<template #item="{ item }">
|
|
10
|
-
<h3 class="text-gray-400 text-sm font-medium mb-2 pl-2">
|
|
11
|
-
@ {{ item.type }}
|
|
12
|
-
</h3>
|
|
13
|
-
</template>
|
|
14
|
-
<template #item-child="{ item: itemChild }">
|
|
15
|
-
<data-list-row
|
|
16
|
-
:item="itemChild"
|
|
17
|
-
:to="`/${itemChild._id}`"
|
|
18
|
-
:headers="ROW_DEFINITION"
|
|
19
|
-
class="border border-gray-100 bg-white shadow-sm rounded-lg"
|
|
20
|
-
@click="_handleRowEvent"
|
|
21
|
-
/>
|
|
22
|
-
</template>
|
|
23
|
-
</data-list>
|
|
24
|
-
</div>
|
|
25
|
-
</template>
|
|
26
|
-
|
|
27
|
-
<script setup>
|
|
28
|
-
import ButtonSecondary from '~/components/elements/buttons/secondary'
|
|
29
|
-
import dataList from '~/components/data/lists/data-list'
|
|
30
|
-
import dataListRow from '~/components/data/display/row'
|
|
31
|
-
import { useWorkspaceStore } from '~/store/layout/workspace'
|
|
32
|
-
import { useModalStore } from '~/store/layout/modal'
|
|
33
|
-
|
|
34
|
-
definePageMeta({
|
|
35
|
-
permissions: ['manage:all'],
|
|
36
|
-
preFetch: ['Organization'],
|
|
37
|
-
headings: {
|
|
38
|
-
title: 'Organisations',
|
|
39
|
-
description: 'Retrouvez & managez ici toutes les organisations.'
|
|
40
|
-
}
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
const { Organization } = useModels()
|
|
44
|
-
const modalStore = useModalStore()
|
|
45
|
-
|
|
46
|
-
// Prepare constants
|
|
47
|
-
const ORGANIZATIONS_ORDER = ['customer', 'network', 'country', 'bu', 'root'];
|
|
48
|
-
const ROW_DEFINITION = [
|
|
49
|
-
{
|
|
50
|
-
component: 'data-avatar',
|
|
51
|
-
nestedValue: false
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
nestedValue: false,
|
|
55
|
-
componentOptions: {
|
|
56
|
-
titleKey: 'name',
|
|
57
|
-
descriptionKey: 'path',
|
|
58
|
-
},
|
|
59
|
-
component: 'data-summary'
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
component: "data-spacer",
|
|
63
|
-
grow: true
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
component: 'actions',
|
|
67
|
-
componentOptions: {
|
|
68
|
-
options: [{ label: 'Voir', action: 'read' }]
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
]
|
|
72
|
-
|
|
73
|
-
// Prepare data
|
|
74
|
-
const { data: organizations } = await useAsyncData('overview', () => Organization.list())
|
|
75
|
-
|
|
76
|
-
// Prepare computed
|
|
77
|
-
const sortedOrganizations = computed(() => organizations.value.sort((a, b) => ORGANIZATIONS_ORDER.indexOf(a.type) - ORGANIZATIONS_ORDER.indexOf(b.type)))
|
|
78
|
-
|
|
79
|
-
// Prepare methods
|
|
80
|
-
const _handleRowEvent = async (eventName, value) => {
|
|
81
|
-
console.log(eventName, value)
|
|
82
|
-
}
|
|
83
|
-
// import { UPDATE_ORGANIZATION } from '~/store/actions'
|
|
84
|
-
// import buttonSecondary from '~/components/elements/buttons/secondary'
|
|
85
|
-
|
|
86
|
-
// export default {
|
|
87
|
-
// name: 'Organizations',
|
|
88
|
-
// meta: {
|
|
89
|
-
// permissions: ['entrance:self'],
|
|
90
|
-
// preFetch: ['Organization'],
|
|
91
|
-
// headings: {
|
|
92
|
-
// title: 'Organisations',
|
|
93
|
-
// description: 'Retrouvez & managez ici toutes les organisations.'
|
|
94
|
-
// }
|
|
95
|
-
// },
|
|
96
|
-
// components: { buttonSecondary },
|
|
97
|
-
// computed: {
|
|
98
|
-
// organizations () {
|
|
99
|
-
// return this.$api.Organization.all()
|
|
100
|
-
// }
|
|
101
|
-
// },
|
|
102
|
-
// beforeDestroy () {
|
|
103
|
-
// this.$nuxt.$off('modalCreateOrganization')
|
|
104
|
-
// },
|
|
105
|
-
// mounted () {
|
|
106
|
-
// this.$nuxt.$on('modalCreateOrganization', this.createOrganization)
|
|
107
|
-
// },
|
|
108
|
-
// methods: {
|
|
109
|
-
// async updateSelectedOrganization (organizationRecord) {
|
|
110
|
-
// try {
|
|
111
|
-
// await this.$store.dispatch(UPDATE_ORGANIZATION, organizationRecord)
|
|
112
|
-
// this.$router.replace(`${organizationRecord.slug}/`)
|
|
113
|
-
// } catch (err) {
|
|
114
|
-
// console.log(err) // eslint-disable-line
|
|
115
|
-
// }
|
|
116
|
-
// },
|
|
117
|
-
// openModalForm (record) {
|
|
118
|
-
// this.$nuxt.$emit('openModalForm', {
|
|
119
|
-
// submitEvent: 'modalCreateOrganization',
|
|
120
|
-
// details: {
|
|
121
|
-
// title: 'Créer une nouvelle organisation',
|
|
122
|
-
// subTitle: 'Renseignez cette nouvelle entité.'
|
|
123
|
-
// },
|
|
124
|
-
// attributes: [
|
|
125
|
-
// // directParent
|
|
126
|
-
// {
|
|
127
|
-
// property: 'directParent',
|
|
128
|
-
// componentOptions: {
|
|
129
|
-
// placeHolder: 'Parent de l\'organisation',
|
|
130
|
-
// name: 'directParent',
|
|
131
|
-
// model: 'Organization',
|
|
132
|
-
// object: true,
|
|
133
|
-
// itemKey: 'name',
|
|
134
|
-
// itemValue: 'slug'
|
|
135
|
-
// },
|
|
136
|
-
// component: 'select-model'
|
|
137
|
-
// },
|
|
138
|
-
// {
|
|
139
|
-
// property: 'type',
|
|
140
|
-
// componentOptions: {
|
|
141
|
-
// placeHolder: 'Type d\'organisation',
|
|
142
|
-
// name: 'type',
|
|
143
|
-
// items: [
|
|
144
|
-
// 'bu',
|
|
145
|
-
// 'country',
|
|
146
|
-
// 'network',
|
|
147
|
-
// 'customer'
|
|
148
|
-
// ]
|
|
149
|
-
// },
|
|
150
|
-
// component: 'select-enum'
|
|
151
|
-
// },
|
|
152
|
-
// {
|
|
153
|
-
// property: 'slug',
|
|
154
|
-
// componentOptions: {
|
|
155
|
-
// placeHolder: 'Identifiant de l\'organisation (slug)',
|
|
156
|
-
// name: 'slug'
|
|
157
|
-
// },
|
|
158
|
-
// component: 'input-text'
|
|
159
|
-
// },
|
|
160
|
-
// {
|
|
161
|
-
// property: 'name',
|
|
162
|
-
// componentOptions: {
|
|
163
|
-
// placeHolder: 'Nom de l\'organisation',
|
|
164
|
-
// name: 'name'
|
|
165
|
-
// },
|
|
166
|
-
// component: 'input-text'
|
|
167
|
-
// },
|
|
168
|
-
// {
|
|
169
|
-
// property: 'type',
|
|
170
|
-
// componentOptions: {
|
|
171
|
-
// placeHolder: 'Localisation',
|
|
172
|
-
// name: 'organization'
|
|
173
|
-
// },
|
|
174
|
-
// component: 'input-location'
|
|
175
|
-
// }
|
|
176
|
-
// ],
|
|
177
|
-
// record
|
|
178
|
-
// })
|
|
179
|
-
// },
|
|
180
|
-
// async createOrganization (data = {}) {
|
|
181
|
-
// this.$nuxt.$loading.start()
|
|
182
|
-
// try {
|
|
183
|
-
// await this.$api.Organization.create(data)
|
|
184
|
-
// } catch (err) {
|
|
185
|
-
// console.log(err)
|
|
186
|
-
// } finally {
|
|
187
|
-
// this.$nuxt.$loading.finish()
|
|
188
|
-
// }
|
|
189
|
-
// }
|
|
190
|
-
// }
|
|
191
|
-
// }
|
|
192
|
-
</script>
|
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<section class="w-full">
|
|
3
|
-
<!-- Rôles figés par Open Commune (admin / rédacteur) : consultation seule. -->
|
|
4
|
-
<p class="mb-6 rounded-md bg-amber-50 border border-amber-200 px-4 py-3 text-sm text-amber-800">
|
|
5
|
-
Les rôles sont désormais prédéfinis (administrateur, rédacteur) et ne sont plus personnalisables.
|
|
6
|
-
</p>
|
|
7
|
-
<default-table
|
|
8
|
-
v-if="!$route.params.event"
|
|
9
|
-
:headers="TABLE_HEADERS"
|
|
10
|
-
:filters="filters"
|
|
11
|
-
:items="records"
|
|
12
|
-
:actions="abilities"
|
|
13
|
-
:pagination-size="limit"
|
|
14
|
-
display-search-bar
|
|
15
|
-
paginated-content
|
|
16
|
-
@fetch-more="_fetchMore"
|
|
17
|
-
@update="_openModalForm('update', $event)"
|
|
18
|
-
@remove="_handle('remove', $event)"
|
|
19
|
-
/>
|
|
20
|
-
</section>
|
|
21
|
-
</template>
|
|
22
|
-
|
|
23
|
-
<script setup>
|
|
24
|
-
import buttonSecondary from '~/components/elements/buttons/secondary'
|
|
25
|
-
import defaultTable from '~/components/data/lists/data-lists-table'
|
|
26
|
-
import { useModalStore } from '~/store/layout/modal'
|
|
27
|
-
|
|
28
|
-
definePageMeta({
|
|
29
|
-
permissions: ['manage:all'],
|
|
30
|
-
preFetch: ['Role'],
|
|
31
|
-
headings: {
|
|
32
|
-
title: 'Membres',
|
|
33
|
-
description: 'Retrouvez & managez ici toutes les membres de la plateforme.'
|
|
34
|
-
}
|
|
35
|
-
})
|
|
36
|
-
|
|
37
|
-
const { Role } = useModels()
|
|
38
|
-
const $route = useRoute()
|
|
39
|
-
const $modalStore = useModalStore()
|
|
40
|
-
|
|
41
|
-
// Prepare constants
|
|
42
|
-
const TABLE_HEADERS = [
|
|
43
|
-
{
|
|
44
|
-
title: 'Nom',
|
|
45
|
-
property: 'name',
|
|
46
|
-
component: 'data-text'
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
title: '',
|
|
50
|
-
component: 'actions'
|
|
51
|
-
}
|
|
52
|
-
]
|
|
53
|
-
|
|
54
|
-
// Prepare reactive data
|
|
55
|
-
const limit = ref(25)
|
|
56
|
-
|
|
57
|
-
// Prepare computed
|
|
58
|
-
const records = computed(() => Role.repo.all())
|
|
59
|
-
const filters = computed(() => [])
|
|
60
|
-
// Rôles figés : aucune action d'édition/suppression proposée.
|
|
61
|
-
const abilities = computed(() => [])
|
|
62
|
-
|
|
63
|
-
// Prepare methods
|
|
64
|
-
const _fetchMore = async (skip = 0) => {
|
|
65
|
-
await Role.list(undefined, undefined, { skip, limit: limit.value })
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// Prepare methods
|
|
69
|
-
const _handle = async (action, data = {}) => {
|
|
70
|
-
const { _id } = data
|
|
71
|
-
switch (action) {
|
|
72
|
-
case 'add':
|
|
73
|
-
await Role.create(data)
|
|
74
|
-
break
|
|
75
|
-
case 'update':
|
|
76
|
-
await Role.update(_id, data)
|
|
77
|
-
break
|
|
78
|
-
case 'remove':
|
|
79
|
-
await Role.remove(_id)
|
|
80
|
-
break
|
|
81
|
-
default:
|
|
82
|
-
throw new Error('E_UNHANDLED')
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
const _openModalForm = (action, record) => {
|
|
87
|
-
$modalStore.open({
|
|
88
|
-
onSubmit: async (data) => _handle(action, data),
|
|
89
|
-
details: {
|
|
90
|
-
title: `${action === 'add' ? 'Ajouter' : 'Modifier'} un rôle`,
|
|
91
|
-
subTitle: 'Reinseignez les informations de ce rôle.',
|
|
92
|
-
acceptButton: `${action === 'add' ? 'Ajouter' : 'Modifier'}`,
|
|
93
|
-
closeButton: 'Annuler'
|
|
94
|
-
},
|
|
95
|
-
attributes: [
|
|
96
|
-
{
|
|
97
|
-
property: 'name',
|
|
98
|
-
componentOptions: {
|
|
99
|
-
label: 'Nom du rôle',
|
|
100
|
-
name: 'name'
|
|
101
|
-
},
|
|
102
|
-
component: 'input-text'
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
property: 'description',
|
|
106
|
-
componentOptions: {
|
|
107
|
-
label: 'Description rôle',
|
|
108
|
-
name: 'description'
|
|
109
|
-
},
|
|
110
|
-
component: 'input-text'
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
property: 'permissions',
|
|
114
|
-
componentOptions: {
|
|
115
|
-
label: 'Permissions du rôle',
|
|
116
|
-
name: 'permissions',
|
|
117
|
-
items: [
|
|
118
|
-
'manage:all',
|
|
119
|
-
'read:deployments',
|
|
120
|
-
'create:deployments',
|
|
121
|
-
'admin:organizations',
|
|
122
|
-
'create:organizations',
|
|
123
|
-
'read:organizations',
|
|
124
|
-
'update:organizations',
|
|
125
|
-
'create:collections',
|
|
126
|
-
'read:collections',
|
|
127
|
-
'update:collections',
|
|
128
|
-
'delete:collections',
|
|
129
|
-
'publish:records',
|
|
130
|
-
'create:records',
|
|
131
|
-
'read:records',
|
|
132
|
-
'update:records',
|
|
133
|
-
'delete:records',
|
|
134
|
-
'create:media',
|
|
135
|
-
'read:media',
|
|
136
|
-
'update:media',
|
|
137
|
-
'delete:media',
|
|
138
|
-
'create:users',
|
|
139
|
-
'read:users',
|
|
140
|
-
'update:users',
|
|
141
|
-
'delete:users',
|
|
142
|
-
'create:roles',
|
|
143
|
-
'read:roles',
|
|
144
|
-
'update:roles',
|
|
145
|
-
'delete:roles',
|
|
146
|
-
'create:tokens',
|
|
147
|
-
'read:tokens',
|
|
148
|
-
'update:tokens',
|
|
149
|
-
'delete:tokens'
|
|
150
|
-
],
|
|
151
|
-
enableMultiple: true,
|
|
152
|
-
object: false,
|
|
153
|
-
placeHolder: 'Ajouter une ou plusieurs permissions',
|
|
154
|
-
},
|
|
155
|
-
component: 'select-enum'
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
property: 'onlyOwn',
|
|
159
|
-
componentOptions: {
|
|
160
|
-
label: 'Restriction créateur',
|
|
161
|
-
description: 'Restreindre le champs d\'action d\'un utilisateur à ses propres ressources uniquement.',
|
|
162
|
-
name: 'onlyOwn',
|
|
163
|
-
property: 'onlyOwn',
|
|
164
|
-
readOnly: true
|
|
165
|
-
},
|
|
166
|
-
component: 'input-toggle'
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
property: 'mfa',
|
|
170
|
-
componentOptions: {
|
|
171
|
-
label: 'Authentification multi-facteur',
|
|
172
|
-
description: 'Vérifier l\'authentification d\'un utilisateur via un facteur supplémentaire (authenticator, sms, ...).',
|
|
173
|
-
name: 'mfa',
|
|
174
|
-
property: 'mfa',
|
|
175
|
-
readOnly: true
|
|
176
|
-
},
|
|
177
|
-
component: 'input-toggle'
|
|
178
|
-
}
|
|
179
|
-
],
|
|
180
|
-
record
|
|
181
|
-
})
|
|
182
|
-
}
|
|
183
|
-
</script>
|
package/public/logo-black.svg
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 436.25 186.76"><g id="Calque_2" data-name="Calque 2"><g id="Calque_1-2" data-name="Calque 1"><path d="M0,78.58H16.89q14.6,0,19.63,1.26a21.85,21.85,0,0,1,11.9,7.38q4.59,5.55,4.58,14t-4.49,13.93a22,22,0,0,1-12.39,7.42Q30.33,124,14.54,124H8.47v39.49H0Zm8.47,8.24v28.85l14.43.17q8.64,0,12.67-1.57a13.08,13.08,0,0,0,6.36-5.15,14.56,14.56,0,0,0,0-15.77,12.72,12.72,0,0,0-6.1-5q-3.78-1.49-12.36-1.49Z"/><path d="M98.22,97.93a31.17,31.17,0,0,1,24,10.47,33.74,33.74,0,0,1-.51,45.65q-9.16,9.81-23.53,9.81t-23.55-9.81a33.69,33.69,0,0,1-.49-45.59A31.09,31.09,0,0,1,98.22,97.93Zm0,7.9A23.16,23.16,0,0,0,81,113.27a24.87,24.87,0,0,0-7.21,18A25.83,25.83,0,0,0,77.07,144a23.16,23.16,0,0,0,8.9,9.11,25.43,25.43,0,0,0,24.59,0A23,23,0,0,0,119.4,144a26,26,0,0,0,3.26-12.73,24.87,24.87,0,0,0-7.21-18A23.16,23.16,0,0,0,98.22,105.83Z"/><path d="M144.7,99.53h8.13v29.3q0,10.77,1.14,14.77a16.44,16.44,0,0,0,6.58,9.13,20.13,20.13,0,0,0,11.68,3.35,19.61,19.61,0,0,0,11.45-3.26,16.68,16.68,0,0,0,6.47-8.59q1.24-3.6,1.25-15.4V99.53h8.25v30.85q0,13-3.07,19.55a23.2,23.2,0,0,1-9.12,10.24q-6.08,3.69-15.23,3.69t-15.34-3.69a22.81,22.81,0,0,1-9.16-10.36q-3-6.66-3-20.06Z"/><path d="M216.25,76.75h8.12v87.06h-8.12Z"/><path d="M258.52,101.1a35.52,35.52,0,0,1,14.39-2.94,31,31,0,0,1,22.9,9.61,31.8,31.8,0,0,1,9.5,23.18,32.34,32.34,0,0,1-9.45,23.47,30.6,30.6,0,0,1-22.72,9.67A31.09,31.09,0,0,1,259.35,161a33.81,33.81,0,0,1-11.39-9.3v35h-8V127.29a43.43,43.43,0,0,1,6.18-16.89A36.22,36.22,0,0,1,258.52,101.1Zm-3.92,12.11a25,25,0,0,0-7.22,18.26,25.93,25.93,0,0,0,3.21,12.85,23.37,23.37,0,0,0,9.16,9.1,25.31,25.31,0,0,0,12.59,3.35,24.06,24.06,0,0,0,12.28-3.35,24.57,24.57,0,0,0,9.16-9.45,25.71,25.71,0,0,0,3.4-12.73,25.39,25.39,0,0,0-3.38-12.71,24.63,24.63,0,0,0-9.07-9.3,24.24,24.24,0,0,0-12.5-3.35A23.75,23.75,0,0,0,254.6,113.21Z"/><path d="M401.3,4.32c-37.74-13.13-70.44,5.59-79.08,30.43-3.34,9.26-.69,14.91,2.11,18,5.32,5.88,14.82,6.74,19.87,5.48a14.89,14.89,0,0,0,4-1.73,9.79,9.79,0,0,0,1.15,3.84,7.13,7.13,0,0,0,6.43,3.57c3.73,0,7.56-2,11.54-6a9.2,9.2,0,0,0,.84,2.11,7.81,7.81,0,0,0,7.09,3.84c8.75,0,15.57-10.58,22.16-20.81.94-1.46,1.86-2.89,2.76-4.25,1.77,3.74,3.68,8.52,3.91,11.84a7,7,0,0,1-1.76,5.43,4.81,4.81,0,0,1-2.85,1.63c-2,0-2-.54-2-.94a2,2,0,0,1,.45-.6,3.29,3.29,0,0,0-4.12-5.12,7.7,7.7,0,0,0-2.89,5.6c0,3.52,2.24,7.63,8.57,7.63a11.09,11.09,0,0,0,7.65-3.71,13.62,13.62,0,0,0,3.51-10.36c-.51-7.65-6.92-18.92-7.19-19.4a3.28,3.28,0,0,0-5.5-.31c-2,2.74-4.07,5.92-6.05,9-5.11,7.94-11.48,17.81-16.64,17.81-1.07,0-1.27-.36-1.4-.57-.84-1.46-.43-5.44,1.51-8.83,1.56-2.72,3.09-5.54,4.23-7.68.23-.42.46-.87.69-1.3.55-1,.93-1.77,1.1-2.11a3.94,3.94,0,0,0,.3-.88,3.21,3.21,0,0,0-5.64-2.84,27,27,0,0,0-1.37,2.37c-.18.35-.39.75-.62,1.17-7,13-13.73,20.67-18.27,20.67-.57,0-.65-.14-.74-.29-.83-1.44-.29-5.72,1.65-9.09,3.06-5.35,6.43-11.2,6.43-11.2a4.59,4.59,0,0,0,.24-.59,3.27,3.27,0,0,0-5.9-2.76c-.94,1.56-1.82,3-2.66,4.47-4.56,7.71-7.57,12.8-12.24,14-3.41.85-10.13.09-13.39-3.51-2.33-2.58-2.6-6.41-.79-11.42C336,15.06,365.23-1.27,399.14,10.53c19.65,6.83,35.93,24.11,29,43.92-7.89,22.69-36.71,30.73-61.51,30.73h-1.24a45.27,45.27,0,0,1-8-.79l-.47-.1a11.66,11.66,0,0,0-7.84,1.07L330.2,95.14c5.05-9.58,9-19.17,7.18-23.2A3.36,3.36,0,0,0,333,70.18a3.2,3.2,0,0,0-1.69,4.25c.51,2.92-5.89,16.33-12.19,27a3.28,3.28,0,0,0,2.83,5,3.35,3.35,0,0,0,1.51-.36l28.64-14.86a5.09,5.09,0,0,1,3.42-.47l.63.13a52.64,52.64,0,0,0,9.2.91c27.36.29,59.86-8.78,69-35.14C440.68,38.53,431.33,14.77,401.3,4.32Z"/></g></g></svg>
|
package/public/logo-white.svg
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 436.25 186.76"><defs><style>.cls-1{fill:#fff;}</style></defs><g id="Calque_2" data-name="Calque 2"><g id="Calque_1-2" data-name="Calque 1"><path class="cls-1" d="M0,78.58H16.89q14.6,0,19.63,1.26a21.85,21.85,0,0,1,11.9,7.38q4.59,5.55,4.58,14t-4.49,13.93a22,22,0,0,1-12.39,7.42Q30.33,124,14.54,124H8.47v39.49H0Zm8.47,8.24v28.85l14.43.17q8.64,0,12.67-1.57a13.08,13.08,0,0,0,6.36-5.15,14.56,14.56,0,0,0,0-15.77,12.72,12.72,0,0,0-6.1-5q-3.78-1.49-12.36-1.49Z"/><path class="cls-1" d="M98.22,97.93a31.17,31.17,0,0,1,24,10.47,33.74,33.74,0,0,1-.51,45.65q-9.16,9.81-23.53,9.81t-23.55-9.81a33.69,33.69,0,0,1-.49-45.59A31.09,31.09,0,0,1,98.22,97.93Zm0,7.9A23.16,23.16,0,0,0,81,113.27a24.87,24.87,0,0,0-7.21,18A25.83,25.83,0,0,0,77.07,144a23.16,23.16,0,0,0,8.9,9.11,25.43,25.43,0,0,0,24.59,0A23,23,0,0,0,119.4,144a26,26,0,0,0,3.26-12.73,24.87,24.87,0,0,0-7.21-18A23.16,23.16,0,0,0,98.22,105.83Z"/><path class="cls-1" d="M144.7,99.53h8.13v29.3q0,10.77,1.14,14.77a16.44,16.44,0,0,0,6.58,9.13,20.13,20.13,0,0,0,11.68,3.35,19.61,19.61,0,0,0,11.45-3.26,16.68,16.68,0,0,0,6.47-8.59q1.24-3.6,1.25-15.4V99.53h8.25v30.85q0,13-3.07,19.55a23.2,23.2,0,0,1-9.12,10.24q-6.08,3.69-15.23,3.69t-15.34-3.69a22.81,22.81,0,0,1-9.16-10.36q-3-6.66-3-20.06Z"/><path class="cls-1" d="M216.25,76.75h8.12v87.06h-8.12Z"/><path class="cls-1" d="M258.52,101.1a35.52,35.52,0,0,1,14.39-2.94,31,31,0,0,1,22.9,9.61,31.8,31.8,0,0,1,9.5,23.18,32.34,32.34,0,0,1-9.45,23.47,30.6,30.6,0,0,1-22.72,9.67A31.09,31.09,0,0,1,259.35,161a33.81,33.81,0,0,1-11.39-9.3v35h-8V127.29a43.43,43.43,0,0,1,6.18-16.89A36.22,36.22,0,0,1,258.52,101.1Zm-3.92,12.11a25,25,0,0,0-7.22,18.26,25.93,25.93,0,0,0,3.21,12.85,23.37,23.37,0,0,0,9.16,9.1,25.31,25.31,0,0,0,12.59,3.35,24.06,24.06,0,0,0,12.28-3.35,24.57,24.57,0,0,0,9.16-9.45,25.71,25.71,0,0,0,3.4-12.73,25.39,25.39,0,0,0-3.38-12.71,24.63,24.63,0,0,0-9.07-9.3,24.24,24.24,0,0,0-12.5-3.35A23.75,23.75,0,0,0,254.6,113.21Z"/><path class="cls-1" d="M401.3,4.32c-37.74-13.13-70.44,5.59-79.08,30.43-3.34,9.26-.69,14.91,2.11,18,5.32,5.88,14.82,6.74,19.87,5.48a14.89,14.89,0,0,0,4-1.73,9.79,9.79,0,0,0,1.15,3.84,7.13,7.13,0,0,0,6.43,3.57c3.73,0,7.56-2,11.54-6a9.2,9.2,0,0,0,.84,2.11,7.81,7.81,0,0,0,7.09,3.84c8.75,0,15.57-10.58,22.16-20.81.94-1.46,1.86-2.89,2.76-4.25,1.77,3.74,3.68,8.52,3.91,11.84a7,7,0,0,1-1.76,5.43,4.81,4.81,0,0,1-2.85,1.63c-2,0-2-.54-2-.94a2,2,0,0,1,.45-.6,3.29,3.29,0,0,0-4.12-5.12,7.7,7.7,0,0,0-2.89,5.6c0,3.52,2.24,7.63,8.57,7.63a11.09,11.09,0,0,0,7.65-3.71,13.62,13.62,0,0,0,3.51-10.36c-.51-7.65-6.92-18.92-7.19-19.4a3.28,3.28,0,0,0-5.5-.31c-2,2.74-4.07,5.92-6.05,9-5.11,7.94-11.48,17.81-16.64,17.81-1.07,0-1.27-.36-1.4-.57-.84-1.46-.43-5.44,1.51-8.83,1.56-2.72,3.09-5.54,4.23-7.68.23-.42.46-.87.69-1.3.55-1,.93-1.77,1.1-2.11a3.94,3.94,0,0,0,.3-.88,3.21,3.21,0,0,0-5.64-2.84,27,27,0,0,0-1.37,2.37c-.18.35-.39.75-.62,1.17-7,13-13.73,20.67-18.27,20.67-.57,0-.65-.14-.74-.29-.83-1.44-.29-5.72,1.65-9.09,3.06-5.35,6.43-11.2,6.43-11.2a4.59,4.59,0,0,0,.24-.59,3.27,3.27,0,0,0-5.9-2.76c-.94,1.56-1.82,3-2.66,4.47-4.56,7.71-7.57,12.8-12.24,14-3.41.85-10.13.09-13.39-3.51-2.33-2.58-2.6-6.41-.79-11.42C336,15.06,365.23-1.27,399.14,10.53c19.65,6.83,35.93,24.11,29,43.92-7.89,22.69-36.71,30.73-61.51,30.73h-1.24a45.27,45.27,0,0,1-8-.79l-.47-.1a11.66,11.66,0,0,0-7.84,1.07L330.2,95.14c5.05-9.58,9-19.17,7.18-23.2A3.36,3.36,0,0,0,333,70.18a3.2,3.2,0,0,0-1.69,4.25c.51,2.92-5.89,16.33-12.19,27a3.28,3.28,0,0,0,2.83,5,3.35,3.35,0,0,0,1.51-.36l28.64-14.86a5.09,5.09,0,0,1,3.42-.47l.63.13a52.64,52.64,0,0,0,9.2.91c27.36.29,59.86-8.78,69-35.14C440.68,38.53,431.33,14.77,401.3,4.32Z"/></g></g></svg>
|
|
File without changes
|