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

Feature: Mobile - Implement article actions layer

Vladimir Sheremet 2 лет назад
Родитель
Сommit
8854a62dd7

+ 3 - 2
app/frontend/apps/mobile/pages/ticket/__tests__/ticket-detail-view.spec.ts

@@ -4,7 +4,7 @@ const now = new Date(2022, 1, 1, 0, 0, 0, 0)
 vi.setSystemTime(now)
 
 import { ApolloError } from '@apollo/client/errors'
-import { TicketArticleRetrySecurityProcessDocument } from '@shared/entities/article/graphql/mutations/ticketArticleRetrySecurityProcess.api'
+import { TicketArticleRetrySecurityProcessDocument } from '@shared/entities/ticket-article/graphql/mutations/ticketArticleRetrySecurityProcess.api'
 import type { TicketArticleRetrySecurityProcessMutation } from '@shared/graphql/types'
 import { getAllByTestId, getByLabelText } from '@testing-library/vue'
 import { getByIconName } from '@tests/support/components/iconQueries'
@@ -179,7 +179,8 @@ test('show article context on click', async () => {
   await view.events.click(contextTriggers[0])
 
   expect(view.getByText('Set to internal')).toBeInTheDocument()
-  expect(view.getByText('Reply')).toBeInTheDocument()
+  expect(view.getByText('Split')).toBeInTheDocument()
+  // expect(view.getByText('Reply')).toBeInTheDocument()
 
   // TODO actions itself should be tested when reply will be implemented
 })

+ 1 - 1
app/frontend/apps/mobile/pages/ticket/components/TicketDetailView/ArticleBubble.vue

@@ -17,8 +17,8 @@ import useImageViewer from '@shared/composables/useImageViewer'
 import CommonFilePreview from '@mobile/components/CommonFilePreview/CommonFilePreview.vue'
 import stopEvent from '@shared/utils/events'
 import { getIdFromGraphQLId } from '@shared/graphql/utils'
+import type { TicketArticleAttachment } from '@shared/entities/ticket/types'
 import { useArticleToggleMore } from '../../composable/useArticleToggleMore'
-import type { TicketArticleAttachment } from '../../types/tickets'
 import { useArticleAttachments } from '../../composable/useArticleAttachments'
 import ArticleSecurityBadge from './ArticleSecurityBadge.vue'
 

+ 1 - 1
app/frontend/apps/mobile/pages/ticket/components/TicketDetailView/ArticleMetadataAddress.vue

@@ -3,7 +3,7 @@
 <script setup lang="ts">
 import CommonSectionMenuItem from '@mobile/components/CommonSectionMenu/CommonSectionMenuItem.vue'
 import { computed } from 'vue'
-import type { TicketArticle } from '../../types/tickets'
+import type { TicketArticle } from '@shared/entities/ticket/types'
 
 interface Props {
   address?: TicketArticle['from']

+ 2 - 2
app/frontend/apps/mobile/pages/ticket/components/TicketDetailView/ArticleMetadataDialog.vue

@@ -1,14 +1,14 @@
 <!-- Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/ -->
 
 <script setup lang="ts">
-import { getArticleChannelIcon } from '@shared/entities/article/composables/getArticleChannelIcon'
+import { getArticleChannelIcon } from '@shared/entities/ticket-article/composables/getArticleChannelIcon'
 import CommonDialog from '@mobile/components/CommonDialog/CommonDialog.vue'
 import CommonSectionMenu from '@mobile/components/CommonSectionMenu/CommonSectionMenu.vue'
 import CommonSectionMenuItem from '@mobile/components/CommonSectionMenu/CommonSectionMenuItem.vue'
 import { computed } from 'vue'
 import { i18n } from '@shared/i18n'
+import type { TicketArticle } from '@shared/entities/ticket/types'
 import ArticleMetadataAddress from './ArticleMetadataAddress.vue'
-import type { TicketArticle } from '../../types/tickets'
 
 interface Props {
   name: string

+ 2 - 5
app/frontend/apps/mobile/pages/ticket/components/TicketDetailView/ArticleSecurityBadge.vue

@@ -6,7 +6,7 @@ import {
   NotificationTypes,
   useNotifications,
 } from '@shared/components/CommonNotifications'
-import { useTicketArticleRetrySecurityProcessMutation } from '@shared/entities/article/graphql/mutations/ticketArticleRetrySecurityProcess.api'
+import { useTicketArticleRetrySecurityProcessMutation } from '@shared/entities/ticket-article/graphql/mutations/ticketArticleRetrySecurityProcess.api'
 import type { TicketArticleSecurityState } from '@shared/graphql/types'
 import { i18n } from '@shared/i18n'
 import { MutationHandler } from '@shared/server/apollo/handler'
@@ -160,10 +160,7 @@ const popupItems = computed(() =>
       :label="$t('Signed')"
     />
   </button>
-  <CommonSectionPopup
-    v-model:state="showPopup"
-    :items="popupItems"
-  >
+  <CommonSectionPopup v-model:state="showPopup" :items="popupItems">
     <template #header>
       <div
         class="flex flex-col items-center gap-2 border-b border-b-white/10 p-4"

+ 4 - 4
app/frontend/apps/mobile/pages/ticket/components/TicketDetailView/ArticlesList.vue

@@ -4,19 +4,19 @@
 // TODO scroll to bottom when data is loaded(?)
 import { toRef, shallowRef } from 'vue'
 import CommonSectionPopup from '@mobile/components/CommonSectionPopup/CommonSectionPopup.vue'
+import type { TicketArticle, TicketById } from '@shared/entities/ticket/types'
 import ArticleBubble from './ArticleBubble.vue'
 import ArticlesPullDown from './ArticlesPullDown.vue'
 import ArticleSeparatorNew from './ArticleSeparatorNew.vue'
 import ArticleSeparatorMore from './ArticleSeparatorMore.vue'
 import ArticleSeparatorDate from './ArticleSeparatorDate.vue'
-import type { TicketArticle } from '../../types/tickets'
 import { useTicketArticleRows } from '../../composable/useTicketArticlesRows'
 import { useTicketArticleContext } from '../../composable/useTicketArticleContext'
 import ArticleSystem from './ArticleSystem.vue'
 
 interface Props {
   articles: TicketArticle[]
-  ticketInternalId: number
+  ticket: TicketById
   totalCount: number
 }
 
@@ -78,10 +78,10 @@ const filterAttachments = (article: TicketArticle) => {
             : 'right'
         "
         :security="row.article.securityState"
-        :ticket-internal-id="ticketInternalId"
+        :ticket-internal-id="ticket.internalId"
         :article-id="row.article.id"
         :attachments="filterAttachments(row.article)"
-        @show-context="showArticleContext(row.article, ticketInternalId)"
+        @show-context="showArticleContext(row.article, ticket)"
       />
       <ArticleSystem
         v-if="row.type === 'system'"

+ 2 - 2
app/frontend/apps/mobile/pages/ticket/components/TicketDetailView/TicketAction/TicketActionChangeCustomerDialog.vue

@@ -19,9 +19,9 @@ import UserError from '@shared/errors/UserError'
 import { useTicketCustomerUpdateMutation } from '@shared/entities/ticket/graphql/mutations/customerUpdate.api'
 import CommonDialog from '@mobile/components/CommonDialog/CommonDialog.vue'
 import { defineFormSchema } from '@mobile/form/defineFormSchema'
-import type { TicketById } from '@mobile/pages/ticket/types/tickets'
+import type { TicketById } from '@shared/entities/ticket/types'
 // No usage of "type" because of: https://github.com/typescript-eslint/typescript-eslint/issues/5468
-import { TicketCustomerUpdateFormData } from '@mobile/pages/ticket/types/tickets'
+import { TicketCustomerUpdateFormData } from '@shared/entities/ticket/types'
 import { useConfirmationDialog } from '@mobile/components/CommonConfirmation'
 
 export interface Props {

+ 1 - 1
app/frontend/apps/mobile/pages/ticket/components/TicketDetailView/TicketActionsDialog.vue

@@ -11,8 +11,8 @@ import CommonSectionMenuLink from '@mobile/components/CommonSectionMenu/CommonSe
 import CommonSectionMenu from '@mobile/components/CommonSectionMenu/CommonSectionMenu.vue'
 import CommonButtonGroup from '@mobile/components/CommonButtonGroup/CommonButtonGroup.vue'
 import CommonDialog from '@mobile/components/CommonDialog/CommonDialog.vue'
+import type { TicketById } from '@shared/entities/ticket/types'
 import { useTicketsMerge } from '../../composable/useTicketsMerge'
-import type { TicketById } from '../../types/tickets'
 import { useTicketSubscribe } from '../../composable/useTicketSubscribe'
 
 // TODO I think the complete dialog should not be available for none agent user (and maybe also for agents without write permission?)

+ 1 - 1
app/frontend/apps/mobile/pages/ticket/components/TicketDetailView/TicketDetailViewHeader.vue

@@ -8,7 +8,7 @@ import { useDialog } from '@shared/composables/useDialog'
 import CommonLoader from '@mobile/components/CommonLoader/CommonLoader.vue'
 import CommonBackButton from '@mobile/components/CommonBackButton/CommonBackButton.vue'
 import { useSessionStore } from '@shared/stores/session'
-import type { TicketById } from '../../types/tickets'
+import type { TicketById } from '@shared/entities/ticket/types'
 
 interface Props {
   ticket?: TicketById

+ 1 - 1
app/frontend/apps/mobile/pages/ticket/components/TicketDetailView/TicketDetailViewTitle.vue

@@ -5,7 +5,7 @@ import CommonTicketPriorityIndicator from '@shared/components/CommonTicketPriori
 import CommonUserAvatar from '@shared/components/CommonUserAvatar/CommonUserAvatar.vue'
 import CommonTicketStateIndicator from '@shared/components/CommonTicketStateIndicator/CommonTicketStateIndicator.vue'
 import { computed } from 'vue'
-import type { TicketById } from '../../types/tickets'
+import type { TicketById } from '@shared/entities/ticket/types'
 
 interface Props {
   ticket: TicketById

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