diff --git a/apps/ops/src/components/flow-editor/kind-catalogs.js b/apps/ops/src/components/flow-editor/kind-catalogs.js index 68850bb..d084aa5 100644 --- a/apps/ops/src/components/flow-editor/kind-catalogs.js +++ b/apps/ops/src/components/flow-editor/kind-catalogs.js @@ -64,7 +64,7 @@ export const TRIGGER_TYPES = { // Project kinds — for the project wizard + service orchestration flows // ----------------------------------------------------------------------------- -const JOB_TYPES = ['Installation', 'Réparation', 'Maintenance', 'Retrait', 'Dépannage', 'Autre'] +import { JOB_TYPES } from 'src/config/job-types' // types de job — SOURCE UNIQUE const PRIORITIES = ['low', 'medium', 'high'] const GROUPS = ['Admin', 'Tech Targo', 'Support', 'NOC', 'Facturation'] diff --git a/apps/ops/src/components/shared/TaskNode.vue b/apps/ops/src/components/shared/TaskNode.vue index 94876e9..535ce49 100644 --- a/apps/ops/src/components/shared/TaskNode.vue +++ b/apps/ops/src/components/shared/TaskNode.vue @@ -179,14 +179,8 @@ const statusOptions = [ ] // Priorité Dispatch Job — SOURCE UNIQUE (config/dispatch-priority). import { DISPATCH_PRIORITIES as priorityOptions } from 'src/config/dispatch-priority' -const jobTypeOptions = [ - { label: 'Installation', value: 'Installation' }, - { label: 'Réparation', value: 'Réparation' }, - { label: 'Maintenance', value: 'Maintenance' }, - { label: 'Retrait', value: 'Retrait' }, - { label: 'Dépannage', value: 'Dépannage' }, - { label: 'Autre', value: 'Autre' }, -] +// Types de job — SOURCE UNIQUE (config/job-types). +import { JOB_TYPE_OPTIONS as jobTypeOptions } from 'src/config/job-types' // ── Tech loading (lazy) ── const techOptions = ref([]) diff --git a/apps/ops/src/components/shared/UnifiedCreateModal.vue b/apps/ops/src/components/shared/UnifiedCreateModal.vue index a9ed3fe..f803183 100644 --- a/apps/ops/src/components/shared/UnifiedCreateModal.vue +++ b/apps/ops/src/components/shared/UnifiedCreateModal.vue @@ -224,14 +224,8 @@ const getTagColor = computed(() => props.externalGetColor || internalGetTagColor // Priorité Dispatch Job — SOURCE UNIQUE (3 niveaux ; « Urgent » = high, le champ Select rejette 'urgent' → 417). import { DISPATCH_PRIORITIES as priorityOptions } from 'src/config/dispatch-priority' -const jobTypeOptions = [ - { label: 'Installation', value: 'Installation' }, - { label: 'Réparation', value: 'Réparation' }, - { label: 'Maintenance', value: 'Maintenance' }, - { label: 'Retrait', value: 'Retrait' }, - { label: 'Dépannage', value: 'Dépannage' }, - { label: 'Autre', value: 'Autre' }, -] +// Types de job — SOURCE UNIQUE (config/job-types). +import { JOB_TYPE_OPTIONS as jobTypeOptions } from 'src/config/job-types' const issueTypeOptions = [ { label: 'Support', value: 'Support' }, diff --git a/apps/ops/src/config/job-types.js b/apps/ops/src/config/job-types.js new file mode 100644 index 0000000..808d73e --- /dev/null +++ b/apps/ops/src/config/job-types.js @@ -0,0 +1,14 @@ +// Types de « job » (champ Dispatch Job.job_type) — SOURCE UNIQUE. +// Importé partout où l'on choisit/affiche un type de job (modales de création, wizard projet, +// nœud de tâche, éditeur de flux). Ajouter/renommer un type = un seul endroit. +export const JOB_TYPE_OPTIONS = [ + { label: 'Installation', value: 'Installation' }, + { label: 'Réparation', value: 'Réparation' }, + { label: 'Maintenance', value: 'Maintenance' }, + { label: 'Retrait', value: 'Retrait' }, + { label: 'Dépannage', value: 'Dépannage' }, + { label: 'Autre', value: 'Autre' }, +] + +// Libellés bruts (['Installation', 'Réparation', …]) pour les sélecteurs qui attendent un tableau de chaînes. +export const JOB_TYPES = JOB_TYPE_OPTIONS.map(o => o.value) diff --git a/apps/ops/src/data/wizard-constants.js b/apps/ops/src/data/wizard-constants.js index 62cd02a..58eb4eb 100644 --- a/apps/ops/src/data/wizard-constants.js +++ b/apps/ops/src/data/wizard-constants.js @@ -1,13 +1,7 @@ export const STEP_LABELS = ['Modèle', 'Étapes', 'Items / Devis', 'Sommaire', 'Publier'] -export const JOB_TYPE_OPTIONS = [ - { label: 'Installation', value: 'Installation' }, - { label: 'Réparation', value: 'Réparation' }, - { label: 'Maintenance', value: 'Maintenance' }, - { label: 'Retrait', value: 'Retrait' }, - { label: 'Dépannage', value: 'Dépannage' }, - { label: 'Autre', value: 'Autre' }, -] +// Types de job — SOURCE UNIQUE dans config/job-types (ré-exporté ici pour compat des imports existants). +export { JOB_TYPE_OPTIONS } from 'src/config/job-types' export const PRIORITY_OPTIONS = [ { label: 'Urgent', value: 'high' },