chill-bundles/eslint-baseline.json

3338 lines
473 KiB
JSON

[
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/docs/source/development/user-interface/js-functions/show_hide.js",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'event' is defined but never used.",
"line": 12,
"column": 26,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 12,
"endColumn": 31
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'event' is defined but never used.",
"line": 29,
"column": 26,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 29,
"endColumn": 31
}
],
"suppressedMessages": [],
"errorCount": 2,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "import { ShowHide } from \"ShowHide/show_hide.js\";\n\nvar div_accompagnement = document.getElementById(\"form_accompagnement\"),\n div_accompagnement_comment = document.getElementById(\n \"form_accompagnement_comment\",\n ),\n div_caf_id = document.getElementById(\"cafId\"),\n div_caf_inscription_date = document.getElementById(\"cafInscriptionDate\");\n// let show/hide the div_accompagnement_comment if the input with value `'autre'` is checked\nnew ShowHide({\n froms: [div_accompagnement],\n test: function (froms, event) {\n for (let el of froms.values()) {\n for (let input of el.querySelectorAll(\"input\").values()) {\n if (input.value === \"autre\") {\n return input.checked;\n }\n }\n }\n\n return false;\n },\n container: [div_accompagnement_comment],\n});\n\n// let show the date input only if the the id is filled\nnew ShowHide({\n froms: [div_caf_id],\n test: function (froms, event) {\n for (let el of froms.values()) {\n return el.querySelector(\"input\").value !== \"\";\n }\n },\n container: [div_caf_inscription_date],\n // using this option, we use the event `input` instead of `change`\n event_name: \"input\",\n});\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc.vue",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'reject' is defined but never used.",
"line": 136,
"column": 39,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 136,
"endColumn": 45
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'reject' is defined but never used.",
"line": 211,
"column": 47,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 211,
"endColumn": 53
}
],
"suppressedMessages": [],
"errorCount": 2,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "<template>\n <teleport to=\"#social-issues-acc\">\n <div class=\"mb-3 row\">\n <div class=\"col-4\">\n <label :class=\"socialIssuesClassList\">{{\n $t(\"activity.social_issues\")\n }}</label>\n </div>\n <div class=\"col-8\">\n <check-social-issue\n v-for=\"issue in socialIssuesList\"\n :key=\"issue.id\"\n :issue=\"issue\"\n :selection=\"socialIssuesSelected\"\n @update-selected=\"updateIssuesSelected\"\n />\n\n <div class=\"my-3\">\n <VueMultiselect\n name=\"otherIssues\"\n label=\"text\"\n track-by=\"id\"\n open-direction=\"bottom\"\n :close-on-select=\"true\"\n :preserve-search=\"false\"\n :reset-after=\"true\"\n :hide-selected=\"true\"\n :taggable=\"false\"\n :multiple=\"false\"\n :searchable=\"true\"\n :allow-empty=\"true\"\n :show-labels=\"false\"\n :loading=\"issueIsLoading\"\n :placeholder=\"$t('activity.choose_other_social_issue')\"\n :options=\"socialIssuesOther\"\n @select=\"addIssueInList\"\n />\n </div>\n </div>\n </div>\n\n <div class=\"mb-3 row\">\n <div class=\"col-4\">\n <label :class=\"socialActionsClassList\">{{\n $t(\"activity.social_actions\")\n }}</label>\n </div>\n <div class=\"col-8\">\n <div v-if=\"actionIsLoading === true\">\n <i class=\"chill-green fa fa-circle-o-notch fa-spin fa-lg\" />\n </div>\n\n <span\n v-else-if=\"socialIssuesSelected.length === 0\"\n class=\"inline-choice chill-no-data-statement mt-3\"\n >\n {{ $t(\"activity.select_first_a_social_issue\") }}\n </span>\n\n <template v-else-if=\"socialActionsList.length > 0\">\n <div\n v-if=\"\n socialIssuesSelected.length ||\n socialActionsSelected.length\n \"\n >\n <check-social-action\n v-for=\"action in socialActionsList\"\n :key=\"action.id\"\n :action=\"action\"\n :selection=\"socialActionsSelected\"\n @update-selected=\"updateActionsSelected\"\n />\n </div>\n </template>\n\n <span\n v-else-if=\"\n actionAreLoaded && socialActionsList.length === 0\n \"\n class=\"inline-choice chill-no-data-statement mt-3\"\n >\n {{ $t(\"activity.social_action_list_empty\") }}\n </span>\n </div>\n </div>\n </teleport>\n</template>\n\n<script>\nimport VueMultiselect from \"vue-multiselect\";\nimport CheckSocialIssue from \"./SocialIssuesAcc/CheckSocialIssue.vue\";\nimport CheckSocialAction from \"./SocialIssuesAcc/CheckSocialAction.vue\";\nimport { getSocialIssues, getSocialActionByIssue } from \"../api.js\";\n\nexport default {\n name: \"SocialIssuesAcc\",\n components: {\n CheckSocialIssue,\n CheckSocialAction,\n VueMultiselect,\n },\n data() {\n return {\n issueIsLoading: false,\n actionIsLoading: false,\n actionAreLoaded: false,\n socialIssuesClassList: `col-form-label ${document.querySelector(\"input#chill_activitybundle_activity_socialIssues\").getAttribute(\"required\") ? \"required\" : \"\"}`,\n socialActionsClassList: `col-form-label ${document.querySelector(\"input#chill_activitybundle_activity_socialActions\").getAttribute(\"required\") ? \"required\" : \"\"}`,\n };\n },\n computed: {\n socialIssuesList() {\n return this.$store.state.activity.accompanyingPeriod.socialIssues;\n },\n socialIssuesSelected() {\n return this.$store.state.activity.socialIssues;\n },\n socialIssuesOther() {\n return this.$store.state.socialIssuesOther;\n },\n socialActionsList() {\n return this.$store.getters.socialActionsListSorted;\n },\n socialActionsSelected() {\n return this.$store.state.activity.socialActions;\n },\n },\n mounted() {\n /* Load others issues in multiselect\n */\n this.issueIsLoading = true;\n this.actionAreLoaded = false;\n getSocialIssues().then(\n (response) =>\n new Promise((resolve, reject) => {\n this.$store.commit(\"updateIssuesOther\", response.results);\n\n /* Add in list the issues already associated (if not yet listed)\n */\n this.socialIssuesSelected.forEach((issue) => {\n if (\n this.socialIssuesList.filter(\n (i) => i.id === issue.id,\n ).length !== 1\n ) {\n this.$store.commit(\"addIssueInList\", issue);\n }\n }, this);\n\n /* Remove from multiselect the issues that are not yet in checkbox list\n */\n this.socialIssuesList.forEach((issue) => {\n this.$store.commit(\"removeIssueInOther\", issue);\n }, this);\n\n /* Filter issues\n */\n this.$store.commit(\"filterList\", \"issues\");\n\n /* Add in list the actions already associated (if not yet listed)\n */\n this.socialActionsSelected.forEach((action) => {\n this.$store.commit(\"addActionInList\", action);\n }, this);\n\n /* Filter issues\n */\n this.$store.commit(\"filterList\", \"actions\");\n\n this.issueIsLoading = false;\n this.actionAreLoaded = true;\n this.updateActionsList();\n resolve();\n }),\n );\n },\n methods: {\n /* When choosing an issue in multiselect, add it in checkboxes (as selected),\n remove it from multiselect, and add socialActions concerned\n */\n addIssueInList(value) {\n //console.log('addIssueInList', value);\n this.$store.commit(\"addIssueInList\", value);\n this.$store.commit(\"removeIssueInOther\", value);\n this.$store.dispatch(\"addIssueSelected\", value);\n this.updateActionsList();\n },\n /* Update value for selected issues checkboxes\n */\n updateIssuesSelected(issues) {\n //console.log('updateIssuesSelected', issues);\n this.$store.dispatch(\"updateIssuesSelected\", issues);\n this.updateActionsList();\n },\n /* Update value for selected actions checkboxes\n */\n updateActionsSelected(actions) {\n //console.log('updateActionsSelected', actions);\n this.$store.dispatch(\"updateActionsSelected\", actions);\n },\n /* Add socialActions concerned: after reset, loop on each issue selected\n to get social actions concerned\n */\n updateActionsList() {\n this.resetActionsList();\n this.socialIssuesSelected.forEach((item) => {\n this.actionIsLoading = true;\n getSocialActionByIssue(item.id).then(\n (actions) =>\n new Promise((resolve, reject) => {\n actions.results.forEach((action) => {\n this.$store.commit(\"addActionInList\", action);\n }, this);\n\n this.$store.commit(\"filterList\", \"actions\");\n\n this.actionIsLoading = false;\n this.actionAreLoaded = true;\n resolve();\n }),\n );\n }, this);\n },\n /* Reset socialActions List: flush list and restore selected actions\n */\n resetActionsList() {\n this.$store.commit(\"resetActionsList\");\n this.actionAreLoaded = false;\n this.socialActionsSelected.forEach((item) => {\n this.$store.commit(\"addActionInList\", item);\n }, this);\n },\n },\n};\n</script>\n\n<style src=\"vue-multiselect/dist/vue-multiselect.css\"></style>\n<style lang=\"scss\" scoped>\nspan.multiselect__single {\n display: none !important;\n}\n</style>\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/index.js",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'app' is assigned a value but never used.",
"line": 18,
"column": 7,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 18,
"endColumn": 10
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'event' is defined but never used.",
"line": 57,
"column": 23,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 57,
"endColumn": 28
}
],
"suppressedMessages": [],
"errorCount": 2,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "import { createApp } from \"vue\";\nimport { _createI18n } from \"ChillMainAssets/vuejs/_js/i18n\";\nimport { activityMessages } from \"./i18n\";\nimport store from \"./store\";\nimport PickTemplate from \"ChillDocGeneratorAssets/vuejs/_components/PickTemplate.vue\";\nimport { fetchTemplates } from \"ChillDocGeneratorAssets/api/pickTemplate.js\";\n\nimport App from \"./App.vue\";\n\nconst i18n = _createI18n(activityMessages);\n\n// app for activity\n\nconst hasSocialIssues = document.querySelector(\"#social-issues-acc\") !== null;\nconst hasLocation = document.querySelector(\"#location\") !== null;\nconst hasPerson = document.querySelector(\"#add-persons\") !== null;\n\nconst app = createApp({\n template: `<app\n :hasSocialIssues=\"hasSocialIssues\"\n :hasLocation=\"hasLocation\"\n :hasPerson=\"hasPerson\"\n ></app>`,\n data() {\n return {\n hasSocialIssues,\n hasLocation,\n hasPerson,\n };\n },\n})\n .use(store)\n .use(i18n)\n .component(\"app\", App)\n .mount(\"#activity\");\n\n// app for picking template\n\nconst i18nGendoc = _createI18n({});\n\ndocument.querySelectorAll(\"div[data-docgen-template-picker]\").forEach((el) => {\n fetchTemplates(el.dataset.entityClass).then((templates) => {\n const picker = {\n template:\n '<pick-template :templates=\"this.templates\" :preventDefaultMoveToGenerate=\"true\" ' +\n ':entityClass=\"faked\" @go-to-generate-document=\"generateDoc\"></pick-template>',\n components: {\n PickTemplate,\n },\n data() {\n return {\n templates: templates,\n entityId: el.dataset.entityId,\n };\n },\n methods: {\n generateDoc({ event, link, template }) {\n console.log(\"generateDoc\");\n console.log(\"link\", link);\n console.log(\"template\", template);\n\n let hiddenInput = document.querySelector(\"input[data-template-id]\");\n\n if (hiddenInput === null) {\n console.error(\"hidden input not found\");\n return;\n }\n\n hiddenInput.value = template;\n\n let form = document.querySelector(\n 'form[name=\"chill_activitybundle_activity\"',\n );\n\n if (form === null) {\n console.error(\"form not found\");\n return;\n }\n\n form.submit();\n },\n },\n };\n createApp(picker).use(i18nGendoc).mount(el);\n });\n});\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/store.js",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'resources' is assigned a value but never used.",
"line": 90,
"column": 13,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 90,
"endColumn": 22
}
],
"suppressedMessages": [],
"errorCount": 1,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "import \"es6-promise/auto\";\nimport { createStore } from \"vuex\";\nimport { postLocation } from \"./api\";\nimport prepareLocations from \"./store.locations.js\";\n\nconst debug = process.env.NODE_ENV !== \"production\";\n//console.log('window.activity', window.activity);\n\nconst addIdToValue = (string, id) => {\n let array = string ? string.split(\",\") : [];\n array.push(id.toString());\n let str = array.join();\n return str;\n};\n\nconst removeIdFromValue = (string, id) => {\n let array = string.split(\",\");\n array = array.filter((el) => el !== id.toString());\n let str = array.join();\n return str;\n};\n\nconst store = createStore({\n strict: debug,\n state: {\n activity: window.activity,\n socialIssuesOther: [],\n socialActionsList: [],\n availableLocations: [],\n },\n getters: {\n suggestedEntities(state) {\n if (\n typeof state.activity.accompanyingPeriod === \"undefined\" ||\n state.activity.accompanyingPeriod === null\n ) {\n return [];\n }\n const allEntities = [\n ...store.getters.suggestedPersons,\n ...store.getters.suggestedRequestor,\n ...store.getters.suggestedUser,\n ...store.getters.suggestedResources,\n ];\n const uniqueIds = [\n ...new Set(allEntities.map((i) => `${i.type}-${i.id}`)),\n ];\n return Array.from(\n uniqueIds,\n (id) => allEntities.filter((r) => `${r.type}-${r.id}` === id)[0],\n );\n },\n suggestedPersons(state) {\n const existingPersonIds = state.activity.persons.map((p) => p.id);\n return state.activity.activityType.personsVisible === 0\n ? []\n : state.activity.accompanyingPeriod.participations\n .filter((p) => p.endDate === null)\n .map((p) => p.person)\n .filter((p) => !existingPersonIds.includes(p.id));\n },\n suggestedRequestor(state) {\n if (state.activity.accompanyingPeriod.requestor === null) {\n return [];\n }\n const existingPersonIds = state.activity.persons.map((p) => p.id);\n const existingThirdPartyIds = state.activity.thirdParties.map(\n (p) => p.id,\n );\n\n return [state.activity.accompanyingPeriod.requestor].filter(\n (r) =>\n (r.type === \"person\" &&\n !existingPersonIds.includes(r.id) &&\n state.activity.activityType.personsVisible !== 0) ||\n (r.type === \"thirdparty\" &&\n !existingThirdPartyIds.includes(r.id) &&\n state.activity.activityType.thirdPartiesVisible !== 0),\n );\n },\n suggestedUser(state) {\n const existingUserIds = state.activity.users.map((p) => p.id);\n return state.activity.activityType.usersVisible === 0\n ? []\n : [state.activity.accompanyingPeriod.user].filter(\n (u) => u !== null && !existingUserIds.includes(u.id),\n );\n },\n suggestedResources(state) {\n const resources = state.activity.accompanyingPeriod.resources;\n const existingPersonIds = state.activity.persons.map((p) => p.id);\n const existingThirdPartyIds = state.activity.thirdParties.map(\n (p) => p.id,\n );\n return state.activity.accompanyingPeriod.resources\n .map((r) => r.resource)\n .filter(\n (r) =>\n (r.type === \"person\" &&\n !existingPersonIds.includes(r.id) &&\n state.activity.activityType.personsVisible !== 0) ||\n (r.type === \"thirdparty\" &&\n !existingThirdPartyIds.includes(r.id) &&\n state.activity.activityType.thirdPartiesVisible !== 0),\n );\n },\n socialActionsListSorted(state) {\n return [...state.socialActionsList].sort(\n (a, b) => a.ordering - b.ordering,\n );\n },\n },\n mutations: {\n // SocialIssueAcc\n addIssueInList(state, issue) {\n //console.log('add issue list', issue.id);\n state.activity.accompanyingPeriod.socialIssues.push(issue);\n },\n addIssueSelected(state, issue) {\n //console.log('add issue selected', issue.id);\n state.activity.socialIssues.push(issue);\n },\n updateIssuesSelected(state, issues) {\n //console.log('update issues selected', issues);\n state.activity.socialIssues = issues;\n },\n updateIssuesOther(state, payload) {\n //console.log('update issues other');\n state.socialIssuesOther = payload;\n },\n removeIssueInOther(state, issue) {\n //console.log('remove issue other', issue.id);\n state.socialIssuesOther = state.socialIssuesOther.filter(\n (i) => i.id !== issue.id,\n );\n },\n resetActionsList(state) {\n //console.log('reset list actions');\n state.socialActionsList = [];\n },\n addActionInList(state, action) {\n state.socialActionsList.push(action);\n },\n updateActionsSelected(state, actions) {\n //console.log('update actions selected', actions);\n state.activity.socialActions = actions;\n },\n filterList(state, list) {\n const filterList = (list) => {\n // remove duplicates entries\n list = list.filter(\n (value, index) =>\n list.findIndex((array) => array.id === value.id) === index,\n );\n // alpha sort\n list.sort((a, b) => (a.text > b.text ? 1 : b.text > a.text ? -1 : 0));\n return list;\n };\n if (list === \"issues\") {\n state.activity.accompanyingPeriod.socialIssues = filterList(\n state.activity.accompanyingPeriod.socialIssues,\n );\n }\n if (list === \"actions\") {\n state.socialActionsList = filterList(state.socialActionsList);\n }\n },\n\n // ConcernedGroups\n addPersonsInvolved(state, payload) {\n console.log(\"### mutation addPersonsInvolved\", payload);\n switch (payload.result.type) {\n case \"person\":\n state.activity.persons.push(payload.result);\n break;\n case \"thirdparty\":\n state.activity.thirdParties.push(payload.result);\n break;\n case \"user\":\n state.activity.users.push(payload.result);\n break;\n }\n },\n removePersonInvolved(state, payload) {\n //console.log('### mutation removePersonInvolved', payload.type);\n switch (payload.type) {\n case \"person\":\n state.activity.persons = state.activity.persons.filter(\n (person) => person !== payload,\n );\n break;\n case \"thirdparty\":\n state.activity.thirdParties = state.activity.thirdParties.filter(\n (thirdparty) => thirdparty !== payload,\n );\n break;\n case \"user\":\n state.activity.users = state.activity.users.filter(\n (user) => user !== payload,\n );\n break;\n }\n },\n updateLocation(state, value) {\n console.log(\"### mutation: updateLocation\", value);\n state.activity.location = value;\n },\n addAvailableLocationGroup(state, group) {\n state.availableLocations.push(group);\n },\n },\n actions: {\n addIssueSelected({ commit }, issue) {\n let aSocialIssues = document.getElementById(\n \"chill_activitybundle_activity_socialIssues\",\n );\n aSocialIssues.value = addIdToValue(aSocialIssues.value, issue.id);\n commit(\"addIssueSelected\", issue);\n },\n updateIssuesSelected({ commit }, payload) {\n let aSocialIssues = document.getElementById(\n \"chill_activitybundle_activity_socialIssues\",\n );\n aSocialIssues.value = \"\";\n payload.forEach((item) => {\n aSocialIssues.value = addIdToValue(aSocialIssues.value, item.id);\n });\n commit(\"updateIssuesSelected\", payload);\n },\n updateActionsSelected({ commit }, payload) {\n let aSocialActions = document.getElementById(\n \"chill_activitybundle_activity_socialActions\",\n );\n aSocialActions.value = \"\";\n payload.forEach((item) => {\n aSocialActions.value = addIdToValue(aSocialActions.value, item.id);\n });\n commit(\"updateActionsSelected\", payload);\n },\n addAvailableLocationGroup({ commit }, payload) {\n commit(\"addAvailableLocationGroup\", payload);\n },\n addPersonsInvolved({ commit }, payload) {\n //console.log('### action addPersonsInvolved', payload.result.type);\n switch (payload.result.type) {\n case \"person\":\n let aPersons = document.getElementById(\n \"chill_activitybundle_activity_persons\",\n );\n aPersons.value = addIdToValue(aPersons.value, payload.result.id);\n break;\n case \"thirdparty\":\n let aThirdParties = document.getElementById(\n \"chill_activitybundle_activity_thirdParties\",\n );\n aThirdParties.value = addIdToValue(\n aThirdParties.value,\n payload.result.id,\n );\n break;\n case \"user\":\n let aUsers = document.getElementById(\n \"chill_activitybundle_activity_users\",\n );\n aUsers.value = addIdToValue(aUsers.value, payload.result.id);\n break;\n }\n commit(\"addPersonsInvolved\", payload);\n },\n removePersonInvolved({ commit }, payload) {\n //console.log('### action removePersonInvolved', payload);\n switch (payload.type) {\n case \"person\":\n let aPersons = document.getElementById(\n \"chill_activitybundle_activity_persons\",\n );\n aPersons.value = removeIdFromValue(aPersons.value, payload.id);\n break;\n case \"thirdparty\":\n let aThirdParties = document.getElementById(\n \"chill_activitybundle_activity_thirdParties\",\n );\n aThirdParties.value = removeIdFromValue(\n aThirdParties.value,\n payload.id,\n );\n break;\n case \"user\":\n let aUsers = document.getElementById(\n \"chill_activitybundle_activity_users\",\n );\n aUsers.value = removeIdFromValue(aUsers.value, payload.id);\n break;\n }\n commit(\"removePersonInvolved\", payload);\n },\n updateLocation({ commit }, value) {\n console.log(\"### action: updateLocation\", value);\n let hiddenLocation = document.getElementById(\n \"chill_activitybundle_activity_location\",\n );\n if (value.onthefly) {\n const body = {\n type: \"location\",\n name:\n value.name === \"__AccompanyingCourseLocation__\" ? null : value.name,\n locationType: {\n id: value.locationType.id,\n type: \"location-type\",\n },\n };\n if (value.address.id) {\n Object.assign(body, {\n address: {\n id: value.address.id,\n },\n });\n }\n postLocation(body)\n .then((location) => (hiddenLocation.value = location.id))\n .catch((err) => {\n console.log(err.message);\n });\n } else {\n hiddenLocation.value = value.id;\n }\n commit(\"updateLocation\", value);\n },\n },\n});\n\nprepareLocations(store);\n\nexport default store;\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillCalendarBundle/Resources/public/module/Invite/answer.js",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'e' is defined but never used.",
"line": 7,
"column": 57,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 7,
"endColumn": 58
}
],
"suppressedMessages": [],
"errorCount": 1,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "import { createApp } from \"vue\";\nimport Answer from \"ChillCalendarAssets/vuejs/Invite/Answer\";\nimport { _createI18n } from \"ChillMainAssets/vuejs/_js/i18n\";\n\nconst i18n = _createI18n({});\n\ndocument.addEventListener(\"DOMContentLoaded\", function (e) {\n console.log(\"dom loaded answer\");\n document.querySelectorAll(\"div[invite-answer]\").forEach(function (el) {\n console.log(\"element found\", el);\n\n const app = createApp({\n components: {\n Answer,\n },\n data() {\n return {\n status: el.dataset.status,\n calendarId: Number.parseInt(el.dataset.calendarId),\n };\n },\n template:\n '<answer :calendarId=\"calendarId\" :status=\"status\" @statusChanged=\"onStatusChanged\"></answer>',\n methods: {\n onStatusChanged: function (newStatus) {\n this.$data.status = newStatus;\n },\n },\n });\n\n app.use(i18n).mount(el);\n });\n});\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillCalendarBundle/Resources/public/vuejs/Calendar/Components/CalendarActive.vue",
"messages": [
{
"ruleId": "vue/valid-v-else",
"severity": 2,
"message": "'v-else' directives require no attribute value.",
"line": 19,
"column": 30,
"nodeType": "VExpressionContainer",
"messageId": "unexpectedValue",
"endLine": 19,
"endColumn": 32
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'mapGetters' is defined but never used.",
"line": 54,
"column": 10,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 54,
"endColumn": 20
}
],
"suppressedMessages": [],
"errorCount": 2,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "<template>\n <div :style=\"style\" class=\"calendar-active\">\n <span class=\"badge-user\">\n {{ user.text }}\n <template v-if=\"invite !== null\">\n <i v-if=\"invite.status === 'accepted'\" class=\"fa fa-check\" />\n <i\n v-else-if=\"invite.status === 'declined'\"\n class=\"fa fa-times\"\n />\n <i\n v-else-if=\"invite.status === 'pending'\"\n class=\"fa fa-question-o\"\n />\n <i\n v-else-if=\"invite.status === 'tentative'\"\n class=\"fa fa-question\"\n />\n <span v-else=\"\">{{ invite.status }}</span>\n </template>\n </span>\n <span class=\"form-check-inline form-switch\">\n <input\n class=\"form-check-input\"\n type=\"checkbox\"\n id=\"flexSwitchCheckDefault\"\n v-model=\"rangeShow\"\n />\n &nbsp;<label\n class=\"form-check-label\"\n for=\"flexSwitchCheckDefault\"\n title=\"Disponibilités\"\n ><i class=\"fa fa-calendar-check-o\"\n /></label>\n </span>\n <span class=\"form-check-inline form-switch\">\n <input\n class=\"form-check-input\"\n type=\"checkbox\"\n id=\"flexSwitchCheckDefault\"\n v-model=\"remoteShow\"\n />\n &nbsp;<label\n class=\"form-check-label\"\n for=\"flexSwitchCheckDefault\"\n title=\"Agenda\"\n ><i class=\"fa fa-calendar\"\n /></label>\n </span>\n </div>\n</template>\n\n<script>\nimport { mapGetters } from \"vuex\";\n\nexport default {\n name: \"CalendarActive\",\n props: {\n user: {\n type: Object,\n required: true,\n },\n invite: {\n type: Object,\n required: false,\n default: null,\n },\n },\n computed: {\n style() {\n return {\n backgroundColor: this.$store.getters.getUserData(this.user)\n .mainColor,\n };\n },\n rangeShow: {\n set(value) {\n this.$store.commit(\"showUserOnCalendar\", {\n user: this.user,\n ranges: value,\n });\n },\n get() {\n return this.$store.getters.isRangeShownOnCalendarForUser(\n this.user,\n );\n },\n },\n remoteShow: {\n set(value) {\n this.$store.commit(\"showUserOnCalendar\", {\n user: this.user,\n remotes: value,\n });\n },\n get() {\n return this.$store.getters.isRemoteShownOnCalendarForUser(\n this.user,\n );\n },\n },\n },\n};\n</script>\n\n<style scoped lang=\"scss\">\n.calendar-active {\n margin: 0 0.25rem 0.25rem 0;\n padding: 0.5rem;\n\n border-radius: 0.5rem;\n\n color: var(--bs-blue);\n\n & > .badge-user {\n margin-right: 0.5rem;\n }\n}\n</style>\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillCalendarBundle/Resources/public/vuejs/Calendar/index.js",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'app' is assigned a value but never used.",
"line": 10,
"column": 7,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 10,
"endColumn": 10
}
],
"suppressedMessages": [],
"errorCount": 1,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "import { createApp } from \"vue\";\nimport { _createI18n } from \"ChillMainAssets/vuejs/_js/i18n\";\nimport { appMessages } from \"./i18n\";\nimport store from \"./store\";\n\nimport App from \"./App.vue\";\n\nconst i18n = _createI18n(appMessages);\n\nconst app = createApp({\n template: `<app></app>`,\n})\n .use(store)\n .use(i18n)\n .component(\"app\", App)\n .mount(\"#calendar\");\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillCalendarBundle/Resources/public/vuejs/Calendar/store/actions.js",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'getters' is defined but never used.",
"line": 29,
"column": 32,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 29,
"endColumn": 39
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'state' is defined but never used.",
"line": 238,
"column": 35,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 238,
"endColumn": 40
}
],
"suppressedMessages": [],
"errorCount": 2,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "import { addIdToValue, removeIdFromValue } from \"./utils\";\nimport {\n fetchCalendarRangeForUser,\n fetchCalendarRemoteForUser,\n fetchCalendarLocalForUser,\n} from \"./../api\";\nimport { datetimeToISO } from \"ChillMainAssets/chill/js/date\";\nimport { postLocation } from \"ChillActivityAssets/vuejs/Activity/api\";\n\n/**\n * This will store a unique key for each value, and prevent to launch the same\n * request multiple times, when fetching user calendars.\n *\n * Actually, each time a user is added or removed, the methods \"dateSet\" is executed and this\n * sparkle a request by user to get the calendar data. When the calendar data is fetched, it is\n * immediatly added to the calendar which, in turn , launch the event dateSet and re-launch fetch\n * queries which has not yet ended. Storing the queries already executed prevent this loop.\n *\n * @type {Set<String>}\n */\nconst fetchings = new Set();\n\nexport default {\n setCurrentDatesView({ commit, dispatch }, { start, end }) {\n commit(\"setCurrentDatesView\", { start, end });\n\n return dispatch(\"fetchCalendarEvents\");\n },\n fetchCalendarEvents({ state, getters, dispatch }) {\n if (state.currentView.start === null && state.currentView.end === null) {\n return Promise.resolve();\n }\n\n let promises = [];\n for (const uid of state.currentView.users.keys()) {\n let unique = `${uid}, ${state.currentView.start.toISOString()}, ${state.currentView.end.toISOString()}`;\n\n if (fetchings.has(unique)) {\n console.log(\"prevent from fetching for a user\", unique);\n continue;\n }\n\n fetchings.add(unique);\n\n promises.push(\n dispatch(\"fetchCalendarRangeForUser\", {\n user: state.usersData.get(uid).user,\n start: state.currentView.start,\n end: state.currentView.end,\n }),\n );\n promises.push(\n dispatch(\"fetchCalendarRemotesForUser\", {\n user: state.usersData.get(uid).user,\n start: state.currentView.start,\n end: state.currentView.end,\n }),\n );\n promises.push(\n dispatch(\"fetchCalendarLocalsForUser\", {\n user: state.usersData.get(uid).user,\n start: state.currentView.start,\n end: state.currentView.end,\n }),\n );\n }\n\n return Promise.all(promises);\n },\n fetchCalendarRangeForUser({ commit, getters }, { user, start, end }) {\n if (!getters.isCalendarRangeLoadedForUser({ user, start, end })) {\n return fetchCalendarRangeForUser(user, start, end).then((ranges) => {\n commit(\"addCalendarRangesForUser\", { user, ranges, start, end });\n\n return Promise.resolve();\n });\n }\n },\n fetchCalendarRemotesForUser({ commit, getters }, { user, start, end }) {\n if (!getters.isCalendarRemoteLoadedForUser({ user, start, end })) {\n return fetchCalendarRemoteForUser(user, start, end).then((remotes) => {\n commit(\"addCalendarRemotesForUser\", { user, remotes, start, end });\n\n return Promise.resolve();\n });\n }\n },\n fetchCalendarLocalsForUser({ commit, getters }, { user, start, end }) {\n if (!getters.isCalendarRemoteLoadedForUser({ user, start, end })) {\n return fetchCalendarLocalForUser(user, start, end).then((locals) => {\n commit(\"addCalendarLocalsForUser\", { user, locals, start, end });\n\n return Promise.resolve();\n });\n }\n },\n addPersonsInvolved({ commit, dispatch }, payload) {\n console.log(\"### action addPersonsInvolved\", payload.result.type);\n console.log(\"### action addPersonsInvolved payload result\", payload.result);\n switch (payload.result.type) {\n case \"person\":\n let aPersons = document.getElementById(\n \"chill_activitybundle_activity_persons\",\n );\n aPersons.value = addIdToValue(aPersons.value, payload.result.id);\n break;\n case \"thirdparty\":\n let aThirdParties = document.getElementById(\n \"chill_activitybundle_activity_professionals\",\n );\n aThirdParties.value = addIdToValue(\n aThirdParties.value,\n payload.result.id,\n );\n break;\n case \"user\":\n let aUsers = document.getElementById(\n \"chill_activitybundle_activity_users\",\n );\n aUsers.value = addIdToValue(aUsers.value, payload.result.id);\n commit(\"showUserOnCalendar\", {\n user: payload.result,\n ranges: false,\n remotes: true,\n });\n dispatch(\"fetchCalendarEvents\");\n break;\n }\n commit(\"addPersonsInvolved\", payload);\n },\n removePersonInvolved({ commit }, payload) {\n //console.log('### action removePersonInvolved', payload);\n switch (payload.type) {\n case \"person\":\n let aPersons = document.getElementById(\n \"chill_activitybundle_activity_persons\",\n );\n aPersons.value = removeIdFromValue(aPersons.value, payload.id);\n break;\n case \"thirdparty\":\n let aThirdParties = document.getElementById(\n \"chill_activitybundle_activity_professionals\",\n );\n aThirdParties.value = removeIdFromValue(\n aThirdParties.value,\n payload.id,\n );\n break;\n case \"user\":\n let aUsers = document.getElementById(\n \"chill_activitybundle_activity_users\",\n );\n aUsers.value = removeIdFromValue(aUsers.value, payload.id);\n break;\n }\n commit(\"removePersonInvolved\", payload);\n },\n\n // Calendar\n /**\n * set event startDate and endDate.\n *\n * if the mainUser is different from \"me\", it will replace the mainUser\n *\n * @param commit\n * @param state\n * @param getters\n * @param start\n * @param end\n */\n setEventTimes({ commit, state, getters }, { start, end }) {\n console.log(\"### action createEvent\", { start, end });\n let startDateInput = document.getElementById(\n \"chill_activitybundle_activity_startDate\",\n );\n startDateInput.value = null !== start ? datetimeToISO(start) : \"\";\n let endDateInput = document.getElementById(\n \"chill_activitybundle_activity_endDate\",\n );\n endDateInput.value = null !== end ? datetimeToISO(end) : \"\";\n let calendarRangeInput = document.getElementById(\n \"chill_activitybundle_activity_calendarRange\",\n );\n calendarRangeInput.value = \"\";\n\n if (\n getters.getMainUser === null ||\n getters.getMainUser.id !== state.me.id\n ) {\n let mainUserInput = document.getElementById(\n \"chill_activitybundle_activity_mainUser\",\n );\n mainUserInput.value = state.me.id;\n commit(\"setMainUser\", state.me);\n }\n\n commit(\"setEventTimes\", { start, end });\n },\n associateCalendarToRange({ state, commit, dispatch, getters }, { range }) {\n console.log(\"### action associateCAlendarToRange\", range);\n let startDateInput = document.getElementById(\n \"chill_activitybundle_activity_startDate\",\n );\n startDateInput.value = null !== range ? datetimeToISO(range.start) : \"\";\n let endDateInput = document.getElementById(\n \"chill_activitybundle_activity_endDate\",\n );\n endDateInput.value = null !== range ? datetimeToISO(range.end) : \"\";\n let calendarRangeInput = document.getElementById(\n \"chill_activitybundle_activity_calendarRange\",\n );\n calendarRangeInput.value =\n null !== range ? Number(range.extendedProps.calendarRangeId) : \"\";\n\n if (null !== range) {\n let location = getters.getLocationById(range.extendedProps.locationId);\n\n if (null === location) {\n console.error(\"location not found!\", range.extendedProps.locationId);\n }\n\n dispatch(\"updateLocation\", location);\n\n const userId = range.extendedProps.userId;\n if (\n state.activity.mainUser !== null &&\n state.activity.mainUser.id !== userId\n ) {\n dispatch(\"setMainUser\", state.usersData.get(userId).user);\n\n // TODO: remove persons involved with this user\n }\n }\n\n commit(\"associateCalendarToRange\", { range });\n return Promise.resolve();\n },\n setMainUser({ commit, dispatch, state }, mainUser) {\n console.log(\"setMainUser\", mainUser);\n\n let mainUserInput = document.getElementById(\n \"chill_activitybundle_activity_mainUser\",\n );\n mainUserInput.value = Number(mainUser.id);\n\n return dispatch(\"associateCalendarToRange\", { range: null }).then(() => {\n commit(\"setMainUser\", mainUser);\n\n return dispatch(\"fetchCalendarEvents\");\n });\n },\n\n // Location\n updateLocation({ commit }, value) {\n console.log(\"### action: updateLocation\", value);\n let hiddenLocation = document.getElementById(\n \"chill_activitybundle_activity_location\",\n );\n if (value.onthefly) {\n const body = {\n type: \"location\",\n name:\n value.name === \"__AccompanyingCourseLocation__\" ? null : value.name,\n locationType: {\n id: value.locationType.id,\n type: \"location-type\",\n },\n };\n if (value.address.id) {\n Object.assign(body, {\n address: {\n id: value.address.id,\n },\n });\n }\n postLocation(body)\n .then((location) => (hiddenLocation.value = location.id))\n .catch((err) => {\n console.log(err.message);\n });\n } else {\n hiddenLocation.value = value.id;\n }\n commit(\"updateLocation\", value);\n },\n};\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillCalendarBundle/Resources/public/vuejs/Calendar/store/getters.js",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'getters' is defined but never used.",
"line": 30,
"column": 26,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 30,
"endColumn": 33
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'resources' is assigned a value but never used.",
"line": 279,
"column": 11,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 279,
"endColumn": 20
}
],
"suppressedMessages": [],
"errorCount": 2,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "export default {\n /**\n * get the main user of the event/Calendar\n *\n * @param state\n * @returns {*|null}\n */\n getMainUser(state) {\n return state.activity.mainUser || null;\n },\n /**\n * return the date of the event/Calendar\n *\n * @param state\n * @returns {Date}\n */\n getEventDate(state) {\n if (null === state.activity.start) {\n return new Date();\n }\n throw \"transform date to object ?\";\n },\n /**\n * Compute the event sources to show on the FullCalendar\n *\n * @param state\n * @param getters\n * @returns {[]}\n */\n getEventSources(state, getters) {\n let sources = [];\n\n // current calendar\n if (state.activity.startDate !== null && state.activity.endDate !== null) {\n const s = {\n id: \"current\",\n events: [\n {\n title: \"Rendez-vous\",\n start: state.activity.startDate,\n end: state.activity.endDate,\n allDay: false,\n is: \"current\",\n classNames: [\"iscurrent\"],\n },\n ],\n editable: state.activity.calendarRange === null,\n };\n\n sources.push(s);\n }\n\n for (const [userId, kinds] of state.currentView.users.entries()) {\n if (!state.usersData.has(userId)) {\n console.log(\"try to get events on a user which not exists\", userId);\n continue;\n }\n\n const userData = state.usersData.get(userId);\n\n if (kinds.ranges && userData.calendarRanges.length > 0) {\n const s = {\n id: `ranges_${userId}`,\n events: userData.calendarRanges.filter(\n (r) =>\n state.activity.calendarRange === null ||\n r.calendarRangeId !==\n state.activity.calendarRange.calendarRangeId,\n ),\n color: userData.mainColor,\n classNames: [\"isrange\"],\n backgroundColor: \"white\",\n textColor: \"black\",\n editable: false,\n };\n\n sources.push(s);\n }\n\n if (kinds.remotes && userData.remotes.length > 0) {\n const s = {\n id: `remote_${userId}`,\n events: userData.remotes,\n color: userData.mainColor,\n textColor: \"black\",\n editable: false,\n };\n\n sources.push(s);\n }\n\n // if remotes is checked, we display also the locals calendars\n if (kinds.remotes && userData.locals.length > 0) {\n const s = {\n id: `local_${userId}`,\n events: userData.locals.filter(\n (l) => l.originId !== state.activity.id,\n ),\n color: userData.mainColor,\n textColor: \"black\",\n editable: false,\n };\n\n sources.push(s);\n }\n }\n\n return sources;\n },\n getInitialDate(state) {\n return state.activity.startDate;\n },\n getInviteForUser: (state) => (user) => {\n return state.activity.invites.find((i) => i.user.id === user.id);\n },\n /**\n * get the user data for a specific user\n *\n * @param state\n * @returns {function(*): unknown}\n */\n getUserData: (state) => (user) => {\n return state.usersData.get(user.id);\n },\n getUserDataById: (state) => (userId) => {\n return state.usersData.get(userId);\n },\n /**\n * return true if the user has an entry in userData\n *\n * @param state\n * @returns {function(*): boolean}\n */\n hasUserData: (state) => (user) => {\n return state.usersData.has(user.id);\n },\n hasUserDataById: (state) => (userId) => {\n return state.usersData.has(userId);\n },\n /**\n * return true if there was a fetch query for event between this date (start and end),\n * those date are included.\n *\n * @param state\n * @param getters\n * @returns {(function({user: *, start: *, end: *}): (boolean))|*}\n */\n isCalendarRangeLoadedForUser:\n (state, getters) =>\n ({ user, start, end }) => {\n if (!getters.hasUserData(user)) {\n return false;\n }\n\n for (let interval of getters.getUserData(user).calendarRangesLoaded) {\n if (start >= interval.start && end <= interval.end) {\n return true;\n }\n }\n\n return false;\n },\n /**\n * return true if there was a fetch query for event between this date (start and end),\n * those date are included.\n *\n * @param state\n * @param getters\n * @returns {(function({user: *, start: *, end: *}): (boolean))|*}\n */\n isCalendarRemoteLoadedForUser:\n (state, getters) =>\n ({ user, start, end }) => {\n if (!getters.hasUserData(user)) {\n return false;\n }\n\n for (let interval of getters.getUserData(user).remotesLoaded) {\n if (start >= interval.start && end <= interval.end) {\n return true;\n }\n }\n\n return false;\n },\n /**\n * return true if the user ranges are shown on calendar\n *\n * @param state\n * @returns boolean\n */\n isRangeShownOnCalendarForUser: (state) => (user) => {\n const k = state.currentView.users.get(user.id);\n if (typeof k === \"undefined\") {\n console.error(\n \"try to determinate if calendar range is shown and user is not in currentView\",\n );\n return false;\n }\n\n return k.ranges;\n },\n\n /**\n * return true if the user remote is shown on calendar\n * @param state\n * @returns boolean\n */\n isRemoteShownOnCalendarForUser: (state) => (user) => {\n const k = state.currentView.users.get(user.id);\n if (typeof k === \"undefined\") {\n console.error(\n \"try to determinate if calendar range is shown and user is not in currentView\",\n );\n return false;\n }\n\n return k.remotes;\n },\n\n getLocationById: (state) => (id) => {\n for (let group of state.availableLocations) {\n console.log(\"group\", group);\n const found = group.locations.find((l) => l.id === id);\n if (typeof found !== \"undefined\") {\n return found;\n }\n }\n\n return null;\n },\n\n suggestedEntities(state, getters) {\n if (typeof state.activity.accompanyingPeriod === \"undefined\") {\n return [];\n }\n const allEntities = [\n ...getters.suggestedPersons,\n ...getters.suggestedRequestor,\n ...getters.suggestedUser,\n ...getters.suggestedResources,\n ];\n const uniqueIds = [...new Set(allEntities.map((i) => `${i.type}-${i.id}`))];\n return Array.from(\n uniqueIds,\n (id) => allEntities.filter((r) => `${r.type}-${r.id}` === id)[0],\n );\n },\n suggestedPersons(state) {\n const existingPersonIds = state.activity.persons.map((p) => p.id);\n return state.activity.accompanyingPeriod.participations\n .filter((p) => p.endDate === null)\n .map((p) => p.person)\n .filter((p) => !existingPersonIds.includes(p.id));\n },\n suggestedRequestor(state) {\n if (state.activity.accompanyingPeriod.requestor === null) {\n return [];\n }\n\n const existingPersonIds = state.activity.persons.map((p) => p.id);\n const existingThirdPartyIds = state.activity.thirdParties.map((p) => p.id);\n return [state.activity.accompanyingPeriod.requestor].filter(\n (r) =>\n (r.type === \"person\" && !existingPersonIds.includes(r.id)) ||\n (r.type === \"thirdparty\" && !existingThirdPartyIds.includes(r.id)),\n );\n },\n suggestedUser(state) {\n if (null === state.activity.users) {\n return [];\n }\n const existingUserIds = state.activity.users.map((p) => p.id);\n return [state.activity.accompanyingPeriod.user].filter(\n (u) => u !== null && !existingUserIds.includes(u.id),\n );\n },\n suggestedResources(state) {\n const resources = state.activity.accompanyingPeriod.resources;\n const existingPersonIds = state.activity.persons.map((p) => p.id);\n const existingThirdPartyIds = state.activity.thirdParties.map((p) => p.id);\n return state.activity.accompanyingPeriod.resources\n .map((r) => r.resource)\n .filter(\n (r) =>\n (r.type === \"person\" && !existingPersonIds.includes(r.id)) ||\n (r.type === \"thirdparty\" && !existingThirdPartyIds.includes(r.id)),\n );\n },\n};\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillCalendarBundle/Resources/public/vuejs/Calendar/store/index.js",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'postLocation' is defined but never used.",
"line": 3,
"column": 10,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 3,
"endColumn": 22
}
],
"suppressedMessages": [],
"errorCount": 1,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "import \"es6-promise/auto\";\nimport { createStore } from \"vuex\";\nimport { postLocation } from \"ChillActivityAssets/vuejs/Activity/api\";\nimport getters from \"./getters\";\nimport actions from \"./actions\";\nimport mutations from \"./mutations\";\nimport { mapEntity } from \"./utils\";\nimport { whoami } from \"../api\";\nimport prepareLocations from \"ChillActivityAssets/vuejs/Activity/store.locations\";\n\nconst debug = process.env.NODE_ENV !== \"production\";\n\nconst store = createStore({\n strict: debug,\n state: {\n activity: mapEntity(window.entity), // activity is the calendar entity actually\n currentEvent: null,\n availableLocations: [],\n /**\n * the current user\n */\n me: null,\n /**\n * store information about current view\n */\n currentView: {\n start: null,\n end: null,\n users: new Map(),\n },\n /**\n * store a list of existing event, to avoid storing them twice\n */\n existingEvents: new Set(),\n /**\n * store user data\n */\n usersData: new Map(),\n },\n getters,\n mutations,\n actions,\n});\n\nwhoami().then((me) => {\n store.commit(\"setWhoAmiI\", me);\n});\n\nif (null !== store.getters.getMainUser) {\n store.commit(\"showUserOnCalendar\", {\n ranges: true,\n remotes: true,\n user: store.getters.getMainUser,\n });\n}\n\nfor (let u of store.state.activity.users) {\n store.commit(\"showUserOnCalendar\", {\n ranges: false,\n remotes: false,\n user: u,\n });\n}\n\nprepareLocations(store);\n\nexport default store;\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillCalendarBundle/Resources/public/vuejs/Invite/Answer.vue",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'payload' is defined but never used.",
"line": 95,
"column": 13,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 95,
"endColumn": 20
}
],
"suppressedMessages": [],
"errorCount": 1,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "<template>\n <div class=\"btn-group\" role=\"group\">\n <button\n id=\"btnGroupDrop1\"\n type=\"button\"\n class=\"btn btn-misc dropdown-toggle\"\n data-bs-toggle=\"dropdown\"\n aria-expanded=\"false\"\n >\n <template v-if=\"status === Statuses.PENDING\">\n <span class=\"fa fa-hourglass\"></span> {{ $t(\"Give_an_answer\") }}\n </template>\n <template v-else-if=\"status === Statuses.ACCEPTED\">\n <span class=\"fa fa-check\"></span> {{ $t(\"Accepted\") }}\n </template>\n <template v-else-if=\"status === Statuses.DECLINED\">\n <span class=\"fa fa-times\"></span> {{ $t(\"Declined\") }}\n </template>\n <template v-else-if=\"status === Statuses.TENTATIVELY_ACCEPTED\">\n <span class=\"fa fa-question\"></span> {{ $t(\"Tentative\") }}\n </template>\n </button>\n <ul class=\"dropdown-menu\" aria-labelledby=\"btnGroupDrop1\">\n <li v-if=\"status !== Statuses.ACCEPTED\">\n <a\n class=\"dropdown-item\"\n @click=\"changeStatus(Statuses.ACCEPTED)\"\n ><i class=\"fa fa-check\" aria-hidden=\"true\"></i>\n {{ $t(\"Accept\") }}</a\n >\n </li>\n <li v-if=\"status !== Statuses.DECLINED\">\n <a\n class=\"dropdown-item\"\n @click=\"changeStatus(Statuses.DECLINED)\"\n ><i class=\"fa fa-times\" aria-hidden=\"true\"></i>\n {{ $t(\"Decline\") }}</a\n >\n </li>\n <li v-if=\"status !== Statuses.TENTATIVELY_ACCEPTED\">\n <a\n class=\"dropdown-item\"\n @click=\"changeStatus(Statuses.TENTATIVELY_ACCEPTED)\"\n ><i class=\"fa fa-question\"></i>\n {{ $t(\"Tentatively_accept\") }}</a\n >\n </li>\n <li v-if=\"status !== Statuses.PENDING\">\n <a class=\"dropdown-item\" @click=\"changeStatus(Statuses.PENDING)\"\n ><i class=\"fa fa-hourglass-o\"></i>\n {{ $t(\"Set_pending\") }}</a\n >\n </li>\n </ul>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, PropType } from \"vue\";\n\nconst ACCEPTED = \"accepted\";\nconst DECLINED = \"declined\";\nconst PENDING = \"pending\";\nconst TENTATIVELY_ACCEPTED = \"tentative\";\n\nconst i18n = {\n messages: {\n fr: {\n Give_an_answer: \"Répondre\",\n Accepted: \"Accepté\",\n Declined: \"Refusé\",\n Tentative: \"Accepté provisoirement\",\n Accept: \"Accepter\",\n Decline: \"Refuser\",\n Tentatively_accept: \"Accepter provisoirement\",\n Set_pending: \"Ne pas répondre\",\n },\n },\n};\n\nexport default defineComponent({\n name: \"Answer\",\n i18n,\n props: {\n calendarId: { type: Number, required: true },\n status: {\n type: String as PropType<\n \"accepted\" | \"declined\" | \"pending\" | \"tentative\"\n >,\n required: true,\n },\n },\n emits: {\n statusChanged(\n payload: \"accepted\" | \"declined\" | \"pending\" | \"tentative\",\n ) {\n return true;\n },\n },\n data() {\n return {\n Statuses: {\n ACCEPTED,\n DECLINED,\n PENDING,\n TENTATIVELY_ACCEPTED,\n },\n };\n },\n methods: {\n changeStatus: function (\n newStatus: \"accepted\" | \"declined\" | \"pending\" | \"tentative\",\n ) {\n console.log(\"changeStatus\", newStatus);\n const url = `/api/1.0/calendar/calendar/${this.$props.calendarId}/answer/${newStatus}.json`;\n window\n .fetch(url, {\n method: \"POST\",\n })\n .then((r: Response) => {\n if (!r.ok) {\n console.error(\"could not confirm answer\", newStatus);\n return;\n }\n console.log(\"answer sent\", newStatus);\n this.$emit(\"statusChanged\", newStatus);\n });\n },\n },\n});\n</script>\n\n<style scoped></style>\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillCalendarBundle/Resources/public/vuejs/MyCalendarRange/App2.vue",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'reactive' is defined but never used.",
"line": 224,
"column": 10,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 224,
"endColumn": 18
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'DropArg' is defined but never used.",
"line": 230,
"column": 5,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 230,
"endColumn": 12
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'t' is assigned a value but never used.",
"line": 251,
"column": 9,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 251,
"endColumn": 10
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'arg' is defined but never used.",
"line": 356,
"column": 32,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 356,
"endColumn": 35
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'changedEvent' is assigned a value but never used.",
"line": 434,
"column": 11,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 434,
"endColumn": 23
},
{
"ruleId": "@typescript-eslint/ban-ts-comment",
"severity": 2,
"message": "Use \"@ts-expect-error\" instead of \"@ts-ignore\", as \"@ts-ignore\" will do nothing if the following line is error-free.",
"line": 444,
"column": 5,
"nodeType": "Line",
"messageId": "tsIgnoreInsteadOfExpectError",
"endLine": 444,
"endColumn": 72,
"suggestions": [
{
"messageId": "replaceTsIgnoreWithTsExpectError",
"fix": {
"range": [
15044,
15111
],
"text": "// @ts-expect-error TS does not recognize the target. But it does exists."
},
"desc": "Replace \"@ts-ignore\" with \"@ts-expect-error\"."
}
]
}
],
"suppressedMessages": [],
"errorCount": 6,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "<template>\n <div class=\"row\">\n <div class=\"col-sm\">\n <label class=\"form-label\">{{ $t(\"created_availabilities\") }}</label>\n <vue-multiselect\n v-model=\"pickedLocation\"\n :options=\"locations\"\n :label=\"'name'\"\n :track-by=\"'id'\"\n :selectLabel=\"'Presser \\'Entrée\\' pour choisir'\"\n :selectedLabel=\"'Choisir'\"\n :deselectLabel=\"'Presser \\'Entrée\\' pour enlever'\"\n :placeholder=\"'Choisir'\"\n ></vue-multiselect>\n </div>\n </div>\n <div\n class=\"display-options row justify-content-between\"\n style=\"margin-top: 1rem\"\n >\n <div class=\"col-sm-9 col-xs-12\">\n <div class=\"input-group mb-3\">\n <label class=\"input-group-text\" for=\"slotDuration\"\n >Durée des créneaux</label\n >\n <select\n v-model=\"slotDuration\"\n id=\"slotDuration\"\n class=\"form-select\"\n >\n <option value=\"00:05:00\">5 minutes</option>\n <option value=\"00:10:00\">10 minutes</option>\n <option value=\"00:15:00\">15 minutes</option>\n <option value=\"00:30:00\">30 minutes</option>\n </select>\n <label class=\"input-group-text\" for=\"slotMinTime\">De</label>\n <select\n v-model=\"slotMinTime\"\n id=\"slotMinTime\"\n class=\"form-select\"\n >\n <option value=\"00:00:00\">0h</option>\n <option value=\"01:00:00\">1h</option>\n <option value=\"02:00:00\">2h</option>\n <option value=\"03:00:00\">3h</option>\n <option value=\"04:00:00\">4h</option>\n <option value=\"05:00:00\">5h</option>\n <option value=\"06:00:00\">6h</option>\n <option value=\"07:00:00\">7h</option>\n <option value=\"08:00:00\">8h</option>\n <option value=\"09:00:00\">9h</option>\n <option value=\"10:00:00\">10h</option>\n <option value=\"11:00:00\">11h</option>\n <option value=\"12:00:00\">12h</option>\n </select>\n <label class=\"input-group-text\" for=\"slotMaxTime\">À</label>\n <select\n v-model=\"slotMaxTime\"\n id=\"slotMaxTime\"\n class=\"form-select\"\n >\n <option value=\"12:00:00\">12h</option>\n <option value=\"13:00:00\">13h</option>\n <option value=\"14:00:00\">14h</option>\n <option value=\"15:00:00\">15h</option>\n <option value=\"16:00:00\">16h</option>\n <option value=\"17:00:00\">17h</option>\n <option value=\"18:00:00\">18h</option>\n <option value=\"19:00:00\">19h</option>\n <option value=\"20:00:00\">20h</option>\n <option value=\"21:00:00\">21h</option>\n <option value=\"22:00:00\">22h</option>\n <option value=\"23:00:00\">23h</option>\n <option value=\"23:59:59\">24h</option>\n </select>\n </div>\n </div>\n <div class=\"col-xs-12 col-sm-3\">\n <div class=\"float-end\">\n <div class=\"form-check input-group\">\n <span class=\"input-group-text\">\n <input\n id=\"showHideWE\"\n class=\"mt-0\"\n type=\"checkbox\"\n v-model=\"showWeekends\"\n />\n </span>\n <label\n for=\"showHideWE\"\n class=\"form-check-label input-group-text\"\n >Week-ends</label\n >\n </div>\n </div>\n </div>\n </div>\n <FullCalendar :options=\"calendarOptions\" ref=\"calendarRef\">\n <template v-slot:eventContent=\"arg: EventApi\">\n <span :class=\"eventClasses(arg.event)\">\n <b v-if=\"arg.event.extendedProps.is === 'remote'\">{{\n arg.event.title\n }}</b>\n <b v-else-if=\"arg.event.extendedProps.is === 'range'\"\n >{{ arg.timeText }} -\n {{ arg.event.extendedProps.locationName }}</b\n >\n <b v-else-if=\"arg.event.extendedProps.is === 'local'\">{{\n arg.event.title\n }}</b>\n <b v-else>no 'is'</b>\n <a\n v-if=\"arg.event.extendedProps.is === 'range'\"\n class=\"fa fa-fw fa-times delete\"\n @click.prevent=\"onClickDelete(arg.event)\"\n >\n </a>\n </span>\n </template>\n </FullCalendar>\n\n <div id=\"copy-widget\">\n <div class=\"container mt-2 mb-2\">\n <div class=\"row justify-content-between align-items-center mb-4\">\n <div class=\"col-xs-12 col-sm-3 col-md-2\">\n <h6 class=\"chill-red\">{{ $t(\"copy_range_from_to\") }}</h6>\n </div>\n <div class=\"col-xs-12 col-sm-9 col-md-2\">\n <select\n v-model=\"dayOrWeek\"\n id=\"dayOrWeek\"\n class=\"form-select\"\n >\n <option value=\"day\">{{ $t(\"from_day_to_day\") }}</option>\n <option value=\"week\">\n {{ $t(\"from_week_to_week\") }}\n </option>\n </select>\n </div>\n <template v-if=\"dayOrWeek === 'day'\">\n <div class=\"col-xs-12 col-sm-3 col-md-3\">\n <input\n class=\"form-control\"\n type=\"date\"\n v-model=\"copyFrom\"\n />\n </div>\n <div class=\"col-xs-12 col-sm-1 col-md-1 copy-chevron\">\n <i class=\"fa fa-angle-double-right\"></i>\n </div>\n <div class=\"col-xs-12 col-sm-3 col-md-3\">\n <input\n class=\"form-control\"\n type=\"date\"\n v-model=\"copyTo\"\n />\n </div>\n <div class=\"col-xs-12 col-sm-5 col-md-1\">\n <button\n class=\"btn btn-action float-end\"\n @click=\"copyDay\"\n >\n {{ $t(\"copy_range\") }}\n </button>\n </div>\n </template>\n <template v-else>\n <div class=\"col-xs-12 col-sm-3 col-md-3\">\n <select\n v-model=\"copyFromWeek\"\n id=\"copyFromWeek\"\n class=\"form-select\"\n >\n <option\n v-for=\"w in lastWeeks\"\n :value=\"w.value\"\n :key=\"w.value\"\n >\n {{ w.text }}\n </option>\n </select>\n </div>\n <div class=\"col-xs-12 col-sm-1 col-md-1 copy-chevron\">\n <i class=\"fa fa-angle-double-right\"></i>\n </div>\n <div class=\"col-xs-12 col-sm-3 col-md-3\">\n <select\n v-model=\"copyToWeek\"\n id=\"copyToWeek\"\n class=\"form-select\"\n >\n <option\n v-for=\"w in nextWeeks\"\n :value=\"w.value\"\n :key=\"w.value\"\n >\n {{ w.text }}\n </option>\n </select>\n </div>\n <div class=\"col-xs-12 col-sm-5 col-md-1\">\n <button\n class=\"btn btn-action float-end\"\n @click=\"copyWeek\"\n >\n {{ $t(\"copy_range\") }}\n </button>\n </div>\n </template>\n </div>\n </div>\n </div>\n\n <!-- not directly seen, but include in a modal -->\n <edit-location ref=\"editLocation\"></edit-location>\n</template>\n\n<script setup lang=\"ts\">\nimport type {\n CalendarOptions,\n DatesSetArg,\n EventInput,\n} from \"@fullcalendar/core\";\nimport { reactive, computed, ref, onMounted } from \"vue\";\nimport { useStore } from \"vuex\";\nimport { key } from \"./store\";\nimport FullCalendar from \"@fullcalendar/vue3\";\nimport frLocale from \"@fullcalendar/core/locales/fr\";\nimport interactionPlugin, {\n DropArg,\n EventResizeDoneArg,\n} from \"@fullcalendar/interaction\";\nimport timeGridPlugin from \"@fullcalendar/timegrid\";\nimport {\n EventApi,\n DateSelectArg,\n EventDropArg,\n EventClickArg,\n} from \"@fullcalendar/core\";\nimport {\n dateToISO,\n ISOToDate,\n} from \"../../../../../ChillMainBundle/Resources/public/chill/js/date\";\nimport VueMultiselect from \"vue-multiselect\";\nimport { Location } from \"../../../../../ChillMainBundle/Resources/public/types\";\nimport EditLocation from \"./Components/EditLocation.vue\";\nimport { useI18n } from \"vue-i18n\";\n\nconst store = useStore(key);\n\nconst { t } = useI18n();\n\nconst showWeekends = ref(false);\nconst slotDuration = ref(\"00:15:00\");\nconst slotMinTime = ref(\"09:00:00\");\nconst slotMaxTime = ref(\"18:00:00\");\nconst copyFrom = ref<string | null>(null);\nconst copyTo = ref<string | null>(null);\nconst editLocation = ref<InstanceType<typeof EditLocation> | null>(null);\nconst dayOrWeek = ref(\"day\");\nconst copyFromWeek = ref<string | null>(null);\nconst copyToWeek = ref<string | null>(null);\n\ninterface Weeks {\n value: string | null;\n text: string;\n}\n\nconst getMonday = (week: number): Date => {\n const lastMonday = new Date();\n lastMonday.setDate(\n lastMonday.getDate() - ((lastMonday.getDay() + 6) % 7) + week * 7,\n );\n return lastMonday;\n};\n\nconst dateOptions: Intl.DateTimeFormatOptions = {\n weekday: \"long\",\n year: \"numeric\",\n month: \"long\",\n day: \"numeric\",\n};\n\nconst lastWeeks = computed((): Weeks[] =>\n Array.from(Array(30).keys()).map((w) => {\n const lastMonday = getMonday(15 - w);\n return {\n value: dateToISO(lastMonday),\n text: `Semaine du ${lastMonday.toLocaleDateString(\"fr-FR\", dateOptions)}`,\n };\n }),\n);\n\nconst nextWeeks = computed((): Weeks[] =>\n Array.from(Array(52).keys()).map((w) => {\n const nextMonday = getMonday(w + 1);\n return {\n value: dateToISO(nextMonday),\n text: `Semaine du ${nextMonday.toLocaleDateString(\"fr-FR\", dateOptions)}`,\n };\n }),\n);\n\nconst baseOptions = ref<CalendarOptions>({\n locale: frLocale,\n plugins: [interactionPlugin, timeGridPlugin],\n initialView: \"timeGridWeek\",\n initialDate: new Date(),\n scrollTimeReset: false,\n selectable: true,\n // when the dates are changes in the fullcalendar view OR when new events are added\n datesSet: onDatesSet,\n // when a date is selected\n select: onDateSelect,\n // when a event is resized\n eventResize: onEventDropOrResize,\n // when an event is moved\n eventDrop: onEventDropOrResize,\n // when an event si clicked\n eventClick: onEventClick,\n selectMirror: false,\n editable: true,\n headerToolbar: {\n left: \"prev,next today\",\n center: \"title\",\n right: \"timeGridWeek,timeGridDay\",\n },\n});\n\nconst ranges = computed<EventInput[]>(() => {\n return store.state.calendarRanges.ranges;\n});\n\nconst locations = computed<Location[]>(() => {\n return store.state.locations.locations;\n});\n\nconst pickedLocation = computed<Location | null>({\n get(): Location | null {\n return (\n store.state.locations.locationPicked ||\n store.state.locations.currentLocation\n );\n },\n set(newLocation: Location | null): void {\n store.commit(\"locations/setLocationPicked\", newLocation, {\n root: true,\n });\n },\n});\n\n/**\n * return the show classes for the event\n * @param arg\n */\nconst eventClasses = function (arg: EventApi): object {\n return { calendarRangeItems: true };\n};\n\n/*\n// currently, all events are stored into calendarRanges, due to reactivity bug\nconst remotes = computed<EventInput[]>(() => {\n return store.state.calendarRemotes.remotes;\n});\n\nconst sources = computed<EventSourceInput[]>(() => {\n const sources = [];\n\n const rangeSource: EventSourceInput = {\n id: 'ranges',\n events: ranges.value,\n };\n\n sources.push(rangeSource);\n\n return sources;\n});\n*/\n\nconst calendarOptions = computed((): CalendarOptions => {\n return {\n ...baseOptions.value,\n weekends: showWeekends.value,\n slotDuration: slotDuration.value,\n events: ranges.value,\n slotMinTime: slotMinTime.value,\n slotMaxTime: slotMaxTime.value,\n };\n});\n\n/**\n * launched when the calendar range date change\n */\nfunction onDatesSet(event: DatesSetArg): void {\n store.dispatch(\"fullCalendar/setCurrentDatesView\", {\n start: event.start,\n end: event.end,\n });\n}\n\nfunction onDateSelect(event: DateSelectArg): void {\n if (null === pickedLocation.value) {\n window.alert(\n \"Indiquez une localisation avant de créer une période de disponibilité.\",\n );\n return;\n }\n\n store.dispatch(\"calendarRanges/createRange\", {\n start: event.start,\n end: event.end,\n location: pickedLocation.value,\n });\n}\n\n/**\n * When a calendar range is deleted\n */\nfunction onClickDelete(event: EventApi): void {\n if (event.extendedProps.is !== \"range\") {\n return;\n }\n\n store.dispatch(\n \"calendarRanges/deleteRange\",\n event.extendedProps.calendarRangeId,\n );\n}\n\nfunction onEventDropOrResize(payload: EventDropArg | EventResizeDoneArg) {\n if (payload.event.extendedProps.is !== \"range\") {\n return;\n }\n const changedEvent = payload.event;\n\n store.dispatch(\"calendarRanges/patchRangeTime\", {\n calendarRangeId: payload.event.extendedProps.calendarRangeId,\n start: payload.event.start,\n end: payload.event.end,\n });\n}\n\nfunction onEventClick(payload: EventClickArg): void {\n // @ts-ignore TS does not recognize the target. But it does exists.\n if (payload.jsEvent.target.classList.contains(\"delete\")) {\n return;\n }\n if (payload.event.extendedProps.is !== \"range\") {\n return;\n }\n\n editLocation.value?.startEdit(payload.event);\n}\n\nfunction copyDay() {\n if (null === copyFrom.value || null === copyTo.value) {\n return;\n }\n store.dispatch(\"calendarRanges/copyFromDayToAnotherDay\", {\n from: ISOToDate(copyFrom.value),\n to: ISOToDate(copyTo.value),\n });\n}\n\nfunction copyWeek() {\n if (null === copyFromWeek.value || null === copyToWeek.value) {\n return;\n }\n store.dispatch(\"calendarRanges/copyFromWeekToAnotherWeek\", {\n fromMonday: ISOToDate(copyFromWeek.value),\n toMonday: ISOToDate(copyToWeek.value),\n });\n}\n\nonMounted(() => {\n copyFromWeek.value = dateToISO(getMonday(0));\n copyToWeek.value = dateToISO(getMonday(1));\n});\n</script>\n\n<style scoped>\n#copy-widget {\n position: sticky;\n bottom: 0px;\n background-color: white;\n z-index: 9999999999;\n padding: 0.25rem 0 0.25rem;\n}\ndiv.copy-chevron {\n text-align: center;\n font-size: x-large;\n width: 2rem;\n}\n</style>\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillCalendarBundle/Resources/public/vuejs/MyCalendarRange/Components/EditLocation.vue",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'_' is defined but never used.",
"line": 77,
"column": 16,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 77,
"endColumn": 17
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'_' is defined but never used.",
"line": 82,
"column": 30,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 82,
"endColumn": 31
},
{
"ruleId": "@typescript-eslint/no-explicit-any",
"severity": 2,
"message": "Unexpected any. Specify a different type.",
"line": 82,
"column": 33,
"nodeType": "TSAnyKeyword",
"messageId": "unexpectedAny",
"endLine": 82,
"endColumn": 36,
"suggestions": [
{
"messageId": "suggestUnknown",
"fix": {
"range": [
2589,
2592
],
"text": "unknown"
},
"desc": "Use `unknown` instead, this will force you to explicitly, and safely assert the type is correct."
},
{
"messageId": "suggestNever",
"fix": {
"range": [
2589,
2592
],
"text": "never"
},
"desc": "Use `never` instead, this is useful when instantiating generic type parameters that you don't need to know the type of."
}
]
}
],
"suppressedMessages": [],
"errorCount": 3,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "<template>\n <component :is=\"Teleport\" to=\"body\">\n <modal v-if=\"showModal\" @close=\"closeModal\">\n <template v-slot:header>\n <h3>{{ \"Modifier le lieu\" }}</h3>\n </template>\n\n <template v-slot:body>\n <div></div>\n <label>Localisation</label>\n <vue-multiselect\n v-model=\"location\"\n :options=\"locations\"\n :label=\"'name'\"\n :track-by=\"'id'\"\n ></vue-multiselect>\n </template>\n\n <template v-slot:footer>\n <button class=\"btn btn-save\" @click=\"saveAndClose\">\n {{ \"Enregistrer\" }}\n </button>\n </template>\n </modal>\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport Modal from \"../../../../../../ChillMainBundle/Resources/public/vuejs/_components/Modal.vue\";\nimport { computed, ref } from \"vue\";\nimport { EventApi } from \"@fullcalendar/core\";\nimport { useStore } from \"vuex\";\nimport { key } from \"../store\";\nimport { Location } from \"../../../../../../ChillMainBundle/Resources/public/types\";\nimport VueMultiselect from \"vue-multiselect\";\n//import type {Teleport} from \"vue\";\n\n// see https://github.com/vuejs/core/issues/2855\nimport { Teleport as teleport_, TeleportProps, VNodeProps } from \"vue\";\n\nconst Teleport = teleport_ as new () => {\n $props: VNodeProps & TeleportProps;\n};\n\nconst store = useStore(key);\n\nconst calendarRangeId = ref<number | null>(null);\nconst location = ref<Location | null>(null);\nconst showModal = ref(false);\n//const tele = ref<InstanceType<typeof Teleport> | null>(null);\n\nconst locations = computed<Location[]>(() => {\n return store.state.locations.locations;\n});\n\nconst startEdit = function (event: EventApi): void {\n console.log(\"startEditing\", event);\n calendarRangeId.value = event.extendedProps.calendarRangeId;\n location.value =\n store.getters[\"locations/getLocationById\"](\n event.extendedProps.locationId,\n ) || null;\n\n console.log(\"new location value\", location.value);\n console.log(\"calendar range id\", calendarRangeId.value);\n showModal.value = true;\n};\n\nconst saveAndClose = function (e: Event): void {\n console.log(\"saveEditAndClose\", e);\n\n store\n .dispatch(\"calendarRanges/patchRangeLocation\", {\n location: location.value,\n calendarRangeId: calendarRangeId.value,\n })\n .then((_) => {\n showModal.value = false;\n });\n};\n\nconst closeModal = function (_: any): void {\n showModal.value = false;\n};\n\ndefineExpose({ startEdit });\n</script>\n\n<style scoped></style>\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillCalendarBundle/Resources/public/vuejs/_components/CalendarUserSelector/CalendarUserSelector.vue",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'reject' is defined but never used.",
"line": 108,
"column": 47,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 108,
"endColumn": 53
},
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"users\" prop.",
"line": 148,
"column": 29,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 148,
"endColumn": 54
},
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"calendarEvents\" prop.",
"line": 151,
"column": 29,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 151,
"endColumn": 72
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'reject' is defined but never used.",
"line": 154,
"column": 59,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 154,
"endColumn": 65
},
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"users\" prop.",
"line": 155,
"column": 41,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 155,
"endColumn": 63
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'reject' is defined but never used.",
"line": 164,
"column": 63,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 164,
"endColumn": 69
},
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"calendarEvents\" prop.",
"line": 185,
"column": 57,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 186,
"endColumn": 86
},
{
"ruleId": "@typescript-eslint/prefer-for-of",
"severity": 2,
"message": "Expected a `for-of` loop instead of a `for` loop with this simple iteration.",
"line": 218,
"column": 17,
"nodeType": "ForStatement",
"messageId": "preferForOf",
"endLine": 230,
"endColumn": 18
},
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"calendarEvents\" prop.",
"line": 235,
"column": 13,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 237,
"endColumn": 14
},
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"users\" prop.",
"line": 240,
"column": 13,
"nodeType": "CallExpression",
"messageId": "unexpectedMutation",
"endLine": 240,
"endColumn": 44
},
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"users\" prop.",
"line": 246,
"column": 13,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 248,
"endColumn": 14
}
],
"suppressedMessages": [],
"errorCount": 11,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "<template>\n <div>\n <h2 class=\"chill-red\">\n {{ $t(\"choose_your_calendar_user\") }}\n </h2>\n <VueMultiselect\n name=\"field\"\n id=\"calendarUserSelector\"\n v-model=\"value\"\n track-by=\"id\"\n label=\"value\"\n :custom-label=\"transName\"\n :placeholder=\"$t('select_user')\"\n :multiple=\"true\"\n :close-on-select=\"false\"\n :allow-empty=\"true\"\n :model-value=\"value\"\n :select-label=\"$t('multiselect.select_label')\"\n :deselect-label=\"$t('multiselect.deselect_label')\"\n :selected-label=\"$t('multiselect.selected_label')\"\n @select=\"selectUsers\"\n @remove=\"unSelectUsers\"\n @close=\"coloriseSelectedValues\"\n :options=\"options\"\n />\n </div>\n <div class=\"form-check\">\n <input\n type=\"checkbox\"\n id=\"myCalendar\"\n class=\"form-check-input\"\n v-model=\"showMyCalendarWidget\"\n />\n <label class=\"form-check-label\" for=\"myCalendar\">{{\n $t(\"show_my_calendar\")\n }}</label>\n </div>\n <div class=\"form-check\">\n <input\n type=\"checkbox\"\n id=\"weekends\"\n class=\"form-check-input\"\n @click=\"toggleWeekends\"\n />\n <label class=\"form-check-label\" for=\"weekends\">{{\n $t(\"show_weekends\")\n }}</label>\n </div>\n</template>\n<script>\nimport { fetchCalendarRanges, fetchCalendar } from \"../../_api/api\";\nimport VueMultiselect from \"vue-multiselect\";\nimport { whoami } from \"ChillPersonAssets/vuejs/AccompanyingCourse/api\";\n\nconst COLORS = [\n /* from https://colorbrewer2.org/#type=qualitative&scheme=Set3&n=12 */\n \"#8dd3c7\",\n \"#ffffb3\",\n \"#bebada\",\n \"#fb8072\",\n \"#80b1d3\",\n \"#fdb462\",\n \"#b3de69\",\n \"#fccde5\",\n \"#d9d9d9\",\n \"#bc80bd\",\n \"#ccebc5\",\n \"#ffed6f\",\n];\n\nexport default {\n name: \"CalendarUserSelector\",\n components: { VueMultiselect },\n props: [\n \"users\",\n \"updateEventsSource\",\n \"calendarEvents\",\n \"showMyCalendar\",\n \"toggleMyCalendar\",\n \"toggleWeekends\",\n ],\n data() {\n return {\n errorMsg: [],\n value: [],\n options: [],\n };\n },\n computed: {\n showMyCalendarWidget: {\n set(value) {\n this.toggleMyCalendar(value);\n this.updateEventsSource();\n },\n get() {\n return this.showMyCalendar;\n },\n },\n },\n methods: {\n init() {\n this.fetchData();\n },\n fetchData() {\n fetchCalendarRanges()\n .then(\n (calendarRanges) =>\n new Promise((resolve, reject) => {\n let results = calendarRanges.results;\n\n let users = [];\n\n results.forEach((i) => {\n if (!users.some((j) => i.user.id === j.id)) {\n let ratio = Math.floor(\n users.length / COLORS.length,\n );\n let colorIndex =\n users.length - ratio * COLORS.length;\n users.push({\n id: i.user.id,\n username: i.user.username,\n color: COLORS[colorIndex],\n });\n }\n });\n\n let calendarEvents = [];\n users.forEach((u) => {\n let arr = results\n .filter((i) => i.user.id === u.id)\n .map((i) => ({\n start: i.startDate.datetime,\n end: i.endDate.datetime,\n calendarRangeId: i.id,\n sourceColor: u.color,\n //display: 'background' // can be an option for the disponibility\n }));\n calendarEvents.push({\n events: arr,\n color: u.color,\n textColor: \"#444444\",\n editable: false,\n id: u.id,\n });\n });\n\n this.users.loaded = users;\n this.options = users;\n\n this.calendarEvents.loaded = calendarEvents;\n whoami().then(\n (me) =>\n new Promise((resolve, reject) => {\n this.users.logged = me;\n let currentUser = users.find(\n (u) => u.id === me.id,\n );\n this.value = currentUser;\n\n fetchCalendar(currentUser.id).then(\n (calendar) =>\n new Promise(\n (resolve, reject) => {\n let results =\n calendar.results;\n let events =\n results.map(\n (i) => ({\n start: i\n .startDate\n .datetime,\n end: i\n .endDate\n .datetime,\n }),\n );\n let calendarEventsCurrentUser =\n {\n events: events,\n color: \"darkblue\",\n id: 1000,\n editable: false,\n };\n this.calendarEvents.user =\n calendarEventsCurrentUser;\n\n this.selectUsers(\n currentUser,\n );\n\n resolve();\n },\n ),\n );\n\n resolve();\n }),\n );\n\n resolve();\n }),\n )\n .catch((error) => {\n this.errorMsg.push(error.message);\n });\n },\n transName(value) {\n return `${value.username}`;\n },\n coloriseSelectedValues() {\n let tags = document.querySelectorAll(\n \"div.multiselect__tags-wrap\",\n )[0];\n\n if (tags.hasChildNodes()) {\n let children = tags.childNodes;\n for (let i = 0; i < children.length; i++) {\n let child = children[i];\n if (child.nodeType === Node.ELEMENT_NODE) {\n this.users.selected.forEach((u) => {\n if (child.hasChildNodes()) {\n if (child.firstChild.innerText == u.username) {\n child.style.background = u.color;\n child.firstChild.style.color = \"#444444\";\n }\n }\n });\n }\n }\n }\n },\n selectEvents() {\n let selectedUsersId = this.users.selected.map((a) => a.id);\n this.calendarEvents.selected = this.calendarEvents.loaded.filter(\n (a) => selectedUsersId.includes(a.id),\n );\n },\n selectUsers(value) {\n this.users.selected.push(value);\n this.coloriseSelectedValues();\n this.selectEvents();\n this.updateEventsSource();\n },\n unSelectUsers(value) {\n this.users.selected = this.users.selected.filter(\n (a) => a.id != value.id,\n );\n this.selectEvents();\n this.updateEventsSource();\n },\n },\n mounted() {\n this.init();\n },\n};\n</script>\n\n<style src=\"vue-multiselect/dist/vue-multiselect.css\"></style>\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillDocStoreBundle/Resources/public/module/async_upload/downloader.js",
"messages": [
{
"ruleId": "@typescript-eslint/prefer-for-of",
"severity": 2,
"message": "Expected a `for-of` loop instead of a `for` loop with this simple iteration.",
"line": 8,
"column": 3,
"nodeType": "ForStatement",
"messageId": "preferForOf",
"endLine": 10,
"endColumn": 4
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'decryptError' is assigned a value but never used.",
"line": 30,
"column": 5,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 30,
"endColumn": 17
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'fetchError' is assigned a value but never used.",
"line": 31,
"column": 5,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 31,
"endColumn": 15
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'key' is defined but never used.",
"line": 32,
"column": 5,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 32,
"endColumn": 8
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'url' is defined but never used.",
"line": 33,
"column": 5,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 33,
"endColumn": 8
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'error' is defined but never used.",
"line": 87,
"column": 13,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 87,
"endColumn": 18
}
],
"suppressedMessages": [],
"errorCount": 6,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "var mime = require(\"mime\");\n\nvar algo = \"AES-CBC\";\n\nvar initializeButtons = (root) => {\n var buttons = root.querySelectorAll(\"a[data-download-button]\");\n\n for (let i = 0; i < buttons.length; i++) {\n initialize(buttons[i]);\n }\n};\n\nvar initialize = (button) => {\n button.addEventListener(\"click\", onClick);\n};\n\nvar onClick = (e) => download(e.target);\n\nvar download = (button) => {\n var keyData = JSON.parse(button.dataset.key),\n ivData = JSON.parse(button.dataset.iv),\n iv = new Uint8Array(ivData),\n urlGenerator = button.dataset.tempUrlGetGenerator,\n hasFilename = \"filename\" in button.dataset,\n filename = button.dataset.filename,\n labelPreparing = button.dataset.labelPreparing,\n labelReady = button.dataset.labelReady,\n mimeType = button.dataset.mimeType,\n extension = mime.getExtension(mimeType),\n decryptError = \"Error while decrypting file\",\n fetchError = \"Error while fetching file\",\n key,\n url;\n\n button.textContent = labelPreparing;\n\n window\n .fetch(urlGenerator)\n .then((r) => {\n if (r.ok) {\n return r.json();\n } else {\n throw new Error(\n \"error while downloading url \" + r.status + \" \" + r.statusText,\n );\n }\n })\n .then((data) => {\n return window.fetch(data.url);\n })\n .then((response) => {\n if (response.ok) {\n return response.arrayBuffer();\n }\n throw new Error(response.status + response.statusText);\n })\n .then((buffer) => {\n if (keyData.alg !== undefined) {\n return window.crypto.subtle\n .importKey(\"jwk\", keyData, { name: algo, iv: iv }, false, [\"decrypt\"])\n .then((key) => {\n return window.crypto.subtle.decrypt(\n { name: algo, iv: iv },\n key,\n buffer,\n );\n });\n }\n return Promise.resolve(buffer);\n })\n .then((decrypted) => {\n var blob = new Blob([decrypted], { type: mimeType }),\n url = window.URL.createObjectURL(blob);\n button.href = url;\n button.target = \"_blank\";\n button.type = mimeType;\n button.textContent = labelReady;\n if (hasFilename) {\n button.download = filename;\n if (extension !== false) {\n button.download = button.download + \".\" + extension;\n }\n }\n button.removeEventListener(\"click\", onClick);\n button.click();\n })\n .catch((error) => {\n button.textContent = \"\";\n button.appendChild(\n document.createTextNode(\"error while handling decrypted file\"),\n );\n });\n};\n\nwindow.addEventListener(\"load\", function (e) {\n initializeButtons(e.target);\n});\n\nexport { initializeButtons, download };\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillDocStoreBundle/Resources/public/module/async_upload/uploader.js",
"messages": [
{
"ruleId": "@typescript-eslint/prefer-for-of",
"severity": 2,
"message": "Expected a `for-of` loop instead of a `for` loop with this simple iteration.",
"line": 39,
"column": 3,
"nodeType": "ForStatement",
"messageId": "preferForOf",
"endLine": 41,
"endColumn": 4
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'files' is defined but never used.",
"line": 44,
"column": 40,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 44,
"endColumn": 45
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'zoneData' is defined but never used.",
"line": 103,
"column": 34,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 103,
"endColumn": 42
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'file' is defined but never used.",
"line": 141,
"column": 27,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 141,
"endColumn": 31
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'response' is defined but never used.",
"line": 154,
"column": 43,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 154,
"endColumn": 51
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'file' is defined but never used.",
"line": 159,
"column": 39,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 159,
"endColumn": 43
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'file' is defined but never used.",
"line": 165,
"column": 41,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 165,
"endColumn": 45
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'zoneData' is defined but never used.",
"line": 239,
"column": 30,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 239,
"endColumn": 38
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'removeDownloadButton' is assigned a value but never used.",
"line": 301,
"column": 7,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 301,
"endColumn": 27
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'zoneData' is defined but never used.",
"line": 301,
"column": 37,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 301,
"endColumn": 45
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'e' is defined but never used.",
"line": 348,
"column": 43,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 348,
"endColumn": 44
}
],
"suppressedMessages": [],
"errorCount": 11,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "var algo = \"AES-CBC\";\nimport Dropzone from \"dropzone\";\nimport { initializeButtons } from \"./downloader.js\";\n\n/**\n *\n * define a dropzone for chill usage\n *\n * An event is launched when dropzone is initialize, allowing to customize events\n * on dropzone :\n *\n * ```\n * window.addEventListener(\"chill_dropzone_initialized\", (e) => {\n * // do something with dropzone:\n * e.detail.dropzone.on(\"success\", (e) => {\n * // see https://www.dropzonejs.com/#event-success\n * });\n * });\n * ```\n *\n */\n\n// load css\n//require('dropzone/dist/basic.css');\nrequire(\"dropzone/dist/dropzone.css\");\nrequire(\"./index.scss\");\n//\n\n// disable dropzone autodiscover\nDropzone.autoDiscover = false;\n\nvar keyDefinition = {\n name: algo,\n length: 256,\n};\n\nvar searchForZones = function (root) {\n var zones = root.querySelectorAll(\"div[data-stored-object]\");\n for (let i = 0; i < zones.length; i++) {\n initialize(zones[i]);\n }\n};\n\nvar getUploadUrl = function (zoneData, files) {\n var generateTempUrlPost = zoneData.zone.querySelector(\n \"input[data-async-file-upload]\",\n ).dataset.generateTempUrlPost,\n oReq = new XMLHttpRequest();\n // arg, dropzone, you cannot handle async upload...\n oReq.open(\"GET\", generateTempUrlPost, false);\n oReq.send();\n\n if (oReq.readyState !== XMLHttpRequest.DONE) {\n throw new Error(\"Error while fetching url to upload\");\n }\n\n zoneData.params = JSON.parse(oReq.responseText);\n\n return zoneData.params.url;\n};\n\nvar encryptFile = function (originalFile, zoneData, done) {\n var iv = crypto.getRandomValues(new Uint8Array(16)),\n reader = new FileReader(),\n jsKey,\n rawKey;\n\n zoneData.originalType = originalFile.type;\n\n reader.onload = (e) => {\n window.crypto.subtle\n .generateKey(keyDefinition, true, [\"encrypt\", \"decrypt\"])\n .then((key) => {\n jsKey = key;\n\n // we register the key somwhere\n return window.crypto.subtle.exportKey(\"jwk\", key);\n })\n .then((exportedKey) => {\n rawKey = exportedKey;\n\n // we start encryption\n return window.crypto.subtle.encrypt(\n { name: algo, iv: iv },\n jsKey,\n e.target.result,\n );\n })\n .then((encrypted) => {\n zoneData.crypto = {\n jsKey: jsKey,\n rawKey: rawKey,\n iv: iv,\n };\n\n done(new File([encrypted], zoneData.suffix));\n });\n };\n\n reader.readAsArrayBuffer(originalFile);\n};\n\nvar addBelowButton = (btn, zone, zoneData) => {\n let belowZone = zone.querySelector(\".chill-dropzone__below-zone\");\n\n if (belowZone === null) {\n belowZone = document.createElement(\"div\");\n belowZone.classList.add(\"chill-dropzone__below-zone\");\n zone.appendChild(belowZone);\n }\n\n belowZone.appendChild(btn);\n};\n\nvar createZone = (zone, zoneData) => {\n var created = document.createElement(\"div\"),\n initMessage = document.createElement(\"div\"),\n initContent = zone.dataset.labelInitMessage,\n dropzoneI;\n\n created.classList.add(\"dropzone\");\n initMessage.classList.add(\"dz-message\");\n initMessage.appendChild(document.createTextNode(initContent));\n console.log(Dropzone);\n dropzoneI = new Dropzone(created, {\n url: function (files) {\n return getUploadUrl(zoneData, files);\n },\n dictDefaultMessage: zone.dataset.dictDefaultMessage,\n dictFileTooBig: zone.dataset.dictFileTooBig,\n dictRemoveFile: zone.dataset.dictRemoveFile,\n dictMaxFilesExceeded: zone.dataset.dictMaxFilesExceeded,\n dictCancelUpload: zone.dataset.dictCancelUpload,\n dictCancelUploadConfirm: zone.dataset.dictCancelUploadConfirm,\n dictUploadCanceled: zone.dataset.dictUploadCanceled,\n maxFiles: 1,\n addRemoveLinks: true,\n transformFile: function (file, done) {\n encryptFile(file, zoneData, done);\n },\n renameFile: function (file) {\n return zoneData.suffix;\n },\n });\n\n dropzoneI.on(\"sending\", function (file, xhr, formData) {\n formData.append(\"redirect\", zoneData.params.redirect);\n formData.append(\"max_file_size\", zoneData.params.max_file_size);\n formData.append(\"max_file_count\", zoneData.params.max_file_count);\n formData.append(\"expires\", zoneData.params.expires);\n formData.append(\"signature\", zoneData.params.signature);\n });\n\n dropzoneI.on(\"success\", function (file, response) {\n zoneData.currentFile = file;\n storeDataInForm(zone, zoneData);\n });\n\n dropzoneI.on(\"addedfile\", function (file) {\n if (zoneData.hasOwnProperty(\"currentFile\")) {\n dropzoneI.removeFile(zoneData.currentFile);\n }\n });\n\n dropzoneI.on(\"removedfile\", function (file) {\n removeDataInForm(zone, zoneData);\n });\n\n zone.insertBefore(created, zone.firstChild);\n\n let event = new CustomEvent(\"chill_dropzone_initialized\", {\n detail: {\n dropzone: dropzoneI,\n zoneData: zoneData,\n },\n });\n window.dispatchEvent(event);\n};\n\nvar initialize = function (zone) {\n var allowRemove = zone.dataset.allowRemove,\n zoneData = {\n zone: zone,\n suffix: createFilename(),\n allowRemove: allowRemove,\n old: null,\n };\n if (hasDataInForm(zone, zoneData)) {\n insertRemoveButton(zone, zoneData);\n insertDownloadButton(zone, zoneData);\n } else {\n createZone(zone, zoneData);\n }\n};\n\nvar createFilename = () => {\n var text = \"\";\n var possible =\n \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for (let i = 0; i < 7; i++) {\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n\n return text;\n};\n\nvar storeDataInForm = (zone, zoneData) => {\n var inputKey = zone.querySelector(\"input[data-stored-object-key]\"),\n inputIv = zone.querySelector(\"input[data-stored-object-iv]\"),\n inputObject = zone.querySelector(\"input[data-async-file-upload]\"),\n inputType = zone.querySelector(\"input[data-async-file-type]\");\n inputKey.value = JSON.stringify(zoneData.crypto.rawKey);\n inputIv.value = JSON.stringify(Array.from(zoneData.crypto.iv));\n inputType.value = zoneData.originalType;\n inputObject.value = zoneData.params.prefix + zoneData.suffix;\n\n insertDownloadButton(zone);\n};\n\nconst restoreDataInForm = (zone, zoneData) => {\n var inputKey = zone.querySelector(\"input[data-stored-object-key]\"),\n inputIv = zone.querySelector(\"input[data-stored-object-iv]\"),\n inputObject = zone.querySelector(\"input[data-async-file-upload]\"),\n inputType = zone.querySelector(\"input[data-async-file-type]\");\n if (zoneData.old === null) {\n console.log(\"should not have restored data\");\n return;\n }\n\n inputKey.value = zoneData.old.key;\n inputIv.value = zoneData.old.iv;\n inputType.value = zoneData.old.type;\n inputObject.value = zoneData.old.obj;\n\n insertDownloadButton(zone);\n};\n\nconst hasDataInForm = (zone, zoneData) => {\n var inputObject = zone.querySelector(\"input[data-async-file-upload]\");\n return inputObject.value.length > 0;\n};\n\nvar removeDataInForm = (zone, zoneData) => {\n var inputKey = zone.querySelector(\"input[data-stored-object-key]\"),\n inputIv = zone.querySelector(\"input[data-stored-object-iv]\"),\n inputObject = zone.querySelector(\"input[data-async-file-upload]\"),\n inputType = zone.querySelector(\"input[data-async-file-type]\");\n // store data for future usage\n zoneData.old = {\n key: inputKey.value,\n iv: inputIv.value,\n obj: inputObject.value,\n type: inputType.value,\n };\n // set blank values\n inputKey.value = \"\";\n inputIv.value = \"\";\n inputType.value = \"\";\n inputObject.value = \"\";\n\n insertDownloadButton(zone);\n};\n\nvar insertRemoveButton = (zone, zoneData) => {\n var removeButton = document.createElement(\"a\"),\n cancelButton = document.createElement(\"a\"),\n labelRemove = zone.dataset.dictRemove,\n labelCancel = \"Restaurer\";\n removeButton.classList.add(\"btn\", \"btn-delete\");\n removeButton.textContent = labelRemove;\n\n cancelButton.classList.add(\"btn\", \"btn-cancel\");\n cancelButton.textContent = labelCancel;\n\n removeButton.addEventListener(\"click\", (e) => {\n e.preventDefault();\n if (zoneData.allowRemove === \"true\") {\n removeDataInForm(zone, zoneData);\n cancelButton.addEventListener(\"click\", (e) => {\n e.preventDefault();\n\n restoreDataInForm(zone, zoneData);\n\n cancelButton.remove();\n zone.querySelector(\".dropzone\").remove();\n\n initialize(zone);\n });\n }\n addBelowButton(cancelButton, zone, zoneData);\n //zone.appendChild(cancelButton);\n removeButton.remove();\n createZone(zone, zoneData);\n });\n\n addBelowButton(removeButton, zone, zoneData);\n // zone.appendChild(removeButton);\n};\n\nconst removeDownloadButton = (zone, zoneData) => {\n var existingButtons = zone.querySelectorAll(\"a[data-download-button]\");\n // remove existing\n existingButtons.forEach(function (b) {\n b.remove();\n });\n};\n\nvar insertDownloadButton = (zone, zoneData) => {\n var existingButtons = zone.querySelectorAll(\"a[data-download-button]\"),\n newButton = document.createElement(\"a\"),\n inputKey = zone.querySelector(\"input[data-stored-object-key]\"),\n inputIv = zone.querySelector(\"input[data-stored-object-iv]\"),\n inputObject = zone.querySelector(\"input[data-async-file-upload]\"),\n inputType = zone.querySelector(\"input[data-async-file-type]\"),\n labelPreparing = zone.dataset.labelPreparing,\n labelQuietButton = zone.dataset.labelQuietButton,\n labelReady = zone.dataset.labelReady,\n tempUrlGenerator = zone.dataset.tempUrlGenerator,\n tempUrlGeneratorParams = new URLSearchParams();\n // remove existing\n existingButtons.forEach(function (b) {\n b.remove();\n });\n\n if (inputObject.value === \"\") {\n return;\n }\n\n tempUrlGeneratorParams.append(\"object_name\", inputObject.value);\n\n newButton.dataset.downloadButton = true;\n newButton.dataset.key = inputKey.value;\n newButton.dataset.iv = inputIv.value;\n newButton.dataset.mimeType = inputType.value;\n newButton.dataset.labelPreparing = labelPreparing;\n newButton.dataset.labelReady = labelReady;\n newButton.dataset.tempUrlGetGenerator =\n tempUrlGenerator + \"?\" + tempUrlGeneratorParams.toString();\n newButton.classList.add(\"btn\", \"btn-download\", \"dz-bt-below-dropzone\");\n newButton.textContent = labelQuietButton;\n\n addBelowButton(newButton, zone, zoneData);\n //zone.appendChild(newButton);\n initializeButtons(zone);\n};\n\nwindow.addEventListener(\"load\", function (e) {\n searchForZones(document);\n});\n\nwindow.addEventListener(\"collection-add-entry\", function (e) {\n searchForZones(e.detail.entry);\n});\n\nexport { searchForZones };\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DropFileWidget/DropFileWidget.vue",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'ref' is defined but never used.",
"line": 3,
"column": 20,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 3,
"endColumn": 23
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'Ref' is defined but never used.",
"line": 3,
"column": 25,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 3,
"endColumn": 28
}
],
"suppressedMessages": [],
"errorCount": 2,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "<script setup lang=\"ts\">\nimport { StoredObject, StoredObjectCreated } from \"../../types\";\nimport { computed, ref, Ref } from \"vue\";\nimport DropFile from \"ChillDocStoreAssets/vuejs/DropFileWidget/DropFile.vue\";\nimport DocumentActionButtonsGroup from \"ChillDocStoreAssets/vuejs/DocumentActionButtonsGroup.vue\";\n\ninterface DropFileConfig {\n allowRemove: boolean;\n existingDoc?: StoredObjectCreated | StoredObject;\n}\n\nconst props = withDefaults(defineProps<DropFileConfig>(), {\n allowRemove: false,\n});\n\nconst emit = defineEmits<{\n (e: \"addDocument\", stored_object: StoredObjectCreated): void;\n (e: \"removeDocument\", stored_object: null): void;\n}>();\n\nconst has_existing_doc = computed<boolean>(() => {\n return props.existingDoc !== undefined && props.existingDoc !== null;\n});\n\nconst dav_link_expiration = computed<number | undefined>(() => {\n if (props.existingDoc === undefined || props.existingDoc === null) {\n return undefined;\n }\n if (props.existingDoc.status !== \"ready\") {\n return undefined;\n }\n\n return props.existingDoc._links?.dav_link?.expiration;\n});\n\nconst dav_link_href = computed<string | undefined>(() => {\n if (props.existingDoc === undefined || props.existingDoc === null) {\n return undefined;\n }\n if (props.existingDoc.status !== \"ready\") {\n return undefined;\n }\n\n return props.existingDoc._links?.dav_link?.href;\n});\n\nconst onAddDocument = (s: StoredObjectCreated): void => {\n emit(\"addDocument\", s);\n};\n\nconst onRemoveDocument = (e: Event): void => {\n e.stopPropagation();\n e.preventDefault();\n emit(\"removeDocument\", null);\n};\n</script>\n\n<template>\n <div>\n <drop-file\n :existingDoc=\"props.existingDoc\"\n @addDocument=\"onAddDocument\"\n ></drop-file>\n\n <ul class=\"record_actions\">\n <li v-if=\"has_existing_doc\">\n <document-action-buttons-group\n :stored-object=\"props.existingDoc\"\n :can-edit=\"props.existingDoc?.status === 'ready'\"\n :can-download=\"true\"\n :dav-link=\"dav_link_href\"\n :dav-link-expiration=\"dav_link_expiration\"\n />\n </li>\n <li>\n <button\n v-if=\"allowRemove\"\n class=\"btn btn-delete\"\n @click=\"onRemoveDocument($event)\"\n ></button>\n </li>\n </ul>\n </div>\n</template>\n\n<style scoped lang=\"scss\"></style>\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/ConvertButton.vue",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'download_and_decrypt_doc' is defined but never used.",
"line": 11,
"column": 5,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 11,
"endColumn": 29
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'mime' is defined but never used.",
"line": 14,
"column": 8,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 14,
"endColumn": 12
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'StoredObjectCreated' is defined but never used.",
"line": 16,
"column": 24,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 16,
"endColumn": 43
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'reset_pending' is assigned a value but never used.",
"line": 50,
"column": 11,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 50,
"endColumn": 24
}
],
"suppressedMessages": [],
"errorCount": 4,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "<template>\n <a :class=\"props.classes\" @click=\"download_and_open($event)\" ref=\"btn\">\n <i class=\"fa fa-file-pdf-o\"></i>\n Télécharger en pdf\n </a>\n</template>\n\n<script lang=\"ts\" setup>\nimport {\n build_convert_link,\n download_and_decrypt_doc,\n download_doc,\n} from \"./helpers\";\nimport mime from \"mime\";\nimport { reactive, ref } from \"vue\";\nimport { StoredObject, StoredObjectCreated } from \"../../types\";\n\ninterface ConvertButtonConfig {\n storedObject: StoredObject;\n classes: Record<string, boolean>;\n filename?: string;\n}\n\ninterface DownloadButtonState {\n content: null | string;\n}\n\nconst props = defineProps<ConvertButtonConfig>();\nconst state: DownloadButtonState = reactive({ content: null });\nconst btn = ref<HTMLAnchorElement | null>(null);\n\nasync function download_and_open(event: Event): Promise<void> {\n const button = event.target as HTMLAnchorElement;\n\n if (null === state.content) {\n event.preventDefault();\n\n const raw = await download_doc(\n build_convert_link(props.storedObject.uuid),\n );\n state.content = window.URL.createObjectURL(raw);\n\n button.href = window.URL.createObjectURL(raw);\n button.type = \"application/pdf\";\n\n button.download = props.filename + \".pdf\" || \"document.pdf\";\n }\n\n button.click();\n const reset_pending = setTimeout(reset_state, 45000);\n}\n\nfunction reset_state(): void {\n state.content = null;\n btn.value?.removeAttribute(\"download\");\n btn.value?.removeAttribute(\"href\");\n btn.value?.removeAttribute(\"type\");\n}\n</script>\n\n<style scoped lang=\"sass\">\ni.fa::before {\n color: var(--bs-dropdown-link-hover-color);\n}\n</style>\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/DownloadButton.vue",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'onMounted' is defined but never used.",
"line": 25,
"column": 35,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 25,
"endColumn": 44
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'button' is assigned a value but never used.",
"line": 63,
"column": 11,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 63,
"endColumn": 17
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'timer' is assigned a value but never used.",
"line": 110,
"column": 11,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 110,
"endColumn": 16
}
],
"suppressedMessages": [],
"errorCount": 3,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "<template>\n <a\n v-if=\"!state.is_ready\"\n :class=\"props.classes\"\n @click=\"download_and_open($event)\"\n >\n <i class=\"fa fa-download\"></i>\n Télécharger\n </a>\n <a\n v-else\n :class=\"props.classes\"\n target=\"_blank\"\n :type=\"props.storedObject.type\"\n :download=\"buildDocumentName()\"\n :href=\"state.href_url\"\n ref=\"open_button\"\n >\n <i class=\"fa fa-external-link\"></i>\n Ouvrir\n </a>\n</template>\n\n<script lang=\"ts\" setup>\nimport { reactive, ref, nextTick, onMounted } from \"vue\";\nimport { build_download_info_link, download_and_decrypt_doc } from \"./helpers\";\nimport mime from \"mime\";\nimport { StoredObject, StoredObjectCreated } from \"../../types\";\n\ninterface DownloadButtonConfig {\n storedObject: StoredObject | StoredObjectCreated;\n classes: Record<string, boolean>;\n filename?: string;\n}\n\ninterface DownloadButtonState {\n is_ready: boolean;\n is_running: boolean;\n href_url: string;\n}\n\nconst props = defineProps<DownloadButtonConfig>();\nconst state: DownloadButtonState = reactive({\n is_ready: false,\n is_running: false,\n href_url: \"#\",\n});\n\nconst open_button = ref<HTMLAnchorElement | null>(null);\n\nfunction buildDocumentName(): string {\n const document_name = props.filename || \"document\";\n const ext = mime.getExtension(props.storedObject.type);\n\n if (null !== ext) {\n return document_name + \".\" + ext;\n }\n\n return document_name;\n}\n\nasync function download_and_open(event: Event): Promise<void> {\n const button = event.target as HTMLAnchorElement;\n\n if (state.is_running) {\n console.log(\"state is running, aborting\");\n return;\n }\n\n state.is_running = true;\n\n if (state.is_ready) {\n console.log(\"state is ready. This should not happens\");\n return;\n }\n\n const urlInfo = build_download_info_link(props.storedObject.filename);\n let raw;\n\n try {\n raw = await download_and_decrypt_doc(\n urlInfo,\n props.storedObject.keyInfos,\n new Uint8Array(props.storedObject.iv),\n );\n } catch (e) {\n console.error(\"error while downloading and decrypting document\");\n console.error(e);\n throw e;\n }\n\n console.log(\"document downloading (and decrypting) successfully\");\n\n console.log(\"creating the url\");\n state.href_url = window.URL.createObjectURL(raw);\n console.log(\"url created\", state.href_url);\n state.is_running = false;\n state.is_ready = true;\n console.log(\"new button marked as ready\");\n console.log(\"will click on button\");\n\n console.log(\"openbutton is now\", open_button.value);\n\n await nextTick();\n console.log(\"next tick actions\");\n console.log(\"openbutton after next tick\", open_button.value);\n open_button.value?.click();\n console.log(\"open button should have been clicked\");\n\n const timer = setTimeout(reset_state, 45000);\n}\n\nfunction reset_state(): void {\n state.href_url = \"#\";\n state.is_ready = false;\n state.is_running = false;\n}\n</script>\n\n<style scoped lang=\"sass\">\ni.fa::before {\n color: var(--bs-dropdown-link-hover-color);\n}\n</style>\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/WopiEditButton.vue",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'WopiEditButton' is defined but never used.",
"line": 15,
"column": 8,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 15,
"endColumn": 22
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'StoredObjectCreated' is defined but never used.",
"line": 19,
"column": 5,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 19,
"endColumn": 24
}
],
"suppressedMessages": [],
"errorCount": 2,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "<template>\n <a\n :class=\"Object.assign(props.classes, { btn: true })\"\n @click=\"beforeLeave($event)\"\n :href=\"\n build_wopi_editor_link(props.storedObject.uuid, props.returnPath)\n \"\n >\n <i class=\"fa fa-paragraph\"></i>\n Editer en ligne\n </a>\n</template>\n\n<script lang=\"ts\" setup>\nimport WopiEditButton from \"./WopiEditButton.vue\";\nimport { build_wopi_editor_link } from \"./helpers\";\nimport {\n StoredObject,\n StoredObjectCreated,\n WopiEditButtonExecutableBeforeLeaveFunction,\n} from \"../../types\";\n\ninterface WopiEditButtonConfig {\n storedObject: StoredObject;\n returnPath?: string;\n classes: Record<string, boolean>;\n executeBeforeLeave?: WopiEditButtonExecutableBeforeLeaveFunction;\n}\n\nconst props = defineProps<WopiEditButtonConfig>();\n\nlet executed = false;\n\nasync function beforeLeave(event: Event): Promise<true> {\n console.log(executed);\n if (props.executeBeforeLeave === undefined || executed === true) {\n return Promise.resolve(true);\n }\n\n event.preventDefault();\n\n await props.executeBeforeLeave();\n executed = true;\n\n const link = event.target as HTMLAnchorElement;\n link.click();\n\n return Promise.resolve(true);\n}\n</script>\n\n<style scoped lang=\"sass\">\ni.fa::before {\n color: var(--bs-dropdown-link-hover-color);\n}\n</style>\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/_components/AddAsyncUpload.vue",
"messages": [
{
"ruleId": "vue/require-valid-default-prop",
"severity": 2,
"message": "Type of the default value for 'options' prop must be a function.",
"line": 117,
"column": 22,
"nodeType": "ObjectExpression",
"messageId": "invalidType",
"endLine": 121,
"endColumn": 14
},
{
"ruleId": "vue/require-valid-default-prop",
"severity": 2,
"message": "Type of the default value for 'btnClasses' prop must be a function.",
"line": 125,
"column": 22,
"nodeType": "ObjectExpression",
"messageId": "invalidType",
"endLine": 128,
"endColumn": 14
}
],
"suppressedMessages": [],
"errorCount": 2,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "<template>\n <a :class=\"btnClasses\" :title=\"$t(buttonTitle)\" @click=\"openModal\">\n <span>{{ $t(buttonTitle) }}</span>\n </a>\n <teleport to=\"body\">\n <div>\n <modal\n v-if=\"modal.showModal\"\n :modal-dialog-class=\"modal.modalDialogClass\"\n @close=\"modal.showModal = false\"\n >\n <template #header>\n {{ $t(\"upload_a_document\") }}\n </template>\n\n <template #body>\n <div id=\"dropZoneWrapper\" ref=\"dropZoneWrapper\">\n <div\n data-stored-object=\"data-stored-object\"\n :data-label-preparing=\"$t('data_label_preparing')\"\n :data-label-quiet-button=\"\n $t('data_label_quiet_button')\n \"\n :data-label-ready=\"$t('data_label_ready')\"\n :data-dict-file-too-big=\"\n $t('data_dict_file_too_big')\n \"\n :data-dict-default-message=\"\n $t('data_dict_default_message')\n \"\n :data-dict-remove-file=\"$t('data_dict_remove_file')\"\n :data-dict-max-files-exceeded=\"\n $t('data_dict_max_files_exceeded')\n \"\n :data-dict-cancel-upload=\"\n $t('data_dict_cancel_upload')\n \"\n :data-dict-cancel-upload-confirm=\"\n $t('data_dict_cancel_upload_confirm')\n \"\n :data-dict-upload-canceled=\"\n $t('data_dict_upload_canceled')\n \"\n :data-dict-remove=\"$t('data_dict_remove')\"\n :data-allow-remove=\"!options.required\"\n data-temp-url-generator=\"/asyncupload/temp_url/generate/GET\"\n >\n <input\n type=\"hidden\"\n data-async-file-upload=\"data-async-file-upload\"\n data-generate-temp-url-post=\"/asyncupload/temp_url/generate/post?expires_delay=180&amp;submit_delay=3600\"\n data-temp-url-get=\"/asyncupload/temp_url/generate/GET\"\n :data-max-files=\"options.maxFiles\"\n :data-max-post-size=\"options.maxPostSize\"\n :v-model=\"dataAsyncFileUpload\"\n />\n <input type=\"hidden\" data-stored-object-key=\"1\" />\n <input type=\"hidden\" data-stored-object-iv=\"1\" />\n <input type=\"hidden\" data-async-file-type=\"1\" />\n </div>\n </div>\n </template>\n\n <template #footer>\n <button\n class=\"btn btn-create\"\n @click.prevent=\"saveDocument\"\n >\n {{ $t(\"action.add\") }}\n </button>\n </template>\n </modal>\n </div>\n </teleport>\n</template>\n\n<script>\nimport Modal from \"ChillMainAssets/vuejs/_components/Modal\";\nimport { searchForZones } from \"../../module/async_upload/uploader\";\nimport { makeFetch } from \"ChillMainAssets/lib/api/apiMethods\";\n\nconst i18n = {\n messages: {\n fr: {\n upload_a_document: \"Téléversez un document\",\n data_label_preparing: \"Chargement...\",\n data_label_quiet_button: \"Téléchargez le fichier existant\",\n data_label_ready: \"Prêt à montrer\",\n data_dict_file_too_big: \"Fichier trop volumineux\",\n data_dict_default_message: \"Glissez votre fichier ou cliquez ici\",\n data_dict_remove_file:\n \"Enlevez votre fichier pour en téléversez un autre\",\n data_dict_max_files_exceeded:\n \"Nombre maximum de fichiers atteint. Enlevez les fichiers précédents\",\n data_dict_cancel_upload: \"Annulez le téléversement\",\n data_dict_cancel_upload_confirm:\n \"Êtes-vous sûr·e de vouloir annuler ce téléversement?\",\n data_dict_upload_canceled: \"Téléversement annulé\",\n data_dict_remove: \"Enlevez le fichier existant\",\n },\n },\n};\n\nexport default {\n name: \"AddAsyncUpload\",\n components: {\n Modal,\n },\n i18n,\n props: {\n buttonTitle: {\n type: String,\n default: \"Ajouter un document\",\n },\n options: {\n type: Object,\n default: {\n maxFiles: 1,\n maxPostSize: 262144000, // 250MB\n required: false,\n },\n },\n btnClasses: {\n type: Object,\n default: {\n btn: true,\n \"btn-create\": true,\n },\n },\n },\n emits: [\"addDocument\"],\n data() {\n return {\n modal: {\n showModal: false,\n modalDialogClass: \"modal-dialog-centered modal-md\",\n },\n };\n },\n updated() {\n if (this.modal.showModal) {\n searchForZones(this.$refs.dropZoneWrapper);\n }\n },\n methods: {\n openModal() {\n this.modal.showModal = true;\n },\n saveDocument() {\n const dropzone = this.$refs.dropZoneWrapper;\n if (dropzone) {\n const inputKey = dropzone.querySelector(\n \"input[data-stored-object-key]\",\n );\n const inputIv = dropzone.querySelector(\n \"input[data-stored-object-iv]\",\n );\n const inputObject = dropzone.querySelector(\n \"input[data-async-file-upload]\",\n );\n const inputType = dropzone.querySelector(\n \"input[data-async-file-type]\",\n );\n\n const url = \"/api/1.0/docstore/stored-object.json\";\n const body = {\n filename: inputObject.value,\n keyInfos: JSON.parse(inputKey.value),\n iv: JSON.parse(inputIv.value),\n type: inputType.value,\n };\n makeFetch(\"POST\", url, body)\n .then((r) => {\n this.$emit(\"addDocument\", r);\n this.modal.showModal = false;\n })\n .catch((error) => {\n if (error.name === \"ValidationException\") {\n for (let v of error.violations) {\n this.$toast.open({ message: v });\n }\n } else {\n console.error(error);\n this.$toast.open({ message: \"An error occurred\" });\n }\n });\n } else {\n this.$toast.open({\n message: \"An error occurred - drop zone not found\",\n });\n }\n },\n },\n};\n</script>\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillJobBundle/src/Resources/public/module/cv_edit/index.js",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'a' is assigned a value but never used.",
"line": 7,
"column": 7,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 7,
"endColumn": 8
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'event' is defined but never used.",
"line": 11,
"column": 28,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 11,
"endColumn": 33
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'_e' is defined but never used.",
"line": 32,
"column": 43,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 32,
"endColumn": 45
}
],
"suppressedMessages": [],
"errorCount": 3,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "import { ShowHide } from \"ShowHide/show_hide.js\";\n// listen to adding of formation and register a show hide\n\nvar make_show_hide = function (entry) {\n let obtained = entry.querySelector(\"[data-diploma-obtained]\"),\n reconnue = entry.querySelector(\"[data-diploma-reconnue]\");\n var a = new ShowHide({\n load_event: null,\n froms: [obtained],\n container: [reconnue],\n test: function (froms, event) {\n for (let f of froms.values()) {\n for (let input of f.querySelectorAll(\"input\").values()) {\n if (input.value === \"non-fr\") {\n return input.checked;\n }\n }\n }\n\n return false;\n },\n });\n};\n\nwindow.addEventListener(\"collection-add-entry\", function (e) {\n if (e.detail.collection.dataset.collectionName === \"formations\") {\n make_show_hide(e.detail.entry);\n }\n});\n\n// starting the formation on load\nwindow.addEventListener(\"load\", function (_e) {\n let formations = document.querySelectorAll(\"[data-formation-entry]\");\n for (let f of formations.values()) {\n make_show_hide(f);\n }\n});\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillJobBundle/src/Resources/public/module/dispositif_edit/index.js",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'event' is defined but never used.",
"line": 15,
"column": 26,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 15,
"endColumn": 31
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'event' is defined but never used.",
"line": 30,
"column": 26,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 30,
"endColumn": 31
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'event' is defined but never used.",
"line": 47,
"column": 26,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 47,
"endColumn": 31
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'event' is defined but never used.",
"line": 59,
"column": 26,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 59,
"endColumn": 31
}
],
"suppressedMessages": [],
"errorCount": 4,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "import { ShowHide } from \"ShowHide/show_hide.js\";\n\nvar div_accompagnement = document.getElementById(\"form_accompagnement\"),\n div_accompagnement_rqth = document.getElementById(\"form_accompagnement_rqth\"),\n div_accompagnement_comment = document.getElementById(\n \"form_accompagnement_comment\",\n ),\n div_caf_id = document.getElementById(\"cafId\"),\n div_caf_inscription_date = document.getElementById(\"cafInscriptionDate\"),\n div_neet_eligibilite = document.getElementById(\"neetEligibilite\"),\n div_neet_commission_date = document.getElementById(\"neetCommissionDate\");\n// faire apparaitre / disparaitre RQTH si RQTH coché\nnew ShowHide({\n froms: [div_accompagnement],\n test: function (froms, event) {\n for (let el of froms.values()) {\n for (let input of el.querySelectorAll(\"input\").values()) {\n if (input.value === \"rqth\") {\n return input.checked;\n }\n }\n }\n },\n container: [div_accompagnement_rqth],\n});\n\n// faire apparaitre / disparaitre commetnaire si coché\nnew ShowHide({\n froms: [div_accompagnement],\n test: function (froms, event) {\n for (let el of froms.values()) {\n for (let input of el.querySelectorAll(\"input\").values()) {\n if (input.value === \"autre\") {\n return input.checked;\n }\n }\n }\n\n return false;\n },\n container: [div_accompagnement_comment],\n});\n\n// faire apparaitre cafInscriptionDate seulement si cafID est rempli\nnew ShowHide({\n froms: [div_caf_id],\n test: function (froms, event) {\n for (let el of froms.values()) {\n return el.querySelector(\"input\").value !== \"\";\n }\n },\n container: [div_caf_inscription_date],\n event_name: \"input\",\n});\n\n// faire apparaitre date de commission neet seulement si eligible\nnew ShowHide({\n froms: [div_neet_eligibilite],\n test: function (froms, event) {\n for (let el of froms.values()) {\n for (let input of el.querySelectorAll(\"input\").values()) {\n if (input.value === \"oui\") {\n return input.checked;\n }\n }\n }\n\n return false;\n },\n container: [div_neet_commission_date],\n});\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillJobBundle/src/Resources/public/module/immersion_edit/index.js",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'event' is defined but never used.",
"line": 8,
"column": 26,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 8,
"endColumn": 31
}
],
"suppressedMessages": [],
"errorCount": 1,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "import { ShowHide } from \"ShowHide/show_hide.js\";\n\nvar div_objectifs = document.getElementById(\"objectifs\"),\n div_objectifs_autre = document.getElementById(\"objectifsAutre\");\nnew ShowHide({\n froms: [div_objectifs],\n container: [div_objectifs_autre],\n test: function (froms, event) {\n for (let el of froms.values()) {\n for (let input of el.querySelectorAll(\"input\").values()) {\n if (input.value === \"autre\") {\n return input.checked;\n }\n }\n }\n },\n});\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillMainBundle/Resources/public/chill/js/chill.js",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'moment' is defined but never used.",
"line": 3,
"column": 11,
"nodeType": "Program",
"messageId": "unusedVar",
"endLine": 3,
"endColumn": 17
},
{
"ruleId": "@typescript-eslint/prefer-for-of",
"severity": 2,
"message": "Expected a `for-of` loop instead of a `for` loop with this simple iteration.",
"line": 241,
"column": 17,
"nodeType": "ForStatement",
"messageId": "preferForOf",
"endLine": 249,
"endColumn": 18
},
{
"ruleId": "@typescript-eslint/prefer-for-of",
"severity": 2,
"message": "Expected a `for-of` loop instead of a `for` loop with this simple iteration.",
"line": 282,
"column": 21,
"nodeType": "ForStatement",
"messageId": "preferForOf",
"endLine": 290,
"endColumn": 22
},
{
"ruleId": "@typescript-eslint/prefer-for-of",
"severity": 2,
"message": "Expected a `for-of` loop instead of a `for` loop with this simple iteration.",
"line": 315,
"column": 7,
"nodeType": "ForStatement",
"messageId": "preferForOf",
"endLine": 317,
"endColumn": 8
},
{
"ruleId": "@typescript-eslint/prefer-for-of",
"severity": 2,
"message": "Expected a `for-of` loop instead of a `for` loop with this simple iteration.",
"line": 319,
"column": 7,
"nodeType": "ForStatement",
"messageId": "preferForOf",
"endLine": 321,
"endColumn": 8
},
{
"ruleId": "@typescript-eslint/prefer-for-of",
"severity": 2,
"message": "Expected a `for-of` loop instead of a `for` loop with this simple iteration.",
"line": 352,
"column": 5,
"nodeType": "ForStatement",
"messageId": "preferForOf",
"endLine": 358,
"endColumn": 6
}
],
"suppressedMessages": [],
"errorCount": 6,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "/* jslint vars: true */\n/*jslint indent: 4 */\n/* global moment, $, window */\n\"use strict\";\n\nvar chill = (function () {\n /**\n * Display an alert message when the user wants to leave a page containing a given form\n * in a given state.\n *\n * The action of displaying the form be parametrised as :\n * - always display the alert message when leaving\n * - only display the alert message when the form contains some modified fields.\n *\n * @param{string} form_id An identification string of the form\n * @param{string} alert_message The alert message to display\n * @param{boolean} check_unsaved_data If true display the alert message only when the form\n * contains some modified fields otherwise always display the alert when leaving\n * @return nothing\n */\n function _generalDisplayAlertWhenLeavingForm(\n form_id,\n alert_message,\n check_unsaved_data,\n ) {\n var form_submitted = false;\n var unsaved_data = false;\n\n $(form_id)\n .submit(function () {\n form_submitted = true;\n })\n .on(\"reset\", function () {\n unsaved_data = false;\n });\n\n $.each($(form_id).find(\":input\"), function (i, e) {\n $(e).change(function () {\n unsaved_data = true;\n });\n });\n\n $(window).bind(\"beforeunload\", function () {\n if (!form_submitted && (unsaved_data || !check_unsaved_data)) {\n return alert_message;\n }\n });\n }\n\n /**\n * Mark the choices \"not specified\" as check by default.\n *\n * This function apply to `custom field choices` when the `required`\n * option is false and `expanded` is true (checkboxes or radio buttons).\n *\n * @param{string} choice_name the name of the input\n */\n function checkNullValuesInChoices(choice_name) {\n var choices;\n choices = $(\"input[name='\" + choice_name + \"']:checked\");\n if (choices.size() === 0) {\n $.each($(\"input[name='\" + choice_name + \"']\"), function (i, e) {\n if (e.value === \"\") {\n e.checked = true;\n }\n });\n }\n }\n\n /**\n * Display an alert message when the user wants to leave a page containing a given\n * modified form.\n *\n * @param{string} form_id An identification string of the form\n * @param{string} alert_message The alert message to display\n * @return nothing\n */\n function displayAlertWhenLeavingModifiedForm(form_id, alert_message) {\n _generalDisplayAlertWhenLeavingForm(form_id, alert_message, true);\n }\n\n /**\n * Display an alert message when the user wants to leave a page containing a given\n * form that was not submitted.\n *\n * @param{string} form_id An identification string of the form\n * @param{string} alert_message The alert message to display\n * @return nothing\n */\n function displayAlertWhenLeavingUnsubmittedForm(form_id, alert_message) {\n _generalDisplayAlertWhenLeavingForm(form_id, alert_message, false);\n }\n\n /* Enable the following behavior : when the user change the value\n of an other field, its checkbox is checked.\n */\n function checkOtherValueOnChange() {\n $(\".input-text-other-value\").each(function () {\n $(this).change(function () {\n var checkbox = $(this)\n .parent()\n .find(\"input[type=checkbox][value=_other]\")[0];\n $(checkbox).prop(\"checked\", $(this).val() !== \"\");\n });\n });\n }\n\n /**\n * Create an interraction between two select element (the parent and the\n * child) of a given form : each parent option has a category, the\n * child select only display options that have the same category of the\n * parent optionn\n *\n * The parent must have the class \"chill-category-link-parent\".\n *\n * The children must have the class \"chill-category-link-child\". Each option\n * of the parent must have the attribute `data-link-category`, with the value of\n * the connected option in parent.\n *\n * Example :\n *\n * ```html\n * <select name=\"country\" class=\"chill-category-link-parent\">\n * <option value=\"BE\">Belgium</option>\n * <option value=\"FR\">France</option>\n * </select>\n *\n * <select name=\"cities\">class=\"chill-category-link-children\">\n * <option value=\"paris\" data-link-category=\"FR\">Paris</option>\n * <option value=\"toulouse\" data-link-category=\"FR\">Toulouse</option>\n * <option value=\"bruxelles\" data-link-category=\"BE\">Bruxelles</option>\n * <option value=\"liege\" data-link-category=\"BE\">Liège</option>\n * <option value=\"mons\" data-link-category=\"BE\">Mons</option>\n * </select>\n * ```\n *\n * TODO ECRIRE LA DOC METTRE LES TESTS DANS git :\n * tester que init est ok :\n - quand vide\n - quand choix\n * tester que quand sélection\n - quand vide\n - quand choix\n */\n function categoryLinkParentChildSelect() {\n var forms_to_link = $(\"form:has(select.chill-category-link-parent)\");\n\n forms_to_link.each(function (i, form_selector) {\n var form = $(form_selector),\n parent_multiple;\n form.old_category = null;\n form.link_parent = $(form).find(\".chill-category-link-parent\");\n form.link_child = $(form).find(\".chill-category-link-child\");\n\n // check if the parent allow multiple or single results\n parent_multiple = $(form)\n .find(\".chill-category-link-parent\")\n .get(0).multiple;\n // if we use select2, parent_multiple will be `undefined`\n if (typeof parent_multiple == \"undefined\") {\n // currently, I do not know how to check if multiple using select2.\n // we suppose that multiple is false (old behaviour)\n parent_multiple = false;\n }\n\n $(form.link_parent).addClass(\"select2\");\n $(form.link_parant).select2({ allowClear: true }); // it is weird: when I fix the typo here, the whole stuff does not work anymore...\n\n if (parent_multiple == false) {\n form.old_category = null;\n if ($(form.link_parent).select2(\"data\") !== null) {\n form.old_category = $(form.link_parent).select2(\n \"data\",\n ).element[0].dataset.linkCategory;\n }\n\n $(form.link_child)\n .find(\"option\")\n .each(function (i, e) {\n if (\n (!$(e).data(\"link-category\") ||\n $(e).data(\"link-category\") == form.old_category) &&\n (!$(e).data(\"link-categories\") ||\n form.old_category in $(e).data(\"link-categories\").split(\",\"))\n ) {\n $(e).show();\n // here, we should handle the optgroup\n } else {\n $(e).hide();\n // here, we should handle the optgroup\n }\n });\n\n form.link_parent.change(function () {\n var new_category = $(form.link_parent).select2(\"data\").element[0]\n .dataset.linkCategory;\n if (new_category != form.old_category) {\n $(form.link_child)\n .find(\"option\")\n .each(function (i, e) {\n if (\n (!$(e).data(\"link-category\") ||\n $(e).data(\"link-category\") == new_category) &&\n (!$(e).data(\"link-categories\") ||\n new_category in $(e).data(\"link-categories\").split(\",\"))\n ) {\n $(e).show();\n // here, we should handle the optgroup\n } else {\n $(e).hide();\n // here, we should handle the opgroup\n }\n });\n $(form.link_child).find(\"option\")[0].selected = true;\n form.old_category = new_category;\n }\n });\n } else {\n var i = 0,\n selected_items = $(form.link_parent).find(\":selected\");\n\n form.old_categories = [];\n for (i = 0; i < selected_items.length; i++) {\n form.old_categories.push(selected_items[i].value);\n }\n\n $(form.link_child)\n .find(\"option\")\n .each(function (i, e) {\n var visible;\n if (form.old_categories.indexOf(e.dataset.linkCategory) != -1) {\n $(e).show();\n if (e.parentNode instanceof HTMLOptGroupElement) {\n $(e.parentNode).show();\n }\n } else {\n $(e).hide();\n if (e.parentNode instanceof HTMLOptGroupElement) {\n // we check if the other options are visible.\n visible = false;\n for (var l = 0; l < e.parentNode.children.length; l++) {\n if (\n window\n .getComputedStyle(e.parentNode.children[l])\n .getPropertyValue(\"display\") != \"none\"\n ) {\n visible = true;\n }\n }\n // if any options are visible, we hide the optgroup\n if (visible == false) {\n $(e.parentNode).hide();\n }\n }\n }\n });\n\n form.link_parent.change(function () {\n var new_categories = [],\n selected_items = $(form.link_parent).find(\":selected\"),\n visible;\n for (i = 0; i < selected_items.length; i++) {\n new_categories.push(selected_items[i].value);\n }\n\n if (new_categories != form.old_categories) {\n $(form.link_child)\n .find(\"option\")\n .each(function (i, e) {\n if (new_categories.indexOf(e.dataset.linkCategory) != -1) {\n $(e).show();\n // if parent is an opgroup, we show it\n if (e.parentNode instanceof HTMLOptGroupElement) {\n $(e.parentNode).show();\n }\n } else {\n $(e).hide();\n // we check if the parent is an optgroup\n if (e.parentNode instanceof HTMLOptGroupElement) {\n // we check if other options are visible\n visible = false;\n for (var l = 0; l < e.parentNode.children.length; l++) {\n if (\n window\n .getComputedStyle(e.parentNode.children[l])\n .getPropertyValue(\"display\") != \"none\"\n ) {\n visible = true;\n }\n }\n // if any options are visible, we hide the optgroup\n if (visible == false) {\n $(e.parentNode).hide();\n }\n }\n }\n });\n //$(form.link_child).find('option')[0].selected = true;\n form.old_categories = new_categories;\n }\n });\n }\n });\n }\n\n function _displayHideTargetWithCheckbox(checkbox) {\n var target = checkbox.dataset.displayTarget,\n hideableElements;\n\n hideableElements = document.querySelectorAll(\n '[data-display-show-hide=\"' + target + '\"]',\n );\n\n if (checkbox.checked) {\n for (let i = 0; i < hideableElements.length; i = i + 1) {\n hideableElements[i].style.display = \"unset\";\n }\n } else {\n for (let i = 0; i < hideableElements.length; i = i + 1) {\n hideableElements[i].style.display = \"none\";\n }\n }\n }\n\n /**\n * create an interaction between a checkbox and element to show if the\n * checkbox is checked, or hide if the checkbox is not checked.\n *\n * The checkbox must have the data `data-display-target` with an id,\n * and the parts to show/hide must have the data `data-display-show-hide`\n * with the same value.\n *\n * Example :\n *\n * ```\n * <input data-display-target=\"export_abc\" value=\"1\" type=\"checkbox\">\n *\n * <div data-display-show-hide=\"export_abc\">\n * <!-- your content here will be hidden / shown according to checked state -->\n * </div>\n * ```\n *\n * Hint: for forms in symfony, you could use the `id` of the form element,\n * accessible through `{{ form.vars.id }}`. This id should be unique.\n *\n *\n * @returns {undefined}\n */\n function listenerDisplayCheckbox() {\n var elements = document.querySelectorAll(\"[data-display-target]\");\n\n for (let i = 0; i < elements.length; i = i + 1) {\n elements[i].addEventListener(\"change\", function (e) {\n _displayHideTargetWithCheckbox(e.target);\n });\n // initial display-hide\n _displayHideTargetWithCheckbox(elements[i]);\n }\n }\n\n return {\n checkOtherValueOnChange: checkOtherValueOnChange,\n displayAlertWhenLeavingModifiedForm: displayAlertWhenLeavingModifiedForm,\n displayAlertWhenLeavingUnsubmittedForm:\n displayAlertWhenLeavingUnsubmittedForm,\n checkNullValuesInChoices: checkNullValuesInChoices,\n categoryLinkParentChildSelect: categoryLinkParentChildSelect,\n listenerDisplayCheckbox: listenerDisplayCheckbox,\n };\n})();\n\nexport { chill };\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillMainBundle/Resources/public/chill/js/counter.js",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'e' is defined but never used.",
"line": 28,
"column": 55,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 28,
"endColumn": 56
}
],
"suppressedMessages": [],
"errorCount": 1,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "/**\n *\n * This script search for span.counter elements like\n * <span class=\"counter\">Il y a 4 notifications</span>\n * and return\n * <span class=\"counter\">Il y a <span>4</span> notifications</span>\n *\n */\nconst isNum = (v) => !isNaN(v);\n\nconst parseCounter = () => {\n document.querySelectorAll(\"span.counter\").forEach((el) => {\n let r = [];\n el.innerText\n .trim()\n .split(\" \")\n .forEach((w) => {\n if (isNum(w)) {\n r.push(`<span>${w}</span>`);\n } else {\n r.push(w);\n }\n });\n el.innerHTML = r.join(\" \");\n });\n};\n\nwindow.addEventListener(\"DOMContentLoaded\", function (e) {\n parseCounter();\n});\n\nexport { parseCounter };\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillMainBundle/Resources/public/lib/download-report/download-report.js",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'mime' is defined but never used.",
"line": 18,
"column": 8,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 18,
"endColumn": 12
}
],
"suppressedMessages": [],
"errorCount": 1,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "/*\n * Copyright (C) 2018 Champs Libres Cooperative <info@champs-libres.coop>\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport mime from \"mime\";\n\nexport const download_report = (url, container) => {\n var download_text = container.dataset.downloadText,\n alias = container.dataset.alias;\n\n window\n .fetch(url, { credentials: \"same-origin\" })\n .then((response) => {\n if (!response.ok) {\n throw Error(response.statusText);\n }\n\n return response.blob();\n })\n .then((blob) => {\n var content = URL.createObjectURL(blob),\n link = document.createElement(\"a\"),\n type = blob.type,\n hasForcedType = \"mimeType\" in container.dataset,\n extension;\n\n if (hasForcedType) {\n // force a type\n type = container.dataset.mimeType;\n blob = new Blob([blob], { type: type });\n content = URL.createObjectURL(blob);\n }\n\n const extensions = new Map();\n extensions.set(\n \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\",\n \"xlsx\",\n );\n extensions.set(\"application/vnd.oasis.opendocument.spreadsheet\", \"ods\");\n extensions.set(\"application/vnd.ms-excel\", \"xlsx\");\n extensions.set(\"text/csv\", \"csv\");\n extensions.set(\"text/csv; charset=utf-8\", \"csv\");\n\n extension = extensions.get(type);\n\n link.appendChild(document.createTextNode(download_text));\n link.classList.add(\"btn\", \"btn-action\");\n link.href = content;\n link.download = alias;\n if (extension !== false) {\n link.download = link.download + \".\" + extension;\n }\n container.innerHTML = \"\";\n container.appendChild(link);\n })\n .catch(function (error) {\n console.error(error);\n var problem_text = document.createTextNode(\"Problem during download\");\n\n container.replaceChild(problem_text, container.firstChild);\n });\n};\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillMainBundle/Resources/public/lib/select_interactive_loading/index.js",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'e' is defined but never used.",
"line": 1,
"column": 43,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 1,
"endColumn": 44
},
{
"ruleId": "@typescript-eslint/prefer-for-of",
"severity": 2,
"message": "Expected a `for-of` loop instead of a `for` loop with this simple iteration.",
"line": 5,
"column": 3,
"nodeType": "ForStatement",
"messageId": "preferForOf",
"endLine": 29,
"endColumn": 4
}
],
"suppressedMessages": [],
"errorCount": 2,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "window.addEventListener(\"load\", function (e) {\n var postalCodes = document.querySelectorAll(\n \"[data-select-interactive-loading]\",\n );\n for (let i = 0; i < postalCodes.length; i++) {\n let searchUrl = postalCodes[i].dataset.searchUrl,\n noResultsLabel = postalCodes[i].dataset.noResultsLabel,\n errorLoadLabel = postalCodes[i].dataset.errorLoadLabel,\n searchingLabel = postalCodes[i].dataset.searchingLabel;\n $(postalCodes[i]).select2({\n allowClear: true,\n language: {\n errorLoading: function () {\n return errorLoadLabel;\n },\n noResults: function () {\n return noResultsLabel;\n },\n searching: function () {\n return searchingLabel;\n },\n },\n ajax: {\n url: searchUrl,\n dataType: \"json\",\n delay: 250,\n },\n });\n }\n});\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillMainBundle/Resources/public/lib/tabs/tabs.js",
"messages": [
{
"ruleId": "@typescript-eslint/prefer-for-of",
"severity": 2,
"message": "Expected a `for-of` loop instead of a `for` loop with this simple iteration.",
"line": 19,
"column": 3,
"nodeType": "ForStatement",
"messageId": "preferForOf",
"endLine": 24,
"endColumn": 4
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'pane' is defined but never used.",
"line": 51,
"column": 30,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 51,
"endColumn": 34
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'tabs' is assigned a value but never used.",
"line": 77,
"column": 9,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 77,
"endColumn": 13
}
],
"suppressedMessages": [],
"errorCount": 3,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "/*\n * Remove active class on both elements: link and content\n */\nlet resetActive = function (links, contents) {\n for (items of [links, contents]) {\n items.forEach(function (item) {\n if (item.classList.contains(\"active\")) {\n item.classList.remove(\"active\");\n }\n });\n }\n};\n\n/*\n * Count links array and return rank of given link\n */\nlet countNewActive = function (links, link) {\n let rank = 0;\n for (let i = 0; i < links.length; ++i) {\n rank++;\n if (links[i] == link) {\n return rank;\n }\n }\n};\n\n/*\n * Set class active on both new elements: link and content\n */\nlet setNewActive = function (links, contents, rank) {\n if (!links[rank - 1]) {\n rank = 1;\n }\n link = links[rank - 1];\n\n link.classList.add(\"active\");\n\n count = 0;\n contents.forEach(function (pane) {\n count++;\n if (rank == count) {\n pane.classList.add(\"active\");\n }\n });\n};\n\n/*\n * Set height of content pane\n */\nlet setPaneHeight = function (contents) {\n contents.forEach(function (pane) {\n // let computedStyle = getComputedStyle(pane);\n // console.log(computedStyle.height);\n // comment prendre la hauteur d'une div masquée avec display:none\n });\n};\n\n/*\n * Check if links are defined in controller\n * If true, disable javascript listener\n */\nlet isLinkRef = function (link) {\n if (link.getAttribute(\"href\") == \"#\") {\n return false;\n }\n return true;\n};\n\n/*\n * Main function\n */\nwindow.addEventListener(\"load\", function () {\n tabParams.forEach(function (unit) {\n let tabPanel = document.querySelector(\"#\" + unit.id);\n if (tabPanel) {\n let nav = tabPanel.querySelector(\"nav\"),\n tabs = nav.querySelectorAll(\"ul.nav-tabs li.nav-item\"),\n links = nav.querySelectorAll(\"ul.nav-tabs li.nav-item a.nav-link\"),\n contents = tabPanel.querySelectorAll(\"div.tab-content div.tab-pane\");\n if (unit.type == \"pill\") {\n tabPanel.classList.add(\"pills\");\n }\n\n if (!unit.initPane) {\n unit.initPane = 1;\n }\n\n setPaneHeight(contents);\n\n // initial position\n setNewActive(links, contents, unit.initPane);\n\n // listen\n links.forEach(function (link) {\n if (isLinkRef(link) == false) {\n link.addEventListener(\"click\", function () {\n resetActive(links, contents);\n setNewActive(links, contents, countNewActive(links, link));\n });\n }\n });\n }\n });\n});\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillMainBundle/Resources/public/module/blur/index.js",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'e' is defined but never used.",
"line": 9,
"column": 32,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 9,
"endColumn": 33
}
],
"suppressedMessages": [],
"errorCount": 1,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "require(\"./blur.scss\");\n\ndocument.querySelectorAll(\".confidential\").forEach(function (el) {\n let i = document.createElement(\"i\");\n const classes = [\"fa\", \"fa-eye-slash\", \"toggle-twig\"];\n i.classList.add(...classes);\n el.appendChild(i);\n\n const toggleBlur = function (e) {\n for (let child of el.children) {\n if (!child.classList.contains(\"toggle-twig\")) {\n child.classList.toggle(\"blur\");\n }\n }\n i.classList.toggle(\"fa-eye-slash\");\n i.classList.toggle(\"fa-eye\");\n };\n i.addEventListener(\"click\", toggleBlur);\n toggleBlur();\n});\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillMainBundle/Resources/public/module/bootstrap/index.js",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'Dropdown' is defined but never used.",
"line": 8,
"column": 8,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 8,
"endColumn": 16
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'Modal' is defined but never used.",
"line": 9,
"column": 8,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 9,
"endColumn": 13
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'Collapse' is defined but never used.",
"line": 10,
"column": 8,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 10,
"endColumn": 16
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'carousel' is assigned a value but never used.",
"line": 27,
"column": 5,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 27,
"endColumn": 13
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'e' is defined but never used.",
"line": 34,
"column": 50,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 34,
"endColumn": 51
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'popoverList' is assigned a value but never used.",
"line": 62,
"column": 7,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 62,
"endColumn": 18
}
],
"suppressedMessages": [],
"errorCount": 6,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "// Compile all bootstrap assets from nodes-modules\n//require('bootstrap/scss/bootstrap.scss')\n\n// Or compile bootstrap only enabled assets\nrequire(\"./bootstrap.scss\");\n\n// You can specify which plugins you need\nimport Dropdown from \"bootstrap/js/src/dropdown\";\nimport Modal from \"bootstrap/js/dist/modal\";\nimport Collapse from \"bootstrap/js/src/collapse\";\nimport Carousel from \"bootstrap/js/src/carousel\";\nimport Popover from \"bootstrap/js/src/popover\";\nimport \"bootstrap-icons/font/bootstrap-icons.css\";\n\n//\n// Carousel: ACHeaderSlider is a small slider used in banner of AccompanyingCourse Section\n// Initialize options, and show/hide controls in first/last slides\n//\nlet ACHeaderSlider = document.querySelector(\"#ACHeaderSlider\");\nif (ACHeaderSlider) {\n let controlPrev = ACHeaderSlider.querySelector(\n 'button[data-bs-slide=\"prev\"]',\n ),\n controlNext = ACHeaderSlider.querySelector('button[data-bs-slide=\"next\"]'),\n length = ACHeaderSlider.querySelectorAll(\".carousel-item\").length,\n last = length - 1,\n carousel = new Carousel(ACHeaderSlider, {\n interval: false,\n wrap: false,\n ride: false,\n keyboard: false,\n touch: true,\n });\n document.addEventListener(\"DOMContentLoaded\", (e) => {\n controlNext.classList.remove(\"visually-hidden\");\n });\n ACHeaderSlider.addEventListener(\"slid.bs.carousel\", (e) => {\n //console.log('from slide', e.direction, e.relatedTarget, e.from, e.to );\n switch (e.to) {\n case 0:\n controlPrev.classList.add(\"visually-hidden\");\n controlNext.classList.remove(\"visually-hidden\");\n break;\n case last:\n controlPrev.classList.remove(\"visually-hidden\");\n controlNext.classList.add(\"visually-hidden\");\n break;\n default:\n controlPrev.classList.remove(\"visually-hidden\");\n controlNext.classList.remove(\"visually-hidden\");\n }\n });\n}\n\n//\n// Popover: used in workflow breadcrumb,\n// (expected in: contextual help, notification-box, workflow-box )\n//\nconst triggerList = [].slice.call(\n document.querySelectorAll('[data-bs-toggle=\"popover\"]'),\n);\nconst popoverList = triggerList.map(function (el) {\n return new Popover(el, {\n html: true,\n });\n});\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillMainBundle/Resources/public/module/disable-buttons/index.js",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'e' is defined but never used.",
"line": 9,
"column": 43,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 9,
"endColumn": 44
},
{
"ruleId": "@typescript-eslint/prefer-for-of",
"severity": 2,
"message": "Expected a `for-of` loop instead of a `for` loop with this simple iteration.",
"line": 10,
"column": 3,
"nodeType": "ForStatement",
"messageId": "preferForOf",
"endLine": 12,
"endColumn": 4
}
],
"suppressedMessages": [],
"errorCount": 2,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "/**\n * Submit button(s) are disabled as soon as submit button is clicked and form is submitted.\n * ID 'create-form' must be added to submit forms.\n */\n\nvar form = document.getElementById(\"create-form\");\nvar submitButtons = document.querySelectorAll(\"[type=submit]\");\n\nform.addEventListener(\"submit\", function (e) {\n for (var i = 0; i < submitButtons.length; i++) {\n submitButtons[i].disabled = true;\n }\n});\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillMainBundle/Resources/public/module/notification/toggle_read.js",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'NotificationReadAllToggle' is defined but never used.",
"line": 4,
"column": 8,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 4,
"endColumn": 33
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'e' is defined but never used.",
"line": 8,
"column": 55,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 8,
"endColumn": 56
}
],
"suppressedMessages": [],
"errorCount": 2,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "import { createApp } from \"vue\";\nimport NotificationReadToggle from \"ChillMainAssets/vuejs/_components/Notification/NotificationReadToggle.vue\";\nimport { _createI18n } from \"ChillMainAssets/vuejs/_js/i18n\";\nimport NotificationReadAllToggle from \"ChillMainAssets/vuejs/_components/Notification/NotificationReadAllToggle.vue\";\n\nconst i18n = _createI18n({});\n\nwindow.addEventListener(\"DOMContentLoaded\", function (e) {\n document\n .querySelectorAll(\".notification_toggle_read_status\")\n .forEach(function (el, i) {\n createApp({\n template: `<notification-read-toggle\n :notificationId=\"notificationId\"\n :buttonClass=\"buttonClass\"\n :buttonNoText=\"buttonNoText\"\n :showUrl=\"showUrl\"\n :isRead=\"isRead\"\n @markRead=\"onMarkRead\"\n @markUnread=\"onMarkUnread\">\n </notification-read-toggle>`,\n components: {\n NotificationReadToggle,\n },\n data() {\n return {\n notificationId: parseInt(el.dataset.notificationId),\n buttonClass: el.dataset.buttonClass,\n buttonNoText: \"false\" === el.dataset.buttonText,\n showUrl: el.dataset.showButtonUrl,\n isRead: 1 === Number.parseInt(el.dataset.notificationCurrentIsRead),\n container: el.dataset.container,\n };\n },\n computed: {\n getContainer() {\n return document.querySelectorAll(`div.${this.container}`);\n },\n },\n methods: {\n onMarkRead() {\n if (typeof this.getContainer[i] !== \"undefined\") {\n this.getContainer[i].classList.replace(\"read\", \"unread\");\n } else {\n throw \"data-container attribute is missing\";\n }\n this.isRead = false;\n },\n onMarkUnread() {\n if (typeof this.getContainer[i] !== \"undefined\") {\n this.getContainer[i].classList.replace(\"unread\", \"read\");\n } else {\n throw \"data-container attribute is missing\";\n }\n this.isRead = true;\n },\n },\n })\n .use(i18n)\n .mount(el);\n });\n});\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillMainBundle/Resources/public/module/pick-entity/index.js",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-expressions",
"severity": 2,
"message": "Expected an assignment or function call and instead saw an expression.",
"line": 26,
"column": 5,
"nodeType": "ExpressionStatement",
"messageId": "unusedExpression",
"endLine": 29,
"endColumn": 61
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'e' is defined but never used.",
"line": 173,
"column": 57,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 173,
"endColumn": 58
}
],
"suppressedMessages": [],
"errorCount": 2,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "import { createApp } from \"vue\";\nimport PickEntity from \"ChillMainAssets/vuejs/PickEntity/PickEntity.vue\";\nimport { _createI18n } from \"ChillMainAssets/vuejs/_js/i18n\";\nimport { appMessages } from \"ChillMainAssets/vuejs/PickEntity/i18n\";\n\nconst i18n = _createI18n(appMessages);\n\nlet appsOnPage = new Map();\nlet appsPerInput = new Map();\n\nfunction loadDynamicPicker(element) {\n let apps = element.querySelectorAll('[data-module=\"pick-dynamic\"]');\n\n apps.forEach(function (el) {\n const isMultiple = parseInt(el.dataset.multiple) === 1,\n uniqId = el.dataset.uniqid,\n input = element.querySelector(\n '[data-input-uniqid=\"' + el.dataset.uniqid + '\"]',\n ),\n // the \"picked\" will always be an array, even if multiple is false\n picked = isMultiple\n ? JSON.parse(input.value)\n : input.value === \"[]\" || input.value === \"\"\n ? null\n : [JSON.parse(input.value)];\n (suggested = JSON.parse(el.dataset.suggested)),\n (as_id = parseInt(el.dataset.asId) === 1),\n (submit_on_adding_new_entity =\n parseInt(el.dataset.submitOnAddingNewEntity) === 1);\n label = el.dataset.label;\n\n if (!isMultiple) {\n if (input.value === \"[]\") {\n input.value = null;\n }\n }\n\n const app = createApp({\n template:\n \"<pick-entity \" +\n ':multiple=\"multiple\" ' +\n ':types=\"types\" ' +\n ':picked=\"picked\" ' +\n ':uniqid=\"uniqid\" ' +\n ':suggested=\"notPickedSuggested\" ' +\n ':label=\"label\" ' +\n '@addNewEntity=\"addNewEntity\" ' +\n '@removeEntity=\"removeEntity\"></pick-entity>',\n components: {\n PickEntity,\n },\n data() {\n return {\n multiple: isMultiple,\n types: JSON.parse(el.dataset.types),\n picked: picked === null ? [] : picked,\n uniqid: el.dataset.uniqid,\n suggested,\n as_id,\n submit_on_adding_new_entity,\n label,\n };\n },\n computed: {\n notPickedSuggested() {\n const pickedIds = new Set();\n for (const p of this.picked) {\n pickedIds.add(`${p.type}${p.id}`);\n }\n return this.suggested.filter(\n (e) => !pickedIds.has(`${e.type}${e.id}`),\n );\n },\n },\n methods: {\n addNewEntity({ entity }) {\n if (this.multiple) {\n if (\n !this.picked.some((el) => {\n return el.type === entity.type && el.id === entity.id;\n })\n ) {\n this.picked.push(entity);\n if (!as_id) {\n input.value = JSON.stringify(this.picked);\n } else {\n const ids = this.picked.map((el) => el.id);\n input.value = ids.join(\",\");\n }\n console.log(entity);\n }\n } else {\n if (\n !this.picked.some((el) => {\n return el.type === entity.type && el.id === entity.id;\n })\n ) {\n this.picked.splice(0, this.picked.length);\n this.picked.push(entity);\n if (!as_id) {\n input.value = JSON.stringify(this.picked[0]);\n } else {\n input.value = this.picked.map((el) => el.id);\n }\n }\n }\n\n if (this.submit_on_adding_new_entity) {\n input.form.submit();\n }\n },\n removeEntity({ entity }) {\n if (\n -1 ===\n this.suggested.findIndex(\n (e) => e.type === entity.type && e.id === entity.id,\n )\n ) {\n this.suggested.push(entity);\n }\n this.picked = this.picked.filter(\n (e) => !(e.type === entity.type && e.id === entity.id),\n );\n if (this.multiple) {\n input.value = JSON.stringify(this.picked);\n } else {\n input.value = \"\";\n }\n },\n },\n })\n .use(i18n)\n .mount(el);\n\n appsOnPage.set(uniqId, app);\n appsPerInput.set(input.name, app);\n });\n}\n\ndocument.addEventListener(\"show-hide-show\", function (e) {\n loadDynamicPicker(e.detail.container);\n});\n\ndocument.addEventListener(\"show-hide-hide\", function (e) {\n console.log(\"hiding event caught\");\n e.detail.container\n .querySelectorAll('[data-module=\"pick-dynamic\"]')\n .forEach((el) => {\n let uniqId = el.dataset.uniqid;\n if (appsOnPage.has(uniqId)) {\n appsOnPage.get(uniqId).unmount();\n appsOnPage.delete(uniqId);\n }\n });\n});\n\ndocument.addEventListener(\"pick-entity-type-action\", function (e) {\n console.log(\"pick entity event\", e);\n if (!appsPerInput.has(e.detail.name)) {\n console.error(\"no app with this name\");\n return;\n }\n const app = appsPerInput.get(e.detail.name);\n if (e.detail.action === \"add\") {\n app.addNewEntity(e.detail.entity);\n } else if (e.detail.action === \"remove\") {\n app.removeEntity(e.detail.entity);\n } else {\n console.error(\"action not supported: \" + e.detail.action);\n }\n});\n\ndocument.addEventListener(\"DOMContentLoaded\", function (e) {\n loadDynamicPicker(document);\n});\n\nwindow.loadDynamicPicker = loadDynamicPicker;\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillMainBundle/Resources/public/module/pick-postal-code/index.js",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'app' is assigned a value but never used.",
"line": 10,
"column": 9,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 10,
"endColumn": 12
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'city' is defined but never used.",
"line": 26,
"column": 21,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 26,
"endColumn": 25
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'e' is defined but never used.",
"line": 55,
"column": 57,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 55,
"endColumn": 58
}
],
"suppressedMessages": [],
"errorCount": 3,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "import { createApp } from \"vue\";\nimport PickPostalCode from \"ChillMainAssets/vuejs/PickPostalCode/PickPostalCode\";\nimport { _createI18n } from \"ChillMainAssets/vuejs/_js/i18n\";\nimport { appMessages } from \"ChillMainAssets/vuejs/PickEntity/i18n\";\nimport { makeFetch } from \"ChillMainAssets/lib/api/apiMethods\";\n\nconst i18n = _createI18n(appMessages);\n\nfunction loadOnePicker(el, input, uniqId, city) {\n const app = createApp({\n template:\n '<pick-postal-code @select-city=\"onCitySelected\" @removeCity=\"onCityRemoved\" :picked=\"city\"></pick-postal-code>',\n components: {\n PickPostalCode,\n },\n data() {\n return {\n city: city,\n };\n },\n methods: {\n onCitySelected(city) {\n this.city = city;\n input.value = city.id;\n },\n onCityRemoved(city) {\n this.city = null;\n input.value = \"\";\n },\n },\n })\n .use(i18n)\n .mount(el);\n}\n\nfunction loadDynamicPickers(element) {\n let apps = element.querySelectorAll('[data-module=\"pick-postal-code\"]');\n\n apps.forEach(function (el) {\n const uniqId = el.dataset.uniqid,\n input = document.querySelector(`input[data-input-uniqid=\"${uniqId}\"]`),\n cityIdValue = input.value === \"\" ? null : input.value;\n if (cityIdValue !== null) {\n makeFetch(\"GET\", `/api/1.0/main/postal-code/${cityIdValue}.json`).then(\n (city) => {\n loadOnePicker(el, input, uniqId, city);\n },\n );\n } else {\n loadOnePicker(el, input, uniqId, null);\n }\n });\n}\n\ndocument.addEventListener(\"DOMContentLoaded\", function (e) {\n loadDynamicPickers(document);\n});\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillMainBundle/Resources/public/module/pick-rolling-date/index.js",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'_e' is defined but never used.",
"line": 3,
"column": 57,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 3,
"endColumn": 59
}
],
"suppressedMessages": [],
"errorCount": 1,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "import { ShowHide } from \"ChillMainAssets/lib/show_hide/index\";\n\ndocument.addEventListener(\"DOMContentLoaded\", function (_e) {\n document.querySelectorAll(\"div[data-rolling-date]\").forEach((picker) => {\n const roll_wrapper = picker.querySelector(\"div.roll-wrapper\"),\n fixed_wrapper = picker.querySelector(\"div.fixed-wrapper\");\n\n new ShowHide({\n froms: [roll_wrapper],\n container: [fixed_wrapper],\n test: function (elems) {\n for (let el of elems) {\n for (let select_roll of el.querySelectorAll(\n \"select[data-roll-picker]\",\n )) {\n return select_roll.value === \"fixed_date\";\n }\n }\n return false;\n },\n });\n });\n});\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillMainBundle/Resources/public/module/wopi-link/index.js",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'e' is defined but never used.",
"line": 21,
"column": 55,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 21,
"endColumn": 56
}
],
"suppressedMessages": [],
"errorCount": 1,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "import { createApp } from \"vue\";\nimport OpenWopiLink from \"ChillMainAssets/vuejs/_components/OpenWopiLink\";\nimport { _createI18n } from \"ChillMainAssets/vuejs/_js/i18n\";\n\nconst i18n = _createI18n({});\n\n//TODO move to chillDocStore or ChillWopi\n\n/*\n\ntags to load module:\n\n<span data-module=\"wopi-link\"\n data-wopi-url=\"{{ path('chill_wopi_file_edit', {'fileId': document.uuid}) }}\"\n data-doc-type=\"{{ document.type|e('html_attr') }}\"\n data-options=\"{{ options|json_encode }}\"\n ></span>\n\n*/\n\nwindow.addEventListener(\"DOMContentLoaded\", function (e) {\n document\n .querySelectorAll('span[data-module=\"wopi-link\"]')\n .forEach(function (el) {\n createApp({\n template:\n '<open-wopi-link :wopiUrl=\"wopiUrl\" :type=\"type\" :options=\"options\"></open-wopi-link>',\n components: {\n OpenWopiLink,\n },\n data() {\n return {\n wopiUrl: el.dataset.wopiUrl,\n type: el.dataset.docType,\n options:\n el.dataset.options !== \"null\"\n ? JSON.parse(el.dataset.options)\n : {},\n };\n },\n })\n .use(i18n)\n .mount(el);\n });\n});\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillMainBundle/Resources/public/page/export/download-export.js",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'e' is defined but never used.",
"line": 3,
"column": 55,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 3,
"endColumn": 56
}
],
"suppressedMessages": [],
"errorCount": 1,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "import { download_report } from \"../../lib/download-report/download-report\";\n\nwindow.addEventListener(\"DOMContentLoaded\", function (e) {\n const export_generate_url = window.export_generate_url;\n\n if (typeof export_generate_url === \"undefined\") {\n console.error(\"Alias not found!\");\n throw new Error(\"Alias not found!\");\n }\n\n const query = window.location.search,\n container = document.querySelector(\"#download_container\");\n download_report(export_generate_url + query.toString(), container);\n});\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillMainBundle/Resources/public/page/homepage_widget/index.js",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'app' is assigned a value but never used.",
"line": 9,
"column": 7,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 9,
"endColumn": 10
}
],
"suppressedMessages": [],
"errorCount": 1,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "import { createApp } from \"vue\";\nimport { _createI18n } from \"ChillMainAssets/vuejs/_js/i18n\";\nimport { appMessages } from \"ChillMainAssets/vuejs/HomepageWidget/js/i18n\";\nimport { store } from \"ChillMainAssets/vuejs/HomepageWidget/js/store\";\nimport App from \"ChillMainAssets/vuejs/HomepageWidget/App\";\n\nconst i18n = _createI18n(appMessages);\n\nconst app = createApp({\n template: `<app></app>`,\n})\n .use(store)\n .use(i18n)\n .component(\"app\", App)\n .mount(\"#homepage_widget\");\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillMainBundle/Resources/public/page/location/index.js",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'_e' is defined but never used.",
"line": 63,
"column": 48,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 63,
"endColumn": 50
}
],
"suppressedMessages": [],
"errorCount": 1,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "const contactDataBlock = document.querySelector(\"div.location-form-contact\");\nconst addressBlock = document.querySelector(\"div.location-form-address\");\nconst locationType = document.getElementById(\n \"chill_mainbundle_location_locationType\",\n);\n\nconst getSelectedAttributes = (select, attr) =>\n select.selectedOptions[0].getAttribute(attr);\n\nconst removeRequired = (formBlock) => {\n formBlock\n .querySelectorAll(\"label\")\n .forEach((l) => l.classList.remove(\"required\"));\n formBlock\n .querySelectorAll(\"input\")\n .forEach((i) => i.removeAttribute(\"required\"));\n};\n\nconst addRequired = (formBlock) => {\n formBlock\n .querySelectorAll(\"label\")\n .forEach((l) => l.classList.add(\"required\"));\n formBlock\n .querySelectorAll(\"input\")\n .forEach((i) => i.setAttribute(\"required\", \"\"));\n};\n\nconst onLocationTypeChange = () => {\n console.log(getSelectedAttributes(locationType, \"data-address\"));\n console.log(getSelectedAttributes(locationType, \"data-contact\"));\n switch (getSelectedAttributes(locationType, \"data-address\")) {\n case \"optional\":\n default:\n removeRequired(addressBlock);\n addressBlock.classList.remove(\"d-none\");\n break;\n case \"required\":\n addRequired(addressBlock);\n addressBlock.classList.remove(\"d-none\");\n break;\n case \"never\":\n removeRequired(addressBlock);\n addressBlock.classList.add(\"d-none\");\n break;\n }\n switch (getSelectedAttributes(locationType, \"data-contact\")) {\n case \"optional\":\n default:\n removeRequired(contactDataBlock);\n contactDataBlock.classList.remove(\"d-none\");\n break;\n case \"required\":\n addRequired(contactDataBlock);\n contactDataBlock.classList.remove(\"d-none\");\n break;\n case \"never\":\n removeRequired(contactDataBlock);\n contactDataBlock.classList.add(\"d-none\");\n break;\n }\n};\n\ndocument.addEventListener(\"DOMContentLoaded\", (_e) => {\n onLocationTypeChange();\n locationType.addEventListener(\"change\", onLocationTypeChange);\n});\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillMainBundle/Resources/public/page/workflow-show/index.js",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'arg2' is defined but never used.",
"line": 11,
"column": 29,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 11,
"endColumn": 33
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'arg3' is defined but never used.",
"line": 11,
"column": 35,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 11,
"endColumn": 39
}
],
"suppressedMessages": [],
"errorCount": 2,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "import { ShowHide } from \"ChillMainAssets/lib/show_hide/show_hide.js\";\n\nwindow.addEventListener(\"DOMContentLoaded\", function () {\n let divTransitions = document.querySelector(\"#transitions\"),\n futureDestUsersContainer = document.querySelector(\"#futureDests\");\n if (null !== divTransitions) {\n new ShowHide({\n load_event: null,\n froms: [divTransitions],\n container: [futureDestUsersContainer],\n test: function (divs, arg2, arg3) {\n for (let div of divs) {\n for (let input of div.querySelectorAll(\"input\")) {\n if (input.checked) {\n if (input.dataset.toFinal === \"1\") {\n return false;\n } else {\n return true;\n }\n }\n }\n }\n\n return true;\n },\n });\n }\n\n let transitionFilterContainer = document.querySelector(\"#transitionFilter\"),\n transitions = document.querySelector(\"#transitions\");\n if (null !== transitionFilterContainer) {\n transitions.querySelectorAll(\".form-check\").forEach(function (row) {\n const isForward = row.querySelector(\"input\").dataset.isForward;\n\n new ShowHide({\n load_event: null,\n froms: [transitionFilterContainer],\n container: row,\n test: function (containers) {\n for (let container of containers) {\n for (let input of container.querySelectorAll(\"input\")) {\n if (input.checked) {\n return isForward === input.value;\n }\n }\n }\n },\n toggle_callback: function (c, dir) {\n for (let div of c) {\n let input = div.querySelector(\"input\");\n if (\"hide\" === dir) {\n input.checked = false;\n input.disabled = true;\n } else {\n input.disabled = false;\n }\n }\n },\n });\n });\n }\n});\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/App.vue",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'reject' is defined but never used.",
"line": 79,
"column": 55,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 79,
"endColumn": 61
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'reject' is defined but never used.",
"line": 101,
"column": 55,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 101,
"endColumn": 61
}
],
"suppressedMessages": [],
"errorCount": 2,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "<template>\n <add-address\n :key=\"key\"\n :context=\"context\"\n :options=\"options\"\n :address-changed-callback=\"submitAddress\"\n ref=\"addAddress\"\n />\n</template>\n\n<script>\nimport AddAddress from \"./components/AddAddress.vue\";\nimport {\n postAddressToHousehold,\n postAddressToPerson,\n} from \"ChillPersonAssets/vuejs/_api/AddAddress\";\n\nexport default {\n name: \"App\",\n components: {\n AddAddress,\n },\n props: [\"addAddress\", \"callback\"],\n emits: [\"addressEdited\", \"addressCreated\"],\n computed: {\n context() {\n return this.addAddress.context;\n },\n options() {\n return this.addAddress.options;\n },\n key() {\n return this.context.edit\n ? \"address_\" + this.context.addressId\n : this.context.target.name + \"_\" + this.context.target.id;\n },\n },\n mounted() {\n //console.log('AddAddress: data context', this.context);\n //console.log('AddAddress: data options', this.options);\n },\n methods: {\n displayErrors() {\n return this.$refs.addAddress.errorMsg;\n },\n submitAddress(payload) {\n console.log(\"@@@ click on Submit Address Button\", payload);\n\n // Existing address\n if (this.context.edit) {\n // address is already linked, just finish !\n this.$refs.addAddress.afterLastPaneAction({});\n this.$emit(\"addressEdited\", payload);\n\n // New created address\n } else {\n this.postAddressTo(payload);\n }\n },\n\n /*\n * Post new created address to targetEntity\n */\n postAddressTo(payload) {\n this.$emit(\"addressCreated\", payload);\n\n console.log(\n \"postAddress\",\n payload.addressId,\n \"To\",\n payload.target,\n payload.targetId,\n );\n switch (payload.target) {\n case \"household\":\n postAddressToHousehold(payload.targetId, payload.addressId)\n .then(\n (address) =>\n new Promise((resolve, reject) => {\n console.log(\"..household address\", address);\n this.$refs.addAddress.flag.loading = false;\n this.$refs.addAddress.flag.success = true;\n\n // finish\n this.$refs.addAddress.afterLastPaneAction({\n addressId: address.address_id,\n });\n\n resolve();\n }),\n )\n .catch((error) => {\n this.$refs.addAddress.errorMsg.push(error);\n this.$refs.addAddress.flag.loading = false;\n });\n break;\n case \"person\":\n postAddressToPerson(payload.targetId, payload.addressId)\n .then(\n (address) =>\n new Promise((resolve, reject) => {\n console.log(\"..person address\", address);\n this.$refs.addAddress.flag.loading = false;\n this.$refs.addAddress.flag.success = true;\n\n // finish\n this.$refs.addAddress.afterLastPaneAction({\n addressId: address.address_id,\n });\n\n resolve();\n }),\n )\n .catch((error) => {\n this.$refs.addAddress.errorMsg.push(error);\n this.$refs.addAddress.flag.loading = false;\n });\n break;\n case \"thirdparty\":\n console.log(\"TODO write postAddressToThirdparty\");\n break;\n default:\n this.$refs.addAddress.errorMsg.push(\n \"That entity is not managed by address !\",\n );\n }\n },\n },\n};\n</script>\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'postAddressToPerson' is defined but never used.",
"line": 247,
"column": 5,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 247,
"endColumn": 24
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'postAddressToHousehold' is defined but never used.",
"line": 248,
"column": 5,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 248,
"endColumn": 27
},
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"context\" prop.",
"line": 490,
"column": 21,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 490,
"endColumn": 45
},
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"context\" prop.",
"line": 491,
"column": 21,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 491,
"endColumn": 62
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'reject' is defined but never used.",
"line": 508,
"column": 47,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 508,
"endColumn": 53
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'reject' is defined but never used.",
"line": 525,
"column": 47,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 525,
"endColumn": 53
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'reject' is defined but never used.",
"line": 553,
"column": 47,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 553,
"endColumn": 53
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'reject' is defined but never used.",
"line": 572,
"column": 47,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 572,
"endColumn": 53
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'reject' is defined but never used.",
"line": 803,
"column": 47,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 803,
"endColumn": 53
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'reject' is defined but never used.",
"line": 852,
"column": 47,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 852,
"endColumn": 53
}
],
"suppressedMessages": [],
"errorCount": 10,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "<template>\n <!-- step0 -->\n <show-pane\n v-if=\"flag.showPane\"\n :context=\"this.context\"\n :options=\"this.options\"\n :defaultz=\"this.defaultz\"\n :entity=\"this.entity\"\n :flag=\"this.flag\"\n :use-date-pane=\"this.useDatePane\"\n @open-edit-pane=\"openEditPane\"\n ref=\"showAddress\"\n />\n\n <!-- step 1 -->\n <teleport to=\"body\" v-if=\"inModal\">\n <modal\n v-if=\"flag.suggestPane\"\n modal-dialog-class=\"modal-dialog-scrollable modal-xl\"\n @close=\"resetPane\"\n >\n <template #header>\n <h2 class=\"modal-title\">\n {{ $t(getTextTitle) }}\n <span v-if=\"flag.loading\" class=\"loading\">\n <i class=\"fa fa-circle-o-notch fa-spin fa-fw\" />\n <span class=\"sr-only\">{{ $t(\"loading\") }}</span>\n </span>\n </h2>\n </template>\n\n <template #body>\n <suggest-pane\n :context=\"this.context\"\n :options=\"this.options\"\n :defaultz=\"this.defaultz\"\n :entity=\"this.entity\"\n :flag=\"this.flag\"\n @pick-address=\"this.pickAddress\"\n ref=\"suggestAddress\"\n />\n </template>\n\n <template #footer>\n <button @click=\"openEditPane\" class=\"btn btn-create\">\n {{ $t(\"create_a_new_address\") }}\n </button>\n </template>\n </modal>\n </teleport>\n <template v-else>\n <div v-if=\"flag.suggestPane\" class=\"mt-4 flex-grow-1\">\n <suggest-pane\n :context=\"this.context\"\n :options=\"this.options\"\n :defaultz=\"this.defaultz\"\n :entity=\"this.entity\"\n :flag=\"this.flag\"\n :inside-modal=\"false\"\n @pick-address=\"this.pickAddress\"\n ref=\"suggestAddress\"\n >\n <template #before v-if=\"!bypassFirstStep\">\n <a class=\"btn btn-cancel\" @click=\"resetPane\">\n {{ $t(\"action.cancel\") }}\n </a>\n </template>\n <template #action>\n <li>\n <button @click=\"openEditPane\" class=\"btn btn-create\">\n {{ $t(\"create_a_new_address\") }}\n </button>\n </li>\n </template>\n </suggest-pane>\n </div>\n </template>\n\n <!-- step 2 -->\n <teleport to=\"body\" v-if=\"inModal\">\n <modal\n v-if=\"flag.editPane\"\n modal-dialog-class=\"modal-dialog-scrollable modal-xl\"\n @close=\"resetPane\"\n >\n <template #header>\n <h2 class=\"modal-title\">\n {{ $t(getTextTitle) }}\n <span v-if=\"flag.loading\" class=\"loading\">\n <i class=\"fa fa-circle-o-notch fa-spin fa-fw\" />\n <span class=\"sr-only\">{{ $t(\"loading\") }}</span>\n </span>\n </h2>\n </template>\n\n <template #body>\n <edit-pane\n :context=\"this.context\"\n :options=\"this.options\"\n :defaultz=\"this.defaultz\"\n :entity=\"this.entity\"\n :flag=\"this.flag\"\n :errors=\"this.errors\"\n :check-errors=\"this.checkErrors\"\n @get-cities=\"getCities\"\n @get-reference-addresses=\"getReferenceAddresses\"\n />\n </template>\n\n <template #footer>\n <!--<button class=\"btn btn-cancel change-icon\" @click=\"resetPane\">{{ $t('action.cancel') }}</button>-->\n <button\n v-if=\"!this.context.edit && this.useDatePane\"\n class=\"btn btn-update change-icon\"\n @click=\"closeEditPane\"\n >\n {{ $t(\"nav.next\") }}\n <i class=\"fa fa-fw fa-arrow-right\" />\n </button>\n <button v-else class=\"btn btn-save\" @click=\"closeEditPane\">\n {{ $t(\"action.save\") }}\n </button>\n </template>\n </modal>\n </teleport>\n <template v-else>\n <div v-if=\"flag.editPane\" class=\"mt-4 flex-grow-1\">\n <edit-pane\n :context=\"this.context\"\n :options=\"this.options\"\n :defaultz=\"this.defaultz\"\n :entity=\"this.entity\"\n :flag=\"this.flag\"\n :errors=\"this.errors\"\n :check-errors=\"this.checkErrors\"\n :inside-modal=\"false\"\n @get-cities=\"getCities\"\n @get-reference-addresses=\"getReferenceAddresses\"\n >\n <template #before>\n <a class=\"btn btn-cancel\" @click=\"resetPane\">\n {{ $t(\"action.cancel\") }}\n </a>\n </template>\n <template #action>\n <li v-if=\"!this.context.edit && this.useDatePane\">\n <button\n class=\"btn btn-update change-icon\"\n @click=\"closeEditPane\"\n >\n {{ $t(\"nav.next\") }}\n <i class=\"fa fa-fw fa-arrow-right\" />\n </button>\n </li>\n <li v-else>\n <button class=\"btn btn-save\" @click=\"closeEditPane\">\n {{ $t(\"action.save\") }}\n </button>\n </li>\n </template>\n </edit-pane>\n </div>\n </template>\n\n <!-- step 3 -->\n <teleport to=\"body\" v-if=\"inModal\">\n <modal\n v-if=\"flag.datePane\"\n modal-dialog-class=\"modal-dialog-scrollable modal-xl\"\n @close=\"resetPane\"\n >\n <template #header>\n <h2 class=\"modal-title\">\n {{ $t(getTextTitle) }}\n <span v-if=\"flag.loading\" class=\"loading\">\n <i class=\"fa fa-circle-o-notch fa-spin fa-fw\" />\n <span class=\"sr-only\">{{ $t(\"loading\") }}</span>\n </span>\n </h2>\n </template>\n\n <template #body>\n <date-pane\n :context=\"this.context\"\n :options=\"this.options\"\n :defaultz=\"this.defaultz\"\n :entity=\"this.entity\"\n :flag=\"this.flag\"\n ref=\"dateAddress\"\n />\n </template>\n\n <template #footer>\n <button class=\"btn btn-misc\" @click=\"openEditPane\">\n <i class=\"fa fa-fw fa-arrow-left\" />\n {{ $t(\"nav.previous\") }}\n </button>\n <button class=\"btn btn-save\" @click=\"closeDatePane\">\n {{ $t(\"action.save\") }}\n </button>\n <!-- -->\n </template>\n </modal>\n </teleport>\n <template v-else>\n <div v-if=\"flag.datePane\" class=\"mt-4 flex-grow-1\">\n <date-pane\n :context=\"this.context\"\n :options=\"this.options\"\n :defaultz=\"this.defaultz\"\n :entity=\"this.entity\"\n :flag=\"this.flag\"\n :inside-modal=\"false\"\n ref=\"dateAddress\"\n >\n <template #before>\n <button class=\"btn btn-misc\" @click=\"openEditPane\">\n <i class=\"fa fa-fw fa-arrow-left\" />\n {{ $t(\"nav.previous\") }}\n </button>\n </template>\n <template #action>\n <li>\n <button class=\"btn btn-save\" @click=\"closeDatePane\">\n {{ $t(\"action.save\") }}\n </button>\n </li>\n </template>\n </date-pane>\n </div>\n </template>\n</template>\n\n<script>\nimport Modal from \"ChillMainAssets/vuejs/_components/Modal\";\nimport {\n duplicateAddress,\n fetchCountries,\n fetchCities,\n fetchReferenceAddresses,\n getAddress,\n patchAddress,\n postAddress,\n postPostalCode,\n} from \"../api\";\nimport {\n postAddressToPerson,\n postAddressToHousehold,\n} from \"ChillPersonAssets/vuejs/_api/AddAddress.js\";\nimport ShowPane from \"./ShowPane.vue\";\nimport SuggestPane from \"./SuggestPane.vue\";\nimport EditPane from \"./EditPane.vue\";\nimport DatePane from \"./DatePane.vue\";\n\nexport default {\n name: \"AddAddress\",\n props: [\"context\", \"options\", \"addressChangedCallback\"],\n components: {\n Modal,\n ShowPane,\n SuggestPane,\n EditPane,\n DatePane,\n },\n emits: {\n pickAddress: null,\n },\n data() {\n return {\n flag: {\n showPane: true, // begin with showPane\n suggestPane: false,\n editPane: false,\n datePane: false,\n loading: false,\n success: false,\n },\n errors: [],\n defaultz: {\n button: {\n text: {\n create: \"add_an_address_title\",\n edit: \"edit_address\",\n },\n type: { create: \"btn-create\", edit: \"btn-update\" },\n displayText: true,\n },\n title: { create: \"add_an_address_title\", edit: \"edit_address\" },\n openPanesInModal: true,\n stickyActions: false,\n // show a message when no address.\n // if set to undefined, the value will be equivalent to false if stickyActions is false, true otherwise.\n showMessageWhenNoAddress: undefined,\n useDate: {\n validFrom: false,\n validTo: false,\n },\n onlyButton: false,\n },\n entity: {\n address: {}, // <== loaded and returned\n loaded: {\n countries: [],\n cities: [],\n addresses: [],\n },\n selected: {\n // <== make temporary changes\n isNoAddress: false,\n country: {},\n city: {},\n postcode: {\n code: null,\n name: null,\n },\n address: {},\n writeNew: {\n address: false,\n postcode: false,\n },\n valid: {\n from: new Date(),\n to: null,\n },\n },\n addressMap: {\n // Note: LeafletJs demands [lat, lon]\n // cfr https://macwright.com/lonlat/\n center: [\n this.context.defaults.map_center.x,\n this.context.defaults.map_center.y,\n ],\n zoom: this.context.defaults.map_center.z,\n },\n },\n errorMsg: [],\n };\n },\n computed: {\n inModal() {\n return typeof this.options.openPanesInModal !== \"undefined\"\n ? this.options.openPanesInModal\n : this.defaultz.openPanesInModal;\n },\n validFrom() {\n return typeof this.options.useDate !== \"undefined\" &&\n typeof this.options.useDate.validFrom !== \"undefined\"\n ? this.options.useDate.validFrom\n : this.defaultz.useDate.validFrom;\n },\n validTo() {\n return typeof this.options.useDate !== \"undefined\" &&\n typeof this.options.useDate.validTo !== \"undefined\"\n ? this.options.useDate.validTo\n : this.defaultz.useDate.validTo;\n },\n useDatePane() {\n return this.validFrom || this.validTo ? true : false;\n },\n hasSuggestions() {\n if (typeof this.context.suggestions !== \"undefined\") {\n console.log(\"hasSuggestions\", this.context.suggestions);\n return this.context.suggestions.length > 0;\n }\n return false;\n },\n displaySuggestions() {\n return !this.context.edit && this.hasSuggestions;\n },\n getTextTitle() {\n if (\n typeof this.options.title !== \"undefined\" &&\n (this.options.title.edit !== null ||\n this.options.title.create !== null)\n ) {\n return this.context.edit\n ? this.options.title.edit\n : this.options.title.create;\n }\n return this.context.edit\n ? this.defaultz.title.edit\n : this.defaultz.title.create;\n },\n bypassFirstStep() {\n // exception: passing step0 if new address and pane are not in modal\n return !this.context.edit && !this.inModal;\n },\n forceRedirect() {\n return !(\n this.context.backUrl === null ||\n typeof this.context.backUrl === \"undefined\"\n );\n },\n },\n mounted() {\n //console.log('validFrom', this.validFrom);\n //console.log('validTo', this.validTo);\n //console.log('useDatePane', this.useDatePane);\n //console.log('Mounted now !');\n\n if (this.context.edit) {\n console.log(\"getInitialAddress\", this.context.addressId);\n this.getInitialAddress(this.context.addressId);\n }\n this.openShowPane();\n },\n methods: {\n /*\n * Opening and closing Panes when interacting with buttons\n */\n openShowPane() {\n if (this.flag.editPane === false && this.bypassFirstStep) {\n console.log(\"bypassFirstStep\");\n this.closeShowPane();\n this.openEditPane();\n } else {\n this.flag.showPane = true;\n //console.log('step0: open the Show Panel');\n }\n },\n closeShowPane() {\n // Show pane can be closed only when openPanesInModal is false\n if (!this.inModal) {\n this.flag.showPane = false;\n console.log(\"step0: close the Show Panel\");\n }\n },\n openSuggestPane() {\n this.flag.suggestPane = true;\n console.log(\"step1: open the Suggestion Panel\");\n },\n closeSuggestPane() {\n this.flag.suggestPane = false;\n console.log(\"step1: close the Suggestion Panel\");\n },\n openEditPane() {\n if (this.flag.suggestPane === false && this.displaySuggestions) {\n console.log(\"displaySuggestions\");\n this.openSuggestPane();\n } else {\n if (this.flag.datePane === false) {\n this.initForm(); // reset form except if we come back from datePane\n }\n this.getCountries(); // will open editPane when resolve promise\n }\n },\n closeEditPane() {\n this.flag.editPane = false;\n console.log(\"step2: close the Edit Panel\");\n if (!this.context.edit && this.useDatePane) {\n this.openDatePane();\n } else {\n this.applyChanges();\n if (!this.forceRedirect) {\n this.openShowPane();\n }\n }\n },\n openDatePane() {\n this.flag.datePane = true;\n console.log(\"step3: open the Date Panel\");\n },\n closeDatePane() {\n this.applyChanges();\n this.flag.datePane = false;\n console.log(\"step3: close the Date Panel\");\n },\n resetPane() {\n console.log(\"resetPane\");\n this.flag.suggestPane = false;\n this.flag.editPane = false;\n this.flag.datePane = false;\n this.openShowPane();\n },\n\n /*\n * What happens when submitting last Pane:\n * - redirect or reset pane,\n * - change context to editing\n */\n afterLastPaneAction(params) {\n this.initForm();\n if (this.forceRedirect) {\n console.log(\"redirect to backUrl\");\n window.location.assign(this.context.backUrl);\n } else {\n console.log(\"don't redirect\");\n this.resetPane();\n if (!this.context.edit) {\n this.context.edit = true;\n this.context.addressId = params.addressId;\n console.log(\n \"context is now edit, with address\",\n params.addressId,\n );\n }\n }\n },\n\n /*\n * Async Fetch datas\n */\n getInitialAddress(id) {\n this.flag.loading = true;\n getAddress(id)\n .then(\n (address) =>\n new Promise((resolve, reject) => {\n this.entity.address = address;\n this.flag.loading = false;\n resolve();\n }),\n )\n .catch((error) => {\n this.errorMsg.push(error.message);\n this.flag.loading = false;\n });\n },\n\n getCountries() {\n this.flag.loading = true;\n fetchCountries()\n .then(\n (countries) =>\n new Promise((resolve, reject) => {\n this.entity.loaded.countries = countries.results;\n if (this.flag.showPane === true) {\n this.closeShowPane();\n }\n if (this.flag.suggestPane === true) {\n this.closeSuggestPane();\n }\n if (this.flag.datePane === true) {\n this.flag.datePane = false;\n }\n console.log(\"step2: open the Edit panel\");\n this.flag.editPane = true;\n this.flag.loading = false;\n resolve();\n }),\n )\n .catch((error) => {\n this.errorMsg.push(error.message);\n this.flag.loading = false;\n });\n },\n\n getCities(country) {\n this.flag.loading = true;\n fetchCities(country)\n .then(\n (cities) =>\n new Promise((resolve, reject) => {\n this.entity.loaded.cities = cities.results.filter(\n (c) => c.origin !== 3,\n ); // filter out user-defined cities\n this.flag.loading = false;\n resolve();\n }),\n )\n .catch((error) => {\n this.errorMsg.push(error.message);\n this.flag.loading = false;\n });\n },\n\n getReferenceAddresses(city) {\n this.flag.loading = true;\n fetchReferenceAddresses(city)\n .then(\n (addresses) =>\n new Promise((resolve, reject) => {\n this.entity.loaded.addresses = addresses.results;\n this.flag.loading = false;\n resolve();\n }),\n )\n .catch((error) => {\n this.errorMsg.push(error.message);\n this.flag.loading = false;\n });\n },\n\n checkErrors() {\n this.errors = [];\n if (this.entity.selected.country === null) {\n this.errors.push(\"Un pays doit être sélectionné.\");\n }\n if (this.entity.selected.city === null) {\n this.errors.push(\"Une ville doit être sélectionnée.\");\n } else {\n if (Object.keys(this.entity.selected.city).length === 0) {\n this.errors.push(\"Une ville doit être sélectionnée.\");\n }\n }\n if (!this.entity.selected.isNoAddress) {\n if (\n this.entity.selected.address.street === null ||\n this.entity.selected.address.street === \"\" ||\n this.entity.selected.address.streetNumber === null ||\n this.entity.selected.address.streetNumber === \"\"\n ) {\n this.errors.push(\"Une adresse doit être sélectionnée.\");\n }\n }\n },\n\n /*\n * Make form ready for new changes\n */\n initForm() {\n console.log(\"init form\");\n\n this.entity.loaded.addresses = [];\n this.entity.loaded.cities = [];\n this.entity.loaded.countries = [];\n\n this.entity.selected.confidential = this.context.edit\n ? this.entity.address.confidential\n : false;\n this.entity.selected.isNoAddress =\n this.context.edit && this.entity.address.text === \"\"\n ? true\n : false;\n\n this.entity.selected.country = this.context.edit\n ? this.entity.address.country\n : {};\n this.entity.selected.postcode = this.context.edit\n ? this.entity.address.postcode\n : {};\n this.entity.selected.city = this.context.edit\n ? this.entity.address.postcode\n : {};\n\n this.entity.selected.address = {};\n this.entity.selected.address.street = this.context.edit\n ? this.entity.address.street\n : \"\";\n this.entity.selected.address.streetNumber = this.context.edit\n ? this.entity.address.streetNumber\n : \"\";\n this.entity.selected.address.floor = this.context.edit\n ? this.entity.address.floor\n : \"\";\n this.entity.selected.address.corridor = this.context.edit\n ? this.entity.address.corridor\n : \"\";\n this.entity.selected.address.steps = this.context.edit\n ? this.entity.address.steps\n : \"\";\n this.entity.selected.address.flat = this.context.edit\n ? this.entity.address.flat\n : \"\";\n this.entity.selected.address.buildingName = this.context.edit\n ? this.entity.address.buildingName\n : \"\";\n this.entity.selected.address.distribution = this.context.edit\n ? this.entity.address.distribution\n : \"\";\n this.entity.selected.address.extra = this.context.edit\n ? this.entity.address.extra\n : \"\";\n\n this.entity.selected.writeNew.address =\n this.context.edit &&\n this.entity.address.addressReference === null &&\n this.entity.address.street.length > 0;\n this.entity.selected.writeNew.postcode = false; // NB: this used to be this.context.edit, but think it was erroneous;\n console.log(\n \"!! just set writeNew.postcode to\",\n this.entity.selected.writeNew.postcode,\n );\n\n this.checkErrors();\n },\n\n /*\n * When changes are validated (get out step2 edit pane, button valid),\n * apply some transformations before asyncing with backend\n * from entity.selected to entity.address\n */\n applyChanges() {\n console.log(\"apply changes\");\n let newAddress = {\n confidential: this.entity.selected.confidential,\n isNoAddress: this.entity.selected.isNoAddress,\n street: this.entity.selected.isNoAddress\n ? \"\"\n : this.entity.selected.address.street,\n streetNumber: this.entity.selected.isNoAddress\n ? \"\"\n : this.entity.selected.address.streetNumber,\n postcode: { id: this.entity.selected.city.id },\n floor: this.entity.selected.address.floor,\n corridor: this.entity.selected.address.corridor,\n steps: this.entity.selected.address.steps,\n flat: this.entity.selected.address.flat,\n buildingName: this.entity.selected.address.buildingName,\n distribution: this.entity.selected.address.distribution,\n extra: this.entity.selected.address.extra,\n };\n\n if (this.entity.selected.address.point !== undefined) {\n newAddress = Object.assign(newAddress, {\n point: this.entity.selected.address.point.coordinates,\n });\n } else {\n if (this.entity.selected.postcode.coordinates) {\n newAddress = Object.assign(newAddress, {\n point: this.entity.selected.postcode.coordinates,\n });\n }\n }\n\n // add the address reference, if any\n if (this.entity.selected.address.addressReference !== undefined) {\n newAddress = Object.assign(newAddress, {\n addressReference:\n this.entity.selected.address.addressReference,\n });\n } else {\n newAddress = Object.assign(newAddress, {\n addressReference: null,\n });\n }\n\n if (this.validFrom) {\n console.log(\n \"add validFrom in fetch body\",\n this.entity.selected.valid.from,\n );\n newAddress = Object.assign(newAddress, {\n validFrom: {\n datetime: `${this.entity.selected.valid.from.toISOString().split(\"T\")[0]}T00:00:00+0100`,\n },\n });\n }\n if (this.validTo && null !== this.entity.selected.valid.to) {\n console.log(\n \"add validTo in fetch body\",\n this.entity.selected.valid.to,\n );\n newAddress = Object.assign(newAddress, {\n validTo: {\n datetime: `${this.entity.selected.valid.to.toISOString().split(\"T\")[0]}T00:00:00+0100`,\n },\n });\n }\n if (this.entity.selected.writeNew.postcode) {\n let newPostcode = this.entity.selected.postcode;\n newPostcode = Object.assign(newPostcode, {\n country: { id: this.entity.selected.country.id },\n }); //TODO why not assign postcodeBody here = Object.assign(postcodeBody, {'origin': 3}); ?\n console.log(\n \"writeNew postcode is true! newPostcode: \",\n newPostcode,\n );\n newAddress = Object.assign(newAddress, {\n newPostcode: newPostcode,\n });\n }\n\n if (!this.context.edit) {\n this.addNewAddress(newAddress).then((payload) =>\n this.addressChangedCallback(payload),\n );\n } else {\n this.updateAddress({\n addressId: this.context.addressId,\n newAddress: newAddress,\n }).then((payload) => this.addressChangedCallback(payload));\n }\n },\n\n /*\n * Async POST transactions,\n * creating new address, and receive backend datas when promise is resolved\n */\n addNewAddress(payload) {\n console.log(\"addNewAddress\", payload);\n this.flag.loading = true;\n\n if (\"newPostcode\" in payload) {\n let postcodeBody = payload.newPostcode;\n postcodeBody = Object.assign(postcodeBody, { origin: 3 });\n console.log(\"juste before post new postcode\", postcodeBody);\n return postPostalCode(postcodeBody).then((postalCode) => {\n console.log(\"new postcode created\", postalCode.id);\n payload.postcode = { id: postalCode.id };\n return this.postNewAddress(payload);\n });\n } else {\n return this.postNewAddress(payload);\n }\n },\n\n postNewAddress(payload) {\n console.log(\"postNewAddress\", payload);\n return postAddress(payload)\n .then(\n (address) =>\n new Promise((resolve, reject) => {\n this.entity.address = address;\n this.flag.loading = false;\n this.flag.success = true;\n resolve({\n address,\n targetOrigin: this.context.target,\n // for \"legacy\" use:\n target: this.context.target.name,\n targetId: this.context.target.id,\n addressId: this.entity.address.address_id,\n });\n }),\n )\n .catch((error) => {\n this.errorMsg.push(error);\n this.flag.loading = false;\n });\n },\n\n /*\n * Async PATCH transactions,\n * then update existing address with backend datas when promise is resolved\n */\n updateAddress(payload) {\n this.flag.loading = true;\n\n // TODO change the condition because it writes new postal code in edit mode now: !writeNewPostalCode\n // BUG réécrit un postcode à chaque édition !\n if (\"newPostcode\" in payload.newAddress) {\n let postcodeBody = payload.newAddress.newPostcode;\n postcodeBody = Object.assign(postcodeBody, { origin: 3 });\n\n console.log(\"juste before post new postcode\", postcodeBody);\n return postPostalCode(postcodeBody).then((postalCode) => {\n console.log(\"new postcode created\", postalCode.id);\n payload.newAddress.postcode = { id: postalCode.id };\n return this.patchExistingAddress(payload);\n });\n } else {\n return this.patchExistingAddress(payload);\n }\n },\n\n patchExistingAddress(payload) {\n console.log(\"patchExistingAddress\", payload);\n return patchAddress(payload.addressId, payload.newAddress)\n .then(\n (address) =>\n new Promise((resolve, reject) => {\n this.entity.address = address;\n this.flag.loading = false;\n this.flag.success = true;\n return resolve({\n address,\n targetOrigin: this.context.target,\n // for \"legacy\" use:\n target: this.context.target.name,\n targetId: this.context.target.id,\n addressId: this.entity.address.address_id,\n });\n }),\n )\n .catch((error) => {\n this.errorMsg.push(error);\n this.flag.loading = false;\n });\n },\n\n /**\n *\n * Called when the event pick-address is emitted, which is, by the way,\n * called when an address suggestion is picked.\n *\n * @param address the address selected\n */\n pickAddress(address) {\n console.log(\"pickAddress\", address);\n duplicateAddress(address).then((newAddress) => {\n this.entity.address = newAddress;\n this.flag.loading = false;\n this.flag.success = true;\n let payload = {\n address: newAddress,\n targetOrigin: this.context.target,\n // for \"legacy\" use:\n target: this.context.target.name,\n targetId: this.context.target.id,\n addressId: this.entity.address.address_id,\n };\n this.addressChangedCallback(payload);\n this.closeSuggestPane();\n });\n },\n },\n};\n</script>\n\n<style lang=\"scss\">\ndiv.entity-address {\n position: relative;\n div.loading {\n position: absolute;\n right: 0;\n top: -55px;\n }\n}\nh4.h3 {\n font-weight: bold;\n}\n</style>\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressMore.vue",
"messages": [
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"entity\" prop.",
"line": 93,
"column": 17,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 93,
"endColumn": 59
},
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"entity\" prop.",
"line": 101,
"column": 17,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 101,
"endColumn": 62
},
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"entity\" prop.",
"line": 109,
"column": 17,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 109,
"endColumn": 59
},
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"entity\" prop.",
"line": 117,
"column": 17,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 117,
"endColumn": 58
},
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"entity\" prop.",
"line": 125,
"column": 17,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 125,
"endColumn": 66
},
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"entity\" prop.",
"line": 133,
"column": 17,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 133,
"endColumn": 59
},
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"entity\" prop.",
"line": 141,
"column": 17,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 141,
"endColumn": 66
}
],
"suppressedMessages": [],
"errorCount": 7,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "<template>\n <h4 class=\"h3\">\n {{ $t(\"fill_an_address\") }}\n </h4>\n <div class=\"row my-3\">\n <div class=\"col-lg-6\" v-if=\"!isNoAddress\">\n <div class=\"form-floating my-1\">\n <input\n class=\"form-control\"\n type=\"text\"\n name=\"floor\"\n :placeholder=\"$t('floor')\"\n v-model=\"floor\"\n />\n <label for=\"floor\">{{ $t(\"floor\") }}</label>\n </div>\n <div class=\"form-floating my-1\">\n <input\n class=\"form-control\"\n type=\"text\"\n name=\"corridor\"\n :placeholder=\"$t('corridor')\"\n v-model=\"corridor\"\n />\n <label for=\"corridor\">{{ $t(\"corridor\") }}</label>\n </div>\n <div class=\"form-floating my-1\">\n <input\n class=\"form-control\"\n type=\"text\"\n name=\"steps\"\n :placeholder=\"$t('steps')\"\n v-model=\"steps\"\n />\n <label for=\"steps\">{{ $t(\"steps\") }}</label>\n </div>\n <div class=\"form-floating my-1\">\n <input\n class=\"form-control\"\n type=\"text\"\n name=\"flat\"\n :placeholder=\"$t('flat')\"\n v-model=\"flat\"\n />\n <label for=\"flat\">{{ $t(\"flat\") }}</label>\n </div>\n </div>\n <div :class=\"isNoAddress ? 'col-lg-12' : 'col-lg-6'\">\n <div class=\"form-floating my-1\" v-if=\"!isNoAddress\">\n <input\n class=\"form-control\"\n type=\"text\"\n name=\"buildingName\"\n maxlength=\"255\"\n :placeholder=\"$t('buildingName')\"\n v-model=\"buildingName\"\n />\n <label for=\"buildingName\">{{ $t(\"buildingName\") }}</label>\n </div>\n <div class=\"form-floating my-1\">\n <input\n class=\"form-control\"\n type=\"text\"\n name=\"extra\"\n maxlength=\"255\"\n :placeholder=\"$t('extra')\"\n v-model=\"extra\"\n />\n <label for=\"extra\">{{ $t(\"extra\") }}</label>\n </div>\n <div class=\"form-floating my-1\" v-if=\"!isNoAddress\">\n <input\n class=\"form-control\"\n type=\"text\"\n name=\"distribution\"\n maxlength=\"255\"\n :placeholder=\"$t('distribution')\"\n v-model=\"distribution\"\n />\n <label for=\"distribution\">{{ $t(\"distribution\") }}</label>\n </div>\n </div>\n </div>\n</template>\n\n<script>\nexport default {\n name: \"AddressMore\",\n props: [\"entity\", \"isNoAddress\"],\n computed: {\n floor: {\n set(value) {\n this.entity.selected.address.floor = value;\n },\n get() {\n return this.entity.selected.address.floor;\n },\n },\n corridor: {\n set(value) {\n this.entity.selected.address.corridor = value;\n },\n get() {\n return this.entity.selected.address.corridor;\n },\n },\n steps: {\n set(value) {\n this.entity.selected.address.steps = value;\n },\n get() {\n return this.entity.selected.address.steps;\n },\n },\n flat: {\n set(value) {\n this.entity.selected.address.flat = value;\n },\n get() {\n return this.entity.selected.address.flat;\n },\n },\n buildingName: {\n set(value) {\n this.entity.selected.address.buildingName = value;\n },\n get() {\n return this.entity.selected.address.buildingName;\n },\n },\n extra: {\n set(value) {\n this.entity.selected.address.extra = value;\n },\n get() {\n return this.entity.selected.address.extra;\n },\n },\n distribution: {\n set(value) {\n this.entity.selected.address.distribution = value;\n },\n get() {\n return this.entity.selected.address.distribution;\n },\n },\n },\n};\n</script>\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue",
"messages": [
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"entity\" prop.",
"line": 106,
"column": 17,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 106,
"endColumn": 60
},
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"entity\" prop.",
"line": 114,
"column": 17,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 114,
"endColumn": 66
},
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"entity\" prop.",
"line": 128,
"column": 13,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 128,
"endColumn": 49
},
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"entity\" prop.",
"line": 129,
"column": 13,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 131,
"endColumn": 14
},
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"entity\" prop.",
"line": 132,
"column": 13,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 132,
"endColumn": 63
},
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"entity\" prop.",
"line": 133,
"column": 13,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 133,
"endColumn": 75
},
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"entity\" prop.",
"line": 134,
"column": 13,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 134,
"endColumn": 58
},
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"entity\" prop.",
"line": 139,
"column": 13,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 139,
"endColumn": 46
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'reject' is defined but never used.",
"line": 153,
"column": 55,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 153,
"endColumn": 61
},
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"entity\" prop.",
"line": 154,
"column": 37,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 155,
"endColumn": 58
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'reject' is defined but never used.",
"line": 171,
"column": 59,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 171,
"endColumn": 65
},
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"entity\" prop.",
"line": 172,
"column": 41,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 173,
"endColumn": 62
},
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"entity\" prop.",
"line": 190,
"column": 17,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 190,
"endColumn": 66
},
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"entity\" prop.",
"line": 191,
"column": 17,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 191,
"endColumn": 72
},
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"entity\" prop.",
"line": 192,
"column": 17,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 192,
"endColumn": 61
},
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"entity\" prop.",
"line": 222,
"column": 13,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 222,
"endColumn": 57
}
],
"suppressedMessages": [],
"errorCount": 16,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "<template>\n <div class=\"my-1\">\n <label class=\"col-form-label\" for=\"addressSelector\">{{\n $t(\"address\")\n }}</label>\n <VueMultiselect\n id=\"addressSelector\"\n v-model=\"value\"\n :placeholder=\"$t('select_address')\"\n :tag-placeholder=\"$t('create_address')\"\n :select-label=\"$t('multiselect.select_label')\"\n :deselect-label=\"$t('create_address')\"\n :selected-label=\"$t('multiselect.selected_label')\"\n @search-change=\"listenInputSearch\"\n :internal-search=\"false\"\n ref=\"addressSelector\"\n @select=\"selectAddress\"\n @remove=\"remove\"\n name=\"field\"\n track-by=\"id\"\n label=\"value\"\n :custom-label=\"transName\"\n :taggable=\"true\"\n :multiple=\"false\"\n @tag=\"addAddress\"\n :loading=\"isLoading\"\n :options=\"addresses\"\n />\n </div>\n\n <div\n class=\"custom-address row g-1\"\n v-if=\"\n writeNewAddress ||\n writeNewPostalCode ||\n (isEnteredCustomAddress && !isAddressSelectorOpen)\n \"\n >\n <div class=\"col-10\">\n <div class=\"form-floating\">\n <input\n class=\"form-control\"\n type=\"text\"\n name=\"street\"\n :placeholder=\"$t('street')\"\n v-model=\"street\"\n />\n <label for=\"street\">{{ $t(\"street\") }}</label>\n </div>\n </div>\n <div class=\"col-2\">\n <div class=\"form-floating\">\n <input\n class=\"form-control\"\n type=\"text\"\n name=\"streetNumber\"\n :placeholder=\"$t('streetNumber')\"\n v-model=\"streetNumber\"\n />\n <label for=\"streetNumber\">{{ $t(\"streetNumber\") }}</label>\n </div>\n </div>\n </div>\n</template>\n\n<script>\nimport VueMultiselect from \"vue-multiselect\";\nimport {\n searchReferenceAddresses,\n fetchReferenceAddresses,\n} from \"../../api.js\";\n\nexport default {\n name: \"AddressSelection\",\n components: { VueMultiselect },\n props: [\"entity\", \"context\", \"updateMapCenter\", \"flag\", \"checkErrors\"],\n data() {\n return {\n value: this.context.edit\n ? this.entity.address.addressReference\n : null,\n isLoading: false,\n };\n },\n computed: {\n writeNewAddress() {\n return this.entity.selected.writeNew.address;\n },\n writeNewPostalCode() {\n return this.entity.selected.writeNew.postCode;\n },\n isAddressSelectorOpen() {\n return this.$refs.addressSelector.$data.isOpen;\n },\n isEnteredCustomAddress() {\n return (\n this.$data.value !== null &&\n typeof this.$data.value.text !== \"undefined\"\n );\n },\n addresses() {\n return this.entity.loaded.addresses;\n },\n street: {\n set(value) {\n this.entity.selected.address.street = value;\n },\n get() {\n return this.entity.selected.address.street;\n },\n },\n streetNumber: {\n set(value) {\n this.entity.selected.address.streetNumber = value;\n },\n get() {\n return this.entity.selected.address.streetNumber;\n },\n },\n },\n methods: {\n transName(value) {\n return value.streetNumber === undefined\n ? value.street\n : `${value.streetNumber}, ${value.street}`;\n },\n selectAddress(value) {\n this.entity.selected.address = value;\n this.entity.selected.address.addressReference = {\n id: value.id,\n };\n this.entity.selected.address.street = value.street;\n this.entity.selected.address.streetNumber = value.streetNumber;\n this.entity.selected.writeNew.address = false;\n this.updateMapCenter(value.point);\n this.checkErrors();\n },\n remove() {\n this.entity.selected.address = {};\n this.checkErrors();\n },\n listenInputSearch(query) {\n //console.log('listenInputSearch', query, this.isAddressSelectorOpen);\n if (\n !this.entity.selected.writeNew.postcode &&\n \"id\" in this.entity.selected.city\n ) {\n if (query.length > 2) {\n this.isLoading = true;\n searchReferenceAddresses(query, this.entity.selected.city)\n .then(\n (addresses) =>\n new Promise((resolve, reject) => {\n this.entity.loaded.addresses =\n addresses.results;\n this.isLoading = false;\n resolve();\n }),\n )\n .catch((error) => {\n console.log(error); //TODO better error handling\n this.isLoading = false;\n });\n } else {\n if (query.length === 0) {\n // Fetch all cities when suppressing the query\n this.isLoading = true;\n fetchReferenceAddresses(this.entity.selected.city)\n .then(\n (addresses) =>\n new Promise((resolve, reject) => {\n this.entity.loaded.addresses =\n addresses.results;\n this.isLoading = false;\n resolve();\n }),\n )\n .catch((error) => {\n console.log(error);\n this.isLoading = false;\n });\n }\n }\n }\n\n if (this.isAddressSelectorOpen) {\n this.$data.value = { text: query };\n } else if (this.isEnteredCustomAddress) {\n let addr = this.splitAddress(this.$data.value.text);\n this.entity.selected.address.street = addr.street;\n this.entity.selected.address.streetNumber = addr.number;\n this.entity.selected.writeNew.address = true;\n this.checkErrors();\n }\n },\n splitAddress(address) {\n let substr = address.split(\",\").map((s) => s.trim());\n if (substr.length === 1) {\n substr = address.split(\" \");\n }\n let decimal = [];\n substr.forEach((s, i) => {\n decimal[i] = /^\\d+$/.test(s);\n });\n if (decimal[0] === true) {\n return {\n number: substr.shift(),\n street: substr.join(\" \"),\n };\n } else if (decimal[decimal.length - 1] === true) {\n return {\n number: substr.pop(),\n street: substr.join(\" \"),\n };\n }\n return {\n number: \"\",\n street: substr.join(\" \"),\n };\n },\n addAddress() {\n this.entity.selected.writeNew.address = true;\n },\n },\n};\n</script>\n\n<style src=\"vue-multiselect/dist/vue-multiselect.css\"></style>\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue",
"messages": [
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"entity\" prop.",
"line": 96,
"column": 20,
"nodeType": "CallExpression",
"messageId": "unexpectedMutation",
"endLine": 98,
"endColumn": 14
},
{
"ruleId": "vue/no-side-effects-in-computed-properties",
"severity": 2,
"message": "Unexpected side effect in \"cities\" computed property.",
"line": 96,
"column": 20,
"nodeType": "CallExpression",
"messageId": "unexpectedSideEffectInProperty",
"endLine": 98,
"endColumn": 14
},
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"entity\" prop.",
"line": 102,
"column": 17,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 102,
"endColumn": 59
},
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"entity\" prop.",
"line": 110,
"column": 17,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 110,
"endColumn": 59
},
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"entity\" prop.",
"line": 124,
"column": 13,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 124,
"endColumn": 51
},
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"entity\" prop.",
"line": 125,
"column": 13,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 125,
"endColumn": 65
},
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"entity\" prop.",
"line": 126,
"column": 13,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 126,
"endColumn": 65
},
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"entity\" prop.",
"line": 131,
"column": 21,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 132,
"endColumn": 54
},
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"entity\" prop.",
"line": 145,
"column": 13,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 145,
"endColumn": 46
},
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"entity\" prop.",
"line": 146,
"column": 13,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 146,
"endColumn": 60
},
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"entity\" prop.",
"line": 147,
"column": 13,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 147,
"endColumn": 60
},
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"entity\" prop.",
"line": 149,
"column": 17,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 150,
"endColumn": 45
},
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"entity\" prop.",
"line": 152,
"column": 13,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 152,
"endColumn": 59
},
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"entity\" prop.",
"line": 161,
"column": 13,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 161,
"endColumn": 43
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'reject' is defined but never used.",
"line": 170,
"column": 51,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 170,
"endColumn": 57
},
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"entity\" prop.",
"line": 171,
"column": 33,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 174,
"endColumn": 38
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'reject' is defined but never used.",
"line": 190,
"column": 55,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 190,
"endColumn": 61
},
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"entity\" prop.",
"line": 191,
"column": 37,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 194,
"endColumn": 42
},
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"entity\" prop.",
"line": 210,
"column": 17,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 210,
"endColumn": 49
},
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"entity\" prop.",
"line": 211,
"column": 17,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 211,
"endColumn": 63
},
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"entity\" prop.",
"line": 212,
"column": 17,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 212,
"endColumn": 63
},
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"entity\" prop.",
"line": 213,
"column": 17,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 213,
"endColumn": 62
},
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"entity\" prop.",
"line": 245,
"column": 13,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 245,
"endColumn": 58
}
],
"suppressedMessages": [],
"errorCount": 23,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "<template>\n <div class=\"my-1\">\n <label class=\"col-form-label\">{{ $t(\"city\") }}</label>\n <VueMultiselect\n id=\"citySelector\"\n v-model=\"value\"\n @search-change=\"listenInputSearch\"\n ref=\"citySelector\"\n @select=\"selectCity\"\n @remove=\"remove\"\n name=\"field\"\n track-by=\"id\"\n label=\"value\"\n :custom-label=\"transName\"\n :placeholder=\"$t('select_city')\"\n :select-label=\"$t('multiselect.select_label')\"\n :deselect-label=\"$t('create_postal_code')\"\n :selected-label=\"$t('multiselect.selected_label')\"\n :taggable=\"true\"\n :multiple=\"false\"\n :internal-search=\"false\"\n @tag=\"addPostcode\"\n :tag-placeholder=\"$t('create_postal_code')\"\n :loading=\"isLoading\"\n :options=\"cities\"\n />\n </div>\n\n <div\n class=\"custom-postcode row g-1\"\n v-if=\"writeNewPostcode || (isEnteredCustomCity && !isCitySelectorOpen)\"\n >\n <div class=\"col-4\">\n <div class=\"form-floating\">\n <input\n class=\"form-control\"\n type=\"text\"\n id=\"code\"\n :placeholder=\"$t('postalCode_code')\"\n v-model=\"code\"\n />\n <label for=\"code\">{{ $t(\"postalCode_code\") }}</label>\n </div>\n </div>\n <div class=\"col-8\">\n <div class=\"form-floating\">\n <input\n class=\"form-control\"\n type=\"text\"\n id=\"name\"\n :placeholder=\"$t('postalCode_name')\"\n v-model=\"name\"\n />\n <label for=\"name\">{{ $t(\"postalCode_name\") }}</label>\n </div>\n </div>\n </div>\n</template>\n\n<script>\nimport VueMultiselect from \"vue-multiselect\";\nimport { searchCities, fetchCities } from \"../../api.js\";\n\nexport default {\n name: \"CitySelection\",\n components: { VueMultiselect },\n props: [\n \"entity\",\n \"context\",\n \"focusOnAddress\",\n \"updateMapCenter\",\n \"flag\",\n \"checkErrors\",\n ],\n emits: [\"getReferenceAddresses\"],\n data() {\n return {\n value: this.context.edit ? this.entity.address.postcode : null,\n isLoading: false,\n };\n },\n computed: {\n writeNewPostcode() {\n return this.entity.selected.writeNew.postcode;\n },\n isCitySelectorOpen() {\n return this.$refs.citySelector.$data.isOpen;\n },\n isEnteredCustomCity() {\n return (\n this.$data.value !== null &&\n typeof this.$data.value.text !== \"undefined\"\n );\n },\n cities() {\n return this.entity.loaded.cities.sort(\n (a, b) => Number(a.code) - Number(b.code) || a.name > b.name,\n );\n },\n name: {\n set(value) {\n this.entity.selected.postcode.name = value;\n },\n get() {\n return this.entity.selected.postcode.name;\n },\n },\n code: {\n set(value) {\n this.entity.selected.postcode.code = value;\n },\n get() {\n return this.entity.selected.postcode.code;\n },\n },\n },\n mounted() {\n console.log(\n \"writeNew.postcode\",\n this.entity.selected.writeNew.postcode,\n \"in mounted\",\n );\n if (this.context.edit) {\n this.entity.selected.city = this.value;\n this.entity.selected.postcode.name = this.value.name;\n this.entity.selected.postcode.code = this.value.code;\n this.$emit(\"getReferenceAddresses\", this.value);\n if (typeof this.value.center !== \"undefined\") {\n this.updateMapCenter(this.value.center);\n if (this.value.center.coordinates) {\n this.entity.selected.postcode.coordinates =\n this.value.center.coordinates;\n }\n }\n }\n },\n methods: {\n transName(value) {\n return value.code && value.name\n ? `${value.name} (${value.code})`\n : \"\";\n },\n selectCity(value) {\n console.log(value);\n this.entity.selected.city = value;\n this.entity.selected.postcode.name = value.name;\n this.entity.selected.postcode.code = value.code;\n if (value.center) {\n this.entity.selected.postcode.coordinates =\n value.center.coordinates;\n }\n this.entity.selected.writeNew.postcode = false;\n this.$emit(\"getReferenceAddresses\", value);\n this.focusOnAddress();\n if (value.center) {\n this.updateMapCenter(value.center);\n }\n this.checkErrors();\n },\n remove() {\n this.entity.selected.city = {};\n this.checkErrors();\n },\n listenInputSearch(query) {\n if (query.length > 2) {\n this.isLoading = true;\n searchCities(query, this.entity.selected.country)\n .then(\n (cities) =>\n new Promise((resolve, reject) => {\n this.entity.loaded.cities =\n cities.results.filter(\n (c) => c.origin !== 3,\n ); // filter out user-defined cities\n this.isLoading = false;\n resolve();\n }),\n )\n .catch((error) => {\n console.log(error); //TODO better error handling\n this.isLoading = false;\n });\n } else {\n if (query.length === 0) {\n // Fetch all cities when suppressing the query\n this.isLoading = true;\n fetchCities(this.entity.selected.country)\n .then(\n (cities) =>\n new Promise((resolve, reject) => {\n this.entity.loaded.cities =\n cities.results.filter(\n (c) => c.origin !== 3,\n ); // filter out user-defined cities\n this.isLoading = false;\n resolve();\n }),\n )\n .catch((error) => {\n console.log(error);\n this.isLoading = false;\n });\n }\n }\n if (this.isCitySelectorOpen) {\n this.$data.value = { text: query };\n } else if (this.isEnteredCustomCity) {\n let city = this.splitCity(this.$data.value.text);\n this.$refs.citySelector.currentOptionLabel = \"\";\n this.entity.selected.city = city;\n this.entity.selected.postcode.name = city.name;\n this.entity.selected.postcode.code = city.code;\n this.entity.selected.writeNew.postcode = true;\n console.log(\"writeNew.postcode true, in listenInputSearch\");\n }\n },\n splitCity(city) {\n let substr = city.split(\"-\").map((s) => s.trim());\n if (substr.length === 1) {\n substr = city.split(\" \");\n }\n //console.log('substr', substr);\n let decimal = [];\n substr.forEach((s, i) => {\n decimal[i] = /^\\d+$/.test(s);\n });\n if (decimal[0] === true) {\n return {\n code: substr.shift(),\n name: substr.join(\" \"),\n };\n } else if (decimal[decimal.length - 1] === true) {\n return {\n code: substr.pop(),\n name: substr.join(\" \"),\n };\n }\n return {\n code: \"\",\n name: substr.join(\" \"),\n };\n },\n addPostcode() {\n console.log(\"addPostcode: pass here ?? never, it seems\");\n this.entity.selected.writeNew.postcode = true;\n console.log(\"writeNew.postcode true, in addPostcode\");\n },\n },\n};\n</script>\n\n<style src=\"vue-multiselect/dist/vue-multiselect.css\"></style>\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CountrySelection.vue",
"messages": [
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"entity\" prop.",
"line": 75,
"column": 13,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 75,
"endColumn": 49
},
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"entity\" prop.",
"line": 80,
"column": 13,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 80,
"endColumn": 48
}
],
"suppressedMessages": [],
"errorCount": 2,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "<template>\n <div class=\"my-1\">\n <label class=\"col-form-label\" for=\"countrySelect\">{{\n $t(\"country\")\n }}</label>\n <VueMultiselect\n id=\"countrySelect\"\n label=\"name\"\n track-by=\"id\"\n :custom-label=\"transName\"\n :placeholder=\"$t('select_country')\"\n :options=\"sortedCountries\"\n v-model=\"value\"\n :select-label=\"$t('multiselect.select_label')\"\n :deselect-label=\"$t('multiselect.deselect_label')\"\n :selected-label=\"$t('multiselect.selected_label')\"\n @select=\"selectCountry\"\n @remove=\"remove\"\n />\n </div>\n</template>\n\n<script>\nimport VueMultiselect from \"vue-multiselect\";\n\nexport default {\n name: \"CountrySelection\",\n components: { VueMultiselect },\n props: [\"context\", \"entity\", \"flag\", \"checkErrors\"],\n emits: [\"getCities\"],\n data() {\n return {\n value: this.selectCountryByCode(\n this.context.edit\n ? this.entity.selected.country.code\n : this.context.defaults.default_country,\n ),\n };\n },\n computed: {\n sortedCountries() {\n const countries = this.entity.loaded.countries;\n let sortedCountries = [];\n sortedCountries.push(\n ...countries.filter((c) => c.countryCode === \"FR\"),\n );\n sortedCountries.push(\n ...countries.filter((c) => c.countryCode === \"BE\"),\n );\n sortedCountries.push(\n ...countries\n .filter((c) => c.countryCode !== \"FR\")\n .filter((c) => c.countryCode !== \"BE\"),\n );\n return sortedCountries;\n },\n },\n mounted() {\n console.log(\"country selection mounted\", this.value);\n if (this.value !== undefined) {\n this.selectCountry(this.value);\n }\n },\n methods: {\n selectCountryByCode(countryCode) {\n return this.entity.loaded.countries.filter(\n (c) => c.countryCode === countryCode,\n )[0];\n },\n transName({ name }) {\n return name.fr; //TODO multilang\n },\n selectCountry(value) {\n //console.log('select country', value);\n this.entity.selected.country = value;\n this.$emit(\"getCities\", value);\n this.checkErrors();\n },\n remove() {\n this.entity.selected.country = null;\n this.checkErrors();\n },\n },\n};\n</script>\n\n<style src=\"vue-multiselect/dist/vue-multiselect.css\"></style>\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/DatePane.vue",
"messages": [
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"entity\" prop.",
"line": 95,
"column": 17,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 95,
"endColumn": 67
},
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"entity\" prop.",
"line": 103,
"column": 17,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 103,
"endColumn": 65
}
],
"suppressedMessages": [],
"errorCount": 2,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "<template>\n <div v-if=\"insideModal === false\" class=\"loading\">\n <i\n v-if=\"flag.loading\"\n class=\"fa fa-circle-o-notch fa-spin fa-2x fa-fw\"\n />\n <span class=\"sr-only\">{{ $t(\"loading\") }}</span>\n </div>\n\n <div v-if=\"errorMsg && errorMsg.length > 0\" class=\"alert alert-danger\">\n {{ errorMsg }}\n </div>\n\n <address-render-box :address=\"selectedAddress\" />\n\n <div class=\"row\">\n <div v-if=\"showDateFrom\" class=\"col-lg-6 address-valid date-since\">\n <h3>{{ $t(getValidFromDateText) }}</h3>\n <div class=\"input-group mb-3\">\n <span class=\"input-group-text\" id=\"validFrom\"\n ><i class=\"fa fa-fw fa-calendar\"\n /></span>\n <input\n type=\"date\"\n class=\"form-control form-control-lg\"\n name=\"validFrom\"\n :placeholder=\"$t(getValidFromDateText)\"\n v-model=\"validFrom\"\n aria-describedby=\"validFrom\"\n />\n </div>\n </div>\n\n <div v-if=\"showDateTo\" class=\"col-lg-6 address-valid date-until\">\n <h3>{{ $t(getValidToDateText) }}</h3>\n <div class=\"input-group mb-3\">\n <span class=\"input-group-text\" id=\"validTo\"\n ><i class=\"fa fa-fw fa-calendar\"\n /></span>\n <input\n type=\"date\"\n class=\"form-control form-control-lg\"\n name=\"validTo\"\n :placeholder=\"$t(getValidToDateText)\"\n v-model=\"validTo\"\n aria-describedby=\"validTo\"\n />\n </div>\n </div>\n </div>\n\n <action-buttons\n v-if=\"insideModal === false\"\n :options=\"this.options\"\n :defaultz=\"this.defaultz\"\n >\n <template #before>\n <slot name=\"before\" />\n </template>\n <template #action>\n <slot name=\"action\" />\n </template>\n <template #after>\n <slot name=\"after\" />\n </template>\n </action-buttons>\n</template>\n\n<script>\nimport { dateToISO, ISOToDate } from \"ChillMainAssets/chill/js/date\";\nimport AddressRenderBox from \"ChillMainAssets/vuejs/_components/Entity/AddressRenderBox.vue\";\nimport ActionButtons from \"./ActionButtons.vue\";\n\nexport default {\n name: \"DatePane\",\n components: {\n AddressRenderBox,\n ActionButtons,\n },\n props: [\n \"context\",\n \"options\",\n \"defaultz\",\n \"flag\",\n \"entity\",\n \"errorMsg\",\n \"insideModal\",\n ],\n computed: {\n address() {\n return this.entity.address;\n },\n validFrom: {\n set(value) {\n this.entity.selected.valid.from = ISOToDate(value);\n },\n get() {\n return dateToISO(this.entity.selected.valid.from);\n },\n },\n validTo: {\n set(value) {\n this.entity.selected.valid.to = ISOToDate(value);\n },\n get() {\n return dateToISO(this.entity.selected.valid.to);\n },\n },\n getValidFromDateText() {\n return this.context.target.name === \"household\"\n ? \"move_date\"\n : \"validFrom\";\n },\n getValidToDateText() {\n return \"validTo\";\n },\n showDateFrom() {\n return !this.context.edit && this.options.useDate.validFrom;\n },\n showDateTo() {\n return !this.context.edit && this.options.useDate.validTo;\n },\n selectedAddress() {\n let address = {};\n\n address[\"country\"] = this.entity.selected.country\n ? this.entity.selected.country\n : null;\n address[\"postcode\"] = this.entity.selected.postcode\n ? this.entity.selected.postcode\n : null;\n\n if (this.entity.selected.address) {\n let number = this.entity.selected.address.streetNumber\n ? this.entity.selected.address.streetNumber\n : null;\n let street = this.entity.selected.address.street\n ? this.entity.selected.address.street\n : null;\n address[\"text\"] = number + \", \" + street;\n\n address[\"street\"] = this.entity.selected.address.street\n ? this.entity.selected.address.street\n : null;\n address[\"streetNumber\"] = this.entity.selected.address\n .streetNumber\n ? this.entity.selected.address.streetNumber\n : null;\n address[\"floor\"] = this.entity.selected.address.floor\n ? this.entity.selected.address.floor\n : null;\n address[\"corridor\"] = this.entity.selected.address.corridor\n ? this.entity.selected.address.corridor\n : null;\n address[\"steps\"] = this.entity.selected.address.steps\n ? this.entity.selected.address.steps\n : null;\n address[\"flat\"] = this.entity.selected.address.flat\n ? this.entity.selected.address.flat\n : null;\n address[\"buildingName\"] = this.entity.selected.address\n .buildingName\n ? this.entity.selected.address.buildingName\n : null;\n address[\"distribution\"] = this.entity.selected.address\n .distribution\n ? this.entity.selected.address.distribution\n : null;\n address[\"extra\"] = this.entity.selected.address.extra\n ? this.entity.selected.address.extra\n : null;\n }\n\n if (this.entity.selected.valid) {\n address[\"validFrom\"] = this.entity.selected.valid.from\n ? dateToISO(this.entity.selected.valid.from)\n : null;\n address[\"validTo\"] = this.entity.selected.valid.to\n ? dateToISO(this.entity.selected.valid.to)\n : null;\n }\n\n return address;\n },\n },\n};\n</script>\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/EditPane.vue",
"messages": [
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"entity\" prop.",
"line": 155,
"column": 17,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 155,
"endColumn": 58
},
{
"ruleId": "vue/no-mutating-props",
"severity": 2,
"message": "Unexpected mutation of \"entity\" prop.",
"line": 164,
"column": 17,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedMutation",
"endLine": 164,
"endColumn": 57
}
],
"suppressedMessages": [],
"errorCount": 2,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "<template>\n <div class=\"address-form\">\n <!-- Not display in modal -->\n <div v-if=\"insideModal === false\" class=\"loading\">\n <i\n v-if=\"flag.loading\"\n class=\"fa fa-circle-o-notch fa-spin fa-2x fa-fw\"\n />\n <span class=\"sr-only\">Loading...</span>\n </div>\n\n <div v-if=\"errors.length\" class=\"alert alert-warning\">\n <ul>\n <li v-for=\"(e, i) in errors\" :key=\"i\">\n {{ e }}\n </li>\n </ul>\n </div>\n\n <h4 class=\"h3\">\n {{ $t(\"select_an_address_title\") }}\n </h4>\n <div class=\"row my-3\">\n <div class=\"col-lg-6\">\n <div class=\"form-check\">\n <input\n type=\"checkbox\"\n class=\"form-check-input\"\n id=\"isConfidential\"\n v-model=\"isConfidential\"\n :value=\"valueConfidential\"\n />\n <label class=\"form-check-label\" for=\"isConfidential\">\n {{ $t(\"isConfidential\") }}\n </label>\n </div>\n <div class=\"form-check\">\n <input\n type=\"checkbox\"\n class=\"form-check-input\"\n id=\"isNoAddress\"\n v-model=\"isNoAddress\"\n :value=\"value\"\n />\n <label class=\"form-check-label\" for=\"isNoAddress\">\n {{ $t(\"isNoAddress\") }}\n </label>\n </div>\n\n <country-selection\n :context=\"context\"\n :entity=\"entity\"\n :flag=\"flag\"\n :check-errors=\"checkErrors\"\n @get-cities=\"$emit('getCities', selected.country)\"\n />\n\n <city-selection\n :entity=\"entity\"\n :context=\"context\"\n :focus-on-address=\"focusOnAddress\"\n :update-map-center=\"updateMapCenter\"\n :flag=\"flag\"\n :check-errors=\"checkErrors\"\n @get-reference-addresses=\"\n $emit('getReferenceAddresses', selected.city)\n \"\n />\n\n <address-selection\n v-if=\"!isNoAddress\"\n :entity=\"entity\"\n :context=\"context\"\n :update-map-center=\"updateMapCenter\"\n :flag=\"flag\"\n :check-errors=\"checkErrors\"\n />\n </div>\n <div class=\"col-lg-6 mt-3 mt-lg-0\">\n <address-map :entity=\"entity\" ref=\"addressMap\" />\n </div>\n </div>\n\n <address-more :entity=\"entity\" :is-no-address=\"isNoAddress\" />\n\n <action-buttons\n v-if=\"insideModal === false\"\n :options=\"this.options\"\n :defaultz=\"this.defaultz\"\n >\n <template #before>\n <slot name=\"before\" />\n </template>\n <template #action>\n <slot name=\"action\" />\n </template>\n <template #after>\n <slot name=\"after\" />\n </template>\n </action-buttons>\n </div>\n</template>\n\n<script>\nimport CountrySelection from \"./AddAddress/CountrySelection\";\nimport CitySelection from \"./AddAddress/CitySelection\";\nimport AddressSelection from \"./AddAddress/AddressSelection\";\nimport AddressMap from \"./AddAddress/AddressMap\";\nimport AddressMore from \"./AddAddress/AddressMore\";\nimport ActionButtons from \"./ActionButtons.vue\";\n\nexport default {\n name: \"EditPane\",\n components: {\n CountrySelection,\n CitySelection,\n AddressSelection,\n AddressMap,\n AddressMore,\n ActionButtons,\n },\n props: [\n \"context\",\n \"options\",\n \"defaultz\",\n \"flag\",\n \"entity\",\n \"errorMsg\",\n \"insideModal\",\n \"errors\",\n \"checkErrors\",\n ],\n emits: [\"getCities\", \"getReferenceAddresses\"],\n data() {\n return {\n value: false,\n valueConfidential: false,\n };\n },\n computed: {\n address() {\n return this.entity.address;\n },\n loaded() {\n return this.entity.loaded;\n },\n selected() {\n return this.entity.selected;\n },\n addressMap() {\n return this.entity.addressMap;\n },\n isConfidential: {\n set(value) {\n this.entity.selected.confidential = value;\n },\n get() {\n return this.entity.selected.confidential;\n },\n },\n isNoAddress: {\n set(value) {\n console.log(\"isNoAddress value\", value);\n this.entity.selected.isNoAddress = value;\n this.checkErrors();\n },\n get() {\n return this.entity.selected.isNoAddress;\n },\n },\n },\n methods: {\n focusOnAddress() {\n const addressSelector = document.getElementById(\"addressSelector\");\n if (addressSelector !== null) {\n addressSelector.focus();\n }\n },\n updateMapCenter(point) {\n console.log(\"point\", point);\n this.addressMap.center[0] = point.coordinates[0];\n this.addressMap.center[1] = point.coordinates[1];\n this.$refs.addressMap.update(); // cast child methods\n },\n },\n};\n</script>\n\n<style lang=\"scss\">\ndiv.address-form {\n div#address_map {\n height: 400px;\n width: 100%;\n z-index: 1;\n }\n}\n</style>\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/index.js",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'app' is assigned a value but never used.",
"line": 10,
"column": 9,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 10,
"endColumn": 12
}
],
"suppressedMessages": [],
"errorCount": 1,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "import { createApp } from \"vue\";\nimport { _createI18n } from \"ChillMainAssets/vuejs/_js/i18n\";\nimport { addressMessages } from \"./i18n\";\nimport App from \"./App.vue\";\n\nconst i18n = _createI18n(addressMessages);\n\nlet containers = document.querySelectorAll(\".address-container\");\ncontainers.forEach((container) => {\n const app = createApp({\n template: `<app v-bind:addAddress=\"this.addAddress\" ></app>`,\n data() {\n return {\n addAddress: {\n context: {\n target: {\n name: container.dataset.targetName,\n id: parseInt(container.dataset.targetId),\n },\n edit: container.dataset.mode === \"edit\", //boolean\n addressId: parseInt(container.dataset.addressId) || null,\n backUrl: container.dataset.backUrl || null,\n defaults: JSON.parse(container.dataset.addressDefaults),\n },\n options: {\n /// Options override default.\n /// null value take default component value defined in AddAddress data()\n button: {\n text: {\n create: container.dataset.buttonText || null,\n edit: container.dataset.buttonText || null,\n },\n size: container.dataset.buttonSize || null,\n displayText: container.dataset.buttonDisplayText !== \"false\", //boolean, default: true\n },\n\n /// Modal title text if create or edit address (trans chain, see i18n)\n title: {\n create: container.dataset.modalTitle || null,\n edit: container.dataset.modalTitle || null,\n },\n\n /// Display panes in Modal for step123\n openPanesInModal: container.dataset.openPanesInModal !== \"false\", //boolean, default: true\n\n /// Display actions buttons of panes in a sticky-form-button navbar\n stickyActions: container.dataset.stickyActions === \"true\", //boolean, default: false\n\n /// Use Date fields\n useDate: {\n validFrom: container.dataset.useValidFrom === \"true\", //boolean, default: false\n validTo: container.dataset.useValidTo === \"true\", //boolean, default: false\n },\n\n /// Don't display show renderbox Address: showPane display only a button\n onlyButton: container.dataset.onlyButton === \"true\", //boolean, default: false\n },\n },\n };\n },\n })\n .use(i18n)\n .component(\"app\", App)\n .mount(container);\n\n //console.log('container dataset', container.dataset);\n});\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/mod_input_address_index.js",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'app' is assigned a value but never used.",
"line": 22,
"column": 11,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 22,
"endColumn": 14
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'_e' is defined but never used.",
"line": 86,
"column": 48,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 86,
"endColumn": 50
}
],
"suppressedMessages": [],
"errorCount": 2,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "import { createApp } from \"vue\";\nimport { _createI18n } from \"ChillMainAssets/vuejs/_js/i18n\";\nimport { addressMessages } from \"./i18n\";\nimport App from \"./App.vue\";\n\nconst i18n = _createI18n(addressMessages);\n\nconst addAddressInput = (inputs) => {\n console.log(inputs);\n inputs.forEach((el) => {\n let addressId = el.value,\n uniqid = el.dataset.inputAddress,\n container = el.parentNode.querySelector(\n 'div[data-input-address-container=\"' + uniqid + '\"]',\n ),\n isEdit = addressId !== \"\",\n addressIdInt = addressId !== \"\" ? parseInt(addressId) : null;\n if (container === null) {\n throw Error(\"no container\");\n }\n /* exported app */\n const app = createApp({\n template: `<app v-bind:addAddress=\"this.addAddress\" @address-created=\"associateToInput\"></app>`,\n data() {\n return {\n addAddress: {\n context: {\n // for legacy ? can be remove ?\n target: {\n name: \"input-address\",\n id: addressIdInt,\n },\n edit: isEdit,\n addressId: addressIdInt,\n defaults: window.addaddress,\n },\n options: {\n /// Options override default.\n /// null value take default component value defined in AddAddress data()\n button: {\n text: {\n create: el.dataset.buttonTextCreate || null,\n edit: el.dataset.buttonTextUpdate || null,\n },\n size: null,\n displayText: true,\n },\n\n /// Modal title text if create or edit address (trans chain, see i18n)\n title: {\n create: null,\n edit: null,\n },\n\n /// Display panes in Modal for step123\n openPanesInModal: true,\n\n /// Display actions buttons of panes in a sticky-form-button navbar\n stickyActions: false,\n showMessageWhenNoAddress: true,\n\n /// Use Date fields\n useDate: {\n validFrom: el.dataset.useValidFrom === \"1\" || false, //boolean, default: false\n validTo: el.dataset.useValidTo === \"1\" || false, //boolean, default: false\n },\n\n /// Don't display show renderbox Address: showPane display only a button\n onlyButton: false,\n },\n },\n };\n },\n methods: {\n associateToInput(payload) {\n el.value = payload.addressId;\n },\n },\n })\n .use(i18n)\n .component(\"app\", App)\n .mount(container);\n });\n};\n\ndocument.addEventListener(\"DOMContentLoaded\", (_e) =>\n addAddressInput(\n document.querySelectorAll('input[type=\"hidden\"][data-input-address]'),\n ),\n);\n\nwindow.addEventListener(\"collection-add-entry\", (e) =>\n addAddressInput(\n e.detail.entry.querySelectorAll('input[type=\"hidden\"][data-input-address]'),\n ),\n);\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/DashboardWidgets/NewsItem.vue",
"messages": [
{
"ruleId": "@typescript-eslint/no-explicit-any",
"severity": 2,
"message": "Unexpected any. Specify a different type.",
"line": 142,
"column": 57,
"nodeType": "TSAnyKeyword",
"messageId": "unexpectedAny",
"endLine": 142,
"endColumn": 60,
"suggestions": [
{
"messageId": "suggestUnknown",
"fix": {
"range": [
4203,
4206
],
"text": "unknown"
},
"desc": "Use `unknown` instead, this will force you to explicitly, and safely assert the type is correct."
},
{
"messageId": "suggestNever",
"fix": {
"range": [
4203,
4206
],
"text": "never"
},
"desc": "Use `never` instead, this is useful when instantiating generic type parameters that you don't need to know the type of."
}
]
}
],
"suppressedMessages": [],
"errorCount": 1,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "<template>\n <li>\n <h2>{{ props.item.title }}</h2>\n <time class=\"createdBy\" datetime=\"{{item.startDate.datetime}}\">{{\n $d(newsItemStartDate(), \"text\")\n }}</time>\n <div class=\"content\" v-if=\"shouldTruncate(item.content)\">\n <div v-html=\"prepareContent(item.content)\"></div>\n <div class=\"float-end\">\n <button\n class=\"btn btn-sm btn-show read-more\"\n @click=\"() => openModal(item)\"\n >\n {{ $t(\"widget.news.readMore\") }}\n </button>\n </div>\n </div>\n <div class=\"content\" v-else>\n <div v-html=\"convertMarkdownToHtml(item.content)\"></div>\n </div>\n\n <modal v-if=\"showModal\" @close=\"closeModal\">\n <template #header>\n <p class=\"news-title\">{{ item.title }}</p>\n </template>\n <template #body>\n <p class=\"news-date\">\n <time\n class=\"createdBy\"\n datetime=\"{{item.startDate.datetime}}\"\n >{{ $d(newsItemStartDate(), \"text\") }}</time\n >\n </p>\n <div v-html=\"convertMarkdownToHtml(item.content)\"></div>\n </template>\n </modal>\n </li>\n</template>\n\n<script setup lang=\"ts\">\nimport Modal from \"ChillMainAssets/vuejs/_components/Modal.vue\";\nimport { marked } from \"marked\";\nimport DOMPurify from \"dompurify\";\nimport { NewsItemType } from \"../../../types\";\nimport type { PropType } from \"vue\";\nimport { ref } from \"vue\";\nimport { ISOToDatetime } from \"../../../chill/js/date\";\n\nconst props = defineProps({\n item: {\n type: Object as PropType<NewsItemType>,\n required: true,\n },\n maxLength: {\n type: Number,\n required: false,\n default: 350,\n },\n maxLines: {\n type: Number,\n required: false,\n default: 3,\n },\n});\n\nconst selectedArticle = ref<NewsItemType | null>(null);\nconst showModal = ref(false);\n\nconst openModal = (item: NewsItemType) => {\n selectedArticle.value = item;\n showModal.value = true;\n};\n\nconst closeModal = () => {\n selectedArticle.value = null;\n showModal.value = false;\n};\n\nconst shouldTruncate = (content: string): boolean => {\n const lines = content.split(\"\\n\");\n\n // Check if any line exceeds the maximum length\n const tooManyLines = lines.length > props.maxLines;\n\n return content.length > props.maxLength || tooManyLines;\n};\n\nconst truncateContent = (content: string): string => {\n let truncatedContent = content.slice(0, props.maxLength);\n let linkDepth = 0;\n let linkStartIndex = -1;\n const lines = content.split(\"\\n\");\n\n // Truncate if amount of lines are too many\n if (lines.length > props.maxLines && content.length < props.maxLength) {\n const truncatedContent = lines\n .slice(0, props.maxLines)\n .join(\"\\n\")\n .trim();\n return truncatedContent + \"...\";\n }\n\n for (let i = 0; i < truncatedContent.length; i++) {\n const char = truncatedContent[i];\n\n if (char === \"[\") {\n linkDepth++;\n if (linkDepth === 1) {\n linkStartIndex = i;\n }\n } else if (char === \"]\") {\n linkDepth = Math.max(0, linkDepth - 1);\n } else if (char === \"(\" && linkDepth === 0) {\n truncatedContent = truncatedContent.slice(0, i);\n break;\n }\n }\n\n while (linkDepth > 0) {\n truncatedContent += \"]\";\n linkDepth--;\n }\n\n // If a link was found, append the URL inside the parentheses\n if (linkStartIndex !== -1) {\n const linkEndIndex = content.indexOf(\")\", linkStartIndex);\n const url = content.slice(linkStartIndex + 1, linkEndIndex);\n truncatedContent =\n truncatedContent.slice(0, linkStartIndex) + `(${url})`;\n }\n\n truncatedContent += \"...\";\n\n return truncatedContent;\n};\n\nconst preprocess = (markdown: string): string => {\n return markdown;\n};\n\nconst postprocess = (html: string): string => {\n DOMPurify.addHook(\"afterSanitizeAttributes\", (node: any) => {\n if (\"target\" in node) {\n node.setAttribute(\"target\", \"_blank\");\n node.setAttribute(\"rel\", \"noopener noreferrer\");\n }\n if (\n !node.hasAttribute(\"target\") &&\n (node.hasAttribute(\"xlink:href\") || node.hasAttribute(\"href\"))\n ) {\n node.setAttribute(\"xlink:show\", \"new\");\n }\n });\n\n return DOMPurify.sanitize(html);\n};\n\nconst convertMarkdownToHtml = (markdown: string): string => {\n marked.use({ hooks: { postprocess, preprocess }, async: false });\n const rawHtml = marked(markdown) as string;\n return rawHtml;\n};\n\nconst prepareContent = (content: string): string => {\n const htmlContent = convertMarkdownToHtml(content);\n return truncateContent(htmlContent);\n};\n\nconst newsItemStartDate = (): null | Date => {\n return ISOToDatetime(props.item?.startDate.datetime);\n};\n</script>\n\n<style scoped>\nli {\n margin-bottom: 20px;\n overflow: hidden;\n padding: 0.8rem;\n background-color: #fbfbfb;\n border-radius: 4px;\n}\n\nh2 {\n font-size: 1rem !important;\n text-transform: uppercase;\n}\n\n.content {\n overflow: hidden;\n font-size: 0.9rem;\n position: relative;\n}\n\n.news-title {\n font-weight: bold;\n}\n</style>\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue",
"messages": [
{
"ruleId": "vue/return-in-computed-property",
"severity": 2,
"message": "Expected to return a value in \"buttonMessage\" computed property.",
"line": 204,
"column": 22,
"nodeType": "FunctionExpression",
"messageId": "expectedReturnInProperty",
"endLine": 211,
"endColumn": 10
}
],
"suppressedMessages": [],
"errorCount": 1,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "<template>\n <a v-if=\"isDisplayBadge\" @click=\"openModal\">\n <span class=\"chill-entity\" :class=\"badgeType\">\n {{ buttonText }}<span v-if=\"isDead\"> (‡)</span>\n </span>\n </a>\n <a\n v-else\n class=\"btn btn-sm\"\n target=\"_blank\"\n :class=\"classAction\"\n :title=\"$t(titleAction)\"\n @click=\"openModal\"\n >\n {{ buttonText }}<span v-if=\"isDead\"> (‡)</span>\n </a>\n\n <teleport to=\"body\">\n <modal\n v-if=\"modal.showModal\"\n :modal-dialog-class=\"modal.modalDialogClass\"\n @close=\"modal.showModal = false\"\n >\n <template #header>\n <h3 v-if=\"parent\" class=\"modal-title\">\n {{ $t(titleModal, { q: parent.text }) }}\n </h3>\n <h3 v-else class=\"modal-title\">\n {{ $t(titleModal) }}\n </h3>\n </template>\n\n <template #body v-if=\"type === 'person'\">\n <on-the-fly-person\n :id=\"id\"\n :type=\"type\"\n :action=\"action\"\n ref=\"castPerson\"\n />\n <div v-if=\"hasResourceComment\">\n <h3>{{ $t(\"onthefly.resource_comment_title\") }}</h3>\n <blockquote class=\"chill-user-quote\">\n {{ parent.comment }}\n </blockquote>\n </div>\n </template>\n\n <template #body v-else-if=\"type === 'thirdparty'\">\n <on-the-fly-thirdparty\n :id=\"id\"\n :type=\"type\"\n :action=\"action\"\n ref=\"castThirdparty\"\n />\n <div v-if=\"hasResourceComment\">\n <h3>{{ $t(\"onthefly.resource_comment_title\") }}</h3>\n <blockquote class=\"chill-user-quote\">\n {{ parent.comment }}\n </blockquote>\n </div>\n </template>\n\n <template #body v-else-if=\"parent\">\n <on-the-fly-thirdparty\n :parent=\"parent\"\n :action=\"action\"\n type=\"thirdparty\"\n ref=\"castThirdparty\"\n />\n </template>\n\n <template #body v-else>\n <on-the-fly-create\n :action=\"action\"\n :allowed-types=\"allowedTypes\"\n :query=\"query\"\n ref=\"castNew\"\n />\n </template>\n\n <template #footer>\n <a\n v-if=\"action === 'show'\"\n :href=\"buildLocation(id, type)\"\n :title=\"$t(titleMessage)\"\n class=\"btn btn-show\"\n >{{ $t(buttonMessage) }}\n </a>\n <a v-else class=\"btn btn-save\" @click=\"saveAction\">\n {{ $t(\"action.save\") }}\n </a>\n </template>\n </modal>\n </teleport>\n</template>\n\n<script>\nimport Modal from \"ChillMainAssets/vuejs/_components/Modal.vue\";\nimport OnTheFlyCreate from \"./Create.vue\";\nimport OnTheFlyPerson from \"ChillPersonAssets/vuejs/_components/OnTheFly/Person.vue\";\nimport OnTheFlyThirdparty from \"ChillThirdPartyAssets/vuejs/_components/OnTheFly/ThirdParty.vue\";\n\nexport default {\n name: \"OnTheFly\",\n components: {\n Modal,\n OnTheFlyPerson,\n OnTheFlyThirdparty,\n OnTheFlyCreate,\n },\n props: [\n \"type\",\n \"id\",\n \"action\",\n \"buttonText\",\n \"displayBadge\",\n \"isDead\",\n \"parent\",\n \"allowedTypes\",\n \"query\",\n ],\n emits: [\"saveFormOnTheFly\"],\n data() {\n return {\n modal: {\n showModal: false,\n modalDialogClass: \"modal-dialog-scrollable modal-xl\",\n },\n };\n },\n computed: {\n hasResourceComment() {\n return (\n typeof this.parent !== \"undefined\" &&\n this.parent !== null &&\n this.action === \"show\" &&\n this.parent.type === \"accompanying_period_resource\" &&\n this.parent.comment !== null &&\n this.parent.comment !== \"\"\n );\n },\n classAction() {\n switch (this.action) {\n case \"show\":\n return \"btn-show\";\n case \"edit\":\n return \"btn-update\";\n case \"create\":\n return \"btn-create\";\n case \"addContact\":\n return \"btn-tpchild\";\n default:\n return \"\";\n }\n },\n titleAction() {\n switch (this.action) {\n case \"show\":\n return \"action.show\";\n case \"edit\":\n return \"action.edit\";\n case \"create\":\n return \"action.create\";\n case \"addContact\":\n return \"action.addContact\";\n default:\n return \"\";\n }\n },\n titleCreate() {\n if (typeof this.allowedTypes === \"undefined\") {\n return \"onthefly.create.title.default\";\n }\n return this.allowedTypes.every((t) => t === \"person\")\n ? \"onthefly.create.title.person\"\n : this.allowedTypes.every((t) => t === \"thirdparty\")\n ? \"onthefly.create.title.thirdparty\"\n : \"onthefly.create.title.default\";\n },\n titleModal() {\n switch (this.action) {\n case \"show\":\n return \"onthefly.show.\" + this.type;\n case \"edit\":\n return \"onthefly.edit.\" + this.type;\n case \"create\":\n return this.titleCreate;\n case \"addContact\":\n return \"onthefly.addContact.title\";\n default:\n return \"\";\n }\n },\n titleMessage() {\n switch (this.type) {\n case \"person\":\n return \"action.redirect.\" + this.type;\n case \"thirdparty\":\n return \"action.redirect.\" + this.type;\n default:\n return \"\";\n }\n },\n buttonMessage() {\n switch (this.type) {\n case \"person\":\n return \"onthefly.show.file_\" + this.type;\n case \"thirdparty\":\n return \"onthefly.show.file_\" + this.type;\n }\n },\n isDisplayBadge() {\n return this.displayBadge === true && this.buttonText !== null;\n },\n badgeType() {\n return \"entity-\" + this.type + \" badge-\" + this.type;\n },\n getReturnPath() {\n return `?returnPath=${window.location.pathname}${window.location.search}${window.location.hash}`;\n },\n },\n methods: {\n closeModal() {\n this.modal.showModal = false;\n },\n openModal() {\n // console.log('## OPEN ON THE FLY MODAL');\n // console.log('## type:', this.type, ', action:', this.action);\n this.modal.showModal = true;\n this.$nextTick(function () {\n //this.$refs.search.focus();\n });\n },\n changeActionTo(action) {\n this.$data.action = action;\n },\n saveAction() {\n // console.log('saveAction button: create/edit action with', this.type);\n let type = this.type,\n data = {};\n switch (type) {\n case \"person\":\n data = this.$refs.castPerson.$data.person;\n console.log(\"person data are\", data);\n break;\n\n case \"thirdparty\":\n data = this.$refs.castThirdparty.$data.thirdparty;\n /* never executed ? */\n break;\n\n default:\n if (typeof this.type === \"undefined\") {\n // action=create or addContact\n // console.log('will rewrite data');\n if (this.action === \"addContact\") {\n type = \"thirdparty\";\n data = this.$refs.castThirdparty.$data.thirdparty;\n // console.log('data original', data);\n data.parent = {\n type: \"thirdparty\",\n id: this.parent.id,\n };\n data.civility =\n data.civility !== null\n ? {\n type: \"chill_main_civility\",\n id: data.civility.id,\n }\n : null;\n data.profession =\n data.profession !== \"\" ? data.profession : \"\";\n } else {\n type = this.$refs.castNew.radioType;\n data = this.$refs.castNew.castDataByType();\n // console.log('type', type);\n if (\n typeof data.civility !== \"undefined\" &&\n null !== data.civility\n ) {\n data.civility =\n data.civility !== null\n ? {\n type: \"chill_main_civility\",\n id: data.civility.id,\n }\n : null;\n }\n if (\n typeof data.profession !== \"undefined\" &&\n \"\" !== data.profession\n ) {\n data.profession =\n data.profession !== \"\"\n ? data.profession\n : \"\";\n }\n // console.log('onthefly data', data);\n }\n } else {\n throw \"error with object type\";\n }\n }\n // pass datas to parent\n this.$emit(\"saveFormOnTheFly\", { type: type, data: data });\n },\n buildLocation(id, type) {\n if (type === \"person\") {\n // TODO i18n\n return encodeURI(\n `/fr/person/${id}/general${this.getReturnPath}`,\n );\n } else if (type === \"thirdparty\") {\n return encodeURI(\n `/fr/3party/3party/${id}/view${this.getReturnPath}`,\n );\n }\n },\n },\n};\n</script>\n\n<style lang=\"css\" scoped>\na {\n cursor: pointer;\n}\n\n/* .btn-add-contact {\n background-color: pink;\n} */\n</style>\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/index.js",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'app' is assigned a value but never used.",
"line": 12,
"column": 9,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 12,
"endColumn": 12
}
],
"suppressedMessages": [],
"errorCount": 1,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "import { createApp } from \"vue\";\nimport { _createI18n } from \"ChillMainAssets/vuejs/_js/i18n\";\nimport { ontheflyMessages } from \"./i18n.js\";\nimport App from \"./App.vue\";\n\nconst i18n = _createI18n(ontheflyMessages);\n\nlet containers = document.querySelectorAll(\".onthefly-container\");\n\ncontainers.forEach((container) => {\n /*exported app */\n const app = createApp({\n template: `<app :onTheFly=\"this.onTheFly\" ></app>`,\n data() {\n return {\n onTheFly: {\n context: {\n action: container.dataset.action,\n type: container.dataset.targetName,\n id: parseInt(container.dataset.targetId),\n },\n options: {\n buttonText: container.dataset.buttonText || null,\n displayBadge: container.dataset.displayBadge || false,\n isDead: container.dataset.isDead || false,\n parent: container.dataset.parent\n ? JSON.parse(container.dataset.parent)\n : null,\n },\n },\n };\n },\n })\n .use(i18n)\n .component(\"app\", App)\n .mount(container);\n\n //console.log('container dataset', container.dataset);\n //console.log('data-parent', container.dataset.parent);\n});\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillMainBundle/Resources/public/vuejs/PickEntity/PickEntity.vue",
"messages": [
{
"ruleId": "vue/require-valid-default-prop",
"severity": 2,
"message": "Type of the default value for 'suggested' prop must be a function.",
"line": 59,
"column": 22,
"nodeType": "ArrayExpression",
"messageId": "invalidType",
"endLine": 59,
"endColumn": 24
}
],
"suppressedMessages": [],
"errorCount": 1,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "<template>\n <ul :class=\"listClasses\" v-if=\"picked.length && displayPicked\">\n <li v-for=\"p in picked\" @click=\"removeEntity(p)\" :key=\"p.type + p.id\">\n <span class=\"chill_denomination\">{{ p.text }}</span>\n </li>\n </ul>\n <ul class=\"record_actions\">\n <li class=\"add-persons\">\n <add-persons\n :options=\"addPersonsOptions\"\n :key=\"uniqid\"\n :button-title=\"translatedListOfTypes\"\n :modal-title=\"translatedListOfTypes\"\n ref=\"addPersons\"\n @add-new-persons=\"addNewEntity\"\n />\n </li>\n </ul>\n <ul class=\"list-suggest add-items inline\">\n <li v-for=\"s in suggested\" :key=\"s.id\" @click=\"addNewSuggested(s)\">\n <span>{{ s.text }}</span>\n </li>\n </ul>\n</template>\n\n<script>\nimport AddPersons from \"ChillPersonAssets/vuejs/_components/AddPersons.vue\";\nimport { appMessages } from \"./i18n\";\n\nexport default {\n name: \"PickEntity\",\n props: {\n multiple: {\n type: Boolean,\n required: true,\n },\n types: {\n type: Array,\n required: true,\n },\n picked: {\n required: true,\n },\n uniqid: {\n type: String,\n required: true,\n },\n removableIfSet: {\n type: Boolean,\n default: true,\n },\n displayPicked: {\n // display picked entities.\n type: Boolean,\n default: true,\n },\n suggested: {\n type: Array,\n default: [],\n },\n label: {\n type: String,\n required: false,\n },\n },\n emits: [\"addNewEntity\", \"removeEntity\"],\n components: {\n AddPersons,\n },\n data() {\n return {\n key: \"\",\n };\n },\n computed: {\n addPersonsOptions() {\n return {\n uniq: !this.multiple,\n type: this.types,\n priority: null,\n button: {\n size: \"btn-sm\",\n class: \"btn-submit\",\n },\n };\n },\n translatedListOfTypes() {\n if (this.label !== \"\") {\n return this.label;\n }\n\n let trans = [];\n this.types.forEach((t) => {\n if (this.$props.multiple) {\n trans.push(appMessages.fr.pick_entity[t].toLowerCase());\n } else {\n trans.push(\n appMessages.fr.pick_entity[t + \"_one\"].toLowerCase(),\n );\n }\n });\n\n if (this.$props.multiple) {\n return (\n appMessages.fr.pick_entity.modal_title + trans.join(\", \")\n );\n } else {\n return (\n appMessages.fr.pick_entity.modal_title_one +\n trans.join(\", \")\n );\n }\n },\n listClasses() {\n return {\n \"list-suggest\": true,\n \"remove-items\": this.$props.removableIfSet,\n };\n },\n },\n methods: {\n addNewSuggested(entity) {\n this.$emit(\"addNewEntity\", { entity: entity });\n },\n addNewEntity({ selected, modal }) {\n selected.forEach((item) => {\n this.$emit(\"addNewEntity\", { entity: item.result });\n }, this);\n this.$refs.addPersons.resetSearch(); // to cast child method\n modal.showModal = false;\n },\n removeEntity(entity) {\n if (!this.$props.removableIfSet) {\n return;\n }\n this.$emit(\"removeEntity\", { entity: entity });\n },\n },\n};\n</script>\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/AddressDetails/Parts/AddressDetailsMap.vue",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'LatLngExpression' is defined but never used.",
"line": 24,
"column": 13,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 24,
"endColumn": 29
}
],
"suppressedMessages": [],
"errorCount": 1,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "<template>\n <div v-if=\"props.address.isNoAddress\" class=\"alert alert-info\">\n Cette adresse est incomplète. La position géographique est\n approximative.\n </div>\n <div\n v-if=\"props.address.point !== null\"\n class=\"address_details_map\"\n ref=\"map_div\"\n ></div>\n <p>\n Voir sur\n <a :href=\"makeUrlGoogleMap(props.address)\" target=\"_blank\"\n >Google Maps</a\n >\n <a :href=\"makeUrlOsm(props.address)\" target=\"_blank\">OSM</a>\n </p>\n</template>\n\n<script lang=\"ts\" setup>\nimport { onMounted, ref } from \"vue\";\nimport \"leaflet/dist/leaflet.css\";\nimport markerIconPng from \"leaflet/dist/images/marker-icon.png\";\nimport L, { LatLngExpression, LatLngTuple } from \"leaflet\";\nimport { Address, Point } from \"../../../../types\";\n\nconst lonLatForLeaflet = (point: Point): LatLngTuple => {\n return [point.coordinates[1], point.coordinates[0]];\n};\n\nexport interface MapProps {\n address: Address;\n}\n\nconst props = defineProps<MapProps>();\n\nconst map_div = ref<HTMLDivElement | null>(null);\nlet map: L.Map | null = null;\nlet marker: L.Marker | null = null;\n\nonMounted(() => {\n if (map_div.value === null) {\n // there is no map div when the address does not have any Point\n return;\n }\n\n if (props.address.point !== null) {\n map = L.map(map_div.value);\n map.setView(lonLatForLeaflet(props.address.point), 18);\n\n L.tileLayer(\"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png\", {\n attribution:\n '&copy; <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors',\n }).addTo(map);\n\n const markerIcon = L.icon({\n iconUrl: markerIconPng,\n iconAnchor: [12, 41],\n });\n\n marker = L.marker(lonLatForLeaflet(props.address.point), {\n icon: markerIcon,\n });\n marker.addTo(map);\n }\n});\n\nconst makeUrlGoogleMap = (address: Address): string => {\n const params = new URLSearchParams();\n params.append(\"api\", \"1\");\n if (address.point !== null && address.addressReference !== null) {\n params.append(\n \"query\",\n `${address.point.coordinates[1]} ${address.point.coordinates[0]}`,\n );\n } else {\n params.append(\"query\", address.lines.join(\", \"));\n }\n\n return `https://www.google.com/maps/search/?${params.toString()}`;\n};\n\nconst makeUrlOsm = (address: Address): string => {\n if (address.point !== null && address.addressReference !== null) {\n const params = new URLSearchParams();\n params.append(\"mlat\", `${address.point.coordinates[1]}`);\n params.append(\"mlon\", `${address.point.coordinates[0]}`);\n const hashParams = new URLSearchParams();\n hashParams.append(\n \"map\",\n `18/${address.point.coordinates[1]}/${address.point.coordinates[0]}`,\n );\n\n return `https://www.openstreetmap.org/?${params.toString()}#${hashParams.toString()}`;\n }\n\n const params = new URLSearchParams();\n params.append(\"query\", address.lines.join(\", \"));\n\n return `https://www.openstreetmap.org/search?${params.toString()}`;\n};\n</script>\n\n<style scoped>\ndiv.address_details_map {\n height: 250px;\n}\n</style>\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/GenderIconRenderBox.vue",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'props' is assigned a value but never used.",
"line": 6,
"column": 7,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 6,
"endColumn": 12
}
],
"suppressedMessages": [],
"errorCount": 1,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "<template>\n <i :class=\"gender.icon\" />\n</template>\n\n<script setup>\nconst props = defineProps({\n gender: Object,\n});\n</script>\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/EntityWorkflow/ListWorkflow.vue",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'popoverList' is assigned a value but never used.",
"line": 141,
"column": 15,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 141,
"endColumn": 26
}
],
"suppressedMessages": [],
"errorCount": 1,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "<template>\n <div class=\"flex-table workflow\" id=\"workflow-list\">\n <div\n v-for=\"(w, i) in workflows\"\n :key=\"`workflow-${i}`\"\n class=\"item-bloc\"\n >\n <div>\n <div class=\"item-row col\">\n <h2>{{ w.title }}</h2>\n <div class=\"flex-grow-1 ms-3 h3\">\n <div class=\"visually-hidden\">\n {{ w.relatedEntityClass }}\n {{ w.relatedEntityId }}\n </div>\n </div>\n </div>\n\n <div class=\"breadcrumb\">\n <template v-for=\"(step, j) in w.steps\" :key=\"`step-${j}`\">\n <span\n class=\"mx-2\"\n tabindex=\"0\"\n data-bs-trigger=\"focus hover\"\n data-bs-toggle=\"popover\"\n data-bs-placement=\"bottom\"\n data-bs-custom-class=\"workflow-transition\"\n :title=\"getPopTitle(step)\"\n :data-bs-content=\"getPopContent(step)\"\n >\n <i\n v-if=\"step.currentStep.name === 'initial'\"\n class=\"fa fa-circle me-1 text-chill-yellow\"\n />\n <i\n v-if=\"step.isFreezed\"\n class=\"fa fa-snowflake-o fa-sm me-1\"\n />\n {{ step.currentStep.text }}\n </span>\n <span v-if=\"j !== Object.keys(w.steps).length - 1\">\n →\n </span>\n </template>\n </div>\n </div>\n\n <div class=\"item-row\">\n <div class=\"item-col flex-grow-1\">\n <p v-if=\"isUserSubscribedToStep(w)\">\n <i class=\"fa fa-check fa-fw\" />\n {{ $t(\"you_subscribed_to_all_steps\") }}\n </p>\n <p v-if=\"isUserSubscribedToFinal(w)\">\n <i class=\"fa fa-check fa-fw\" />\n {{ $t(\"you_subscribed_to_final_step\") }}\n </p>\n </div>\n <div class=\"item-col\">\n <ul class=\"record_actions\">\n <li>\n <a\n :href=\"goToUrl(w)\"\n class=\"btn btn-sm btn-show\"\n :title=\"$t('action.show')\"\n />\n </li>\n </ul>\n </div>\n </div>\n </div>\n </div>\n</template>\n\n<script>\nimport Popover from \"bootstrap/js/src/popover\";\n\nconst i18n = {\n messages: {\n fr: {\n you_subscribed_to_all_steps:\n \"Vous recevrez une notification à chaque étape\",\n you_subscribed_to_final_step:\n \"Vous recevrez une notification à l'étape finale\",\n by: \"Par\",\n at: \"Le\",\n },\n },\n};\n\nexport default {\n name: \"ListWorkflow\",\n i18n: i18n,\n props: {\n workflows: {\n type: Array,\n required: true,\n },\n },\n methods: {\n goToUrl(w) {\n return `/fr/main/workflow/${w.id}/show`;\n },\n getPopTitle(step) {\n if (step.transitionPrevious != null) {\n //console.log(step.transitionPrevious.text);\n let freezed = step.isFreezed\n ? `<i class=\"fa fa-snowflake-o fa-sm me-1\"></i>`\n : ``;\n return `${freezed}${step.transitionPrevious.text}`;\n }\n },\n getPopContent(step) {\n if (step.transitionPrevious != null) {\n return `<ul class=\"small_in_title\">\n <li><span class=\"item-key\">${i18n.messages.fr.by} : </span><b>${step.transitionPreviousBy.text}</b></li>\n <li><span class=\"item-key\">${i18n.messages.fr.at} : </span><b>${this.formatDate(step.transitionPreviousAt.datetime)}</b></li>\n </ul>`;\n }\n },\n formatDate(datetime) {\n return (\n datetime.split(\"T\")[0] +\n \" \" +\n datetime.split(\"T\")[1].substring(0, 5)\n );\n },\n isUserSubscribedToStep() {\n // todo\n return false;\n },\n isUserSubscribedToFinal() {\n // todo\n return false;\n },\n },\n mounted() {\n const triggerList = [].slice.call(\n document.querySelectorAll('[data-bs-toggle=\"popover\"]'),\n );\n const popoverList = triggerList.map(function (el) {\n //console.log('popover', el)\n return new Popover(el, {\n html: true,\n });\n });\n },\n};\n</script>\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Modal.vue",
"messages": [
{
"ruleId": "vue/require-toggle-inside-transition",
"severity": 2,
"message": "The element inside `<transition>` is expected to have a `v-if` or `v-show` directive.",
"line": 3,
"column": 9,
"nodeType": "VStartTag",
"messageId": "expected",
"endLine": 3,
"endColumn": 33
},
{
"ruleId": "vue/require-valid-default-prop",
"severity": 2,
"message": "Type of the default value for 'modalDialogClass' prop must be a function.",
"line": 59,
"column": 22,
"nodeType": "ObjectExpression",
"messageId": "invalidType",
"endLine": 59,
"endColumn": 24
}
],
"suppressedMessages": [],
"errorCount": 2,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "<template>\n <transition name=\"modal\">\n <div class=\"modal-mask\">\n <!-- :: styles bootstrap :: -->\n <div\n class=\"modal fade show\"\n style=\"display: block\"\n aria-modal=\"true\"\n role=\"dialog\"\n >\n <div class=\"modal-dialog\" :class=\"modalDialogClass\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <slot name=\"header\" />\n <button class=\"close btn\" @click=\"$emit('close')\">\n <i class=\"fa fa-times\" aria-hidden=\"true\" />\n </button>\n </div>\n <div class=\"modal-body\">\n <div class=\"body-head\">\n <slot name=\"body-head\" />\n </div>\n <slot name=\"body\" />\n </div>\n <div class=\"modal-footer\" v-if=\"!hideFooter\">\n <button\n class=\"btn btn-cancel\"\n @click=\"$emit('close')\"\n >\n {{ $t(\"action.close\") }}\n </button>\n <slot name=\"footer\" />\n </div>\n </div>\n </div>\n </div>\n <!-- :: end styles bootstrap :: -->\n </div>\n </transition>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent } from \"vue\";\n/*\n * This Modal component is a mix between Vue3 modal implementation\n * [+] with 'v-if:showModal' directive:parameter, html scope is added/removed not just shown/hidden\n * [+] with slot we can pass content from parent component\n * [+] some classes are passed from parent component\n * and Bootstrap 5 _modal.scss module\n * [+] using bootstrap css classes, the modal have a responsive behaviour,\n * [+] modal design can be configured using css classes (size, scroll)\n */\nexport default defineComponent({\n name: \"Modal\",\n props: {\n modalDialogClass: {\n type: Object,\n required: false,\n default: {},\n },\n hideFooter: {\n type: Boolean,\n required: false,\n default: false,\n },\n },\n emits: [\"close\"],\n});\n</script>\n\n<style lang=\"scss\">\n/**\n * This is a mask behind the modal.\n */\n.modal-mask {\n position: fixed;\n z-index: 9998;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.75);\n transition: opacity 0.3s ease;\n}\n.modal-header .close {\n border-top-right-radius: 0.3rem;\n}\n/*\n * The following styles are auto-applied to elements with\n * transition=\"modal\" when their visibility is toggled\n * by Vue.js.\n *\n * You can easily play with the modal transition by editing\n * these styles.\n */\n.modal-enter {\n opacity: 0;\n}\n.modal-leave-active {\n opacity: 0;\n}\n.modal-enter .modal-container,\n.modal-leave-active .modal-container {\n -webkit-transform: scale(1.1);\n transform: scale(1.1);\n}\nh3.modal-title {\n font-size: 1.5rem;\n font-weight: bold;\n}\ndiv.modal-footer {\n button:first-child {\n margin-right: auto;\n }\n}\n</style>\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillPersonBundle/Resources/public/page/accompanying_course_index/masonry.js",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'msnry' is assigned a value but never used.",
"line": 4,
"column": 5,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 4,
"endColumn": 10
}
],
"suppressedMessages": [],
"errorCount": 1,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "import Masonry from \"masonry-layout/masonry\";\n\nlet elem = document.querySelector(\"#dashboards\");\nlet msnry = new Masonry(elem, {\n // options\n});\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillPersonBundle/Resources/public/page/person/suggest-names.js",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'tags' is assigned a value but never used.",
"line": 47,
"column": 9,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 47,
"endColumn": 13
}
],
"suppressedMessages": [],
"errorCount": 1,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "function capitalizeFirstLetter(string) {\n return string.charAt(0).toLocaleUpperCase() + string.slice(1);\n}\n\nwindow.addEventListener(\"DOMContentLoaded\", function () {\n const uri = decodeURI(location.hash.substring(1));\n let searchFragments = uri.split(\" \");\n searchFragments = searchFragments.filter((el) => {\n if (\n el.startsWith(\"firstname\") ||\n el.startsWith(\"lastname\") ||\n (el !== \"\" &&\n !el.startsWith(\"birthdate\") &&\n !el.startsWith(\"gender\") &&\n !el.startsWith(\"city\") &&\n !el.startsWith(\"phonenumber\") &&\n !el.startsWith(\"@\"))\n ) {\n return el;\n }\n });\n\n searchFragments = searchFragments.map((el) => {\n if (el.startsWith(\"firstname\")) {\n return el.slice(10);\n } else if (el.startsWith(\"lastname\")) {\n return el.slice(10);\n }\n return el.replace('\"', \"\");\n });\n\n if (searchFragments) {\n const pre = '<ul class=\"list-suggest add-items inline\">';\n const after = \"</ul>\";\n\n document\n .querySelectorAll(\"[data-suggest-container]\")\n .forEach(function (container) {\n const suggestions = searchFragments.map(\n (el) =>\n `<li class=\"suggest-item-name\"><span data-suggest-target=\"${container.dataset.suggestContainer}\">${capitalizeFirstLetter(el)}</span></li>`,\n );\n container.innerHTML = pre + suggestions.join(\" \") + after;\n });\n }\n\n const tags = document\n .querySelectorAll(\"[data-suggest-target]\")\n .forEach((tag) => {\n tag.addEventListener(\"click\", function (e) {\n const field = document.querySelector(\n `[name=\"${e.target.dataset.suggestTarget}\"]`,\n );\n let suggestion = e.target.textContent.trim();\n switch (field.dataset.suggestTransform) {\n case \"uppercase_all\":\n suggestion = suggestion.toLocaleUpperCase();\n break;\n case \"uppercase_first_letter\":\n default:\n suggestion = capitalizeFirstLetter(suggestion);\n }\n\n if (field.value === \"\") {\n field.value = suggestion;\n } else {\n field.value = `${field.value} ${suggestion}`;\n }\n e.target.style.display = \"none\";\n\n [...document.querySelectorAll(\"[data-suggest-target]\")]\n .filter((p) => p.textContent.includes(e.target.textContent))\n .forEach((p) => p.remove());\n });\n });\n});\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StickyNav.vue",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'event' is defined but never used.",
"line": 116,
"column": 18,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 116,
"endColumn": 23
}
],
"suppressedMessages": [],
"errorCount": 1,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "<template>\n <teleport to=\"#content\">\n <div id=\"navmap\">\n <nav>\n <a class=\"top\" href=\"#top\">\n <i class=\"fa fa-fw fa-square\" />\n <span>{{ $t(\"nav.top\") }}</span>\n </a>\n <item v-for=\"item of items\" :key=\"item.key\" :item=\"item\" :step=\"step\" />\n </nav>\n </div>\n </teleport>\n</template>\n\n<script>\nimport Item from \"./StickyNav/Item.vue\";\n\nexport default {\n name: \"StickyNav\",\n components: {\n Item,\n },\n data() {\n return {\n header: document.querySelector(\"header nav.navbar\"),\n bannerName: document.querySelector(\"#header-accompanying_course-name\"),\n bannerDetails: document.querySelector(\n \"#header-accompanying_course-details\",\n ),\n container: null,\n heightSum: null,\n stickyNav: null,\n limit: 25,\n anchors: null,\n items: [],\n };\n },\n computed: {\n accompanyingCourse() {\n return this.$store.state.accompanyingCourse;\n },\n step() {\n return this.accompanyingCourse.step;\n },\n top() {\n return parseInt(\n window\n .getComputedStyle(this.stickyNav)\n .getPropertyValue(\"top\")\n .slice(0, -2),\n );\n },\n },\n mounted() {\n this.ready();\n window.addEventListener(\"scroll\", this.handleScroll);\n },\n unmounted() {\n window.removeEventListener(\"scroll\", this.handleScroll);\n },\n methods: {\n ready() {\n // load datas DOM when mounted ready\n this.container = document.querySelector(\"#content\");\n this.stickyNav = document.querySelector(\"#navmap\");\n this.anchors = document.querySelectorAll(\"h2 a[id^='section']\");\n this.initItemsMap();\n\n // TODO resizeObserver not supports IE !\n // Listen when elements change size, then recalculate heightSum and initItemsMap\n const resizeObserver = new ResizeObserver(() => {\n this.refreshPos();\n });\n\n resizeObserver.observe(this.header);\n resizeObserver.observe(this.bannerName);\n resizeObserver.observe(this.bannerDetails);\n resizeObserver.observe(this.container);\n },\n initItemsMap() {\n this.anchors.forEach((anchor) => {\n this.items.push({\n pos: null,\n active: false,\n key: parseInt(anchor.id.slice(8).slice(0, -1)),\n id: \"#\" + anchor.id,\n });\n });\n },\n refreshPos() {\n //console.log('refreshPos');\n this.heightSum =\n this.header.offsetHeight +\n this.bannerName.offsetHeight +\n this.bannerDetails.offsetHeight;\n\n this.anchors.forEach((anchor, i) => {\n this.items[i].pos = this.findPos(anchor)[\"y\"];\n });\n },\n findPos(element) {\n let posX = 0,\n posY = 0;\n do {\n posX += element.offsetLeft;\n posY += element.offsetTop;\n element = element.offsetParent;\n } while (element != null);\n\n let pos = [];\n pos[\"x\"] = posX;\n pos[\"y\"] = posY;\n\n return pos;\n },\n handleScroll(event) {\n let pos = this.findPos(this.stickyNav);\n let top = this.heightSum + this.top - window.scrollY;\n //console.log(window.scrollY);\n\n if (top > this.limit) {\n this.stickyNav.style.position = \"absolute\";\n this.stickyNav.style.left = \"10px\";\n } else {\n this.stickyNav.style.position = \"fixed\";\n this.stickyNav.style.left = pos[\"x\"] + \"px\";\n }\n\n this.switchActive();\n },\n switchActive() {\n this.items.forEach((item, i) => {\n let next = this.items[i + 1] ? this.items[i + 1].pos : \"100000\";\n item.active =\n (window.scrollY >= item.pos) & (window.scrollY < next) ? true : false;\n }, this);\n\n // last item never switch active because scroll reach bottom of page\n if (document.body.scrollHeight == window.scrollY + window.innerHeight) {\n this.items[this.items.length - 1].active = true;\n this.items[this.items.length - 2].active = false;\n } else {\n this.items[this.items.length - 1].active = false;\n }\n },\n },\n};\n</script>\n\n<style lang=\"scss\">\ndiv#content {\n position: relative;\n\n div#navmap {\n position: absolute;\n top: 30px;\n left: 10px; //-10%;\n nav {\n font-size: small;\n a {\n display: block;\n box-sizing: border-box;\n margin-bottom: -3px;\n color: #71859669;\n text-decoration: none;\n &.top {\n color: #718596;\n }\n span {\n display: none;\n }\n &:hover,\n &.active {\n span {\n display: inline;\n padding-left: 8px;\n }\n }\n &:hover {\n color: #718596b5;\n }\n &.active {\n color: #e2793d; //orange\n //color: #eec84a; //jaune\n }\n }\n }\n }\n}\n@media only screen and (max-width: 768px) {\n div#navmap {\n display: none;\n }\n}\n</style>\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/index.js",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'app' is assigned a value but never used.",
"line": 19,
"column": 11,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 19,
"endColumn": 14
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'app' is assigned a value but never used.",
"line": 42,
"column": 11,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 42,
"endColumn": 14
}
],
"suppressedMessages": [],
"errorCount": 2,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "import { createApp } from \"vue\";\nimport { _createI18n } from \"ChillMainAssets/vuejs/_js/i18n\";\nimport { appMessages } from \"./js/i18n\";\nimport { initPromise } from \"./store\";\nimport \"vue-toast-notification/dist/theme-sugar.css\";\nimport App from \"./App.vue\";\nimport Banner from \"./components/Banner.vue\";\nimport ToastPlugin from \"vue-toast-notification\";\n\nconst root = window.vueRootComponent;\n\n/*\n * Load all App component, for AccompanyingCourse edition page\n */\nif (root === \"app\") {\n initPromise(root).then((store) => {\n const i18n = _createI18n(appMessages);\n\n const app = createApp({\n template: `<app></app>`,\n })\n .use(store)\n .use(i18n)\n .use(ToastPlugin, {\n position: \"bottom-right\",\n type: \"error\",\n duration: 5000,\n dismissible: true,\n })\n .component(\"app\", App)\n .mount(\"#accompanying-course\");\n });\n}\n\n/*\n * Load only Banner sub-component, for all others AccompanyingCourse page\n */\nif (root === \"banner\") {\n initPromise(root).then((store) => {\n const i18n = _createI18n(appMessages);\n\n const app = createApp({\n template: `<banner></banner>`,\n })\n .use(store)\n .use(i18n)\n .use(ToastPlugin, {\n position: \"bottom-right\",\n type: \"error\",\n duration: 5000,\n dismissible: true,\n })\n .component(\"banner\", Banner)\n .mount(\"#banner-accompanying-course\");\n });\n}\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkCreate/index.js",
"messages": [
{
"ruleId": "no-unused-vars",
"severity": 2,
"message": "'app' is assigned a value but never used.",
"line": 12,
"column": 7,
"nodeType": "Identifier",
"messageId": "unusedVar",
"endLine": 12,
"endColumn": 10
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'app' is assigned a value but never used.",
"line": 12,
"column": 7,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 12,
"endColumn": 10
}
],
"suppressedMessages": [],
"errorCount": 2,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "import { createApp } from \"vue\";\nimport { _createI18n } from \"ChillMainAssets/vuejs/_js/i18n\";\nimport { store } from \"./store\";\nimport { personMessages } from \"ChillPersonAssets/vuejs/_js/i18n\";\nimport App from \"./App.vue\";\nimport ToastPlugin from \"vue-toast-notification\";\n\nconst i18n = _createI18n(personMessages);\n\n/*eslint no-unused-vars: \"error\"*/\n/* exported app */\nconst app = createApp({\n template: `<app></app>`,\n})\n .use(store)\n .use(i18n)\n .use(ToastPlugin, {\n position: \"bottom-right\",\n type: \"error\",\n duration: 10000,\n dismissible: true,\n })\n .component(\"app\", App)\n .mount(\"#accompanying_course_work_create\");\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'event' is defined but never used.",
"line": 568,
"column": 7,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 568,
"endColumn": 12
},
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'link' is defined but never used.",
"line": 569,
"column": 7,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 569,
"endColumn": 11
}
],
"suppressedMessages": [],
"errorCount": 2,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "<template>\n <div>\n <!--h2>\n {{ $t('evaluation_title') }}\n </h2-->\n\n <div class=\"m-md-3\">\n <!--div class=\"row mb-3\">\n <label class=\"col-sm-4 col-form-label\">{{ $t('evaluation_status') }}</label>\n <div class=\"col-sm-8\">\n <select class=\"form-select form-select-sm\" v-model=\"status\">\n <option disabled value=\"\">{{ $t('evaluation_choose_a_status') }}</option>\n <option v-for=\"s in listAllStatus\" :value=\"s.id\">\n {{ s.id }}\n </option>\n </select>\n </div>\n </div-->\n\n <div class=\"row mb-3\">\n <label class=\"col-4 col-sm-2 col-md-4 col-lg-2 col-form-label\">\n {{ $t(\"evaluation_startdate\") }}\n </label>\n <div class=\"col-8 col-sm-4 col-md-8 col-lg-4\">\n <input\n class=\"form-control form-control-sm\"\n type=\"date\"\n v-model=\"startDate\"\n />\n </div>\n\n <label class=\"col-4 col-sm-2 col-md-4 col-lg-2 col-form-label\">\n {{ $t(\"evaluation_enddate\") }}\n </label>\n <div class=\"col-8 col-sm-4 col-md-8 col-lg-4\">\n <input\n class=\"form-control form-control-sm\"\n type=\"date\"\n v-model=\"endDate\"\n />\n </div>\n </div>\n\n <div class=\"row mb-3\">\n <label class=\"col-4 col-sm-2 col-md-4 col-lg-2 col-form-label\">\n {{ $t(\"evaluation_maxdate\") }}\n </label>\n <div class=\"col-8 col-sm-4 col-md-8 col-lg-4\">\n <input\n class=\"form-control form-control-sm\"\n type=\"date\"\n v-model=\"maxDate\"\n />\n </div>\n\n <label class=\"col-4 col-sm-2 col-md-4 col-lg-2 col-form-label\">\n {{ $t(\"evaluation_warning_interval\") }}\n </label>\n <div class=\"col-8 col-sm-4 col-md-8 col-lg-4\">\n <input\n class=\"form-control form-control-sm\"\n type=\"number\"\n v-model.number=\"warningInterval\"\n />\n </div>\n </div>\n\n <div class=\"row mb-3\">\n <label class=\"col-4 col-sm-2 col-md-4 col-lg-2 col-form-label\">\n {{ $t(\"evaluation_time_spent\") }}\n </label>\n <div class=\"col-8 col-sm-4 col-md-8 col-lg-4\">\n <select\n class=\"form-control form-control-sm\"\n type=\"time\"\n v-model=\"timeSpent\"\n >\n <option disabled value=\"\">\n {{ $t(\"select_time_spent\") }}\n </option>\n <option\n v-for=\"(time, index) in timeSpentChoices\"\n :key=\"index\"\n :value=\"time.value\"\n >\n {{ time.text }}\n </option>\n </select>\n </div>\n </div>\n\n <div class=\"row mb-3\">\n <label class=\"col-sm-4 col-form-label visually-hidden\">{{\n $t(\"evaluation_public_comment\")\n }}</label>\n <div class=\"col-sm-12\">\n <ckeditor\n :editor=\"editor\"\n :placeholder=\"$t('evaluation_comment_placeholder')\"\n v-model=\"comment\"\n tag-name=\"textarea\"\n />\n </div>\n </div>\n\n <div v-if=\"evaluation.documents.length > 0\" class=\"row mb-3\">\n <h5>{{ $t(\"Documents\") }} :</h5>\n\n <div class=\"flex-table\">\n <div\n class=\"item-bloc\"\n v-for=\"(d, i) in evaluation.documents\"\n :key=\"d.id\"\n :class=\"[\n parseInt(this.docAnchorId) === d.id ? 'bg-blink' : 'nothing',\n ]\"\n >\n <div :id=\"`document_${d.id}`\" class=\"item-row\">\n <div class=\"input-group input-group-lg mb-3 row\">\n <label class=\"col-sm-3 col-form-label\"\n >Titre du document:</label\n >\n <div class=\"col-sm-9\">\n <input\n class=\"form-control document-title\"\n type=\"text\"\n :value=\"d.title\"\n :id=\"d.id\"\n :data-key=\"i\"\n @input=\"onInputDocumentTitle\"\n />\n </div>\n </div>\n </div>\n <div class=\"item-row\">\n <div class=\"item-col item-meta\">\n <p v-if=\"d.createdBy\" class=\"createdBy\">\n Créé par {{ d.createdBy.text }}<br />\n Le {{ $d(ISOToDatetime(d.createdAt.datetime), \"long\") }}\n </p>\n </div>\n </div>\n <div class=\"item-row\">\n <div class=\"item-col\">\n <ul class=\"record_actions\">\n <li v-if=\"d.workflows_availables.length > 0\">\n <list-workflow-modal\n :workflows=\"d.workflows\"\n :allow-create=\"true\"\n related-entity-class=\"Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWorkEvaluationDocument\"\n :related-entity-id=\"d.id\"\n :workflows-availables=\"d.workflows_availables\"\n :prevent-default-move-to-generate=\"true\"\n :go-to-generate-workflow-payload=\"{ doc: d }\"\n @go-to-generate-workflow=\"\n goToGenerateWorkflowEvaluationDocument\n \"\n />\n </li>\n <li>\n <button\n v-if=\"AmIRefferer\"\n class=\"btn btn-notify\"\n @click=\"goToGenerateDocumentNotification(d, false)\"\n />\n <template v-else>\n <button\n id=\"btnGroupNotifyButtons\"\n type=\"button\"\n class=\"btn btn-notify dropdown-toggle\"\n :title=\"$t('notification_send')\"\n data-bs-toggle=\"dropdown\"\n aria-expanded=\"false\"\n >\n &nbsp;\n </button>\n <ul\n class=\"dropdown-menu\"\n aria-labelledby=\"btnGroupNotifyButtons\"\n >\n <li>\n <a\n class=\"dropdown-item\"\n @click=\"goToGenerateDocumentNotification(d, true)\"\n >{{ $t(\"notification_notify_referrer\") }}</a\n >\n </li>\n <li>\n <a\n class=\"dropdown-item\"\n @click=\"goToGenerateDocumentNotification(d, false)\"\n >{{ $t(\"notification_notify_any\") }}</a\n >\n </li>\n </ul>\n </template>\n </li>\n <li>\n <document-action-buttons-group\n :stored-object=\"d.storedObject\"\n :filename=\"d.title\"\n :can-edit=\"true\"\n :execute-before-leave=\"submitBeforeLeaveToEditor\"\n :dav-link=\"d.storedObject._links?.dav_link.href\"\n :dav-link-expiration=\"\n d.storedObject._links?.dav_link.expiration\n \"\n @on-stored-object-status-change=\"onStatusDocumentChanged\"\n />\n </li>\n <li>\n <add-async-upload\n :button-title=\"$t('replace')\"\n :options=\"asyncUploadOptions\"\n :btn-classes=\"{ btn: true, 'btn-edit': true }\"\n @add-document=\"(arg) => replaceDocument(d, arg)\"\n />\n </li>\n <li v-if=\"d.workflows.length === 0\">\n <a class=\"btn btn-delete\" @click=\"removeDocument(d)\" />\n </li>\n </ul>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"row mb-3\">\n <h6>{{ $t(\"document_add\") }} :</h6>\n <pick-template\n entity-class=\"Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWorkEvaluation\"\n :id=\"evaluation.id\"\n :templates=\"getTemplatesAvailables\"\n :prevent-default-move-to-generate=\"true\"\n @go-to-generate-document=\"submitBeforeGenerate\"\n >\n <template #title>\n <label class=\"col-form-label\">{{\n $t(\"evaluation_generate_a_document\")\n }}</label>\n </template>\n </pick-template>\n <div>\n <label class=\"col-form-label\">{{ $t(\"document_upload\") }}</label>\n <ul class=\"record_actions document-upload\">\n <li>\n <add-async-upload\n :button-title=\"$t('browse')\"\n :options=\"asyncUploadOptions\"\n @add-document=\"addDocument\"\n />\n </li>\n </ul>\n </div>\n </div>\n </div>\n </div>\n</template>\n\n<script>\nimport { ISOToDatetime } from \"ChillMainAssets/chill/js/date\";\nimport CKEditor from \"@ckeditor/ckeditor5-vue\";\nimport ClassicEditor from \"ChillMainAssets/module/ckeditor5/editor_config\";\nimport { mapState } from \"vuex\";\nimport PickTemplate from \"ChillDocGeneratorAssets/vuejs/_components/PickTemplate.vue\";\nimport { buildLink } from \"ChillDocGeneratorAssets/lib/document-generator\";\nimport AddAsyncUpload from \"ChillDocStoreAssets/vuejs/_components/AddAsyncUpload.vue\";\nimport ListWorkflowModal from \"ChillMainAssets/vuejs/_components/EntityWorkflow/ListWorkflowModal.vue\";\nimport { buildLinkCreate } from \"ChillMainAssets/lib/entity-workflow/api.js\";\nimport { buildLinkCreate as buildLinkCreateNotification } from \"ChillMainAssets/lib/entity-notification/api\";\nimport DocumentActionButtonsGroup from \"ChillDocStoreAssets/vuejs/DocumentActionButtonsGroup.vue\";\n\nconst i18n = {\n messages: {\n fr: {\n evaluation_title: \"Ecrire une évaluation\",\n evaluation_status: \"Statut\",\n evaluation_choose_a_status: \"Choisir un statut\",\n evaluation_startdate: \"Date d'ouverture\",\n evaluation_enddate: \"Date de fin\",\n evaluation_maxdate: \"Date d'échéance\",\n evaluation_warning_interval: \"Rappel (jours)\",\n evaluation_public_comment: \"Note publique\",\n evaluation_comment_placeholder: \"Commencez à écrire ...\",\n evaluation_generate_a_document: \"Générer un document\",\n evaluation_choose_a_template: \"Choisir un modèle\",\n evaluation_add_a_document: \"Ajouter un document\",\n evaluation_add: \"Ajouter une évaluation\",\n evaluation_time_spent: \"Temps de rédaction\",\n select_time_spent: \"Indiquez le temps de rédaction\",\n Documents: \"Documents\",\n document_add: \"Générer ou téléverser un document\",\n document_upload: \"Téléverser un document\",\n document_title: \"Titre du document\",\n template_title: \"Nom du template\",\n browse: \"Ajouter un document\",\n replace: \"Remplacer\",\n download: \"Télécharger le fichier existant\",\n notification_notify_referrer: \"Notifier le référent\",\n notification_notify_any: \"Notifier d'autres utilisateurs\",\n notification_send: \"Envoyer une notification\",\n },\n },\n};\n\nexport default {\n name: \"FormEvaluation\",\n props: [\"evaluation\", \"docAnchorId\"],\n components: {\n ckeditor: CKEditor.component,\n PickTemplate,\n AddAsyncUpload,\n ListWorkflowModal,\n DocumentActionButtonsGroup,\n },\n i18n,\n data() {\n return {\n editor: ClassicEditor,\n template: null,\n asyncUploadOptions: {\n maxFiles: 1,\n maxPostSize: 15000000,\n required: false,\n },\n timeSpentChoices: [\n { text: \"1 minute\", value: 60 },\n { text: \"2 minutes\", value: 120 },\n { text: \"3 minutes\", value: 180 },\n { text: \"4 minutes\", value: 240 },\n { text: \"5 minutes\", value: 300 },\n { text: \"10 minutes\", value: 600 },\n { text: \"15 minutes\", value: 900 },\n { text: \"20 minutes\", value: 1200 },\n { text: \"25 minutes\", value: 1500 },\n { text: \"30 minutes\", value: 1800 },\n { text: \"45 minutes\", value: 2700 },\n { text: \"1 hour\", value: 3600 },\n { text: \"1 hour 15 minutes\", value: 4500 },\n { text: \"1 hour 30 minutes\", value: 5400 },\n { text: \"1 hour 45 minutes\", value: 6300 },\n { text: \"2 hours\", value: 7200 },\n { text: \"2 hours 30 minutes\", value: 9000 },\n { text: \"3 hours\", value: 10800 },\n { text: \"3 hours 30 minutes\", value: 12600 },\n { text: \"4 hours\", value: 14400 },\n { text: \"4 hours 30 minutes\", value: 16200 },\n { text: \"5 hours\", value: 18000 },\n { text: \"5 hours 30 minutes\", value: 19800 },\n { text: \"6 hours\", value: 21600 },\n { text: \"6 hours 30 minutes\", value: 23400 },\n { text: \"7 hours\", value: 25200 },\n { text: \"7 hours 30 minutes\", value: 27000 },\n { text: \"8 hours\", value: 28800 },\n ],\n };\n },\n computed: {\n ...mapState([\"isPosting\", \"work\", \"me\"]),\n AmIRefferer() {\n return !(\n this.$store.state.work.accompanyingPeriod.user &&\n this.$store.state.me &&\n this.$store.state.work.accompanyingPeriod.user.id !==\n this.$store.state.me.id\n );\n },\n getTemplatesAvailables() {\n return this.$store.getters.getTemplatesAvailablesForEvaluation(\n this.evaluation.evaluation,\n );\n },\n canGenerate() {\n return !this.$store.state.isPosting && this.template !== null;\n },\n startDate: {\n get() {\n console.log(\"evaluation\", this.evaluation);\n return this.evaluation.startDate;\n },\n set(v) {\n this.$store.commit(\"setEvaluationStartDate\", {\n key: this.evaluation.key,\n date: v,\n });\n },\n },\n endDate: {\n get() {\n return this.evaluation.endDate;\n },\n set(v) {\n this.$store.commit(\"setEvaluationEndDate\", {\n key: this.evaluation.key,\n date: v,\n });\n },\n },\n maxDate: {\n get() {\n return this.evaluation.maxDate;\n },\n set(v) {\n this.$store.commit(\"setEvaluationMaxDate\", {\n key: this.evaluation.key,\n date: v,\n });\n },\n },\n warningInterval: {\n get() {\n return this.evaluation.warningInterval;\n },\n set(v) {\n this.$store.commit(\"setEvaluationWarningInterval\", {\n key: this.evaluation.key,\n days: v,\n });\n },\n },\n timeSpent: {\n get() {\n return this.evaluation.timeSpent;\n },\n set(v) {\n this.$store.commit(\"setEvaluationTimeSpent\", {\n key: this.evaluation.key,\n time: v,\n });\n },\n },\n comment: {\n get() {\n return this.evaluation.comment;\n },\n set(v) {\n this.$store.commit(\"setEvaluationComment\", {\n key: this.evaluation.key,\n comment: v,\n });\n },\n },\n },\n methods: {\n ISOToDatetime,\n listAllStatus() {\n console.log(\"load all status\");\n let url = `/api/`;\n fetch(url).then((response) => {\n if (response.ok) {\n return response.json();\n }\n throw { m: \"yeeah\", s: response.status, b: response.body };\n });\n },\n buildEditLink(document) {\n return (\n `/chill/wopi/edit/${document.storedObject.uuid}?returnPath=` +\n encodeURIComponent(\n window.location.pathname +\n window.location.search +\n window.location.hash,\n )\n );\n },\n submitBeforeLeaveToEditor() {\n console.log(\"submit beore edit 2\");\n // empty callback\n const callback = () => null;\n return this.$store.dispatch(\"submit\", callback).catch((e) => {\n console.log(e);\n throw e;\n });\n },\n submitBeforeEdit(storedObject) {\n const callback = (data) => {\n let evaluation = data.accompanyingPeriodWorkEvaluations.find(\n (e) => e.key === this.evaluation.key,\n );\n let document = evaluation.documents.find(\n (d) => d.storedObject.id === storedObject.id,\n );\n //console.log('=> document', document);\n window.location.assign(this.buildEditLink(document));\n };\n return this.$store.dispatch(\"submit\", callback).catch((e) => {\n console.log(e);\n throw e;\n });\n },\n submitBeforeGenerate({ template }) {\n const callback = (data) => {\n let evaluationId = data.accompanyingPeriodWorkEvaluations.find(\n (e) => e.key === this.evaluation.key,\n ).id;\n\n window.location.assign(\n buildLink(\n template,\n evaluationId,\n \"Chill\\\\PersonBundle\\\\Entity\\\\AccompanyingPeriod\\\\AccompanyingPeriodWorkEvaluation\",\n ),\n );\n };\n\n return this.$store.dispatch(\"submit\", callback).catch((e) => {\n console.log(e);\n throw e;\n });\n },\n onInputDocumentTitle(event) {\n const id = Number(event.target.id);\n const key = Number(event.target.dataset.key) + 1;\n const title = event.target.value;\n this.$store.commit(\"updateDocumentTitle\", {\n id: id,\n key: key,\n evaluationKey: this.evaluation.key,\n title: title,\n });\n },\n addDocument(storedObject) {\n let document = {\n type: \"accompanying_period_work_evaluation_document\",\n storedObject: storedObject,\n title: \"Nouveau document\",\n };\n this.$store.commit(\"addDocument\", {\n key: this.evaluation.key,\n document: document,\n });\n },\n replaceDocument(oldDocument, storedObject) {\n let document = {\n type: \"accompanying_period_work_evaluation_document\",\n storedObject: storedObject,\n title: oldDocument.title,\n };\n this.$store.commit(\"replaceDocument\", {\n key: this.evaluation.key,\n document: document,\n oldDocument: oldDocument,\n });\n },\n removeDocument(document) {\n if (\n window.confirm(\n 'Êtes-vous sûr·e de vouloir supprimer le document qui a pour titre \"' +\n document.title +\n '\" ?',\n )\n ) {\n this.$store.commit(\"removeDocument\", {\n key: this.evaluation.key,\n document: document,\n });\n }\n },\n onStatusDocumentChanged(newStatus) {\n console.log(\"onStatusDocumentChanged\", newStatus);\n this.$store.commit(\"statusDocumentChanged\", {\n key: this.evaluation.key,\n newStatus: newStatus,\n });\n },\n goToGenerateWorkflowEvaluationDocument({\n event,\n link,\n workflowName,\n payload,\n }) {\n const callback = (data) => {\n let evaluation = data.accompanyingPeriodWorkEvaluations.find(\n (e) => e.key === this.evaluation.key,\n );\n let updatedDocument = evaluation.documents.find(\n (d) => d.key === payload.doc.key,\n );\n window.location.assign(\n buildLinkCreate(\n workflowName,\n \"Chill\\\\PersonBundle\\\\Entity\\\\AccompanyingPeriod\\\\AccompanyingPeriodWorkEvaluationDocument\",\n updatedDocument.id,\n ),\n );\n };\n\n return this.$store.dispatch(\"submit\", callback).catch((e) => {\n console.log(e);\n throw e;\n });\n },\n goToGenerateDocumentNotification(document, tos) {\n const callback = (data) => {\n let evaluation = data.accompanyingPeriodWorkEvaluations.find(\n (e) => e.key === this.evaluation.key,\n );\n let updatedDocument = evaluation.documents.find(\n (d) => d.key === document.key,\n );\n window.location.assign(\n buildLinkCreateNotification(\n \"Chill\\\\PersonBundle\\\\Entity\\\\AccompanyingPeriod\\\\AccompanyingPeriodWorkEvaluationDocument\",\n updatedDocument.id,\n tos === true\n ? this.$store.state.work.accompanyingPeriod.user.id\n : null,\n window.location.pathname +\n window.location.search +\n window.location.hash,\n ),\n );\n };\n return this.$store.dispatch(\"submit\", callback).catch((e) => {\n console.log(e);\n throw e;\n });\n },\n },\n};\n</script>\n\n<style lang=\"scss\" scoped>\ninput.document-title {\n font-weight: bold;\n font-size: 1rem;\n}\nul.document-upload {\n justify-content: flex-start;\n}\n\n.bg-blink {\n color: #050000;\n padding: 10px;\n display: inline-block;\n border-radius: 5px;\n animation: blinkingBackground 2.2s infinite;\n animation-iteration-count: 2;\n}\n\n@keyframes blinkingBackground {\n 0% {\n background-color: #ed776d;\n }\n 50% {\n background-color: #ffffff;\n }\n 100% {\n background-color: #ed776d;\n }\n}\n</style>\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/index.js",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'app' is assigned a value but never used.",
"line": 12,
"column": 7,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 12,
"endColumn": 10
}
],
"suppressedMessages": [],
"errorCount": 1,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "import { createApp } from \"vue\";\nimport { _createI18n } from \"ChillMainAssets/vuejs/_js/i18n\";\nimport { store } from \"./store\";\nimport { personMessages } from \"ChillPersonAssets/vuejs/_js/i18n\";\nimport \"vue-toast-notification/dist/theme-sugar.css\";\nimport App from \"./App.vue\";\nimport ToastPlugin from \"vue-toast-notification\";\n\nconst i18n = _createI18n(personMessages);\n\n/* exported app */\nconst app = createApp({\n template: `<app></app>`,\n})\n .use(store)\n .use(ToastPlugin, {\n position: \"bottom-right\",\n type: \"error\",\n duration: 10000,\n dismissible: true,\n })\n .use(i18n)\n .component(\"app\", App)\n .mount(\"#accompanying_course_work_edit\");\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillPersonBundle/Resources/public/vuejs/ExportFormActionGoalResult/App.vue",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-expressions",
"severity": 2,
"message": "Expected an assignment or function call and instead saw an expression.",
"line": 282,
"column": 7,
"nodeType": "ExpressionStatement",
"messageId": "unusedExpression",
"endLine": 286,
"endColumn": 15
}
],
"suppressedMessages": [],
"errorCount": 1,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "<template>\n <fieldset class=\"mb-3\" id=\"actionType\">\n <div class=\"row\">\n <legend class=\"col-sm-4 col-form-label\">\n {{ $t(\"action.label\") }}\n </legend>\n <div class=\"col-sm-8\">\n <VueMultiselect\n v-model=\"action\"\n :options=\"actions.options\"\n @select=\"selectAction\"\n @remove=\"unselectAction\"\n :multiple=\"true\"\n :close-on-select=\"false\"\n :placeholder=\"$t('action.placeholder')\"\n :custom-label=\"formatSocialAction\"\n track-by=\"id\"\n :searchable=\"true\"\n />\n </div>\n </div>\n </fieldset>\n\n <fieldset class=\"mb-3\" id=\"goal\">\n <div class=\"row\">\n <legend class=\"col-sm-4 col-form-label\">\n {{ $t(\"goal.label\") }}\n </legend>\n <div class=\"col-sm-8\">\n <VueMultiselect\n v-model=\"goal\"\n :options=\"goals.options\"\n @select=\"selectGoal\"\n @remove=\"unselectGoal\"\n :multiple=\"true\"\n :close-on-select=\"false\"\n :placeholder=\"$t('goal.placeholder')\"\n label=\"title\"\n :custom-label=\"transTitle\"\n track-by=\"id\"\n :searchable=\"true\"\n />\n </div>\n </div>\n </fieldset>\n\n <fieldset class=\"mb-3\" id=\"result\">\n <div class=\"row\">\n <legend class=\"col-sm-4 col-form-label\">\n {{ $t(\"result.label\") }}\n </legend>\n <div class=\"col-sm-8\">\n <VueMultiselect\n v-model=\"result\"\n :options=\"results.options\"\n @select=\"selectResult\"\n @remove=\"unselectResult\"\n :multiple=\"true\"\n :close-on-select=\"false\"\n :placeholder=\"$t('result.placeholder')\"\n label=\"title\"\n :custom-label=\"transTitle\"\n track-by=\"id\"\n :searchable=\"true\"\n />\n </div>\n </div>\n </fieldset>\n</template>\n\n<script>\nimport VueMultiselect from \"vue-multiselect\";\nimport {\n getSocialActions,\n getGoalByAction,\n getResultByAction,\n getResultByGoal,\n} from \"./api\";\n\nexport default {\n name: \"App\",\n components: {\n VueMultiselect,\n },\n i18n: {\n messages: {\n fr: {\n action: {\n label: \"Types d'actions\",\n placeholder: \"Choisissez une ou plusieurs actions\",\n },\n goal: {\n label: \"Objectifs\",\n placeholder: \"Choisissez un ou plusieurs objectifs\",\n },\n result: {\n label: \"Résultats\",\n placeholder: \"Choisissez un ou plusieurs résultats\",\n },\n },\n },\n },\n data() {\n return {\n actions: {\n options: [], // array with multiselect options\n value: [], // array with selected values\n hiddenField: document.getElementById(\n \"export_filters_social_work_type_filter_form_actionType\",\n ),\n },\n goals: {\n options: [],\n value: [],\n hiddenField: document.getElementById(\n \"export_filters_social_work_type_filter_form_goal\",\n ),\n },\n results: {\n options: [],\n value: [],\n hiddenField: document.getElementById(\n \"export_filters_social_work_type_filter_form_result\",\n ),\n },\n };\n },\n computed: {\n action: {\n get() {\n return this.actions.value;\n },\n set(value) {\n this.actions.value = value;\n this.rebuildHiddenFieldValues(\"actions\");\n },\n },\n goal: {\n get() {\n return this.goals.value;\n },\n set(value) {\n this.goals.value = value;\n this.rebuildHiddenFieldValues(\"goals\");\n },\n },\n result: {\n get() {\n return this.results.value;\n },\n set(value) {\n this.results.value = value;\n this.rebuildHiddenFieldValues(\"results\");\n },\n },\n },\n async mounted() {\n await this.getSocialActionsList();\n\n if (\"\" !== this.actions.hiddenField.value) {\n const actionIds = this.actions.hiddenField.value.split(\",\");\n for (const aid of actionIds) {\n let action = this.actions.options.find(\n (a) => Number.parseInt(aid) === a.id,\n );\n if (undefined !== action) {\n this.action.push(action);\n await this.selectAction(action);\n }\n }\n }\n\n if (\"\" !== this.goals.hiddenField.value) {\n const goalsIds = this.goals.hiddenField.value\n .split(\",\")\n .map((s) => Number.parseInt(s));\n for (const gid of goalsIds) {\n let goal = this.goals.options.find((g) => gid === g.id);\n if (undefined !== goal) {\n this.goal.push(goal);\n await this.selectGoal(goal);\n }\n }\n }\n\n if (\"\" !== this.results.hiddenField.value) {\n const resultsIds = this.results.hiddenField.value\n .split(\",\")\n .map((s) => Number.parseInt(s));\n for (const rid of resultsIds) {\n let result = this.results.options.find((r) => rid === r.id);\n if (undefined !== result) {\n this.result.push(result);\n }\n }\n }\n },\n methods: {\n async getSocialActionsList() {\n let actions = await getSocialActions();\n this.actions.options = actions.toSorted(function (a, b) {\n if (a.issue.ordering === b.issue.ordering) {\n if (a.ordering === b.ordering) {\n return 0;\n }\n if (a.ordering < b.ordering) {\n return -1;\n }\n return 1;\n }\n\n if (a.issue.ordering < b.issue.ordering) {\n return -1;\n }\n\n return 1;\n });\n\n return Promise.resolve();\n },\n\n formatSocialAction({ text, issue }) {\n return text + \" (\" + issue.text + \")\";\n },\n\n /**\n * Select/unselect in Action Multiselect\n * @param value\n */\n async selectAction(value) {\n //console.log('----'); console.log('select action', value.id);\n let children = this.getChildrensFromParent(value);\n this.addSelectedElement(\"actions\", children);\n\n let parentAndChildren = [...[value], ...children];\n const promises = [];\n parentAndChildren.forEach((elem) => {\n promises.push(\n getGoalByAction(elem.id).then((goals) => {\n this.addElementInData(\"goals\", goals);\n return Promise.resolve();\n }),\n );\n promises.push(\n getResultByAction(elem.id).then((results) => {\n this.addElementInData(\"results\", results);\n return Promise.resolve();\n }),\n );\n });\n\n await Promise.all(promises);\n return Promise.resolve();\n },\n\n unselectAction(value) {\n getGoalByAction(value.id).then((goals) => {\n [this.results.options, this.results.value] = this.removeElementInData(\n \"goals\",\n goals,\n );\n });\n getResultByAction(value.id).then((results) => {\n [this.results.options, this.results.value] = this.removeElementInData(\n \"results\",\n results,\n );\n });\n },\n\n /**\n * Select/unselect in Goal Multiselect\n * @param value\n */\n async selectGoal(value) {\n return getResultByGoal(value.id).then((results) => {\n this.addElementInData(\"results\", results);\n });\n },\n\n unselectGoal(value) {\n getResultByGoal(value.id).then(\n (results) =>\n ([this.results.options, this.results.value] =\n this.removeElementInData(\"results\", results)),\n ).catch;\n },\n\n // selectResult(value) {\n //console.log('----'); console.log('select result', value.id);\n // },\n\n // unselectResult(value) {\n //console.log('----'); console.log('unselect result', value.id);\n // },\n\n /**\n * Choose parent action will involve retaining the \"children\" actions.\n * @param value\n * @return array\n */\n getChildrensFromParent(value) {\n if (null === value.parent) {\n let excludeParent = this.actions.options.filter(\n (o) => o.parent !== null,\n );\n let children = excludeParent.filter((o) => o.parent.id === value.id);\n //console.log(\"get childrens\", children.map(e => e.id));\n return children;\n }\n return [];\n },\n\n /**\n * Add response elements in data target\n * @param target string -> 'actions', 'goals' or 'results'\n * @param response array of objects with fetch results\n */\n addElementInData(target, response) {\n let data = this[target];\n let dump = [];\n response.forEach((elem) => {\n let found = data.options.some((e) => e.id === elem.id);\n if (!found) {\n data.options.push(elem);\n dump.push(elem.id);\n }\n });\n if (dump.length > 0) {\n //console.log('push ' + dump.length + ' elems in', target, dump);\n }\n data.options.sort();\n },\n\n /**\n * Remove response elements from data target\n * @param target string -> 'actions', 'goals' or 'results'\n * @param response array of objects with fetch results\n * @returns data.<target>.options\n */\n removeElementInData(target, response) {\n let data = this[target];\n let dump = [];\n response.forEach((elem) => {\n let found = data.options.some((e) => e.id === elem.id);\n if (found) {\n data.options = data.options.filter((e) => e.id !== elem.id);\n dump.push(elem.id);\n\n this.removeSelectedElement(target, elem);\n }\n });\n if (dump.length > 0) {\n //console.log('remove ' + dump.length + ' elems from ' + target + ' options', dump);\n }\n return [data.options, data.value];\n },\n\n /**\n *\n * @param target\n * @param elements\n */\n addSelectedElement(target, elements) {\n let data = this[target];\n let dump = [];\n elements.forEach((elem) => {\n let selected = data.value.some((e) => e.id === elem.id);\n if (!selected) {\n data.value.push(elem);\n dump.push(elem.id);\n\n // add in hiddenField\n this.rebuildHiddenFieldValues(target);\n }\n });\n if (dump.length > 0) {\n //console.log('add ' + dump.length + ' selected elems in', target, dump);\n }\n },\n\n /**\n * Remove element from selected and from hiddenField\n * @param target\n * @param elem\n */\n removeSelectedElement(target, elem) {\n let data = this[target];\n let selected = data.value.some((e) => e.id === elem.id);\n if (selected) {\n // remove from selected\n data.value = data.value.filter((e) => e.id !== elem.id);\n //console.log('remove ' + elem.id + ' from selected ' + target);\n\n // remove from hiddenField\n this.rebuildHiddenFieldValues(target);\n\n // in any cases, remove should be recursive\n this.unselectToNextField(target, elem);\n }\n },\n\n /**\n * When unselect Action, it could remove elements in goals multiselect.\n * In that case, we have to unselect Goal to remove elements in results too.\n * @param target\n * @param elem\n */\n unselectToNextField(target, elem) {\n if (target === \"goals\") {\n //console.log('!!!! target is goal: unselect goal', elem.id);\n this.unselectGoal(elem);\n //console.log('!!!! done');\n }\n },\n\n /**\n * Rebuild values serie (string) in target HiddenField\n * @param target\n */\n rebuildHiddenFieldValues(target) {\n let data = this[target];\n //console.log('rebuild hiddenFields ' + target + ' values :');\n data.hiddenField.value = \"\"; // reset\n data.value.forEach((elem) => {\n data.hiddenField.value = this.addIdToValue(\n data.hiddenField.value,\n elem.id,\n );\n });\n //console.log(data.hiddenField);\n },\n\n addIdToValue(string, id) {\n let array = string ? string.split(\",\") : [];\n array.push(id.toString());\n let str = array.join();\n return str;\n },\n\n transTitle({ title }) {\n return title.fr; //TODO multilang\n },\n },\n};\n</script>\n\n<style scoped></style>\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillPersonBundle/Resources/public/vuejs/ExportFormActionGoalResult/index.js",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'app' is assigned a value but never used.",
"line": 16,
"column": 9,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 16,
"endColumn": 12
}
],
"suppressedMessages": [],
"errorCount": 1,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "import { createApp } from \"vue\";\nimport { _createI18n } from \"ChillMainAssets/vuejs/_js/i18n\";\nimport App from \"./App.vue\";\n\nif (\n null !==\n document.getElementById(\"export_filters_social_work_type_filter_enabled\")\n) {\n const i18n = _createI18n({});\n const form = document.getElementById(\n \"export_filters_social_work_type_filter_form\",\n );\n const after = form.appendChild(document.createElement(\"div\"));\n\n /* exported app */\n const app = createApp({\n template: `<app></app>`,\n })\n .use(i18n)\n .component(\"app\", App)\n .mount(after);\n}\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/components/Positioning.vue",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'app' is defined but never used.",
"line": 82,
"column": 31,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 82,
"endColumn": 34
}
],
"suppressedMessages": [],
"errorCount": 1,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "<template>\n <current-household />\n\n <h2>\n {{ $t(\"household_members_editor.positioning.persons_to_positionnate\") }}\n </h2>\n\n <div class=\"list-household-members flex-table\">\n <div v-for=\"conc in concerned\" class=\"item-bloc\" :key=\"conc.person.id\">\n <div class=\"pick-position item-row\">\n <div class=\"person\">\n <!-- <h3>{{ conc.person.text }}</h3> -->\n <h3><person-text :person=\"conc.person\" /></h3>\n </div>\n <div class=\"holder\">\n <button\n class=\"btn\"\n :disabled=\"!allowHolderForConcerned(conc)\"\n :class=\"{\n 'btn-outline-chill-green': !conc.holder,\n 'btn-chill-green': conc.holder,\n }\"\n @click=\"toggleHolder(conc)\"\n >\n {{ $t(\"household_members_editor.positioning.holder\") }}\n </button>\n </div>\n <div\n v-for=\"(position, i) in positions\"\n :key=\"`position-${i}`\"\n class=\"position\"\n >\n <button\n class=\"btn\"\n :class=\"{\n 'btn-primary': conc.position === position,\n 'btn-outline-primary': conc.position !== position,\n }\"\n @click=\"moveToPosition(conc.person.id, position.id)\"\n >\n {{ position.label.fr }}\n </button>\n </div>\n </div>\n <div class=\"item-row\">\n <div>\n <h6>{{ $t(\"household_members_editor.positioning.comment\") }}</h6>\n <person-comment :conc=\"conc\" />\n </div>\n </div>\n </div>\n </div>\n</template>\n\n<script>\nimport { mapGetters, mapState } from \"vuex\";\nimport CurrentHousehold from \"./CurrentHousehold\";\nimport PersonComment from \"./PersonComment\";\nimport PersonText from \"../../_components/Entity/PersonText.vue\";\n\nexport default {\n name: \"Positioning\",\n components: {\n CurrentHousehold,\n PersonComment,\n PersonText,\n },\n computed: {\n ...mapState([\"concerned\"]),\n ...mapGetters([\n \"persons\",\n \"concUnpositionned\",\n \"positions\",\n \"concByPosition\",\n ]),\n allPersonsPositionnated() {\n return (\n this.$store.getters.persons.length > 0 &&\n this.$store.getters.concUnpositionned.length === 0\n );\n },\n allowHolderForConcerned: (app) => (conc) => {\n console.log(\"allow holder for concerned\", conc);\n if (conc.position === null) {\n return false;\n }\n\n return conc.position.allowHolder;\n },\n },\n methods: {\n moveToPosition(person_id, position_id) {\n this.$store.dispatch(\"markPosition\", { person_id, position_id });\n },\n toggleHolder(conc) {\n console.log(\"toggle holder\", conc);\n this.$store.dispatch(\"toggleHolder\", conc);\n },\n },\n};\n</script>\n\n<style lang=\"scss\" scoped>\n.pick-position {\n margin: 0;\n padding: 0;\n display: flex;\n justify-content: flex-end;\n align-items: center;\n\n .person {\n margin-right: auto;\n }\n .holder {\n margin-right: 1.2rem;\n }\n}\n</style>\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillPersonBundle/Resources/public/vuejs/HouseholdMembersEditor/index.js",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'app' is assigned a value but never used.",
"line": 13,
"column": 7,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 13,
"endColumn": 10
}
],
"suppressedMessages": [],
"errorCount": 1,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "import { createApp } from \"vue\";\nimport { _createI18n } from \"ChillMainAssets/vuejs/_js/i18n\";\nimport { appMessages } from \"./js/i18n\";\nimport { store } from \"./store\";\nimport \"vue-toast-notification/dist/theme-sugar.css\";\nimport ToastPlugin from \"vue-toast-notification\";\n\nimport App from \"./App.vue\";\n\nconst i18n = _createI18n(appMessages);\n\n/* exported app */\nconst app = createApp({\n template: `<app></app>`,\n})\n .use(store)\n .use(i18n)\n .use(ToastPlugin, {\n position: \"bottom-right\",\n type: \"error\",\n duration: 5000,\n dismissible: true,\n })\n .component(\"app\", App)\n .mount(\"#household_members_editor\");\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillPersonBundle/Resources/public/vuejs/VisGraph/App.vue",
"messages": [
{
"ruleId": "vue/return-in-computed-property",
"severity": 2,
"message": "Expected to return a value in \"refreshNetwork\" computed property.",
"line": 263,
"column": 19,
"nodeType": "FunctionExpression",
"messageId": "expectedReturnInProperty",
"endLine": 266,
"endColumn": 6
},
{
"ruleId": "vue/no-side-effects-in-computed-properties",
"severity": 2,
"message": "Unexpected side effect in \"legendLayers\" computed property.",
"line": 270,
"column": 7,
"nodeType": "AssignmentExpression",
"messageId": "unexpectedSideEffectInProperty",
"endLine": 270,
"endColumn": 30
},
{
"ruleId": "vue/no-dupe-keys",
"severity": 2,
"message": "Duplicate key 'checkedLayers'. May cause name collision in script or template tag.",
"line": 281,
"column": 5,
"nodeType": "Identifier",
"messageId": "duplicateKey",
"endLine": 281,
"endColumn": 18
},
{
"ruleId": "@typescript-eslint/no-unused-expressions",
"severity": 2,
"message": "Expected an assignment or function call and instead saw an expression.",
"line": 353,
"column": 7,
"nodeType": "ExpressionStatement",
"messageId": "unusedExpression",
"endLine": 353,
"endColumn": 27
}
],
"suppressedMessages": [],
"errorCount": 4,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "<template>\n <div id=\"visgraph\" />\n\n <teleport to=\"#visgraph-legend\">\n <div class=\"post-menu\">\n <div class=\"list-group mt-4\">\n <button\n type=\"button\"\n class=\"list-group-item list-group-item-action btn btn-misc\"\n @click=\"createRelationship\"\n >\n <i class=\"fa fa-plus\" /> {{ $t(\"visgraph.add_link\") }}\n </button>\n <a\n type=\"button\"\n class=\"list-group-item list-group-item-action btn btn-misc\"\n id=\"exportCanvasBtn\"\n @click=\"exportCanvasAsImage\"\n >\n <i class=\"fa fa-camera fa-fw\" /> {{ $t(\"visgraph.screenshot\") }}\n </a>\n </div>\n\n <div v-if=\"displayHelpMessage\" class=\"alert alert-info mt-3\">\n {{ $t(\"visgraph.create_link_help\") }}\n </div>\n\n <div class=\"my-4 legend\">\n <h3>{{ $t(\"visgraph.Legend\") }}</h3>\n <div class=\"list-group\">\n <label\n class=\"list-group-item\"\n v-for=\"(layer, i) in legendLayers\"\n :key=\"`layer-${i}`\"\n >\n <input\n class=\"form-check-input me-1\"\n type=\"checkbox\"\n :value=\"layer.id\"\n v-model=\"checkedLayers\"\n @change=\"toggleLayer\"\n />\n {{ layer.label }}\n </label>\n </div>\n </div>\n </div>\n </teleport>\n\n <teleport to=\"body\">\n <modal\n v-if=\"modal.showModal\"\n :modal-dialog-class=\"modal.modalDialogClass\"\n @close=\"modal.showModal = false\"\n >\n <template #header>\n <h2 class=\"modal-title\">\n {{ $t(modal.title) }}\n </h2>\n <!-- {{ modal.data.id }} -->\n </template>\n <template #body>\n <div v-if=\"modal.action === 'delete'\">\n <p>{{ $t(\"visgraph.delete_confirmation_text\") }}</p>\n </div>\n <div v-else>\n <form>\n <div class=\"row\">\n <div class=\"col-12 text-center\">\n {{ $t(\"visgraph.between\") }}<br />{{ $t(\"visgraph.and\") }}\n </div>\n <div class=\"col\">\n <small>{{ getPersonAge(modal.data.from) }}</small>\n <h4>{{ getPerson(modal.data.from).text }}</h4>\n <p class=\"text-start\" v-if=\"relation && relation.title\">\n <span v-if=\"reverse\">\n {{\n $t(\"visgraph.relation_from_to_like\", [\n getPerson(modal.data.from).text,\n getPerson(modal.data.to).text,\n relation.reverseTitle.fr.toLowerCase(),\n ])\n }}\n </span>\n <span v-else>\n {{\n $t(\"visgraph.relation_from_to_like\", [\n getPerson(modal.data.from).text,\n getPerson(modal.data.to).text,\n relation.title.fr.toLowerCase(),\n ])\n }}\n </span>\n </p>\n </div>\n <div class=\"col text-end\">\n <small>{{ getPersonAge(modal.data.to) }}</small>\n <h4>{{ getPerson(modal.data.to).text }}</h4>\n <p class=\"text-end\" v-if=\"relation && relation.title\">\n <span v-if=\"reverse\">\n {{\n $t(\"visgraph.relation_from_to_like\", [\n getPerson(modal.data.to).text,\n getPerson(modal.data.from).text,\n relation.title.fr.toLowerCase(),\n ])\n }}\n </span>\n <span v-else>\n {{\n $t(\"visgraph.relation_from_to_like\", [\n getPerson(modal.data.to).text,\n getPerson(modal.data.from).text,\n relation.reverseTitle.fr.toLowerCase(),\n ])\n }}\n </span>\n </p>\n </div>\n </div>\n <div class=\"my-3\">\n <VueMultiselect\n id=\"relation\"\n label=\"title\"\n track-by=\"id\"\n :custom-label=\"customLabel\"\n :placeholder=\"$t('visgraph.choose_relation')\"\n :close-on-select=\"true\"\n :multiple=\"false\"\n :searchable=\"true\"\n :options=\"relations\"\n v-model=\"relation\"\n :value=\"relation\"\n />\n </div>\n <div class=\"form-check form-switch\">\n <input\n class=\"form-check-input\"\n type=\"checkbox\"\n id=\"reverse\"\n v-model=\"reverse\"\n />\n <label class=\"form-check-label\" for=\"reverse\">{{\n $t(\"visgraph.reverse_relation\")\n }}</label>\n </div>\n </form>\n </div>\n </template>\n <template #footer>\n <button\n class=\"btn\"\n :class=\"modal.button.class\"\n @click=\"submitRelationship\"\n >\n {{ $t(modal.button.text) }}\n </button>\n <button\n class=\"btn btn-delete\"\n v-if=\"modal.action === 'edit'\"\n @click=\"dropRelationship\"\n />\n </template>\n </modal>\n </teleport>\n <ul class=\"record_actions sticky-form-buttons\">\n <li>\n <add-persons\n button-title=\"visgraph.add_person\"\n modal-title=\"visgraph.add_person\"\n :key=\"addPersons.key\"\n :options=\"addPersons.options\"\n @add-new-persons=\"addNewPersons\"\n ref=\"addPersons\"\n />\n </li>\n </ul>\n</template>\n\n<script>\nimport vis from \"vis-network/dist/vis-network\";\nimport { mapState, mapGetters } from \"vuex\";\nimport Modal from \"ChillMainAssets/vuejs/_components/Modal\";\nimport VueMultiselect from \"vue-multiselect\";\nimport {\n getRelationsList,\n postRelationship,\n patchRelationship,\n deleteRelationship,\n} from \"./api\";\nimport { splitId, getAge } from \"./vis-network\";\nimport { visMessages } from \"./i18n\";\nimport AddPersons from \"ChillPersonAssets/vuejs/_components/AddPersons.vue\";\n\nexport default {\n name: \"App\",\n components: {\n Modal,\n VueMultiselect,\n AddPersons,\n },\n props: [\"household_id\"],\n data() {\n return {\n container: \"\",\n checkedLayers: [],\n relations: [],\n displayHelpMessage: false,\n listenPersonFlag: \"normal\",\n newEdgeData: {},\n modal: {\n showModal: false,\n modalDialogClass: \"modal-md\",\n title: null,\n action: null,\n data: {\n type: \"relationship\",\n from: null,\n to: null,\n relation: null,\n reverse: false,\n },\n button: {\n class: null,\n text: null,\n },\n },\n canvas: null,\n link: null,\n addPersons: {\n key: \"filiation\",\n options: {\n type: [\"person\"],\n priority: null,\n uniq: false,\n },\n },\n };\n },\n computed: {\n ...mapGetters([\n \"nodes\",\n \"edges\",\n // not used 'isInWhitelist', 'isHouseholdLoading', 'isCourseLoaded', 'isRelationshipLoaded', 'isPersonLoaded', 'isExcludedNode', 'countLinksByNode', 'getParticipationsByCourse', 'getMembersByHousehold', 'getPersonsGroup',\n ]),\n ...mapState([\n \"persons\",\n \"households\",\n \"courses\",\n \"excludedNodesIds\",\n \"updateHack\",\n // not used 'links', 'relationships', 'whitelistIds', 'personLoadedIds', 'householdLoadingIds', 'courseLoadedIds', 'relationshipLoadedIds',\n ]),\n\n visgraph_data() {\n //console.log('::: visgraph_data :::', this.nodes.length, 'nodes,', this.edges.length, 'edges')\n return {\n nodes: this.nodes,\n edges: this.edges,\n };\n },\n\n refreshNetwork() {\n //console.log('--- refresh network')\n window.network.setData(this.visgraph_data);\n },\n\n legendLayers() {\n //console.log('--- refresh legend and rebuild checked Layers')\n this.checkedLayers = [];\n let layersDisplayed = [\n ...this.nodes.filter((n) => n.id.startsWith(\"household\")),\n ...this.nodes.filter((n) => n.id.startsWith(\"accompanying\")),\n ];\n layersDisplayed.forEach((layer) => {\n this.checkedLayers.push(layer.id);\n });\n return [...this.households, ...this.courses];\n },\n\n checkedLayers() {\n // required to refresh data checkedLayers\n //console.log('--- checkedLayers')\n return this.checkedLayers;\n },\n\n relation: {\n get() {\n return this.modal.data.relation;\n },\n set(value) {\n this.modal.data.relation = value;\n },\n },\n\n reverse: {\n get() {\n return this.modal.data.reverse;\n },\n set(value) {\n this.modal.data.reverse = value;\n },\n },\n },\n watch: {\n updateHack(newValue, oldValue) {\n //console.log(`--- updateHack ${oldValue} <> ${newValue}`)\n if (oldValue !== newValue) {\n this.forceUpdateComponent();\n }\n },\n },\n mounted() {\n //console.log('=== mounted: init graph')\n this.initGraph();\n this.listenOnGraph();\n this.getRelationsList();\n console.log(this.persons);\n\n this.canvas = document.getElementById(\"visgraph\").querySelector(\"canvas\");\n this.link = document.getElementById(\"exportCanvasBtn\");\n },\n methods: {\n addNewPersons({ selected, modal }) {\n // console.log('@@@ CLICK button addNewPersons', selected);\n selected.forEach(function (item) {\n this.$store\n .dispatch(\"addMorePerson\", item.result)\n .catch(({ name, violations }) => {\n if (name === \"ValidationException\" || name === \"AccessException\") {\n violations.forEach((violation) =>\n this.$toast.open({ message: violation }),\n );\n } else {\n this.$toast.open({ message: violations });\n }\n });\n }, this);\n this.$refs.addPersons.resetSearch(); // to cast child method\n modal.showModal = false;\n },\n initGraph() {\n this.container = document.getElementById(\"visgraph\");\n // Instanciate vis objects in separate window variables, see vis-network.js\n window.network = new vis.Network(\n this.container,\n this.visgraph_data,\n window.options,\n );\n },\n forceUpdateComponent() {\n //console.log('!! forceUpdateComponent !!')\n this.refreshNetwork;\n this.$forceUpdate();\n },\n\n // events\n listenOnGraph() {\n window.network.on(\"selectNode\", (data) => {\n if (data.nodes.length > 1) {\n throw \"Multi selection is not allowed. Disable it in options.interaction !\";\n }\n let node = data.nodes[0];\n let nodeType = splitId(node, \"type\");\n switch (nodeType) {\n case \"person\":\n let person = this.nodes.filter((n) => n.id === node)[0];\n //console.log('@@@@@@ event on selected Node', person.id)\n if (this.listenPersonFlag === \"normal\") {\n if (person.folded === true) {\n //console.log(' @@> expand mode event')\n this.$store.commit(\"unfoldPerson\", person);\n this.$store.dispatch(\"fetchInfoForPerson\", person);\n }\n } else {\n //console.log(' @@> create link mode event')\n this.listenStepsToAddRelationship(person);\n }\n break;\n\n case \"household\":\n let household = this.nodes.filter((n) => n.id === node)[0];\n //console.log('@@@@@@ event on selected Node', household.id)\n this.$store.dispatch(\"unfoldPersonsByHousehold\", household);\n break;\n\n case \"accompanying_period\":\n let course = this.nodes.filter((n) => n.id === node)[0];\n //console.log('@@@@@@ event on selected Node', course.id)\n this.$store.dispatch(\"unfoldPersonsByCourse\", course);\n break;\n\n default:\n throw \"event is undefined for this type of node\";\n }\n this.forceUpdateComponent();\n });\n window.network.on(\"selectEdge\", (data) => {\n if (data.nodes.length !== 0 || data.edges.length !== 1) {\n return false; //we don't want to trigger nodeEdge or multiselect !\n }\n let link = data.edges[0];\n let linkType = splitId(link, \"link\");\n //console.log('@@@@@ event on selected Edge', data.edges.length, linkType, data)\n\n if (linkType.startsWith(\"relationship\")) {\n //console.log('linkType relationship')\n\n let relationships = this.edges.filter((l) => l.id === link);\n if (relationships.length > 1) {\n throw \"error: only one link is allowed between two person!\";\n }\n\n let relationship = relationships[0];\n //console.log(relationship)\n\n this.editRelationshipModal({\n from: relationship.from,\n to: relationship.to,\n id: relationship.id,\n relation: relationship.relation,\n reverse: relationship.reverse,\n });\n }\n });\n },\n listenStepsToAddRelationship(person) {\n //console.log(' @@> listenStep', this.listenPersonFlag)\n if (this.listenPersonFlag === \"step2\") {\n //console.log(' @@> person 2', person)\n this.newEdgeData.to = person.id;\n this.addRelationshipModal(this.newEdgeData);\n this.displayHelpMessage = false;\n this.listenPersonFlag = \"normal\";\n this.newEdgeData = {};\n }\n if (this.listenPersonFlag === \"step1\") {\n //console.log(' @@> person 1', person)\n this.newEdgeData.from = person.id;\n this.listenPersonFlag = \"step2\";\n }\n },\n\n /// control Layers\n toggleLayer(value) {\n let id = value.target.value;\n //console.log('@@@@@@ toggle Layer', id)\n this.forceUpdateComponent();\n if (this.checkedLayers.includes(id)) {\n this.removeLayer(id);\n } else {\n this.addLayer(id);\n }\n },\n addLayer(id) {\n //console.log('+ addLayer', id)\n this.checkedLayers.push(id);\n this.$store.dispatch(\"excludedNode\", [\"remove\", id]);\n },\n removeLayer(id) {\n //console.log('- removeLayer', id)\n this.checkedLayers = this.checkedLayers.filter((i) => i !== id);\n this.$store.dispatch(\"excludedNode\", [\"add\", id]);\n },\n\n /// control Modal\n addRelationshipModal(edgeData) {\n //console.log('==- addRelationshipModal', edgeData)\n this.modal = {\n data: { from: edgeData.from, to: edgeData.to, reverse: false },\n action: \"create\",\n showModal: true,\n title: \"visgraph.add_relationship_link\",\n button: { class: \"btn-create\", text: \"action.create\" },\n };\n },\n editRelationshipModal(edgeData) {\n //console.log('==- editRelationshipModal', edgeData)\n this.modal = {\n data: edgeData,\n action: \"edit\",\n showModal: true,\n title: \"visgraph.edit_relationship_link\",\n button: { class: \"btn-edit\", text: \"action.edit\" },\n };\n },\n\n // form\n resetForm() {\n this.modal = {\n data: {\n type: \"relationship\",\n from: null,\n to: null,\n relation: null,\n reverse: false,\n },\n action: null,\n title: null,\n button: { class: null, text: null },\n };\n //console.log('==- reset Form', this.modal.data)\n },\n getRelationsList() {\n //console.log('fetch relationsList')\n return getRelationsList()\n .then(\n (relations) =>\n new Promise((resolve) => {\n //console.log('+ relations list', relations.results.length)\n this.relations = relations.results.filter(\n (r) => r.isActive === true,\n );\n resolve();\n }),\n )\n .catch();\n },\n customLabel(value) {\n //console.log('customLabel', value)\n return value.title && value.reverseTitle\n ? `${value.title.fr} ↔ ${value.reverseTitle.fr}`\n : \"\";\n },\n getPerson(id) {\n let person = this.persons.filter((p) => p.id === id);\n return person[0];\n },\n getPersonAge(id) {\n let person = this.getPerson(id);\n return getAge(person);\n },\n\n // actions\n createRelationship() {\n this.displayHelpMessage = true;\n this.listenPersonFlag = \"step1\"; // toggle listener in create link mode\n //console.log(' @@> switch listener to create link mode:', this.listenPersonFlag)\n },\n dropRelationship() {\n //console.log('delete', this.modal.data)\n deleteRelationship(this.modal.data).catch();\n this.$store.commit(\"removeLink\", this.modal.data.id);\n this.modal.showModal = false;\n this.resetForm();\n this.forceUpdateComponent();\n },\n submitRelationship() {\n //console.log('submitRelationship', this.modal.action)\n switch (this.modal.action) {\n case \"create\":\n return postRelationship(this.modal.data)\n .then(\n (relationship) =>\n new Promise((resolve) => {\n //console.log('post relationship response', relationship)\n this.$store.dispatch(\"addLinkFromRelationship\", relationship);\n this.modal.showModal = false;\n this.resetForm();\n this.forceUpdateComponent();\n resolve();\n }),\n )\n .catch((error) => {\n if (error.name === \"ValidationException\") {\n for (let v of error.violations) {\n this.$toast.open({ message: v });\n console.log(v);\n }\n } else {\n this.$toast.open({ message: \"An error occurred\" });\n }\n });\n\n case \"edit\":\n return patchRelationship(this.modal.data)\n .then(\n (relationship) =>\n new Promise((resolve) => {\n //console.log('patch relationship response', relationship)\n this.$store.commit(\"updateLink\", relationship);\n this.modal.showModal = false;\n this.resetForm();\n this.forceUpdateComponent();\n resolve();\n }),\n )\n .catch();\n\n default:\n throw \"uncaught action\";\n }\n },\n\n // export image\n async exportCanvasAsImage() {\n let filename = `filiation_${this.household_id}.jpg`,\n mime = \"image/jpeg\",\n quality = 0.85,\n footer = `© Chill ${new Date().getFullYear()}`,\n timestamp = `${visMessages.fr.visgraph.relationship_household} n° ${this.household_id} — ${new Date().toLocaleString()}`;\n\n // resolve toBlob in a Promise\n const getCanvasBlob = (canvas) =>\n new Promise((resolve) => {\n canvas.toBlob((blob) => resolve(blob), mime, quality);\n });\n\n // build image from new temporary canvas\n let tmpCanvas = document.createElement(\"canvas\");\n tmpCanvas.width = this.canvas.width;\n tmpCanvas.height = this.canvas.height;\n\n let ctx = tmpCanvas.getContext(\"2d\");\n ctx.beginPath();\n ctx.fillStyle = \"#fff\";\n ctx.fillRect(0, 0, tmpCanvas.width, tmpCanvas.height);\n ctx.fillStyle = \"#9d4600\";\n ctx.fillText(footer + \" — \" + timestamp, 5, tmpCanvas.height - 10);\n ctx.drawImage(this.canvas, 0, 0);\n\n return await getCanvasBlob(tmpCanvas).then((blob) => {\n let url = document.createElement(\"a\");\n url.download = filename;\n url.href = window.URL.createObjectURL(blob);\n url.click();\n console.log(\"url\", url.href);\n URL.revokeObjectURL(url.href);\n });\n },\n },\n};\n</script>\n\n<style src=\"vis-network/dist/dist/vis-network.min.css\"></style>\n<style src=\"vue-multiselect/dist/vue-multiselect.css\"></style>\n\n<style lang=\"scss\" scoped>\ndiv#visgraph {\n height: 700px;\n margin: auto;\n}\ndiv#visgraph-legend {\n div.post-menu.legend {\n }\n}\n.modal-mask {\n background-color: rgba(0, 0, 0, 0.25);\n}\n.debug {\n margin: 1em;\n padding: 1em;\n color: dimgray;\n font-style: italic;\n font-size: 80%;\n}\n</style>\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillPersonBundle/Resources/public/vuejs/VisGraph/index.js",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'app' is assigned a value but never used.",
"line": 20,
"column": 7,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 20,
"endColumn": 10
}
],
"suppressedMessages": [],
"errorCount": 1,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "import { createApp } from \"vue\";\nimport { store } from \"./store.js\";\nimport { _createI18n } from \"ChillMainAssets/vuejs/_js/i18n\";\nimport { visMessages } from \"./i18n\";\nimport App from \"./App.vue\";\nimport \"vue-toast-notification/dist/theme-sugar.css\";\nimport \"./vis-network\";\nimport ToastPlugin from \"vue-toast-notification\";\n\nconst i18n = _createI18n(visMessages);\nconst container = document.getElementById(\"relationship-graph\");\nconst persons = JSON.parse(container.dataset.persons);\n\npersons.forEach((person) => {\n store.dispatch(\"addPerson\", person);\n store.commit(\"markInWhitelist\", person);\n});\n\n/* exported app */\nconst app = createApp({\n template: `<app :household_id=\"this.household_id\"></app>`,\n data() {\n return {\n household_id: JSON.parse(container.dataset.householdId),\n };\n },\n})\n .use(store)\n .use(i18n)\n .use(ToastPlugin, {\n position: \"bottom-right\",\n type: \"error\",\n duration: 5000,\n dismissible: true,\n })\n .component(\"app\", App)\n .mount(\"#relationship-graph\");\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AccompanyingPeriod/SetReferrer.vue",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'response' is defined but never used.",
"line": 42,
"column": 16,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 42,
"endColumn": 24
}
],
"suppressedMessages": [],
"errorCount": 1,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "<template>\n <ul class=\"list-suggest add-items\" v-if=\"suggested.length > 0\">\n <li v-for=\"(r, i) in suggested\" @click=\"setReferrer(r)\" :key=\"i\">\n <span>{{ r.text }}</span>\n </li>\n </ul>\n</template>\n\n<script>\nimport { makeFetch } from \"ChillMainAssets/lib/api/apiMethods.ts\";\n\nexport default {\n name: \"SetReferrer\",\n props: {\n suggested: {\n type: Array,\n required: false,\n //default: [],\n },\n periodId: {\n type: Number,\n required: true,\n },\n },\n data() {\n return {\n /*suggested: [\n {id: 5, text: 'Robert'}, {id: 8, text: 'Monique'},\n ]*/\n };\n },\n emits: [\"referrerSet\"],\n methods: {\n setReferrer: function (ref) {\n const url = `/api/1.0/person/accompanying-course/${this.periodId}.json`;\n const body = {\n type: \"accompanying_period\",\n user: { id: ref.id, type: ref.type },\n };\n\n return makeFetch(\"PATCH\", url, body)\n .then((response) => {\n this.$emit(\"referrerSet\", ref);\n })\n .catch((error) => {\n throw error;\n });\n },\n },\n};\n</script>\n\n<style scoped></style>\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons.vue",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-vars",
"severity": 2,
"message": "'_response' is defined but never used.",
"line": 356,
"column": 28,
"nodeType": null,
"messageId": "unusedVar",
"endLine": 356,
"endColumn": 37
}
],
"suppressedMessages": [],
"errorCount": 1,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "<template>\n <a\n class=\"btn\"\n :class=\"getClassButton\"\n :title=\"$t(buttonTitle || '')\"\n @click=\"openModal\"\n >\n <span v-if=\"displayTextButton\">{{ $t(buttonTitle || \"\") }}</span>\n </a>\n\n <teleport to=\"body\">\n <modal\n v-if=\"modal.showModal\"\n :modal-dialog-class=\"modal.modalDialogClass\"\n @close=\"modal.showModal = false\"\n >\n <template #header>\n <h3 class=\"modal-title\">\n {{ $t(modalTitle) }}\n </h3>\n </template>\n\n <template #body-head>\n <div class=\"modal-body\">\n <div class=\"search\">\n <label class=\"col-form-label\" style=\"float: right\">\n {{ $tc(\"add_persons.suggested_counter\", suggestedCounter) }}\n </label>\n\n <input\n id=\"search-persons\"\n name=\"query\"\n v-model=\"query\"\n :placeholder=\"$t('add_persons.search_some_persons')\"\n ref=\"search\"\n />\n <i class=\"fa fa-search fa-lg\" />\n <i\n class=\"fa fa-times\"\n v-if=\"queryLength >= 3\"\n @click=\"resetSuggestion\"\n />\n </div>\n </div>\n <div class=\"modal-body\" v-if=\"checkUniq === 'checkbox'\">\n <div class=\"count\">\n <span>\n <a v-if=\"suggestedCounter > 2\" @click=\"selectAll\">\n {{ $t(\"action.check_all\") }}\n </a>\n <a v-if=\"selectedCounter > 0\" @click=\"resetSelection\">\n <i v-if=\"suggestedCounter > 2\"> • </i>\n {{ $t(\"action.reset\") }}\n </a>\n </span>\n <span v-if=\"selectedCounter > 0\">\n {{ $tc(\"add_persons.selected_counter\", selectedCounter) }}\n </span>\n </div>\n </div>\n </template>\n\n <template #body>\n <div class=\"results\">\n <person-suggestion\n v-for=\"item in this.selectedAndSuggested.slice().reverse()\"\n :key=\"itemKey(item)\"\n :item=\"item\"\n :search=\"search\"\n :type=\"checkUniq\"\n @save-form-on-the-fly=\"saveFormOnTheFly\"\n @new-prior-suggestion=\"newPriorSuggestion\"\n @update-selected=\"updateSelected\"\n />\n\n <div class=\"create-button\">\n <on-the-fly\n v-if=\"\n queryLength >= 3 &&\n (options.type.includes('person') ||\n options.type.includes('thirdparty'))\n \"\n :button-text=\"$t('onthefly.create.button', { q: query })\"\n :allowed-types=\"options.type\"\n :query=\"query\"\n action=\"create\"\n @save-form-on-the-fly=\"saveFormOnTheFly\"\n ref=\"onTheFly\"\n />\n </div>\n </div>\n </template>\n\n <template #footer>\n <button\n class=\"btn btn-create\"\n @click.prevent=\"$emit('addNewPersons', { selected, modal })\"\n >\n {{ $t(\"action.add\") }}\n </button>\n </template>\n </modal>\n </teleport>\n</template>\n\n<script>\nimport Modal from \"ChillMainAssets/vuejs/_components/Modal\";\nimport OnTheFly from \"ChillMainAssets/vuejs/OnTheFly/components/OnTheFly.vue\";\nimport PersonSuggestion from \"./AddPersons/PersonSuggestion\";\nimport { searchEntities } from \"ChillPersonAssets/vuejs/_api/AddPersons\";\nimport { makeFetch } from \"ChillMainAssets/lib/api/apiMethods\";\n\nexport default {\n name: \"AddPersons\",\n components: {\n Modal,\n PersonSuggestion,\n OnTheFly,\n },\n props: [\"buttonTitle\", \"modalTitle\", \"options\"],\n emits: [\"addNewPersons\"],\n data() {\n return {\n modal: {\n showModal: false,\n modalDialogClass: \"modal-dialog-scrollable modal-xl\",\n },\n search: {\n query: \"\",\n previousQuery: \"\",\n currentSearchQueryController: null,\n suggested: [],\n selected: [],\n priorSuggestion: {},\n },\n };\n },\n computed: {\n query: {\n set(query) {\n return this.setQuery(query);\n },\n get() {\n return this.search.query;\n },\n },\n queryLength() {\n return this.search.query.length;\n },\n suggested() {\n return this.search.suggested;\n },\n suggestedCounter() {\n return this.search.suggested.length;\n },\n selected() {\n return this.search.selected;\n },\n selectedCounter() {\n return this.search.selected.length;\n },\n selectedAndSuggested() {\n this.addPriorSuggestion();\n const uniqBy = (a, key) => [\n ...new Map(a.map((x) => [key(x), x])).values(),\n ];\n let union = [\n ...new Set([\n ...this.suggested.slice().reverse(),\n ...this.selected.slice().reverse(),\n ]),\n ];\n return uniqBy(union, (k) => k.key);\n },\n getClassButton() {\n let size =\n typeof this.options.button !== \"undefined\" &&\n typeof this.options.button.size !== \"undefined\"\n ? this.options.button.size\n : \"\";\n let type =\n typeof this.options.button !== \"undefined\" &&\n typeof this.options.button.type !== \"undefined\"\n ? this.options.button.type\n : \"btn-create\";\n return size ? size + \" \" + type : type;\n },\n displayTextButton() {\n return typeof this.options.button !== \"undefined\" &&\n typeof this.options.button.display !== \"undefined\"\n ? this.options.button.display\n : true;\n },\n checkUniq() {\n if (this.options.uniq === true) {\n return \"radio\";\n }\n return \"checkbox\";\n },\n priorSuggestion() {\n return this.search.priorSuggestion;\n },\n hasPriorSuggestion() {\n return this.search.priorSuggestion.key ? true : false;\n },\n },\n methods: {\n openModal() {\n this.modal.showModal = true;\n this.$nextTick(function () {\n this.$refs.search.focus();\n });\n },\n setQuery(query) {\n this.search.query = query;\n\n setTimeout(\n function () {\n if (query === \"\") {\n this.loadSuggestions([]);\n return;\n }\n if (query === this.search.query) {\n if (this.search.currentSearchQueryController !== null) {\n this.search.currentSearchQueryController.abort();\n }\n this.search.currentSearchQueryController = new AbortController();\n searchEntities(\n { query, options: this.options },\n this.search.currentSearchQueryController.signal,\n )\n .then(\n (suggested) =>\n new Promise((resolve) => {\n this.loadSuggestions(suggested.results);\n resolve();\n }),\n )\n .catch((error) => {\n if (error instanceof DOMException) {\n if (error.name === \"AbortError\") {\n console.log(\"request aborted due to user continue typing\");\n return;\n }\n }\n\n throw error;\n });\n }\n }.bind(this),\n query.length > 3 ? 300 : 700,\n );\n },\n loadSuggestions(suggested) {\n this.search.suggested = suggested;\n this.search.suggested.forEach(function (item) {\n item.key = this.itemKey(item);\n }, this);\n },\n updateSelected(value) {\n //console.log('value', value);\n this.search.selected = value;\n },\n resetSearch() {\n this.resetSelection();\n this.resetSuggestion();\n },\n resetSuggestion() {\n this.search.query = \"\";\n this.search.suggested = [];\n },\n resetSelection() {\n this.search.selected = [];\n },\n selectAll() {\n this.search.suggested.forEach(function (item) {\n this.search.selected.push(item);\n }, this);\n },\n itemKey(item) {\n return item.result.type + item.result.id;\n },\n addPriorSuggestion() {\n // console.log('prior suggestion', this.priorSuggestion);\n if (this.hasPriorSuggestion) {\n // console.log('addPriorSuggestion',);\n this.suggested.unshift(this.priorSuggestion);\n this.selected.unshift(this.priorSuggestion);\n\n this.newPriorSuggestion(null);\n }\n },\n newPriorSuggestion(entity) {\n // console.log('newPriorSuggestion', entity);\n if (entity !== null) {\n let suggestion = {\n key: entity.type + entity.id,\n relevance: 0.5,\n result: entity,\n };\n this.search.priorSuggestion = suggestion;\n // console.log('search priorSuggestion', this.search.priorSuggestion);\n this.addPriorSuggestion(suggestion);\n } else {\n this.search.priorSuggestion = {};\n }\n },\n saveFormOnTheFly({ type, data }) {\n console.log(\n \"saveFormOnTheFly from addPersons, type\",\n type,\n \", data\",\n data,\n );\n if (type === \"person\") {\n makeFetch(\"POST\", \"/api/1.0/person/person.json\", data)\n .then((responsePerson) => {\n this.newPriorSuggestion(responsePerson);\n this.$refs.onTheFly.closeModal();\n\n if (null !== data.addressId) {\n const household = {\n type: \"household\",\n };\n const address = {\n id: data.addressId,\n };\n makeFetch(\"POST\", \"/api/1.0/person/household.json\", household)\n .then((responseHousehold) => {\n const member = {\n concerned: [\n {\n person: {\n type: \"person\",\n id: responsePerson.id,\n },\n start_date: {\n // TODO: use date.ts methods (low priority)\n datetime: `${new Date().toISOString().split(\"T\")[0]}T00:00:00+02:00`,\n },\n holder: false,\n comment: null,\n },\n ],\n destination: {\n type: \"household\",\n id: responseHousehold.id,\n },\n composition: null,\n };\n return makeFetch(\n \"POST\",\n \"/api/1.0/person/household/members/move.json\",\n member,\n )\n .then((_response) => {\n makeFetch(\n \"POST\",\n `/api/1.0/person/household/${responseHousehold.id}/address.json`,\n address,\n )\n .then((_response) => {\n console.log(_response);\n })\n .catch((error) => {\n if (error.name === \"ValidationException\") {\n for (let v of error.violations) {\n this.$toast.open({ message: v });\n }\n } else {\n this.$toast.open({ message: \"An error occurred\" });\n }\n });\n })\n .catch((error) => {\n if (error.name === \"ValidationException\") {\n for (let v of error.violations) {\n this.$toast.open({ message: v });\n }\n } else {\n this.$toast.open({ message: \"An error occurred\" });\n }\n });\n })\n .catch((error) => {\n if (error.name === \"ValidationException\") {\n for (let v of error.violations) {\n this.$toast.open({ message: v });\n }\n } else {\n this.$toast.open({ message: \"An error occurred\" });\n }\n });\n }\n })\n .catch((error) => {\n if (error.name === \"ValidationException\") {\n for (let v of error.violations) {\n this.$toast.open({ message: v });\n }\n } else {\n this.$toast.open({ message: \"An error occurred\" });\n }\n });\n } else if (type === \"thirdparty\") {\n makeFetch(\"POST\", \"/api/1.0/thirdparty/thirdparty.json\", data)\n .then((response) => {\n this.newPriorSuggestion(response);\n this.$refs.onTheFly.closeModal();\n })\n .catch((error) => {\n if (error.name === \"ValidationException\") {\n for (let v of error.violations) {\n this.$toast.open({ message: v });\n }\n } else {\n this.$toast.open({ message: \"An error occurred\" });\n }\n });\n }\n },\n },\n};\n</script>\n\n<style lang=\"scss\">\nli.add-persons {\n a {\n cursor: pointer;\n }\n}\ndiv.body-head {\n overflow-y: unset;\n div.modal-body:first-child {\n margin: auto 4em;\n div.search {\n position: relative;\n input {\n width: 100%;\n padding: 1.2em 1.5em 1.2em 2.5em;\n //margin: 1em 0;\n }\n i {\n position: absolute;\n opacity: 0.5;\n padding: 0.65em 0;\n top: 50%;\n }\n i.fa-search {\n left: 0.5em;\n }\n i.fa-times {\n right: 1em;\n padding: 0.75em 0;\n cursor: pointer;\n }\n }\n }\n div.modal-body:last-child {\n padding-bottom: 0;\n }\n div.count {\n margin: -0.5em 0 0.7em;\n display: flex;\n justify-content: space-between;\n a {\n cursor: pointer;\n }\n }\n}\n.create-button > a {\n margin-top: 0.5em;\n margin-left: 2.6em;\n}\n</style>\n",
"usedDeprecatedRules": []
},
{
"filePath": "/home/julielenaerts/Documents/CHAMPSLIBRES/CHILL/chill-base-v3/vendor/chill-project/chill-bundles/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue",
"messages": [
{
"ruleId": "@typescript-eslint/no-unused-expressions",
"severity": 2,
"message": "Expected an assignment or function call and instead saw an expression.",
"line": 371,
"column": 21,
"nodeType": "ExpressionStatement",
"messageId": "unusedExpression",
"endLine": 373,
"endColumn": 62
}
],
"suppressedMessages": [],
"errorCount": 1,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"source": "<template>\n <div v-if=\"action === 'show'\">\n <div class=\"flex-table\">\n <third-party-render-box\n :thirdparty=\"thirdparty\"\n :options=\"{\n addInfo: true,\n addEntity: true,\n entityDisplayLong: true,\n addAltNames: true,\n addId: true,\n addLink: false,\n addAge: false,\n hLevel: 3,\n addCenter: true,\n addNoData: true,\n isMultiline: true,\n }\"\n />\n </div>\n </div>\n <div\n v-else-if=\"\n action === 'edit' || action === 'create' || action === 'addContact'\n \"\n >\n <div v-if=\"parent\">\n <div class=\"parent-info\">\n <i class=\"fa fa-li fa-hand-o-right\" />\n <b class=\"me-2\">{{ $t(\"child_of\") }}</b>\n <span class=\"chill-entity badge-thirdparty\">{{\n parent.text\n }}</span>\n </div>\n </div>\n <div class=\"form-floating mb-3\" v-else-if=\"kind !== 'child'\">\n <div class=\"form-check\">\n <input\n class=\"form-check-input mt-0\"\n type=\"radio\"\n v-model=\"kind\"\n value=\"company\"\n id=\"tpartyKindInstitution\"\n />\n <label for=\"tpartyKindInstitution\" class=\"required\">\n <badge-entity\n :entity=\"{ type: 'thirdparty', kind: 'company' }\"\n :options=\"{ displayLong: true }\"\n />\n </label>\n </div>\n <div class=\"form-check\">\n <input\n class=\"form-check-input mt-0\"\n type=\"radio\"\n v-model=\"kind\"\n value=\"contact\"\n id=\"tpartyKindContact\"\n />\n <label for=\"tpartyKindContact\" class=\"required\">\n <badge-entity\n :entity=\"{ type: 'thirdparty', kind: 'contact' }\"\n :options=\"{ displayLong: true }\"\n />\n </label>\n </div>\n </div>\n <div v-else>\n <p>Contact de&nbsp;:</p>\n <third-party-render-box\n :thirdparty=\"thirdparty.parent\"\n :options=\"{\n addInfo: true,\n addEntity: false,\n addAltNames: true,\n addId: false,\n addLink: false,\n addAge: false,\n hLevel: 4,\n addCenter: false,\n addNoData: true,\n isMultiline: false,\n }\"\n />\n </div>\n\n <div\n v-if=\"thirdparty.kind === 'child' || thirdparty.kind === 'contact'\"\n >\n <div class=\"child-info\">\n <div class=\"input-group mb-3 input-section\">\n <select\n class=\"form-select form-select-lg\"\n id=\"civility\"\n v-model=\"thirdparty.civility\"\n >\n <option selected disabled :value=\"null\">\n {{ $t(\"thirdparty.civility\") }}\n </option>\n <option\n v-for=\"civility in civilities\"\n :key=\"civility.id\"\n :value=\"civility\"\n >\n {{ civility.name.fr }}\n </option>\n </select>\n </div>\n <div class=\"input-group mb-3 input-section\">\n <input\n class=\"form-control form-control-lg\"\n v-model=\"thirdparty.profession\"\n :placeholder=\"$t('thirdparty.profession')\"\n :aria-label=\"$t('thirdparty.profession')\"\n aria-describedby=\"profession\"\n />\n </div>\n </div>\n <div class=\"child-info\">\n <div class=\"input-section\">\n <div class=\"form-floating mb-3\">\n <input\n class=\"form-control form-control-lg\"\n id=\"firstname\"\n v-model=\"thirdparty.firstname\"\n :placeholder=\"$t('thirdparty.firstname')\"\n />\n <label for=\"firstname\">{{\n $t(\"thirdparty.firstname\")\n }}</label>\n </div>\n <div v-if=\"queryItems\">\n <ul class=\"list-suggest add-items inline\">\n <li\n v-for=\"(qi, i) in queryItems\"\n :key=\"i\"\n @click=\"addQueryItem('firstName', qi)\"\n >\n <span class=\"person-text\">{{ qi }}</span>\n </li>\n </ul>\n </div>\n </div>\n <div class=\"input-section\">\n <div class=\"form-floating mb-3\">\n <input\n class=\"form-control form-control-lg\"\n id=\"name\"\n v-model=\"thirdparty.name\"\n :placeholder=\"$t('thirdparty.lastname')\"\n />\n <label for=\"name\">{{\n $t(\"thirdparty.lastname\")\n }}</label>\n </div>\n <div v-if=\"queryItems\">\n <ul class=\"list-suggest add-items inline\">\n <li\n v-for=\"(qi, i) in queryItems\"\n :key=\"i\"\n @click=\"addQueryItem('name', qi)\"\n >\n <span class=\"person-text\">{{ qi }}</span>\n </li>\n </ul>\n </div>\n </div>\n </div>\n </div>\n\n <div v-if=\"thirdparty.kind === 'company'\">\n <div class=\"form-floating mb-3\">\n <input\n class=\"form-control form-control-lg\"\n id=\"name\"\n v-model=\"thirdparty.name\"\n :placeholder=\"$t('thirdparty.name')\"\n />\n <label for=\"name\">{{ $t(\"thirdparty.name\") }}</label>\n </div>\n <div v-if=\"query\">\n <ul class=\"list-suggest add-items inline\">\n <li @click=\"addQuery(query)\">\n <span class=\"person-text\">{{ query }}</span>\n </li>\n </ul>\n </div>\n </div>\n\n <template v-if=\"thirdparty.kind !== 'child'\">\n <add-address\n key=\"thirdparty\"\n :context=\"context\"\n :options=\"addAddress.options\"\n :address-changed-callback=\"submitAddress\"\n ref=\"addAddress\"\n />\n </template>\n\n <div class=\"input-group mb-3\">\n <span class=\"input-group-text\" id=\"email\"\n ><i class=\"fa fa-fw fa-envelope\"\n /></span>\n <input\n class=\"form-control form-control-lg\"\n v-model=\"thirdparty.email\"\n :placeholder=\"$t('thirdparty.email')\"\n :aria-label=\"$t('thirdparty.email')\"\n aria-describedby=\"email\"\n />\n </div>\n\n <div class=\"input-group mb-3\">\n <span class=\"input-group-text\" id=\"phonenumber\"\n ><i class=\"fa fa-fw fa-phone\"\n /></span>\n <input\n class=\"form-control form-control-lg\"\n v-model=\"thirdparty.telephone\"\n :placeholder=\"$t('thirdparty.phonenumber')\"\n :aria-label=\"$t('thirdparty.phonenumber')\"\n aria-describedby=\"phonenumber\"\n />\n </div>\n\n <div v-if=\"parent\">\n <div class=\"input-group mb-3\">\n <span class=\"input-group-text\" id=\"comment\"\n ><i class=\"fa fa-fw fa-pencil\"\n /></span>\n <textarea\n class=\"form-control form-control-lg\"\n :placeholder=\"$t('thirdparty.comment')\"\n v-model=\"thirdparty.comment\"\n />\n </div>\n </div>\n </div>\n</template>\n\n<script>\nimport ThirdPartyRenderBox from \"../Entity/ThirdPartyRenderBox.vue\";\nimport AddAddress from \"ChillMainAssets/vuejs/Address/components/AddAddress\";\nimport { getThirdparty } from \"../../_api/OnTheFly\";\nimport BadgeEntity from \"ChillMainAssets/vuejs/_components/BadgeEntity.vue\";\nimport { makeFetch } from \"ChillMainAssets/lib/api/apiMethods\";\n\nexport default {\n name: \"OnTheFlyThirdParty\",\n props: [\"id\", \"type\", \"action\", \"query\", \"parent\"],\n components: {\n ThirdPartyRenderBox,\n AddAddress,\n BadgeEntity,\n },\n data() {\n return {\n //context: {}, <--\n thirdparty: {\n type: \"thirdparty\",\n address: null,\n kind: \"company\",\n firstname: \"\",\n name: \"\",\n telephone: \"\",\n civility: null,\n profession: \"\",\n },\n civilities: [],\n addAddress: {\n options: {\n openPanesInModal: true,\n onlyButton: false,\n button: {\n size: \"btn-sm\",\n },\n title: {\n create: \"add_an_address_title\",\n edit: \"edit_address\",\n },\n },\n },\n };\n },\n computed: {\n kind: {\n get() {\n // note: there are also default to 'institution' set in the \"mounted\" method\n if (this.$data.thirdparty.kind !== undefined) {\n return this.$data.thirdparty.kind;\n } else {\n return \"company\";\n }\n },\n set(v) {\n this.$data.thirdparty.kind = v;\n },\n },\n context() {\n let context = {\n target: {\n name: this.type,\n id: this.id,\n },\n edit: false,\n addressId: null,\n defaults: window.addaddress,\n };\n if (\n !(\n this.thirdparty.address === undefined ||\n this.thirdparty.address === null\n ) &&\n this.thirdparty.address.address_id !== null\n ) {\n // to complete\n context.addressId = this.thirdparty.address.address_id;\n context.edit = true;\n }\n //this.context = context; <--\n return context;\n },\n queryItems() {\n return this.query ? this.query.split(\" \") : null;\n },\n },\n methods: {\n loadData() {\n return getThirdparty(this.id).then(\n (thirdparty) =>\n new Promise((resolve) => {\n this.thirdparty = thirdparty;\n this.thirdparty.kind = thirdparty.kind;\n if (this.action !== \"show\") {\n if (thirdparty.address !== null) {\n // bof! we force getInitialAddress because addressId not available when mounted\n this.$refs.addAddress.getInitialAddress(\n thirdparty.address.address_id,\n );\n }\n }\n resolve();\n }),\n );\n },\n loadCivilities() {\n const url = `/api/1.0/main/civility.json`;\n return makeFetch(\"GET\", url)\n .then((response) => {\n this.$data.civilities = response.results;\n return Promise.resolve();\n })\n .catch((error) => {\n console.log(error);\n this.$toast.open({ message: error.body });\n });\n },\n submitAddress(payload) {\n console.log(\"submitAddress\", payload);\n if (typeof payload.addressId !== \"undefined\") {\n // <--\n this.context.edit = true;\n this.context.addressId = payload.addressId; // bof! use legacy and not legacy in payload\n this.thirdparty.address = payload.address; // <--\n console.log(\"switch address to edit mode\", this.context);\n }\n },\n addQueryItem(field, queryItem) {\n switch (field) {\n case \"name\":\n this.thirdparty.name\n ? (this.thirdparty.name += ` ${queryItem}`)\n : (this.thirdparty.name = queryItem);\n break;\n case \"firstName\":\n this.thirdparty.firstname = queryItem;\n break;\n }\n },\n addQuery(query) {\n this.thirdparty.name = query;\n },\n },\n mounted() {\n let dependencies = [];\n dependencies.push(this.loadCivilities());\n if (this.action !== \"create\") {\n if (this.id) {\n dependencies.push(this.loadData());\n // here we can do something when all promises are resolve, with\n // Promise.all(dependencies).then(() => { /* do something */ });\n }\n if (this.action === \"addContact\") {\n this.$data.thirdparty.kind = \"child\";\n // this.$data.thirdparty.parent = this.parent.id\n this.$data.thirdparty.address = null;\n }\n } else {\n this.thirdparty.kind = \"company\";\n }\n },\n};\n</script>\n\n<style lang=\"scss\" scoped>\ndiv.flex-table {\n div.item-bloc {\n div.item-row {\n div.item-col:last-child {\n justify-content: flex-start;\n }\n }\n }\n}\ndl {\n dd {\n margin-left: 1em;\n }\n}\n.parent-info {\n margin-bottom: 1rem;\n}\n\n.child-info {\n display: flex;\n justify-content: space-between;\n .input-section {\n width: 49%;\n }\n}\n</style>\n",
"usedDeprecatedRules": []
}
]