dbeaver/pro#7359 add support service (#3878)

Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
This commit is contained in:
alex
2025-11-12 23:35:01 +08:00
committed by GitHub
co-authored by Daria Marutkina
parent 754927a1ae
commit f64bc1b435
21 changed files with 280 additions and 0 deletions
@@ -36,6 +36,7 @@ export const WEBSITE_LINKS = {
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/',
TECH_SUPPORT_PAGE: 'https://dbeaver.com/tickets/',
getTeamArchiveById(id: string): string {
return `${WEBSITE_LINKS.TEAM_ARCHIVE}/${id}`;
+24
View File
@@ -0,0 +1,24 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.js
# testing
/coverage
# production
/lib
# misc
.DS_Store
.env*
# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# typescript
*.tsbuildinfo
+41
View File
@@ -0,0 +1,41 @@
{
"name": "@cloudbeaver/core-support",
"type": "module",
"sideEffects": [
"./lib/module.js",
"./lib/index.js",
"src/**/*.css",
"src/**/*.scss",
"public/**/*"
],
"version": "0.1.0",
"description": "",
"license": "Apache-2.0",
"exports": {
".": "./lib/index.js",
"./module": "./lib/module.js"
},
"scripts": {
"build": "tsc -b",
"clean": "rimraf --glob lib",
"lint": "eslint ./src/ --ext .ts,.tsx",
"test": "dbeaver-test",
"validate-dependencies": "core-cli-validate-dependencies"
},
"dependencies": {
"@cloudbeaver/core-blocks": "workspace:*",
"@cloudbeaver/core-di": "workspace:*",
"@cloudbeaver/core-links": "workspace:*",
"@cloudbeaver/core-localization": "workspace:*",
"react": "^19",
"tslib": "^2"
},
"devDependencies": {
"@cloudbeaver/core-cli": "workspace:*",
"@cloudbeaver/tsconfig": "workspace:*",
"@dbeaver/cli": "workspace:*",
"@types/react": "^19",
"rimraf": "^6",
"typescript": "^5"
}
}
@@ -0,0 +1,25 @@
/*
* CloudBeaver - Cloud Database Manager
* Copyright (C) 2020-2025 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, Text, useTranslate } from '@cloudbeaver/core-blocks';
import { WEBSITE_LINKS } from '@cloudbeaver/core-links';
export const GeneralSupportInstruction: React.FC = function GeneralSupportInstruction() {
const translate = useTranslate();
return (
<div>
<Text className="tw:text-xs tw:text-center">
{translate('core_support_description')}
<Link href={WEBSITE_LINKS.TECH_SUPPORT_PAGE} target="_blank" rel="noopener noreferrer" inline indicator>
{translate('core_support')}
</Link>
</Text>
</div>
);
};
@@ -0,0 +1,11 @@
/*
* CloudBeaver - Cloud Database Manager
* Copyright (C) 2020-2025 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 { importLazyComponent } from '@cloudbeaver/core-blocks';
export const GeneralSupportInstruction = importLazyComponent(() => import('./GeneralSupportInstruction.js').then(m => m.GeneralSupportInstruction));
@@ -0,0 +1,30 @@
/*
* CloudBeaver - Cloud Database Manager
* Copyright (C) 2020-2025 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 { Bootstrap, injectable } from '@cloudbeaver/core-di';
import { LocalizationService } from '@cloudbeaver/core-localization';
@injectable(() => [LocalizationService])
export class LocaleService extends Bootstrap {
constructor(private readonly localizationService: LocalizationService) {
super();
}
override register(): void {
this.localizationService.addProvider(this.provider.bind(this));
}
private async provider(locale: string) {
switch (locale) {
case 'ru':
return (await import('./locales/ru.js')).default;
default:
return (await import('./locales/en.js')).default;
}
}
}
@@ -0,0 +1,22 @@
/*
* CloudBeaver - Cloud Database Manager
* Copyright (C) 2020-2025 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 { injectable } from '@cloudbeaver/core-di';
@injectable()
export class SupportService {
supportInstruction: (() => React.FC) | null;
constructor() {
this.supportInstruction = null;
}
registerSupportInstruction(componentGetter: (() => React.FC) | null): void {
this.supportInstruction = componentGetter;
}
}
+12
View File
@@ -0,0 +1,12 @@
/*
* CloudBeaver - Cloud Database Manager
* Copyright (C) 2020-2025 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 './module.js';
export * from './SupportService.js';
export * from './GeneralSupportInstructionLazy.js';
@@ -0,0 +1,4 @@
export default [
['core_support', 'Tech Support'],
['core_support_description', 'For technical assistance, submit a request '],
];
@@ -0,0 +1,4 @@
export default [
['core_support', 'Тех. поддержка'],
['core_support_description', 'Для получения технической помощи отправьте запрос '],
];
@@ -0,0 +1,20 @@
/*
* CloudBeaver - Cloud Database Manager
* Copyright (C) 2020-2025 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 { ModuleRegistry, Bootstrap } from '@cloudbeaver/core-di';
import { LocaleService } from './LocaleService.js';
import { SupportService } from './SupportService.js';
export default ModuleRegistry.add({
name: '@cloudbeaver/core-support',
configure: serviceCollection => {
serviceCollection.addSingleton(SupportService).addSingleton(Bootstrap, LocaleService);
},
});
@@ -0,0 +1,40 @@
{
"extends": "@cloudbeaver/tsconfig/tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "lib",
"tsBuildInfoFile": "lib/tsconfig.tsbuildinfo",
"composite": true
},
"references": [
{
"path": "../../common-typescript/@dbeaver/cli"
},
{
"path": "../core-blocks"
},
{
"path": "../core-cli"
},
{
"path": "../core-di"
},
{
"path": "../core-links"
},
{
"path": "../core-localization"
}
],
"include": [
"__custom_mocks__/**/*",
"src/**/*",
"src/**/*.json",
"src/**/*.css",
"src/**/*.scss"
],
"exclude": [
"**/node_modules",
"lib/**/*"
]
}
@@ -36,6 +36,7 @@
"@cloudbeaver/core-resource": "workspace:*",
"@cloudbeaver/core-root": "workspace:*",
"@cloudbeaver/core-routing": "workspace:*",
"@cloudbeaver/core-support": "workspace:*",
"@cloudbeaver/core-ui": "workspace:*",
"@cloudbeaver/core-utils": "workspace:*",
"@cloudbeaver/core-view": "workspace:*",
@@ -31,6 +31,7 @@ import { useService } from '@cloudbeaver/core-di';
import { OptionsPanelService, TabList, TabListStyles, TabsState, TabStyles } from '@cloudbeaver/core-ui';
import type { ILoadableState } from '@cloudbeaver/core-utils';
import { CaptureView } from '@cloudbeaver/core-view';
import { SupportService } from '@cloudbeaver/core-support';
import { AdministrationCaptureViewContext } from './AdministrationCaptureViewContext.js';
import { AdministrationViewService } from './AdministrationViewService.js';
@@ -93,6 +94,7 @@ export const Administration = observer<React.PropsWithChildren<Props>>(function
const administrationViewService = useService(AdministrationViewService);
const administrationItemService = useService(AdministrationItemService);
const optionsPanelService = useService(OptionsPanelService);
const supportService = useService(SupportService);
const OptionsPanel = optionsPanelService.getPanelComponent();
const visibleItems = administrationItemService.getActiveItems(configurationWizard);
@@ -109,6 +111,8 @@ export const Administration = observer<React.PropsWithChildren<Props>>(function
optionsPanelService.close();
}
const SupportInstruction = supportService.supportInstruction?.();
return (
<CaptureView view={administrationViewService} className={s(styles, { captureView: true })}>
<AdministrationCaptureViewContext />
@@ -124,6 +128,12 @@ export const Administration = observer<React.PropsWithChildren<Props>>(function
onSelect={onItemSelect}
/>
))}
{SupportInstruction && (
<div className="tw:mt-auto tw:p-2">
<SupportInstruction />
</div>
)}
</TabList>
</SContext>
<div ref={contentRef} className={s(styles, { contentContainer: true })}>
@@ -55,6 +55,9 @@
{
"path": "../core-routing"
},
{
"path": "../core-support"
},
{
"path": "../core-ui"
},
@@ -48,6 +48,7 @@
"@cloudbeaver/core-settings-localization": "workspace:*",
"@cloudbeaver/core-settings-user": "workspace:*",
"@cloudbeaver/core-storage": "workspace:*",
"@cloudbeaver/core-support": "workspace:*",
"@cloudbeaver/core-task-manager": "workspace:*",
"@cloudbeaver/core-theming": "workspace:*",
"@cloudbeaver/core-ui": "workspace:*",
@@ -36,6 +36,7 @@ import coreTheming from '@cloudbeaver/core-theming/module';
import coreUi from '@cloudbeaver/core-ui/module';
import coreVersion from '@cloudbeaver/core-version/module';
import coreVersionUpdate from '@cloudbeaver/core-version-update/module';
import coreSupport from '@cloudbeaver/core-support/module';
import coreView from '@cloudbeaver/core-view/module';
import coreServerNotifications from '@cloudbeaver/core-server-notifications/module';
@@ -131,6 +132,7 @@ const core = [
coreView,
coreVersion,
coreVersionUpdate,
coreSupport,
coreConnections,
coreAdministration,
coreDialogs,
@@ -88,6 +88,9 @@
{
"path": "../core-storage"
},
{
"path": "../core-support"
},
{
"path": "../core-task-manager"
},
@@ -27,6 +27,7 @@
"@cloudbeaver/core-bootstrap": "workspace:*",
"@cloudbeaver/core-di": "workspace:*",
"@cloudbeaver/core-localization": "workspace:*",
"@cloudbeaver/core-support": "workspace:*",
"@cloudbeaver/core-version-update": "workspace:*",
"@cloudbeaver/plugin-data-editor-public-settings": "workspace:*",
"@cloudbeaver/plugin-set-common": "workspace:*",
@@ -22,6 +22,9 @@
{
"path": "../core-localization"
},
{
"path": "../core-support"
},
{
"path": "../core-version-update"
},
+22
View File
@@ -2134,6 +2134,25 @@ __metadata:
languageName: unknown
linkType: soft
"@cloudbeaver/core-support@workspace:*, @cloudbeaver/core-support@workspace:packages/core-support":
version: 0.0.0-use.local
resolution: "@cloudbeaver/core-support@workspace:packages/core-support"
dependencies:
"@cloudbeaver/core-blocks": "workspace:*"
"@cloudbeaver/core-cli": "workspace:*"
"@cloudbeaver/core-di": "workspace:*"
"@cloudbeaver/core-links": "workspace:*"
"@cloudbeaver/core-localization": "workspace:*"
"@cloudbeaver/tsconfig": "workspace:*"
"@dbeaver/cli": "workspace:*"
"@types/react": "npm:^19"
react: "npm:^19"
rimraf: "npm:^6"
tslib: "npm:^2"
typescript: "npm:^5"
languageName: unknown
linkType: soft
"@cloudbeaver/core-task-manager@workspace:*, @cloudbeaver/core-task-manager@workspace:packages/core-task-manager":
version: 0.0.0-use.local
resolution: "@cloudbeaver/core-task-manager@workspace:packages/core-task-manager"
@@ -2358,6 +2377,7 @@ __metadata:
"@cloudbeaver/core-resource": "workspace:*"
"@cloudbeaver/core-root": "workspace:*"
"@cloudbeaver/core-routing": "workspace:*"
"@cloudbeaver/core-support": "workspace:*"
"@cloudbeaver/core-ui": "workspace:*"
"@cloudbeaver/core-utils": "workspace:*"
"@cloudbeaver/core-view": "workspace:*"
@@ -3772,6 +3792,7 @@ __metadata:
"@cloudbeaver/core-settings-localization": "workspace:*"
"@cloudbeaver/core-settings-user": "workspace:*"
"@cloudbeaver/core-storage": "workspace:*"
"@cloudbeaver/core-support": "workspace:*"
"@cloudbeaver/core-task-manager": "workspace:*"
"@cloudbeaver/core-theming": "workspace:*"
"@cloudbeaver/core-ui": "workspace:*"
@@ -4488,6 +4509,7 @@ __metadata:
"@cloudbeaver/core-cli": "workspace:*"
"@cloudbeaver/core-di": "workspace:*"
"@cloudbeaver/core-localization": "workspace:*"
"@cloudbeaver/core-support": "workspace:*"
"@cloudbeaver/core-version-update": "workspace:*"
"@cloudbeaver/plugin-data-editor-public-settings": "workspace:*"
"@cloudbeaver/plugin-set-common": "workspace:*"