mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-10-24 23:05:29 +08:00
Cb 4760 add to value panel more clear abstractions and separation of the logic (#2688)
* CB-4760 refactors value panel boolean presentation * CB-4760 refactors value panel image presentation * CB-4760 refactors value panel text presentation (part 1) * CB-4760 refactors value panel text presentation (part 2) * CB-4760 moves ValuePanel presentation layer to ValuePanel folder * CB-4760 fixes type in file name * CB-4760 modifies isBlob truncated logic * CB-4760 booleanValuePresentation uses actions helper * CB-4760 reverts value panel helpers location * CB-4760 reverts getResultSetActions * CB-4760 add preprocessBooleanValue helper instead of hook * CB-4760 reverts truncated message isTruncated logic * CB-4760 cleanup * CB-4760 cleanup * CB-4760 test commit for save file history * CB-4760 test commit for save file history [2] * CB-4760 test commit for save file history [3] * CB-4760 moves back ValuePanelPresentation directory to src folder to save git history * CB-4760 pr fixes * CB-4760 adds placeholder for non selected elements in boolean value presentation (value panel) * CB-4760 fixes placeholder translation for non selected elements in boolean value presentation (value panel) * CB-4760 fix: app restart process * CB-4760 fix: app restart process --------- Co-authored-by: mr-anton-t <42037741+mr-anton-t@users.noreply.github.com> Co-authored-by: Aleksei Potsetsuev <wrouds@gmail.com>
This commit is contained in:
co-authored by
mr-anton-t
Aleksei Potsetsuev
parent
1c9b4f1ece
commit
a65dff32d6
-58
@@ -1,58 +0,0 @@
|
||||
import { computed, observable } from 'mobx';
|
||||
|
||||
import { useObservableRef } from '@cloudbeaver/core-blocks';
|
||||
|
||||
import type { IDatabaseDataModel } from '../../IDatabaseDataModel';
|
||||
import type { IDatabaseResultSet } from '../../IDatabaseResultSet';
|
||||
import { ResultSetConstraintAction } from './ResultSetConstraintAction';
|
||||
import { ResultSetDataAction } from './ResultSetDataAction';
|
||||
import { ResultSetDataContentAction } from './ResultSetDataContentAction';
|
||||
import { ResultSetEditAction } from './ResultSetEditAction';
|
||||
import { ResultSetFormatAction } from './ResultSetFormatAction';
|
||||
import { ResultSetSelectAction } from './ResultSetSelectAction';
|
||||
import { ResultSetViewAction } from './ResultSetViewAction';
|
||||
|
||||
interface IResultActionsArgs {
|
||||
resultIndex: number;
|
||||
model: IDatabaseDataModel<any, IDatabaseResultSet>;
|
||||
}
|
||||
|
||||
export function useResultSetActions({ model, resultIndex }: IResultActionsArgs) {
|
||||
return useObservableRef(
|
||||
() => ({
|
||||
get dataAction(): ResultSetDataAction {
|
||||
return this.model.source.getAction(this.resultIndex, ResultSetDataAction);
|
||||
},
|
||||
get selectAction(): ResultSetSelectAction {
|
||||
return this.model.source.getAction(this.resultIndex, ResultSetSelectAction);
|
||||
},
|
||||
get editAction(): ResultSetEditAction {
|
||||
return this.model.source.getAction(this.resultIndex, ResultSetEditAction);
|
||||
},
|
||||
get contentAction(): ResultSetDataContentAction {
|
||||
return this.model.source.getAction(this.resultIndex, ResultSetDataContentAction);
|
||||
},
|
||||
get formatAction(): ResultSetFormatAction {
|
||||
return this.model.source.getAction(this.resultIndex, ResultSetFormatAction);
|
||||
},
|
||||
get constraintAction(): ResultSetConstraintAction {
|
||||
return this.model.source.getAction(this.resultIndex, ResultSetConstraintAction);
|
||||
},
|
||||
get viewAction(): ResultSetViewAction {
|
||||
return this.model.source.getAction(this.resultIndex, ResultSetViewAction);
|
||||
},
|
||||
}),
|
||||
{
|
||||
dataAction: computed,
|
||||
selectAction: computed,
|
||||
editAction: computed,
|
||||
contentAction: computed,
|
||||
formatAction: computed,
|
||||
constraintAction: computed,
|
||||
viewAction: computed,
|
||||
model: observable.ref,
|
||||
resultIndex: observable.ref,
|
||||
},
|
||||
{ model, resultIndex },
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user