generated from TBD54566975/tbd-project-template
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: create new module decl panels and layout
- Loading branch information
1 parent
8dd6664
commit 008a8f1
Showing
46 changed files
with
263 additions
and
183 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
13 changes: 0 additions & 13 deletions
13
frontend/console/src/features/console/right-panel/ConfigPanels.tsx
This file was deleted.
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
File renamed without changes.
8 changes: 8 additions & 0 deletions
8
frontend/console/src/features/modules/decls/RightPanelHeader.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,8 @@ | ||
export const RightPanelHeader = ({ Icon, title }: { Icon?: React.ElementType; title?: string }) => { | ||
return ( | ||
<div className='flex items-center gap-2 px-2 py-2'> | ||
{Icon && <Icon className='h-5 w-5 text-indigo-600' />} | ||
{title && <div className='flex flex-col min-w-0'>{title}</div>} | ||
</div> | ||
) | ||
} |
19 changes: 0 additions & 19 deletions
19
frontend/console/src/features/modules/decls/SubscriptionPanel.tsx
This file was deleted.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
frontend/console/src/features/modules/decls/TopicPanel.tsx
This file was deleted.
Oops, something went wrong.
32 changes: 0 additions & 32 deletions
32
frontend/console/src/features/modules/decls/VerbRequestEditor.tsx
This file was deleted.
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
16 changes: 16 additions & 0 deletions
16
frontend/console/src/features/modules/decls/config/ConfigRightPanels.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,16 @@ | ||
import { RightPanelAttribute } from '../../../../components/RightPanelAttribute' | ||
import type { Config } from '../../../../protos/xyz/block/ftl/v1/console/console_pb' | ||
import type { ExpandablePanelProps } from '../../../console/ExpandablePanel' | ||
|
||
export const configPanels = (config: Config) => { | ||
return [ | ||
{ | ||
title: 'Details', | ||
expanded: true, | ||
children: [ | ||
<RightPanelAttribute key='name' name='Name' value={config.config?.name} />, | ||
<RightPanelAttribute key='type' name='Type' value={config.config?.type?.value.case ?? ''} />, | ||
], | ||
}, | ||
] as ExpandablePanelProps[] | ||
} |
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
13 changes: 13 additions & 0 deletions
13
frontend/console/src/features/modules/decls/data/DataRightPanels.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,13 @@ | ||
import { RightPanelAttribute } from '../../../../components/RightPanelAttribute' | ||
import type { Data } from '../../../../protos/xyz/block/ftl/v1/console/console_pb' | ||
import type { ExpandablePanelProps } from '../../../console/ExpandablePanel' | ||
|
||
export const dataPanels = (data: Data) => { | ||
return [ | ||
{ | ||
title: 'Details', | ||
expanded: true, | ||
children: [<RightPanelAttribute key='name' name='Name' value={data.data?.name} />], | ||
}, | ||
] as ExpandablePanelProps[] | ||
} |
8 changes: 4 additions & 4 deletions
8
.../features/modules/decls/DatabasePanel.tsx → .../modules/decls/database/DatabasePanel.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
8 changes: 4 additions & 4 deletions
8
.../src/features/modules/decls/EnumPanel.tsx → ...features/modules/decls/enum/EnumPanel.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
2 changes: 1 addition & 1 deletion
2
.../src/features/modules/decls/enum.utils.ts → ...features/modules/decls/enum/enum.utils.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
File renamed without changes.
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
16 changes: 16 additions & 0 deletions
16
frontend/console/src/features/modules/decls/secret/SecretRightPanels.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,16 @@ | ||
import { RightPanelAttribute } from '../../../../components/RightPanelAttribute' | ||
import type { Secret } from '../../../../protos/xyz/block/ftl/v1/console/console_pb' | ||
import type { ExpandablePanelProps } from '../../../console/ExpandablePanel' | ||
|
||
export const secretPanels = (secret: Secret) => { | ||
return [ | ||
{ | ||
title: 'Details', | ||
expanded: true, | ||
children: [ | ||
<RightPanelAttribute key='name' name='Name' value={secret.secret?.name} />, | ||
<RightPanelAttribute key='type' name='Type' value={secret.secret?.type?.value.case ?? ''} />, | ||
], | ||
}, | ||
] as ExpandablePanelProps[] | ||
} |
39 changes: 39 additions & 0 deletions
39
frontend/console/src/features/modules/decls/subscription/SubscriptionPanel.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,39 @@ | ||
import { ResizablePanels } from '../../../../components/ResizablePanels' | ||
import type { Subscription } from '../../../../protos/xyz/block/ftl/v1/console/console_pb' | ||
import { declIcon } from '../../module.utils' | ||
import { Schema } from '../../schema/Schema' | ||
import { DeclDefaultPanels } from '../DeclDefaultPanels' | ||
import { PanelHeader } from '../PanelHeader' | ||
import { RightPanelHeader } from '../RightPanelHeader' | ||
import { subscriptionPanels } from './SubscriptionRightPanels' | ||
|
||
export const SubscriptionPanel = ({ value, schema, moduleName, declName }: { value: Subscription; schema: string; moduleName: string; declName: string }) => { | ||
if (!value || !schema) { | ||
return | ||
} | ||
|
||
const decl = value.subscription | ||
if (!decl) { | ||
return | ||
} | ||
|
||
return ( | ||
<div className='h-full'> | ||
<ResizablePanels | ||
mainContent={ | ||
<div className='p-4'> | ||
<div className=''> | ||
<PanelHeader title='Data' declRef={`${moduleName}.${declName}`} exported={false} comments={decl.comments} /> | ||
<div className='-mx-3.5'> | ||
<Schema schema={schema} /> | ||
</div> | ||
</div> | ||
</div> | ||
} | ||
rightPanelHeader={<RightPanelHeader Icon={declIcon('subscription', decl)} title={declName} />} | ||
rightPanelPanels={[...subscriptionPanels(value), ...DeclDefaultPanels(schema, value.references)]} | ||
storageKeyPrefix='subscriptionPanel' | ||
/> | ||
</div> | ||
) | ||
} |
13 changes: 13 additions & 0 deletions
13
frontend/console/src/features/modules/decls/subscription/SubscriptionRightPanels.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,13 @@ | ||
import { RightPanelAttribute } from '../../../../components/RightPanelAttribute' | ||
import type { Subscription } from '../../../../protos/xyz/block/ftl/v1/console/console_pb' | ||
import type { ExpandablePanelProps } from '../../../console/ExpandablePanel' | ||
|
||
export const subscriptionPanels = (subscription: Subscription) => { | ||
return [ | ||
{ | ||
title: 'Details', | ||
expanded: true, | ||
children: [<RightPanelAttribute key='name' name='Name' value={subscription.subscription?.name} />], | ||
}, | ||
] as ExpandablePanelProps[] | ||
} |
Oops, something went wrong.