Skip to content

Commit 700e560

Browse files
feat: add icons to schema actions and templates
1 parent 2ef05b6 commit 700e560

File tree

5 files changed

+41
-17
lines changed

5 files changed

+41
-17
lines changed

package-lock.json

Lines changed: 11 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"@gravity-ui/date-components": "^3.2.3",
1919
"@gravity-ui/date-utils": "^2.5.6",
2020
"@gravity-ui/i18n": "^1.7.0",
21-
"@gravity-ui/icons": "^2.13.0",
21+
"@gravity-ui/icons": "^2.16.0",
2222
"@gravity-ui/illustrations": "^2.1.0",
2323
"@gravity-ui/navigation": "^3.3.9",
2424
"@gravity-ui/paranoid": "^3.0.0",
@@ -59,7 +59,7 @@
5959
"use-query-params": "^2.2.1",
6060
"uuid": "^10.0.0",
6161
"web-vitals": "^1.1.2",
62-
"ydb-ui-components": "^5.0.0",
62+
"ydb-ui-components": "^5.1.0",
6363
"zod": "^3.24.1"
6464
},
6565
"scripts": {

src/containers/Tenant/Query/NewSQL/NewSQL.tsx

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
import React from 'react';
22

3-
import {ChevronDown} from '@gravity-ui/icons';
3+
import {
4+
ArrowsOppositeToDots,
5+
ChevronDown,
6+
FileArrowRightOut,
7+
FileText,
8+
LayoutHeaderCells,
9+
PencilToSquare,
10+
Persons,
11+
} from '@gravity-ui/icons';
12+
import type {DropdownMenuItem} from '@gravity-ui/uikit';
413
import {Button, DropdownMenu} from '@gravity-ui/uikit';
514

615
import {useChangeInputWithConfirmation} from '../../../../utils/hooks/withConfirmation/useChangeInputWithConfirmation';
@@ -18,9 +27,10 @@ export function NewSQL() {
1827

1928
const actions = bindActions(onTemplateClick);
2029

21-
const items = [
30+
const items: DropdownMenuItem[] = [
2231
{
2332
text: i18n('menu.tables'),
33+
iconStart: <LayoutHeaderCells />,
2434
items: [
2535
{
2636
text: i18n('action.create-row-table'),
@@ -74,6 +84,7 @@ export function NewSQL() {
7484
},
7585
{
7686
text: i18n('menu.topics'),
87+
iconStart: <FileText />,
7788
items: [
7889
{
7990
text: i18n('action.create-topic'),
@@ -91,6 +102,7 @@ export function NewSQL() {
91102
},
92103
{
93104
text: i18n('menu.replication'),
105+
iconStart: <ArrowsOppositeToDots />,
94106
items: [
95107
{
96108
text: i18n('action.create-async-replication'),
@@ -108,6 +120,7 @@ export function NewSQL() {
108120
},
109121
{
110122
text: i18n('menu.transfer'),
123+
iconStart: <FileArrowRightOut />,
111124
items: [
112125
{
113126
text: i18n('action.create-transfer'),
@@ -125,6 +138,7 @@ export function NewSQL() {
125138
},
126139
{
127140
text: i18n('menu.capture'),
141+
iconStart: <PencilToSquare />,
128142
items: [
129143
{
130144
text: i18n('action.create-cdc-stream'),
@@ -134,6 +148,7 @@ export function NewSQL() {
134148
},
135149
{
136150
text: i18n('menu.users'),
151+
iconStart: <Persons />,
137152
items: [
138153
{
139154
text: i18n('action.create-user'),

src/containers/Tenant/utils/controls.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ export const getSchemaControls =
7575

7676
table: openPreview,
7777
column_table: openPreview,
78+
system_table: openPreview,
7879

7980
index_table: undefined,
8081
topic: isTopicPreviewAvailable && !isCdcTopic ? openPreview : undefined,

src/containers/Tenant/utils/schemaActions.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Copy, PlugConnection} from '@gravity-ui/icons';
1+
import {CirclePlus, Copy, PlugConnection} from '@gravity-ui/icons';
22
import {Flex, Spin} from '@gravity-ui/uikit';
33
import copy from 'copy-to-clipboard';
44
import type {NavigationTreeNodeType} from 'ydb-ui-components';
@@ -183,12 +183,12 @@ export const getActions =
183183
const copyItem: ActionsSet[0] = {
184184
text: i18n('actions.copyPath'),
185185
action: actions.copyPath,
186-
iconEnd: <Copy />,
186+
iconStart: <Copy />,
187187
};
188188
const connectToDBItem = {
189189
text: i18n('actions.connectToDB'),
190190
action: actions.getConnectToDBDialog,
191-
iconEnd: <PlugConnection />,
191+
iconStart: <PlugConnection />,
192192
};
193193

194194
const createEntitiesSet = [
@@ -224,6 +224,7 @@ export const getActions =
224224
const createDirectoryItem = {
225225
text: i18n('actions.createDirectory'),
226226
action: actions.createDirectory,
227+
iconStart: <CirclePlus />,
227228
};
228229

229230
DB_SET.splice(1, 0, [createDirectoryItem]);
@@ -289,6 +290,11 @@ export const getActions =
289290
[{text: i18n('actions.dropView'), action: actions.dropView}],
290291
];
291292

293+
const SYSTEM_VIEW_SET: ActionsSet = [
294+
[copyItem],
295+
[{text: i18n('actions.selectQuery'), action: actions.selectQuery}],
296+
];
297+
292298
const ASYNC_REPLICATION_SET: ActionsSet = [
293299
[copyItem],
294300
[
@@ -324,6 +330,7 @@ export const getActions =
324330

325331
table: ROW_TABLE_SET,
326332
column_table: COLUMN_TABLE_SET,
333+
system_table: SYSTEM_VIEW_SET,
327334

328335
index_table: JUST_COPY,
329336
topic: TOPIC_SET,

0 commit comments

Comments
 (0)