Skip to content

Commit c8d0988

Browse files
committed
Move notices into group notice slots
- 'api keys are stored securely...' should be inside 'Providers', not outside of it. - do the same for `agent's execution environment...` ├── apps │ └── editor │ └── src │ └── views │ └── settings │ └── frontend │ ├── Home │ │ ├── Home.tsx │ │ ├── hooks │ │ │ └── use-scroll-to.ts │ │ ├── index.ts │ │ └── sections │ │ ├── ApiSection.tsx │ │ ├── CliSection.tsx │ │ ├── GeneralSection.tsx │ │ └── WebSection.tsx │ └── i18n │ └── translations │ ├── actions.ts │ ├── api.ts │ ├── cli.ts │ ├── common.ts │ ├── edit-provider-form.ts │ ├── edit-template-form.ts │ ├── index.ts │ ├── sections.ts │ └── web.ts └── packages └── ui └── src └── components └── editor └── settings-view ├── DefaultConfigurationSelector │ ├── DefaultConfigurationSelector.module.scss │ ├── DefaultConfigurationSelector.tsx │ └── index.ts ├── Group │ ├── Group.module.scss │ └── Group.tsx ├── Item │ ├── Item.module.scss │ ├── Item.stories.tsx │ ├── Item.tsx │ └── index.ts ├── Layout │ ├── Layout.module.scss │ ├── Layout.tsx │ └── index.ts ├── Modal │ ├── Form │ │ ├── Form.module.scss │ │ ├── Form.tsx │ │ └── index.ts │ ├── Modal.module.scss │ ├── Modal.tsx │ └── index.ts ├── NavigationItemGroup │ ├── NavigationItemGroup.module.scss │ ├── NavigationItemGroup.tsx │ └── index.ts ├── NavigationItemSection │ ├── NavigationItemSection.module.scss │ ├── NavigationItemSection.tsx │ └── index.ts ├── NavigationSection │ ├── NavigationSection.module.scss │ ├── NavigationSection.tsx │ └── index.ts ├── Notices │ ├── Notices.module.scss │ ├── Notices.tsx │ └── index.ts ├── Section │ ├── Section.module.scss │ ├── Section.tsx │ └── index.ts ├── SortableList │ ├── SortableList.module.scss │ ├── SortableList.stories.tsx │ ├── SortableList.tsx │ └── index.ts └── Templates ├── Templates.module.scss ├── Templates.tsx └── index.ts
1 parent 823726e commit c8d0988

2 files changed

Lines changed: 45 additions & 43 deletions

File tree

‎apps/editor/src/views/settings/frontend/Home/sections/ApiSection.tsx‎

Lines changed: 32 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -65,46 +65,44 @@ export const ApiSection = forwardRef<HTMLDivElement, Props>((props, ref) => {
6565

6666
return (
6767
<UiSection ref={ref} title={t('api.title')} subtitle={t('api.subtitle')}>
68-
<UiNotices
69-
notices={[
70-
{
71-
type: 'info',
72-
message: (
73-
<Translation
74-
id="api.notice.credentials"
75-
components={{
76-
link: (
77-
<a href="https://code.visualstudio.com/api/references/vscode-api#SecretStorage">
78-
SecretStorage
79-
</a>
80-
)
81-
}}
82-
/>
83-
)
84-
}
85-
]}
86-
/>
8768
<div
8869
ref={(el) => props.set_section_ref('section:api:group:providers', el)}
8970
>
9071
<UiGroup
9172
title={t('api.providers.title')}
9273
notice_slot={
93-
!props.providers.length ? (
94-
<UiNotices
95-
notices={[
96-
{
97-
type: 'warning',
98-
slot_right: (
99-
<Button on_click={() => props.on_add_provider()}>
100-
{t('action.add-new')}
101-
</Button>
102-
),
103-
message: t('api.providers.missing-provider')
104-
}
105-
]}
106-
/>
107-
) : null
74+
<UiNotices
75+
notices={[
76+
{
77+
type: 'info',
78+
message: (
79+
<Translation
80+
id="api.notice.credentials"
81+
components={{
82+
link: (
83+
<a href="https://code.visualstudio.com/api/references/vscode-api#SecretStorage">
84+
SecretStorage
85+
</a>
86+
)
87+
}}
88+
/>
89+
)
90+
},
91+
...(!props.providers.length
92+
? [
93+
{
94+
type: 'warning' as const,
95+
slot_right: (
96+
<Button on_click={() => props.on_add_provider()}>
97+
{t('action.add-new')}
98+
</Button>
99+
),
100+
message: t('api.providers.missing-provider')
101+
}
102+
]
103+
: [])
104+
]}
105+
/>
108106
}
109107
>
110108
{props.providers.length > 0 && (

‎apps/editor/src/views/settings/frontend/Home/sections/CliSection.tsx‎

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,20 @@ export const CliSection = forwardRef<HTMLDivElement, Props>((props, ref) => {
5656

5757
return (
5858
<UiSection ref={ref} title={t('cli.title')} subtitle={t('cli.subtitle')}>
59-
<UiNotices
60-
notices={[
61-
{
62-
type: 'info',
63-
message: t('cli.notice')
64-
}
65-
]}
66-
/>
6759
<div ref={(el) => props.set_section_ref('section:cli:group:agents', el)}>
68-
<UiGroup title={t('agents.configurations.title')}>
60+
<UiGroup
61+
title={t('agents.configurations.title')}
62+
notice_slot={
63+
<UiNotices
64+
notices={[
65+
{
66+
type: 'info',
67+
message: t('cli.notice')
68+
}
69+
]}
70+
/>
71+
}
72+
>
6973
<SortableList
7074
items={props.cli_configurations.map((c) => ({
7175
...c,

0 commit comments

Comments
 (0)