Commit 107436a
* 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 <139753579+EvgeniaBzzz@users.noreply.github.com>
1 parent 4388491 commit 107436a
File tree
2 files changed
+5
-5
lines changed- webapp/packages/plugin-data-viewer/src
- ResultSet
2 files changed
+5
-5
lines changedLines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
43 | 47 | | |
44 | 48 | | |
45 | 49 | | |
| |||
Lines changed: 0 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | 85 | | |
90 | 86 | | |
91 | 87 | | |
| |||
0 commit comments