Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CB-3197 add interface comments #2018

Merged
merged 6 commits into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export interface ITreeNodeState {
disabled?: boolean;
loading?: boolean;
selected?: boolean;
/** It is true when the node is neither selected nor unselected, used to indicate a mixed or partial selection in a group of sub-options */
indeterminateSelected?: boolean;
externalExpanded?: boolean;
expanded?: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ import { CaptureViewContext, useDataContext } from '@cloudbeaver/core-view';
import { DataPresentationComponent, IDatabaseResultSet, TableViewerLoader } from '@cloudbeaver/plugin-data-viewer';

import { DATA_CONTEXT_DV_DDM_RS_GROUPING } from './DataContext/DATA_CONTEXT_DV_DDM_RS_GROUPING';
import { DEFAULT_GROUPING_QUERY_OPERATION } from './DEFAULT_GROUPING_QUERY_OPERATION';
import type { IGroupingQueryState } from './IGroupingQueryState';
import { useGroupingData } from './useGroupingData';
import { useGroupingDataModel } from './useGroupingDataModel';
import { useGroupingDnDColumns } from './useGroupingDnDColumns';
import { DEFAULT_GROUPING_QUERY_OPERATION } from './DEFAULT_GROUPING_QUERY_OPERATION';

const styles = css`
drop-area {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@ export interface IRequestEventData<TOptions = any, TResult extends IDatabaseData
model: IDatabaseDataModel<TOptions, TResult>;
}

/** Represents an interface for interacting with a database. It is used for managing and requesting data. */
export interface IDatabaseDataModel<TOptions = any, TResult extends IDatabaseDataResult = IDatabaseDataResult> {
readonly id: string;
readonly name: string | null;
readonly source: IDatabaseDataSource<TOptions, TResult>;
/** Holds metadata about a data request. */
readonly requestInfo: IRequestInfo;
readonly supportedDataFormats: ResultDataFormat[];
/** Represents the value by which the number of loaded rows will be increased when loading the next data portion */
readonly countGain: number;

readonly onOptionsChange: IExecutor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ export interface IDatabaseDataOptions {
connectionKey: IConnectionInfoParams;
schema?: string;
catalog?: string;
/** A raw string representation of the query filter conditions ("id=4") */
whereFilter: string;
/** A complex object that can represent filters and sorting options of the result set */
constraints: SqlDataFilterConstraint[];
readLogs?: boolean;
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
readonly originalQuery: string;
readonly requestDuration: number;
readonly requestMessage: string;
/** A string representation of the filters constraints applied to the data request. Also returns as it is in case of whereFilter */
readonly requestFilter: string;
readonly source: string | null;
}
Expand All @@ -30,11 +31,13 @@
readonly access: DatabaseDataAccessMode;
readonly dataFormat: ResultDataFormat;
readonly supportedDataFormats: ResultDataFormat[];
/** Indicates whether database supports filtering and sorting via constraints */
readonly constraintsAvailable: boolean;
readonly actions: IDatabaseDataActions<TOptions, TResult>;
readonly results: TResult[];
readonly offset: number;
readonly count: number;
/** Options of the previous request */
readonly prevOptions: Readonly<TOptions> | null;
readonly options: TOptions | null;
readonly requestInfo: IRequestInfo;
Expand Down Expand Up @@ -80,6 +83,7 @@
setExecutionContext: (context: IConnectionExecutionContext | null) => this;

retry: () => Promise<void>;
/** Allows to perform an asynchronous action on the data source, this action will wait previous action to finish and save or load requests. The data source will have a loading and disabled state while performing an action */

Check warning on line 86 in webapp/packages/plugin-data-viewer/src/DatabaseDataModel/IDatabaseDataSource.ts

View check run for this annotation

Jenkins-CI-integration / CheckStyle TypeScript Report

webapp/packages/plugin-data-viewer/src/DatabaseDataModel/IDatabaseDataSource.ts#L86

This line has a length of 226. Maximum allowed is 150. (max-len)
runTask: <T>(task: () => Promise<T>) => Promise<T>;
requestData: () => Promise<void> | void;
refreshData: () => Promise<void> | void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ interface Props {
resultIndex: number | undefined;
presentationId: string | undefined;
valuePresentationId: string | null | undefined;
/** Display data in simple mode, some features will be hidden or disabled */
simple?: boolean;
context?: IDataContext;
className?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,12 @@ const oldStyles = css`
`;

export interface ElementsTreeProps extends IElementsTreeOptions, React.PropsWithChildren {
/** Specifies the root path for the tree. ROOT_NODE_PATH will be used if not defined */
root?: string;
selectionTree?: boolean;
/** Specifies a custom control component for navigation tree */
control?: NavTreeControlComponent;
/** A placeholder component to be displayed when the elements tree is empty */
emptyPlaceholder?: React.FC;
big?: boolean;
style?: ComponentStyle;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export interface IElementsTreeOptions {
renderers?: IElementsTreeCustomRenderer[];
nodeInfoTransformers?: IElementsTreeCustomNodeInfo[];
expandStateGetters?: IElementsTreeNodeExpandInfoGetter[];
/** Allows to pass external state. It can be used to manipulate a tree state from the outside or to store it in an external state */
localState?: MetadataMap<string, ITreeNodeState>;
getChildren: (id: string) => string[] | undefined;
loadChildren: (id: string, manual: boolean) => Promise<boolean>;
Expand Down
Loading