-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(frontend): integrate config settings with API (#2108)
- Loading branch information
Showing
30 changed files
with
4,694 additions
and
397 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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,27 @@ | ||
import {EResourceType, TResource} from 'types/Settings.types'; | ||
|
||
export type TRawConfig = { | ||
analyticsEnabled: boolean; | ||
id: string; | ||
name: string; | ||
}; | ||
|
||
type Config = { | ||
analyticsEnabled: boolean; | ||
id: string; | ||
name: string; | ||
}; | ||
|
||
function Config(rawConfig?: TResource<TRawConfig>): Config { | ||
return { | ||
analyticsEnabled: rawConfig?.spec?.analyticsEnabled ?? false, | ||
id: rawConfig?.spec?.id ?? 'current', | ||
name: rawConfig?.spec?.name ?? '', | ||
}; | ||
} | ||
|
||
export function rawToResource(spec: TRawConfig): TResource<TRawConfig> { | ||
return {spec, type: EResourceType.Config}; | ||
} | ||
|
||
export default Config; |
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,33 @@ | ||
import {EResourceType, TListResponse, TResource} from 'types/Settings.types'; | ||
|
||
export type TRawPolling = { | ||
id: string; | ||
maxWaitTimeForTrace: string; | ||
name: string; | ||
retryDelay: string; | ||
}; | ||
|
||
type Polling = { | ||
id: string; | ||
maxWaitTimeForTrace: string; | ||
name: string; | ||
retryDelay: string; | ||
}; | ||
|
||
function Polling(rawPollings?: TListResponse<TRawPolling>): Polling { | ||
const items = rawPollings?.items ?? []; | ||
const polling = items?.[0]; | ||
|
||
return { | ||
id: polling?.spec?.id ?? '', | ||
maxWaitTimeForTrace: polling?.spec?.maxWaitTimeForTrace ?? '', | ||
name: polling?.spec?.name ?? '', | ||
retryDelay: polling?.spec?.retryDelay ?? '', | ||
}; | ||
} | ||
|
||
export function rawToResource(spec: TRawPolling): TResource<TRawPolling> { | ||
return {spec, type: EResourceType.Polling}; | ||
} | ||
|
||
export default Polling; |
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.