diff --git a/package.json b/package.json index cd4f23a07..12a5fee26 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,6 @@ "@hotwired/stimulus": "^3.0.0", "@luminateone/eslint-baseline": "^1.0.9", "@symfony/stimulus-bridge": "^3.2.0", - "@symfony/ux-translator": "file:vendor/symfony/ux-translator/assets", "@symfony/webpack-encore": "^4.1.0", "@tsconfig/node20": "^20.1.4", "@types/dompurify": "^3.0.5", diff --git a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc.vue b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc.vue index 210f8092f..42df15f8b 100644 --- a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc.vue +++ b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc.vue @@ -1,103 +1,98 @@ @@ -284,18 +278,18 @@ export default { @import "ChillMainAssets/chill/scss/chill_variables"; span.multiselect__single { - display: none !important; + display: none !important; } #actionsList { - border-radius: 0.5rem; - padding: 1rem; - margin: 0.5rem; - background-color: whitesmoke; + border-radius: 0.5rem; + padding: 1rem; + margin: 0.5rem; + background-color: whitesmoke; } span.badge { - margin-bottom: 0.5rem; - @include badge_social($social-issue-color); + margin-bottom: 0.5rem; + @include badge_social($social-issue-color); } diff --git a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc/CheckSocialAction.vue b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc/CheckSocialAction.vue index 4b3c210f2..895e3e55b 100644 --- a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc/CheckSocialAction.vue +++ b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc/CheckSocialAction.vue @@ -44,20 +44,21 @@ span.badge { @include badge_social($social-action-color); font-size: 95%; white-space: normal; - word-wrap: break-word; - word-break: break-word; - display: inline-block; - max-width: 100%;margin-bottom: 5px; + word-wrap: break-word; + word-break: break-word; + display: inline-block; + max-width: 100%; + margin-bottom: 5px; margin-right: 1em; text-align: left; - line-height: 1.2em; + line-height: 1.2em; &::before { - position: absolute; - left: 11px; - top: 0; - margin: 0 0.3em 0 -0.75em; - } - position: relative; - padding-left: 1.5em; + position: absolute; + left: 11px; + top: 0; + margin: 0 0.3em 0 -0.75em; + } + position: relative; + padding-left: 1.5em; } diff --git a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc/CheckSocialIssue.vue b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc/CheckSocialIssue.vue index c8b87f8c9..63fad09fc 100644 --- a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc/CheckSocialIssue.vue +++ b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc/CheckSocialIssue.vue @@ -42,19 +42,21 @@ span.badge { @include badge_social($social-issue-color); font-size: 95%; white-space: normal; - word-wrap: break-word; - word-break: break-word; - display: inline-block; - max-width: 100%;margin-bottom: 5px; - margin-right: 1em;text-align: left; + word-wrap: break-word; + word-break: break-word; + display: inline-block; + max-width: 100%; + margin-bottom: 5px; + margin-right: 1em; + text-align: left; - &::before { - position: absolute; - left: 11px; - top: 0; - margin: 0 0.3em 0 -0.75em; - } - position: relative; - padding-left: 1.5em; + &::before { + position: absolute; + left: 11px; + top: 0; + margin: 0 0.3em 0 -0.75em; + } + position: relative; + padding-left: 1.5em; } diff --git a/src/Bundle/ChillCalendarBundle/Resources/public/vuejs/Calendar/App.vue b/src/Bundle/ChillCalendarBundle/Resources/public/vuejs/Calendar/App.vue index 27acb901a..d1374714b 100644 --- a/src/Bundle/ChillCalendarBundle/Resources/public/vuejs/Calendar/App.vue +++ b/src/Bundle/ChillCalendarBundle/Resources/public/vuejs/Calendar/App.vue @@ -1,166 +1,148 @@ diff --git a/src/Bundle/ChillCalendarBundle/Resources/public/vuejs/MyCalendarRange/App2.vue b/src/Bundle/ChillCalendarBundle/Resources/public/vuejs/MyCalendarRange/App2.vue index 40c3200b9..e35db74ad 100644 --- a/src/Bundle/ChillCalendarBundle/Resources/public/vuejs/MyCalendarRange/App2.vue +++ b/src/Bundle/ChillCalendarBundle/Resources/public/vuejs/MyCalendarRange/App2.vue @@ -1,231 +1,185 @@ diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/WaitPostProcessWorkflow/index.ts b/src/Bundle/ChillMainBundle/Resources/public/vuejs/WaitPostProcessWorkflow/index.ts index ac52a90cd..55b0a4331 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/WaitPostProcessWorkflow/index.ts +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/WaitPostProcessWorkflow/index.ts @@ -2,50 +2,50 @@ import { createApp } from "vue"; import App from "./App.vue"; function mountApp(): void { - const el = document.querySelector(".screen-wait"); - if (!el) { - console.error( - "WaitPostProcessWorkflow: mount element .screen-wait not found", - ); - return; - } + const el = document.querySelector(".screen-wait"); + if (!el) { + console.error( + "WaitPostProcessWorkflow: mount element .screen-wait not found", + ); + return; + } - const workflowIdAttr = el.getAttribute("data-workflow-id"); - const expectedStep = el.getAttribute("data-expected-step") || ""; + const workflowIdAttr = el.getAttribute("data-workflow-id"); + const expectedStep = el.getAttribute("data-expected-step") || ""; - if (!workflowIdAttr) { - console.error( - "WaitPostProcessWorkflow: data-workflow-id attribute missing on mount element", - ); - return; - } + if (!workflowIdAttr) { + console.error( + "WaitPostProcessWorkflow: data-workflow-id attribute missing on mount element", + ); + return; + } - if (!expectedStep) { - console.error( - "WaitPostProcessWorkflow: data-expected-step attribute missing on mount element", - ); - return; - } + if (!expectedStep) { + console.error( + "WaitPostProcessWorkflow: data-expected-step attribute missing on mount element", + ); + return; + } - const workflowId = Number(workflowIdAttr); - if (Number.isNaN(workflowId)) { - console.error( - "WaitPostProcessWorkflow: data-workflow-id is not a valid number:", - workflowIdAttr, - ); - return; - } + const workflowId = Number(workflowIdAttr); + if (Number.isNaN(workflowId)) { + console.error( + "WaitPostProcessWorkflow: data-workflow-id is not a valid number:", + workflowIdAttr, + ); + return; + } - const app = createApp(App, { - workflowId, - expectedStep, - }); + const app = createApp(App, { + workflowId, + expectedStep, + }); - app.mount(el); + app.mount(el); } if (document.readyState === "loading") { - document.addEventListener("DOMContentLoaded", mountApp); + document.addEventListener("DOMContentLoaded", mountApp); } else { - mountApp(); + mountApp(); } diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/WorkflowAttachment/App.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/WorkflowAttachment/App.vue index af319580d..a9a201275 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/WorkflowAttachment/App.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/WorkflowAttachment/App.vue @@ -9,17 +9,17 @@ import { fetchWorkflow } from "ChillMainAssets/lib/workflow/api"; import { trans, WORKFLOW_ATTACHMENTS_ADD_AN_ATTACHMENT } from "translator"; interface AppConfig { - workflowId: number; - accompanyingPeriodId: number; - attachments: WorkflowAttachment[]; + workflowId: number; + accompanyingPeriodId: number; + attachments: WorkflowAttachment[]; } const emit = defineEmits<{ - ( - e: "pickGenericDoc", - payload: { genericDoc: GenericDocForAccompanyingPeriod }, - ): void; - (e: "removeAttachment", payload: { attachment: WorkflowAttachment }): void; + ( + e: "pickGenericDoc", + payload: { genericDoc: GenericDocForAccompanyingPeriod }, + ): void; + (e: "removeAttachment", payload: { attachment: WorkflowAttachment }): void; }>(); type PickGenericModalType = InstanceType; @@ -28,66 +28,66 @@ const pickDocModal = useTemplateRef("pickDocModal"); const props = defineProps(); const attachedGenericDoc = computed( - () => - props.attachments - .map((a: WorkflowAttachment) => a.genericDoc) - .filter( - (g: GenericDoc | null) => g !== null, - ) as GenericDocForAccompanyingPeriod[], + () => + props.attachments + .map((a: WorkflowAttachment) => a.genericDoc) + .filter( + (g: GenericDoc | null) => g !== null, + ) as GenericDocForAccompanyingPeriod[], ); const workflow = ref(null); onMounted(async () => { - workflow.value = await fetchWorkflow(Number(props.workflowId)); - console.log("workflow", workflow.value); + workflow.value = await fetchWorkflow(Number(props.workflowId)); + console.log("workflow", workflow.value); }); const openModal = function () { - pickDocModal.value?.openModal(); + pickDocModal.value?.openModal(); }; const onPickGenericDoc = ({ - genericDoc, + genericDoc, }: { - genericDoc: GenericDocForAccompanyingPeriod; + genericDoc: GenericDocForAccompanyingPeriod; }) => { - emit("pickGenericDoc", { genericDoc }); + emit("pickGenericDoc", { genericDoc }); }; const onRemoveAttachment = (payload: { attachment: WorkflowAttachment }) => { - emit("removeAttachment", payload); + emit("removeAttachment", payload); }; const canEditAttachement = computed(() => { - if (null === workflow.value) { - return false; - } + if (null === workflow.value) { + return false; + } - return workflow.value._permissions.CHILL_MAIN_WORKFLOW_ATTACHMENT_EDIT; + return workflow.value._permissions.CHILL_MAIN_WORKFLOW_ATTACHMENT_EDIT; }); diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/WorkflowAttachment/Component/AttachmentList.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/WorkflowAttachment/Component/AttachmentList.vue index d12496266..f9d29d1b6 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/WorkflowAttachment/Component/AttachmentList.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/WorkflowAttachment/Component/AttachmentList.vue @@ -1,9 +1,9 @@ diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/WorkflowAttachment/Component/GenericDocItemBox.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/WorkflowAttachment/Component/GenericDocItemBox.vue index d57a99475..2d769121f 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/WorkflowAttachment/Component/GenericDocItemBox.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/WorkflowAttachment/Component/GenericDocItemBox.vue @@ -2,17 +2,17 @@ import { GenericDoc } from "ChillDocStoreAssets/types/generic_doc"; interface GenericDocItemBoxProps { - genericDoc: GenericDoc; + genericDoc: GenericDoc; } const props = defineProps(); diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/WorkflowAttachment/Component/PickGenericDoc.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/WorkflowAttachment/Component/PickGenericDoc.vue index 717b8a62b..ec0296da4 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/WorkflowAttachment/Component/PickGenericDoc.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/WorkflowAttachment/Component/PickGenericDoc.vue @@ -1,7 +1,7 @@ diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/WorkflowAttachment/Component/PickGenericDocModal.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/WorkflowAttachment/Component/PickGenericDocModal.vue index adaa4c825..c30afa5dc 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/WorkflowAttachment/Component/PickGenericDocModal.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/WorkflowAttachment/Component/PickGenericDocModal.vue @@ -6,20 +6,20 @@ import { GenericDocForAccompanyingPeriod } from "ChillDocStoreAssets/types/gener import { EntityWorkflow } from "ChillMainAssets/types"; interface PickGenericDocModalProps { - workflow: EntityWorkflow | null; - accompanyingPeriodId: number; - toRemove: GenericDocForAccompanyingPeriod[]; + workflow: EntityWorkflow | null; + accompanyingPeriodId: number; + toRemove: GenericDocForAccompanyingPeriod[]; } type PickGenericDocType = InstanceType; const props = defineProps(); const emit = defineEmits<{ - // eslint-disable-next-line @typescript-eslint/prefer-function-type - ( - e: "pickGenericDoc", - payload: { genericDoc: GenericDocForAccompanyingPeriod }, - ): void; + // eslint-disable-next-line @typescript-eslint/prefer-function-type + ( + e: "pickGenericDoc", + payload: { genericDoc: GenericDocForAccompanyingPeriod }, + ): void; }>(); const picker = useTemplateRef("picker"); const modalOpened = ref(false); @@ -29,88 +29,88 @@ const modalClasses = { "modal-xl": true, "modal-dialog-scrollable": true }; const numberOfPicked = computed(() => pickeds.value.length); const onPicked = ({ - genericDoc, + genericDoc, }: { - genericDoc: GenericDocForAccompanyingPeriod; + genericDoc: GenericDocForAccompanyingPeriod; }) => { - pickeds.value.push(genericDoc); + pickeds.value.push(genericDoc); }; const onRemove = ({ - genericDoc, + genericDoc, }: { - genericDoc: GenericDocForAccompanyingPeriod; + genericDoc: GenericDocForAccompanyingPeriod; }) => { - const index = pickeds.value.findIndex( - (item) => item.uniqueKey === genericDoc.uniqueKey, - ); + const index = pickeds.value.findIndex( + (item) => item.uniqueKey === genericDoc.uniqueKey, + ); - if (index === -1) { - throw new Error("Remove generic doc that doesn't exist"); - } + if (index === -1) { + throw new Error("Remove generic doc that doesn't exist"); + } - pickeds.value.splice(index, 1); + pickeds.value.splice(index, 1); }; const onConfirm = () => { - for (let genericDoc of pickeds.value) { - emit("pickGenericDoc", { genericDoc }); - } - pickeds.value = []; - closeModal(); + for (let genericDoc of pickeds.value) { + emit("pickGenericDoc", { genericDoc }); + } + pickeds.value = []; + closeModal(); }; const closeModal = function () { - modalOpened.value = false; + modalOpened.value = false; }; const openModal = function () { - modalOpened.value = true; + modalOpened.value = true; }; defineExpose({ openModal, closeModal }); diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/GenderIconRenderBox.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/GenderIconRenderBox.vue index 6b11d400f..318d4faaa 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/GenderIconRenderBox.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/GenderIconRenderBox.vue @@ -5,7 +5,7 @@ @@ -81,19 +78,19 @@ const emits = defineEmits<{ * This is a mask behind the modal. */ .modal-mask { - position: fixed; - z-index: 9998; - top: 0; - left: 0; - width: 100%; - height: 100%; - background-color: rgba(0, 0, 0, 0.75); - transition: opacity 0.3s ease; + position: fixed; + z-index: 9998; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, 0.75); + transition: opacity 0.3s ease; } .modal-header .close { - border-top-right-radius: 0.3rem; - margin-right: 0; - margin-left: auto; + border-top-right-radius: 0.3rem; + margin-right: 0; + margin-left: auto; } /* * The following styles are auto-applied to elements with @@ -104,23 +101,23 @@ const emits = defineEmits<{ * these styles. */ .modal-enter { - opacity: 0; + opacity: 0; } .modal-leave-active { - opacity: 0; + opacity: 0; } .modal-enter .modal-container, .modal-leave-active .modal-container { - -webkit-transform: scale(1.1); - transform: scale(1.1); + -webkit-transform: scale(1.1); + transform: scale(1.1); } h3.modal-title { - font-size: 1.5rem; - font-weight: bold; + font-size: 1.5rem; + font-weight: bold; } div.modal-footer { - button:first-child { - margin-right: auto; - } + button:first-child { + margin-right: auto; + } } diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/WaitingScreen.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/WaitingScreen.vue index 963db5e81..ea12b1577 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/WaitingScreen.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/WaitingScreen.vue @@ -2,61 +2,61 @@ import { WaitingScreenState } from "ChillMainAssets/types"; interface Props { - state: WaitingScreenState; + state: WaitingScreenState; } const props = defineProps(); diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_composables/violationList.ts b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_composables/violationList.ts index 328972e1b..b8af0b519 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_composables/violationList.ts +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_composables/violationList.ts @@ -1,23 +1,25 @@ -import {ref} from "vue"; -import {ValidationExceptionInterface} from "ChillMainAssets/types"; +import { ref } from "vue"; +import { ValidationExceptionInterface } from "ChillMainAssets/types"; -export function useViolationList>>() { +export function useViolationList< + T extends Record>, +>() { type ViolationKey = Extract; - const violationsList = ref|null>(null); + const violationsList = ref | null>(null); function violationTitles

(property: P): string[] { if (null === violationsList.value) { return []; } - const r = violationsList.value.violationsByNormalizedProperty(property).map((v) => v.title); - + const r = violationsList.value + .violationsByNormalizedProperty(property) + .map((v) => v.title); return r; - } function violationTitlesWithParameter< P extends ViolationKey, - Param extends Extract + Param extends Extract, >( property: P, with_parameter: Param, @@ -26,26 +28,38 @@ export function useViolationList if (violationsList.value === null) { return []; } - return violationsList.value.violationsByNormalizedPropertyAndParams(property, with_parameter, with_parameter_value) + return violationsList.value + .violationsByNormalizedPropertyAndParams( + property, + with_parameter, + with_parameter_value, + ) .map((v) => v.title); } - function hasViolation

(property: P): boolean { return violationTitles(property).length > 0; } function hasViolationWithParameter< P extends ViolationKey, - Param extends Extract + Param extends Extract, >( property: P, with_parameter: Param, with_parameter_value: T[P][Param], ): boolean { - return violationTitlesWithParameter(property, with_parameter, with_parameter_value).length > 0; + return ( + violationTitlesWithParameter( + property, + with_parameter, + with_parameter_value, + ).length > 0 + ); } - function setValidationException>(validationException: V): void { + function setValidationException>( + validationException: V, + ): void { violationsList.value = validationException; } @@ -53,5 +67,12 @@ export function useViolationList violationsList.value = null; } - return {violationTitles, violationTitlesWithParameter, setValidationException, cleanException, hasViolationWithParameter, hasViolation}; + return { + violationTitles, + violationTitlesWithParameter, + setValidationException, + cleanException, + hasViolationWithParameter, + hasViolation, + }; } diff --git a/src/Bundle/ChillPersonBundle/Resources/public/types.ts b/src/Bundle/ChillPersonBundle/Resources/public/types.ts index 4523325e8..71906cfb3 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/types.ts +++ b/src/Bundle/ChillPersonBundle/Resources/public/types.ts @@ -14,7 +14,8 @@ import { DateTimeWrite, SetGender, SetCenter, - SetCivility, Gender, + SetCivility, + Gender, } from "ChillMainAssets/types"; import { StoredObject } from "ChillDocStoreAssets/types"; import { Thirdparty } from "../../../ChillThirdPartyBundle/Resources/public/types"; @@ -157,16 +158,16 @@ export interface AccompanyingPeriod { } export interface AccompanyingPeriodWorkEvaluationDocument { - id: number; - type: "accompanying_period_work_evaluation_document"; - storedObject: StoredObject; - title: string; - createdAt: DateTime | null; - createdBy: User | null; - updatedAt: DateTime | null; - updatedBy: User | null; - workflows_availables: WorkflowAvailable[]; - workflows: object[]; + id: number; + type: "accompanying_period_work_evaluation_document"; + storedObject: StoredObject; + title: string; + createdAt: DateTime | null; + createdBy: User | null; + updatedAt: DateTime | null; + updatedBy: User | null; + workflows_availables: WorkflowAvailable[]; + workflows: object[]; } export interface AccompanyingPeriodWork { @@ -195,139 +196,139 @@ export interface AccompanyingPeriodWork { } interface SocialAction { - id: number; - parent?: SocialAction | null; - children: SocialAction[]; - issue?: SocialIssue | null; - ordering: number; - title: { - fr: string; - }; - text: string; - defaultNotificationDelay?: string | null; - desactivationDate?: string | null; - evaluations: Evaluation[]; - goals: Goal[]; - results: Result[]; + id: number; + parent?: SocialAction | null; + children: SocialAction[]; + issue?: SocialIssue | null; + ordering: number; + title: { + fr: string; + }; + text: string; + defaultNotificationDelay?: string | null; + desactivationDate?: string | null; + evaluations: Evaluation[]; + goals: Goal[]; + results: Result[]; } export interface AccompanyingPeriodResource { - id: number; - accompanyingPeriod: AccompanyingPeriod; - comment?: string | null; - person?: Person | null; - thirdParty?: Thirdparty | null; + id: number; + accompanyingPeriod: AccompanyingPeriod; + comment?: string | null; + person?: Person | null; + thirdParty?: Thirdparty | null; } export interface Origin { - id: number; - label: { - fr: string; - }; - noActiveAfter: DateTime; + id: number; + label: { + fr: string; + }; + noActiveAfter: DateTime; } export interface ClosingMotive { - id: number; - active: boolean; - name: { - fr: string; - }; - ordering: number; - isCanceledAccompanyingPeriod: boolean; - parent?: ClosingMotive | null; - children: ClosingMotive[]; + id: number; + active: boolean; + name: { + fr: string; + }; + ordering: number; + isCanceledAccompanyingPeriod: boolean; + parent?: ClosingMotive | null; + children: ClosingMotive[]; } export interface AccompanyingPeriodParticipation { - id: number; - startDate: DateTime; - endDate?: DateTime | null; - accompanyingPeriod: AccompanyingPeriod; - person: Person; + id: number; + startDate: DateTime; + endDate?: DateTime | null; + accompanyingPeriod: AccompanyingPeriod; + person: Person; } export interface AccompanyingPeriodLocationHistory { - id: number; - startDate: DateTime; - endDate?: DateTime | null; - addressLocation?: Address | null; - period: AccompanyingPeriod; - personLocation?: Person | null; + id: number; + startDate: DateTime; + endDate?: DateTime | null; + addressLocation?: Address | null; + period: AccompanyingPeriod; + personLocation?: Person | null; } export interface SocialIssue { - id: number; - text: string; - parent?: SocialIssue | null; - children: SocialIssue[]; - socialActions?: SocialAction[] | null; - ordering: number; - title: { - fr: string; - }; - desactivationDate?: string | null; + id: number; + text: string; + parent?: SocialIssue | null; + children: SocialIssue[]; + socialActions?: SocialAction[] | null; + ordering: number; + title: { + fr: string; + }; + desactivationDate?: string | null; } export interface Goal { - id: number; - results: Result[]; - socialActions?: SocialAction[] | null; - title: { - fr: string; - }; + id: number; + results: Result[]; + socialActions?: SocialAction[] | null; + title: { + fr: string; + }; } export interface Result { - id: number; - accompanyingPeriodWorks: AccompanyingPeriodWork[]; - accompanyingPeriodWorkGoals: AccompanyingPeriodWorkGoal[]; - goals: Goal[]; - socialActions: SocialAction[]; - title: { - fr: string; - }; - desactivationDate?: string | null; + id: number; + accompanyingPeriodWorks: AccompanyingPeriodWork[]; + accompanyingPeriodWorkGoals: AccompanyingPeriodWorkGoal[]; + goals: Goal[]; + socialActions: SocialAction[]; + title: { + fr: string; + }; + desactivationDate?: string | null; } export interface AccompanyingPeriodWorkGoal { - id: number; - accompanyingPeriodWork: AccompanyingPeriodWork; - goal: Goal; - note: string; - results: Result[]; + id: number; + accompanyingPeriodWork: AccompanyingPeriodWork; + goal: Goal; + note: string; + results: Result[]; } export interface AccompanyingPeriodWorkEvaluation { - type: 'accompanying_period_work_evaluation'; - accompanyingPeriodWork: AccompanyingPeriodWork | null; - comment: string; - createdAt: DateTime | null; - createdBy: User | null; - documents: AccompanyingPeriodWorkEvaluationDocument[]; - endDate: DateTime | null; - evaluation: Evaluation | null; - id: number | null; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - key: any; - maxDate: DateTime | null; - startDate: DateTime | null; - updatedAt: DateTime | null; - updatedBy: User | null; - warningInterval: string | null; - timeSpent: number | null; + type: "accompanying_period_work_evaluation"; + accompanyingPeriodWork: AccompanyingPeriodWork | null; + comment: string; + createdAt: DateTime | null; + createdBy: User | null; + documents: AccompanyingPeriodWorkEvaluationDocument[]; + endDate: DateTime | null; + evaluation: Evaluation | null; + id: number | null; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + key: any; + maxDate: DateTime | null; + startDate: DateTime | null; + updatedAt: DateTime | null; + updatedBy: User | null; + warningInterval: string | null; + timeSpent: number | null; } export interface Evaluation { - id: number; - url: string; - socialActions: SocialAction[]; - title: { - fr: string; - }; - active: boolean; - delay: string; - notificationDelay: string; + id: number; + url: string; + socialActions: SocialAction[]; + title: { + fr: string; + }; + active: boolean; + delay: string; + notificationDelay: string; } export interface Step { @@ -394,15 +395,15 @@ export interface AccompanyingCourse { } export interface AccompanyingPeriodWorkReferrerHistory { - id: number; - accompanyingPeriodWork: AccompanyingPeriodWork; - user: User; - startDate: DateTime; - endDate: DateTime | null; - createdAt: DateTime; - updatedAt: DateTime | null; - createdBy: User; - updatedBy: User | null; + id: number; + accompanyingPeriodWork: AccompanyingPeriodWork; + user: User; + startDate: DateTime; + endDate: DateTime | null; + createdAt: DateTime; + updatedAt: DateTime | null; + createdBy: User; + updatedBy: User | null; } export interface AccompanyingPeriodWorkEvaluationDocument { @@ -432,7 +433,7 @@ export type EntityType = | "user" | "household"; -export type Entities = (UserGroup | User | Person | Thirdparty | Household); +export type Entities = UserGroup | User | Person | Thirdparty | Household; export function isEntityHousehold(e: Entities): e is Household { return e.type === "household"; @@ -440,25 +441,34 @@ export function isEntityHousehold(e: Entities): e is Household { export type EntitiesOrMe = "me" | Entities; - // Type guards to discriminate Suggestions by their result kind -export function isSuggestionForUserGroup(s: Suggestion): s is Suggestion & { result: UserGroup } { +export function isSuggestionForUserGroup( + s: Suggestion, +): s is Suggestion & { result: UserGroup } { return (s as any)?.result?.type === "user_group"; } -export function isSuggestionForUser(s: Suggestion): s is Suggestion & { result: User } { +export function isSuggestionForUser( + s: Suggestion, +): s is Suggestion & { result: User } { return (s as any)?.result?.type === "user"; } -export function isSuggestionForPerson(s: Suggestion): s is Suggestion & { result: Person } { +export function isSuggestionForPerson( + s: Suggestion, +): s is Suggestion & { result: Person } { return (s as any)?.result?.type === "person"; } -export function isSuggestionForThirdParty(s: Suggestion): s is Suggestion & { result: Thirdparty } { +export function isSuggestionForThirdParty( + s: Suggestion, +): s is Suggestion & { result: Thirdparty } { return (s as any)?.result?.type === "thirdparty"; } -export function isSuggestionForHousehold(s: Suggestion): s is Suggestion & { result: Household } { +export function isSuggestionForHousehold( + s: Suggestion, +): s is Suggestion & { result: Household } { return (s as any)?.result?.type === "household"; } @@ -482,7 +492,7 @@ export interface SearchPagination { export interface Search { count: number; pagination: SearchPagination; - results: {relevance: number, result: Entities}[]; + results: { relevance: number; result: Entities }[]; } export interface SearchOptions { @@ -498,7 +508,11 @@ export interface SearchOptions { }; } -type PersonIdentifierPresence = 'NOT_EDITABLE' | 'ON_EDIT' | 'ON_CREATION' | 'REQUIRED'; +type PersonIdentifierPresence = + | "NOT_EDITABLE" + | "ON_EDIT" + | "ON_CREATION" + | "REQUIRED"; export interface PersonIdentifierWorker { type: "person_identifier_worker"; diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Confirm.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Confirm.vue index 687774a18..74fe0467d 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Confirm.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Confirm.vue @@ -42,9 +42,7 @@

  • -
  • diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonsAssociated.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonsAssociated.vue index e023c227b..583062275 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonsAssociated.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonsAssociated.vue @@ -84,8 +84,12 @@
    • -
      -
      -
      - -
      -

      - - {{ work.socialAction.text }} -

      -
      - -
      - - -
      - -
      - - -
      - -
      - - -
      - -
      - - -
      - -
      -
      -
      -

      {{ $t("goals_title") }}

      -
      -
      -

      {{ $t("results_title") }}

      -
      -
      - - -
      -
      - {{ - localizeString(g.goal.title) - }} -
      -
      - -
      -
      - - -
      -
      - {{ $t("results_without_objective") }} -
      -
      - -
      -
      - - -
      -
      -

      - - - -

      -
      - -
      -

      - Aucun objectif associé -

      -
      -
      - {{ - $t("no_goals_available") - }} -
      -
      - - -
      - -
      -
      -
      -

      - {{ $t("Evaluations") }} - {{ $t("Forms") }} - - {{ $t("Post") }} -

      -
      -
      - - - - - - -
      -
      -

      {{ $t("available_evaluations_text") }}

      -
        -
      • - {{ localizeString(e.title) }} -
      • -
      -
      -
        -
      • - -
      • -
      -
      - {{ - $t("no_evaluations_available") - }} -
      -
      -
      - -
      -

      {{ $t("persons_involved") }}

      - -
        -
      • -
        - - -
        -
      • -
      • -
        - - -
        -  {{ - $t("warning_previous_persons") - }} -
      • -
      -
      - -
      -

      {{ $t("referrers") }}

      - -
      -

      {{ $t("no_referrers") }}

      -
      - -
      -
        -
      • - - {{ u.text }} - -
      • -
      -
      - -
        -
      • - - -
      • -
      -
      - -
      -

      {{ $t("handling_thirdparty") }}

      - -
      -

      - {{ $t("no_handling_thirdparty") }} -

      - -
        -
      • - - - -
      • -
      -
      -
      - -
        -
      • -
      • -
      -
      -
      - -
      -

      {{ $t("thirdparty_intervener") }}

      - -
      -

      - {{ $t("no_thirdparty_intervener") }} -

      -
      - -
      -
      - - - -
      -
      - -
        -
      • - - - -
      • -
      -
      - -
      -

      {{ $t("fix_these_errors") }}

      -
        -
      • {{ e }}
      • -
      -
      +
      +
      +
      + +
      +

      + + {{ work.socialAction.text }} +

      -
        -
      • - -
      • -
      • +
        + + +
        + +
        + + +
        + +
        + + +
        + +
        + + +
        + +
        +
        +
        +

        {{ $t("goals_title") }}

        +
        +
        +

        {{ $t("results_title") }}

        +
        +
        + + +
        +
        + {{ localizeString(g.goal.title) }} +
        +
        + +
        +
        + + +
        +
        + {{ $t("results_without_objective") }} +
        +
        + +
        +
        + + +
        +
        +

        - @@ -856,172 +821,172 @@ export default { @import "~ChillMainAssets/chill/scss/mixins"; div#workEditor { - display: grid; - grid-template-columns: 50%; - column-gap: 0rem; - grid-template-areas: - "title title" - "startDate endDate" - "comment comment" - "privateComment privateComment" - "objectives objectives" - "evaluations evaluations" - "persons persons" - "referrers referrers" - "handling handling" - "tparties tparties" - "errors errors"; + display: grid; + grid-template-columns: 50%; + column-gap: 0rem; + grid-template-areas: + "title title" + "startDate endDate" + "comment comment" + "privateComment privateComment" + "objectives objectives" + "evaluations evaluations" + "persons persons" + "referrers referrers" + "handling handling" + "tparties tparties" + "errors errors"; - #title { - grid-area: title; - } - #startDate { - grid-area: startDate; - } - #endDate { - grid-area: endDate; - } - #comment { - grid-area: comment; - } - #privateComment { - grid-area: privateComment; - } - #objectives { - grid-area: objectives; - } - #evaluations { - grid-area: evaluations; - } - #persons { - grid-area: persons; - } - #handlingThirdParty { - grid-area: handling; - } - #thirdParties { - grid-area: tparties; - } - #referrers { - grid-area: referrers; - } - #errors { - grid-area: errors; + #title { + grid-area: title; + } + #startDate { + grid-area: startDate; + } + #endDate { + grid-area: endDate; + } + #comment { + grid-area: comment; + } + #privateComment { + grid-area: privateComment; + } + #objectives { + grid-area: objectives; + } + #evaluations { + grid-area: evaluations; + } + #persons { + grid-area: persons; + } + #handlingThirdParty { + grid-area: handling; + } + #thirdParties { + grid-area: tparties; + } + #referrers { + grid-area: referrers; + } + #errors { + grid-area: errors; + } + + div.action-row { + @include border-collapse; + padding: 1em; + + &#title { + label { + margin-bottom: 0; + } + p { + margin-top: 0; + font-weight: bold; + font-size: 1rem; + } } - div.action-row { + &#objectives { + & > div { + display: grid; + grid-template-columns: 50%; + column-gap: 0rem; + grid-template-areas: "obj res"; + + & > div { + @include border-collapse; + padding: 1em; + + &:nth-child(1) { + grid-area: obj; + } + + &:nth-child(2) { + grid-area: res; + } + } + + & > div.results_without_objective { + background: repeating-linear-gradient( + 45deg, + $gray-200, + $gray-200 10px, + $gray-100 10px, + $gray-100 20px + ); + text-align: center; + font-weight: 700; + padding-top: 1.5rem; + } + } + } + + &#evaluations { + & > div { @include border-collapse; padding: 1em; - - &#title { - label { - margin-bottom: 0; - } - p { - margin-top: 0; - font-weight: bold; - font-size: 1rem; - } - } - - &#objectives { - & > div { - display: grid; - grid-template-columns: 50%; - column-gap: 0rem; - grid-template-areas: "obj res"; - - & > div { - @include border-collapse; - padding: 1em; - - &:nth-child(1) { - grid-area: obj; - } - - &:nth-child(2) { - grid-area: res; - } - } - - & > div.results_without_objective { - background: repeating-linear-gradient( - 45deg, - $gray-200, - $gray-200 10px, - $gray-100 10px, - $gray-100 20px - ); - text-align: center; - font-weight: 700; - padding-top: 1.5rem; - } - } - } - - &#evaluations { - & > div { - @include border-collapse; - padding: 1em; - } - } - - &#objectives, - &#evaluations { - padding: 0; - - & > div.title { - background-color: $gray-200; - color: $gray-700; - - h3 { - text-align: center; - } - } - - .item-title { - font-weight: bold; - } - .item-details { - margin: 1em 2em; - font-size: 85%; - } - - & > i.fa { - padding: 0.25rem; - color: $white; - - &.fa-times { - color: $red; - } - } - } - - &#persons { - margin-top: 1.5em; - } - - ul.record_actions { - margin-bottom: 0; - } + } } - div#errors { - &.alert { - margin-top: 2em; + &#objectives, + &#evaluations { + padding: 0; + + & > div.title { + background-color: $gray-200; + color: $gray-700; + + h3 { + text-align: center; } + } + + .item-title { + font-weight: bold; + } + .item-details { + margin: 1em 2em; + font-size: 85%; + } + + & > i.fa { + padding: 0.25rem; + color: $white; + + &.fa-times { + color: $red; + } + } } + + &#persons { + margin-top: 1.5em; + } + + ul.record_actions { + margin-bottom: 0; + } + } + + div#errors { + &.alert { + margin-top: 2em; + } + } } .accordion-item:first-of-type, .accordion-item:last-of-type { - border-radius: 0rem; - border: 0px; - .accordion-button { - padding: 0.25rem; - border: 1px solid rgba(17, 17, 17, 0.125); - margin-top: 20px; - margin-bottom: 20px; - } + border-radius: 0rem; + border: 0px; + .accordion-button { + padding: 0.25rem; + border: 1px solid rgba(17, 17, 17, 0.125); + margin-top: 20px; + margin-bottom: 20px; + } } diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/CommentInput.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/CommentInput.vue index 84a27a5ed..62b46d2da 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/CommentInput.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/CommentInput.vue @@ -1,19 +1,19 @@ diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/DocumentActions.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/DocumentActions.vue index 126fbffe6..2f7701210 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/DocumentActions.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/DocumentActions.vue @@ -1,43 +1,43 @@ diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/DocumentsList.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/DocumentsList.vue index 7c9892de9..1a6f428ba 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/DocumentsList.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/DocumentsList.vue @@ -1,288 +1,205 @@ 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 6f459daec..91adc4bb1 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue @@ -1,49 +1,47 @@ diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/TimeSpentInput.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/TimeSpentInput.vue index e03ec0ed5..a253f87d3 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/TimeSpentInput.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/TimeSpentInput.vue @@ -1,27 +1,27 @@ diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AccompanyingPeriodWorkSelector/AccompanyingPeriodWorkEvaluationList.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AccompanyingPeriodWorkSelector/AccompanyingPeriodWorkEvaluationList.vue index 8581546f1..b85c87ec4 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AccompanyingPeriodWorkSelector/AccompanyingPeriodWorkEvaluationList.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AccompanyingPeriodWorkSelector/AccompanyingPeriodWorkEvaluationList.vue @@ -1,24 +1,24 @@ diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AccompanyingPeriodWorkSelector/AccompanyingPeriodWorkList.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AccompanyingPeriodWorkSelector/AccompanyingPeriodWorkList.vue index 9a7afa7da..03d513b13 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AccompanyingPeriodWorkSelector/AccompanyingPeriodWorkList.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AccompanyingPeriodWorkSelector/AccompanyingPeriodWorkList.vue @@ -27,22 +27,22 @@ import { AccompanyingPeriodWork } from "../../../types"; import { defineProps, ref, watch } from "vue"; const props = defineProps<{ - accompanyingPeriodWorks: AccompanyingPeriodWork[]; - selectedAcpw?: AccompanyingPeriodWork | null; + accompanyingPeriodWorks: AccompanyingPeriodWork[]; + selectedAcpw?: AccompanyingPeriodWork | null; }>(); const selectedAcpw = ref( - props.selectedAcpw ?? null, + props.selectedAcpw ?? null, ); const emit = defineEmits<{ - "update:selectedAcpw": [value: AccompanyingPeriodWork | null]; + "update:selectedAcpw": [value: AccompanyingPeriodWork | null]; }>(); watch( - () => props.selectedAcpw, - (val) => { - selectedAcpw.value = val ?? null; - }, + () => props.selectedAcpw, + (val) => { + selectedAcpw.value = val ?? null; + }, ); watch(selectedAcpw, (newValue) => { diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AccompanyingPeriodWorkSelector/AccompanyingPeriodWorkSelectorModal.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AccompanyingPeriodWorkSelector/AccompanyingPeriodWorkSelectorModal.vue index 158f6c16b..5ba7c1283 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AccompanyingPeriodWorkSelector/AccompanyingPeriodWorkSelectorModal.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AccompanyingPeriodWorkSelector/AccompanyingPeriodWorkSelectorModal.vue @@ -20,26 +20,28 @@

      - - - + + + @@ -59,13 +61,14 @@ import Modal from "ChillMainAssets/vuejs/_components/Modal.vue"; import AccompanyingPeriodWorkList from "./AccompanyingPeriodWorkList.vue"; import { AccompanyingPeriodWork } from "../../../types"; import { - trans,ACPW_DUPLICATE_SELECT_ACCOMPANYING_PERIOD_WORK, - ACPW_DUPLICATE_SELECT_AN_EVALUATION,CONFIRM, - + trans, + ACPW_DUPLICATE_SELECT_ACCOMPANYING_PERIOD_WORK, + ACPW_DUPLICATE_SELECT_AN_EVALUATION, + CONFIRM, } from "translator"; import { fetchResults } from "ChillMainAssets/lib/api/apiMethods"; import AccompanyingPeriodWorkEvaluationList from "ChillPersonAssets/vuejs/_components/AccompanyingPeriodWorkSelector/AccompanyingPeriodWorkEvaluationList.vue"; - import { AccompanyingPeriodWorkEvaluation } from "../../../types"; +import { AccompanyingPeriodWorkEvaluation } from "../../../types"; const selectedAcpw = ref(null); const selectedEvaluation = ref(null); @@ -74,21 +77,21 @@ const accompanyingPeriodWorks = ref([]); const evaluations = ref([]); const props = defineProps<{ - accompanyingPeriodId: string; - isEvaluationSelector: boolean; - ignoreAccompanyingPeriodWorkIds: number[]; + accompanyingPeriodId: string; + isEvaluationSelector: boolean; + ignoreAccompanyingPeriodWorkIds: number[]; }>(); const emit = defineEmits<{ pickWork: [payload: { work: AccompanyingPeriodWork | null }]; - closeModal: []; - "update:selectedEvaluation": [evaluation: AccompanyingPeriodWorkEvaluation]; + closeModal: []; + "update:selectedEvaluation": [evaluation: AccompanyingPeriodWorkEvaluation]; }>(); const getModalTitle = () => - evaluations.value.length > 0 - ? trans(ACPW_DUPLICATE_SELECT_AN_EVALUATION) - : trans(ACPW_DUPLICATE_SELECT_ACCOMPANYING_PERIOD_WORK); + evaluations.value.length > 0 + ? trans(ACPW_DUPLICATE_SELECT_AN_EVALUATION) + : trans(ACPW_DUPLICATE_SELECT_ACCOMPANYING_PERIOD_WORK); onMounted(() => { if (props.accompanyingPeriodId) { @@ -97,70 +100,70 @@ onMounted(() => { console.error("No accompanyingperiod id was given"); } - showModal.value = true; + showModal.value = true; }); const getAccompanyingPeriodWorks = async (periodId: number) => { const url = `/api/1.0/person/accompanying-course/${periodId}/works.json`; const accompanyingPeriodWorksFetched = - await fetchResults(url); + await fetchResults(url); if (props.isEvaluationSelector) { accompanyingPeriodWorks.value = accompanyingPeriodWorksFetched.filter( - (acpw: AccompanyingPeriodWork) => - acpw.accompanyingPeriodWorkEvaluations.length > 0 && - typeof acpw.id !== "undefined" && - !props.ignoreAccompanyingPeriodWorkIds.includes(acpw.id), - ); - } else { - accompanyingPeriodWorks.value = accompanyingPeriodWorksFetched; - } + (acpw: AccompanyingPeriodWork) => + acpw.accompanyingPeriodWorkEvaluations.length > 0 && + typeof acpw.id !== "undefined" && + !props.ignoreAccompanyingPeriodWorkIds.includes(acpw.id), + ); + } else { + accompanyingPeriodWorks.value = accompanyingPeriodWorksFetched; + } }; watch(selectedAcpw, (newValue) => { - const inputField = document.getElementById( - "find_accompanying_period_work_acpw", - ) as HTMLInputElement; - if (inputField) { - inputField.value = String(newValue?.id || ""); - } + const inputField = document.getElementById( + "find_accompanying_period_work_acpw", + ) as HTMLInputElement; + if (inputField) { + inputField.value = String(newValue?.id || ""); + } - /* if (!props.isEvaluationSelector) { + /* if (!props.isEvaluationSelector) { console.log("Emitting from watch:", { work: newValue }); emit("pickWork", { work: newValue }); }*/ }); const openModal = () => { - showModal.value = true; + showModal.value = true; }; const closeModal = () => { - showModal.value = false; - selectedEvaluation.value = null; - // selectedAcpw.value = null; - emit("closeModal"); + showModal.value = false; + selectedEvaluation.value = null; + // selectedAcpw.value = null; + emit("closeModal"); }; const confirmSelection = () => { selectedAcpw.value = selectedAcpw.value; - console.log("selectedAcpw", selectedAcpw.value); + console.log("selectedAcpw", selectedAcpw.value); - if (!props.isEvaluationSelector) { - if (selectedAcpw.value) { - // only emit if something is actually selected!emit("pickWork", { work: selectedAcpw.value }); - closeModal();} - // optionally show some error or warning if not selected - return; + if (!props.isEvaluationSelector) { + if (selectedAcpw.value) { + // only emit if something is actually selected!emit("pickWork", { work: selectedAcpw.value }); + closeModal(); } + // optionally show some error or warning if not selected + return; + } - if (selectedAcpw.value && props.isEvaluationSelector) { - evaluations.value = - selectedAcpw.value.accompanyingPeriodWorkEvaluations; - } + if (selectedAcpw.value && props.isEvaluationSelector) { + evaluations.value = selectedAcpw.value.accompanyingPeriodWorkEvaluations; + } - if (selectedEvaluation.value && props.isEvaluationSelector) { - // console.log('evaluation log in modal', selectedEvaluation.value) - emit("update:selectedEvaluation", selectedEvaluation.value); - closeModal(); - } + if (selectedEvaluation.value && props.isEvaluationSelector) { + // console.log('evaluation log in modal', selectedEvaluation.value) + emit("update:selectedEvaluation", selectedEvaluation.value); + closeModal(); + } }; diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons.vue index 417ef4b7a..ea4090452 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons.vue @@ -25,7 +25,11 @@ />