@open-commune/web 0.2.2 → 0.2.4

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.
@@ -4,7 +4,7 @@
4
4
 
5
5
  <script setup>
6
6
  import badge from '~/components/elements/badges/badge'
7
- import { STATUSES } from '~/constants/statuses'
7
+ import { STATUSES } from '../../../../constants/statuses'
8
8
 
9
9
  // Prepare props
10
10
  const $props = defineProps({
@@ -40,7 +40,7 @@
40
40
  * the screen holds them and decides what to do with them.
41
41
  */
42
42
  import inputFilter from '~/components/forms/inputs/input-filter'
43
- import { ALL_STATUSES, STATUSES } from '~/constants/statuses'
43
+ import { ALL_STATUSES, STATUSES } from '../../../constants/statuses'
44
44
 
45
45
  // Prepare props
46
46
  const $props = defineProps({
@@ -0,0 +1,29 @@
1
+ import {
2
+ PUBLICATION_STATUSES,
3
+ type PublicationStatus,
4
+ } from '@open-commune/core/collections/constants';
5
+
6
+ interface Presentation {
7
+ label: string;
8
+ color: string;
9
+ }
10
+
11
+ /**
12
+ * How each publication status is shown. Typed against the core's union, so a
13
+ * status added there fails to compile here rather than reaching a screen that
14
+ * quietly ignores it.
15
+ */
16
+ 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' },
22
+ };
23
+
24
+ export const STATUSES = PUBLICATION_STATUSES.map((value) => ({
25
+ value,
26
+ ...PRESENTATION[value],
27
+ }));
28
+
29
+ export const ALL_STATUSES = [...PUBLICATION_STATUSES];
package/package.json CHANGED
@@ -40,7 +40,7 @@
40
40
  },
41
41
  "description": "The Open Commune application: the admin interface and the server, on a single origin.",
42
42
  "license": "AGPL-3.0-or-later",
43
- "version": "0.2.2",
43
+ "version": "0.2.4",
44
44
  "type": "module",
45
45
  "main": "./nuxt.config.ts",
46
46
  "files": [
@@ -49,6 +49,7 @@
49
49
  "nuxt.config.ts",
50
50
  "assets",
51
51
  "components",
52
+ "constants",
52
53
  "composables",
53
54
  "editor",
54
55
  "layouts",
@@ -47,7 +47,7 @@ import defaultTable from '~/components/data/lists/data-lists-table'
47
47
  import inputFilter from '~/components/forms/inputs/input-filter'
48
48
  import inputFilterStatus from '~/components/forms/inputs/input-filter-status'
49
49
  import inputSearch from '~/components/forms/inputs/input-search'
50
- import { ALL_STATUSES } from '~/constants/statuses'
50
+ import { ALL_STATUSES } from '../../constants/statuses'
51
51
 
52
52
  // Prepare composable
53
53
  const { Collection, Record } = useModels()