Skip to content

Commit

Permalink
Hotfix/cb 5872 aws marketplace change the instruction in the version …
Browse files Browse the repository at this point in the history
…update tab (#3099)
  • Loading branch information
sergeyteleshev authored Nov 26, 2024
1 parent b2a0a88 commit be112be
Show file tree
Hide file tree
Showing 14 changed files with 26 additions and 17 deletions.
8 changes: 0 additions & 8 deletions webapp/packages/core-links/src/GithubLinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,4 @@ 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;
},
};
1 change: 1 addition & 0 deletions webapp/packages/core-links/src/WebsiteLinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const WEBSITE_LINKS = {
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/',
AWS_DEPLOY_UPDATE_PAGE: 'https://dbeaver.com/docs/cloudbeaver/Managing-CloudBeaver-server-on-AWS/#version-update-procedure',

ENTERPRISE_BUY_PRODUCT_PAGE: 'https://dbeaver.com/products/cloudbeaver-enterprise/',
TEAM_EDITION_BUY_PRODUCT_PAGE: 'https://dbeaver.com/products/team-edition/',
Expand Down
2 changes: 1 addition & 1 deletion webapp/packages/core-localization/src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export default [
['ui_close_others', 'Close others'],
['ui_close_all_to_the_right', 'Close all to the Right'],
['ui_close_all_to_the_left', 'Close all to the Left'],
['ui_or', 'Or'],
['ui_or', 'or'],
['ui_download', 'Download'],
['ui_download_file', 'Download file'],
['ui_upload', 'Upload'],
Expand Down
2 changes: 1 addition & 1 deletion webapp/packages/core-localization/src/locales/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export default [
['ui_close_others', 'Fermer les autres'],
['ui_close_all_to_the_right', 'Fermer tout à droite'],
['ui_close_all_to_the_left', 'Fermer tout à gauche'],
['ui_or', 'Ou'],
['ui_or', 'ou'],
['ui_download', 'Télécharger'],
['ui_download_file', 'Télécharger le fichier'],
['ui_upload', 'Importer'],
Expand Down
2 changes: 1 addition & 1 deletion webapp/packages/core-localization/src/locales/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export default [
['ui_close_others', 'Close others'],
['ui_close_all_to_the_right', 'Close all to the Right'],
['ui_close_all_to_the_left', 'Close all to the Left'],
['ui_or', 'Or'],
['ui_or', 'or'],
['ui_download', 'Download'],
['ui_download_file', 'Download file'],
['ui_upload', 'Upload'],
Expand Down
2 changes: 1 addition & 1 deletion webapp/packages/core-localization/src/locales/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export default [
['ui_close_others', 'Закрыть другие'],
['ui_close_all_to_the_right', 'Закрыть все справа'],
['ui_close_all_to_the_left', 'Закрыть все слева'],
['ui_or', 'Или'],
['ui_or', 'или'],
['ui_download', 'Cкачать'],
['ui_download_file', 'Скачать файл'],
['ui_upload', 'Загрузить'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@
* 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 { Link, Text, useTranslate } from '@cloudbeaver/core-blocks';

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

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

if (!link) {
return <Text className={className}>{translate('version_update_instruction_link_not_provided')}</Text>;
}

return (
<div className={className}>
{translate('version_update_instruction')}{' '}
Expand Down
11 changes: 9 additions & 2 deletions webapp/packages/core-version-update/src/VersionUpdateService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
* Licensed under the Apache License, Version 2.0.
* you may not use this file except in compliance with the License.
*/
import { computed, makeObservable } from 'mobx';
import { computed, makeObservable, observable } from 'mobx';

import { injectable } from '@cloudbeaver/core-di';
import { type IVersion, VersionResource, VersionService } from '@cloudbeaver/core-version';

interface IInstructionProps {
version: IVersion;
link: string;
link: string | null;
containerId?: string;
className?: string;
}
Expand All @@ -23,6 +23,7 @@ export type InstructionComponent = React.FunctionComponent<IInstructionProps>;
export class VersionUpdateService {
generalInstructionsGetter: (() => React.FC) | null = null;
versionInstructionGetter: (() => InstructionComponent) | null;
instructionLink: string | null;

get newVersionAvailable() {
if (!this.versionService.current || !this.versionResource.latest) {
Expand All @@ -37,12 +38,18 @@ export class VersionUpdateService {
private readonly versionResource: VersionResource,
) {
this.versionInstructionGetter = null;
this.instructionLink = null;

makeObservable(this, {
newVersionAvailable: computed,
instructionLink: observable.ref,
});
}

registerInstructionLink(link: string): void {
this.instructionLink = link;
}

registerVersionInstruction(componentGetter: () => InstructionComponent): void {
this.versionInstructionGetter = componentGetter;
}
Expand Down
1 change: 1 addition & 0 deletions webapp/packages/core-version-update/src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ export default [
['version_update_info', 'Info'],
['version_update_instruction', 'To update version, please follow'],
['version_update_instruction_link', 'the instructions'],
['version_update_instruction_link_not_provided', 'Instructions link is not provided. Please contact support.'],
];
1 change: 1 addition & 0 deletions webapp/packages/core-version-update/src/locales/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ export default [
['version_update_info', 'Info'],
['version_update_instruction', 'To update version, please follow'],
['version_update_instruction_link', 'the instructions'],
['version_update_instruction_link_not_provided', 'Instructions link is not provided. Please contact support.'],
];
1 change: 1 addition & 0 deletions webapp/packages/core-version-update/src/locales/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ export default [
['version_update_info', 'Info'],
['version_update_instruction', 'To update version, please follow'],
['version_update_instruction_link', 'the instructions'],
['version_update_instruction_link_not_provided', 'Instructions link is not provided. Please contact support.'],
];
1 change: 1 addition & 0 deletions webapp/packages/core-version-update/src/locales/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ export default [
['version_update_info', 'Информация'],
['version_update_instruction', 'Чтобы обновить версию, следуйте'],
['version_update_instruction_link', 'инструкциям'],
['version_update_instruction_link_not_provided', 'Ссылка на инструкции не предоставлена. Обратитесь в службу поддержки.'],
];
1 change: 1 addition & 0 deletions webapp/packages/core-version-update/src/locales/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ export default [
['version_update_info', '信息'],
['version_update_instruction', 'To update version, please follow'],
['version_update_instruction_link', 'the instructions'],
['version_update_instruction_link_not_provided', 'Instructions link is not provided. Please contact support.'],
];
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ 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 { 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 @@ -39,6 +38,7 @@ export const VersionSelector = observer<Props>(function VersionSelector({ versio

const version = versions.find(v => v.number === selected);
const Instruction = versionUpdateService.versionInstructionGetter?.();
const instructionLink = versionUpdateService.instructionLink;

return (
<Container gap>
Expand All @@ -56,7 +56,7 @@ export const VersionSelector = observer<Props>(function VersionSelector({ versio
{version && Instruction && (
<GroupItem>
<Instruction
link={GITHUB_LINKS.getDeployUpdateLink(!!serverConfigResource.data?.distributed)}
link={instructionLink}
className={s(style, { instruction: true })}
version={version}
containerId={serverConfigResource.data?.containerId}
Expand Down

0 comments on commit be112be

Please sign in to comment.