Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* CB-6181 fix: show save/cancel buttons in json docs * CB-6181 refactor: change condition for SAVE/CANCEL buttons 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 * СB-6181 refactor: update isReadonly flag for resultset --------- Co-authored-by: Evgenia <[email protected]>
- Loading branch information