eslint corrections in personbundle

This commit is contained in:
Julie Lenaerts 2024-11-14 16:45:50 +01:00
parent c971e34675
commit 2d6d2a1f58
13 changed files with 19 additions and 27 deletions

View File

@ -12,7 +12,7 @@ import { ShowHide } from 'ShowHide';
'froms': [k ], 'froms': [k ],
'event_name': 'input', 'event_name': 'input',
'debug': true, 'debug': true,
'test': function(froms, event) { 'test': function(froms) {
for (let f of froms.values()) { for (let f of froms.values()) {
console.log(f); console.log(f);
for (let input of f.querySelectorAll('input').values()) { for (let input of f.querySelectorAll('input').values()) {

View File

@ -70,7 +70,7 @@ export default {
value = "occasional"; value = "occasional";
} }
this.$store.dispatch('toggleIntensity', value) this.$store.dispatch('toggleIntensity', value)
.catch(({name, violations}) => { .catch(({name}) => {
if (name === 'ValidationException' || name === 'AccessException') { if (name === 'ValidationException' || name === 'AccessException') {
this.$toast.open({message: this.$t('Only the referrer can toggle the intensity of an accompanying course')}) this.$toast.open({message: this.$t('Only the referrer can toggle the intensity of an accompanying course')})
} else { } else {
@ -90,7 +90,7 @@ export default {
}, },
toggleConfidential() { toggleConfidential() {
this.$store.dispatch('toggleConfidential') this.$store.dispatch('toggleConfidential')
.catch(({name, violations}) => { .catch(({name}) => {
console.log(name); console.log(name);
if (name === 'ValidationException' || name === 'AccessException') { if (name === 'ValidationException' || name === 'AccessException') {
this.$toast.open({message: this.$t('Only the referrer can toggle the confidentiality of an accompanying course')}) this.$toast.open({message: this.$t('Only the referrer can toggle the confidentiality of an accompanying course')})

View File

@ -70,7 +70,7 @@ export default {
// TODO resizeObserver not supports IE ! // TODO resizeObserver not supports IE !
// Listen when elements change size, then recalculate heightSum and initItemsMap // Listen when elements change size, then recalculate heightSum and initItemsMap
const resizeObserver = new ResizeObserver(entries => { const resizeObserver = new ResizeObserver(() => {
this.refreshPos(); this.refreshPos();
}); });

View File

@ -378,7 +378,7 @@ let initPromise = (root) => Promise.all([getScopesPromise(root), accompanyingCou
const url = `/api/1.0/person/accompanying-course/${id}/comment.json`; const url = `/api/1.0/person/accompanying-course/${id}/comment.json`;
return makeFetch('DELETE', url, body) return makeFetch('DELETE', url, body)
.then((response) => { .then(() => {
commit('removePinnedComment'); commit('removePinnedComment');
}) })
.catch((error) => { .catch((error) => {
@ -459,7 +459,7 @@ let initPromise = (root) => Promise.all([getScopesPromise(root), accompanyingCou
const url = `/api/1.0/person/accompanying-course/${id}/requestor.json`; const url = `/api/1.0/person/accompanying-course/${id}/requestor.json`;
return makeFetch('DELETE', url, body) return makeFetch('DELETE', url, body)
.then((response) => { .then(() => {
commit('removeRequestor'); commit('removeRequestor');
dispatch('requestorIsAnonymous', false); dispatch('requestorIsAnonymous', false);
}) })
@ -503,7 +503,7 @@ let initPromise = (root) => Promise.all([getScopesPromise(root), accompanyingCou
const url = `/api/1.0/person/accompanying-course/${id}/resource.json`; const url = `/api/1.0/person/accompanying-course/${id}/resource.json`;
return makeFetch('DELETE', url, body) return makeFetch('DELETE', url, body)
.then((response) => { .then(() => {
commit('removeResource', payload) commit('removeResource', payload)
}) })
.catch((error) => { .catch((error) => {
@ -736,7 +736,7 @@ let initPromise = (root) => Promise.all([getScopesPromise(root), accompanyingCou
updateSocialIssues({ state, commit, dispatch }, { payload, body, method }) { updateSocialIssues({ state, commit, dispatch }, { payload, body, method }) {
const url = `/api/1.0/person/accompanying-course/${id}/socialissue.json`; const url = `/api/1.0/person/accompanying-course/${id}/socialissue.json`;
return makeFetch(method, url, body) return makeFetch(method, url, body)
.then((response) => { .then(() => {
commit('updateSocialIssues', payload); commit('updateSocialIssues', payload);
}) })
.then(() => { .then(() => {

View File

@ -7,6 +7,8 @@ import ToastPlugin from "vue-toast-notification";
const i18n = _createI18n(personMessages); const i18n = _createI18n(personMessages);
/*eslint no-unused-vars: "error"*/
/* exported app */
const app = createApp({ const app = createApp({
template: `<app></app>`, template: `<app></app>`,
}) })

View File

@ -8,6 +8,7 @@ import ToastPlugin from "vue-toast-notification";
const i18n = _createI18n(personMessages); const i18n = _createI18n(personMessages);
/* exported app */
const app = createApp({ const app = createApp({
template: `<app></app>`, template: `<app></app>`,
}) })

View File

@ -4,7 +4,6 @@ import { fetchResults, makeFetch } from 'ChillMainAssets/lib/api/apiMethods.ts';
import { fetchTemplates } from 'ChillDocGeneratorAssets/api/pickTemplate.js'; import { fetchTemplates } from 'ChillDocGeneratorAssets/api/pickTemplate.js';
const debug = process.env.NODE_ENV !== 'production'; const debug = process.env.NODE_ENV !== 'production';
const evalFQDN = encodeURIComponent("Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWorkEvaluation");
const store = createStore({ const store = createStore({
strict: debug, strict: debug,
@ -502,8 +501,7 @@ const store = createStore({
let let
payload = getters.buildPayload, payload = getters.buildPayload,
params = new URLSearchParams({'entity_version': state.version}), params = new URLSearchParams({'entity_version': state.version}),
url = `/api/1.0/person/accompanying-course/work/${state.work.id}.json?${params}`, url = `/api/1.0/person/accompanying-course/work/${state.work.id}.json?${params}`
errors = []
; ;
commit('setIsPosting', true); commit('setIsPosting', true);

View File

@ -264,9 +264,10 @@ export default {
}, },
unselectGoal(value) { unselectGoal(value) {
getResultByGoal(value.id).then(results => { getResultByGoal(value.id)
[ this.results.options, this.results.value ] = this.removeElementInData('results', results); .then(
}).catch; results => [ this.results.options, this.results.value ] = this.removeElementInData('results', results)
).catch;
}, },
// selectResult(value) { // selectResult(value) {

View File

@ -7,6 +7,7 @@ if (null !== document.getElementById('export_filters_social_work_type_filter_ena
const form = document.getElementById('export_filters_social_work_type_filter_form'); const form = document.getElementById('export_filters_social_work_type_filter_form');
const after = form.appendChild(document.createElement('div')); const after = form.appendChild(document.createElement('div'));
/* exported app */
const app = createApp({ const app = createApp({
template: `<app></app>`, template: `<app></app>`,
}) })

View File

@ -49,7 +49,6 @@
</template> </template>
<script> <script>
import MemberDetails from './MemberDetails.vue';
import {mapGetters, mapState} from "vuex"; import {mapGetters, mapState} from "vuex";
import CurrentHousehold from "./CurrentHousehold"; import CurrentHousehold from "./CurrentHousehold";
import PersonComment from './PersonComment'; import PersonComment from './PersonComment';

View File

@ -9,6 +9,7 @@ import App from './App.vue';
const i18n = _createI18n(appMessages); const i18n = _createI18n(appMessages);
/* exported app */
const app = createApp({ const app = createApp({
template: `<app></app>`, template: `<app></app>`,
}) })

View File

@ -1,17 +1,5 @@
import { splitId } from './vis-network'; import { splitId } from './vis-network';
import {makeFetch} from 'ChillMainAssets/lib/api/apiMethods.ts'; import {makeFetch} from 'ChillMainAssets/lib/api/apiMethods.ts';
/**
* @function getFetch
* @param url
* @returns {Promise<Response>}
* @deprecated use makeFetch instead
*/
const getFetch = (url) => {
console.error('deprecated method');
return makeFetch('GET', url, null)
}
/** /**
* @function postFetch * @function postFetch
* @param url * @param url

View File

@ -16,6 +16,7 @@ persons.forEach(person => {
store.commit('markInWhitelist', person) store.commit('markInWhitelist', person)
}) })
/* exported app */
const app = createApp({ const app = createApp({
template: `<app :household_id="this.household_id"></app>`, template: `<app :household_id="this.household_id"></app>`,
data() { data() {