Browse Source

Maintenance: Disable cache for autocomplete query in mobile view and removed no longer needed comments.

Dominik Klein 1 year ago
parent
commit
8f4bda435c

+ 1 - 5
app/frontend/apps/mobile/components/Form/fields/FieldAutoComplete/FieldAutoCompleteInputDialog.vue

@@ -101,9 +101,6 @@ const AutocompleteSearchDocument = gql`
   ${props.context.gqlQuery}
 `
 
-// TODO: Check the cache policy for this query, because already triggered searches are re-used from the cache and if
-//   the source was changed in the meantime, the result will not be updated. It's unclear if there is a subscription in
-//   place to update the result on any changes.
 const autocompleteQueryHandler = new QueryHandler(
   useLazyQuery(
     AutocompleteSearchDocument,
@@ -116,6 +113,7 @@ const autocompleteQueryHandler = new QueryHandler(
     }),
     () => ({
       enabled: !!(debouncedFilter.value || props.context.defaultFilter),
+      cachePolicy: 'no-cache', // Do not use cache, because we want always up-to-date results.
     }),
   ),
 )
@@ -349,8 +347,6 @@ useTraverseOptions(autocompleteList)
           >
             <span>{{ (option as AutoCompleteOption).heading }}</span>
           </span>
-          <!-- since it has fixed height, we add ellipsis on the first line -->
-          <!-- TODO: should it be fixed? or we should allow multiline with maximum lines (3?) -->
           <span
             :class="{
               'opacity-30': option.disabled,

+ 0 - 2
app/frontend/apps/mobile/components/Form/fields/FieldFile/FieldFileInput.vue

@@ -13,8 +13,6 @@ import { useFormUploadCacheAddMutation } from './graphql/mutations/uploadCache/a
 import { useFormUploadCacheRemoveMutation } from './graphql/mutations/uploadCache/remove.api.ts'
 import type { FieldFileProps } from './types.ts'
 
-// TODO: Add a test + story for this component.
-
 export interface Props {
   context: FormFieldContext<FieldFileProps>
 }

+ 0 - 1
app/frontend/apps/mobile/components/Organization/OrganizationItem.vue

@@ -48,7 +48,6 @@ const users = computed(() => {
       class="flex flex-1 flex-col overflow-hidden border-b border-white/10 py-3 text-gray-100"
     >
       <span class="truncate">
-        <!-- TODO: Should we show open or closed or nothing at all? -->
         {{
           entity.ticketsCount?.open === 1
             ? `1 ${$t('ticket')}`

+ 0 - 1
app/frontend/apps/mobile/components/User/UserItem.vue

@@ -24,7 +24,6 @@ const { stringUpdated } = useEditedBy(toRef(props, 'entity'))
       class="flex flex-1 flex-col overflow-hidden border-b border-white/10 py-3 text-gray-100"
     >
       <span class="truncate">
-        <!-- TODO: Should we show open or closed or nothing at all? -->
         {{
           entity.ticketsCount?.open === 1
             ? `1 ${$t('ticket')}`

+ 0 - 6
app/frontend/apps/mobile/components/layout/LayoutMain.vue

@@ -46,12 +46,6 @@ const { stickyStyles } = useStickyHeader([title], headerElement)
     >
       <!-- let's see how it feels without transition -->
       <RouterView />
-      <!-- TODO check when we will have more time -->
-      <!-- <router-view #default="{ Component }">
-        <TransitionViewNavigation>
-          <component :is="Component" />
-        </TransitionViewNavigation>
-      </router-view> -->
       <div v-if="showBottomNavigation" class="BottomNavigationPadding"></div>
     </main>
     <LayoutBottomNavigation v-if="showBottomNavigation" />

+ 0 - 1
app/frontend/apps/mobile/components/transition/TransitionViewNavigation/TransitionViewNavigation.story.vue

@@ -1,7 +1,6 @@
 <!-- Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/ -->
 
 <script setup lang="ts">
-// TODO doesn't work as expected
 import { defineComponent, h, ref } from 'vue'
 import { useViewTransition } from './useViewTransition.ts'
 import TransitionViewNavigation from './TransitionViewNavigation.vue'

+ 1 - 3
app/frontend/apps/mobile/components/transition/TransitionViewNavigation/TransitionViewNavigation.vue

@@ -15,9 +15,7 @@ const { viewTransition } = useViewTransition()
 </template>
 
 <style scoped>
-/* TODO: Styles needs to be aligned/beautified. */
-
-/* Example from: https://codesandbox.io/s/zq5mw2zk9x */
+/* First example idea from: https://codesandbox.io/s/zq5mw2zk9x */
 main {
   grid-template: 'main';
 }

+ 0 - 1
app/frontend/apps/mobile/entities/user/composables/useUserCreate.ts

@@ -34,7 +34,6 @@ export const useUserCreate = () => {
   const onSuccess = (data: { userAdd: UserAddPayload }) => {
     const { internalId } = data.userAdd.user as User
 
-    // TODO change when actually implemented
     router.push(`/users/${internalId}`)
   }
 

+ 1 - 0
app/frontend/apps/mobile/entities/user/composables/useUserEdit.ts

@@ -77,6 +77,7 @@ export const useUserEdit = () => {
           formChangeFields.organization_id.help = msg
 
           // TODO: helpClass is not reactive right now, should be fine with a future FormKit version
+          // We need to implement the mention workaround: https://github.com/formkit/formkit/issues/828
           formChangeFields.organization_id.helpClass = helpClass
         }
       },

+ 1 - 1
app/frontend/apps/mobile/form/defineFormSchema.ts

@@ -6,7 +6,7 @@ type FormSchemaOptions = {
   showDirtyMark: boolean
 }
 
-// TODO: do we need this?
+// TODO: do we need this in future like that?
 export const defineFormSchema = (
   schema: FormSchemaNode[],
   options?: FormSchemaOptions,

Some files were not shown because too many files changed in this diff