From 8077dc001513d7f10a04846b4e4c44cd6583008c Mon Sep 17 00:00:00 2001 From: Naumov Alexey Date: Mon, 20 Dec 2021 16:56:01 +0300 Subject: [PATCH] feat(core-version): CB-1432 show versions that >= current --- .../src/EVersionUpdate.ts | 12 ---- .../src/Instructions.tsx | 5 +- .../src/VersionUpdate.tsx | 57 +++++-------------- 3 files changed, 19 insertions(+), 55 deletions(-) delete mode 100644 webapp/packages/plugin-version-update-administration/src/EVersionUpdate.ts diff --git a/webapp/packages/plugin-version-update-administration/src/EVersionUpdate.ts b/webapp/packages/plugin-version-update-administration/src/EVersionUpdate.ts deleted file mode 100644 index 6897cb7c76..0000000000 --- a/webapp/packages/plugin-version-update-administration/src/EVersionUpdate.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* - * CloudBeaver - Cloud Database Manager - * Copyright (C) 2020-2021 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 enum EVersionUpdate { - INFO = 'info', - VERSIONS = 'versions', -} diff --git a/webapp/packages/plugin-version-update-administration/src/Instructions.tsx b/webapp/packages/plugin-version-update-administration/src/Instructions.tsx index 4869cd3079..a9788bb77b 100644 --- a/webapp/packages/plugin-version-update-administration/src/Instructions.tsx +++ b/webapp/packages/plugin-version-update-administration/src/Instructions.tsx @@ -37,7 +37,10 @@ export const Instructions = observer(function Instructions() { {translate('version_update_how_to_update')} -

The following instructions are only relevant for Mac and Linux systems.

+

+ Our team suggests not to downgrade to ensure that the version transition process will not affect the program's functionality.
+ The following instructions are only relevant for Mac and Linux systems. +

  1. Stop the existing container by running the docker stop command.
  2. Use the docker rm command to remove it.
  3. diff --git a/webapp/packages/plugin-version-update-administration/src/VersionUpdate.tsx b/webapp/packages/plugin-version-update-administration/src/VersionUpdate.tsx index 748ec99518..e30b0f2ef0 100644 --- a/webapp/packages/plugin-version-update-administration/src/VersionUpdate.tsx +++ b/webapp/packages/plugin-version-update-administration/src/VersionUpdate.tsx @@ -8,64 +8,37 @@ import { observer } from 'mobx-react-lite'; import styled, { css } from 'reshadow'; +import { gte } from 'semver'; -import { AdministrationItemContentComponent, ADMINISTRATION_TOOLS_PANEL_STYLES } from '@cloudbeaver/core-administration'; -import { TabsState, TabList, Tab, TabPanel, ToolsPanel, UNDERLINE_TAB_STYLES, BASE_CONTAINERS_STYLES, ColoredContainer, useMapResource } from '@cloudbeaver/core-blocks'; -import { useTranslate } from '@cloudbeaver/core-localization'; +import type { AdministrationItemContentComponent } from '@cloudbeaver/core-administration'; +import { BASE_CONTAINERS_STYLES, ColoredContainer, useMapResource } from '@cloudbeaver/core-blocks'; +import { useService } from '@cloudbeaver/core-di'; import { CachedMapAllKey } from '@cloudbeaver/core-sdk'; import { useStyles } from '@cloudbeaver/core-theming'; -import { VersionResource } from '@cloudbeaver/core-version'; +import { VersionResource, VersionService } from '@cloudbeaver/core-version'; -import { EVersionUpdate } from './EVersionUpdate'; import { Instructions } from './Instructions'; import { VersionChecker } from './VersionChecker'; import { VersionSelector } from './VersionSelector'; -import { VersionsTable } from './VersionsTable'; -const tabsStyles = css` +const styles = css` ColoredContainer { list-style-position: inside; } - TabList { - position: relative; - flex-shrink: 0; - align-items: center; - height: 51px; - } - Tab { - height: 46px!important; - text-transform: uppercase; - font-weight: 500 !important; - } - TabPanel { - flex-direction: column; - } `; export const VersionUpdate: AdministrationItemContentComponent = observer(function VersionUpdate() { - const tabStyle = [tabsStyles, UNDERLINE_TAB_STYLES]; - const translate = useTranslate(); - const style = useStyles(ADMINISTRATION_TOOLS_PANEL_STYLES, BASE_CONTAINERS_STYLES, tabStyle); + const style = useStyles(BASE_CONTAINERS_STYLES, styles); + const versionService = useService(VersionService); const versionResource = useMapResource(VersionUpdate, VersionResource, CachedMapAllKey); + const versions = versionResource.resource.values.filter(v => gte(v.number, versionService.current)); + return styled(style)( - - - - {translate('version_update_info')} - {translate('versions')} - - - - - - - - - - - - - + + + + + ); });