ydb-embedded-ui 6.2.1 → 6.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,15 +15,16 @@
15
15
 
16
16
  &__clipboard-button {
17
17
  display: flex;
18
- visibility: hidden;
19
18
  flex-shrink: 0;
20
19
 
21
20
  margin-left: 8px;
22
21
 
22
+ opacity: 0;
23
23
  color: var(--g-color-text-secondary);
24
24
 
25
- &_visible {
26
- visibility: visible;
25
+ &_visible,
26
+ &:focus-visible {
27
+ opacity: 1;
27
28
  }
28
29
  }
29
30
 
@@ -119,10 +119,9 @@ body,
119
119
  .data-table__row,
120
120
  .ydb-virtual-table__row,
121
121
  .ydb-tree-view__item {
122
- &:hover,
123
- &:focus-within {
122
+ &:hover {
124
123
  & .clipboard-button {
125
- visibility: visible;
124
+ opacity: 1;
126
125
  }
127
126
  }
128
127
  }
@@ -135,5 +135,12 @@ export declare const EXTERNAL_TABLE_PAGES: ({
135
135
  id: "describe";
136
136
  title: string;
137
137
  })[];
138
+ export declare const VIEW_PAGES: ({
139
+ id: "overview";
140
+ title: string;
141
+ } | {
142
+ id: "describe";
143
+ title: string;
144
+ })[];
138
145
  export declare const getPagesByType: (type?: EPathType) => Page[];
139
146
  export {};
@@ -69,6 +69,7 @@ export const CDC_STREAM_PAGES = [overview, consumers, partitions, nodes, describ
69
69
  export const TOPIC_PAGES = [overview, consumers, partitions, nodes, describe];
70
70
  export const EXTERNAL_DATA_SOURCE_PAGES = [overview, describe];
71
71
  export const EXTERNAL_TABLE_PAGES = [overview, describe];
72
+ export const VIEW_PAGES = [overview, describe];
72
73
  // verbose mapping to guarantee correct tabs for new path types
73
74
  // TS will error when a new type is added but not mapped here
74
75
  const pathTypeToPages = {
@@ -84,5 +85,6 @@ const pathTypeToPages = {
84
85
  [EPathType.EPathTypePersQueueGroup]: TOPIC_PAGES,
85
86
  [EPathType.EPathTypeExternalDataSource]: EXTERNAL_DATA_SOURCE_PAGES,
86
87
  [EPathType.EPathTypeExternalTable]: EXTERNAL_TABLE_PAGES,
88
+ [EPathType.EPathTypeView]: VIEW_PAGES,
87
89
  };
88
90
  export const getPagesByType = (type) => (type && pathTypeToPages[type]) || DIR_PAGES;
@@ -62,6 +62,7 @@ function Overview({ type, tenantName }) {
62
62
  [EPathType.EPathTypePersQueueGroup]: () => _jsx(TopicInfo, { data: data }),
63
63
  [EPathType.EPathTypeExternalTable]: () => _jsx(ExternalTableInfo, { data: data }),
64
64
  [EPathType.EPathTypeExternalDataSource]: () => _jsx(ExternalDataSourceInfo, { data: data }),
65
+ [EPathType.EPathTypeView]: undefined,
65
66
  };
66
67
  return ((type && ((_a = pathTypeToComponent[type]) === null || _a === void 0 ? void 0 : _a.call(pathTypeToComponent))) || (_jsx(TableInfo, { data: data, type: type, olapStats: olapStats })));
67
68
  };
@@ -28,7 +28,7 @@ import { SchemaViewer } from '../Schema/SchemaViewer/SchemaViewer';
28
28
  import { TENANT_INFO_TABS, TENANT_SCHEMA_TAB, TenantTabsGroups } from '../TenantPages';
29
29
  import i18n from '../i18n';
30
30
  import { PaneVisibilityActionTypes, PaneVisibilityToggleButtons, paneVisibilityToggleReducerCreator, } from '../utils/paneVisibilityToggleHelpers';
31
- import { isIndexTable, isTableType } from '../utils/schema';
31
+ import { isIndexTableType, isTableType, isViewType } from '../utils/schema';
32
32
  import './ObjectSummary.scss';
33
33
  const b = cn('object-summary');
34
34
  const getTenantCommonInfoState = () => {
@@ -54,13 +54,15 @@ export function ObjectSummary({ type, subType, onCollapseSummary, onExpandSummar
54
54
  const currentObjectData = currentSchemaPath ? data[currentSchemaPath] : undefined;
55
55
  const currentSchemaData = (_c = currentObjectData === null || currentObjectData === void 0 ? void 0 : currentObjectData.PathDescription) === null || _c === void 0 ? void 0 : _c.Self;
56
56
  React.useEffect(() => {
57
- const isTable = isTableType(type);
57
+ // TODO: enable schema tab for view when supported
58
+ const isTable = isTableType(type) && !isViewType(type);
58
59
  if (type && !isTable && !TENANT_INFO_TABS.find((el) => el.id === summaryTab)) {
59
60
  dispatch(setSummaryTab(TENANT_SUMMARY_TABS_IDS.overview));
60
61
  }
61
62
  }, [dispatch, type, summaryTab]);
62
63
  const renderTabs = () => {
63
- const isTable = isTableType(type);
64
+ // TODO: enable schema tab for view when supported
65
+ const isTable = isTableType(type) && !isViewType(type);
64
66
  const tabsItems = isTable ? [...TENANT_INFO_TABS, ...TENANT_SCHEMA_TAB] : TENANT_INFO_TABS;
65
67
  return (_jsx("div", { className: b('tabs'), children: _jsx(Tabs, { size: "l", items: tabsItems, activeTab: summaryTab, wrapTo: ({ id }, node) => {
66
68
  const path = createHref(routes.tenant, undefined, Object.assign(Object.assign({}, queryParams), { name: tenantName, [TenantTabsGroups.summaryTab]: id }));
@@ -84,6 +86,7 @@ export function ObjectSummary({ type, subType, onCollapseSummary, onExpandSummar
84
86
  [EPathType.EPathTypePersQueueGroup]: () => (_jsx(PersQueueGroupOverview, { data: currentObjectData })),
85
87
  [EPathType.EPathTypeExternalTable]: () => (_jsx(ExternalTableSummary, { data: currentObjectData })),
86
88
  [EPathType.EPathTypeExternalDataSource]: () => (_jsx(ExternalDataSourceSummary, { data: currentObjectData })),
89
+ [EPathType.EPathTypeView]: undefined,
87
90
  };
88
91
  let component = (currentSchemaData === null || currentSchemaData === void 0 ? void 0 : currentSchemaData.PathType) && ((_a = pathTypeToComponent[currentSchemaData.PathType]) === null || _a === void 0 ? void 0 : _a.call(pathTypeToComponent));
89
92
  if (!component) {
@@ -134,7 +137,7 @@ export function ObjectSummary({ type, subType, onCollapseSummary, onExpandSummar
134
137
  dispatch(setQueryTab(TENANT_QUERY_TABS_ID.newQuery));
135
138
  };
136
139
  const renderCommonInfoControls = () => {
137
- const showPreview = isTableType(type) && !isIndexTable(subType);
140
+ const showPreview = isTableType(type) && !isIndexTableType(subType);
138
141
  return (_jsxs(React.Fragment, { children: [showPreview && (_jsx(Button, { view: "flat-secondary", onClick: onOpenPreview, title: i18n('summary.showPreview'), children: _jsx(Icon, { name: "tablePreview", viewBox: '0 0 16 16', height: 16, width: 16 }) })), currentSchemaPath && (_jsx(ClipboardButton, { text: currentSchemaPath, view: "flat-secondary", title: i18n('summary.copySchemaPath') })), _jsx(PaneVisibilityToggleButtons, { onCollapse: onCollapseInfoHandler, onExpand: onExpandInfoHandler, isCollapsed: commonInfoVisibilityState.collapsed, initialDirection: "bottom" })] }));
139
142
  };
140
143
  const renderEntityTypeBadge = () => {
@@ -9,7 +9,7 @@ import { setShowPreview } from '../../../../store/reducers/schema/schema';
9
9
  import { cn } from '../../../../utils/cn';
10
10
  import { useTypedDispatch, useTypedSelector } from '../../../../utils/hooks';
11
11
  import { prepareQueryError } from '../../../../utils/query';
12
- import { isExternalTable, isTableType } from '../../utils/schema';
12
+ import { isExternalTableType, isTableType } from '../../utils/schema';
13
13
  import i18n from '../i18n';
14
14
  import './Preview.scss';
15
15
  const b = cn('kv-preview');
@@ -19,7 +19,7 @@ export const Preview = ({ database, type }) => {
19
19
  const { autorefresh, currentSchemaPath } = useTypedSelector((state) => state.schema);
20
20
  const isFullscreen = useTypedSelector((state) => state.fullscreen);
21
21
  const query = `--!syntax_v1\nselect * from \`${currentSchemaPath}\` limit 32`;
22
- const { currentData, isFetching, error } = previewApi.useSendQueryQuery({ database, query, action: isExternalTable(type) ? 'execute-query' : 'execute-scan' }, { pollingInterval: autorefresh, skip: !isPreviewAvailable });
22
+ const { currentData, isFetching, error } = previewApi.useSendQueryQuery({ database, query, action: isExternalTableType(type) ? 'execute-query' : 'execute-scan' }, { pollingInterval: autorefresh, skip: !isPreviewAvailable });
23
23
  const loading = isFetching && currentData === undefined;
24
24
  const data = currentData !== null && currentData !== void 0 ? currentData : {};
25
25
  const handleClosePreview = () => {
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import DataTable from '@gravity-ui/react-data-table';
3
3
  import { Icon } from '../../../../components/Icon';
4
4
  import { EColumnCodec } from '../../../../types/api/schema';
5
- import { isColumnEntityType, isExternalTable, isRowTable, isTableType } from '../../utils/schema';
5
+ import { isColumnEntityType, isExternalTableType, isRowTableType, isTableType, } from '../../utils/schema';
6
6
  export const SchemaViewerColumns = {
7
7
  id: 'Id',
8
8
  name: 'Name',
@@ -51,7 +51,7 @@ export function prepareColumnDescriptions(type, scheme) {
51
51
  keyColumnIds = (_b = columnTableSchema.KeyColumnIds) !== null && _b !== void 0 ? _b : [];
52
52
  columns = (_c = columnTableSchema.Columns) !== null && _c !== void 0 ? _c : [];
53
53
  }
54
- else if (isExternalTable(type)) {
54
+ else if (isExternalTableType(type)) {
55
55
  columns = (_f = (_e = (_d = scheme === null || scheme === void 0 ? void 0 : scheme.PathDescription) === null || _d === void 0 ? void 0 : _d.ExternalTableDescription) === null || _e === void 0 ? void 0 : _e.Columns) !== null && _f !== void 0 ? _f : [];
56
56
  }
57
57
  else {
@@ -83,7 +83,7 @@ export function prepareSchemaTableColumns(options) {
83
83
  width: 60,
84
84
  },
85
85
  ];
86
- if (!isExternalTable(options.type)) {
86
+ if (!isExternalTableType(options.type)) {
87
87
  // External tables don't have key columns
88
88
  columns.push({
89
89
  name: SchemaViewerColumns.key,
@@ -116,7 +116,7 @@ export function prepareSchemaTableColumns(options) {
116
116
  return undefined;
117
117
  },
118
118
  });
119
- if (options.withFamilies && isRowTable(options.type)) {
119
+ if (options.withFamilies && isRowTableType(options.type)) {
120
120
  columns.push({
121
121
  name: SchemaViewerColumns.familyName,
122
122
  width: 100,
@@ -7,14 +7,15 @@
7
7
  "summary.copySchemaPath": "Copy schema path",
8
8
  "actions.copied": "The path is copied to the clipboard",
9
9
  "actions.notCopied": "Couldn’t copy the path",
10
- "actions.externalTableSelectUnavailable": "Select query for external tables available only with 'YQL - QueryService' query mode. You need to turn in additional query modes in settings to enable it",
11
10
  "actions.copyPath": "Copy path",
12
11
  "actions.openPreview": "Open preview",
13
12
  "actions.createTable": "Create table...",
14
13
  "actions.createExternalTable": "Create external table...",
15
14
  "actions.createTopic": "Create topic...",
15
+ "actions.createView": "Create view...",
16
16
  "actions.dropTable": "Drop table...",
17
17
  "actions.dropTopic": "Drop topic...",
18
+ "actions.dropView": "Drop view...",
18
19
  "actions.alterTable": "Alter table...",
19
20
  "actions.alterTopic": "Alter topic...",
20
21
  "actions.selectQuery": "Select query...",
@@ -1,2 +1,2 @@
1
- declare const _default: (key: "page.title" | "acl.owner" | "acl.empty" | "summary.navigation" | "summary.showPreview" | "summary.copySchemaPath" | "actions.copied" | "actions.notCopied" | "actions.externalTableSelectUnavailable" | "actions.copyPath" | "actions.openPreview" | "actions.createTable" | "actions.createExternalTable" | "actions.createTopic" | "actions.dropTable" | "actions.dropTopic" | "actions.alterTable" | "actions.alterTopic" | "actions.selectQuery" | "actions.upsertQuery", params?: import("@gravity-ui/i18n").Params | undefined) => string;
1
+ declare const _default: (key: "page.title" | "acl.owner" | "acl.empty" | "summary.navigation" | "summary.showPreview" | "summary.copySchemaPath" | "actions.copied" | "actions.notCopied" | "actions.copyPath" | "actions.openPreview" | "actions.createTable" | "actions.createExternalTable" | "actions.createTopic" | "actions.createView" | "actions.dropTable" | "actions.dropTopic" | "actions.dropView" | "actions.alterTable" | "actions.alterTopic" | "actions.selectQuery" | "actions.upsertQuery", params?: import("@gravity-ui/i18n").Params | undefined) => string;
2
2
  export default _default;
@@ -1,5 +1,4 @@
1
1
  import { registerKeysets } from '../../../utils/i18n';
2
2
  import en from './en.json';
3
- import ru from './ru.json';
4
3
  const COMPONENT = 'ydb-tenant';
5
- export default registerKeysets(COMPONENT, { en, ru });
4
+ export default registerKeysets(COMPONENT, { en });
@@ -7,3 +7,5 @@ export declare const createExternalTableTemplate: (path: string) => string;
7
7
  export declare const createTopicTemplate: (path: string) => string;
8
8
  export declare const alterTopicTemplate: (path: string) => string;
9
9
  export declare const dropTopicTemplate: (path: string) => string;
10
+ export declare const createViewTemplate: (path: string) => string;
11
+ export declare const dropViewTemplate: (path: string) => string;
@@ -105,3 +105,9 @@ ALTER TOPIC \`${path}\`
105
105
  export const dropTopicTemplate = (path) => {
106
106
  return `DROP TOPIC \`${path}\`;`;
107
107
  };
108
+ export const createViewTemplate = (path) => {
109
+ return `CREATE VIEW \`${path}/my_view\` WITH (security_invoker = TRUE) AS SELECT 1;`;
110
+ };
111
+ export const dropViewTemplate = (path) => {
112
+ return `DROP VIEW \`${path}\`;`;
113
+ };
@@ -5,12 +5,13 @@ export declare const mapPathTypeToNavigationTreeType: (type?: EPathType, subType
5
5
  export declare const mapPathTypeToEntityName: (type?: EPathType, subType?: EPathSubType) => string | undefined;
6
6
  export declare const mapDatabaseTypeToDBName: (type?: ETenantType) => string | undefined;
7
7
  export declare const isTableType: (pathType?: EPathType) => boolean;
8
- export declare const isIndexTable: (subType?: EPathSubType) => boolean;
8
+ export declare const isIndexTableType: (subType?: EPathSubType) => boolean;
9
9
  export declare const isColumnEntityType: (type?: EPathType) => boolean;
10
10
  export declare const isDatabaseEntityType: (type?: EPathType) => boolean;
11
11
  export declare const isCdcStreamEntityType: (type?: EPathType) => boolean;
12
12
  export declare const isEntityWithMergedImplementation: (type?: EPathType) => boolean;
13
13
  export declare const isChildlessPathType: (type?: EPathType, subType?: EPathSubType) => boolean;
14
14
  export declare const isPathTypeWithTopic: (type?: EPathType) => boolean;
15
- export declare const isExternalTable: (type?: EPathType) => boolean;
16
- export declare const isRowTable: (type?: EPathType) => boolean;
15
+ export declare const isExternalTableType: (type?: EPathType) => boolean;
16
+ export declare const isRowTableType: (type?: EPathType) => boolean;
17
+ export declare const isViewType: (type?: EPathType) => boolean;
@@ -22,6 +22,7 @@ const pathTypeToNodeType = {
22
22
  [EPathType.EPathTypePersQueueGroup]: 'topic',
23
23
  [EPathType.EPathTypeExternalDataSource]: 'external_data_source',
24
24
  [EPathType.EPathTypeExternalTable]: 'external_table',
25
+ [EPathType.EPathTypeView]: 'view',
25
26
  };
26
27
  export const mapPathTypeToNavigationTreeType = (type = EPathType.EPathTypeDir, subType, defaultType = 'directory') => (subType && pathSubTypeToNodeType[subType]) || pathTypeToNodeType[type] || defaultType;
27
28
  // ====================
@@ -44,6 +45,7 @@ const pathTypeToEntityName = {
44
45
  [EPathType.EPathTypePersQueueGroup]: 'Topic',
45
46
  [EPathType.EPathTypeExternalDataSource]: 'External Data Source',
46
47
  [EPathType.EPathTypeExternalTable]: 'External Table',
48
+ [EPathType.EPathTypeView]: 'View',
47
49
  };
48
50
  export const mapPathTypeToEntityName = (type, subType) => (subType && pathSubTypeToEntityName[subType]) || (type && pathTypeToEntityName[type]);
49
51
  // ====================
@@ -60,6 +62,7 @@ const pathTypeToIsTable = {
60
62
  [EPathType.EPathTypeTable]: true,
61
63
  [EPathType.EPathTypeColumnTable]: true,
62
64
  [EPathType.EPathTypeExternalTable]: true,
65
+ [EPathType.EPathTypeView]: true,
63
66
  [EPathType.EPathTypeInvalid]: false,
64
67
  [EPathType.EPathTypeDir]: false,
65
68
  [EPathType.EPathTypeSubDomain]: false,
@@ -78,7 +81,7 @@ const pathSubTypeToIsIndexImpl = {
78
81
  [EPathSubType.EPathSubTypeStreamImpl]: false,
79
82
  [EPathSubType.EPathSubTypeEmpty]: false,
80
83
  };
81
- export const isIndexTable = (subType) => { var _a; return (_a = (subType && pathSubTypeToIsIndexImpl[subType])) !== null && _a !== void 0 ? _a : false; };
84
+ export const isIndexTableType = (subType) => { var _a; return (_a = (subType && pathSubTypeToIsIndexImpl[subType])) !== null && _a !== void 0 ? _a : false; };
82
85
  // ====================
83
86
  const pathTypeToIsColumn = {
84
87
  [EPathType.EPathTypeColumnStore]: true,
@@ -93,6 +96,7 @@ const pathTypeToIsColumn = {
93
96
  [EPathType.EPathTypePersQueueGroup]: false,
94
97
  [EPathType.EPathTypeExternalDataSource]: false,
95
98
  [EPathType.EPathTypeExternalTable]: false,
99
+ [EPathType.EPathTypeView]: false,
96
100
  };
97
101
  export const isColumnEntityType = (type) => { var _a; return (_a = (type && pathTypeToIsColumn[type])) !== null && _a !== void 0 ? _a : false; };
98
102
  // ====================
@@ -109,6 +113,7 @@ const pathTypeToIsDatabase = {
109
113
  [EPathType.EPathTypePersQueueGroup]: false,
110
114
  [EPathType.EPathTypeExternalDataSource]: false,
111
115
  [EPathType.EPathTypeExternalTable]: false,
116
+ [EPathType.EPathTypeView]: false,
112
117
  };
113
118
  export const isDatabaseEntityType = (type) => { var _a; return (_a = (type && pathTypeToIsDatabase[type])) !== null && _a !== void 0 ? _a : false; };
114
119
  // ====================
@@ -127,6 +132,7 @@ const pathTypeToEntityWithMergedImplementation = {
127
132
  [EPathType.EPathTypeExtSubDomain]: false,
128
133
  [EPathType.EPathTypeExternalDataSource]: false,
129
134
  [EPathType.EPathTypeExternalTable]: false,
135
+ [EPathType.EPathTypeView]: false,
130
136
  };
131
137
  export const isEntityWithMergedImplementation = (type) => { var _a; return (_a = (type && pathTypeToEntityWithMergedImplementation[type])) !== null && _a !== void 0 ? _a : false; };
132
138
  // ====================
@@ -141,6 +147,7 @@ const pathTypeToChildless = {
141
147
  [EPathType.EPathTypePersQueueGroup]: true,
142
148
  [EPathType.EPathTypeExternalDataSource]: true,
143
149
  [EPathType.EPathTypeExternalTable]: true,
150
+ [EPathType.EPathTypeView]: true,
144
151
  [EPathType.EPathTypeInvalid]: false,
145
152
  [EPathType.EPathTypeColumnStore]: false,
146
153
  [EPathType.EPathTypeColumnTable]: false,
@@ -165,8 +172,10 @@ const mapPathTypeToIsWithTopic = {
165
172
  [EPathType.EPathTypeExtSubDomain]: false,
166
173
  [EPathType.EPathTypeExternalDataSource]: false,
167
174
  [EPathType.EPathTypeExternalTable]: false,
175
+ [EPathType.EPathTypeView]: false,
168
176
  };
169
177
  export const isPathTypeWithTopic = (type) => { var _a; return (_a = (type && mapPathTypeToIsWithTopic[type])) !== null && _a !== void 0 ? _a : false; };
170
178
  // ====================
171
- export const isExternalTable = (type) => type === EPathType.EPathTypeExternalTable;
172
- export const isRowTable = (type) => type === EPathType.EPathTypeTable;
179
+ export const isExternalTableType = (type) => type === EPathType.EPathTypeExternalTable;
180
+ export const isRowTableType = (type) => type === EPathType.EPathTypeTable;
181
+ export const isViewType = (type) => type === EPathType.EPathTypeView;
@@ -4,7 +4,7 @@ import { TENANT_PAGES_IDS, TENANT_QUERY_TABS_ID } from '../../../store/reducers/
4
4
  import { setQueryTab, setTenantPage } from '../../../store/reducers/tenant/tenant';
5
5
  import createToast from '../../../utils/createToast';
6
6
  import i18n from '../i18n';
7
- import { alterTableTemplate, alterTopicTemplate, createExternalTableTemplate, createTableTemplate, createTopicTemplate, dropExternalTableTemplate, dropTopicTemplate, selectQueryTemplate, upsertQueryTemplate, } from './queryTemplates';
7
+ import { alterTableTemplate, alterTopicTemplate, createExternalTableTemplate, createTableTemplate, createTopicTemplate, createViewTemplate, dropExternalTableTemplate, dropTopicTemplate, dropViewTemplate, selectQueryTemplate, upsertQueryTemplate, } from './queryTemplates';
8
8
  const bindActions = (path, dispatch, additionalEffects) => {
9
9
  const { setActivePath, setQueryMode } = additionalEffects;
10
10
  const inputQuery = (tmpl, mode) => () => {
@@ -27,6 +27,8 @@ const bindActions = (path, dispatch, additionalEffects) => {
27
27
  createTopic: inputQuery(createTopicTemplate, 'script'),
28
28
  alterTopic: inputQuery(alterTopicTemplate, 'script'),
29
29
  dropTopic: inputQuery(dropTopicTemplate, 'script'),
30
+ createView: inputQuery(createViewTemplate, 'script'),
31
+ dropView: inputQuery(dropViewTemplate, 'script'),
30
32
  copyPath: () => {
31
33
  try {
32
34
  copy(path);
@@ -54,6 +56,7 @@ export const getActions = (dispatch, additionalEffects) => (path, type) => {
54
56
  [
55
57
  { text: i18n('actions.createTable'), action: actions.createTable },
56
58
  { text: i18n('actions.createTopic'), action: actions.createTopic },
59
+ { text: i18n('actions.createView'), action: actions.createView },
57
60
  ],
58
61
  ];
59
62
  const TABLE_SET = [
@@ -85,6 +88,11 @@ export const getActions = (dispatch, additionalEffects) => (path, type) => {
85
88
  [copyItem],
86
89
  [{ text: i18n('actions.createExternalTable'), action: actions.createExternalTable }],
87
90
  ];
91
+ const VIEW_SET = [
92
+ [copyItem],
93
+ [{ text: i18n('actions.selectQuery'), action: actions.selectQuery }],
94
+ [{ text: i18n('actions.dropView'), action: actions.dropView }],
95
+ ];
88
96
  const JUST_COPY = [copyItem];
89
97
  // verbose mapping to guarantee a correct actions set for new node types
90
98
  // TS will error when a new type is added in the lib but is not mapped here
@@ -99,6 +107,7 @@ export const getActions = (dispatch, additionalEffects) => (path, type) => {
99
107
  index: JUST_COPY,
100
108
  external_table: EXTERNAL_TABLE_SET,
101
109
  external_data_source: EXTERNAL_DATA_SOURCE_SET,
110
+ view: VIEW_SET,
102
111
  };
103
112
  return nodeTypeToActions[type];
104
113
  };
@@ -30,6 +30,7 @@ export const getControls = (dispatch, additionalEffects) => (path, type) => {
30
30
  index: undefined,
31
31
  external_table: openPreview,
32
32
  external_data_source: undefined,
33
+ view: openPreview,
33
34
  };
34
35
  return nodeTypeToControls[type];
35
36
  };
@@ -6,6 +6,7 @@ import type { TExternalTableDescription } from './externalTable';
6
6
  import type { TPersQueueGroupDescription } from './persQueueGroup';
7
7
  import type { TTableDescription, TTableStats } from './table';
8
8
  import type { TIndexDescription } from './tableIndex';
9
+ import type { TViewDescription } from './view';
9
10
  /**
10
11
  * source: https://github.com/ydb-platform/ydb/blob/main/ydb/core/protos/flat_tx_scheme.proto
11
12
  */
@@ -68,6 +69,7 @@ export interface TPathDescription {
68
69
  PersQueueGroup?: TPersQueueGroupDescription;
69
70
  ExternalTableDescription?: TExternalTableDescription;
70
71
  ExternalDataSourceDescription?: TExternalDataSourceDescription;
72
+ ViewDescription?: TViewDescription;
71
73
  }
72
74
  export interface TDirEntry {
73
75
  Name?: string;
@@ -211,7 +213,8 @@ export declare enum EPathType {
211
213
  EPathTypeColumnTable = "EPathTypeColumnTable",
212
214
  EPathTypeCdcStream = "EPathTypeCdcStream",
213
215
  EPathTypeExternalDataSource = "EPathTypeExternalDataSource",
214
- EPathTypeExternalTable = "EPathTypeExternalTable"
216
+ EPathTypeExternalTable = "EPathTypeExternalTable",
217
+ EPathTypeView = "EPathTypeView"
215
218
  }
216
219
  export declare enum EPathSubType {
217
220
  EPathSubTypeEmpty = "EPathSubTypeEmpty",
@@ -40,6 +40,7 @@ export var EPathType;
40
40
  EPathType["EPathTypeCdcStream"] = "EPathTypeCdcStream";
41
41
  EPathType["EPathTypeExternalDataSource"] = "EPathTypeExternalDataSource";
42
42
  EPathType["EPathTypeExternalTable"] = "EPathTypeExternalTable";
43
+ EPathType["EPathTypeView"] = "EPathTypeView";
43
44
  })(EPathType || (EPathType = {}));
44
45
  export var EPathSubType;
45
46
  (function (EPathSubType) {
@@ -0,0 +1,8 @@
1
+ import type { TPathID } from './shared';
2
+ export interface TViewDescription {
3
+ Name?: string;
4
+ PathId?: TPathID;
5
+ /** uint64 */
6
+ Version?: string;
7
+ QueryText?: string;
8
+ }
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ydb-embedded-ui",
3
- "version": "6.2.1",
3
+ "version": "6.3.0",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -13,7 +13,7 @@
13
13
  "@bem-react/classname": "^1.6.0",
14
14
  "@gravity-ui/axios-wrapper": "^1.4.1",
15
15
  "@gravity-ui/chartkit": "^5.5.0",
16
- "@gravity-ui/components": "^3.6.0",
16
+ "@gravity-ui/components": "^3.4.1",
17
17
  "@gravity-ui/date-utils": "^2.4.0",
18
18
  "@gravity-ui/i18n": "^1.5.0",
19
19
  "@gravity-ui/icons": "^2.9.1",
@@ -48,7 +48,7 @@
48
48
  "url": "^0.11.3",
49
49
  "use-query-params": "^2.2.1",
50
50
  "web-vitals": "^1.1.2",
51
- "ydb-ui-components": "^4.0.0"
51
+ "ydb-ui-components": "^4.1.0"
52
52
  },
53
53
  "scripts": {
54
54
  "analyze": "source-map-explorer 'build/static/js/*.js'",
@@ -1,22 +0,0 @@
1
- {
2
- "page.title": "База данных",
3
- "acl.owner": "Владелец",
4
- "acl.empty": "Нет данных об Acl",
5
- "summary.navigation": "Навигация",
6
- "summary.showPreview": "Показать превью",
7
- "summary.copySchemaPath": "Скопировать путь",
8
- "actions.copied": "Путь успешно скопирован",
9
- "actions.notCopied": "Не получилось скопировать путь",
10
- "actions.externalTableSelectUnavailable": "Select запрос для внешних таблиц доступен только в режиме 'YQL - QueryService'. Вам необходимо включить дополнительные режимы выполнения запросов в настройках",
11
- "actions.copyPath": "Скопировать путь",
12
- "actions.openPreview": "Открыть превью",
13
- "actions.createTable": "Создать таблицу...",
14
- "actions.createExternalTable": "Создать внешнюю таблицу...",
15
- "actions.createTopic": "Создать топик...",
16
- "actions.dropTable": "Удалить таблицу...",
17
- "actions.dropTopic": "Удалить топик...",
18
- "actions.alterTable": "Изменить таблицу...",
19
- "actions.alterTopic": "Изменить топик...",
20
- "actions.selectQuery": "Select запрос...",
21
- "actions.upsertQuery": "Upsert запрос..."
22
- }