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.
Fixes: Mobile - Fixed problems with customer and organization field i…
…n the ticket create.
- Loading branch information
1 parent
456c482
commit c4de870
Showing
25 changed files
with
171 additions
and
59 deletions.
There are no files selected for viewing
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
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
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
8 changes: 6 additions & 2 deletions
8
app/frontend/shared/entities/organization/utils/getAutoCompleteOption.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 |
---|---|---|
@@ -1,12 +1,16 @@ | ||
// Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/ | ||
|
||
import type { Organization } from '@shared/graphql/types' | ||
import { ensureGraphqlId } from '@shared/graphql/utils' | ||
|
||
export const getAutoCompleteOption = (organization: Partial<Organization>) => { | ||
return { | ||
label: organization.name, | ||
value: organization.internalId, | ||
// disabled: !object.active, // TODO: we can not use disabled for the active/inactive flag, because it will be no longer possible to select the option | ||
value: | ||
organization.internalId || | ||
(organization.id | ||
? ensureGraphqlId('Organization', organization.id) | ||
: null), | ||
organization, | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/ | ||
|
||
import {convertToGraphQLId, isGraphQLId, ensureGraphqlId, getIdFromGraphQLId} from '../utils' | ||
|
||
describe('isGraphQLId', () => { | ||
it('check for valid id', async () => { | ||
expect(isGraphQLId('gid://zammad/Organization/1')).toBe(true) | ||
}) | ||
|
||
it('check for invalid id', async () => { | ||
expect(isGraphQLId('invalid')).toBe(false) | ||
}) | ||
}) | ||
|
||
describe('convertToGraphQLId', () => { | ||
it('check convertion', async () => { | ||
expect(convertToGraphQLId('Organization', 1)).toBe('gid://zammad/Organization/1') | ||
}) | ||
}) | ||
|
||
describe('convertToGraphQLId', () => { | ||
it('check convertion', async () => { | ||
expect(convertToGraphQLId('Organization', 1)).toBe('gid://zammad/Organization/1') | ||
}) | ||
}) | ||
|
||
describe('ensureGraphqlId', () => { | ||
it('check that we have always a GraphQL id', async () => { | ||
expect(ensureGraphqlId('Organization', 1)).toBe('gid://zammad/Organization/1') | ||
}) | ||
|
||
it('check that we have always a GraphQL id (also when it has the correct format)', async () => { | ||
expect(ensureGraphqlId('Organization', 'gid://zammad/Organization/1')).toBe('gid://zammad/Organization/1') | ||
}) | ||
}) | ||
|
||
describe('getIdFromGraphQLId', () => { | ||
it('check that ID can parsed from graphqlId ', async () => { | ||
expect(getIdFromGraphQLId('gid://zammad/Organization/1')).toBe(1) | ||
}) | ||
}) |
Oops, something went wrong.