chore(deps): update dev-dependencies (major) (#3741)
Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/3741 Co-authored-by: renovate <renovatebot@kolaente.de> Co-committed-by: renovate <renovatebot@kolaente.de>
This commit is contained in:
@ -107,6 +107,7 @@ import {closeWhenClickedOutside} from '@/helpers/closeWhenClickedOutside'
|
||||
import BaseButton from '@/components/base/BaseButton.vue'
|
||||
import CustomTransition from '@/components/misc/CustomTransition.vue'
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function elementInResults(elem: string | any, label: string, query: string): boolean {
|
||||
// Don't make create available if we have an exact match in our search results.
|
||||
if (label !== '') {
|
||||
@ -135,7 +136,8 @@ const props = defineProps({
|
||||
* The search results where the @search listener needs to put the results into
|
||||
*/
|
||||
searchResults: {
|
||||
type: Array as PropType<{[id: string]: any}>,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
type: Array as PropType<{ [id: string]: any }>,
|
||||
default: () => [],
|
||||
},
|
||||
/**
|
||||
@ -150,7 +152,8 @@ const props = defineProps({
|
||||
* The object with the value, updated every time an entry is selected.
|
||||
*/
|
||||
modelValue: {
|
||||
type: [Object] as PropType<{[key: string]: any}>,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
type: [Object] as PropType<{ [key: string]: any }>,
|
||||
default: null,
|
||||
},
|
||||
/**
|
||||
@ -230,7 +233,8 @@ const emit = defineEmits<{
|
||||
/**
|
||||
* Triggered every time an option from the search results is selected. Also triggers a change in v-model.
|
||||
*/
|
||||
(e: 'select', value: {[key: string]: any}): void
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
(e: 'select', value: { [key: string]: any }): void
|
||||
/**
|
||||
* If nothing or no exact match was found and `creatable` is true, this event is triggered with the current value of the search query.
|
||||
*/
|
||||
@ -241,11 +245,13 @@ const emit = defineEmits<{
|
||||
(e: 'remove', value: null): void
|
||||
}>()
|
||||
|
||||
const query = ref<string | {[key: string]: any}>('')
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const query = ref<string | { [key: string]: any }>('')
|
||||
const searchTimeout = ref<ReturnType<typeof setTimeout> | null>(null)
|
||||
const localLoading = ref(false)
|
||||
const showSearchResults = ref(false)
|
||||
const internalValue = ref<string | {[key: string]: any} | any[] | null>(null)
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const internalValue = ref<string | { [key: string]: any } | any[] | null>(null)
|
||||
|
||||
onMounted(() => document.addEventListener('click', hideSearchResultsHandler))
|
||||
onBeforeUnmount(() => document.removeEventListener('click', hideSearchResultsHandler))
|
||||
@ -273,6 +279,7 @@ const searchResultsVisible = computed(() => {
|
||||
})
|
||||
|
||||
const creatableAvailable = computed(() => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const hasResult = filteredSearchResults.value.some((elem: any) => elementInResults(elem, props.label, query.value))
|
||||
const hasQueryAlreadyAdded = Array.isArray(internalValue.value) && internalValue.value.some(elem => elementInResults(elem, props.label, query.value))
|
||||
|
||||
@ -284,6 +291,7 @@ const creatableAvailable = computed(() => {
|
||||
const filteredSearchResults = computed(() => {
|
||||
const currentInternal = internalValue.value
|
||||
if (props.multiple && currentInternal !== null && Array.isArray(currentInternal)) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
return searchResults.value.filter((item: any) => !currentInternal.some(e => e === item))
|
||||
}
|
||||
|
||||
@ -342,12 +350,14 @@ function handleFocus() {
|
||||
}, 10)
|
||||
}
|
||||
|
||||
function select(object: {[key: string]: any} | null) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function select(object: { [key: string]: any } | null) {
|
||||
if (props.multiple) {
|
||||
if (internalValue.value === null) {
|
||||
internalValue.value = []
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
(internalValue.value as any[]).push(object)
|
||||
} else {
|
||||
internalValue.value = object
|
||||
@ -361,7 +371,8 @@ function select(object: {[key: string]: any} | null) {
|
||||
}
|
||||
}
|
||||
|
||||
function setSelectedObject(object: string | {[id: string]: any} | null, resetOnly = false) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function setSelectedObject(object: string | { [id: string]: any } | null, resetOnly = false) {
|
||||
internalValue.value = object
|
||||
|
||||
// We assume we're getting an array when multiple is enabled and can therefore leave the query
|
||||
@ -430,6 +441,7 @@ function createOrSelectOnEnter() {
|
||||
|
||||
if (!creatableAvailable.value) {
|
||||
// Check if there's an exact match for our search term
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const exactMatch = filteredSearchResults.value.find((elem: any) => elementInResults(elem, props.label, query.value))
|
||||
if (exactMatch) {
|
||||
select(exactMatch)
|
||||
@ -441,6 +453,7 @@ function createOrSelectOnEnter() {
|
||||
create()
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function remove(item: any) {
|
||||
for (const ind in internalValue.value) {
|
||||
if (internalValue.value[ind] === item) {
|
||||
|
@ -93,6 +93,7 @@ import {success} from '@/message'
|
||||
import type {ITeam} from '@/modelTypes/ITeam'
|
||||
import type {ITask} from '@/modelTypes/ITask'
|
||||
import type {IProject} from '@/modelTypes/IProject'
|
||||
import type {IAbstract} from '@/modelTypes/IAbstract'
|
||||
|
||||
const {t} = useI18n({useScope: 'global'})
|
||||
const router = useRouter()
|
||||
@ -103,7 +104,7 @@ const labelStore = useLabelStore()
|
||||
const taskStore = useTaskStore()
|
||||
const authStore = useAuthStore()
|
||||
|
||||
type DoAction<Type = any> = { type: ACTION_TYPE } & Type
|
||||
type DoAction<Type> = { type: ACTION_TYPE } & Type
|
||||
|
||||
enum ACTION_TYPE {
|
||||
CMD = 'cmd',
|
||||
@ -190,7 +191,7 @@ const foundCommands = computed(() => availableCmds.value.filter((a) =>
|
||||
interface Result {
|
||||
type: ACTION_TYPE
|
||||
title: string
|
||||
items: DoAction<any>
|
||||
items: DoAction<IAbstract>
|
||||
}
|
||||
|
||||
const results = computed<Result[]>(() => {
|
||||
|
@ -178,7 +178,7 @@ async function addTask() {
|
||||
return rel
|
||||
})
|
||||
await Promise.all(relations)
|
||||
} catch (e: any) {
|
||||
} catch (e) {
|
||||
newTaskTitle.value = taskTitleBackup
|
||||
if (e?.message === 'NO_PROJECT') {
|
||||
errorMessage.value = t('project.create.addProjectRequired')
|
||||
|
@ -4,8 +4,6 @@ import BaseButton from '@/components/base/BaseButton.vue'
|
||||
import User from '@/components/misc/user.vue'
|
||||
import {computed} from 'vue'
|
||||
|
||||
type removeFunction = (item: any) => void
|
||||
|
||||
const {
|
||||
assignees,
|
||||
remove,
|
||||
@ -14,7 +12,7 @@ const {
|
||||
inline = false,
|
||||
} = defineProps<{
|
||||
assignees: IUser[],
|
||||
remove?: removeFunction,
|
||||
remove?: (user: IUser) => void,
|
||||
disabled?: boolean,
|
||||
avatarSize?: number,
|
||||
inline?: boolean,
|
||||
|
@ -2,6 +2,7 @@ import {computed, ref, watch, type Ref} from 'vue'
|
||||
import {useRouter, type RouteLocationNormalized, type RouteLocationRaw, type RouteRecordName} from 'vue-router'
|
||||
import equal from 'fast-deep-equal/es6'
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export type Filters = Record<string, any>
|
||||
|
||||
export function useRouteFilters<CurrentFilters extends Filters>(
|
||||
|
@ -4,6 +4,7 @@ import {snakeCase} from 'snake-case'
|
||||
/**
|
||||
* Transforms field names to camel case.
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export function objectToCamelCase(object: Record<string, any>) {
|
||||
|
||||
// When calling recursively, this can be called without being and object or array in which case we just return the value
|
||||
@ -11,6 +12,7 @@ export function objectToCamelCase(object: Record<string, any>) {
|
||||
return object
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const parsedObject: Record<string, any> = {}
|
||||
for (const m in object) {
|
||||
parsedObject[camelCase(m)] = object[m]
|
||||
@ -23,6 +25,7 @@ export function objectToCamelCase(object: Record<string, any>) {
|
||||
|
||||
// Call it again for arrays
|
||||
if (Array.isArray(object[m])) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
parsedObject[camelCase(m)] = object[m].map((o: Record<string, any>) => objectToCamelCase(o))
|
||||
// Because typeof [] === 'object' is true for arrays, we leave the loop here to prevent converting arrays to objects.
|
||||
continue
|
||||
@ -39,6 +42,7 @@ export function objectToCamelCase(object: Record<string, any>) {
|
||||
/**
|
||||
* Transforms field names to snake case - used before making an api request.
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export function objectToSnakeCase(object: Record<string, any>) {
|
||||
|
||||
// When calling recursively, this can be called without being and object or array in which case we just return the value
|
||||
@ -46,6 +50,7 @@ export function objectToSnakeCase(object: Record<string, any>) {
|
||||
return object
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const parsedObject: Record<string, any> = {}
|
||||
for (const m in object) {
|
||||
parsedObject[snakeCase(m)] = object[m]
|
||||
@ -61,6 +66,7 @@ export function objectToSnakeCase(object: Record<string, any>) {
|
||||
|
||||
// Call it again for arrays
|
||||
if (Array.isArray(object[m])) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
parsedObject[snakeCase(m)] = object[m].map((o: Record<string, any>) => objectToSnakeCase(o))
|
||||
// Because typeof [] === 'object' is true for arrays, we leave the loop here to prevent converting arrays to objects.
|
||||
continue
|
||||
|
@ -6,7 +6,11 @@ export function findById<T extends {id: string | number}>(array : T[], id : stri
|
||||
return array.find(({id: currentId}) => currentId === id)
|
||||
}
|
||||
|
||||
export function includesById(array: any[], id: string | number) {
|
||||
interface ObjectWithId {
|
||||
id: number
|
||||
}
|
||||
|
||||
export function includesById(array: ObjectWithId[], id: string | number) {
|
||||
return array.some(({id: currentId}) => currentId === id)
|
||||
}
|
||||
|
||||
|
@ -34,6 +34,7 @@ export const i18n = createI18n({
|
||||
legacy: false,
|
||||
messages: {
|
||||
[DEFAULT_LANGUAGE]: langEN,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
} as Record<SupportedLocale, any>,
|
||||
})
|
||||
|
||||
|
@ -18,7 +18,7 @@ export interface IUserSettings extends IAbstract {
|
||||
discoverableByName: boolean
|
||||
discoverableByEmail: boolean
|
||||
overdueTasksRemindersEnabled: boolean
|
||||
overdueTasksRemindersTime: any
|
||||
overdueTasksRemindersTime: string | Date
|
||||
defaultProjectId: undefined | IProject['id']
|
||||
weekStart: 0 | 1 | 2 | 3 | 4 | 5 | 6
|
||||
timezone: string
|
||||
|
@ -82,7 +82,7 @@ export function useGanttTaskList<F extends Filters>(
|
||||
// update the task with possible changes from server
|
||||
tasks.value.set(updatedTask.id, updatedTask)
|
||||
success('Saved')
|
||||
} catch (e: any) {
|
||||
} catch (e) {
|
||||
error('Something went wrong saving the task')
|
||||
// roll back changes
|
||||
tasks.value.set(task.id, oldTask)
|
||||
|
@ -105,18 +105,18 @@ function useAuth() {
|
||||
params: {projectId},
|
||||
hash,
|
||||
})
|
||||
} catch (e: any) {
|
||||
if (e.response?.data?.code === 13001) {
|
||||
} catch (e) {
|
||||
if (e?.response?.data?.code === 13001) {
|
||||
authenticateWithPassword.value = true
|
||||
return
|
||||
}
|
||||
|
||||
// TODO: Put this logic in a global errorMessage handler method which checks all auth codes
|
||||
let err = t('sharing.error')
|
||||
if (e.response?.data?.message) {
|
||||
if (e?.response?.data?.message) {
|
||||
err = e.response.data.message
|
||||
}
|
||||
if (e.response?.data?.code === 13002) {
|
||||
if (e?.response?.data?.code === 13002) {
|
||||
err = t('sharing.invalidPassword')
|
||||
}
|
||||
errorMessage.value = err
|
||||
|
@ -143,7 +143,7 @@ async function submit() {
|
||||
|
||||
try {
|
||||
await authStore.register(toRaw(credentials))
|
||||
} catch (e: any) {
|
||||
} catch (e) {
|
||||
errorMessage.value = e?.message
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user