Skip to content

Commit

Permalink
CB-5645 pr fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeyteleshev committed Oct 23, 2024
1 parent 098e823 commit a000e94
Show file tree
Hide file tree
Showing 13 changed files with 53 additions and 54 deletions.
19 changes: 9 additions & 10 deletions webapp/packages/core-links/src/GithubLinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,16 @@
* Licensed under the Apache License, Version 2.0.
* you may not use this file except in compliance with the License.
*/
export class GithubLinks {
static CLOUDBEAVER_REPO = 'https://github.com/dbeaver/cloudbeaver';
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',

static EE_DEPLOY_UPDATE = 'https://github.com/dbeaver/cloudbeaver-deploy?tab=readme-ov-file#updating-the-cluster';
static TE_DEPLOY_UPDATE = 'https://github.com/dbeaver/team-edition-deploy?tab=readme-ov-file#server-version-update';

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

return GithubLinks.EE_DEPLOY_UPDATE;
}
}
return GITHUB_LINKS.EE_DEPLOY_UPDATE;
},
};
39 changes: 19 additions & 20 deletions webapp/packages/core-links/src/WebsiteLinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,28 @@
* Licensed under the Apache License, Version 2.0.
* you may not use this file except in compliance with the License.
*/
export class WebsiteLinks {
static ROOT_PAGE = 'https://dbeaver.com/';
static DATA_EDITOR_DOCUMENTATION_PAGE = 'https://dbeaver.com/docs/cloudbeaver/Data-editor/';
static SQL_EDITOR_DOCUMENTATION_PAGE = 'https://dbeaver.com/docs/cloudbeaver/SQL-Editor/';
static SERVER_CONFIGURATION_RESOURCE_QUOTAS_PAGE = 'https://dbeaver.com/docs/cloudbeaver/Server-configuration/#resource-quotas';
static DATABASE_NAVIGATOR_DOCUMENTATION_PAGE = 'https://dbeaver.com/docs/cloudbeaver/Database-Navigator/';
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/',

static ENTERPRISE_BUY_PRODUCT_PAGE = 'https://dbeaver.com/products/cloudbeaver-enterprise/';
static TEAM_EDITION_BUY_PRODUCT_PAGE = 'https://dbeaver.com/products/team-edition/';
static LATEST_COMMUNITY_VERSION_PAGE = 'https://dbeaver.com/product/cloudbeaver-ce-version.json';
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/',

static TEAM_ARCHIVE = 'https://dbeaver.com/downloads-team';
static CONTACT_PAGE = 'https://dbeaver.com/contact/';
getTeamArchiveById(id: string) {
return `${WEBSITE_LINKS.TEAM_ARCHIVE}/${id}`;
},

static getTeamArchiveById(id: string) {
return `${WebsiteLinks.TEAM_ARCHIVE}/${id}`;
}

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

return WebsiteLinks.ENTERPRISE_BUY_PRODUCT_PAGE;
}
}
return WEBSITE_LINKS.ENTERPRISE_BUY_PRODUCT_PAGE;
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Licensed under the Apache License, Version 2.0.
* you may not use this file except in compliance with the License.
*/
import { WebsiteLinks } from '@cloudbeaver/core-links';
import { WEBSITE_LINKS } from '@cloudbeaver/core-links';
import type { ServerConfigQuery } from '@cloudbeaver/core-sdk';

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
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,14 @@ import { Link, useTranslate } from '@cloudbeaver/core-blocks';

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

const SPLITTER = '*splitter*';

export const BaseUpdateInstruction: InstructionComponent = function UpdateInstruction({ version, containerId, link, className }) {
const translate = useTranslate();
const mainText = translate('version_update_instruction').split(SPLITTER)[0]?.trim();
const linkText = translate('version_update_instruction').split(SPLITTER)[1]?.trim();

return (
<div className={className}>
{mainText}{' '}
{translate('version_update_instruction')}{' '}
<Link href={link} target="_blank" rel="noopener noreferrer" inline indicator>
{linkText}
{translate('version_update_instruction_link')}
</Link>
</div>
);
Expand Down
3 changes: 2 additions & 1 deletion webapp/packages/core-version-update/src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +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 *splitter* the instructions'],
['version_update_instruction', 'To update version, please follow'],
['version_update_instruction_link', 'the instructions'],
];
3 changes: 2 additions & 1 deletion webapp/packages/core-version-update/src/locales/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +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 *splitter* the instructions'],
['version_update_instruction', 'To update version, please follow'],
['version_update_instruction_link', 'the instructions'],
];
3 changes: 2 additions & 1 deletion webapp/packages/core-version-update/src/locales/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +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 *splitter* the instructions'],
['version_update_instruction', 'To update version, please follow'],
['version_update_instruction_link', 'the instructions'],
];
3 changes: 2 additions & 1 deletion webapp/packages/core-version-update/src/locales/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ export default [
['version_update_versions_refresh_fail', 'Не удалось обновить список версий'],
['version_update_how_to_update', 'Как обновить версию'],
['version_update_info', 'Информация'],
['version_update_instruction', 'Чтобы обновить версию, следуйте *splitter* инструкциям'],
['version_update_instruction', 'Чтобы обновить версию, следуйте'],
['version_update_instruction_link', 'инструкциям'],
];
3 changes: 2 additions & 1 deletion webapp/packages/core-version-update/src/locales/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +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 *splitter* the instructions'],
['version_update_instruction', 'To update version, please follow'],
['version_update_instruction_link', 'the instructions'],
];
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { observer } from 'mobx-react-lite';

import { Container, Link, s, usePermission, useS, useTranslate } from '@cloudbeaver/core-blocks';
import { WebsiteLinks } from '@cloudbeaver/core-links';
import { WEBSITE_LINKS } from '@cloudbeaver/core-links';
import { EAdminPermission } from '@cloudbeaver/core-root';

import type { IResultSetElementKey } from '../DatabaseDataModel/Actions/ResultSet/IResultSetDataKey.js';
Expand Down Expand Up @@ -46,7 +46,7 @@ export const QuotaPlaceholder: React.FC<React.PropsWithChildren<Props>> = observ
&nbsp;
<span className={s(style, { limitWord: true })}>
{admin ? (
<Link title={limitInfo?.limitWithSize} href={WebsiteLinks.SERVER_CONFIGURATION_RESOURCE_QUOTAS_PAGE} target="_blank" indicator>
<Link title={limitInfo?.limitWithSize} href={WEBSITE_LINKS.SERVER_CONFIGURATION_RESOURCE_QUOTAS_PAGE} target="_blank" indicator>
{translate('ui_limit')}
</Link>
) : (
Expand Down
8 changes: 4 additions & 4 deletions webapp/packages/plugin-help/src/Shortcuts/ShortcutsDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
useTranslate,
} from '@cloudbeaver/core-blocks';
import type { DialogComponent } from '@cloudbeaver/core-dialogs';
import { WebsiteLinks } from '@cloudbeaver/core-links';
import { WEBSITE_LINKS } from '@cloudbeaver/core-links';

import { Shortcut } from './Shortcut.js';
import { DATA_VIEWER_SHORTCUTS, NAVIGATION_TREE_SHORTCUTS, SQL_EDITOR_SHORTCUTS } from './SHORTCUTS_DATA.js';
Expand All @@ -37,7 +37,7 @@ export const ShortcutsDialog: DialogComponent<null> = function ShortcutsDialog({
<Container className={s(styles, { container: true })} gap wrap overflow>
<Group box gap dense overflow>
<GroupTitle header>
<Link href={WebsiteLinks.DATA_EDITOR_DOCUMENTATION_PAGE} target="_blank" wrapper indicator>
<Link href={WEBSITE_LINKS.DATA_EDITOR_DOCUMENTATION_PAGE} target="_blank" wrapper indicator>
Data Viewer
</Link>
</GroupTitle>
Expand All @@ -47,7 +47,7 @@ export const ShortcutsDialog: DialogComponent<null> = function ShortcutsDialog({
</Group>
<Group box gap dense overflow>
<GroupTitle header>
<Link href={WebsiteLinks.SQL_EDITOR_DOCUMENTATION_PAGE} target="_blank" wrapper indicator>
<Link href={WEBSITE_LINKS.SQL_EDITOR_DOCUMENTATION_PAGE} target="_blank" wrapper indicator>
SQL Editor
</Link>
</GroupTitle>
Expand All @@ -57,7 +57,7 @@ export const ShortcutsDialog: DialogComponent<null> = function ShortcutsDialog({
</Group>
<Group box gap dense overflow>
<GroupTitle header>
<Link href={WebsiteLinks.DATABASE_NAVIGATOR_DOCUMENTATION_PAGE} target="_blank" wrapper indicator>
<Link href={WEBSITE_LINKS.DATABASE_NAVIGATOR_DOCUMENTATION_PAGE} target="_blank" wrapper indicator>
Navigation Tree
</Link>
</GroupTitle>
Expand Down
6 changes: 3 additions & 3 deletions webapp/packages/plugin-product/src/ProductInfoDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
} from '@cloudbeaver/core-blocks';
import { useService } from '@cloudbeaver/core-di';
import type { DialogComponentProps } from '@cloudbeaver/core-dialogs';
import { GithubLinks, WebsiteLinks } from '@cloudbeaver/core-links';
import { GITHUB_LINKS, WEBSITE_LINKS } from '@cloudbeaver/core-links';
import { ProductInfoResource } from '@cloudbeaver/core-root';
import { ThemeService } from '@cloudbeaver/core-theming';
import { useAppVersion } from '@cloudbeaver/core-version';
Expand Down Expand Up @@ -70,12 +70,12 @@ export const ProductInfoDialog = observer<DialogComponentProps<null>>(function P
<FormFieldDescription className={s(styles, { formFieldDescription: true })} label={translate('app_product_info_contacts')}>
<div className={s(styles, { contactsInfo: true })}>
You can contact us via our
<Link href={WebsiteLinks.CONTACT_PAGE} target="_blank" rel="noopener noreferrer">
<Link href={WEBSITE_LINKS.CONTACT_PAGE} target="_blank" rel="noopener noreferrer">
{' '}
Site{' '}
</Link>
or
<Link href={GithubLinks.CLOUDBEAVER_REPO} target="_blank" rel="noopener noreferrer">
<Link href={GITHUB_LINKS.CLOUDBEAVER_REPO} target="_blank" rel="noopener noreferrer">
{' '}
Github
</Link>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { useEffect, useState } from 'react';

import { Combobox, Container, Group, GroupItem, GroupTitle, s, useS, useTranslate } from '@cloudbeaver/core-blocks';
import { useService } from '@cloudbeaver/core-di';
import { GithubLinks } from '@cloudbeaver/core-links';
import { GITHUB_LINKS } from '@cloudbeaver/core-links';
import { ServerConfigResource } from '@cloudbeaver/core-root';
import { type IVersion, VersionResource } from '@cloudbeaver/core-version';
import { VersionUpdateService } from '@cloudbeaver/core-version-update';
Expand Down Expand Up @@ -56,7 +56,7 @@ export const VersionSelector = observer<Props>(function VersionSelector({ versio
{version && Instruction && (
<GroupItem>
<Instruction
link={GithubLinks.getDeployUpdateLink(!!serverConfigResource.data?.distributed)}
link={GITHUB_LINKS.getDeployUpdateLink(!!serverConfigResource.data?.distributed)}
className={s(style, { instruction: true })}
version={version}
containerId={serverConfigResource.data?.containerId}
Expand Down

0 comments on commit a000e94

Please sign in to comment.