diff --git a/apps/studio/components/interfaces/Account/AccessTokenList.tsx b/apps/studio/components/interfaces/Account/AccessTokenList.tsx index 7b7ba8fc96d..e23b5be8e2d 100644 --- a/apps/studio/components/interfaces/Account/AccessTokenList.tsx +++ b/apps/studio/components/interfaces/Account/AccessTokenList.tsx @@ -68,7 +68,6 @@ const AccessTokenList = () => { type="default" title="Manage access" onClick={() => { - console.log('Manage access clicked for token:', x) setIsPanelOpen(true) setToken(x) }} diff --git a/apps/studio/components/interfaces/Account/UpdateTokensPanel/UpdateTokensPanel.constants.tsx b/apps/studio/components/interfaces/Account/UpdateTokensPanel/UpdateTokensPanel.constants.tsx new file mode 100644 index 00000000000..0232349c4cd --- /dev/null +++ b/apps/studio/components/interfaces/Account/UpdateTokensPanel/UpdateTokensPanel.constants.tsx @@ -0,0 +1,22 @@ +export const DUMMY_PERMISSIONS = [ + { + title: 'Project permissions', + description: 'On a project level, you can decide what resources your token can access.', + permissions: [ + { + title: 'Manage organization adming settings', + options: ['No access', 'Read and write'], + }, + { + title: 'Manage organization members', + options: ['No access', 'Read and write'], + }, + ], + }, + { + title: 'Organization permissions', + description: + 'These are your organizational permissions. Here you can decide what resources your token can access.', + permissions: [], + }, +] diff --git a/apps/studio/components/interfaces/Account/UpdateTokensPanel/UpdateTokensPanel.tsx b/apps/studio/components/interfaces/Account/UpdateTokensPanel/UpdateTokensPanel.tsx index d71ccb21091..e9fce430a38 100644 --- a/apps/studio/components/interfaces/Account/UpdateTokensPanel/UpdateTokensPanel.tsx +++ b/apps/studio/components/interfaces/Account/UpdateTokensPanel/UpdateTokensPanel.tsx @@ -1,5 +1,24 @@ -import { Button, Sheet, SheetContent, SheetFooter, SheetHeader, SheetSection, cn } from 'ui' +import { + Separator, + Sheet, + SheetContent, + SheetFooter, + SheetHeader, + SheetSection, + ScrollArea, + ScrollBar, + SelectContent_Shadcn_, + SelectGroup_Shadcn_, + SelectItem_Shadcn_, + SelectTrigger_Shadcn_, + Select_Shadcn_, + Button, + cn, + Select, +} from 'ui' import { AccessToken } from 'data/access-tokens/access-tokens-query' +import { DocsButton } from 'components/ui/DocsButton' +import { DUMMY_PERMISSIONS } from './UpdateTokensPanel.constants' // This is just for prototyping, will be replaced with endpoints when available. interface UpdateTokensPanelProps { visible: boolean @@ -10,21 +29,70 @@ interface UpdateTokensPanelProps { export function UpdateTokensPanel({ visible, token, onClose }: UpdateTokensPanelProps) { return ( onClose()}> - - -

- Manage access for {token?.name} -

-
- -

Here you can update your tokens.

-

{token?.name}

-
- - - + +
+ +

+ Manage access for {token?.name} +

+ +
+ + +
+ {DUMMY_PERMISSIONS.map((section, i) => ( + <> +
+
{section.title}
+
{section.description}
+
+ {section.permissions.map((permission, j) => ( +
+

{permission.title}

+ { + // Handle value change logic here + console.log(`Changed ${permission.title} to ${value}`) + }} + > + + No access + + + + {permission.options.map((option) => ( + + {option} + + ))} + + + +
+ ))} + + + ))} +
+ +
+
+ + + + +
)