Skip to content

CB-3972 safe way to get action check for the document#2261

Merged
Wroud merged 5 commits intodevelfrom
CB-3974-grouping-panel-json-tab
Jan 3, 2024
Merged

CB-3972 safe way to get action check for the document#2261
Wroud merged 5 commits intodevelfrom
CB-3974-grouping-panel-json-tab

Conversation

@devnaumov
Copy link
Copy Markdown
Member

No description provided.

@devnaumov devnaumov self-assigned this Dec 28, 2023
Comment on lines +91 to +97
}
const selectionAction = model.source.getAction(resultIndex, ResultSetSelectAction);
const dataAction = model.source.getAction(resultIndex, ResultSetDataAction);
const selectionAction = model.source.tryGetAction(resultIndex, ResultSetSelectAction);
const dataAction = model.source.tryGetAction(resultIndex, ResultSetDataAction);

if (!selectionAction || !dataAction) {
return true;
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's will be better to:

  1. in DATA_CONTEXT_DV_DDM remove second generic from IDatabaseDataModel so it will be set to IDatabaseDataResult
export const DATA_CONTEXT_DV_DDM = createDataContext<IDatabaseDataModel<IDatabaseDataOptions>>('data-viewer-database-data-model');
  1. in DVResultSetGroupingPluginBootstrap.ts
    don't register data presentation and menu creator if model.source.getResult(resultIndex)?.dataFormat !== ResultDataFormat.Resultset

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or in case if we want to enable this presentation for other data formats it's better to use getActionImplementation(resultIndex, DatabaseSelectAction) and getActionImplementation(resultIndex, DatabaseDataAction) or check data format and get proper action for this format (or just cast type because getActionImplementation will return proper action but type will be common)

@Wroud Wroud merged commit d719008 into devel Jan 3, 2024
@Wroud Wroud deleted the CB-3974-grouping-panel-json-tab branch January 3, 2024 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants