-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️ refactor(typescript): improving typesafety generally
- Loading branch information
1 parent
d8e06c2
commit 9b461e3
Showing
29 changed files
with
183 additions
and
128 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
8 changes: 8 additions & 0 deletions
8
src/frontend/design-system/components/Section/SectionBox/types.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,8 @@ | ||
import { ButtonIconTypes } from "../../Button/constants"; | ||
|
||
export interface ISectionBoxIconButton { | ||
action: string | (() => void); | ||
label?: string; | ||
icon?: ButtonIconTypes; | ||
order?: number; | ||
} |
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,32 @@ | ||
import { DATA_MUTATION_QUERY_ENDPOINTS } from "./portal"; | ||
|
||
export const ENTITY_TABLE_PATH = (entity: string) => | ||
`/api/data/${entity}/table`; | ||
|
||
export const ENTITY_COUNT_PATH = (entity: string) => | ||
`/api/data/${entity}/count`; | ||
|
||
export const ENTITY_DETAILS_PATH = ( | ||
entity: string, | ||
id: string, | ||
column?: string | ||
) => { | ||
const baseLink = `/api/data/${entity}/${id}`; | ||
|
||
if (column) { | ||
return `${baseLink}?column=${column}`; | ||
} | ||
return baseLink; | ||
}; | ||
|
||
export const ENTITY_REFERENCE_PATH = (entity: string, id: string) => | ||
`/api/data/${entity}/${id}/reference`; | ||
|
||
export const ENTITY_LIST_PATH = (entity: string) => `/api/data/${entity}/list`; | ||
|
||
export const CREATE_DATA_ENDPOINT_TO_CLEAR = (entity: string) => [ | ||
ENTITY_TABLE_PATH(entity), | ||
ENTITY_COUNT_PATH(entity), | ||
ENTITY_LIST_PATH(entity), | ||
...DATA_MUTATION_QUERY_ENDPOINTS(entity), | ||
]; |
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
10 changes: 9 additions & 1 deletion
10
src/frontend/lib/data/useMutate/useWaitForResponseMutationOptions.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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export { useDetailsViewMenuItems } from "./main"; | ||
export { useDetailsViewMenuItems, useSectionBoxIconButtons } from "./main"; |
Oops, something went wrong.