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-6181 fix: show save/cancel buttons in json docs #3222

Merged
merged 6 commits into from
Feb 6, 2025
Merged

Conversation

SychevAndrey
Copy link
Contributor

@SychevAndrey SychevAndrey commented Jan 29, 2025

No description provided.

@SychevAndrey SychevAndrey requested a review from Wroud January 29, 2025 09:45
@SychevAndrey SychevAndrey self-assigned this Jan 29, 2025
The problem is that for select 1 in TE we get different result from other product, because in CE/EE we use ResultSetFooterMenuService, while for TE we use regular TableFooterMenuService. model.source.isReadOnly flag doesn't return true anymore since we extracted hasRowIdentifier flag from it, so we get redundant buttons in tables like that in TE.

Since the only difference is products where we are executing this script, it's quite hard to detect it inside a component. I decided to check editor's features, they are empty in this case (select 1) in all products, so we can be 100% sure that if there are no features, we don't need any buttons.

The other problem that for Document type of data format we also don't have features (and we use the same footer menu service). If it's not read-only, we need to have those buttons to save/cancel edits. The first solution is to check data format is Document (or check the editor type or to try get action with needed type). The other solution that I used is to check hasRowIdentifier flag(hasElementIdentifier) because editable documents will have it true, while datasets like select 1 don't have them. It looks more generic for me and should work in more cases in future
@SychevAndrey SychevAndrey marked this pull request as ready for review February 4, 2025 11:03
@SychevAndrey SychevAndrey requested a review from Wroud February 4, 2025 18:20
@Wroud Wroud merged commit 107436a into devel Feb 6, 2025
6 of 7 checks passed
@Wroud Wroud deleted the CB-6181-edit-json branch February 6, 2025 11:31
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.

3 participants