-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ui/feat/custom-oauth-app-implementation (#368)
* UI chore: rename customApp to appOverride in oauth apps workflow Signed-off-by: Ryan Hopper-Lowe <[email protected]> * feat: implement hook to fetch custom oauth apps * UI feat: implement basic custom OAuth app workflow Signed-off-by: Ryan Hopper-Lowe <[email protected]> --------- Signed-off-by: Ryan Hopper-Lowe <[email protected]>
- Loading branch information
1 parent
b511ee2
commit 28bbb1d
Showing
22 changed files
with
506 additions
and
108 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
60 changes: 60 additions & 0 deletions
60
ui/admin/app/components/oauth-apps/custom/CreateCustomOAuthApp.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,60 @@ | ||
import { PlusIcon } from "lucide-react"; | ||
import { useState } from "react"; | ||
import { mutate } from "swr"; | ||
|
||
import { OauthAppService } from "~/lib/service/api/oauthAppService"; | ||
|
||
import { Button } from "~/components/ui/button"; | ||
import { | ||
Dialog, | ||
DialogContent, | ||
DialogDescription, | ||
DialogHeader, | ||
DialogTitle, | ||
DialogTrigger, | ||
} from "~/components/ui/dialog"; | ||
import { useAsync } from "~/hooks/useAsync"; | ||
|
||
import { CustomOAuthAppForm } from "./CustomOAuthAppForm"; | ||
|
||
export function CreateCustomOAuthApp() { | ||
const [isOpen, setIsOpen] = useState(false); | ||
|
||
const createApp = useAsync(OauthAppService.createOauthApp, { | ||
onSuccess: () => { | ||
setIsOpen(false); | ||
mutate(OauthAppService.getOauthApps.key()); | ||
}, | ||
}); | ||
|
||
return ( | ||
<Dialog open={isOpen} onOpenChange={setIsOpen}> | ||
<DialogTrigger asChild> | ||
<Button variant="outline" className="flex items-center gap-2"> | ||
<PlusIcon className="h-4 w-4" /> Create a Custom OAuth App | ||
</Button> | ||
</DialogTrigger> | ||
|
||
<DialogContent> | ||
<DialogHeader> | ||
<DialogTitle>Create Custom OAuth App</DialogTitle> | ||
</DialogHeader> | ||
|
||
<DialogDescription hidden> | ||
Create Custom OAuth App | ||
</DialogDescription> | ||
|
||
<CustomOAuthAppForm | ||
onSubmit={(data) => | ||
createApp.execute({ | ||
type: "custom", | ||
global: true, | ||
refName: data.integration, | ||
...data, | ||
}) | ||
} | ||
/> | ||
</DialogContent> | ||
</Dialog> | ||
); | ||
} |
Oops, something went wrong.