Skip to content

Commit

Permalink
CB-5645 [EE\AWS] Change the instruction in the Version update tab (#3017
Browse files Browse the repository at this point in the history
)

* CB-5645 adds core-links and GithubLinks

* CB-5645 adds BaseUpdate instruction to EE, TE, AWS

* CB-5645 pr fixes

* CB-5645 REVERT IT (need for tests)

* Revert "CB-5645 REVERT IT (need for tests)"

This reverts commit 6c53b90.

---------

Co-authored-by: Daria Marutkina <[email protected]>
  • Loading branch information
sergeyteleshev and dariamarutkina authored Oct 25, 2024
1 parent 0126b20 commit 4cfb27b
Show file tree
Hide file tree
Showing 42 changed files with 177 additions and 74 deletions.
2 changes: 1 addition & 1 deletion webapp/packages/core-bootstrap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"@cloudbeaver/core-dialogs": "^0",
"@cloudbeaver/core-events": "^0",
"@cloudbeaver/core-executor": "^0",
"@cloudbeaver/core-links": "^0",
"@cloudbeaver/core-localization": "^0",
"@cloudbeaver/core-navigation-tree": "^0",
"@cloudbeaver/core-product": "^0",
Expand All @@ -52,7 +53,6 @@
"@cloudbeaver/core-version": "^0",
"@cloudbeaver/core-version-update": "^0",
"@cloudbeaver/core-view": "^0",
"@cloudbeaver/core-website": "^0",
"mobx": "^6",
"react": "^18",
"react-dom": "^18"
Expand Down
4 changes: 2 additions & 2 deletions webapp/packages/core-bootstrap/src/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { coreConnectionsManifest } from '@cloudbeaver/core-connections';
import { coreDIManifest, type PluginManifest } from '@cloudbeaver/core-di';
import { coreDialogsManifest } from '@cloudbeaver/core-dialogs';
import { coreEventsManifest } from '@cloudbeaver/core-events';
import { coreLinksManifest } from '@cloudbeaver/core-links';
import { coreLocalizationManifest } from '@cloudbeaver/core-localization';
import { coreNavigationTree } from '@cloudbeaver/core-navigation-tree';
import { coreProductManifest } from '@cloudbeaver/core-product';
Expand All @@ -38,7 +39,6 @@ import { coreUIManifest } from '@cloudbeaver/core-ui';
import { coreVersionManifest } from '@cloudbeaver/core-version';
import { coreVersionUpdateManifest } from '@cloudbeaver/core-version-update';
import { coreViewManifest } from '@cloudbeaver/core-view';
import { coreWebsiteManifest } from '@cloudbeaver/core-website';

export const coreManifests: PluginManifest[] = [
{
Expand All @@ -64,7 +64,7 @@ export const coreManifests: PluginManifest[] = [
coreResourceManifest,
coreSDKManifest,
coreRootManifest,
coreWebsiteManifest,
coreLinksManifest,
coreBrowserSettingsManifest,
coreBrowserCookiesManifest,
coreProductManifest,
Expand Down
6 changes: 3 additions & 3 deletions webapp/packages/core-bootstrap/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
{
"path": "../core-executor/tsconfig.json"
},
{
"path": "../core-links/tsconfig.json"
},
{
"path": "../core-localization/tsconfig.json"
},
Expand Down Expand Up @@ -107,9 +110,6 @@
},
{
"path": "../core-view/tsconfig.json"
},
{
"path": "../core-website/tsconfig.json"
}
],
"include": [
Expand Down
2 changes: 2 additions & 0 deletions webapp/packages/core-client-activity/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
},
"peerDependencies": {},
"devDependencies": {
"@jest/globals": "^29",
"@types/jest": "^29",
"typescript": "^5"
}
}
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@cloudbeaver/core-website",
"name": "@cloudbeaver/core-links",
"type": "module",
"sideEffects": [
"src/**/*.css",
Expand Down
20 changes: 20 additions & 0 deletions webapp/packages/core-links/src/GithubLinks.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* CloudBeaver - Cloud Database Manager
* Copyright (C) 2020-2024 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0.
* you may not use this file except in compliance with the License.
*/
export const GITHUB_LINKS = {
CLOUDBEAVER_REPO: 'https://github.com/dbeaver/cloudbeaver',
EE_DEPLOY_UPDATE: 'https://github.com/dbeaver/cloudbeaver-deploy?tab=readme-ov-file#updating-the-cluster',
TE_DEPLOY_UPDATE: 'https://github.com/dbeaver/team-edition-deploy?tab=readme-ov-file#server-version-update',

getDeployUpdateLink(distributed: boolean) {
if (distributed) {
return GITHUB_LINKS.TE_DEPLOY_UPDATE;
}

return GITHUB_LINKS.EE_DEPLOY_UPDATE;
},
};
32 changes: 32 additions & 0 deletions webapp/packages/core-links/src/WebsiteLinks.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* CloudBeaver - Cloud Database Manager
* Copyright (C) 2020-2024 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0.
* you may not use this file except in compliance with the License.
*/
export const WEBSITE_LINKS = {
ROOT_PAGE: 'https://dbeaver.com/',
DATA_EDITOR_DOCUMENTATION_PAGE: 'https://dbeaver.com/docs/cloudbeaver/Data-editor/',
SQL_EDITOR_DOCUMENTATION_PAGE: 'https://dbeaver.com/docs/cloudbeaver/SQL-Editor/',
SERVER_CONFIGURATION_RESOURCE_QUOTAS_PAGE: 'https://dbeaver.com/docs/cloudbeaver/Server-configuration/#resource-quotas',
DATABASE_NAVIGATOR_DOCUMENTATION_PAGE: 'https://dbeaver.com/docs/cloudbeaver/Database-Navigator/',

ENTERPRISE_BUY_PRODUCT_PAGE: 'https://dbeaver.com/products/cloudbeaver-enterprise/',
TEAM_EDITION_BUY_PRODUCT_PAGE: 'https://dbeaver.com/products/team-edition/',
LATEST_COMMUNITY_VERSION_PAGE: 'https://dbeaver.com/product/cloudbeaver-ce-version.json',
TEAM_ARCHIVE: 'https://dbeaver.com/downloads-team',
CONTACT_PAGE: 'https://dbeaver.com/contact/',

getTeamArchiveById(id: string) {
return `${WEBSITE_LINKS.TEAM_ARCHIVE}/${id}`;
},

getProductBuyPage(distributed: boolean) {
if (distributed) {
return WEBSITE_LINKS.TEAM_EDITION_BUY_PRODUCT_PAGE;
}

return WEBSITE_LINKS.ENTERPRISE_BUY_PRODUCT_PAGE;
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
* you may not use this file except in compliance with the License.
*/
export * from './WebsiteLinks.js';
export * from './GithubLinks.js';
export * from './manifest.js';
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
*/
import type { PluginManifest } from '@cloudbeaver/core-di';

export const coreWebsiteManifest: PluginManifest = {
export const coreLinksManifest: PluginManifest = {
info: {
name: 'Core Website',
name: 'Core Links',
},

providers: [],
Expand Down
File renamed without changes.
2 changes: 2 additions & 0 deletions webapp/packages/core-localization/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
},
"peerDependencies": {},
"devDependencies": {
"@jest/globals": "^29",
"@types/jest": "^29",
"typescript": "^5"
}
}
2 changes: 1 addition & 1 deletion webapp/packages/core-root/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
},
"peerDependencies": {},
"devDependencies": {
"@cloudbeaver/core-links": "^0",
"@cloudbeaver/core-sdk": "^0",
"@cloudbeaver/core-website": "^0",
"@cloudbeaver/tests-runner": "^0",
"@jest/globals": "^29",
"@types/jest": "^29",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* Licensed under the Apache License, Version 2.0.
* you may not use this file except in compliance with the License.
*/
import { WEBSITE_LINKS } from '@cloudbeaver/core-links';
import type { ServerConfigQuery } from '@cloudbeaver/core-sdk';
import { WebsiteLinks } from '@cloudbeaver/core-website';

import { defaultProductConfiguration } from './defaultProductConfiguration.js';

Expand Down Expand Up @@ -113,7 +113,7 @@ export const defaultServerConfig: (productConfiguration?: Record<string, any>) =
productInfo: {
id: 'io.cloudbeaver.product.ce.product',
version: '22.1.2.202207140640',
latestVersionInfo: WebsiteLinks.LATEST_COMMUNITY_VERSION_PAGE,
latestVersionInfo: WEBSITE_LINKS.LATEST_COMMUNITY_VERSION_PAGE,
name: 'CloudBeaver CE Server',
description: 'Cloudbeaver Web UI Application',
buildTime: 'July 14, 2022',
Expand Down
6 changes: 3 additions & 3 deletions webapp/packages/core-root/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
{
"path": "../core-executor/tsconfig.json"
},
{
"path": "../core-links/tsconfig.json"
},
{
"path": "../core-localization/tsconfig.json"
},
Expand All @@ -41,9 +44,6 @@
{
"path": "../core-utils/tsconfig.json"
},
{
"path": "../core-website/tsconfig.json"
},
{
"path": "../tests-runner/tsconfig.json"
}
Expand Down
6 changes: 5 additions & 1 deletion webapp/packages/core-version-update/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,17 @@
"update-ts-references": "yarn run clean && typescript-resolve-references"
},
"dependencies": {
"@cloudbeaver/core-blocks": "^0",
"@cloudbeaver/core-di": "^0",
"@cloudbeaver/core-localization": "^0",
"@cloudbeaver/core-version": "^0",
"mobx": "^6"
"@cloudbeaver/core-version-update": "^0",
"mobx": "^6",
"react": "^18"
},
"peerDependencies": {},
"devDependencies": {
"@types/react": "^18",
"typescript": "^5"
}
}
23 changes: 23 additions & 0 deletions webapp/packages/core-version-update/src/BaseUpdateInstruction.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* CloudBeaver - Cloud Database Manager
* Copyright (C) 2020-2024 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0.
* you may not use this file except in compliance with the License.
*/
import { Link, useTranslate } from '@cloudbeaver/core-blocks';

import type { InstructionComponent } from './VersionUpdateService.js';

export const BaseUpdateInstruction: InstructionComponent = function UpdateInstruction({ version, containerId, link, className }) {
const translate = useTranslate();

return (
<div className={className}>
{translate('version_update_instruction')}{' '}
<Link href={link} target="_blank" rel="noopener noreferrer" inline indicator>
{translate('version_update_instruction_link')}
</Link>
</div>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { type IVersion, VersionResource, VersionService } from '@cloudbeaver/cor

interface IInstructionProps {
version: IVersion;
link: string;
containerId?: string;
className?: string;
}
Expand Down
1 change: 1 addition & 0 deletions webapp/packages/core-version-update/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
export { manifest as coreVersionUpdateManifest } from './manifest.js';

export * from './VersionUpdateService.js';
export * from './BaseUpdateInstruction.js';
9 changes: 9 additions & 0 deletions webapp/packages/core-version-update/src/locales/en.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/*
* CloudBeaver - Cloud Database Manager
* Copyright (C) 2020-2024 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0.
* you may not use this file except in compliance with the License.
*/
export default [
['version_update', 'Version update'],
['version_update_version_is_up_to_date', 'Version is up to date'],
Expand All @@ -7,4 +14,6 @@ export default [
['version_update_versions_refresh_fail', 'Versions list refresh failed'],
['version_update_how_to_update', 'How to update'],
['version_update_info', 'Info'],
['version_update_instruction', 'To update version, please follow'],
['version_update_instruction_link', 'the instructions'],
];
2 changes: 2 additions & 0 deletions webapp/packages/core-version-update/src/locales/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ export default [
['version_update_versions_refresh_fail', 'Échec du rafraîchissement de la liste des versions'],
['version_update_how_to_update', 'Comment mettre à jour'],
['version_update_info', 'Info'],
['version_update_instruction', 'To update version, please follow'],
['version_update_instruction_link', 'the instructions'],
];
9 changes: 9 additions & 0 deletions webapp/packages/core-version-update/src/locales/it.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/*
* CloudBeaver - Cloud Database Manager
* Copyright (C) 2020-2024 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0.
* you may not use this file except in compliance with the License.
*/
export default [
['version_update', 'Version update'],
['version_update_version_is_up_to_date', 'Version is up to date'],
Expand All @@ -7,4 +14,6 @@ export default [
['version_update_versions_refresh_fail', 'Versions list refresh failed'],
['version_update_how_to_update', 'How to update'],
['version_update_info', 'Info'],
['version_update_instruction', 'To update version, please follow'],
['version_update_instruction_link', 'the instructions'],
];
9 changes: 9 additions & 0 deletions webapp/packages/core-version-update/src/locales/ru.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/*
* CloudBeaver - Cloud Database Manager
* Copyright (C) 2020-2024 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0.
* you may not use this file except in compliance with the License.
*/
export default [
['version_update', 'Обновление версии'],
['version_update_version_is_up_to_date', 'Установлена актуальная версия'],
Expand All @@ -7,4 +14,6 @@ export default [
['version_update_versions_refresh_fail', 'Не удалось обновить список версий'],
['version_update_how_to_update', 'Как обновить версию'],
['version_update_info', 'Информация'],
['version_update_instruction', 'Чтобы обновить версию, следуйте'],
['version_update_instruction_link', 'инструкциям'],
];
2 changes: 2 additions & 0 deletions webapp/packages/core-version-update/src/locales/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ export default [
['version_update_versions_refresh_fail', '版本列表刷新失败'],
['version_update_how_to_update', '如何升级'],
['version_update_info', '信息'],
['version_update_instruction', 'To update version, please follow'],
['version_update_instruction_link', 'the instructions'],
];
3 changes: 3 additions & 0 deletions webapp/packages/core-version-update/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"tsBuildInfoFile": "dist/tsconfig.tsbuildinfo"
},
"references": [
{
"path": "../core-blocks/tsconfig.json"
},
{
"path": "../core-di/tsconfig.json"
},
Expand Down
3 changes: 2 additions & 1 deletion webapp/packages/core-view/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"@cloudbeaver/core-utils": "^0",
"mobx": "^6",
"mobx-react-lite": "^4",
"react": "^18"
"react": "^18",
"react-hotkeys-hook": "^4"
},
"peerDependencies": {},
"devDependencies": {
Expand Down
35 changes: 0 additions & 35 deletions webapp/packages/core-website/src/WebsiteLinks.ts

This file was deleted.

3 changes: 3 additions & 0 deletions webapp/packages/plugin-administration/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
{
"path": "../core-connections/tsconfig.json"
},
{
"path": "../core-data-context/tsconfig.json"
},
{
"path": "../core-di/tsconfig.json"
},
Expand Down
Loading

0 comments on commit 4cfb27b

Please sign in to comment.