+
-
{{ display_filename }}
+
+ {{ display_filename }}
+
-
Déposez un document ou cliquez ici pour remplacer le document existant
-
Déposez un document ou cliquez ici pour ouvrir le navigateur de fichier
+
+ Déposez un document ou cliquez ici pour remplacer le document
+ existant
+
+
+ Déposez un document ou cliquez ici pour ouvrir le navigateur de
+ fichier
+
@@ -140,7 +166,8 @@ const handleFile = async (file: File): Promise
=> {
font-weight: 200;
}
- & > .area, & > .waiting {
+ & > .area,
+ & > .waiting {
width: 100%;
height: 10rem;
@@ -163,5 +190,4 @@ const handleFile = async (file: File): Promise => {
}
}
}
-
diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DropFileWidget/DropFileModal.vue b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DropFileWidget/DropFileModal.vue
index db868131a..216e2ddad 100644
--- a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DropFileWidget/DropFileModal.vue
+++ b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DropFileWidget/DropFileModal.vue
@@ -1,14 +1,13 @@
- Ajouter un document
- Remplacer le document
-
+
+ Ajouter un document
+
+
+ Remplacer le document
+
+
-
+
-
+
diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DropFileWidget/DropFileWidget.vue b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DropFileWidget/DropFileWidget.vue
index dd37a56fd..4e295e9ea 100644
--- a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DropFileWidget/DropFileWidget.vue
+++ b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DropFileWidget/DropFileWidget.vue
@@ -1,13 +1,12 @@
-
+
@@ -72,12 +85,14 @@ const onRemoveDocument = (e: Event): void => {
/>
-
+
-
+
diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/FileIcon.vue b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/FileIcon.vue
index 437d6bdc8..5260095fa 100644
--- a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/FileIcon.vue
+++ b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/FileIcon.vue
@@ -4,22 +4,43 @@ interface FileIconConfig {
}
const props = defineProps();
-
-
-
-
-
-
+
+
+
+
+
-
-
+
+
-
+
diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/ConvertButton.vue b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/ConvertButton.vue
index 397837688..b6c6a496f 100644
--- a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/ConvertButton.vue
+++ b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/ConvertButton.vue
@@ -1,61 +1,65 @@
-
-
- Télécharger en pdf
-
+
+
+ Télécharger en pdf
+
diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/DownloadButton.vue b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/DownloadButton.vue
index f3fd3b4b5..8fc88d729 100644
--- a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/DownloadButton.vue
+++ b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/DownloadButton.vue
@@ -1,58 +1,79 @@
-
+
Télécharger
-
+
Ouvrir
-
-
-
- Historique
-
+
+
+
+ Historique
+
+
diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/HistoryButton/HistoryButtonListItem.vue b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/HistoryButton/HistoryButtonListItem.vue
index 13ad2b547..917d4d109 100644
--- a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/HistoryButton/HistoryButtonListItem.vue
+++ b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/HistoryButton/HistoryButtonListItem.vue
@@ -1,11 +1,15 @@
-
-
+
diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/HistoryButton/RestoreVersionButton.vue b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/HistoryButton/RestoreVersionButton.vue
index 0c2ba2996..41ae8e978 100644
--- a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/HistoryButton/RestoreVersionButton.vue
+++ b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/HistoryButton/RestoreVersionButton.vue
@@ -1,17 +1,20 @@
- Restaurer
+
+ Restaurer
+
-
+
diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/WopiEditButton.vue b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/WopiEditButton.vue
index 135392c1e..b57c1f188 100644
--- a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/WopiEditButton.vue
+++ b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/WopiEditButton.vue
@@ -1,20 +1,29 @@
-
-
- Editer en ligne
-
+
+
+ Editer en ligne
+
-
diff --git a/src/Bundle/ChillMainBundle/Resources/public/module/pick-entity/index.js b/src/Bundle/ChillMainBundle/Resources/public/module/pick-entity/index.js
index 19194e318..b8fbf2022 100644
--- a/src/Bundle/ChillMainBundle/Resources/public/module/pick-entity/index.js
+++ b/src/Bundle/ChillMainBundle/Resources/public/module/pick-entity/index.js
@@ -1,7 +1,7 @@
-import { createApp } from 'vue';
-import PickEntity from 'ChillMainAssets/vuejs/PickEntity/PickEntity.vue';
-import { _createI18n } from 'ChillMainAssets/vuejs/_js/i18n';
-import { appMessages } from 'ChillMainAssets/vuejs/PickEntity/i18n';
+import { createApp } from "vue";
+import PickEntity from "ChillMainAssets/vuejs/PickEntity/PickEntity.vue";
+import { _createI18n } from "ChillMainAssets/vuejs/_js/i18n";
+import { appMessages } from "ChillMainAssets/vuejs/PickEntity/i18n";
const i18n = _createI18n(appMessages);
@@ -9,158 +9,172 @@ let appsOnPage = new Map();
let appsPerInput = new Map();
function loadDynamicPicker(element) {
+ let apps = element.querySelectorAll('[data-module="pick-dynamic"]');
- let apps = element.querySelectorAll('[data-module="pick-dynamic"]');
+ apps.forEach(function (el) {
+ const isMultiple = parseInt(el.dataset.multiple) === 1,
+ uniqId = el.dataset.uniqid,
+ input = element.querySelector(
+ '[data-input-uniqid="' + el.dataset.uniqid + '"]',
+ ),
+ // the "picked" will always be an array, even if multiple is false
+ picked = isMultiple
+ ? JSON.parse(input.value)
+ : input.value === "[]" || input.value === ""
+ ? null
+ : [JSON.parse(input.value)];
+ (suggested = JSON.parse(el.dataset.suggested)),
+ (as_id = parseInt(el.dataset.asId) === 1),
+ (submit_on_adding_new_entity =
+ parseInt(el.dataset.submitOnAddingNewEntity) === 1);
+ label = el.dataset.label;
- apps.forEach(function(el) {
+ if (!isMultiple) {
+ if (input.value === "[]") {
+ input.value = null;
+ }
+ }
- const
- isMultiple = parseInt(el.dataset.multiple) === 1,
- uniqId = el.dataset.uniqid,
- input = element.querySelector('[data-input-uniqid="'+ el.dataset.uniqid +'"]'),
- // the "picked" will always be an array, even if multiple is false
- picked = isMultiple ?
- JSON.parse(input.value) : (
- (input.value === '[]' || input.value === '') ?
- null : [ JSON.parse(input.value) ]
- )
- suggested = JSON.parse(el.dataset.suggested),
- as_id = parseInt(el.dataset.asId) === 1,
- submit_on_adding_new_entity = parseInt(el.dataset.submitOnAddingNewEntity) === 1
- label = el.dataset.label;
-
- if (!isMultiple) {
- if (input.value === '[]'){
- input.value = null;
- }
- }
-
- const app = createApp({
- template: '
',
- components: {
- PickEntity,
- },
- data() {
- return {
- multiple: isMultiple,
- types: JSON.parse(el.dataset.types),
- picked: picked === null ? [] : picked,
- uniqid: el.dataset.uniqid,
- suggested,
- as_id,
- submit_on_adding_new_entity,
- label,
- }
- },
- computed: {
- notPickedSuggested() {
- const pickedIds = new Set();
- for (const p of this.picked) {
- pickedIds.add(`${p.type}${p.id}`);
- }
- return this.suggested.filter(e => !pickedIds.has(`${e.type}${e.id}`))
+ const app = createApp({
+ template:
+ "
",
+ components: {
+ PickEntity,
+ },
+ data() {
+ return {
+ multiple: isMultiple,
+ types: JSON.parse(el.dataset.types),
+ picked: picked === null ? [] : picked,
+ uniqid: el.dataset.uniqid,
+ suggested,
+ as_id,
+ submit_on_adding_new_entity,
+ label,
+ };
+ },
+ computed: {
+ notPickedSuggested() {
+ const pickedIds = new Set();
+ for (const p of this.picked) {
+ pickedIds.add(`${p.type}${p.id}`);
+ }
+ return this.suggested.filter(
+ (e) => !pickedIds.has(`${e.type}${e.id}`),
+ );
+ },
+ },
+ methods: {
+ addNewEntity({ entity }) {
+ if (this.multiple) {
+ if (
+ !this.picked.some((el) => {
+ return el.type === entity.type && el.id === entity.id;
+ })
+ ) {
+ this.picked.push(entity);
+ if (!as_id) {
+ input.value = JSON.stringify(this.picked);
+ } else {
+ const ids = this.picked.map((el) => el.id);
+ input.value = ids.join(",");
}
- },
- methods: {
- addNewEntity({entity}) {
- if (this.multiple) {
- if (!this.picked.some(el => {
- return el.type === entity.type && el.id === entity.id;
- })) {
- this.picked.push(entity);
- if (!as_id) {
- input.value = JSON.stringify(this.picked);
- } else {
- const ids = this.picked.map(el => el.id);
- input.value = ids.join(',');
- }
- console.log(entity)
- }
- } else {
- if (!this.picked.some(el => {
- return el.type === entity.type && el.id === entity.id;
- })) {
- this.picked.splice(0, this.picked.length);
- this.picked.push(entity);
- if (!as_id) {
- input.value = JSON.stringify(this.picked[0]);
- } else {
- input.value = this.picked.map(el => el.id);
- }
- }
- }
- },
- addNewEntityProcessEnded() {
- if (this.submit_on_adding_new_entity) {
- input.form.submit();
- }
- },
- removeEntity({entity}) {
- if (-1 === this.suggested.findIndex(e => e.type === entity.type && e.id === entity.id)) {
- this.suggested.push(entity);
- }
- this.picked = this.picked.filter(e => !(e.type === entity.type && e.id === entity.id));
- if (this.multiple) {
- input.value = JSON.stringify(this.picked);
- } else {
- input.value = "";
- }
- },
+ console.log(entity);
}
- })
- .use(i18n)
- .mount(el);
+ } else {
+ if (
+ !this.picked.some((el) => {
+ return el.type === entity.type && el.id === entity.id;
+ })
+ ) {
+ this.picked.splice(0, this.picked.length);
+ this.picked.push(entity);
+ if (!as_id) {
+ input.value = JSON.stringify(this.picked[0]);
+ } else {
+ input.value = this.picked.map((el) => el.id);
+ }
+ }
+ }
+ },
+ addNewEntityProcessEnded() {
+ if (this.submit_on_adding_new_entity) {
+ input.form.submit();
+ }
+ },
+ removeEntity({ entity }) {
+ if (
+ -1 ===
+ this.suggested.findIndex(
+ (e) => e.type === entity.type && e.id === entity.id,
+ )
+ ) {
+ this.suggested.push(entity);
+ }
+ this.picked = this.picked.filter(
+ (e) => !(e.type === entity.type && e.id === entity.id),
+ );
+ if (this.multiple) {
+ input.value = JSON.stringify(this.picked);
+ } else {
+ input.value = "";
+ }
+ },
+ },
+ })
+ .use(i18n)
+ .mount(el);
- appsOnPage.set(uniqId, app);
- appsPerInput.set(input.name, app);
- });
+ appsOnPage.set(uniqId, app);
+ appsPerInput.set(input.name, app);
+ });
}
-
-document.addEventListener('show-hide-show', function(e) {
- loadDynamicPicker(e.detail.container)
+document.addEventListener("show-hide-show", function (e) {
+ loadDynamicPicker(e.detail.container);
});
-document.addEventListener('show-hide-hide', function(e) {
- console.log('hiding event caught')
- e.detail.container.querySelectorAll('[data-module="pick-dynamic"]').forEach((el) => {
- let uniqId = el.dataset.uniqid;
- if (appsOnPage.has(uniqId)) {
- appsOnPage.get(uniqId).unmount();
- appsOnPage.delete(uniqId);
- }
- })
-});
-
-document.addEventListener('pick-entity-type-action', function (e) {
- console.log('pick entity event', e);
- if (!appsPerInput.has(e.detail.name)) {
- console.error('no app with this name');
- return;
- }
- const app = appsPerInput.get(e.detail.name);
- if (e.detail.action === 'add') {
- app.addNewEntity(e.detail.entity);
- } else if (e.detail.action === 'remove') {
- app.removeEntity(e.detail.entity);
- } else {
- console.error('action not supported: '+e.detail.action);
+document.addEventListener("show-hide-hide", function (e) {
+ console.log("hiding event caught");
+ e.detail.container
+ .querySelectorAll('[data-module="pick-dynamic"]')
+ .forEach((el) => {
+ let uniqId = el.dataset.uniqid;
+ if (appsOnPage.has(uniqId)) {
+ appsOnPage.get(uniqId).unmount();
+ appsOnPage.delete(uniqId);
}
+ });
});
-document.addEventListener('DOMContentLoaded', function(e) {
- loadDynamicPicker(document)
-})
+document.addEventListener("pick-entity-type-action", function (e) {
+ console.log("pick entity event", e);
+ if (!appsPerInput.has(e.detail.name)) {
+ console.error("no app with this name");
+ return;
+ }
+ const app = appsPerInput.get(e.detail.name);
+ if (e.detail.action === "add") {
+ app.addNewEntity(e.detail.entity);
+ } else if (e.detail.action === "remove") {
+ app.removeEntity(e.detail.entity);
+ } else {
+ console.error("action not supported: " + e.detail.action);
+ }
+});
+
+document.addEventListener("DOMContentLoaded", function (e) {
+ loadDynamicPicker(document);
+});
window.loadDynamicPicker = loadDynamicPicker;
-
diff --git a/src/Bundle/ChillMainBundle/Resources/public/page/workflow-show/index.js b/src/Bundle/ChillMainBundle/Resources/public/page/workflow-show/index.js
index 7ae5ca621..26e8001c9 100644
--- a/src/Bundle/ChillMainBundle/Resources/public/page/workflow-show/index.js
+++ b/src/Bundle/ChillMainBundle/Resources/public/page/workflow-show/index.js
@@ -1,174 +1,180 @@
-import {ShowHide} from 'ChillMainAssets/lib/show_hide/show_hide.js';
+import { ShowHide } from "ChillMainAssets/lib/show_hide/show_hide.js";
-window.addEventListener('DOMContentLoaded', function() {
- const
- divTransitions = document.querySelector('#transitions'),
- futureDestUsersContainer = document.querySelector('#futureDests'),
- personSignatureField = document.querySelector('#person-signature-field'),
- userSignatureField = document.querySelector('#user-signature-field'),
- signatureTypeChoices = document.querySelector('#signature-type-choice'),
- personChoice = document.querySelector('#workflow_step_isPersonOrUserSignature_0'),
- userChoice = document.querySelector('#workflow_step_isPersonOrUserSignature_1'),
- signatureZone = document.querySelector('#signature-zone'),
- transitionFilterContainer = document.querySelector('#transitionFilter'),
- transitionsContainer = document.querySelector('#transitions'),
- sendExternalContainer = document.querySelector('#sendExternalContainer')
- ;
+window.addEventListener("DOMContentLoaded", function () {
+ const divTransitions = document.querySelector("#transitions"),
+ futureDestUsersContainer = document.querySelector("#futureDests"),
+ personSignatureField = document.querySelector("#person-signature-field"),
+ userSignatureField = document.querySelector("#user-signature-field"),
+ signatureTypeChoices = document.querySelector("#signature-type-choice"),
+ personChoice = document.querySelector(
+ "#workflow_step_isPersonOrUserSignature_0",
+ ),
+ userChoice = document.querySelector(
+ "#workflow_step_isPersonOrUserSignature_1",
+ ),
+ signatureZone = document.querySelector("#signature-zone"),
+ transitionFilterContainer = document.querySelector("#transitionFilter"),
+ transitionsContainer = document.querySelector("#transitions"),
+ sendExternalContainer = document.querySelector("#sendExternalContainer");
+ // ShowHide instance for future dest users
+ new ShowHide({
+ debug: false,
+ load_event: null,
+ froms: [divTransitions],
+ container: [futureDestUsersContainer],
+ test: function (froms, event) {
+ for (let transition of froms) {
+ for (let input of transition.querySelectorAll("input")) {
+ if (input.checked) {
+ if ("1" === input.dataset.toFinal) {
+ return false;
+ }
- // ShowHide instance for future dest users
+ if ("1" === input.dataset.isSentExternal) {
+ return false;
+ }
+
+ const inputData = JSON.parse(
+ input.getAttribute("data-is-signature"),
+ );
+ if (inputData.includes("person") || inputData.includes("user")) {
+ return false;
+ } else {
+ personChoice.checked = false;
+ userChoice.checked = false;
+
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ },
+ });
+
+ // ShowHide instance for send external
+ new ShowHide({
+ debug: false,
+ load_event: null,
+ froms: [divTransitions],
+ container: [sendExternalContainer],
+ test: function (froms, event) {
+ for (let transition of froms) {
+ for (let input of transition.querySelectorAll("input")) {
+ if (input.checked) {
+ if ("1" === input.dataset.isSentExternal) {
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ },
+ });
+
+ // ShowHide signature zone
+ new ShowHide({
+ debug: false,
+ load_event: null,
+ froms: [divTransitions],
+ container: [signatureZone],
+ test: function (froms, event) {
+ for (let transition of froms) {
+ for (let input of transition.querySelectorAll("input")) {
+ if (input.checked) {
+ const inputData = JSON.parse(
+ input.getAttribute("data-is-signature"),
+ );
+ if (inputData.includes("person") || inputData.includes("user")) {
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ },
+ });
+
+ // ShowHides for personSignatureField or userSignatureField within signature zone
+ new ShowHide({
+ debug: false,
+ froms: [signatureTypeChoices],
+ container: [personSignatureField],
+ test: function (froms, event) {
+ for (let container of froms) {
+ return personChoice.checked;
+ }
+ return false;
+ },
+ });
+
+ new ShowHide({
+ debug: false,
+ froms: [signatureTypeChoices],
+ container: [userSignatureField],
+ test: function (froms, event) {
+ for (let container of froms) {
+ return userChoice.checked;
+ }
+ return false;
+ },
+ });
+
+ if (null !== divTransitions) {
new ShowHide({
- debug: false,
load_event: null,
froms: [divTransitions],
container: [futureDestUsersContainer],
- test: function(froms, event) {
- for (let transition of froms) {
- for (let input of transition.querySelectorAll('input')) {
+ test: function (divs, arg2, arg3) {
+ for (let div of divs) {
+ for (let input of div.querySelectorAll("input")) {
if (input.checked) {
- if ('1' === input.dataset.toFinal) {
- return false;
- }
-
- if ('1' === input.dataset.isSentExternal) {
- return false;
- }
-
- const inputData = JSON.parse(input.getAttribute('data-is-signature'))
- if (inputData.includes('person') || inputData.includes('user')) {
+ if (input.dataset.toFinal === "1") {
return false;
} else {
- personChoice.checked = false
- userChoice.checked = false
-
return true;
}
}
}
}
- return false;
- }
- });
- // ShowHide instance for send external
- new ShowHide({
- debug: false,
- load_event: null,
- froms: [divTransitions],
- container: [sendExternalContainer],
- test: function(froms, event) {
- for (let transition of froms) {
- for (let input of transition.querySelectorAll('input')) {
- if (input.checked) {
- if ('1' === input.dataset.isSentExternal) {
- return true;
- }
- }
- }
- }
- return false;
- }
- })
-
- // ShowHide signature zone
- new ShowHide({
- debug: false,
- load_event: null,
- froms: [divTransitions],
- container: [signatureZone],
- test: function(froms, event) {
- for (let transition of froms) {
- for (let input of transition.querySelectorAll('input')) {
- if (input.checked) {
- const inputData = JSON.parse(input.getAttribute('data-is-signature'))
- if (inputData.includes('person') || inputData.includes('user')) {
- return true;
- }
- }
- }
- }
- return false;
- }
- });
-
- // ShowHides for personSignatureField or userSignatureField within signature zone
- new ShowHide({
- debug: false,
- froms: [signatureTypeChoices],
- container: [personSignatureField],
- test: function(froms, event) {
- for (let container of froms) {
- return personChoice.checked;
- }
- return false;
+ return true;
},
});
+ }
- new ShowHide({
- debug: false,
- froms: [signatureTypeChoices],
- container: [userSignatureField],
- test: function(froms, event) {
- for (let container of froms) {
- return userChoice.checked;
- }
- return false;
- },
- });
+ if (null !== transitionFilterContainer) {
+ transitionsContainer
+ .querySelectorAll(".form-check")
+ .forEach(function (row) {
+ const isForward = row.querySelector("input").dataset.isForward;
- if (null !== divTransitions) {
- new ShowHide({
+ new ShowHide({
load_event: null,
- froms: [divTransitions],
- container: [futureDestUsersContainer],
- test: function(divs, arg2, arg3) {
- for (let div of divs) {
- for (let input of div.querySelectorAll('input')) {
- if (input.checked) {
- if (input.dataset.toFinal === "1") {
- return false;
- } else {
- return true;
- }
- }
- }
+ froms: [transitionFilterContainer],
+ container: row,
+ test: function (containers) {
+ for (let container of containers) {
+ for (let input of container.querySelectorAll("input")) {
+ if (input.checked) {
+ return isForward === input.value;
+ }
}
-
- return true;
+ }
+ return true;
+ },
+ toggle_callback: function (c, dir) {
+ for (let div of c) {
+ let input = div.querySelector("input");
+ if ("hide" === dir) {
+ input.checked = false;
+ input.disabled = true;
+ } else {
+ input.disabled = false;
+ }
+ }
},
- });
- }
-
- if (null !== transitionFilterContainer) {
- transitionsContainer.querySelectorAll('.form-check').forEach(function(row) {
-
- const isForward = row.querySelector('input').dataset.isForward;
-
- new ShowHide({
- load_event: null,
- froms: [transitionFilterContainer],
- container: row,
- test: function (containers) {
- for (let container of containers) {
- for (let input of container.querySelectorAll('input')) {
- if (input.checked) {
- return isForward === input.value;
- }
- }
- }
- return true;
- },
- toggle_callback: function (c, dir) {
- for (let div of c) {
- let input = div.querySelector('input');
- if ('hide' === dir) {
- input.checked = false;
- input.disabled = true;
- } else {
- input.disabled = false;
- }
- }
- },
- });
});
- }
+ });
+ }
});
diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/MyWorkflowsTable.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/MyWorkflowsTable.vue
index f13327c84..61dfa420d 100644
--- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/MyWorkflowsTable.vue
+++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/MyWorkflowsTable.vue
@@ -28,7 +28,11 @@
/>
{{ getStep(w) }}
- {{ $t('on_hold') }}
+ {{ $t("on_hold") }}
diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/js/i18n.js b/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/js/i18n.js
index 0205df092..574854c91 100644
--- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/js/i18n.js
+++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/js/i18n.js
@@ -1,83 +1,89 @@
const appMessages = {
- fr: {
- main_title: "Vue d'ensemble",
- my_works: {
- tab: "Mes actions",
- description: "Liste des actions d'accompagnement dont je suis référent et qui arrivent à échéance.",
- },
- my_evaluations: {
- tab: "Mes évaluations",
- description: "Liste des évaluations dont je suis référent et qui arrivent à échéance.",
- },
- my_tasks: {
- tab: "Mes tâches",
- description_alert: "Liste des tâches auxquelles je suis assigné et dont la date de rappel est dépassée.",
- description_warning: "Liste des tâches auxquelles je suis assigné et dont la date d'échéance est dépassée.",
- },
- my_accompanying_courses: {
- tab: "Mes nouveaux parcours",
- description: "Liste des parcours d'accompagnement que l'on vient de m'attribuer depuis moins de 15 jours.",
- },
- my_notifications: {
- tab: "Mes nouvelles notifications",
- description: "Liste des notifications reçues et non lues.",
- },
- my_workflows: {
- tab: "Mes workflows",
- description: "Liste des workflows en attente d'une action.",
- description_cc: "Liste des workflows dont je suis en copie."
- },
- opening_date: "Date d'ouverture",
- social_issues: "Problématiques sociales",
- concerned_persons: "Usagers concernés",
- max_date: "Date d'échéance",
- warning_date: "Date de rappel",
- evaluation: "Évaluation",
- task: "Tâche",
- Date: "Date",
- From: "Expéditeur",
- Subject: "Objet",
- Entity: "Associé à",
- Step: "Étape",
- concerned_users: "Usagers concernés",
- Object_workflow: "Objet du workflow",
- on_hold: "En attente",
- show_entity: "Voir {entity}",
- the_activity: "l'échange",
- the_course: "le parcours",
- the_action: "l'action",
- the_evaluation: "l'évaluation",
- the_evaluation_document: "le document",
- the_task: "la tâche",
- the_workflow: "le workflow",
- StartDate: "Date d'ouverture",
- SocialAction: "Action d'accompagnement",
- no_data: "Aucun résultats",
- no_dashboard: "Pas de tableaux de bord",
- counter: {
- unread_notifications: "{n} notification non lue | {n} notifications non lues",
- assignated_courses: "{n} parcours récent assigné | {n} parcours récents assignés",
- assignated_actions: "{n} action assignée | {n} actions assignées",
- assignated_evaluations: "{n} évaluation assignée | {n} évaluations assignées",
- alert_tasks: "{n} tâche en rappel | {n} tâches en rappel",
- warning_tasks: "{n} tâche à échéance | {n} tâches à échéance",
- },
- emergency: "Urgent",
- confidential: "Confidentiel",
- automatic_notification: "Notification automatique",
- widget: {
- news: {
- title: "Actualités",
- readMore: "Lire la suite",
- date: "Date",
- none: "Aucune actualité"
- }
- }
- }
+ fr: {
+ main_title: "Vue d'ensemble",
+ my_works: {
+ tab: "Mes actions",
+ description:
+ "Liste des actions d'accompagnement dont je suis référent et qui arrivent à échéance.",
+ },
+ my_evaluations: {
+ tab: "Mes évaluations",
+ description:
+ "Liste des évaluations dont je suis référent et qui arrivent à échéance.",
+ },
+ my_tasks: {
+ tab: "Mes tâches",
+ description_alert:
+ "Liste des tâches auxquelles je suis assigné et dont la date de rappel est dépassée.",
+ description_warning:
+ "Liste des tâches auxquelles je suis assigné et dont la date d'échéance est dépassée.",
+ },
+ my_accompanying_courses: {
+ tab: "Mes nouveaux parcours",
+ description:
+ "Liste des parcours d'accompagnement que l'on vient de m'attribuer depuis moins de 15 jours.",
+ },
+ my_notifications: {
+ tab: "Mes nouvelles notifications",
+ description: "Liste des notifications reçues et non lues.",
+ },
+ my_workflows: {
+ tab: "Mes workflows",
+ description: "Liste des workflows en attente d'une action.",
+ description_cc: "Liste des workflows dont je suis en copie.",
+ },
+ opening_date: "Date d'ouverture",
+ social_issues: "Problématiques sociales",
+ concerned_persons: "Usagers concernés",
+ max_date: "Date d'échéance",
+ warning_date: "Date de rappel",
+ evaluation: "Évaluation",
+ task: "Tâche",
+ Date: "Date",
+ From: "Expéditeur",
+ Subject: "Objet",
+ Entity: "Associé à",
+ Step: "Étape",
+ concerned_users: "Usagers concernés",
+ Object_workflow: "Objet du workflow",
+ on_hold: "En attente",
+ show_entity: "Voir {entity}",
+ the_activity: "l'échange",
+ the_course: "le parcours",
+ the_action: "l'action",
+ the_evaluation: "l'évaluation",
+ the_evaluation_document: "le document",
+ the_task: "la tâche",
+ the_workflow: "le workflow",
+ StartDate: "Date d'ouverture",
+ SocialAction: "Action d'accompagnement",
+ no_data: "Aucun résultats",
+ no_dashboard: "Pas de tableaux de bord",
+ counter: {
+ unread_notifications:
+ "{n} notification non lue | {n} notifications non lues",
+ assignated_courses:
+ "{n} parcours récent assigné | {n} parcours récents assignés",
+ assignated_actions: "{n} action assignée | {n} actions assignées",
+ assignated_evaluations:
+ "{n} évaluation assignée | {n} évaluations assignées",
+ alert_tasks: "{n} tâche en rappel | {n} tâches en rappel",
+ warning_tasks: "{n} tâche à échéance | {n} tâches à échéance",
+ },
+ emergency: "Urgent",
+ confidential: "Confidentiel",
+ automatic_notification: "Notification automatique",
+ widget: {
+ news: {
+ title: "Actualités",
+ readMore: "Lire la suite",
+ date: "Date",
+ none: "Aucune actualité",
+ },
+ },
+ },
};
Object.assign(appMessages.fr);
-export {
- appMessages
-};
+export { appMessages };
diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/PickEntity/PickEntity.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/PickEntity/PickEntity.vue
index e2ba91f8f..56e324133 100644
--- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/PickEntity/PickEntity.vue
+++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/PickEntity/PickEntity.vue
@@ -1,6 +1,6 @@
@@ -18,7 +18,9 @@
- {{ s.text }}
+
+ {{ s.text }}
+
@@ -49,86 +51,92 @@ export default {
default: true,
},
displayPicked: {
- // display picked entities.
- type: Boolean,
- default: true,
+ // display picked entities.
+ type: Boolean,
+ default: true,
},
suggested: {
- type: Array,
- default: []
+ type: Array,
+ default: [],
},
label: {
type: String,
required: false,
- }
+ },
},
- emits: ['addNewEntity', 'removeEntity', 'addNewEntityProcessEnded'],
+ emits: ["addNewEntity", "removeEntity", "addNewEntityProcessEnded"],
components: {
AddPersons,
},
data() {
return {
- key: ''
+ key: "",
};
},
computed: {
- addPersonsOptions() {
- return {
- uniq: !this.multiple,
- type: this.types,
- priority: null,
- button: {
- size: 'btn-sm',
- class: 'btn-submit',
- },
- };
- },
- translatedListOfTypes() {
- if (this.label !== '') {
- return this.label;
- }
+ addPersonsOptions() {
+ return {
+ uniq: !this.multiple,
+ type: this.types,
+ priority: null,
+ button: {
+ size: "btn-sm",
+ class: "btn-submit",
+ },
+ };
+ },
+ translatedListOfTypes() {
+ if (this.label !== "") {
+ return this.label;
+ }
- let trans = [];
- this.types.forEach(t => {
- if (this.$props.multiple) {
- trans.push(appMessages.fr.pick_entity[t].toLowerCase());
- } else {
- trans.push(appMessages.fr.pick_entity[t + '_one'].toLowerCase());
- }
- })
+ let trans = [];
+ this.types.forEach((t) => {
+ if (this.$props.multiple) {
+ trans.push(appMessages.fr.pick_entity[t].toLowerCase());
+ } else {
+ trans.push(
+ appMessages.fr.pick_entity[t + "_one"].toLowerCase(),
+ );
+ }
+ });
- if (this.$props.multiple) {
- return appMessages.fr.pick_entity.modal_title + trans.join(', ');
- } else {
- return appMessages.fr.pick_entity.modal_title_one + trans.join(', ');
- }
- },
- listClasses() {
- return {
- 'list-suggest': true,
- 'remove-items': this.$props.removableIfSet,
- };
- },
+ if (this.$props.multiple) {
+ return (
+ appMessages.fr.pick_entity.modal_title + trans.join(", ")
+ );
+ } else {
+ return (
+ appMessages.fr.pick_entity.modal_title_one +
+ trans.join(", ")
+ );
+ }
+ },
+ listClasses() {
+ return {
+ "list-suggest": true,
+ "remove-items": this.$props.removableIfSet,
+ };
+ },
},
methods: {
- addNewSuggested(entity) {
- this.$emit('addNewEntity', {entity: entity});
- },
- addNewEntity({ selected, modal }) {
- selected.forEach((item) => {
- this.$emit('addNewEntity', { entity: item.result});
- }, this
- );
- this.$refs.addPersons.resetSearch(); // to cast child method
- modal.showModal = false;
- this.$emit('addNewEntityProcessEnded');
- },
- removeEntity(entity) {
- if (!this.$props.removableIfSet) {
- return;
- }
- this.$emit('removeEntity',{ entity: entity });
- }
+ addNewSuggested(entity) {
+ this.$emit("addNewEntity", { entity: entity });
+ },
+ addNewEntity({ selected, modal }) {
+ selected.forEach((item) => {
+ this.$emit("addNewEntity", { entity: item.result });
+ }, this);
+ this.$refs.addPersons.resetSearch(); // to cast child method
+ modal.showModal = false;
+ this.$emit("addNewEntityProcessEnded");
+ },
+ removeEntity(entity) {
+ if (!this.$props.removableIfSet) {
+ return;
+ }
+ this.$emit("removeEntity", { entity: entity });
+ },
},
-}
+};
diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/UserGroupRenderBox.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/UserGroupRenderBox.vue
index d25100776..7a3c5fcc1 100644
--- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/UserGroupRenderBox.vue
+++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/UserGroupRenderBox.vue
@@ -1,6 +1,6 @@
- {{ userGroup.label.fr }}
+ {{
+ userGroup.label.fr
+ }}
-
+
diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/EntityWorkflow/ListWorkflow.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/EntityWorkflow/ListWorkflow.vue
index 943ea85f3..608508dd8 100644
--- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/EntityWorkflow/ListWorkflow.vue
+++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/EntityWorkflow/ListWorkflow.vue
@@ -1,140 +1,163 @@
-
-
+
+
+
+
+
{{ w.title }}
+
+
+ {{ w.relatedEntityClass }}
+ {{ w.relatedEntityId }}
+
+
+
-
-
-
{{ w.title }}
-
-
- {{ w.relatedEntityClass }}
- {{ w.relatedEntityId }}
-
-
+
+
+
+
+
+
+
+ {{ step.currentStep.text }}
+
+
+ →
+
+
+
+
{{ $t("on_hold") }}
-
-
-
-
-
-
-
-
- {{ step.currentStep.text }}
-
-
- →
-
-
+
+
+
+
+ {{ $t("you_subscribed_to_all_steps") }}
+
+
+
+ {{ $t("you_subscribed_to_final_step") }}
+
+
+
-
{{ $t('on_hold') }}
-
-
-
-
-
-
- {{ $t('you_subscribed_to_all_steps') }}
-
-
-
- {{ $t('you_subscribed_to_final_step') }}
-
-
-
-
-
-
-
+
+
diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/EntityWorkflow/ListWorkflowModal.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/EntityWorkflow/ListWorkflowModal.vue
index ab52b7452..022f274a3 100644
--- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/EntityWorkflow/ListWorkflowModal.vue
+++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/EntityWorkflow/ListWorkflowModal.vue
@@ -1,126 +1,129 @@
-
+
-
-
+
+
+
+ {{ $t("workflow_list") }}
+
-
- {{ $t('workflow_list') }}
-
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/EntityWorkflow/PickWorkflow.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/EntityWorkflow/PickWorkflow.vue
index 3cd88369c..f82a6fd33 100644
--- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/EntityWorkflow/PickWorkflow.vue
+++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/EntityWorkflow/PickWorkflow.vue
@@ -1,12 +1,27 @@
-
-
+
+
Créer un workflow
@@ -20,12 +35,31 @@
{{ countExistingWorkflows }} workflows associés
-
- Liste des workflows disponibles
+
+ Liste des workflows disponibles
-
@@ -33,7 +67,14 @@
-
+
1 workflow associé
@@ -46,9 +87,8 @@
-
+
diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue
index a17cfbd0d..5453edae4 100644
--- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue
+++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue
@@ -1,805 +1,957 @@
-
-
-
-
-
- {{ work.socialAction.issue.text }}
-
-
-
-
-
- {{ work.socialAction.text }}
-
+
+
+
+
+
+ {{
+ work.socialAction.issue.text
+ }}
+
+
+
+
+
+ {{ work.socialAction.text }}
+
+
+
+
+ {{ $t("startDate") }}
+
+
+
+
+ {{ $t("endDate") }}
+
+
+
+
+
+
+
+
+
+
+
{{ $t("goals_title") }}
+
+
+
{{ $t("results_title") }}
+
-
-
{{ $t('startDate') }}
-
+
+
+
+ {{ $t("results_without_objective") }}
+
+
-
-
{{ $t('endDate') }}
-
+
+
+
+ {{ g.goal.title.fr }}
+
+
+
+
+
+
+
+ Masquer
+
+
+
+ Motifs, objectifs et dispositfs disponibles
+
+
+
+
+ Aucun objectif associé
+
+
+
+ {{
+ $t("no_goals_available")
+ }}
+
+
+
+
+
+
+
+
+ {{ $t("Evaluations") }} - {{ $t("Forms") }} - {{ $t("Post") }}
+
+
-
+
+
+
-
-
-
-
-
-
{{ $t('goals_title') }}
-
{{ $t('results_title') }}
-
-
-
-
-
- {{ $t('results_without_objective') }}
-
-
-
-
-
-
-
- {{ g.goal.title.fr }}
-
-
-
-
-
-
-
-
- Masquer
-
-
-
- Motifs, objectifs et dispositfs disponibles
-
-
-
-
-
- Aucun objectif associé
-
-
-
- {{ $t('no_goals_available') }}
-
-
-
-
-
-
-
{{ $t('Evaluations') }} - {{ $t('Forms') }} - {{ $t('Post') }}
-
-
-
-
-
-
-
-
-
-
{{ $t('available_evaluations_text') }}
-
-
-
-
- {{ $t('add_an_evaluation') }}
-
-
-
- {{ $t('no_evaluations_available') }}
-
-
-
-
-
-
{{ $t('persons_involved') }}
-
-
-
-
+
+
+
+
{{ $t("available_evaluations_text") }}
+
+
+
+
+
+
+ {{ $t("add_an_evaluation") }}
+
+
+
+
+ {{
+ $t("no_evaluations_available")
+ }}
+
+
+
+
+
+
{{ $t("persons_involved") }}
+
+
+
+
+
+
{{ $t("referrers") }}
+
+
+
{{ $t("no_referrers") }}
-
-
{{ $t('referrers') }}
-
-
-
{{ $t('no_referrers') }}
-
-
-
-
-
+
-
-
{{ $t('handling_thirdparty') }}
+
+
-
-
- {{ $t('no_handling_thirdparty') }}
-
+
+
{{ $t("handling_thirdparty") }}
-
-
-
+
+
+ {{ $t("no_handling_thirdparty") }}
+
+
+
+
+
+
+
+
{{ $t("thirdparty_intervener") }}
+
+
+
+ {{ $t("no_thirdparty_intervener") }}
+
-
-
{{ $t('thirdparty_intervener') }}
-
-
-
{{ $t('no_thirdparty_intervener') }}
-
-
-
-
-
+
-
-
{{ $t('fix_these_errors') }}
-
-
+
+
-
-
+
+
+
+ {{ $t("action.save") }}
+
+
+
diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/AddEvaluation.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/AddEvaluation.vue
index 6c2c7f58d..d1009a4fb 100644
--- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/AddEvaluation.vue
+++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/AddEvaluation.vue
@@ -1,157 +1,181 @@
-
-
-
- {{ evaluation.evaluation.title.fr }}
-
+
+
+
+ {{ evaluation.evaluation.title.fr }}
+
-
+
-
-
-
-
-
- {{ $t('delete.sure') }}
-
-
- {{ $t('delete.sure_description') }}
-
-
-
- {{ $t('delete.ok') }}
-
-
-
-
-
+
+
+
+ {{ $t("delete.sure") }}
+
+
+ {{ $t("delete.sure_description") }}
+
+
+
+ {{ $t("delete.ok") }}
+
+
+
+
+
diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue
index 25ec6c5cc..0bb51c786 100644
--- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue
+++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue
@@ -1,10 +1,10 @@
-
-
-
+
-
- {{ $t('evaluation_startdate') }}
-
-
-
-
+
+ {{ $t("evaluation_startdate") }}
+
+
+
+
-
- {{ $t('evaluation_enddate') }}
-
-
-
-
+
+ {{ $t("evaluation_enddate") }}
+
+
+
+
-
- {{ $t('evaluation_maxdate') }}
-
-
-
-
+
+ {{ $t("evaluation_maxdate") }}
+
+
+
+
-
- {{ $t('evaluation_warning_interval') }}
-
-
-
-
+
+ {{ $t("evaluation_warning_interval") }}
+
+
+
+
-
-
- {{ $t('evaluation_time_spent') }}
-
-
-
- {{ $t('select_time_spent') }}
-
- {{ time.text }}
-
-
-
-
-
-
{{ $t('evaluation_public_comment') }}
-
-
-
+
+ {{ $t("evaluation_time_spent") }}
+
+
+
+ {{ $t("select_time_spent") }}
+
+ {{ time.text }}
+
+
+
-
-
{{ $t('Documents') }} :
+
+
{{
+ $t("evaluation_public_comment")
+ }}
+
+
+
+
-
-
+
+
{{ $t("document_add") }} :
+
+
+ {{
+ $t("evaluation_generate_a_document")
+ }}
+
+
+
+
{{ $t("document_upload") }}
+
+
+
+
+
diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js
index 4279aa366..e2105f314 100644
--- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js
+++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js
@@ -1,22 +1,35 @@
-import { createStore } from 'vuex';
-import { dateToISO, ISOToDate, datetimeToISO, ISOToDatetime, intervalDaysToISO, intervalISOToDays } from 'ChillMainAssets/chill/js/date';
-import { findSocialActionsBySocialIssue } from 'ChillPersonAssets/vuejs/_api/SocialWorkSocialAction.js';
-import { create } from 'ChillPersonAssets/vuejs/_api/AccompanyingCourseWork.js';
-import { fetchResults, makeFetch } from 'ChillMainAssets/lib/api/apiMethods.ts';
-import { fetchTemplates } from 'ChillDocGeneratorAssets/api/pickTemplate.js';
-import { duplicate } from '../_api/accompanyingCourseWorkEvaluationDocument';
+import { createStore } from "vuex";
+import {
+ dateToISO,
+ ISOToDate,
+ datetimeToISO,
+ ISOToDatetime,
+ intervalDaysToISO,
+ intervalISOToDays,
+} from "ChillMainAssets/chill/js/date";
+import { findSocialActionsBySocialIssue } from "ChillPersonAssets/vuejs/_api/SocialWorkSocialAction.js";
+import { create } from "ChillPersonAssets/vuejs/_api/AccompanyingCourseWork.js";
+import { fetchResults, makeFetch } from "ChillMainAssets/lib/api/apiMethods.ts";
+import { fetchTemplates } from "ChillDocGeneratorAssets/api/pickTemplate.js";
+import { duplicate } from "../_api/accompanyingCourseWorkEvaluationDocument";
-const debug = process.env.NODE_ENV !== 'production';
-const evalFQDN = encodeURIComponent("Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWorkEvaluation");
+const debug = process.env.NODE_ENV !== "production";
+const evalFQDN = encodeURIComponent(
+ "Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWorkEvaluation",
+);
const store = createStore({
strict: debug,
state: {
work: window.accompanyingCourseWork,
- startDate: window.accompanyingCourseWork.startDate !== null ?
- dateToISO(new Date(window.accompanyingCourseWork.startDate.datetime)) : null,
- endDate: window.accompanyingCourseWork.endDate !== null ?
- dateToISO(new Date(window.accompanyingCourseWork.endDate.datetime)) : null,
+ startDate:
+ window.accompanyingCourseWork.startDate !== null
+ ? dateToISO(new Date(window.accompanyingCourseWork.startDate.datetime))
+ : null,
+ endDate:
+ window.accompanyingCourseWork.endDate !== null
+ ? dateToISO(new Date(window.accompanyingCourseWork.endDate.datetime))
+ : null,
note: window.accompanyingCourseWork.note,
privateComment: window.accompanyingCourseWork.privateComment,
goalsPicked: window.accompanyingCourseWork.goals,
@@ -29,15 +42,17 @@ const store = createStore({
templatesAvailablesForAction: [],
templatesAvailablesForEvaluation: new Map([]),
personsPicked: window.accompanyingCourseWork.persons,
- personsReachables: window.accompanyingCourseWork.accompanyingPeriod.participations.filter(p => p.endDate == null)
- .map(p => p.person),
+ personsReachables:
+ window.accompanyingCourseWork.accompanyingPeriod.participations
+ .filter((p) => p.endDate == null)
+ .map((p) => p.person),
handlingThirdParty: window.accompanyingCourseWork.handlingThierParty,
thirdParties: window.accompanyingCourseWork.thirdParties,
referrers: window.accompanyingCourseWork.referrers,
isPosting: false,
errors: [],
me: null,
- version: window.accompanyingCourseWork.version
+ version: window.accompanyingCourseWork.version,
},
getters: {
socialAction(state) {
@@ -47,12 +62,12 @@ const store = createStore({
return state.resultsForAction.length > 0;
},
resultsForGoal: (state) => (goal) => {
- let founds = state.resultsForGoal.filter(r => r.goalId === goal.id);
+ let founds = state.resultsForGoal.filter((r) => r.goalId === goal.id);
return founds === undefined ? [] : founds;
},
resultsPickedForGoal: (state) => (goal) => {
- let found = state.goalsPicked.find(g => g.goal.id === goal.id);
+ let found = state.goalsPicked.find((g) => g.goal.id === goal.id);
return found === undefined ? [] : found.results;
},
@@ -74,26 +89,38 @@ const store = createStore({
},
buildPayload(state) {
return {
- type: 'accompanying_period_work',
+ type: "accompanying_period_work",
id: state.work.id,
version: state.version,
- startDate: state.startDate === null || state.startDate === '' ? null : {
- datetime: datetimeToISO(ISOToDate(state.startDate))
- },
- endDate: state.endDate === null || state.endDate === '' ? null : {
- datetime: datetimeToISO(ISOToDate(state.endDate))
- },
+ startDate:
+ state.startDate === null || state.startDate === ""
+ ? null
+ : {
+ datetime: datetimeToISO(ISOToDate(state.startDate)),
+ },
+ endDate:
+ state.endDate === null || state.endDate === ""
+ ? null
+ : {
+ datetime: datetimeToISO(ISOToDate(state.endDate)),
+ },
note: state.note,
privateComment: state.privateComment,
- persons: state.personsPicked.map(p => ({id: p.id, type: p.type})),
- handlingThierParty: state.handlingThirdParty === null ? null : {
- id: state.handlingThirdParty.id,
- type: state.handlingThirdParty.type
- },
- results: state.resultsPicked.map(r => ({id: r.id, type: r.type})),
- thirdParties: state.thirdParties.map(t => ({id: t.id, type: t.type})),
- referrers: state.referrers.map(t => ({id: t.id, type: t.type})),
- goals: state.goalsPicked.map(g => {
+ persons: state.personsPicked.map((p) => ({ id: p.id, type: p.type })),
+ handlingThierParty:
+ state.handlingThirdParty === null
+ ? null
+ : {
+ id: state.handlingThirdParty.id,
+ type: state.handlingThirdParty.type,
+ },
+ results: state.resultsPicked.map((r) => ({ id: r.id, type: r.type })),
+ thirdParties: state.thirdParties.map((t) => ({
+ id: t.id,
+ type: t.type,
+ })),
+ referrers: state.referrers.map((t) => ({ id: t.id, type: t.type })),
+ goals: state.goalsPicked.map((g) => {
let o = {
type: g.type,
note: g.note,
@@ -101,55 +128,72 @@ const store = createStore({
type: g.goal.type,
id: g.goal.id,
},
- results: g.results.map(r => ({id: r.id, type: r.type})),
+ results: g.results.map((r) => ({ id: r.id, type: r.type })),
};
if (g.id !== undefined) {
o.id = g.id;
}
return o;
}),
- accompanyingPeriodWorkEvaluations: state.evaluationsPicked.map(e => {
+ accompanyingPeriodWorkEvaluations: state.evaluationsPicked.map((e) => {
let o = {
type: e.type,
key: e.key,
evaluation: {
id: e.evaluation.id,
- type: e.evaluation.type
+ type: e.evaluation.type,
},
- startDate: e.startDate === null || e.startDate === '' ? null : { datetime: datetimeToISO(ISOToDate(e.startDate)) },
- endDate: e.endDate === null || e.endDate === '' ? null : { datetime: datetimeToISO(ISOToDate(e.endDate)) },
- maxDate: e.maxDate === null || e.maxDate === '' ? null : { datetime: datetimeToISO(ISOToDate(e.maxDate)) },
+ startDate:
+ e.startDate === null || e.startDate === ""
+ ? null
+ : { datetime: datetimeToISO(ISOToDate(e.startDate)) },
+ endDate:
+ e.endDate === null || e.endDate === ""
+ ? null
+ : { datetime: datetimeToISO(ISOToDate(e.endDate)) },
+ maxDate:
+ e.maxDate === null || e.maxDate === ""
+ ? null
+ : { datetime: datetimeToISO(ISOToDate(e.maxDate)) },
warningInterval: intervalDaysToISO(e.warningInterval),
timeSpent: e.timeSpent,
comment: e.comment,
- documents: e.documents
+ documents: e.documents,
};
if (e.id !== undefined) {
o.id = e.id;
}
return o;
- })
+ }),
};
- }
+ },
},
mutations: {
setWhoAmiI(state, me) {
- state.me = me;
+ state.me = me;
},
setEvaluationsPicked(state, evaluations) {
state.evaluationsPicked = evaluations.map((e, index) => {
var k = Object.assign(e, {
key: index,
editEvaluation: false,
- startDate: e.startDate !== null ? dateToISO(new Date(e.startDate.datetime)) : null,
- endDate: e.endDate !== null ? dateToISO(new Date(e.endDate.datetime)) : null,
- maxDate: e.maxDate !== null ? dateToISO(new Date(e.maxDate.datetime)) : null,
- warningInterval: e.warningInterval !== null ? intervalISOToDays(e.warningInterval) : null,
+ startDate:
+ e.startDate !== null
+ ? dateToISO(new Date(e.startDate.datetime))
+ : null,
+ endDate:
+ e.endDate !== null ? dateToISO(new Date(e.endDate.datetime)) : null,
+ maxDate:
+ e.maxDate !== null ? dateToISO(new Date(e.maxDate.datetime)) : null,
+ warningInterval:
+ e.warningInterval !== null
+ ? intervalISOToDays(e.warningInterval)
+ : null,
timeSpent: e.timeSpent !== null ? e.timeSpent : null,
documents: e.documents.map((d, docIndex) => {
return Object.assign(d, {
- key: docIndex
+ key: docIndex,
});
}),
});
@@ -181,28 +225,30 @@ const store = createStore({
state.resultsPicked.push(result);
},
removeResultPicked(state, result) {
- state.resultsPicked = state.resultsPicked.filter(r => r.id !== result.id);
+ state.resultsPicked = state.resultsPicked.filter(
+ (r) => r.id !== result.id,
+ );
},
addGoal(state, goal) {
let g = {
type: "accompanying_period_work_goal",
goal: goal,
- note: '',
- results: []
- }
- const tmpIndex = () => {
- let ar = state.goalsPicked.map(g => g.id),
- s = Math.min(...ar);
- return (s < 0) ? s : 0
+ note: "",
+ results: [],
};
- g.id = tmpIndex() -1
+ const tmpIndex = () => {
+ let ar = state.goalsPicked.map((g) => g.id),
+ s = Math.min(...ar);
+ return s < 0 ? s : 0;
+ };
+ g.id = tmpIndex() - 1;
state.goalsPicked.push(g);
},
removeGoal(state, goal) {
- state.goalsPicked = state.goalsPicked.filter(g => g.id !== goal.id);
+ state.goalsPicked = state.goalsPicked.filter((g) => g.id !== goal.id);
},
- addResultForGoalPicked(state, { goal, result}) {
- let found = state.goalsPicked.find(g => g.goal.id === goal.id);
+ addResultForGoalPicked(state, { goal, result }) {
+ let found = state.goalsPicked.find((g) => g.goal.id === goal.id);
if (found === undefined) {
return;
@@ -211,39 +257,48 @@ const store = createStore({
found.results.push(result);
},
removeResultForGoalPicked(state, { goal, result }) {
- let found = state.goalsPicked.find(g => g.goal.id === goal.id);
+ let found = state.goalsPicked.find((g) => g.goal.id === goal.id);
if (found === undefined) {
return;
}
- found.results = found.results.filter(r => r.id !== result.id);
+ found.results = found.results.filter((r) => r.id !== result.id);
},
addDocument(state, payload) {
// associate version to stored object
- payload.document.storedObject.currentVersion = payload.stored_object_version;
+ payload.document.storedObject.currentVersion =
+ payload.stored_object_version;
- let evaluation = state.evaluationsPicked.find(e => e.key === payload.key);
+ let evaluation = state.evaluationsPicked.find(
+ (e) => e.key === payload.key,
+ );
- evaluation.documents.push(Object.assign(
- payload.document, {
+ evaluation.documents.push(
+ Object.assign(payload.document, {
key: evaluation.documents.length + 1,
- workflows_availables: state.work.workflows_availables_evaluation_documents,
+ workflows_availables:
+ state.work.workflows_availables_evaluation_documents,
workflows: [],
- }));
+ }),
+ );
},
- removeDocument(state, {key, document}) {
- let evaluation = state.evaluationsPicked.find(e => e.key === key);
+ removeDocument(state, { key, document }) {
+ let evaluation = state.evaluationsPicked.find((e) => e.key === key);
if (evaluation === undefined) {
return;
}
- evaluation.documents = evaluation.documents.filter(d => d.key !== document.key);
+ evaluation.documents = evaluation.documents.filter(
+ (d) => d.key !== document.key,
+ );
},
- addDuplicatedDocument(state, {document, evaluation_key}) {
- console.log('add duplicated document', document);
- console.log('add duplicated dcuemnt - evaluation key', evaluation_key);
+ addDuplicatedDocument(state, { document, evaluation_key }) {
+ console.log("add duplicated document", document);
+ console.log("add duplicated dcuemnt - evaluation key", evaluation_key);
- let evaluation = state.evaluationsPicked.find(e => e.key === evaluation_key);
+ let evaluation = state.evaluationsPicked.find(
+ (e) => e.key === evaluation_key,
+ );
document.key = evaluation.documents.length + 1;
evaluation.documents.splice(0, 0, document);
},
@@ -255,28 +310,33 @@ const store = createStore({
* @return {void} - returns nothing.
*/
replaceDocument(state, payload) {
- let evaluation = state.evaluationsPicked.find(e => e.key === payload.key);
+ let evaluation = state.evaluationsPicked.find(
+ (e) => e.key === payload.key,
+ );
if (evaluation === undefined) {
return;
}
- let doc = evaluation.documents.find(d => d.key === payload.oldDocument.key);
+ let doc = evaluation.documents.find(
+ (d) => d.key === payload.oldDocument.key,
+ );
- if (typeof doc === 'undefined') {
- console.error('doc not found');
+ if (typeof doc === "undefined") {
+ console.error("doc not found");
return;
}
doc.storedObject.currentVersion = payload.stored_object_version;
return;
- let newDocument = Object.assign(
- payload.document, {
- key: evaluation.documents.length + 1,
- workflows_availables: state.work.workflows_availables_evaluation_documents,
- workflows: [],
- }
+ let newDocument = Object.assign(payload.document, {
+ key: evaluation.documents.length + 1,
+ workflows_availables:
+ state.work.workflows_availables_evaluation_documents,
+ workflows: [],
+ });
+ evaluation.documents = evaluation.documents.map((d) =>
+ d.id === payload.oldDocument.id ? newDocument : d,
);
- evaluation.documents = evaluation.documents.map(d => d.id === payload.oldDocument.id ? newDocument : d);
},
addEvaluation(state, evaluation) {
let e = {
@@ -284,8 +344,8 @@ const store = createStore({
key: state.evaluationsPicked.length + 1,
evaluation: evaluation,
startDate: dateToISO(new Date()),
- endDate: null,
- maxDate: null,
+ endDate: null,
+ maxDate: null,
warningInterval: null,
timeSpent: null,
comment: "",
@@ -297,46 +357,43 @@ const store = createStore({
state.evaluationsPicked.push(e);
},
removeEvaluation(state, evaluation) {
- state.evaluationsPicked = state.evaluationsPicked.filter(e => e.key !== evaluation.key);
+ state.evaluationsPicked = state.evaluationsPicked.filter(
+ (e) => e.key !== evaluation.key,
+ );
},
- setEvaluationStartDate(state, {key, date}) {
- state.evaluationsPicked.find(e => e.key === key)
- .startDate = date;
+ setEvaluationStartDate(state, { key, date }) {
+ state.evaluationsPicked.find((e) => e.key === key).startDate = date;
},
- setEvaluationEndDate(state, {key, date}) {
- console.log('commit date', date)
- state.evaluationsPicked.find(e => e.key === key)
- .endDate = date;
+ setEvaluationEndDate(state, { key, date }) {
+ console.log("commit date", date);
+ state.evaluationsPicked.find((e) => e.key === key).endDate = date;
},
- setEvaluationMaxDate(state, {key, date}) {
- state.evaluationsPicked.find(e => e.key === key)
- .maxDate = date;
+ setEvaluationMaxDate(state, { key, date }) {
+ state.evaluationsPicked.find((e) => e.key === key).maxDate = date;
},
- setEvaluationWarningInterval(state, {key, days}) {
- state.evaluationsPicked.find(e => e.key === key)
- .warningInterval = days;
+ setEvaluationWarningInterval(state, { key, days }) {
+ state.evaluationsPicked.find((e) => e.key === key).warningInterval = days;
},
- setEvaluationTimeSpent(state, {key, time}) {
- state.evaluationsPicked.find(e => e.key === key)
- .timeSpent = time;
+ setEvaluationTimeSpent(state, { key, time }) {
+ state.evaluationsPicked.find((e) => e.key === key).timeSpent = time;
},
- setEvaluationComment(state, {key, comment}) {
- state.evaluationsPicked.find(e => e.key === key)
- .comment = comment;
+ setEvaluationComment(state, { key, comment }) {
+ state.evaluationsPicked.find((e) => e.key === key).comment = comment;
},
- toggleEvaluationEdit(state, {key}) {
- let evaluation = state.evaluationsPicked.find(e => e.key === key);
+ toggleEvaluationEdit(state, { key }) {
+ let evaluation = state.evaluationsPicked.find((e) => e.key === key);
evaluation.editEvaluation = !evaluation.editEvaluation;
},
- setTemplatesForEvaluation(state, {templates, evaluation}) {
+ setTemplatesForEvaluation(state, { templates, evaluation }) {
state.templatesAvailablesForEvaluation.set(evaluation.id, templates);
},
setTemplatesAvailablesForAction(state, templates) {
state.templatesAvailablesForAction = templates;
},
setPersonsPickedIds(state, ids) {
- state.personsPicked = state.personsReachables
- .filter(p => ids.includes(p.id))
+ state.personsPicked = state.personsReachables.filter((p) =>
+ ids.includes(p.id),
+ );
},
setNote(state, note) {
state.note = note;
@@ -349,8 +406,8 @@ const store = createStore({
},
addThirdParties(state, thirdParties) {
// filter to remove existing thirdparties
- let ids = state.thirdParties.map(t => t.id);
- let unexistings = thirdParties.filter(t => !ids.includes(t.id));
+ let ids = state.thirdParties.map((t) => t.id);
+ let unexistings = thirdParties.filter((t) => !ids.includes(t.id));
for (let i in unexistings) {
state.thirdParties.push(unexistings[i]);
@@ -358,27 +415,29 @@ const store = createStore({
},
updateThirdParty(state, thirdParty) {
for (let t of state.thirdParties) {
- if (t.id === thirdParty.id){
- state.thirdParties = state.thirdParties.filter(t => t.id !== thirdParty.id);
+ if (t.id === thirdParty.id) {
+ state.thirdParties = state.thirdParties.filter(
+ (t) => t.id !== thirdParty.id,
+ );
state.thirdParties.push(thirdParty);
}
}
},
removeThirdParty(state, thirdParty) {
- state.thirdParties = state.thirdParties
- .filter(t => t.id !== thirdParty.id);
+ state.thirdParties = state.thirdParties.filter(
+ (t) => t.id !== thirdParty.id,
+ );
},
addReferrers(state, referrers) {
- let ids = state.referrers.map(t => t.id);
- let unexistings = referrers.filter(t => !ids.includes(t.id));
+ let ids = state.referrers.map((t) => t.id);
+ let unexistings = referrers.filter((t) => !ids.includes(t.id));
for (let i in unexistings) {
state.referrers.push(unexistings[i]);
}
},
removeReferrer(state, user) {
- state.referrers = state.referrers
- .filter(u => u.id !== user.id);
+ state.referrers = state.referrers.filter((u) => u.id !== user.id);
},
setErrors(state, errors) {
state.errors = errors;
@@ -388,22 +447,24 @@ const store = createStore({
},
updateDocumentTitle(state, payload) {
if (payload.id === 0) {
- state.evaluationsPicked.find(e => e.key === payload.evaluationKey)
- .documents.find(d => d.key === payload.key).title = payload.title;
+ state.evaluationsPicked
+ .find((e) => e.key === payload.evaluationKey)
+ .documents.find((d) => d.key === payload.key).title = payload.title;
} else {
- state.evaluationsPicked.find(e => e.key === payload.evaluationKey)
- .documents.find(d => d.id === payload.id).title = payload.title;
+ state.evaluationsPicked
+ .find((e) => e.key === payload.evaluationKey)
+ .documents.find((d) => d.id === payload.id).title = payload.title;
}
},
- statusDocumentChanged(state, {newStatus, key}) {
- const e = state.evaluationsPicked.find(e => e.key === key);
- if (typeof e === 'undefined') {
- console.error('evaluation not found for given key', {key});
+ statusDocumentChanged(state, { newStatus, key }) {
+ const e = state.evaluationsPicked.find((e) => e.key === key);
+ if (typeof e === "undefined") {
+ console.error("evaluation not found for given key", { key });
}
- const doc = e.documents.find(d => d.storedObject?.id === newStatus.id);
- if (typeof doc === 'undefined') {
- console.error('document not found', {newStatus});
+ const doc = e.documents.find((d) => d.storedObject?.id === newStatus.id);
+ if (typeof doc === "undefined") {
+ console.error("document not found", { newStatus });
}
doc.storedObject.status = newStatus.status;
@@ -413,165 +474,189 @@ const store = createStore({
},
actions: {
getWhoAmI({ commit }) {
- let url = `/api/1.0/main/whoami.json`;
- window.fetch(url)
- .then(response => {
- if (response.ok) {
- return response.json();
- }
- throw { m: 'Error while retriving results for goal', s: response.status, b: response.body };
- })
- .then(data => {
- commit('setWhoAmiI', data);
- });
- },
- updateThirdParty({ commit }, payload) {
- commit('updateThirdParty', payload);
- },
- getReachablesGoalsForAction({ getters, commit, dispatch }) {
- let
- socialActionId = getters.socialAction.id,
- url = `/api/1.0/person/social-work/goal/by-social-action/${socialActionId}.json`
- ;
+ let url = `/api/1.0/main/whoami.json`;
window
- .fetch(
- url
- ).then( response => {
+ .fetch(url)
+ .then((response) => {
if (response.ok) {
return response.json();
}
- throw { m: 'Error while retriving goal for social action', s: response.status, b: response.body };
- }).then( data => {
- for (let i in data.results) {
- dispatch('getReachablesResultsForGoal', data.results[i]);
- }
- }).catch( errors => {
- commit('addErrors', errors);
+ throw {
+ m: "Error while retriving results for goal",
+ s: response.status,
+ b: response.body,
+ };
+ })
+ .then((data) => {
+ commit("setWhoAmiI", data);
+ });
+ },
+ updateThirdParty({ commit }, payload) {
+ commit("updateThirdParty", payload);
+ },
+ getReachablesGoalsForAction({ getters, commit, dispatch }) {
+ let socialActionId = getters.socialAction.id,
+ url = `/api/1.0/person/social-work/goal/by-social-action/${socialActionId}.json`;
+ window
+ .fetch(url)
+ .then((response) => {
+ if (response.ok) {
+ return response.json();
+ }
+ throw {
+ m: "Error while retriving goal for social action",
+ s: response.status,
+ b: response.body,
+ };
+ })
+ .then((data) => {
+ for (let i in data.results) {
+ dispatch("getReachablesResultsForGoal", data.results[i]);
+ }
+ })
+ .catch((errors) => {
+ commit("addErrors", errors);
});
},
getReachablesResultsForGoal({ commit }, goal) {
- let
- url = `/api/1.0/person/social-work/result/by-goal/${goal.id}.json`
- ;
- window.fetch(url)
- .then(response => {
+ let url = `/api/1.0/person/social-work/result/by-goal/${goal.id}.json`;
+ window
+ .fetch(url)
+ .then((response) => {
if (response.ok) {
return response.json();
}
- throw { m: 'Error while retriving results for goal', s: response.status, b: response.body };
+ throw {
+ m: "Error while retriving results for goal",
+ s: response.status,
+ b: response.body,
+ };
})
- .then(data => {
- commit('setResultsForGoal', { goal, results: data.results });
+ .then((data) => {
+ commit("setResultsForGoal", { goal, results: data.results });
});
},
getReachablesResultsForAction({ getters, commit }) {
- let
- socialActionId = getters.socialAction.id,
- url = `/api/1.0/person/social-work/result/by-social-action/${socialActionId}.json`
- ;
- window.fetch(url)
- .then(response => {
+ let socialActionId = getters.socialAction.id,
+ url = `/api/1.0/person/social-work/result/by-social-action/${socialActionId}.json`;
+ window
+ .fetch(url)
+ .then((response) => {
if (response.ok) {
return response.json();
}
- throw { m: 'Error while retriving results for social action', s: response.status, b: response.body };
+ throw {
+ m: "Error while retriving results for social action",
+ s: response.status,
+ b: response.body,
+ };
})
- .then(data => {
- commit('setResultsForAction', data.results);
+ .then((data) => {
+ commit("setResultsForAction", data.results);
});
},
getReachablesEvaluationsForAction({ getters, commit }) {
- let
- socialActionId = getters.socialAction.id,
- url = `/api/1.0/person/social-work/evaluation/by-social-action/${socialActionId}.json`
- ;
- window.fetch(url)
- .then(response => {
+ let socialActionId = getters.socialAction.id,
+ url = `/api/1.0/person/social-work/evaluation/by-social-action/${socialActionId}.json`;
+ window
+ .fetch(url)
+ .then((response) => {
if (response.ok) {
return response.json();
}
- throw { m: 'Error while retriving evaluations for social action', s: response.status, b: response.body };
+ throw {
+ m: "Error while retriving evaluations for social action",
+ s: response.status,
+ b: response.body,
+ };
})
- .then(data => {
- commit('setEvaluationsForAction', data.results);
+ .then((data) => {
+ commit("setEvaluationsForAction", data.results);
});
},
- addEvaluation({commit, dispatch}, evaluation) {
- commit('addEvaluation', evaluation);
- dispatch('fetchTemplatesAvailablesForEvaluation', evaluation);
+ addEvaluation({ commit, dispatch }, evaluation) {
+ commit("addEvaluation", evaluation);
+ dispatch("fetchTemplatesAvailablesForEvaluation", evaluation);
},
- fetchTemplatesAvailablesForEvaluation({commit, state}, evaluation) {
+ fetchTemplatesAvailablesForEvaluation({ commit, state }, evaluation) {
if (!state.templatesAvailablesForEvaluation.has(evaluation.id)) {
// commit an empty array to avoid parallel fetching for same evaluation id
- commit('setTemplatesForEvaluation', {templates: [], evaluation});
- fetchResults(`/api/1.0/person/docgen/template/by-evaluation/${evaluation.id}.json`)
- .then(templates => {
- commit('setTemplatesForEvaluation', {templates, evaluation});
- });
+ commit("setTemplatesForEvaluation", { templates: [], evaluation });
+ fetchResults(
+ `/api/1.0/person/docgen/template/by-evaluation/${evaluation.id}.json`,
+ ).then((templates) => {
+ commit("setTemplatesForEvaluation", { templates, evaluation });
+ });
}
},
- addDocument({commit}, payload) {
- commit('addDocument', payload);
+ addDocument({ commit }, payload) {
+ commit("addDocument", payload);
},
- async duplicateDocument({commit}, {document, evaluation_key}) {
+ async duplicateDocument({ commit }, { document, evaluation_key }) {
const newDoc = await duplicate(document.id);
- commit('addDuplicatedDocument', {document: newDoc, evaluation_key});
+ commit("addDuplicatedDocument", { document: newDoc, evaluation_key });
},
- removeDocument({commit}, payload) {
- commit('removeDocument', payload);
+ removeDocument({ commit }, payload) {
+ commit("removeDocument", payload);
},
- replaceDocument({commit}, payload) {
- commit('replaceDocument', payload);
+ replaceDocument({ commit }, payload) {
+ commit("replaceDocument", payload);
},
submit({ getters, state, commit }, callback) {
- let
- payload = getters.buildPayload,
- params = new URLSearchParams({'entity_version': state.version}),
+ let payload = getters.buildPayload,
+ params = new URLSearchParams({ entity_version: state.version }),
url = `/api/1.0/person/accompanying-course/work/${state.work.id}.json?${params}`,
- errors = []
- ;
-
- commit('setIsPosting', true);
+ errors = [];
+ commit("setIsPosting", true);
// console.log('the social action', payload);
- return makeFetch('PUT', url, payload)
- .then(data => {
- if (typeof(callback) !== 'undefined') {
+ return makeFetch("PUT", url, payload)
+ .then((data) => {
+ if (typeof callback !== "undefined") {
return callback(data);
} else {
// console.log('payload', payload.privateComment)
// console.info('nothing to do here, bye bye');
- window.location.assign(`/fr/person/accompanying-period/${state.work.accompanyingPeriod.id}/work`);
+ window.location.assign(
+ `/fr/person/accompanying-period/${state.work.accompanyingPeriod.id}/work`,
+ );
}
- }).catch(error => {
- console.log('error', error)
- commit('setIsPosting', false);
+ })
+ .catch((error) => {
+ console.log("error", error);
+ commit("setIsPosting", false);
throw error;
});
},
- updateDocumentTitle({commit}, payload) {
- commit('updateDocumentTitle', payload)
- }
- }
+ updateDocumentTitle({ commit }, payload) {
+ commit("updateDocumentTitle", payload);
+ },
+ },
});
-store.commit('setEvaluationsPicked', window.accompanyingCourseWork.accompanyingPeriodWorkEvaluations);
-store.dispatch('getReachablesResultsForAction');
-store.dispatch('getReachablesGoalsForAction');
-store.dispatch('getReachablesEvaluationsForAction');
-store.dispatch('getWhoAmI');
+store.commit(
+ "setEvaluationsPicked",
+ window.accompanyingCourseWork.accompanyingPeriodWorkEvaluations,
+);
+store.dispatch("getReachablesResultsForAction");
+store.dispatch("getReachablesGoalsForAction");
+store.dispatch("getReachablesEvaluationsForAction");
+store.dispatch("getWhoAmI");
-store.state.evaluationsPicked.forEach(evaluation => {
- store.dispatch('fetchTemplatesAvailablesForEvaluation', evaluation.evaluation)
+store.state.evaluationsPicked.forEach((evaluation) => {
+ store.dispatch(
+ "fetchTemplatesAvailablesForEvaluation",
+ evaluation.evaluation,
+ );
});
-fetchTemplates('Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWork')
- .then(templates => {
- store.commit('setTemplatesAvailablesForAction', templates);
- }
-)
+fetchTemplates(
+ "Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWork",
+).then((templates) => {
+ store.commit("setTemplatesAvailablesForAction", templates);
+});
export { store };
diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/PersonSuggestion.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/PersonSuggestion.vue
index ec9556a95..bef3967b5 100644
--- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/PersonSuggestion.vue
+++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/PersonSuggestion.vue
@@ -1,133 +1,131 @@
-
diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/TypeUserGroup.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/TypeUserGroup.vue
index f1a83ff22..cc8c6ca66 100644
--- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/TypeUserGroup.vue
+++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/TypeUserGroup.vue
@@ -1,6 +1,8 @@
diff --git a/webpack.config.js b/webpack.config.js
index 6282b64ce..8732b1db2 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -1,6 +1,6 @@
-const Encore = require('@symfony/webpack-encore');
-const { resolve, parse } = require('path');
-const { readdir } = require('fs').promises;
+const Encore = require("@symfony/webpack-encore");
+const { resolve, parse } = require("path");
+const { readdir } = require("fs").promises;
/**
* get the file names inside given directory recursively, limiting to
@@ -10,20 +10,20 @@ const { readdir } = require('fs').promises;
* @param int depth the maximum depth to look into
*/
async function* getFiles(dir, depth, ignored) {
- const dirents = await readdir(dir, { withFileTypes: true });
- for (const dirent of dirents) {
- const res = resolve(dir, dirent.name);
- if (dirent.isDirectory()) {
- if (depth > 0) {
- yield* getFiles(res, depth - 1, ignored);
- }
- } else if (ignored.includes(res)) {
- continue;
- } else {
- yield res;
- }
+ const dirents = await readdir(dir, { withFileTypes: true });
+ for (const dirent of dirents) {
+ const res = resolve(dir, dirent.name);
+ if (dirent.isDirectory()) {
+ if (depth > 0) {
+ yield* getFiles(res, depth - 1, ignored);
+ }
+ } else if (ignored.includes(res)) {
+ continue;
+ } else {
+ yield res;
}
-};
+ }
+}
/**
* populate the config of encore in directories inside `'./src'` and
@@ -38,88 +38,84 @@ async function* getFiles(dir, depth, ignored) {
*
*/
async function populateConfig(Encore, chillEntries) {
- // chill-main contains some bootstrap that must be loaded first.
- // we register them first and, then, store this chill.webpack.config.js file
- // into `toIgnore`, ignoring it when we loop on other folders.
- let
- toIgnore = [];
+ // chill-main contains some bootstrap that must be loaded first.
+ // we register them first and, then, store this chill.webpack.config.js file
+ // into `toIgnore`, ignoring it when we loop on other folders.
+ let toIgnore = [];
- // loop into chill main
- for await (const f of getFiles('./src/Bundle/ChillMainBundle/', 1, [])) {
- let filename = parse(f).base;
- if (filename === 'chill.webpack.config.js') {
- configure = require(f);
- configure(Encore, chillEntries);
- toIgnore.push(f);
- }
+ // loop into chill main
+ for await (const f of getFiles("./src/Bundle/ChillMainBundle/", 1, [])) {
+ let filename = parse(f).base;
+ if (filename === "chill.webpack.config.js") {
+ configure = require(f);
+ configure(Encore, chillEntries);
+ toIgnore.push(f);
}
+ }
- // loop into other chill bundles
- for await (const f of getFiles('./src/Bundle', 2, toIgnore)) {
- let filename = parse(f).base;
- if (filename === 'chill.webpack.config.js') {
- configure = require(f);
- configure(Encore, chillEntries);
- }
+ // loop into other chill bundles
+ for await (const f of getFiles("./src/Bundle", 2, toIgnore)) {
+ let filename = parse(f).base;
+ if (filename === "chill.webpack.config.js") {
+ configure = require(f);
+ configure(Encore, chillEntries);
}
-};
+ }
+}
// export the final configuration
module.exports = (async () => {
+ // Manually configure the runtime environment if not already configured yet by the "encore" command.
+ // It's useful when you use tools that rely on webpack.config.js file.
+ if (!Encore.isRuntimeEnvironmentConfigured()) {
+ Encore.configureRuntimeEnvironment(process.env.NODE_ENV || "dev");
+ }
+ // basic encore configuration
+ Encore.setOutputPath("public/build/")
+ .setPublicPath("/build")
+ .enableSassLoader()
+ .enableVueLoader(() => {}, {
+ version: 3,
+ })
+ .enableTypeScriptLoader(function (tsConfig) {
+ tsConfig.appendTsSuffixTo = [/\.vue$/];
+ tsConfig.appendTsxSuffixTo = [/\.vue$/];
+ // temporary fix for https://github.com/vuejs/vue-loader/issues/1915 and https://github.com/vuejs/core/issues/2855
+ tsConfig.compilerOptions = { strict: !Encore.isProduction() };
+ tsConfig.silent = false;
+ })
+ //.enableForkedTypeScriptTypesChecking()
+ .autoProvidejQuery()
+ .enableSourceMaps(!Encore.isProduction())
+ .cleanupOutputBeforeBuild()
+ //.enableBuildNotifications()
+ .enableVersioning()
+ .enableSingleRuntimeChunk()
+ .splitEntryChunks();
+ // added when upgrading to symfony 5.4
+ // enables and configure @babel/preset-env polyfills
+ //.configureBabelPresetEnv((config) => {
+ // config.useBuiltIns = 'usage';
+ // config.corejs = '3.23';
+ //})
+ //.addLoader({ test: /\.pdf$/, loader: 'file-loader', options: { name: '[name]_[hash].[ext]', outputPath: 'pdf/' } })
- // Manually configure the runtime environment if not already configured yet by the "encore" command.
- // It's useful when you use tools that rely on webpack.config.js file.
- if (!Encore.isRuntimeEnvironmentConfigured()) {
- Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev');
- }
- // basic encore configuration
- Encore
- .setOutputPath('public/build/')
- .setPublicPath('/build')
- .enableSassLoader()
- .enableVueLoader(() => {}, {
- version: 3
- })
- .enableTypeScriptLoader(function (tsConfig){
- tsConfig.appendTsSuffixTo = [/\.vue$/];
- tsConfig.appendTsxSuffixTo = [/\.vue$/];
- // temporary fix for https://github.com/vuejs/vue-loader/issues/1915 and https://github.com/vuejs/core/issues/2855
- tsConfig.compilerOptions = {strict: !Encore.isProduction()};
- tsConfig.silent = false;
- })
- //.enableForkedTypeScriptTypesChecking()
- .autoProvidejQuery()
- .enableSourceMaps(!Encore.isProduction())
- .cleanupOutputBeforeBuild()
- //.enableBuildNotifications()
- .enableVersioning()
- .enableSingleRuntimeChunk()
- .splitEntryChunks()
- // added when upgrading to symfony 5.4
- // enables and configure @babel/preset-env polyfills
- //.configureBabelPresetEnv((config) => {
- // config.useBuiltIns = 'usage';
- // config.corejs = '3.23';
- //})
- //.addLoader({ test: /\.pdf$/, loader: 'file-loader', options: { name: '[name]_[hash].[ext]', outputPath: 'pdf/' } })
- ;
+ // populate config with chill entries
+ let chillEntries = [];
+ await populateConfig(Encore, chillEntries);
+ // configure Babel
+ // .configureBabel((config) => {
+ // config.plugins.push('@babel/a-babel-plugin');
+ // })
- // populate config with chill entries
- let chillEntries = [];
- await populateConfig(Encore, chillEntries);
- // configure Babel
- // .configureBabel((config) => {
- // config.plugins.push('@babel/a-babel-plugin');
- // })
+ //getting the encore config and appending chill entries
+ config = Encore.getWebpackConfig();
+ config.entry.chill = chillEntries;
- //getting the encore config and appending chill entries
- config = Encore.getWebpackConfig();
- config.entry.chill = chillEntries;
+ if (!Encore.isProduction()) {
+ console.log(config);
+ config.devtool = "eval-source-map";
+ }
- if (!Encore.isProduction()) {
- console.log(config);
- config.devtool = 'eval-source-map';
- }
-
- return config;
+ return config;
})();