generated from bcgov/quickstart-openshift
-
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.
Feat/497 connect backend and frontend for client search (#831)
* fix: client search on edit seedlot info * feat: integrate endpoint * feat: refactor client search table and modal * fix: better constants
- Loading branch information
Showing
18 changed files
with
232 additions
and
395 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
16 changes: 16 additions & 0 deletions
16
frontend/src/components/ApplicantAgencyFields/ClientSearchModal/constants.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,16 @@ | ||
import { ClientSearchDropdown } from './definitions'; | ||
|
||
export const clientSearchOptions: Array<ClientSearchDropdown> = [ | ||
{ | ||
label: 'Full name', | ||
option: 'client_name' | ||
}, | ||
{ | ||
label: 'Acronym', | ||
option: 'acronym' | ||
}, | ||
{ | ||
label: 'Number', | ||
option: 'client_number' | ||
} | ||
]; |
39 changes: 0 additions & 39 deletions
39
frontend/src/components/ApplicantAgencyFields/ClientSearchModal/constants.tsx
This file was deleted.
Oops, something went wrong.
10 changes: 3 additions & 7 deletions
10
frontend/src/components/ApplicantAgencyFields/ClientSearchModal/definitions.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,27 +1,23 @@ | ||
import { UseMutationResult } from '@tanstack/react-query'; | ||
import { ForestClientSearchType } from '../../../types/ForestClientTypes/ForestClientSearchType'; | ||
|
||
export interface ClientSearchModalProps { | ||
linkText: string; | ||
modalLabel: string; | ||
applySelectedClient: Function; | ||
} | ||
|
||
export type ClientSearchOptions = 'acronym' | 'fullName' | 'number'; | ||
export type ClientSearchOptions = 'acronym' | 'client_name' | 'client_number'; | ||
|
||
export type ClientSearchDropdown = { | ||
label: string; | ||
option: ClientSearchOptions | ||
}; | ||
|
||
export type MutationParams = { | ||
word: string; | ||
option: ClientSearchOptions | ||
}; | ||
|
||
export type ClientSearchFieldsProps = { | ||
searchWord: string, | ||
setSearchWord: Function, | ||
searchOption: ClientSearchDropdown, | ||
setSearchOption: Function, | ||
mutationFn: UseMutationResult<unknown, Error, MutationParams, unknown> | ||
mutationFn: UseMutationResult<ForestClientSearchType[], unknown, void, unknown> | ||
}; |
Oops, something went wrong.