forked from zammad/zammad
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: Mobile - Fix sender/type handling when creating an article.
- Loading branch information
1 parent
84dab1e
commit 9f670d2
Showing
25 changed files
with
692 additions
and
262 deletions.
There are no files selected for viewing
4 changes: 3 additions & 1 deletion
4
...tend/shared/entities/ticket-article/action/plugins/__tests__/article-action-types.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
app/frontend/shared/entities/ticket-article/action/plugins/__tests__/type-web.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/ | ||
|
||
import { defaultTicket } from '@mobile/pages/ticket/__tests__/mocks/detail-view' | ||
import { mockPermissions } from '@tests/support/mock-permissions' | ||
import { createTestArticleTypes } from './utils' | ||
|
||
describe('web type', () => { | ||
it('customer does get web type', () => { | ||
mockPermissions(['ticket.customer']) | ||
const { ticket } = defaultTicket() | ||
|
||
const types = createTestArticleTypes(ticket) | ||
|
||
expect(types).toContainEqual(expect.objectContaining({ value: 'web' })) | ||
}) | ||
|
||
it('agent does not get web type', () => { | ||
mockPermissions(['ticket.agent']) | ||
const { ticket } = defaultTicket() | ||
|
||
const types = createTestArticleTypes(ticket) | ||
|
||
expect(types).not.toContainEqual(expect.objectContaining({ value: 'web' })) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
app/frontend/shared/entities/ticket-article/action/plugins/web.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/ | ||
|
||
import type { TicketArticleActionPlugin, TicketArticleType } from './types' | ||
|
||
const actionPlugin: TicketArticleActionPlugin = { | ||
order: 100, | ||
|
||
addTypes() { | ||
const type: TicketArticleType = { | ||
apps: ['mobile'], | ||
value: 'web', | ||
label: __('Web'), | ||
icon: { | ||
mobile: 'mobile-web', | ||
}, | ||
view: { | ||
customer: ['change'], | ||
}, | ||
attributes: ['attachments'], | ||
internal: false, | ||
} | ||
return [type] | ||
}, | ||
} | ||
|
||
export default actionPlugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.