Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ui): adjust SSO credential form styling #3742

Merged
merged 3 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,8 @@ export function LDAPCredentialForm({
</FormItem>
)}
/>
<div className="mt-4">
<Separator className="my-2" />
<div className="flex flex-col gap-4 sm:flex-row sm:justify-between">
<Button
onClick={onTestLdapCredential}
type="button"
Expand All @@ -465,66 +466,63 @@ export function LDAPCredentialForm({
<IconSpinner className="mr-2 h-4 w-4 animate-spin" />
)}
</Button>
</div>

<Separator />

<div className="flex justify-end gap-4">
<Button
type="button"
variant="ghost"
onClick={navigateToSSOSettings}
>
Back
</Button>
{!isNew && (
<AlertDialog
open={deleteAlertVisible}
onOpenChange={setDeleteAlertVisible}
<div className="flex items-center justify-end gap-4 sm:justify-start">
<Button
type="button"
variant="ghost"
onClick={navigateToSSOSettings}
>
<AlertDialogTrigger asChild>
<Button variant="hover-destructive">Delete</Button>
</AlertDialogTrigger>
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>
Are you absolutely sure?
</AlertDialogTitle>
<AlertDialogDescription>
This action cannot be undone. It will permanently delete
the current credential.
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel>Cancel</AlertDialogCancel>
<AlertDialogAction
className={buttonVariants({ variant: 'destructive' })}
onClick={onDelete}
>
{isDeleting && (
<IconSpinner className="mr-2 h-4 w-4 animate-spin" />
)}
Yes, delete it
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
)}
<LicenseGuard licenses={[LicenseType.Enterprise]}>
{({ hasValidLicense }) => (
<Button
type="submit"
disabled={
!hasValidLicense || isSubmitting || (!isNew && !isDirty)
}
Back
</Button>
{!isNew && (
<AlertDialog
open={deleteAlertVisible}
onOpenChange={setDeleteAlertVisible}
>
{isSubmitting && (
<IconSpinner className="mr-2 h-4 w-4 animate-spin" />
)}
{isNew ? 'Create' : 'Update'}
</Button>
<AlertDialogTrigger asChild>
<Button variant="hover-destructive">Delete</Button>
</AlertDialogTrigger>
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>
Are you absolutely sure?
</AlertDialogTitle>
<AlertDialogDescription>
This action cannot be undone. It will permanently delete
the current credential.
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel>Cancel</AlertDialogCancel>
<AlertDialogAction
className={buttonVariants({ variant: 'destructive' })}
onClick={onDelete}
>
{isDeleting && (
<IconSpinner className="mr-2 h-4 w-4 animate-spin" />
)}
Yes, delete it
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
)}
</LicenseGuard>
<LicenseGuard licenses={[LicenseType.Enterprise]}>
{({ hasValidLicense }) => (
<Button
type="submit"
disabled={
!hasValidLicense || isSubmitting || (!isNew && !isDirty)
}
>
{isSubmitting && (
<IconSpinner className="mr-2 h-4 w-4 animate-spin" />
)}
{isNew ? 'Create' : 'Update'}
</Button>
)}
</LicenseGuard>
</div>
</div>
</form>
<FormMessage className="text-center" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import {
import { Input } from '@/components/ui/input'
import { Label } from '@/components/ui/label'
import { RadioGroup, RadioGroupItem } from '@/components/ui/radio-group'
import { Separator } from '@/components/ui/separator'
import { CopyButton } from '@/components/copy-button'
import { LicenseGuard } from '@/components/license-guard'

Expand Down Expand Up @@ -276,17 +277,20 @@ export default function OAuthCredentialForm({

{oauthRedirectUrlData && (
<FormItem className="mt-4">
<div className="flex flex-col gap-2 rounded-lg border px-3 py-2">
<div className="flex flex-col gap-2 overflow-hidden rounded-lg border px-3 py-2">
<div className="text-sm text-muted-foreground">
Create your OAuth2 application with the following information
</div>
<div className="flex items-center justify-between">
<div className="flex flex-col justify-between sm:flex-row sm:items-center">
<div className="text-sm font-medium">
Authorization callback URL
</div>
<span className="flex items-center text-sm">
{oauthRedirectUrlData.oauthCallbackUrl}
<span className="truncate">
{oauthRedirectUrlData.oauthCallbackUrl}
</span>
<CopyButton
className="shrink-0"
type="button"
value={oauthRedirectUrlData.oauthCallbackUrl!}
/>
Expand Down Expand Up @@ -345,6 +349,7 @@ export default function OAuthCredentialForm({
</FormItem>
)}
/>
<Separator className="my-2" />
<div className="flex justify-end gap-4">
<Button
type="button"
Expand Down
Loading