mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
* dbeaver/pro#7081 feat: conditional formatting for data editor * feat: code cleanup after review + reworked rules management * feat: add SVG icons for conditional formatting and update localization strings * chore: after review * feat: refactor conditional formatting presentation and add transition component * refactor: reorder Props interface fields for consistency * refactor: remove unused onAddRule prop from ColorScaleRuleForm and SingleColorRuleForm * feat: add SVG icon for conditional formatting * fix: charts * feat: refactor conditional formatting utilities and improve code organization * fix: localization Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * chore: hide conditional formatting from UI * dbeaver/pro#7210 feat: color palette * chore: codestyle * chore: pr review, use `color` library for manipulating css colors * chore: revert panel hiding * chore: localization * fix: use custom row renderer with mobx observer * fix: line hightlight style * chore: remove unused types --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: mr-anton-t <42037741+mr-anton-t@users.noreply.github.com>
45 lines
1.7 KiB
TypeScript
45 lines
1.7 KiB
TypeScript
/*
|
|
* 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';
|
|
import { Bootstrap, injectable } from '@cloudbeaver/core-di';
|
|
import { DataPresentationService, DataPresentationType, GridDataResultAction, IDatabaseDataResultAction } from '@cloudbeaver/plugin-data-viewer';
|
|
|
|
const ConditionalFormattingPresentation = importLazyComponent(() =>
|
|
import('./presentation/ConditionalFormattingPresentation.js').then(module => module.ConditionalFormattingPresentation),
|
|
);
|
|
|
|
@injectable(() => [DataPresentationService])
|
|
export class DVConditionalFormattingPluginBootstrap extends Bootstrap {
|
|
constructor(private readonly dataPresentationService: DataPresentationService) {
|
|
super();
|
|
}
|
|
|
|
override register(): void {
|
|
this.registerPresentation();
|
|
}
|
|
|
|
private registerPresentation(): void {
|
|
this.dataPresentationService.add({
|
|
id: 'conditional-formatting-presentation',
|
|
type: DataPresentationType.toolsPanel,
|
|
title: 'plugin_data_viewer_conditional_formatting_presentation_title',
|
|
icon: '/icons/conditional_formatting_sm.svg',
|
|
hidden: (dataFormat, model, resultIndex) => {
|
|
if (!model.source.hasResult(resultIndex) || true) {
|
|
return true;
|
|
}
|
|
|
|
// @ts-expect-error feature disabled for now
|
|
const data = model.source.tryGetAction(resultIndex, IDatabaseDataResultAction, GridDataResultAction);
|
|
return data?.empty ?? true;
|
|
},
|
|
getPresentationComponent: () => ConditionalFormattingPresentation,
|
|
});
|
|
}
|
|
}
|