Просмотр исходного кода

Maintenance: Fix silent and no-op type checking.

Dusan Vuckovic 8 месяцев назад
Родитель
Сommit
06f44c7f38

+ 1 - 1
app/frontend/apps/desktop/components/CommonActionMenu/CommonActionMenu.vue

@@ -7,7 +7,7 @@ import CommonPopover from '#shared/components/CommonPopover/CommonPopover.vue'
 import type {
   Orientation,
   Placement,
-} from '#shared/components/CommonPopover/types'
+} from '#shared/components/CommonPopover/types.ts'
 import { usePopover } from '#shared/components/CommonPopover/usePopover.ts'
 import type { ObjectLike } from '#shared/types/utils.ts'
 import getUuid from '#shared/utils/getUuid.ts'

+ 2 - 2
app/frontend/apps/desktop/components/Form/fields/FieldCustomer/FieldCustomerOptionIcon.vue

@@ -3,10 +3,10 @@
 <script setup lang="ts">
 import CommonOrganizationAvatar from '#shared/components/CommonOrganizationAvatar/CommonOrganizationAvatar.vue'
 import CommonUserAvatar from '#shared/components/CommonUserAvatar/CommonUserAvatar.vue'
-import type { AutoCompleteCustomerOption } from '#shared/components/Form/fields/FieldCustomer/types.ts'
+import type { AutoCompleteCustomerGenericOption } from '#shared/components/Form/fields/FieldCustomer/types.ts'
 
 defineProps<{
-  option: AutoCompleteCustomerOption
+  option: AutoCompleteCustomerGenericOption
 }>()
 </script>
 

+ 4 - 3
app/frontend/apps/desktop/components/Form/fields/FieldCustomer/FieldCustomerWrapper.vue

@@ -5,7 +5,7 @@ import { markRaw } from 'vue'
 import type { SelectValue } from '#shared/components/CommonSelect/types.ts'
 import type { AutoCompleteOption } from '#shared/components/Form/fields/FieldAutocomplete/types.ts'
 import { AutocompleteSearchGenericDocument } from '#shared/components/Form/fields/FieldCustomer/graphql/queries/autocompleteSearch/generic.api.ts'
-import type { AutoCompleteCustomerOption } from '#shared/components/Form/fields/FieldCustomer/types.ts'
+import type { AutoCompleteCustomerGenericOption } from '#shared/components/Form/fields/FieldCustomer/types.ts'
 import type { FormFieldContext } from '#shared/components/Form/types/field.ts'
 import type { User } from '#shared/graphql/types.ts'
 import type { ObjectLike } from '#shared/types/utils.ts'
@@ -20,7 +20,7 @@ import type { AutoCompleteProps } from '../FieldAutoComplete/types.ts'
 interface Props {
   context: FormFieldContext<
     AutoCompleteProps & {
-      options?: AutoCompleteCustomerOption[]
+      options?: AutoCompleteCustomerGenericOption[]
     }
   >
 }
@@ -59,7 +59,8 @@ Object.assign(props.context, {
     onlyIn: ['User', 'Organization'],
   },
   autocompleteOptionsPreprocessor: (
-    autocompleteOptions: (AutoCompleteCustomerOption & AutoCompleteOption)[],
+    autocompleteOptions: (AutoCompleteCustomerGenericOption &
+      AutoCompleteOption)[],
   ) =>
     autocompleteOptions.map((autocompleteOption) => {
       if (

+ 1 - 0
app/frontend/apps/desktop/components/NavigationMenu/NavigationMenu.vue

@@ -30,6 +30,7 @@ const permittedEntries = computed(() => {
     (memo, entries, category) => {
       memo[category] = entries.filter((entry) => {
         if (
+          typeof entry.route === 'object' &&
           entry.route.meta?.requiredPermission &&
           !session.hasPermission(entry.route.meta.requiredPermission)
         )

+ 6 - 4
app/frontend/apps/desktop/pages/dashboard/views/Playground.vue

@@ -22,6 +22,7 @@ import type {
 } from '#shared/components/Form/types.ts'
 import { useConfirmation } from '#shared/composables/useConfirmation.ts'
 import { defineFormSchema } from '#shared/form/defineFormSchema.ts'
+import { EnumObjectManagerObjects } from '#shared/graphql/types.ts'
 import { useApplicationStore } from '#shared/stores/application.ts'
 import { useSessionStore } from '#shared/stores/session.ts'
 
@@ -39,7 +40,6 @@ import type { MenuItem } from '#desktop/components/CommonPopoverMenu/types.ts'
 import CommonProgressBar from '#desktop/components/CommonProgressBar/CommonProgressBar.vue'
 import CommonSimpleTable from '#desktop/components/CommonSimpleTable/CommonSimpleTable.vue'
 import CommonTabManager from '#desktop/components/CommonTabManager/CommonTabManager.vue'
-import type { Tab } from '#desktop/components/CommonTabManager/types.ts'
 import { useTabManager } from '#desktop/components/CommonTabManager/useTabManager.ts'
 import LayoutContent from '#desktop/components/layout/LayoutContent.vue'
 import ThemeSwitch from '#desktop/components/ThemeSwitch/ThemeSwitch.vue'
@@ -642,7 +642,7 @@ const formSchema = defineFormSchema([
     type: 'externalDataSource',
     name: 'external_data_source',
     label: 'External Data Source',
-    object: 'Ticket',
+    object: EnumObjectManagerObjects.Ticket,
     help: 'Please add external_data_source attribute on Ticket object. Otherwise this field will not work.',
   },
   {
@@ -831,7 +831,9 @@ const formSchema = defineFormSchema([
     type: 'file',
     name: 'file',
     label: 'Attachment',
-    multiple: true,
+    props: {
+      multiple: true,
+    },
   },
   {
     type: 'toggleButtons',
@@ -1071,7 +1073,7 @@ const changeRow = () => {
 
 const { activeTab } = useTabManager<string>()
 
-const { activeTab: activeFilters } = useTabManager<Tab[]>()
+const { activeTab: activeFilters } = useTabManager<string[]>()
 
 const popoverOrientation: Ref<Orientation> = ref('autoVertical')
 const popoverOrientationOptions = [

+ 4 - 4
app/frontend/apps/desktop/pages/guided-setup/components/GuidedSetupActionFooter.vue

@@ -21,7 +21,7 @@ interface Props {
   goBackRoute?: RouteLocationRaw
   onSkip?: () => void
   onContinue?: () => void
-  onBack?: () => void
+  onGoBack?: () => void
   onSubmit?: () => void
   submitButtonText?: string
   submitButtonVariant?: ButtonVariant
@@ -36,7 +36,7 @@ const props = withDefaults(defineProps<Props>(), {
 
 const emit = defineEmits<{
   submit: []
-  back: []
+  'go-back': []
   skip: []
   continue: []
 }>()
@@ -54,7 +54,7 @@ const localSubmitButtonText = computed(() => {
 })
 
 const goBack = () => {
-  if (props.onBack) emit('back')
+  if (props.onGoBack) emit('go-back')
 
   if (props.goBackRoute) router.push(props.goBackRoute)
 }
@@ -79,7 +79,7 @@ const submit = () => {
 <template>
   <LayoutPublicPageBoxActions>
     <CommonButton
-      v-if="goBackRoute || onBack"
+      v-if="goBackRoute || onGoBack"
       variant="secondary"
       size="large"
       :disabled="isDisabled"

+ 4 - 3
app/frontend/apps/desktop/pages/guided-setup/components/__tests__/GuidedSetupActionFooter.spec.ts

@@ -118,10 +118,11 @@ describe('GuidedSetupActionFooter.vue', () => {
   })
 
   it('renders back button when event registration exists', async () => {
-    const onBack = vi.fn()
+    const onGoBack = vi.fn()
+
     const view = renderComponent(GuidedSetupActionFooter, {
       props: {
-        onBack,
+        onGoBack,
       },
       ...wrapperParameters,
     })
@@ -132,7 +133,7 @@ describe('GuidedSetupActionFooter.vue', () => {
 
     await view.events.click(goBackButton)
 
-    expect(onBack).toHaveBeenCalledOnce()
+    expect(onGoBack).toHaveBeenCalledOnce()
   })
 
   it('renders skip button when route is given', () => {

+ 1 - 1
app/frontend/apps/desktop/pages/guided-setup/views/GuidedSetupImport/GuidedSetupImportSelection.vue

@@ -55,6 +55,6 @@ const unlockCallback = () => {
     </template>
   </CommonButtonGroup>
   <GuidedSetupActionFooter
-    @back="systemSetupInfoStore.systemSetupUnlock(unlockCallback)"
+    @go-back="systemSetupInfoStore.systemSetupUnlock(unlockCallback)"
   />
 </template>

+ 1 - 1
app/frontend/apps/desktop/pages/guided-setup/views/GuidedSetupImport/GuidedSetupImportSource/GuidedSetupImportSource.vue

@@ -55,7 +55,7 @@ const { form, debouncedLoading, onContinueButtonCallback } = useImportSource()
       :submit-button-type="onContinueButtonCallback ? 'button' : 'submit'"
       :submit-button-variant="onContinueButtonCallback ? 'primary' : 'submit'"
       :on-submit="onContinueButtonCallback"
-      @back="goBack()"
+      @go-back="goBack()"
       @submit="onContinueButtonCallback"
     />
   </div>

+ 1 - 1
app/frontend/apps/desktop/pages/guided-setup/views/GuidedSetupManual/GuidedSetupManualAdmin.vue

@@ -86,6 +86,6 @@ const unlockCallback = () => {
   <GuidedSetupActionFooter
     :form="form"
     :submit-button-text="__('Create account')"
-    @back="systemSetupUnlock(unlockCallback)"
+    @go-back="systemSetupUnlock(unlockCallback)"
   />
 </template>

Некоторые файлы не были показаны из-за большого количества измененных файлов