diff --git a/CHANGELOG.md b/CHANGELOG.md index da3e14477..3c4de84e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,22 +1,5 @@ # Changelog -## [6.6.0](https://github.com/ydb-platform/ydb-embedded-ui/compare/v6.5.0...v6.6.0) (2024-06-14) - - -### Features - -* @gravity-ui/websql-autocomplete -> 9.1.0, enable autocomplete by default ([#904](https://github.com/ydb-platform/ydb-embedded-ui/issues/904)) ([e71fad9](https://github.com/ydb-platform/ydb-embedded-ui/commit/e71fad97fe16ec56dd3ee14e2e1f9ac76eb1bed9)) -* **Diagnostics:** add tablets tab to all entities with tablets ([#892](https://github.com/ydb-platform/ydb-embedded-ui/issues/892)) ([e94d53a](https://github.com/ydb-platform/ydb-embedded-ui/commit/e94d53a1fb293119dc3383add220da5f0cf601c3)) -* **Overview:** add view info ([#912](https://github.com/ydb-platform/ydb-embedded-ui/issues/912)) ([02e0cd6](https://github.com/ydb-platform/ydb-embedded-ui/commit/02e0cd66739b442eed649c9edd257ac1de87dcae)) -* **SchemaViewer:** refactor, add view schema ([#910](https://github.com/ydb-platform/ydb-embedded-ui/issues/910)) ([3a10460](https://github.com/ydb-platform/ydb-embedded-ui/commit/3a1046031b0ced98494c821b8dc5bf13b87081c4)) -* **UserSettings:** display app version ([#889](https://github.com/ydb-platform/ydb-embedded-ui/issues/889)) ([e52639e](https://github.com/ydb-platform/ydb-embedded-ui/commit/e52639e84dc5e1ca2707bb38ed917cd613a9c395)) - - -### Bug Fixes - -* **AsyncReplication:** fix table styles ([#891](https://github.com/ydb-platform/ydb-embedded-ui/issues/891)) ([f879369](https://github.com/ydb-platform/ydb-embedded-ui/commit/f87936951e28e18823c8743b3634f6f7d0d18b55)) -* **TenantOverview:** increase section margin ([#916](https://github.com/ydb-platform/ydb-embedded-ui/issues/916)) ([d8f97f0](https://github.com/ydb-platform/ydb-embedded-ui/commit/d8f97f0de7d452a5f741cca023e233968be97bfa)) - ## [6.5.0](https://github.com/ydb-platform/ydb-embedded-ui/compare/v6.4.0...v6.5.0) (2024-06-06) diff --git a/package-lock.json b/package-lock.json index 718d223b3..9b4d30453 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ydb-embedded-ui", - "version": "6.6.0", + "version": "6.5.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "ydb-embedded-ui", - "version": "6.6.0", + "version": "6.5.0", "dependencies": { "@bem-react/classname": "^1.6.0", "@gravity-ui/axios-wrapper": "^1.4.1", diff --git a/package.json b/package.json index 38e4172da..4259128b3 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,10 @@ { "name": "ydb-embedded-ui", - "version": "6.6.0", + "version": "6.5.0", "files": [ "dist" ], - "main": "dist/lib.js", + "main": "dist/src/lib.js", "repository": { "type": "git", "url": "git@github.com:ydb-platform/ydb-embedded-ui.git" @@ -65,7 +65,7 @@ "lint:other": "npm run prettier -- --check", "prettier": "prettier '**/*.{json,yaml,yml,md}'", "unimported": "npx unimported --no-cache", - "package": "rm -rf dist && tsc -p tsconfig.package.json && copyfiles -u 1 'src/**/*.{css,scss,svg}' dist", + "package": "rm -rf dist && tsc -p tsconfig.package.json && copyfiles -u 1 'src/**/*.{css,scss,svg}' dist/src", "test": "react-app-rewired test", "eject": "react-scripts eject", "prepublishOnly": "npm run package", diff --git a/src/containers/App/App.scss b/src/containers/App/App.scss index 1a3c4b65b..b480824e8 100644 --- a/src/containers/App/App.scss +++ b/src/containers/App/App.scss @@ -28,6 +28,11 @@ body, :root { --g-color-base-yellow-light: rgba(255, 199, 0, 0.15); --g-color-base-yellow-medium: rgba(255, 219, 77, 0.4); + + --tenant-object-info-max-value-width: 300px; + --diagnostics-section-title-margin: 20px; + --diagnostics-section-margin: 30px; + --diagnostics-section-table-width: 872px; } .g-root { diff --git a/src/containers/AppWithClusters/ExtendedTenant/ExtendedTenant.tsx b/src/containers/AppWithClusters/ExtendedTenant/ExtendedTenant.tsx index f743c6d56..2b82af2f4 100644 --- a/src/containers/AppWithClusters/ExtendedTenant/ExtendedTenant.tsx +++ b/src/containers/AppWithClusters/ExtendedTenant/ExtendedTenant.tsx @@ -1,4 +1,5 @@ import {MonitoringButton} from '../../../components/MonitoringButton/MonitoringButton'; +import type {ETenantType} from '../../../types/api/tenant'; import type {GetMonitoringLink} from '../../../utils/monitoring'; import type Tenant from '../../Tenant/Tenant'; import {useClusterData} from '../useClusterData'; @@ -15,7 +16,7 @@ export function ExtendedTenant({ const {additionalNodesProps, cluster, monitoring} = useClusterData(); const additionalTenantProps = { - getMonitoringLink: (dbName?: string, dbType?: string) => { + getMonitoringLink: (dbName?: string, dbType?: ETenantType) => { if (monitoring && dbName && dbType && getMonitoringLink) { const href = getMonitoringLink({ monitoring, diff --git a/src/containers/Tenant/utils/schema.ts b/src/containers/Tenant/utils/schema.ts index 3094d5ecf..d214a953d 100644 --- a/src/containers/Tenant/utils/schema.ts +++ b/src/containers/Tenant/utils/schema.ts @@ -1,7 +1,7 @@ import type {NavigationTreeNodeType} from 'ydb-ui-components'; import {EPathSubType, EPathType} from '../../../types/api/schema'; -import {ETenantType} from '../../../types/api/tenant'; +import type {ETenantType} from '../../../types/api/tenant'; // this file contains verbose mappings that are typed in a way that ensures // correctness when a new node type or a new path type is added @@ -89,11 +89,11 @@ export const mapPathTypeToEntityName = ( // ==================== const databaseTypeToDBName: Record = { - [ETenantType.UnknownTenantType]: 'Database', - [ETenantType.Domain]: 'Cluster Root', - [ETenantType.Dedicated]: 'Dedicated Database', - [ETenantType.Shared]: 'Shared Database', - [ETenantType.Serverless]: 'Serverless Database', + UnknownTenantType: 'Database', + Domain: 'Cluster Root', + Dedicated: 'Dedicated Database', + Shared: 'Shared Database', + Serverless: 'Serverless Database', }; export const mapDatabaseTypeToDBName = (type?: ETenantType) => type && databaseTypeToDBName[type]; diff --git a/src/index.tsx b/src/index.tsx index 1b437a73c..5a8402071 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -8,7 +8,6 @@ import reportWebVitals from './reportWebVitals'; import {history, store} from './store/defaultStore'; import './styles/themes.scss'; -import './styles/constants.scss'; import './index.css'; async function render() { diff --git a/src/lib.ts b/src/lib.ts index 75f6b74e3..b25f9c5c4 100644 --- a/src/lib.ts +++ b/src/lib.ts @@ -16,7 +16,7 @@ export {setUserSettings} from './store/reducers/settings/settings'; export {componentsRegistry} from './components/ComponentsProvider/componentsRegistry'; export {useSetting, useTypedSelector} from './utils/hooks'; export {getMonitoringLink, getMonitoringClusterLink} from './utils/monitoring'; -export {i18n, Lang} from './utils/i18n'; +export {i18n, Lang, registerKeysets} from './utils/i18n'; export {toaster} from './utils/createToast'; export {cn} from './utils/cn'; export * from './utils/constants'; @@ -31,3 +31,4 @@ export type { } from './containers/UserSettings/settings'; export type {SettingProps} from './containers/UserSettings/Setting'; export type {AsideNavigationProps} from './containers/AsideNavigation/AsideNavigation'; +export type {GetMonitoringLink, GetMonitoringClusterLink} from './utils/monitoring'; diff --git a/src/styles/constants.scss b/src/styles/constants.scss deleted file mode 100644 index b82a1e363..000000000 --- a/src/styles/constants.scss +++ /dev/null @@ -1,9 +0,0 @@ -:root { - --tenant-object-info-max-value-width: 300px; - - --diagnostics-section-title-margin: 20px; - - --diagnostics-section-margin: 30px; - - --diagnostics-section-table-width: 872px; -} diff --git a/src/types/api/tenant.ts b/src/types/api/tenant.ts index 619fe6850..a4d2d1bef 100644 --- a/src/types/api/tenant.ts +++ b/src/types/api/tenant.ts @@ -128,13 +128,7 @@ export interface ControlPlane { name?: string; } -export enum ETenantType { - 'UnknownTenantType' = 'UnknownTenantType', - 'Domain' = 'Domain', - 'Dedicated' = 'Dedicated', - 'Shared' = 'Shared', - 'Serverless' = 'Serverless', -} +export type ETenantType = 'UnknownTenantType' | 'Domain' | 'Dedicated' | 'Shared' | 'Serverless'; export enum State { 'STATE_UNSPECIFIED' = 'STATE_UNSPECIFIED', diff --git a/src/utils/__test__/monitoring.test.ts b/src/utils/__test__/monitoring.test.ts index 514ed07c9..e89c7045c 100644 --- a/src/utils/__test__/monitoring.test.ts +++ b/src/utils/__test__/monitoring.test.ts @@ -14,7 +14,7 @@ describe('getMonitoringLink', () => { monitoring: solomonString, clusterName: 'global', dbName: 'database', - dbType: 'Database', + dbType: 'Dedicated', }), ).toBe( 'https://monitoring.test.ai/projects/yc.ydb.ydbaas-cloud/dashboards/aol34hftdn7o4fls50sv?p.cluster=global&p.host=cluster&p.slot=static&p.database=database', diff --git a/src/utils/monitoring.ts b/src/utils/monitoring.ts index a0ea95b66..e76b20c4b 100644 --- a/src/utils/monitoring.ts +++ b/src/utils/monitoring.ts @@ -1,4 +1,4 @@ -import {ETenantType} from '../types/api/tenant'; +import type {ETenantType} from '../types/api/tenant'; export type ParsedMonitoringData = { monitoring_url: string; @@ -16,7 +16,7 @@ export type ParsedMonitoringData = { export interface GetMonitoringLinkProps { monitoring: string; dbName: string; - dbType: string; + dbType: ETenantType; clusterName?: string; } @@ -41,9 +41,7 @@ export function getMonitoringLink({ if (!url.search) { const dashboard = - dbType === ETenantType.Serverless - ? data.serverless_dashboard - : data.dedicated_dashboard; + dbType === 'Serverless' ? data.serverless_dashboard : data.dedicated_dashboard; url.pathname += `/${dashboard}`; } diff --git a/tsconfig.package.json b/tsconfig.package.json index 245953dd0..8185af8cf 100644 --- a/tsconfig.package.json +++ b/tsconfig.package.json @@ -6,6 +6,6 @@ "noEmit": false, "importHelpers": true }, - "include": ["src/**/*"], + "include": ["src/**/*", "package.json"], "exclude": ["src/setup*", "src/index.tsx", "**/__tests__", "**/tests"] }