diff --git a/webapp/packages/core-links/src/WebsiteLinks.ts b/webapp/packages/core-links/src/WebsiteLinks.ts index 5e07b79aad..e20054b625 100644 --- a/webapp/packages/core-links/src/WebsiteLinks.ts +++ b/webapp/packages/core-links/src/WebsiteLinks.ts @@ -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}`; diff --git a/webapp/packages/core-support/.gitignore b/webapp/packages/core-support/.gitignore new file mode 100644 index 0000000000..0990be9258 --- /dev/null +++ b/webapp/packages/core-support/.gitignore @@ -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 \ No newline at end of file diff --git a/webapp/packages/core-support/package.json b/webapp/packages/core-support/package.json new file mode 100644 index 0000000000..85ff25962c --- /dev/null +++ b/webapp/packages/core-support/package.json @@ -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" + } +} diff --git a/webapp/packages/core-support/src/GeneralSupportInstruction.tsx b/webapp/packages/core-support/src/GeneralSupportInstruction.tsx new file mode 100644 index 0000000000..828e3e0b0a --- /dev/null +++ b/webapp/packages/core-support/src/GeneralSupportInstruction.tsx @@ -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 ( +
+ + {translate('core_support_description')} + + {translate('core_support')} + + +
+ ); +}; diff --git a/webapp/packages/core-support/src/GeneralSupportInstructionLazy.ts b/webapp/packages/core-support/src/GeneralSupportInstructionLazy.ts new file mode 100644 index 0000000000..de5a001e9b --- /dev/null +++ b/webapp/packages/core-support/src/GeneralSupportInstructionLazy.ts @@ -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)); diff --git a/webapp/packages/core-support/src/LocaleService.ts b/webapp/packages/core-support/src/LocaleService.ts new file mode 100644 index 0000000000..8ad8201381 --- /dev/null +++ b/webapp/packages/core-support/src/LocaleService.ts @@ -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; + } + } +} diff --git a/webapp/packages/core-support/src/SupportService.ts b/webapp/packages/core-support/src/SupportService.ts new file mode 100644 index 0000000000..4721deceb5 --- /dev/null +++ b/webapp/packages/core-support/src/SupportService.ts @@ -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; + } +} diff --git a/webapp/packages/core-support/src/index.ts b/webapp/packages/core-support/src/index.ts new file mode 100644 index 0000000000..944388e14e --- /dev/null +++ b/webapp/packages/core-support/src/index.ts @@ -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'; diff --git a/webapp/packages/core-support/src/locales/en.ts b/webapp/packages/core-support/src/locales/en.ts new file mode 100644 index 0000000000..9851bfc72e --- /dev/null +++ b/webapp/packages/core-support/src/locales/en.ts @@ -0,0 +1,4 @@ +export default [ + ['core_support', 'Tech Support'], + ['core_support_description', 'For technical assistance, submit a request '], +]; diff --git a/webapp/packages/core-support/src/locales/ru.ts b/webapp/packages/core-support/src/locales/ru.ts new file mode 100644 index 0000000000..709e7a8ba9 --- /dev/null +++ b/webapp/packages/core-support/src/locales/ru.ts @@ -0,0 +1,4 @@ +export default [ + ['core_support', 'Тех. поддержка'], + ['core_support_description', 'Для получения технической помощи отправьте запрос '], +]; diff --git a/webapp/packages/core-support/src/module.ts b/webapp/packages/core-support/src/module.ts new file mode 100644 index 0000000000..361a9f3299 --- /dev/null +++ b/webapp/packages/core-support/src/module.ts @@ -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); + }, +}); diff --git a/webapp/packages/core-support/tsconfig.json b/webapp/packages/core-support/tsconfig.json new file mode 100644 index 0000000000..b334ec4911 --- /dev/null +++ b/webapp/packages/core-support/tsconfig.json @@ -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/**/*" + ] +} diff --git a/webapp/packages/plugin-administration/package.json b/webapp/packages/plugin-administration/package.json index 681dcc8a9e..1fa4c5fa96 100644 --- a/webapp/packages/plugin-administration/package.json +++ b/webapp/packages/plugin-administration/package.json @@ -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:*", diff --git a/webapp/packages/plugin-administration/src/Administration/Administration.tsx b/webapp/packages/plugin-administration/src/Administration/Administration.tsx index b30a5e65c9..3cbfc3268c 100644 --- a/webapp/packages/plugin-administration/src/Administration/Administration.tsx +++ b/webapp/packages/plugin-administration/src/Administration/Administration.tsx @@ -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>(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>(function optionsPanelService.close(); } + const SupportInstruction = supportService.supportInstruction?.(); + return ( @@ -124,6 +128,12 @@ export const Administration = observer>(function onSelect={onItemSelect} /> ))} + + {SupportInstruction && ( +
+ +
+ )}
diff --git a/webapp/packages/plugin-administration/tsconfig.json b/webapp/packages/plugin-administration/tsconfig.json index a69c36ce8f..d02855d35c 100644 --- a/webapp/packages/plugin-administration/tsconfig.json +++ b/webapp/packages/plugin-administration/tsconfig.json @@ -55,6 +55,9 @@ { "path": "../core-routing" }, + { + "path": "../core-support" + }, { "path": "../core-ui" }, diff --git a/webapp/packages/plugin-set-common/package.json b/webapp/packages/plugin-set-common/package.json index 3773e22223..4c43defc6c 100644 --- a/webapp/packages/plugin-set-common/package.json +++ b/webapp/packages/plugin-set-common/package.json @@ -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:*", diff --git a/webapp/packages/plugin-set-common/src/index.ts b/webapp/packages/plugin-set-common/src/index.ts index 68629edd1f..cb65cdea8c 100644 --- a/webapp/packages/plugin-set-common/src/index.ts +++ b/webapp/packages/plugin-set-common/src/index.ts @@ -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, diff --git a/webapp/packages/plugin-set-common/tsconfig.json b/webapp/packages/plugin-set-common/tsconfig.json index 8a7e7019ce..1550db7941 100644 --- a/webapp/packages/plugin-set-common/tsconfig.json +++ b/webapp/packages/plugin-set-common/tsconfig.json @@ -88,6 +88,9 @@ { "path": "../core-storage" }, + { + "path": "../core-support" + }, { "path": "../core-task-manager" }, diff --git a/webapp/packages/product-default-impl/package.json b/webapp/packages/product-default-impl/package.json index 7bd6f21f71..54d142bdc6 100644 --- a/webapp/packages/product-default-impl/package.json +++ b/webapp/packages/product-default-impl/package.json @@ -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:*", diff --git a/webapp/packages/product-default-impl/tsconfig.json b/webapp/packages/product-default-impl/tsconfig.json index 6d445e01b6..e3edf0a4ad 100644 --- a/webapp/packages/product-default-impl/tsconfig.json +++ b/webapp/packages/product-default-impl/tsconfig.json @@ -22,6 +22,9 @@ { "path": "../core-localization" }, + { + "path": "../core-support" + }, { "path": "../core-version-update" }, diff --git a/webapp/yarn.lock b/webapp/yarn.lock index e46a543d42..287ffb9aca 100644 --- a/webapp/yarn.lock +++ b/webapp/yarn.lock @@ -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:*"