/
vshmidt
/
cloudbeaver
Обзор
Документация
Войти
/
vshmidt
/
cloudbeaver
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
devel
webapp/packages/plugin-data-viewer/src/TableViewer/ValuePanel/DataValuePanelBootstrap.ts
47 строк
2 KB
Alexey Potsetsuev
dbeaver/pro#7080 refactor: grid API (#3799)
13 окт 2025, 14:30
Не верифицирован
13 окт 2025, 14:30
682a387
Код
Авторство
О чём код?
/* * 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 React from 'react'; import { Bootstrap, injectable } from '@cloudbeaver/core-di'; import { DataPresentationService, DataPresentationType } from '../../DataPresentationService.js'; import { DataValuePanelService } from './DataValuePanelService.js'; import { IDatabaseDataResultAction } from '../../DatabaseDataModel/Actions/IDatabaseDataResultAction.js'; export const ValuePanel = React.lazy(async () => { const { ValuePanel } = await import('./ValuePanel.js'); return { default: ValuePanel }; }); @injectable(() => [DataPresentationService, DataValuePanelService]) export class DataValuePanelBootstrap extends Bootstrap { constructor( private readonly dataPresentationService: DataPresentationService, private readonly dataValuePanelService: DataValuePanelService, ) { super(); } override register(): void | Promise<void> { this.dataPresentationService.add({ id: 'value-text-presentation', type: DataPresentationType.toolsPanel, title: 'data_viewer_presentation_value_title', icon: 'value-panel', hidden: (dataFormat, model, resultIndex) => { if (!model.source.hasResult(resultIndex)) { return true; } const data = model.source.tryGetAction(resultIndex, IDatabaseDataResultAction); return data?.empty || this.dataValuePanelService.getDisplayed({ model, resultIndex, dataFormat }).length === 0; }, getPresentationComponent: () => ValuePanel, }); } }