Fix of errors: automatic and some manual

This commit is contained in:
Julie Lenaerts 2024-11-04 19:56:03 +01:00
parent 90798b12e5
commit f05c25853c
41 changed files with 101 additions and 148 deletions

View File

@ -4,7 +4,7 @@ var
div_accompagnement = document.getElementById("form_accompagnement"), div_accompagnement = document.getElementById("form_accompagnement"),
div_accompagnement_comment = document.getElementById("form_accompagnement_comment"), div_accompagnement_comment = document.getElementById("form_accompagnement_comment"),
div_caf_id = document.getElementById("cafId"), div_caf_id = document.getElementById("cafId"),
div_caf_inscription_date = document.getElementById("cafInscriptionDate"), div_caf_inscription_date = document.getElementById("cafInscriptionDate")
; ;
// let show/hide the div_accompagnement_comment if the input with value `'autre'` is checked // let show/hide the div_accompagnement_comment if the input with value `'autre'` is checked

View File

@ -54,14 +54,15 @@
</span> </span>
<template v-else-if="socialActionsList.length > 0"> <template v-else-if="socialActionsList.length > 0">
<check-social-action <div v-if="socialIssuesSelected.length || socialActionsSelected.length">
v-if="socialIssuesSelected.length || socialActionsSelected.length" <check-social-action
v-for="action in socialActionsList" v-for="action in socialActionsList"
:key="action.id" :key="action.id"
:action="action" :action="action"
:selection="socialActionsSelected" :selection="socialActionsSelected"
@update-selected="updateActionsSelected" @update-selected="updateActionsSelected"
/> />
</div>
</template> </template>
<span <span

View File

@ -46,7 +46,6 @@
<teleport to="#fullCalendar"> <teleport to="#fullCalendar">
<div class="calendar-actives"> <div class="calendar-actives">
<template <template
class=""
v-for="u in getActiveUsers" v-for="u in getActiveUsers"
:key="u.id" :key="u.id"
> >

View File

@ -17,16 +17,16 @@ export interface UserData {
} }
export const addIdToValue = (string: string, id: number): string => { export const addIdToValue = (string: string, id: number): string => {
let array = string ? string.split(',') : []; const array = string ? string.split(',') : [];
array.push(id.toString()); array.push(id.toString());
let str = array.join(); const str = array.join();
return str; return str;
}; };
export const removeIdFromValue = (string: string, id: number) => { export const removeIdFromValue = (string: string, id: number) => {
let array = string.split(','); let array = string.split(',');
array = array.filter(el => el !== id.toString()); array = array.filter(el => el !== id.toString());
let str = array.join(); const str = array.join();
return str; return str;
}; };
@ -34,7 +34,7 @@ export const removeIdFromValue = (string: string, id: number) => {
* Assign missing keys for the ConcernedGroups component * Assign missing keys for the ConcernedGroups component
*/ */
export const mapEntity = (entity: EventInput): EventInput => { export const mapEntity = (entity: EventInput): EventInput => {
let calendar = { ...entity}; const calendar = { ...entity};
Object.assign(calendar, {thirdParties: entity.professionals}); Object.assign(calendar, {thirdParties: entity.professionals});
if (entity.startDate !== null ) { if (entity.startDate !== null ) {

View File

@ -40,11 +40,9 @@ import {
VNodeProps VNodeProps
} from 'vue' } from 'vue'
const Teleport = teleport_ as { const Teleport = teleport_ as new () => {
new (): {
$props: VNodeProps & TeleportProps $props: VNodeProps & TeleportProps
} }
}
const store = useStore(key); const store = useStore(key);

View File

@ -16,7 +16,7 @@ export interface CalendarLocalsState {
type Context = ActionContext<CalendarLocalsState, State>; type Context = ActionContext<CalendarLocalsState, State>;
export default <Module<CalendarLocalsState, State>> { export default {
namespaced: true, namespaced: true,
state: (): CalendarLocalsState => ({ state: (): CalendarLocalsState => ({
locals: [], locals: [],
@ -26,7 +26,7 @@ export default <Module<CalendarLocalsState, State>> {
}), }),
getters: { getters: {
isLocalsLoaded: (state: CalendarLocalsState) => ({start, end}: {start: Date, end: Date}): boolean => { isLocalsLoaded: (state: CalendarLocalsState) => ({start, end}: {start: Date, end: Date}): boolean => {
for (let range of state.localsLoaded) { for (const range of state.localsLoaded) {
if (start.getTime() === range.start && end.getTime() === range.end) { if (start.getTime() === range.start && end.getTime() === range.end) {
return true; return true;
} }
@ -92,4 +92,4 @@ export default <Module<CalendarLocalsState, State>> {
}); });
} }
} }
}; } as Module<CalendarLocalsState, State>;

View File

@ -22,7 +22,7 @@ export interface CalendarRangesState {
type Context = ActionContext<CalendarRangesState, State>; type Context = ActionContext<CalendarRangesState, State>;
export default <Module<CalendarRangesState, State>>{ export default {
namespaced: true, namespaced: true,
state: (): CalendarRangesState => ({ state: (): CalendarRangesState => ({
ranges: [], ranges: [],
@ -32,7 +32,7 @@ export default <Module<CalendarRangesState, State>>{
}), }),
getters: { getters: {
isRangeLoaded: (state: CalendarRangesState) => ({start, end}: { start: Date, end: Date }): boolean => { isRangeLoaded: (state: CalendarRangesState) => ({start, end}: { start: Date, end: Date }): boolean => {
for (let range of state.rangesLoaded) { for (const range of state.rangesLoaded) {
if (start.getTime() === range.start && end.getTime() === range.end) { if (start.getTime() === range.start && end.getTime() === range.end) {
return true; return true;
} }
@ -42,9 +42,9 @@ export default <Module<CalendarRangesState, State>>{
}, },
getRangesOnDate: (state: CalendarRangesState) => (date: Date): EventInputCalendarRange[] => { getRangesOnDate: (state: CalendarRangesState) => (date: Date): EventInputCalendarRange[] => {
const founds = []; const founds = [];
const dateStr = <string>dateToISO(date); const dateStr = dateToISO(date) as string;
for (let range of state.ranges) { for (const range of state.ranges) {
if (isEventInputCalendarRange(range) if (isEventInputCalendarRange(range)
&& range.start.startsWith(dateStr) && range.start.startsWith(dateStr)
) { ) {
@ -56,11 +56,11 @@ export default <Module<CalendarRangesState, State>>{
}, },
getRangesOnWeek: (state: CalendarRangesState) => (mondayDate: Date): EventInputCalendarRange[] => { getRangesOnWeek: (state: CalendarRangesState) => (mondayDate: Date): EventInputCalendarRange[] => {
const founds = []; const founds = [];
for (let d of Array.from(Array(7).keys())) { for (const d of Array.from(Array(7).keys())) {
const dateOfWeek = new Date(mondayDate); const dateOfWeek = new Date(mondayDate);
dateOfWeek.setDate(mondayDate.getDate() + d); dateOfWeek.setDate(mondayDate.getDate() + d);
const dateStr = <string>dateToISO(dateOfWeek); const dateStr = dateToISO(dateOfWeek) as string;
for (let range of state.ranges) { for (const range of state.ranges) {
if (isEventInputCalendarRange(range) if (isEventInputCalendarRange(range)
&& range.start.startsWith(dateStr) && range.start.startsWith(dateStr)
) { ) {
@ -253,12 +253,12 @@ export default <Module<CalendarRangesState, State>>{
const rangesToCopy: EventInputCalendarRange[] = ctx.getters['getRangesOnDate'](from); const rangesToCopy: EventInputCalendarRange[] = ctx.getters['getRangesOnDate'](from);
const promises = []; const promises = [];
for (let r of rangesToCopy) { for (const r of rangesToCopy) {
let start = new Date(<Date>ISOToDatetime(r.start)); const start = new Date((ISOToDatetime(r.start) as Date));
start.setFullYear(to.getFullYear(), to.getMonth(), to.getDate()); start.setFullYear(to.getFullYear(), to.getMonth(), to.getDate());
let end = new Date(<Date>ISOToDatetime(r.end)); const end = new Date((ISOToDatetime(r.end) as Date));
end.setFullYear(to.getFullYear(), to.getMonth(), to.getDate()); end.setFullYear(to.getFullYear(), to.getMonth(), to.getDate());
let location = ctx.rootGetters['locations/getLocationById'](r.locationId); const location = ctx.rootGetters['locations/getLocationById'](r.locationId);
promises.push(ctx.dispatch('createRange', {start, end, location})); promises.push(ctx.dispatch('createRange', {start, end, location}));
} }
@ -270,12 +270,12 @@ export default <Module<CalendarRangesState, State>>{
const rangesToCopy: EventInputCalendarRange[] = ctx.getters['getRangesOnWeek'](fromMonday); const rangesToCopy: EventInputCalendarRange[] = ctx.getters['getRangesOnWeek'](fromMonday);
const promises = []; const promises = [];
const diffTime = toMonday.getTime() - fromMonday.getTime(); const diffTime = toMonday.getTime() - fromMonday.getTime();
for (let r of rangesToCopy) { for (const r of rangesToCopy) {
let start = new Date(<Date>ISOToDatetime(r.start)); const start = new Date((ISOToDatetime(r.start) as Date));
let end = new Date(<Date>ISOToDatetime(r.end)); const end = new Date((ISOToDatetime(r.end) as Date));
start.setTime(start.getTime() + diffTime); start.setTime(start.getTime() + diffTime);
end.setTime(end.getTime() + diffTime); end.setTime(end.getTime() + diffTime);
let location = ctx.rootGetters['locations/getLocationById'](r.locationId); const location = ctx.rootGetters['locations/getLocationById'](r.locationId);
promises.push(ctx.dispatch('createRange', {start, end, location})); promises.push(ctx.dispatch('createRange', {start, end, location}));
} }
@ -283,4 +283,4 @@ export default <Module<CalendarRangesState, State>>{
return Promise.all(promises).then(_ => Promise.resolve(null)); return Promise.all(promises).then(_ => Promise.resolve(null));
} }
} }
}; } as Module<CalendarRangesState, State>;

View File

@ -16,7 +16,7 @@ export interface CalendarRemotesState {
type Context = ActionContext<CalendarRemotesState, State>; type Context = ActionContext<CalendarRemotesState, State>;
export default <Module<CalendarRemotesState, State>> { export default {
namespaced: true, namespaced: true,
state: (): CalendarRemotesState => ({ state: (): CalendarRemotesState => ({
remotes: [], remotes: [],
@ -26,7 +26,7 @@ export default <Module<CalendarRemotesState, State>> {
}), }),
getters: { getters: {
isRemotesLoaded: (state: CalendarRemotesState) => ({start, end}: {start: Date, end: Date}): boolean => { isRemotesLoaded: (state: CalendarRemotesState) => ({start, end}: {start: Date, end: Date}): boolean => {
for (let range of state.remotesLoaded) { for (const range of state.remotesLoaded) {
if (start.getTime() === range.start && end.getTime() === range.end) { if (start.getTime() === range.start && end.getTime() === range.end) {
return true; return true;
} }
@ -92,4 +92,4 @@ export default <Module<CalendarRemotesState, State>> {
}); });
} }
} }
}; } as Module<CalendarRemotesState, State>;

View File

@ -10,7 +10,7 @@ export interface LocationState {
currentLocation: Location | null; currentLocation: Location | null;
} }
export default <Module<LocationState, State>>{ export default {
namespaced: true, namespaced: true,
state: (): LocationState => { state: (): LocationState => {
return { return {
@ -58,5 +58,5 @@ export default <Module<LocationState, State>>{
}) })
} }
} }
} } as Module<LocationState, State>

View File

@ -68,10 +68,10 @@ window.addEventListener('DOMContentLoaded', () => {
upload_inputs.forEach((input: HTMLDivElement): void => { upload_inputs.forEach((input: HTMLDivElement): void => {
// test for a parent to check if this is a collection entry // test for a parent to check if this is a collection entry
let collectionEntry: null|HTMLLIElement = null; let collectionEntry: null|HTMLLIElement = null;
let parent = input.parentElement; const parent = input.parentElement;
console.log('parent', parent); console.log('parent', parent);
if (null !== parent) { if (null !== parent) {
let grandParent = parent.parentElement; const grandParent = parent.parentElement;
console.log('grandParent', grandParent); console.log('grandParent', grandParent);
if (null !== grandParent) { if (null !== grandParent) {
if (grandParent.tagName.toLowerCase() === 'li' && grandParent.classList.contains('entry')) { if (grandParent.tagName.toLowerCase() === 'li' && grandParent.classList.contains('entry')) {

View File

@ -43,9 +43,7 @@ export interface StoredObjectStatusChange {
/** /**
* Function executed by the WopiEditButton component. * Function executed by the WopiEditButton component.
*/ */
export type WopiEditButtonExecutableBeforeLeaveFunction = { export type WopiEditButtonExecutableBeforeLeaveFunction = () => Promise<void>
(): Promise<void>
}
/** /**
* Object containing information for performering a POST request to a swift object store * Object containing information for performering a POST request to a swift object store

View File

@ -73,9 +73,7 @@ interface DocumentActionButtonsGroupConfig {
davLinkExpiration?: number, davLinkExpiration?: number,
} }
const emit = defineEmits<{ const emit = defineEmits<(e: 'onStoredObjectStatusChange', newStatus: StoredObjectStatusChange) => void>();
(e: 'onStoredObjectStatusChange', newStatus: StoredObjectStatusChange): void
}>();
const props = withDefaults(defineProps<DocumentActionButtonsGroupConfig>(), { const props = withDefaults(defineProps<DocumentActionButtonsGroupConfig>(), {
small: false, small: false,

View File

@ -10,9 +10,7 @@ interface DropFileConfig {
const props = defineProps<DropFileConfig>(); const props = defineProps<DropFileConfig>();
const emit = defineEmits<{ const emit = defineEmits<(e: 'addDocument', stored_object: StoredObjectCreated) => void,>();
(e: 'addDocument', stored_object: StoredObjectCreated): void,
}>();
const is_dragging: Ref<boolean> = ref(false); const is_dragging: Ref<boolean> = ref(false);
const uploading: Ref<boolean> = ref(false); const uploading: Ref<boolean> = ref(false);

View File

@ -14,7 +14,7 @@ import {StoredObject, StoredObjectCreated} from "../../types";
interface ConvertButtonConfig { interface ConvertButtonConfig {
storedObject: StoredObject, storedObject: StoredObject,
classes: { [key: string]: boolean}, classes: Record<string, boolean>,
filename?: string, filename?: string,
}; };

View File

@ -5,7 +5,7 @@ import {computed, reactive} from "vue";
export interface DesktopEditButtonConfig { export interface DesktopEditButtonConfig {
editLink: null, editLink: null,
classes: { [k: string]: boolean }, classes: Record<string, boolean>,
expirationLink: number|Date, expirationLink: number|Date,
} }

View File

@ -17,7 +17,7 @@ import {StoredObject, StoredObjectCreated} from "../../types";
interface DownloadButtonConfig { interface DownloadButtonConfig {
storedObject: StoredObject|StoredObjectCreated, storedObject: StoredObject|StoredObjectCreated,
classes: { [k: string]: boolean }, classes: Record<string, boolean>,
filename?: string, filename?: string,
} }

View File

@ -13,7 +13,7 @@ import {StoredObject, StoredObjectCreated, WopiEditButtonExecutableBeforeLeaveFu
interface WopiEditButtonConfig { interface WopiEditButtonConfig {
storedObject: StoredObject, storedObject: StoredObject,
returnPath?: string, returnPath?: string,
classes: {[k: string] : boolean}, classes: Record<string, boolean>,
executeBeforeLeave?: WopiEditButtonExecutableBeforeLeaveFunction, executeBeforeLeave?: WopiEditButtonExecutableBeforeLeaveFunction,
} }

View File

@ -11,8 +11,8 @@ const keyDefinition = {
}; };
const createFilename = (): string => { const createFilename = (): string => {
var text = ""; let text = "";
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; const possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
for (let i = 0; i < 7; i++) { for (let i = 0; i < 7; i++) {
text += possible.charAt(Math.floor(Math.random() * possible.length)); text += possible.charAt(Math.floor(Math.random() * possible.length));

View File

@ -37,7 +37,7 @@ export const ISOToDate = (str: string|null): Date|null => {
return null; return null;
} }
let const
[year, month, day] = str.split('-').map(p => parseInt(p)); [year, month, day] = str.split('-').map(p => parseInt(p));
return new Date(year, month-1, day, 0, 0, 0, 0); return new Date(year, month-1, day, 0, 0, 0, 0);
@ -52,7 +52,7 @@ export const ISOToDatetime = (str: string|null): Date|null => {
return null; return null;
} }
let const
[cal, times] = str.split('T'), [cal, times] = str.split('T'),
[year, month, date] = cal.split('-').map(s => parseInt(s)), [year, month, date] = cal.split('-').map(s => parseInt(s)),
[time, timezone] = times.split(times.charAt(8)), [time, timezone] = times.split(times.charAt(8)),
@ -91,7 +91,7 @@ export const datetimeToISO = (date: Date): string => {
Math.abs(date.getTimezoneOffset() % 60).toString().padStart(2, '0'), Math.abs(date.getTimezoneOffset() % 60).toString().padStart(2, '0'),
].join(''); ].join('');
let x = cal + 'T' + time + offset; const x = cal + 'T' + time + offset;
return x; return x;
}; };

View File

@ -1,11 +1,9 @@
import {Scope} from '../../types'; import {Scope} from '../../types';
export type body = {[key: string]: boolean|string|number|null}; export type body = Record<string, boolean|string|number|null>;
export type fetchOption = {[key: string]: boolean|string|number|null}; export type fetchOption = Record<string, boolean|string|number|null>;
export interface Params { export type Params = Record<string, number|string>;
[key: string]: number|string
}
export interface PaginationResponse<T> { export interface PaginationResponse<T> {
pagination: { pagination: {
@ -16,9 +14,7 @@ export interface PaginationResponse<T> {
count: number; count: number;
} }
export interface FetchParams { export type FetchParams = Record<string, string|number|null>;;
[K: string]: string|number|null;
};
export interface TransportExceptionInterface { export interface TransportExceptionInterface {
name: string; name: string;
@ -118,15 +114,15 @@ export const makeFetch = <Input, Output>(
* Fetch results with certain parameters * Fetch results with certain parameters
*/ */
function _fetchAction<T>(page: number, uri: string, params?: FetchParams): Promise<PaginationResponse<T>> { function _fetchAction<T>(page: number, uri: string, params?: FetchParams): Promise<PaginationResponse<T>> {
const item_per_page: number = 50; const item_per_page = 50;
let searchParams = new URLSearchParams(); const searchParams = new URLSearchParams();
searchParams.append('item_per_page', item_per_page.toString()); searchParams.append('item_per_page', item_per_page.toString());
searchParams.append('page', page.toString()); searchParams.append('page', page.toString());
if (params !== undefined) { if (params !== undefined) {
Object.keys(params).forEach(key => { Object.keys(params).forEach(key => {
let v = params[key]; const v = params[key];
if (typeof v === 'string') { if (typeof v === 'string') {
searchParams.append(key, v); searchParams.append(key, v);
} else if (typeof v === 'number') { } else if (typeof v === 'number') {
@ -137,7 +133,7 @@ function _fetchAction<T>(page: number, uri: string, params?: FetchParams): Promi
}); });
} }
let url = uri + '?' + searchParams.toString(); const url = uri + '?' + searchParams.toString();
return fetch(url, { return fetch(url, {
method: 'GET', method: 'GET',
@ -177,7 +173,7 @@ function _fetchAction<T>(page: number, uri: string, params?: FetchParams): Promi
export const fetchResults = async<T> (uri: string, params?: FetchParams): Promise<T[]> => { export const fetchResults = async<T> (uri: string, params?: FetchParams): Promise<T[]> => {
let promises: Promise<T[]>[] = [], let promises: Promise<T[]>[] = [],
page = 1; page = 1;
let firstData: PaginationResponse<T> = await _fetchAction(page, uri, params) as PaginationResponse<T>; const firstData: PaginationResponse<T> = await _fetchAction(page, uri, params) as PaginationResponse<T>;
promises.push(Promise.resolve(firstData.results)); promises.push(Promise.resolve(firstData.results));

View File

@ -41,7 +41,7 @@ export class CollectionEventPayload {
} }
export const handleAdd = (button: any): void => { export const handleAdd = (button: any): void => {
let const
form_name = button.dataset.collectionAddTarget, form_name = button.dataset.collectionAddTarget,
prototype = button.dataset.formPrototype, prototype = button.dataset.formPrototype,
collection: HTMLUListElement | null = document.querySelector('ul[data-collection-name="' + form_name + '"]'); collection: HTMLUListElement | null = document.querySelector('ul[data-collection-name="' + form_name + '"]');
@ -50,7 +50,7 @@ export const handleAdd = (button: any): void => {
return; return;
} }
let const
empty_explain: HTMLLIElement | null = collection.querySelector('li[data-collection-empty-explain]'), empty_explain: HTMLLIElement | null = collection.querySelector('li[data-collection-empty-explain]'),
entry = document.createElement('li'), entry = document.createElement('li'),
counter = collection.querySelectorAll('li.entry').length, // Updated counter logic counter = collection.querySelectorAll('li.entry').length, // Updated counter logic
@ -85,7 +85,7 @@ const initializeRemove = (collection: HTMLUListElement, entry: HTMLLIElement): v
export const buildRemoveButton = (collection: HTMLUListElement, entry: HTMLLIElement): HTMLButtonElement|null => { export const buildRemoveButton = (collection: HTMLUListElement, entry: HTMLLIElement): HTMLButtonElement|null => {
let const
button = document.createElement('button'), button = document.createElement('button'),
isPersisted = entry.dataset.collectionIsPersisted || '', isPersisted = entry.dataset.collectionIsPersisted || '',
content = collection.dataset.collectionButtonRemoveLabel || '', content = collection.dataset.collectionButtonRemoveLabel || '',
@ -108,19 +108,19 @@ export const buildRemoveButton = (collection: HTMLUListElement, entry: HTMLLIEle
} }
window.addEventListener('load', () => { window.addEventListener('load', () => {
let const
addButtons: NodeListOf<HTMLButtonElement> = document.querySelectorAll("button[data-collection-add-target]"), addButtons: NodeListOf<HTMLButtonElement> = document.querySelectorAll("button[data-collection-add-target]"),
collections: NodeListOf<HTMLUListElement> = document.querySelectorAll("ul[data-collection-regular]"); collections: NodeListOf<HTMLUListElement> = document.querySelectorAll("ul[data-collection-regular]");
for (let i = 0; i < addButtons.length; i++) { for (let i = 0; i < addButtons.length; i++) {
let addButton = addButtons[i]; const addButton = addButtons[i];
addButton.addEventListener('click', (e: Event) => { addButton.addEventListener('click', (e: Event) => {
e.preventDefault(); e.preventDefault();
handleAdd(e.target); handleAdd(e.target);
}); });
} }
for (let i = 0; i < collections.length; i++) { for (let i = 0; i < collections.length; i++) {
let entries: NodeListOf<HTMLLIElement> = collections[i].querySelectorAll(':scope > li'); const entries: NodeListOf<HTMLLIElement> = collections[i].querySelectorAll(':scope > li');
for (let j = 0; j < entries.length; j++) { for (let j = 0; j < entries.length; j++) {
if (entries[j].dataset.collectionEmptyExplain === "1") { if (entries[j].dataset.collectionEmptyExplain === "1") {
continue; continue;

View File

@ -47,7 +47,7 @@ export interface UserAssociatedInterface {
id: number; id: number;
}; };
export type TranslatableString = { export interface TranslatableString {
fr?: string; fr?: string;
nl?: string; nl?: string;
} }
@ -59,7 +59,7 @@ export interface Postcode {
center: Point; center: Point;
} }
export type Point = { export interface Point {
type: "Point"; type: "Point";
coordinates: [lat: number, lon: number]; coordinates: [lat: number, lon: number];
} }

View File

@ -32,9 +32,7 @@ const data: AddressModalData = reactive({
const props = defineProps<AddressModalContentProps>(); const props = defineProps<AddressModalContentProps>();
const emit = defineEmits<{ const emit = defineEmits<(e: 'update-address', value: Address) => void>();
(e: 'update-address', value: Address): void
}>();
const address_modal = ref<InstanceType<typeof AddressModal> | null>(null); const address_modal = ref<InstanceType<typeof AddressModal> | null>(null);

View File

@ -18,9 +18,7 @@ interface AddressModalContentProps {
const props = defineProps<AddressModalContentProps>(); const props = defineProps<AddressModalContentProps>();
const emit = defineEmits<{ const emit = defineEmits<(e: 'update-address', value: Address) => void>();
(e: 'update-address', value: Address): void
}>();
const onUpdateAddress = (address: Address): void => { const onUpdateAddress = (address: Address): void => {
emit('update-address', address); emit('update-address', address);

View File

@ -27,9 +27,7 @@ interface AddressModalState {
const props = defineProps<AddressModalProps>(); const props = defineProps<AddressModalProps>();
const emit = defineEmits<{ const emit = defineEmits<(e: 'update-address', value: Address) => void>();
(e: 'update-address', value: Address): void
}>();
const state: AddressModalState = reactive({show_modal: false}); const state: AddressModalState = reactive({show_modal: false});

View File

@ -53,9 +53,7 @@ export interface AddressDetailsRefMatchingProps {
const props = defineProps<AddressDetailsRefMatchingProps>(); const props = defineProps<AddressDetailsRefMatchingProps>();
const emit = defineEmits<{ const emit = defineEmits<(e: 'update-address', value: Address) => void>();
(e: 'update-address', value: Address): void
}>();
const applyUpdate = async () => { const applyUpdate = async () => {
const new_address = await syncAddressWithReference(props.address); const new_address = await syncAddressWithReference(props.address);

View File

@ -98,7 +98,6 @@
import ToggleFlags from './Banner/ToggleFlags'; import ToggleFlags from './Banner/ToggleFlags';
import SocialIssue from './Banner/SocialIssue.vue'; import SocialIssue from './Banner/SocialIssue.vue';
import PersonsAssociated from './Banner/PersonsAssociated.vue'; import PersonsAssociated from './Banner/PersonsAssociated.vue';
import UserRenderBoxBadge from 'ChillMainAssets/vuejs/_components/Entity/UserRenderBoxBadge.vue';
export default { export default {
name: 'Banner', name: 'Banner',
@ -106,7 +105,6 @@ export default {
ToggleFlags, ToggleFlags,
SocialIssue, SocialIssue,
PersonsAssociated, PersonsAssociated,
UserRenderBoxBadge,
}, },
computed: { computed: {
accompanyingCourse() { accompanyingCourse() {

View File

@ -106,7 +106,6 @@
<script> <script>
import OnTheFly from 'ChillMainAssets/vuejs/OnTheFly/components/OnTheFly.vue'; import OnTheFly from 'ChillMainAssets/vuejs/OnTheFly/components/OnTheFly.vue';
import ButtonLocation from '../ButtonLocation.vue';
import PersonRenderBox from 'ChillPersonAssets/vuejs/_components/Entity/PersonRenderBox.vue'; import PersonRenderBox from 'ChillPersonAssets/vuejs/_components/Entity/PersonRenderBox.vue';
import ThirdPartyRenderBox from 'ChillThirdPartyAssets/vuejs/_components/Entity/ThirdPartyRenderBox.vue'; import ThirdPartyRenderBox from 'ChillThirdPartyAssets/vuejs/_components/Entity/ThirdPartyRenderBox.vue';
import WriteComment from './WriteComment'; import WriteComment from './WriteComment';
@ -116,7 +115,6 @@ export default {
name: 'ResourceItem', name: 'ResourceItem',
components: { components: {
OnTheFly, OnTheFly,
ButtonLocation,
PersonRenderBox, PersonRenderBox,
ThirdPartyRenderBox, ThirdPartyRenderBox,
WriteComment WriteComment

View File

@ -520,12 +520,9 @@ import ClassicEditor from 'ChillMainAssets/module/ckeditor5/editor_config';
import AddResult from './components/AddResult.vue'; import AddResult from './components/AddResult.vue';
import AddEvaluation from './components/AddEvaluation.vue'; import AddEvaluation from './components/AddEvaluation.vue';
import AddPersons from 'ChillPersonAssets/vuejs/_components/AddPersons.vue'; import AddPersons from 'ChillPersonAssets/vuejs/_components/AddPersons.vue';
import AddressRenderBox from 'ChillMainAssets/vuejs/_components/Entity/AddressRenderBox.vue';
import ThirdPartyRenderBox from 'ChillThirdPartyAssets/vuejs/_components/Entity/ThirdPartyRenderBox.vue'; import ThirdPartyRenderBox from 'ChillThirdPartyAssets/vuejs/_components/Entity/ThirdPartyRenderBox.vue';
import PickTemplate from 'ChillDocGeneratorAssets/vuejs/_components/PickTemplate.vue';
import OnTheFly from 'ChillMainAssets/vuejs/OnTheFly/components/OnTheFly.vue'; import OnTheFly from 'ChillMainAssets/vuejs/OnTheFly/components/OnTheFly.vue';
import ListWorkflowModal from 'ChillMainAssets/vuejs/_components/EntityWorkflow/ListWorkflowModal.vue'; import ListWorkflowModal from 'ChillMainAssets/vuejs/_components/EntityWorkflow/ListWorkflowModal.vue';
import PickWorkflow from 'ChillMainAssets/vuejs/_components/EntityWorkflow/PickWorkflow.vue';
import PersonText from 'ChillPersonAssets/vuejs/_components/Entity/PersonText.vue'; import PersonText from 'ChillPersonAssets/vuejs/_components/Entity/PersonText.vue';
import {buildLinkCreate} from 'ChillMainAssets/lib/entity-workflow/api.js'; import {buildLinkCreate} from 'ChillMainAssets/lib/entity-workflow/api.js';
import { makeFetch } from 'ChillMainAssets/lib/api/apiMethods'; import { makeFetch } from 'ChillMainAssets/lib/api/apiMethods';
@ -586,12 +583,9 @@ export default {
AddResult, AddResult,
AddEvaluation, AddEvaluation,
AddPersons, AddPersons,
AddressRenderBox,
ThirdPartyRenderBox, ThirdPartyRenderBox,
PickTemplate,
ListWorkflowModal, ListWorkflowModal,
OnTheFly, OnTheFly,
PickWorkflow,
PersonText, PersonText,
}, },
i18n, i18n,

View File

@ -259,14 +259,13 @@
</template> </template>
<script> <script>
import {dateToISO, ISOToDate, ISOToDatetime} from 'ChillMainAssets/chill/js/date'; import {ISOToDatetime} from 'ChillMainAssets/chill/js/date';
import CKEditor from '@ckeditor/ckeditor5-vue'; import CKEditor from '@ckeditor/ckeditor5-vue';
import ClassicEditor from 'ChillMainAssets/module/ckeditor5/editor_config'; import ClassicEditor from 'ChillMainAssets/module/ckeditor5/editor_config';
import { mapGetters, mapState } from 'vuex'; import { mapState } from 'vuex';
import PickTemplate from 'ChillDocGeneratorAssets/vuejs/_components/PickTemplate.vue'; import PickTemplate from 'ChillDocGeneratorAssets/vuejs/_components/PickTemplate.vue';
import {buildLink} from 'ChillDocGeneratorAssets/lib/document-generator'; import {buildLink} from 'ChillDocGeneratorAssets/lib/document-generator';
import AddAsyncUpload from 'ChillDocStoreAssets/vuejs/_components/AddAsyncUpload.vue'; import AddAsyncUpload from 'ChillDocStoreAssets/vuejs/_components/AddAsyncUpload.vue';
import AddAsyncUploadDownloader from 'ChillDocStoreAssets/vuejs/_components/AddAsyncUploadDownloader.vue';
import ListWorkflowModal from 'ChillMainAssets/vuejs/_components/EntityWorkflow/ListWorkflowModal.vue'; import ListWorkflowModal from 'ChillMainAssets/vuejs/_components/EntityWorkflow/ListWorkflowModal.vue';
import {buildLinkCreate} from 'ChillMainAssets/lib/entity-workflow/api.js'; import {buildLinkCreate} from 'ChillMainAssets/lib/entity-workflow/api.js';
import {buildLinkCreate as buildLinkCreateNotification} from 'ChillMainAssets/lib/entity-notification/api'; import {buildLinkCreate as buildLinkCreateNotification} from 'ChillMainAssets/lib/entity-notification/api';
@ -312,7 +311,6 @@ export default {
ckeditor: CKEditor.component, ckeditor: CKEditor.component,
PickTemplate, PickTemplate,
AddAsyncUpload, AddAsyncUpload,
AddAsyncUploadDownloader,
ListWorkflowModal, ListWorkflowModal,
DocumentActionButtonsGroup, DocumentActionButtonsGroup,
}, },

View File

@ -1,7 +1,5 @@
import { createStore } from 'vuex'; import { createStore } from 'vuex';
import { dateToISO, ISOToDate, datetimeToISO, ISOToDatetime, intervalDaysToISO, intervalISOToDays } from 'ChillMainAssets/chill/js/date'; import { dateToISO, ISOToDate, datetimeToISO, intervalDaysToISO, intervalISOToDays } from 'ChillMainAssets/chill/js/date';
import { findSocialActionsBySocialIssue } from 'ChillPersonAssets/vuejs/_api/SocialWorkSocialAction.js';
import { create } from 'ChillPersonAssets/vuejs/_api/AccompanyingCourseWork.js';
import { fetchResults, makeFetch } from 'ChillMainAssets/lib/api/apiMethods.ts'; import { fetchResults, makeFetch } from 'ChillMainAssets/lib/api/apiMethods.ts';
import { fetchTemplates } from 'ChillDocGeneratorAssets/api/pickTemplate.js'; import { fetchTemplates } from 'ChillDocGeneratorAssets/api/pickTemplate.js';

View File

@ -269,17 +269,13 @@ export default {
}).catch; }).catch;
}, },
/** // selectResult(value) {
* Select/unselect in Result Multiselect
* @param value
*/
selectResult(value) {
//console.log('----'); console.log('select result', value.id); //console.log('----'); console.log('select result', value.id);
}, // },
unselectResult(value) { // unselectResult(value) {
//console.log('----'); console.log('unselect result', value.id); //console.log('----'); console.log('unselect result', value.id);
}, // },
/** /**
* Choose parent action will involve retaining the "children" actions. * Choose parent action will involve retaining the "children" actions.

View File

@ -65,7 +65,7 @@
<script> <script>
import {mapGetters, mapState} from 'vuex'; import {mapState} from 'vuex';
import Concerned from './components/Concerned.vue'; import Concerned from './components/Concerned.vue';
import Household from './components/Household.vue'; import Household from './components/Household.vue';
import HouseholdAddress from './components/HouseholdAddress'; import HouseholdAddress from './components/HouseholdAddress';

View File

@ -72,14 +72,12 @@
<script> <script>
import { mapState, mapGetters } from 'vuex'; import { mapState, mapGetters } from 'vuex';
import AddPersons from 'ChillPersonAssets/vuejs/_components/AddPersons.vue'; import AddPersons from 'ChillPersonAssets/vuejs/_components/AddPersons.vue';
import PersonRenderBox from 'ChillPersonAssets/vuejs/_components/Entity/PersonRenderBox.vue';
import PersonText from 'ChillPersonAssets/vuejs/_components/Entity/PersonText.vue'; import PersonText from 'ChillPersonAssets/vuejs/_components/Entity/PersonText.vue';
export default { export default {
name: 'Concerned', name: 'Concerned',
components: { components: {
AddPersons, AddPersons,
PersonRenderBox,
PersonText, PersonText,
}, },
computed: { computed: {

View File

@ -52,7 +52,6 @@
import MemberDetails from './MemberDetails.vue'; import MemberDetails from './MemberDetails.vue';
import {mapGetters, mapState} from "vuex"; import {mapGetters, mapState} from "vuex";
import CurrentHousehold from "./CurrentHousehold"; import CurrentHousehold from "./CurrentHousehold";
import PersonRenderBox from 'ChillPersonAssets/vuejs/_components/Entity/PersonRenderBox.vue';
import PersonComment from './PersonComment'; import PersonComment from './PersonComment';
import PersonText from '../../_components/Entity/PersonText.vue'; import PersonText from '../../_components/Entity/PersonText.vue';
@ -60,7 +59,6 @@ export default {
name: "Positioning", name: "Positioning",
components: { components: {
CurrentHousehold, CurrentHousehold,
PersonRenderBox,
PersonComment, PersonComment,
PersonText PersonText
}, },

View File

@ -382,7 +382,7 @@ const store = createStore({
state.household.current_address = address; state.household.current_address = address;
state.forceHouseholdNoAddress = false; state.forceHouseholdNoAddress = false;
}, },
removeHouseholdAddress(state, address) { removeHouseholdAddress(state) {
if (null === state.household) { if (null === state.household) {
console.error("no household"); console.error("no household");
throw new Error("No household"); throw new Error("No household");
@ -455,7 +455,7 @@ const store = createStore({
dispatch('computeWarnings'); dispatch('computeWarnings');
dispatch('fetchAddressSuggestions'); dispatch('fetchAddressSuggestions');
}, },
markPosition({ commit, state, dispatch }, { person_id, position_id }) { markPosition({ commit, dispatch }, { person_id, position_id }) {
commit('markPosition', { person_id, position_id }); commit('markPosition', { person_id, position_id });
dispatch('computeWarnings'); dispatch('computeWarnings');
}, },
@ -504,7 +504,7 @@ const store = createStore({
setHouseholdCompositionType({ commit }, payload) { setHouseholdCompositionType({ commit }, payload) {
commit('setHouseholdCompositionType', payload); commit('setHouseholdCompositionType', payload);
}, },
fetchHouseholdSuggestionForConcerned({ commit, state }, person) { fetchHouseholdSuggestionForConcerned({ commit }, person) {
fetchHouseholdSuggestionByAccompanyingPeriod(person.id) fetchHouseholdSuggestionByAccompanyingPeriod(person.id)
.then(households => { .then(households => {
commit('addHouseholdSuggestionByAccompanyingPeriod', households); commit('addHouseholdSuggestionByAccompanyingPeriod', households);
@ -535,8 +535,7 @@ const store = createStore({
}); });
}, },
computeWarnings({ commit, state, getters }) { computeWarnings({ commit, state, getters }) {
let warnings = [], let warnings = []
payload;
if (!getters.hasHousehold && !state.forceLeaveWithoutHousehold) { if (!getters.hasHousehold && !state.forceLeaveWithoutHousehold) {
warnings.push({ m: 'household_members_editor.add_destination', a: {} }); warnings.push({ m: 'household_members_editor.add_destination', a: {} });
@ -553,7 +552,7 @@ const store = createStore({
commit('setWarnings', warnings); commit('setWarnings', warnings);
}, },
confirm({ getters, state, commit }) { confirm({ getters, commit }) {
let payload = getters.buildPayload, let payload = getters.buildPayload,
errors = [], errors = [],
person_id, person_id,

View File

@ -38,7 +38,7 @@ const patchFetch = (url, body) => {
* @param body * @param body
* @returns {Promise<Response>} * @returns {Promise<Response>}
*/ */
const deleteFetch = (url, body) => { const deleteFetch = (url) => {
return makeFetch('DELETE', url, null) return makeFetch('DELETE', url, null)
} }

View File

@ -1,6 +1,6 @@
import { createStore } from 'vuex' import { createStore } from 'vuex'
import { getHouseholdByPerson, getCoursesByPerson, getRelationshipsByPerson } from './api' import { getHouseholdByPerson, getCoursesByPerson, getRelationshipsByPerson } from './api'
import { getHouseholdLabel, getHouseholdWidth, getRelationshipLabel, getRelationshipTitle, getRelationshipDirection, splitId, getAge } from './vis-network' import { getHouseholdWidth, getRelationshipLabel, getRelationshipTitle, getRelationshipDirection, splitId, getAge } from './vis-network'
import {visMessages} from "./i18n"; import {visMessages} from "./i18n";
import { darkBlue, darkBrown, darkGreen, lightBlue, lightBrown, lightGreen } from './colors'; import { darkBlue, darkBrown, darkGreen, lightBlue, lightBrown, lightGreen } from './colors';
@ -364,7 +364,6 @@ const store = createStore({
color: lightBrown, color: lightBrown,
font: { color: darkBrown }, font: { color: darkBrown },
dashes: (getHouseholdWidth(m) === 1)? [0,4] : false, //edge style: [dash, gap, dash, gap] dashes: (getHouseholdWidth(m) === 1)? [0,4] : false, //edge style: [dash, gap, dash, gap]
//label: getHouseholdLabel(m),
width: getHouseholdWidth(m), width: getHouseholdWidth(m),
}) })
if (!getters.isPersonLoaded(m.person.id)) { if (!getters.isPersonLoaded(m.person.id)) {
@ -378,7 +377,7 @@ const store = createStore({
* @param object * @param object
* @param person * @param person
*/ */
fetchCoursesByPerson({ commit, dispatch }, person) { fetchCoursesByPerson({ dispatch }, person) {
return getCoursesByPerson(person) return getCoursesByPerson(person)
.then(courses => new Promise(resolve => { .then(courses => new Promise(resolve => {
dispatch('addCourses', courses) dispatch('addCourses', courses)
@ -496,7 +495,7 @@ const store = createStore({
* @param object * @param object
* @param array * @param array
*/ */
addMissingPerson({ commit, getters, dispatch }, [person, parent]) { addMissingPerson({ commit, getters }, [person, parent]) {
//console.log('! add missing Person', person.id) //console.log('! add missing Person', person.id)
commit('markPersonLoaded', person.id) commit('markPersonLoaded', person.id)
commit('addPerson', [person, { folded: true }]) commit('addPerson', [person, { folded: true }])

View File

@ -227,7 +227,7 @@ export default {
} }
this.search.currentSearchQueryController = new AbortController(); this.search.currentSearchQueryController = new AbortController();
searchEntities({ query, options: this.options }, this.search.currentSearchQueryController.signal) searchEntities({ query, options: this.options }, this.search.currentSearchQueryController.signal)
.then(suggested => new Promise((resolve, reject) => { .then(suggested => new Promise((resolve) => {
this.loadSuggestions(suggested.results); this.loadSuggestions(suggested.results);
resolve(); resolve();
})) }))

View File

@ -278,21 +278,18 @@
</template> </template>
<script> <script>
import {dateToISO, ISOToDate} from 'ChillMainAssets/chill/js/date'; import {ISOToDate} from 'ChillMainAssets/chill/js/date';
import AddressRenderBox from 'ChillMainAssets/vuejs/_components/Entity/AddressRenderBox.vue'; import AddressRenderBox from 'ChillMainAssets/vuejs/_components/Entity/AddressRenderBox.vue';
import GenderIconRenderBox from 'ChillMainAssets/vuejs/_components/Entity/GenderIconRenderBox.vue' import GenderIconRenderBox from 'ChillMainAssets/vuejs/_components/Entity/GenderIconRenderBox.vue'
import Confidential from 'ChillMainAssets/vuejs/_components/Confidential.vue';
import BadgeEntity from 'ChillMainAssets/vuejs/_components/BadgeEntity.vue'; import BadgeEntity from 'ChillMainAssets/vuejs/_components/BadgeEntity.vue';
import PersonText from 'ChillPersonAssets/vuejs/_components/Entity/PersonText.vue'; import PersonText from 'ChillPersonAssets/vuejs/_components/Entity/PersonText.vue';
import ThirdPartyText from 'ChillThirdPartyAssets/vuejs/_components/Entity/ThirdPartyText.vue'; import ThirdPartyText from 'ChillThirdPartyAssets/vuejs/_components/Entity/ThirdPartyText.vue';
import AddressDetailsButton from "ChillMainAssets/vuejs/_components/AddressDetails/AddressDetailsButton.vue";
export default { export default {
name: "PersonRenderBox", name: "PersonRenderBox",
components: { components: {
AddressRenderBox, AddressRenderBox,
GenderIconRenderBox, GenderIconRenderBox,
Confidential,
BadgeEntity, BadgeEntity,
PersonText, PersonText,
ThirdPartyText ThirdPartyText

View File

@ -6,7 +6,7 @@ import {
} from "../../../../../../ChillDocStoreBundle/Resources/public/types"; } from "../../../../../../ChillDocStoreBundle/Resources/public/types";
async function reload_if_needed(stored_object: StoredObject, i: number): Promise<void> { async function reload_if_needed(stored_object: StoredObject, i: number): Promise<void> {
let current_status = await is_object_ready(stored_object); const current_status = await is_object_ready(stored_object);
if (stored_object.status !== current_status.status) { if (stored_object.status !== current_status.status) {
window.location.reload(); window.location.reload();
@ -19,7 +19,7 @@ function wait_before_reload(stored_object: StoredObject, i: number): void {
/** /**
* value of the timeout. Set to 5 sec during the first 10 minutes, then every 1 minute * value of the timeout. Set to 5 sec during the first 10 minutes, then every 1 minute
*/ */
let timeout = i < 1200 ? 5000 : 60000; const timeout = i < 1200 ? 5000 : 60000;
setTimeout( setTimeout(
reload_if_needed, reload_if_needed,
@ -30,11 +30,11 @@ function wait_before_reload(stored_object: StoredObject, i: number): void {
} }
window.addEventListener('DOMContentLoaded', async function (e) { window.addEventListener('DOMContentLoaded', async function (e) {
if (undefined === (<any>window).stored_object) { if (undefined === (window as any).stored_object) {
console.error('window.stored_object is undefined'); console.error('window.stored_object is undefined');
throw Error('window.stored_object is undefined'); throw Error('window.stored_object is undefined');
} }
let stored_object = JSON.parse((<any>window).stored_object) as StoredObject; const stored_object = JSON.parse((window as any).stored_object) as StoredObject;
reload_if_needed(stored_object, 0); reload_if_needed(stored_object, 0);
}); });