From 70c3f05050ce218bd7490662348616d439eedbac Mon Sep 17 00:00:00 2001 From: Rijk van Zanten Date: Tue, 5 May 2020 14:22:01 -0400 Subject: [PATCH] Interface many to one (#524) * Start on m2o * Render preview in m2o * Add icons * Style inline icons * Add editing modal * Disable any linter * Add add-new button * Pass existing selection on to layout * Update v-table to allow for keys-only-selection * Fix batch on tabular --- .eslintrc.js | 2 +- src/components/v-form/v-form.vue | 4 +- src/components/v-input/v-input.vue | 26 +- src/components/v-menu/use-popper.ts | 1 - src/components/v-menu/v-menu.vue | 17 +- src/components/v-modal/v-modal.vue | 1 - src/components/v-select/v-select.vue | 1 - src/components/v-table/types.ts | 1 - src/components/v-table/v-table.vue | 30 +- .../use-collection-preset/types.ts | 4 +- .../use-collection-preset.ts | 2 - .../use-collection/use-collection.ts | 4 +- .../use-custom-selection.ts | 1 - .../use-element-size/use-element-size.ts | 1 - src/composables/use-item/use-item.ts | 2 - src/composables/use-items/use-items.ts | 7 +- src/composables/use-sync/readme.md | 2 +- src/composables/use-sync/use-sync.ts | 2 +- src/displays/types.ts | 3 +- src/hydrate.ts | 2 +- src/interfaces/index.ts | 2 + src/interfaces/many-to-one/index.ts | 17 + src/interfaces/many-to-one/many-to-one.vue | 579 ++++++++++++++++++ src/interfaces/many-to-one/readme.md | 0 src/interfaces/wysiwyg/wysiwyg.vue | 1 - src/lang/en-US/index.json | 12 +- src/layouts/cards/cards.vue | 4 - src/layouts/cards/components/card.vue | 3 - src/layouts/cards/components/header.vue | 1 - src/layouts/tabular/tabular.vue | 9 +- src/modules/activity/routes/browse/browse.vue | 1 - src/modules/activity/routes/detail/detail.vue | 1 - .../collections/routes/browse/browse.vue | 14 +- .../collections/routes/detail/detail.vue | 2 - src/modules/files/composables/use-folders.ts | 2 +- src/modules/files/routes/browse/browse.vue | 1 - src/modules/files/routes/detail/detail.vue | 2 - .../field-setup/field-setup-display.vue | 1 - .../field-setup/field-setup-interface.vue | 1 - .../components/field-setup/field-setup.vue | 6 +- src/modules/settings/routes/global/global.vue | 1 - .../settings/routes/presets/detail/detail.vue | 6 +- .../settings/routes/roles/browse/browse.vue | 1 - .../permissions-statuses.vue | 1 - .../settings/routes/roles/detail/detail.vue | 1 - .../routes/webhooks/browse/browse.vue | 1 - .../routes/webhooks/detail/detail.vue | 1 - src/modules/users/routes/browse/browse.vue | 1 - src/modules/users/routes/detail/detail.vue | 2 - src/stores/collection-presets/types.ts | 4 +- src/stores/settings/settings.ts | 3 +- src/stores/settings/types.ts | 2 +- .../filters-to-query/filters-to-query.ts | 1 - src/utils/move-in-array/move-in-array.ts | 1 - .../register-component/register-component.ts | 2 +- .../activity-drawer-detail.vue | 1 - .../render-template/render-template.vue | 1 - 57 files changed, 686 insertions(+), 116 deletions(-) create mode 100644 src/interfaces/many-to-one/index.ts create mode 100644 src/interfaces/many-to-one/many-to-one.vue create mode 100644 src/interfaces/many-to-one/readme.md diff --git a/.eslintrc.js b/.eslintrc.js index 562ff698e0..29b594145a 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -16,6 +16,7 @@ module.exports = { '@typescript-eslint/camelcase': 0, '@typescript-eslint/no-use-before-define': 0, '@typescript-eslint/ban-ts-ignore': 0, + '@typescript-eslint/no-explicit-any': 0, 'comma-dangle': [ 'error', { @@ -37,7 +38,6 @@ module.exports = { jest: true, }, rules: { - '@typescript-eslint/no-explicit-any': 0, '@typescript-eslint/no-empty-function': 0, '@typescript-eslint/no-non-null-assertion': 0, }, diff --git a/src/components/v-form/v-form.vue b/src/components/v-form/v-form.vue index 71f2376d98..a369ac830c 100644 --- a/src/components/v-form/v-form.vue +++ b/src/components/v-form/v-form.vue @@ -90,6 +90,8 @@ " :width="field.width" :type="field.type" + :collection="field.collection" + :field="field.field" @input="setValue(field, $event)" /> @@ -112,7 +114,6 @@ import marked from 'marked'; import getDefaultInterfaceForType from '@/utils/get-default-interface-for-type'; type FieldValues = { - // eslint-disable-next-line @typescript-eslint/no-explicit-any [field: string]: any; }; @@ -273,7 +274,6 @@ export default defineComponent({ return { formFields, gridClass }; } - // eslint-disable-next-line @typescript-eslint/no-explicit-any function setValue(field: Field, value: any) { const edits = props.edits ? clone(props.edits) : {}; edits[field.field] = value; diff --git a/src/components/v-input/v-input.vue b/src/components/v-input/v-input.vue index 2d83bafab1..2c3f21fd33 100644 --- a/src/components/v-input/v-input.vue +++ b/src/components/v-input/v-input.vue @@ -12,18 +12,20 @@ {{ prefix }} - + + + {{ suffix }} void = () => undefined) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any const modifiers: Partial>[] = [ popperOffsets, { diff --git a/src/components/v-menu/v-menu.vue b/src/components/v-menu/v-menu.vue index 3582c11e0f..1a09bc0886 100644 --- a/src/components/v-menu/v-menu.vue +++ b/src/components/v-menu/v-menu.vue @@ -43,7 +43,7 @@ + + diff --git a/src/interfaces/many-to-one/readme.md b/src/interfaces/many-to-one/readme.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/interfaces/wysiwyg/wysiwyg.vue b/src/interfaces/wysiwyg/wysiwyg.vue index 8cfaf8081e..2935bf86d3 100644 --- a/src/interfaces/wysiwyg/wysiwyg.vue +++ b/src/interfaces/wysiwyg/wysiwyg.vue @@ -81,7 +81,6 @@ export default defineComponent({ }, }, setup(props, { emit }) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any const editorElement = ref(null); const _value = computed({ diff --git a/src/lang/en-US/index.json b/src/lang/en-US/index.json index 371414a270..782a08d19a 100644 --- a/src/lang/en-US/index.json +++ b/src/lang/en-US/index.json @@ -140,6 +140,8 @@ "comments": "Comments", + "select_item": "Select Item", + "item_count": "No Items | One Item | {count} Items", "no_items_copy": "It looks like you don’t have any items in this collection. You can click the button below to add an item.", "all_items": "All Items", @@ -152,6 +154,9 @@ "radio_buttons": "Radio Buttons", "checkboxes": "Checkboxes", + "relationship_not_setup": "The relationship hasn't been configured correctly.", + "display_template_not_setup": "The display template hasn't been configured correctly.", + "choose_status": "Choose Status...", "users": "Users", @@ -174,6 +179,9 @@ "bookmark_doesnt_exist_copy": "The bookmark you're trying to open couldn't be found.", "bookmark_doesnt_exist_cta": "Return to collection", + "select_an_item": "Select an item...", + "edit": "Edit", + "errors": { "3": "Only super admins have access to this", "4": "Super Admin Token not provided", @@ -325,6 +333,9 @@ "add_new_item": "Add New Item", + "many-to-one": "Many to One", + "display_template": "Display Template", + "n_items_selected": "No Items Selected | 1 Item Selected | {n} Items Selected", "per_page": "Per Page", "all_files": "All Files", @@ -796,7 +807,6 @@ "related_entries": "Has related entries", "relational": "Relational", "relationship": "Relationship", - "relationship_not_setup": "The relationship hasn't been configured correctly.", "remove": "Remove", "remove_related": "Remove Related Item", "report_issue": "Report Issue", diff --git a/src/layouts/cards/cards.vue b/src/layouts/cards/cards.vue index 2c7fb58c4a..c96b3836bb 100644 --- a/src/layouts/cards/cards.vue +++ b/src/layouts/cards/cards.vue @@ -150,7 +150,6 @@ import CardsHeader from './components/header.vue'; import i18n from '@/lang'; import adjustFieldsForDisplays from '@/utils/adjust-fields-for-displays'; -// eslint-disable-next-line @typescript-eslint/no-explicit-any type Item = Record; type ViewOptions = { @@ -317,7 +316,6 @@ export default defineComponent({ return { size, icon, imageSource, title, subtitle, imageFit }; - // eslint-disable-next-line @typescript-eslint/no-explicit-any function createViewOption(key: keyof ViewOptions, defaultValue: any) { return computed({ get() { @@ -375,7 +373,6 @@ export default defineComponent({ return { sort, limit, page, fields }; - // eslint-disable-next-line @typescript-eslint/no-explicit-any function createViewQueryOption(key: keyof ViewQuery, defaultValue: any) { return computed({ get() { @@ -392,7 +389,6 @@ export default defineComponent({ } } - // eslint-disable-next-line @typescript-eslint/no-explicit-any function getLinkForItem(item: Record) { const currentProjectKey = projectsStore.state.currentProjectKey; diff --git a/src/layouts/cards/components/card.vue b/src/layouts/cards/components/card.vue index c3dbc463b2..24d1e7789d 100644 --- a/src/layouts/cards/components/card.vue +++ b/src/layouts/cards/components/card.vue @@ -40,7 +40,6 @@ import { defineComponent, PropType, computed } from '@vue/composition-api'; import router from '@/router'; type File = { - // eslint-disable-next-line @typescript-eslint/no-explicit-any [key: string]: any; type: string; data: { @@ -71,12 +70,10 @@ export default defineComponent({ default: false, }, item: { - // eslint-disable-next-line @typescript-eslint/no-explicit-any type: Object as PropType>, default: null, }, value: { - // eslint-disable-next-line @typescript-eslint/no-explicit-any type: Array as PropType[]>, default: () => [], }, diff --git a/src/layouts/cards/components/header.vue b/src/layouts/cards/components/header.vue index 2da129bd63..ba97ed2c45 100644 --- a/src/layouts/cards/components/header.vue +++ b/src/layouts/cards/components/header.vue @@ -65,7 +65,6 @@ export default defineComponent({ required: true, }, selection: { - // eslint-disable-next-line @typescript-eslint/no-explicit-any type: Array as PropType>, default: () => [], }, diff --git a/src/layouts/tabular/tabular.vue b/src/layouts/tabular/tabular.vue index 15ab10371f..576171a0b4 100644 --- a/src/layouts/tabular/tabular.vue +++ b/src/layouts/tabular/tabular.vue @@ -76,7 +76,8 @@ :item-key="primaryKeyField.field" :show-manual-sort="_filters && _filters.length === 0 && sortField !== null" :manual-sort-key="sortField && sortField.field" - @click:row="readonly ? null : onRowClick" + selection-use-keys + @click:row="onRowClick" @update:sort="onSortChange" @manual-sort="changeManualSort" > @@ -471,11 +472,13 @@ export default defineComponent({ }; function onRowClick(item: Item) { + if (props.readonly === true) return; + if (props.selectMode || _selection.value?.length > 0) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any (table.value as any).onItemSelected({ item, - value: _selection.value?.includes(item) === false, + value: + _selection.value?.includes(item[primaryKeyField.value.field]) === false, }); } else { // eslint-disable-next-line @typescript-eslint/no-non-null-assertion diff --git a/src/modules/activity/routes/browse/browse.vue b/src/modules/activity/routes/browse/browse.vue index d971f46a3d..fa12fa8ac9 100644 --- a/src/modules/activity/routes/browse/browse.vue +++ b/src/modules/activity/routes/browse/browse.vue @@ -32,7 +32,6 @@ import { LayoutComponent } from '@/layouts/types'; import useCollectionPreset from '@/composables/use-collection-preset'; type Item = { - // eslint-disable-next-line @typescript-eslint/no-explicit-any [field: string]: any; }; diff --git a/src/modules/activity/routes/detail/detail.vue b/src/modules/activity/routes/detail/detail.vue index e709337d12..a576b33620 100644 --- a/src/modules/activity/routes/detail/detail.vue +++ b/src/modules/activity/routes/detail/detail.vue @@ -27,7 +27,6 @@ import useItem from '@/composables/use-item'; import SaveOptions from '@/views/private/components/save-options'; type Values = { - // eslint-disable-next-line @typescript-eslint/no-explicit-any [field: string]: any; }; diff --git a/src/modules/collections/routes/browse/browse.vue b/src/modules/collections/routes/browse/browse.vue index 403da79e77..8cd703d5d4 100644 --- a/src/modules/collections/routes/browse/browse.vue +++ b/src/modules/collections/routes/browse/browse.vue @@ -21,7 +21,7 @@ @@ -85,7 +85,7 @@ v-else class="layout" ref="layout" - :is="`layout-${viewType}`" + :is="`layout-${viewType || 'tabular'}`" :collection="collection" :selection.sync="selection" :view-options.sync="viewOptions" @@ -140,7 +140,6 @@ const redirectIfNeeded: NavigationGuard = async (to, from, next) => { }; type Item = { - // eslint-disable-next-line @typescript-eslint/no-explicit-any [field: string]: any; }; @@ -190,10 +189,6 @@ export default defineComponent({ const { addBookmarkActive, creatingBookmark, createBookmark } = useBookmarks(); - if (viewType.value === null) { - viewType.value = 'tabular'; - } - return { addNewLink, batchDelete, @@ -267,10 +262,7 @@ export default defineComponent({ const batchLink = computed(() => { const currentProjectKey = projectsStore.state.currentProjectKey; - const batchPrimaryKeys = selection.value - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - .map((item) => item[primaryKeyField.value!.field]) - .join(); + const batchPrimaryKeys = selection.value.join(); return `/${currentProjectKey}/collections/${props.collection}/${batchPrimaryKeys}`; }); diff --git a/src/modules/collections/routes/detail/detail.vue b/src/modules/collections/routes/detail/detail.vue index cc55ddfec8..d628ff5b03 100644 --- a/src/modules/collections/routes/detail/detail.vue +++ b/src/modules/collections/routes/detail/detail.vue @@ -163,7 +163,6 @@ import useItem from '@/composables/use-item'; import SaveOptions from '@/views/private/components/save-options'; type Values = { - // eslint-disable-next-line @typescript-eslint/no-explicit-any [field: string]: any; }; @@ -250,7 +249,6 @@ export default defineComponent({ } async function saveAndStay() { - // eslint-disable-next-line @typescript-eslint/no-explicit-any const savedItem: Record = await save(); if (props.primaryKey === '+') { diff --git a/src/modules/files/composables/use-folders.ts b/src/modules/files/composables/use-folders.ts index d0b1eb4cc8..4d9096a6bc 100644 --- a/src/modules/files/composables/use-folders.ts +++ b/src/modules/files/composables/use-folders.ts @@ -16,7 +16,7 @@ export type Folder = { let loading: Ref | null = null; let folders: Ref | null = null; -// eslint-disable-next-line @typescript-eslint/no-explicit-any + let error: Ref | null = null; export default function useFolders() { diff --git a/src/modules/files/routes/browse/browse.vue b/src/modules/files/routes/browse/browse.vue index 8720f11876..36bf5b30da 100644 --- a/src/modules/files/routes/browse/browse.vue +++ b/src/modules/files/routes/browse/browse.vue @@ -84,7 +84,6 @@ import AddFolder from '../../components/add-folder'; import SearchInput from '@/views/private/components/search-input'; type Item = { - // eslint-disable-next-line @typescript-eslint/no-explicit-any [field: string]: any; }; diff --git a/src/modules/files/routes/detail/detail.vue b/src/modules/files/routes/detail/detail.vue index 5a651988a0..e3e60a92e3 100644 --- a/src/modules/files/routes/detail/detail.vue +++ b/src/modules/files/routes/detail/detail.vue @@ -126,7 +126,6 @@ import { nanoid } from 'nanoid'; import FileLightbox from '@/views/private/components/file-lightbox'; type Values = { - // eslint-disable-next-line @typescript-eslint/no-explicit-any [field: string]: any; }; @@ -220,7 +219,6 @@ export default defineComponent({ } async function saveAndStay() { - // eslint-disable-next-line @typescript-eslint/no-explicit-any const savedItem: Record = await save(); if (props.primaryKey === '+') { diff --git a/src/modules/settings/routes/data-model/fields/components/field-setup/field-setup-display.vue b/src/modules/settings/routes/data-model/fields/components/field-setup/field-setup-display.vue index 9cb4f7cfd2..f4ca6b1245 100644 --- a/src/modules/settings/routes/data-model/fields/components/field-setup/field-setup-display.vue +++ b/src/modules/settings/routes/data-model/fields/components/field-setup/field-setup-display.vue @@ -29,7 +29,6 @@ export default defineComponent({ default: null, }, options: { - // eslint-disable-next-line @typescript-eslint/no-explicit-any type: Object as PropType, default: null, }, diff --git a/src/modules/settings/routes/data-model/fields/components/field-setup/field-setup-interface.vue b/src/modules/settings/routes/data-model/fields/components/field-setup/field-setup-interface.vue index cda6e63e9a..63c9697309 100644 --- a/src/modules/settings/routes/data-model/fields/components/field-setup/field-setup-interface.vue +++ b/src/modules/settings/routes/data-model/fields/components/field-setup/field-setup-interface.vue @@ -29,7 +29,6 @@ export default defineComponent({ default: null, }, options: { - // eslint-disable-next-line @typescript-eslint/no-explicit-any type: Object as PropType, default: null, }, diff --git a/src/modules/settings/routes/data-model/fields/components/field-setup/field-setup.vue b/src/modules/settings/routes/data-model/fields/components/field-setup/field-setup.vue index 1bb2325a2c..2e0edb9cd1 100644 --- a/src/modules/settings/routes/data-model/fields/components/field-setup/field-setup.vue +++ b/src/modules/settings/routes/data-model/fields/components/field-setup/field-setup.vue @@ -120,7 +120,6 @@ export default defineComponent({ const isNew = computed(() => props.existingField === null); - // eslint-disable-next-line @typescript-eslint/no-explicit-any const edits = ref>({}); watch( @@ -302,7 +301,6 @@ export default defineComponent({ () => localType.value && ['relational', 'file', 'files'].includes(localType.value) ); - // eslint-disable-next-line @typescript-eslint/no-explicit-any const relationships: any[] = []; return { needsRelationalSetup, relationships }; @@ -325,7 +323,7 @@ export default defineComponent({ get() { return edits.value.options || props.existingField?.options; }, - // eslint-disable-next-line @typescript-eslint/no-explicit-any + set(newOptions: { [key: string]: any } | null) { edits.value = { ...edits.value, @@ -354,7 +352,7 @@ export default defineComponent({ get() { return edits.value.display_options || props.existingField?.display_options; }, - // eslint-disable-next-line @typescript-eslint/no-explicit-any + set(newOptions: { [key: string]: any } | null) { edits.value = { ...edits.value, diff --git a/src/modules/settings/routes/global/global.vue b/src/modules/settings/routes/global/global.vue index e40ad0d261..f33dea7ee5 100644 --- a/src/modules/settings/routes/global/global.vue +++ b/src/modules/settings/routes/global/global.vue @@ -36,7 +36,6 @@ export default defineComponent({ const initialValues = settingsStore.formatted; - // eslint-disable-next-line @typescript-eslint/no-explicit-any const edits = ref<{ [key: string]: any }>(null); const noEdits = computed( diff --git a/src/modules/settings/routes/presets/detail/detail.vue b/src/modules/settings/routes/presets/detail/detail.vue index c89890b73f..f668514017 100644 --- a/src/modules/settings/routes/presets/detail/detail.vue +++ b/src/modules/settings/routes/presets/detail/detail.vue @@ -101,9 +101,9 @@ type FormattedPreset = { collection: string; layout: string | null; name: string | null; - // eslint-disable-next-line @typescript-eslint/no-explicit-any + view_query: Record | null; - // eslint-disable-next-line @typescript-eslint/no-explicit-any + view_options: Record | null; filters: readonly Filter[] | null; }; @@ -228,7 +228,6 @@ export default defineComponent({ } function useValues() { - // eslint-disable-next-line @typescript-eslint/no-explicit-any const edits = ref({}); const hasEdits = computed(() => Object.keys(edits.value).length > 0); @@ -363,7 +362,6 @@ export default defineComponent({ }, }); - // eslint-disable-next-line @typescript-eslint/no-explicit-any users.value = response.data.data.map((user: any) => ({ name: user.first_name + ' ' + user.last_name, id: user.id, diff --git a/src/modules/settings/routes/roles/browse/browse.vue b/src/modules/settings/routes/roles/browse/browse.vue index 72c946c3a8..3ebf9231e6 100644 --- a/src/modules/settings/routes/roles/browse/browse.vue +++ b/src/modules/settings/routes/roles/browse/browse.vue @@ -71,7 +71,6 @@ import { LayoutComponent } from '@/layouts/types'; import useCollectionPreset from '@/composables/use-collection-preset'; type Item = { - // eslint-disable-next-line @typescript-eslint/no-explicit-any [field: string]: any; }; diff --git a/src/modules/settings/routes/roles/detail/components/permissions-statuses/permissions-statuses.vue b/src/modules/settings/routes/roles/detail/components/permissions-statuses/permissions-statuses.vue index c73b961320..8ab978c3a3 100644 --- a/src/modules/settings/routes/roles/detail/components/permissions-statuses/permissions-statuses.vue +++ b/src/modules/settings/routes/roles/detail/components/permissions-statuses/permissions-statuses.vue @@ -72,7 +72,6 @@ export default defineComponent({ const allowedStatuses = ref([]); const indeterminate = ref([]); - // eslint-disable-next-line @typescript-eslint/no-explicit-any const statusKeys = computed(() => props.statuses.map((status: any) => status.value)); const allAllowed = computed(() => { diff --git a/src/modules/settings/routes/roles/detail/detail.vue b/src/modules/settings/routes/roles/detail/detail.vue index d29954f1b1..26229eaaf7 100644 --- a/src/modules/settings/routes/roles/detail/detail.vue +++ b/src/modules/settings/routes/roles/detail/detail.vue @@ -101,7 +101,6 @@ import SaveOptions from '@/views/private/components/save-options'; import PermissionsManagement from './components/permissions-management'; type Values = { - // eslint-disable-next-line @typescript-eslint/no-explicit-any [field: string]: any; }; diff --git a/src/modules/settings/routes/webhooks/browse/browse.vue b/src/modules/settings/routes/webhooks/browse/browse.vue index 24d523dfc2..47b9585915 100644 --- a/src/modules/settings/routes/webhooks/browse/browse.vue +++ b/src/modules/settings/routes/webhooks/browse/browse.vue @@ -71,7 +71,6 @@ import { LayoutComponent } from '@/layouts/types'; import useCollectionPreset from '@/composables/use-collection-preset'; type Item = { - // eslint-disable-next-line @typescript-eslint/no-explicit-any [field: string]: any; }; diff --git a/src/modules/settings/routes/webhooks/detail/detail.vue b/src/modules/settings/routes/webhooks/detail/detail.vue index e1a67b5749..1d7695b675 100644 --- a/src/modules/settings/routes/webhooks/detail/detail.vue +++ b/src/modules/settings/routes/webhooks/detail/detail.vue @@ -91,7 +91,6 @@ import useItem from '@/composables/use-item'; import SaveOptions from '@/views/private/components/save-options'; type Values = { - // eslint-disable-next-line @typescript-eslint/no-explicit-any [field: string]: any; }; diff --git a/src/modules/users/routes/browse/browse.vue b/src/modules/users/routes/browse/browse.vue index ceecaaccfc..149e1a5be6 100644 --- a/src/modules/users/routes/browse/browse.vue +++ b/src/modules/users/routes/browse/browse.vue @@ -81,7 +81,6 @@ import LayoutDrawerDetail from '@/views/private/components/layout-drawer-detail' import SearchInput from '@/views/private/components/search-input'; type Item = { - // eslint-disable-next-line @typescript-eslint/no-explicit-any [field: string]: any; }; diff --git a/src/modules/users/routes/detail/detail.vue b/src/modules/users/routes/detail/detail.vue index d39c6fff24..0f355d0650 100644 --- a/src/modules/users/routes/detail/detail.vue +++ b/src/modules/users/routes/detail/detail.vue @@ -91,7 +91,6 @@ import useItem from '@/composables/use-item'; import SaveOptions from '@/views/private/components/save-options'; type Values = { - // eslint-disable-next-line @typescript-eslint/no-explicit-any [field: string]: any; }; @@ -164,7 +163,6 @@ export default defineComponent({ } async function saveAndStay() { - // eslint-disable-next-line @typescript-eslint/no-explicit-any const savedItem: Record = await save(); if (props.primaryKey === '+') { diff --git a/src/stores/collection-presets/types.ts b/src/stores/collection-presets/types.ts index b6e6c1d299..ba1fd98251 100644 --- a/src/stores/collection-presets/types.ts +++ b/src/stores/collection-presets/types.ts @@ -37,8 +37,8 @@ export type CollectionPreset = { search_query: string | null; filters: readonly Filter[] | null; view_type: string | null; - // eslint-disable-next-line @typescript-eslint/no-explicit-any + view_query: { [view_type: string]: any } | null; - // eslint-disable-next-line @typescript-eslint/no-explicit-any + view_options: { [view_type: string]: any } | null; }; diff --git a/src/stores/settings/settings.ts b/src/stores/settings/settings.ts index a4ddf6cb83..d6b49163ee 100644 --- a/src/stores/settings/settings.ts +++ b/src/stores/settings/settings.ts @@ -35,7 +35,7 @@ export const useSettingsStore = createStore({ async dehydrate() { this.reset(); }, - // eslint-disable-next-line @typescript-eslint/no-explicit-any + async updateSettings(updates: { [key: string]: any }) { const projectsStore = useProjectsStore(); const currentProjectKey = projectsStore.state.currentProjectKey; @@ -79,7 +79,6 @@ export const useSettingsStore = createStore({ this.state.settings = this.state.settings.map((setting) => { const updated = response.data.data.find( - // eslint-disable-next-line @typescript-eslint/no-explicit-any (update: any) => update.id === setting.id ); diff --git a/src/stores/settings/types.ts b/src/stores/settings/types.ts index db23d567bf..46e84b31a3 100644 --- a/src/stores/settings/types.ts +++ b/src/stores/settings/types.ts @@ -1,6 +1,6 @@ export type Setting = { id: number; key: string; - // eslint-disable-next-line @typescript-eslint/no-explicit-any + value: any; }; diff --git a/src/utils/filters-to-query/filters-to-query.ts b/src/utils/filters-to-query/filters-to-query.ts index b6375911b1..8f9dd43216 100644 --- a/src/utils/filters-to-query/filters-to-query.ts +++ b/src/utils/filters-to-query/filters-to-query.ts @@ -1,7 +1,6 @@ import { Filter } from '@/stores/collection-presets/types'; export default function filtersToQuery(filters: readonly Filter[]) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any const query: Record = {}; filters.forEach((filter) => { diff --git a/src/utils/move-in-array/move-in-array.ts b/src/utils/move-in-array/move-in-array.ts index c5bee6eac5..92505e6146 100644 --- a/src/utils/move-in-array/move-in-array.ts +++ b/src/utils/move-in-array/move-in-array.ts @@ -1,4 +1,3 @@ -// eslint-disable-next-line @typescript-eslint/no-explicit-any export default function moveInArray(array: readonly any[], fromIndex: number, toIndex: number) { const item = array[fromIndex]; const length = array.length; diff --git a/src/utils/register-component/register-component.ts b/src/utils/register-component/register-component.ts index eb215d4c79..6d6863c46b 100644 --- a/src/utils/register-component/register-component.ts +++ b/src/utils/register-component/register-component.ts @@ -2,7 +2,7 @@ import Vue, { Component } from 'vue'; function registerComponent(id: string, component: Component): void; function registerComponent(id: string, component: Parameters[1]): void; -// eslint-disable-next-line @typescript-eslint/no-explicit-any + function registerComponent(id: string, component: any) { Vue.component(id, component); } diff --git a/src/views/private/components/activity-drawer-detail/activity-drawer-detail.vue b/src/views/private/components/activity-drawer-detail/activity-drawer-detail.vue index 96085eb753..b47862569e 100644 --- a/src/views/private/components/activity-drawer-detail/activity-drawer-detail.vue +++ b/src/views/private/components/activity-drawer-detail/activity-drawer-detail.vue @@ -162,7 +162,6 @@ export default defineComponent({ }); } - // eslint-disable-next-line @typescript-eslint/no-explicit-any activity.value = records; } catch (error) { error.value = error; diff --git a/src/views/private/components/render-template/render-template.vue b/src/views/private/components/render-template/render-template.vue index 66c7e4db7a..0acc26de08 100644 --- a/src/views/private/components/render-template/render-template.vue +++ b/src/views/private/components/render-template/render-template.vue @@ -32,7 +32,6 @@ export default defineComponent({ required: true, }, item: { - // eslint-disable-next-line @typescript-eslint/no-explicit-any type: Object as PropType>, required: true, },