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-3972 safe way to get action check for the document #2261

Merged
merged 5 commits into from
Jan 3, 2024

Conversation

devnaumov
Copy link
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
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
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
2 of 3 checks passed
@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