mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Fix of errors: automatic and some manual
This commit is contained in:
parent
90798b12e5
commit
f05c25853c
@ -1,16 +1,16 @@
|
||||
import { ShowHide } from 'ShowHide/show_hide.js';
|
||||
|
||||
var
|
||||
var
|
||||
div_accompagnement = document.getElementById("form_accompagnement"),
|
||||
div_accompagnement_comment = document.getElementById("form_accompagnement_comment"),
|
||||
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
|
||||
new ShowHide({
|
||||
"froms": [div_accompagnement],
|
||||
"test": function(froms, event) {
|
||||
"test": function(froms, event) {
|
||||
for (let el of froms.values()) {
|
||||
for (let input of el.querySelectorAll('input').values()) {
|
||||
if (input.value === 'autre') {
|
||||
@ -18,13 +18,13 @@ new ShowHide({
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
},
|
||||
"container": [div_accompagnement_comment]
|
||||
});
|
||||
|
||||
// let show the date input only if the the id is filled
|
||||
// let show the date input only if the the id is filled
|
||||
new ShowHide({
|
||||
froms: [ div_caf_id ],
|
||||
test: function(froms, event) {
|
||||
|
@ -54,14 +54,15 @@
|
||||
</span>
|
||||
|
||||
<template v-else-if="socialActionsList.length > 0">
|
||||
<check-social-action
|
||||
v-if="socialIssuesSelected.length || socialActionsSelected.length"
|
||||
v-for="action in socialActionsList"
|
||||
:key="action.id"
|
||||
:action="action"
|
||||
:selection="socialActionsSelected"
|
||||
@update-selected="updateActionsSelected"
|
||||
/>
|
||||
<div v-if="socialIssuesSelected.length || socialActionsSelected.length">
|
||||
<check-social-action
|
||||
v-for="action in socialActionsList"
|
||||
:key="action.id"
|
||||
:action="action"
|
||||
:selection="socialActionsSelected"
|
||||
@update-selected="updateActionsSelected"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<span
|
||||
|
@ -46,7 +46,6 @@
|
||||
<teleport to="#fullCalendar">
|
||||
<div class="calendar-actives">
|
||||
<template
|
||||
class=""
|
||||
v-for="u in getActiveUsers"
|
||||
:key="u.id"
|
||||
>
|
||||
|
@ -17,16 +17,16 @@ export interface UserData {
|
||||
}
|
||||
|
||||
export const addIdToValue = (string: string, id: number): string => {
|
||||
let array = string ? string.split(',') : [];
|
||||
const array = string ? string.split(',') : [];
|
||||
array.push(id.toString());
|
||||
let str = array.join();
|
||||
const str = array.join();
|
||||
return str;
|
||||
};
|
||||
|
||||
export const removeIdFromValue = (string: string, id: number) => {
|
||||
let array = string.split(',');
|
||||
array = array.filter(el => el !== id.toString());
|
||||
let str = array.join();
|
||||
const str = array.join();
|
||||
return str;
|
||||
};
|
||||
|
||||
@ -34,7 +34,7 @@ export const removeIdFromValue = (string: string, id: number) => {
|
||||
* Assign missing keys for the ConcernedGroups component
|
||||
*/
|
||||
export const mapEntity = (entity: EventInput): EventInput => {
|
||||
let calendar = { ...entity};
|
||||
const calendar = { ...entity};
|
||||
Object.assign(calendar, {thirdParties: entity.professionals});
|
||||
|
||||
if (entity.startDate !== null ) {
|
||||
|
@ -40,11 +40,9 @@ import {
|
||||
VNodeProps
|
||||
} from 'vue'
|
||||
|
||||
const Teleport = teleport_ as {
|
||||
new (): {
|
||||
const Teleport = teleport_ as new () => {
|
||||
$props: VNodeProps & TeleportProps
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const store = useStore(key);
|
||||
|
@ -16,7 +16,7 @@ export interface CalendarLocalsState {
|
||||
|
||||
type Context = ActionContext<CalendarLocalsState, State>;
|
||||
|
||||
export default <Module<CalendarLocalsState, State>> {
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: (): CalendarLocalsState => ({
|
||||
locals: [],
|
||||
@ -26,7 +26,7 @@ export default <Module<CalendarLocalsState, State>> {
|
||||
}),
|
||||
getters: {
|
||||
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) {
|
||||
return true;
|
||||
}
|
||||
@ -92,4 +92,4 @@ export default <Module<CalendarLocalsState, State>> {
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
} as Module<CalendarLocalsState, State>;
|
||||
|
@ -22,7 +22,7 @@ export interface CalendarRangesState {
|
||||
|
||||
type Context = ActionContext<CalendarRangesState, State>;
|
||||
|
||||
export default <Module<CalendarRangesState, State>>{
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: (): CalendarRangesState => ({
|
||||
ranges: [],
|
||||
@ -32,7 +32,7 @@ export default <Module<CalendarRangesState, State>>{
|
||||
}),
|
||||
getters: {
|
||||
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) {
|
||||
return true;
|
||||
}
|
||||
@ -42,9 +42,9 @@ export default <Module<CalendarRangesState, State>>{
|
||||
},
|
||||
getRangesOnDate: (state: CalendarRangesState) => (date: Date): EventInputCalendarRange[] => {
|
||||
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)
|
||||
&& range.start.startsWith(dateStr)
|
||||
) {
|
||||
@ -56,11 +56,11 @@ export default <Module<CalendarRangesState, State>>{
|
||||
},
|
||||
getRangesOnWeek: (state: CalendarRangesState) => (mondayDate: Date): EventInputCalendarRange[] => {
|
||||
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);
|
||||
dateOfWeek.setDate(mondayDate.getDate() + d);
|
||||
const dateStr = <string>dateToISO(dateOfWeek);
|
||||
for (let range of state.ranges) {
|
||||
const dateStr = dateToISO(dateOfWeek) as string;
|
||||
for (const range of state.ranges) {
|
||||
if (isEventInputCalendarRange(range)
|
||||
&& range.start.startsWith(dateStr)
|
||||
) {
|
||||
@ -253,12 +253,12 @@ export default <Module<CalendarRangesState, State>>{
|
||||
const rangesToCopy: EventInputCalendarRange[] = ctx.getters['getRangesOnDate'](from);
|
||||
const promises = [];
|
||||
|
||||
for (let r of rangesToCopy) {
|
||||
let start = new Date(<Date>ISOToDatetime(r.start));
|
||||
for (const r of rangesToCopy) {
|
||||
const start = new Date((ISOToDatetime(r.start) as Date));
|
||||
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());
|
||||
let location = ctx.rootGetters['locations/getLocationById'](r.locationId);
|
||||
const location = ctx.rootGetters['locations/getLocationById'](r.locationId);
|
||||
|
||||
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 promises = [];
|
||||
const diffTime = toMonday.getTime() - fromMonday.getTime();
|
||||
for (let r of rangesToCopy) {
|
||||
let start = new Date(<Date>ISOToDatetime(r.start));
|
||||
let end = new Date(<Date>ISOToDatetime(r.end));
|
||||
for (const r of rangesToCopy) {
|
||||
const start = new Date((ISOToDatetime(r.start) as Date));
|
||||
const end = new Date((ISOToDatetime(r.end) as Date));
|
||||
start.setTime(start.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}));
|
||||
}
|
||||
@ -283,4 +283,4 @@ export default <Module<CalendarRangesState, State>>{
|
||||
return Promise.all(promises).then(_ => Promise.resolve(null));
|
||||
}
|
||||
}
|
||||
};
|
||||
} as Module<CalendarRangesState, State>;
|
||||
|
@ -16,7 +16,7 @@ export interface CalendarRemotesState {
|
||||
|
||||
type Context = ActionContext<CalendarRemotesState, State>;
|
||||
|
||||
export default <Module<CalendarRemotesState, State>> {
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: (): CalendarRemotesState => ({
|
||||
remotes: [],
|
||||
@ -26,7 +26,7 @@ export default <Module<CalendarRemotesState, State>> {
|
||||
}),
|
||||
getters: {
|
||||
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) {
|
||||
return true;
|
||||
}
|
||||
@ -92,4 +92,4 @@ export default <Module<CalendarRemotesState, State>> {
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
} as Module<CalendarRemotesState, State>;
|
||||
|
@ -10,7 +10,7 @@ export interface LocationState {
|
||||
currentLocation: Location | null;
|
||||
}
|
||||
|
||||
export default <Module<LocationState, State>>{
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: (): LocationState => {
|
||||
return {
|
||||
@ -58,5 +58,5 @@ export default <Module<LocationState, State>>{
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
} as Module<LocationState, State>
|
||||
|
||||
|
@ -68,10 +68,10 @@ window.addEventListener('DOMContentLoaded', () => {
|
||||
upload_inputs.forEach((input: HTMLDivElement): void => {
|
||||
// test for a parent to check if this is a collection entry
|
||||
let collectionEntry: null|HTMLLIElement = null;
|
||||
let parent = input.parentElement;
|
||||
const parent = input.parentElement;
|
||||
console.log('parent', parent);
|
||||
if (null !== parent) {
|
||||
let grandParent = parent.parentElement;
|
||||
const grandParent = parent.parentElement;
|
||||
console.log('grandParent', grandParent);
|
||||
if (null !== grandParent) {
|
||||
if (grandParent.tagName.toLowerCase() === 'li' && grandParent.classList.contains('entry')) {
|
||||
|
@ -43,9 +43,7 @@ export interface StoredObjectStatusChange {
|
||||
/**
|
||||
* Function executed by the WopiEditButton component.
|
||||
*/
|
||||
export type WopiEditButtonExecutableBeforeLeaveFunction = {
|
||||
(): Promise<void>
|
||||
}
|
||||
export type WopiEditButtonExecutableBeforeLeaveFunction = () => Promise<void>
|
||||
|
||||
/**
|
||||
* Object containing information for performering a POST request to a swift object store
|
||||
|
@ -73,9 +73,7 @@ interface DocumentActionButtonsGroupConfig {
|
||||
davLinkExpiration?: number,
|
||||
}
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'onStoredObjectStatusChange', newStatus: StoredObjectStatusChange): void
|
||||
}>();
|
||||
const emit = defineEmits<(e: 'onStoredObjectStatusChange', newStatus: StoredObjectStatusChange) => void>();
|
||||
|
||||
const props = withDefaults(defineProps<DocumentActionButtonsGroupConfig>(), {
|
||||
small: false,
|
||||
|
@ -10,9 +10,7 @@ interface DropFileConfig {
|
||||
|
||||
const props = defineProps<DropFileConfig>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'addDocument', stored_object: StoredObjectCreated): void,
|
||||
}>();
|
||||
const emit = defineEmits<(e: 'addDocument', stored_object: StoredObjectCreated) => void,>();
|
||||
|
||||
const is_dragging: Ref<boolean> = ref(false);
|
||||
const uploading: Ref<boolean> = ref(false);
|
||||
|
@ -14,7 +14,7 @@ import {StoredObject, StoredObjectCreated} from "../../types";
|
||||
|
||||
interface ConvertButtonConfig {
|
||||
storedObject: StoredObject,
|
||||
classes: { [key: string]: boolean},
|
||||
classes: Record<string, boolean>,
|
||||
filename?: string,
|
||||
};
|
||||
|
||||
|
@ -5,7 +5,7 @@ import {computed, reactive} from "vue";
|
||||
|
||||
export interface DesktopEditButtonConfig {
|
||||
editLink: null,
|
||||
classes: { [k: string]: boolean },
|
||||
classes: Record<string, boolean>,
|
||||
expirationLink: number|Date,
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@ import {StoredObject, StoredObjectCreated} from "../../types";
|
||||
|
||||
interface DownloadButtonConfig {
|
||||
storedObject: StoredObject|StoredObjectCreated,
|
||||
classes: { [k: string]: boolean },
|
||||
classes: Record<string, boolean>,
|
||||
filename?: string,
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,7 @@ import {StoredObject, StoredObjectCreated, WopiEditButtonExecutableBeforeLeaveFu
|
||||
interface WopiEditButtonConfig {
|
||||
storedObject: StoredObject,
|
||||
returnPath?: string,
|
||||
classes: {[k: string] : boolean},
|
||||
classes: Record<string, boolean>,
|
||||
executeBeforeLeave?: WopiEditButtonExecutableBeforeLeaveFunction,
|
||||
}
|
||||
|
||||
|
@ -11,8 +11,8 @@ const keyDefinition = {
|
||||
};
|
||||
|
||||
const createFilename = (): string => {
|
||||
var text = "";
|
||||
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
||||
let text = "";
|
||||
const possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
||||
|
||||
for (let i = 0; i < 7; i++) {
|
||||
text += possible.charAt(Math.floor(Math.random() * possible.length));
|
||||
|
@ -37,7 +37,7 @@ export const ISOToDate = (str: string|null): Date|null => {
|
||||
return null;
|
||||
}
|
||||
|
||||
let
|
||||
const
|
||||
[year, month, day] = str.split('-').map(p => parseInt(p));
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
let
|
||||
const
|
||||
[cal, times] = str.split('T'),
|
||||
[year, month, date] = cal.split('-').map(s => parseInt(s)),
|
||||
[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'),
|
||||
].join('');
|
||||
|
||||
let x = cal + 'T' + time + offset;
|
||||
const x = cal + 'T' + time + offset;
|
||||
|
||||
return x;
|
||||
};
|
||||
|
@ -1,11 +1,9 @@
|
||||
import {Scope} from '../../types';
|
||||
|
||||
export type body = {[key: string]: boolean|string|number|null};
|
||||
export type fetchOption = {[key: string]: boolean|string|number|null};
|
||||
export type body = Record<string, boolean|string|number|null>;
|
||||
export type fetchOption = Record<string, boolean|string|number|null>;
|
||||
|
||||
export interface Params {
|
||||
[key: string]: number|string
|
||||
}
|
||||
export type Params = Record<string, number|string>;
|
||||
|
||||
export interface PaginationResponse<T> {
|
||||
pagination: {
|
||||
@ -16,9 +14,7 @@ export interface PaginationResponse<T> {
|
||||
count: number;
|
||||
}
|
||||
|
||||
export interface FetchParams {
|
||||
[K: string]: string|number|null;
|
||||
};
|
||||
export type FetchParams = Record<string, string|number|null>;;
|
||||
|
||||
export interface TransportExceptionInterface {
|
||||
name: string;
|
||||
@ -118,15 +114,15 @@ export const makeFetch = <Input, Output>(
|
||||
* Fetch results with certain parameters
|
||||
*/
|
||||
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('page', page.toString());
|
||||
|
||||
if (params !== undefined) {
|
||||
Object.keys(params).forEach(key => {
|
||||
let v = params[key];
|
||||
const v = params[key];
|
||||
if (typeof v === 'string') {
|
||||
searchParams.append(key, v);
|
||||
} 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, {
|
||||
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[]> => {
|
||||
let promises: Promise<T[]>[] = [],
|
||||
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));
|
||||
|
||||
|
@ -41,7 +41,7 @@ export class CollectionEventPayload {
|
||||
}
|
||||
|
||||
export const handleAdd = (button: any): void => {
|
||||
let
|
||||
const
|
||||
form_name = button.dataset.collectionAddTarget,
|
||||
prototype = button.dataset.formPrototype,
|
||||
collection: HTMLUListElement | null = document.querySelector('ul[data-collection-name="' + form_name + '"]');
|
||||
@ -50,7 +50,7 @@ export const handleAdd = (button: any): void => {
|
||||
return;
|
||||
}
|
||||
|
||||
let
|
||||
const
|
||||
empty_explain: HTMLLIElement | null = collection.querySelector('li[data-collection-empty-explain]'),
|
||||
entry = document.createElement('li'),
|
||||
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 => {
|
||||
|
||||
let
|
||||
const
|
||||
button = document.createElement('button'),
|
||||
isPersisted = entry.dataset.collectionIsPersisted || '',
|
||||
content = collection.dataset.collectionButtonRemoveLabel || '',
|
||||
@ -108,19 +108,19 @@ export const buildRemoveButton = (collection: HTMLUListElement, entry: HTMLLIEle
|
||||
}
|
||||
|
||||
window.addEventListener('load', () => {
|
||||
let
|
||||
const
|
||||
addButtons: NodeListOf<HTMLButtonElement> = document.querySelectorAll("button[data-collection-add-target]"),
|
||||
collections: NodeListOf<HTMLUListElement> = document.querySelectorAll("ul[data-collection-regular]");
|
||||
|
||||
for (let i = 0; i < addButtons.length; i++) {
|
||||
let addButton = addButtons[i];
|
||||
const addButton = addButtons[i];
|
||||
addButton.addEventListener('click', (e: Event) => {
|
||||
e.preventDefault();
|
||||
handleAdd(e.target);
|
||||
});
|
||||
}
|
||||
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++) {
|
||||
if (entries[j].dataset.collectionEmptyExplain === "1") {
|
||||
continue;
|
||||
|
@ -47,7 +47,7 @@ export interface UserAssociatedInterface {
|
||||
id: number;
|
||||
};
|
||||
|
||||
export type TranslatableString = {
|
||||
export interface TranslatableString {
|
||||
fr?: string;
|
||||
nl?: string;
|
||||
}
|
||||
@ -59,7 +59,7 @@ export interface Postcode {
|
||||
center: Point;
|
||||
}
|
||||
|
||||
export type Point = {
|
||||
export interface Point {
|
||||
type: "Point";
|
||||
coordinates: [lat: number, lon: number];
|
||||
}
|
||||
|
@ -32,9 +32,7 @@ const data: AddressModalData = reactive({
|
||||
|
||||
const props = defineProps<AddressModalContentProps>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'update-address', value: Address): void
|
||||
}>();
|
||||
const emit = defineEmits<(e: 'update-address', value: Address) => void>();
|
||||
|
||||
const address_modal = ref<InstanceType<typeof AddressModal> | null>(null);
|
||||
|
||||
|
@ -18,9 +18,7 @@ interface AddressModalContentProps {
|
||||
|
||||
const props = defineProps<AddressModalContentProps>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'update-address', value: Address): void
|
||||
}>();
|
||||
const emit = defineEmits<(e: 'update-address', value: Address) => void>();
|
||||
|
||||
const onUpdateAddress = (address: Address): void => {
|
||||
emit('update-address', address);
|
||||
|
@ -27,9 +27,7 @@ interface AddressModalState {
|
||||
|
||||
const props = defineProps<AddressModalProps>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'update-address', value: Address): void
|
||||
}>();
|
||||
const emit = defineEmits<(e: 'update-address', value: Address) => void>();
|
||||
|
||||
const state: AddressModalState = reactive({show_modal: false});
|
||||
|
||||
|
@ -53,9 +53,7 @@ export interface AddressDetailsRefMatchingProps {
|
||||
|
||||
const props = defineProps<AddressDetailsRefMatchingProps>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'update-address', value: Address): void
|
||||
}>();
|
||||
const emit = defineEmits<(e: 'update-address', value: Address) => void>();
|
||||
|
||||
const applyUpdate = async () => {
|
||||
const new_address = await syncAddressWithReference(props.address);
|
||||
|
@ -98,7 +98,6 @@
|
||||
import ToggleFlags from './Banner/ToggleFlags';
|
||||
import SocialIssue from './Banner/SocialIssue.vue';
|
||||
import PersonsAssociated from './Banner/PersonsAssociated.vue';
|
||||
import UserRenderBoxBadge from 'ChillMainAssets/vuejs/_components/Entity/UserRenderBoxBadge.vue';
|
||||
|
||||
export default {
|
||||
name: 'Banner',
|
||||
@ -106,7 +105,6 @@ export default {
|
||||
ToggleFlags,
|
||||
SocialIssue,
|
||||
PersonsAssociated,
|
||||
UserRenderBoxBadge,
|
||||
},
|
||||
computed: {
|
||||
accompanyingCourse() {
|
||||
|
@ -106,7 +106,6 @@
|
||||
|
||||
<script>
|
||||
import OnTheFly from 'ChillMainAssets/vuejs/OnTheFly/components/OnTheFly.vue';
|
||||
import ButtonLocation from '../ButtonLocation.vue';
|
||||
import PersonRenderBox from 'ChillPersonAssets/vuejs/_components/Entity/PersonRenderBox.vue';
|
||||
import ThirdPartyRenderBox from 'ChillThirdPartyAssets/vuejs/_components/Entity/ThirdPartyRenderBox.vue';
|
||||
import WriteComment from './WriteComment';
|
||||
@ -116,7 +115,6 @@ export default {
|
||||
name: 'ResourceItem',
|
||||
components: {
|
||||
OnTheFly,
|
||||
ButtonLocation,
|
||||
PersonRenderBox,
|
||||
ThirdPartyRenderBox,
|
||||
WriteComment
|
||||
|
@ -520,12 +520,9 @@ import ClassicEditor from 'ChillMainAssets/module/ckeditor5/editor_config';
|
||||
import AddResult from './components/AddResult.vue';
|
||||
import AddEvaluation from './components/AddEvaluation.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 PickTemplate from 'ChillDocGeneratorAssets/vuejs/_components/PickTemplate.vue';
|
||||
import OnTheFly from 'ChillMainAssets/vuejs/OnTheFly/components/OnTheFly.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 {buildLinkCreate} from 'ChillMainAssets/lib/entity-workflow/api.js';
|
||||
import { makeFetch } from 'ChillMainAssets/lib/api/apiMethods';
|
||||
@ -586,12 +583,9 @@ export default {
|
||||
AddResult,
|
||||
AddEvaluation,
|
||||
AddPersons,
|
||||
AddressRenderBox,
|
||||
ThirdPartyRenderBox,
|
||||
PickTemplate,
|
||||
ListWorkflowModal,
|
||||
OnTheFly,
|
||||
PickWorkflow,
|
||||
PersonText,
|
||||
},
|
||||
i18n,
|
||||
|
@ -259,14 +259,13 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {dateToISO, ISOToDate, ISOToDatetime} from 'ChillMainAssets/chill/js/date';
|
||||
import {ISOToDatetime} from 'ChillMainAssets/chill/js/date';
|
||||
import CKEditor from '@ckeditor/ckeditor5-vue';
|
||||
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 {buildLink} from 'ChillDocGeneratorAssets/lib/document-generator';
|
||||
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 {buildLinkCreate} from 'ChillMainAssets/lib/entity-workflow/api.js';
|
||||
import {buildLinkCreate as buildLinkCreateNotification} from 'ChillMainAssets/lib/entity-notification/api';
|
||||
@ -312,7 +311,6 @@ export default {
|
||||
ckeditor: CKEditor.component,
|
||||
PickTemplate,
|
||||
AddAsyncUpload,
|
||||
AddAsyncUploadDownloader,
|
||||
ListWorkflowModal,
|
||||
DocumentActionButtonsGroup,
|
||||
},
|
||||
|
@ -1,7 +1,5 @@
|
||||
import { createStore } from 'vuex';
|
||||
import { dateToISO, ISOToDate, datetimeToISO, ISOToDatetime, intervalDaysToISO, intervalISOToDays } from 'ChillMainAssets/chill/js/date';
|
||||
import { findSocialActionsBySocialIssue } from 'ChillPersonAssets/vuejs/_api/SocialWorkSocialAction.js';
|
||||
import { create } from 'ChillPersonAssets/vuejs/_api/AccompanyingCourseWork.js';
|
||||
import { dateToISO, ISOToDate, datetimeToISO, intervalDaysToISO, intervalISOToDays } from 'ChillMainAssets/chill/js/date';
|
||||
import { fetchResults, makeFetch } from 'ChillMainAssets/lib/api/apiMethods.ts';
|
||||
import { fetchTemplates } from 'ChillDocGeneratorAssets/api/pickTemplate.js';
|
||||
|
||||
|
@ -269,17 +269,13 @@ export default {
|
||||
}).catch;
|
||||
},
|
||||
|
||||
/**
|
||||
* Select/unselect in Result Multiselect
|
||||
* @param value
|
||||
*/
|
||||
selectResult(value) {
|
||||
// selectResult(value) {
|
||||
//console.log('----'); console.log('select result', value.id);
|
||||
},
|
||||
// },
|
||||
|
||||
unselectResult(value) {
|
||||
// unselectResult(value) {
|
||||
//console.log('----'); console.log('unselect result', value.id);
|
||||
},
|
||||
// },
|
||||
|
||||
/**
|
||||
* Choose parent action will involve retaining the "children" actions.
|
||||
|
@ -65,7 +65,7 @@
|
||||
|
||||
<script>
|
||||
|
||||
import {mapGetters, mapState} from 'vuex';
|
||||
import {mapState} from 'vuex';
|
||||
import Concerned from './components/Concerned.vue';
|
||||
import Household from './components/Household.vue';
|
||||
import HouseholdAddress from './components/HouseholdAddress';
|
||||
|
@ -72,14 +72,12 @@
|
||||
<script>
|
||||
import { mapState, mapGetters } from 'vuex';
|
||||
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';
|
||||
|
||||
export default {
|
||||
name: 'Concerned',
|
||||
components: {
|
||||
AddPersons,
|
||||
PersonRenderBox,
|
||||
PersonText,
|
||||
},
|
||||
computed: {
|
||||
|
@ -52,7 +52,6 @@
|
||||
import MemberDetails from './MemberDetails.vue';
|
||||
import {mapGetters, mapState} from "vuex";
|
||||
import CurrentHousehold from "./CurrentHousehold";
|
||||
import PersonRenderBox from 'ChillPersonAssets/vuejs/_components/Entity/PersonRenderBox.vue';
|
||||
import PersonComment from './PersonComment';
|
||||
import PersonText from '../../_components/Entity/PersonText.vue';
|
||||
|
||||
@ -60,7 +59,6 @@ export default {
|
||||
name: "Positioning",
|
||||
components: {
|
||||
CurrentHousehold,
|
||||
PersonRenderBox,
|
||||
PersonComment,
|
||||
PersonText
|
||||
},
|
||||
|
@ -382,7 +382,7 @@ const store = createStore({
|
||||
state.household.current_address = address;
|
||||
state.forceHouseholdNoAddress = false;
|
||||
},
|
||||
removeHouseholdAddress(state, address) {
|
||||
removeHouseholdAddress(state) {
|
||||
if (null === state.household) {
|
||||
console.error("no household");
|
||||
throw new Error("No household");
|
||||
@ -455,7 +455,7 @@ const store = createStore({
|
||||
dispatch('computeWarnings');
|
||||
dispatch('fetchAddressSuggestions');
|
||||
},
|
||||
markPosition({ commit, state, dispatch }, { person_id, position_id }) {
|
||||
markPosition({ commit, dispatch }, { person_id, position_id }) {
|
||||
commit('markPosition', { person_id, position_id });
|
||||
dispatch('computeWarnings');
|
||||
},
|
||||
@ -504,7 +504,7 @@ const store = createStore({
|
||||
setHouseholdCompositionType({ commit }, payload) {
|
||||
commit('setHouseholdCompositionType', payload);
|
||||
},
|
||||
fetchHouseholdSuggestionForConcerned({ commit, state }, person) {
|
||||
fetchHouseholdSuggestionForConcerned({ commit }, person) {
|
||||
fetchHouseholdSuggestionByAccompanyingPeriod(person.id)
|
||||
.then(households => {
|
||||
commit('addHouseholdSuggestionByAccompanyingPeriod', households);
|
||||
@ -535,8 +535,7 @@ const store = createStore({
|
||||
});
|
||||
},
|
||||
computeWarnings({ commit, state, getters }) {
|
||||
let warnings = [],
|
||||
payload;
|
||||
let warnings = []
|
||||
|
||||
if (!getters.hasHousehold && !state.forceLeaveWithoutHousehold) {
|
||||
warnings.push({ m: 'household_members_editor.add_destination', a: {} });
|
||||
@ -553,7 +552,7 @@ const store = createStore({
|
||||
|
||||
commit('setWarnings', warnings);
|
||||
},
|
||||
confirm({ getters, state, commit }) {
|
||||
confirm({ getters, commit }) {
|
||||
let payload = getters.buildPayload,
|
||||
errors = [],
|
||||
person_id,
|
||||
|
@ -38,7 +38,7 @@ const patchFetch = (url, body) => {
|
||||
* @param body
|
||||
* @returns {Promise<Response>}
|
||||
*/
|
||||
const deleteFetch = (url, body) => {
|
||||
const deleteFetch = (url) => {
|
||||
return makeFetch('DELETE', url, null)
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { createStore } from 'vuex'
|
||||
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 { darkBlue, darkBrown, darkGreen, lightBlue, lightBrown, lightGreen } from './colors';
|
||||
|
||||
@ -364,7 +364,6 @@ const store = createStore({
|
||||
color: lightBrown,
|
||||
font: { color: darkBrown },
|
||||
dashes: (getHouseholdWidth(m) === 1)? [0,4] : false, //edge style: [dash, gap, dash, gap]
|
||||
//label: getHouseholdLabel(m),
|
||||
width: getHouseholdWidth(m),
|
||||
})
|
||||
if (!getters.isPersonLoaded(m.person.id)) {
|
||||
@ -378,7 +377,7 @@ const store = createStore({
|
||||
* @param object
|
||||
* @param person
|
||||
*/
|
||||
fetchCoursesByPerson({ commit, dispatch }, person) {
|
||||
fetchCoursesByPerson({ dispatch }, person) {
|
||||
return getCoursesByPerson(person)
|
||||
.then(courses => new Promise(resolve => {
|
||||
dispatch('addCourses', courses)
|
||||
@ -496,7 +495,7 @@ const store = createStore({
|
||||
* @param object
|
||||
* @param array
|
||||
*/
|
||||
addMissingPerson({ commit, getters, dispatch }, [person, parent]) {
|
||||
addMissingPerson({ commit, getters }, [person, parent]) {
|
||||
//console.log('! add missing Person', person.id)
|
||||
commit('markPersonLoaded', person.id)
|
||||
commit('addPerson', [person, { folded: true }])
|
||||
|
@ -227,7 +227,7 @@ export default {
|
||||
}
|
||||
this.search.currentSearchQueryController = new AbortController();
|
||||
searchEntities({ query, options: this.options }, this.search.currentSearchQueryController.signal)
|
||||
.then(suggested => new Promise((resolve, reject) => {
|
||||
.then(suggested => new Promise((resolve) => {
|
||||
this.loadSuggestions(suggested.results);
|
||||
resolve();
|
||||
}))
|
||||
|
@ -278,21 +278,18 @@
|
||||
</template>
|
||||
|
||||
<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 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 PersonText from 'ChillPersonAssets/vuejs/_components/Entity/PersonText.vue';
|
||||
import ThirdPartyText from 'ChillThirdPartyAssets/vuejs/_components/Entity/ThirdPartyText.vue';
|
||||
import AddressDetailsButton from "ChillMainAssets/vuejs/_components/AddressDetails/AddressDetailsButton.vue";
|
||||
|
||||
export default {
|
||||
name: "PersonRenderBox",
|
||||
components: {
|
||||
AddressRenderBox,
|
||||
GenderIconRenderBox,
|
||||
Confidential,
|
||||
BadgeEntity,
|
||||
PersonText,
|
||||
ThirdPartyText
|
||||
|
@ -6,7 +6,7 @@ import {
|
||||
} from "../../../../../../ChillDocStoreBundle/Resources/public/types";
|
||||
|
||||
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) {
|
||||
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
|
||||
*/
|
||||
let timeout = i < 1200 ? 5000 : 60000;
|
||||
const timeout = i < 1200 ? 5000 : 60000;
|
||||
|
||||
setTimeout(
|
||||
reload_if_needed,
|
||||
@ -30,11 +30,11 @@ function wait_before_reload(stored_object: StoredObject, i: number): void {
|
||||
}
|
||||
|
||||
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');
|
||||
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);
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user