-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: custom api code generator and fix chat locking when saving (#…
…3618) * Removed saveLoading from the chat * Fixed initialSetup that couldnt be null * Added types for get codes type * Added new types for getCodes and initialSetup on Tweaks store * Created a use custom api code to return all code * Passed the getCodes from the custom hook into initialSetup * Updated tabs array to receive object * Update every code to get correct props * Update tweaks store to handle refactored getCodes and createTabsArray * Added custom api generator component on top of the codetabscomponent
- Loading branch information
1 parent
10d0336
commit 32d51b6
Showing
15 changed files
with
178 additions
and
128 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
src/frontend/src/customization/components/custom-api-generator.tsx
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,3 @@ | ||
export function CustomAPIGenerator() { | ||
return <></>; | ||
} |
19 changes: 19 additions & 0 deletions
19
src/frontend/src/customization/hooks/use-custom-api-code.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,19 @@ | ||
import { | ||
getCurlRunCode, | ||
getCurlWebhookCode, | ||
} from "@/modals/apiModal/utils/get-curl-code"; | ||
import getJsApiCode from "@/modals/apiModal/utils/get-js-api-code"; | ||
import getPythonApiCode from "@/modals/apiModal/utils/get-python-api-code"; | ||
import getPythonCode from "@/modals/apiModal/utils/get-python-code"; | ||
import getWidgetCode from "@/modals/apiModal/utils/get-widget-code"; | ||
|
||
export function useCustomAPICode() { | ||
return { | ||
getCurlRunCode, | ||
getCurlWebhookCode, | ||
getJsApiCode, | ||
getPythonApiCode, | ||
getPythonCode, | ||
getWidgetCode, | ||
}; | ||
} |
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
Oops, something went wrong.