(core) Backend restrictions for raw data widgets

Summary:
Prevent most updates or removals of raw view sections and their fields in `useractions.py`. Only a fiew columns are allowed to be updated.

Removed the unused method `_UpdateViews` while I was at it.

Test Plan:
Added a Python test.

Tested manually that I can still make all expected changes, i.e. those allowed by the UI, e.g. reordering columns.

Reviewers: georgegevoian

Reviewed By: georgegevoian

Differential Revision: https://phab.getgrist.com/D3263
This commit is contained in:
Alex Hall
2022-02-14 14:25:52 +02:00
parent 2f6eafff35
commit c0ca936c1e
5 changed files with 111 additions and 23 deletions

View File

@@ -168,8 +168,7 @@ class TestDocModel(test_engine.EngineTestCase):
view = self.engine.docmodel.views.lookupOne(id=1)
self.assertRecordSet(view.viewSections, [1, 5, 6])
self.engine.docmodel.remove(f for vs in table.viewSections for f in vs.fields)
self.engine.docmodel.remove(table.viewSections)
self.engine.docmodel.remove(set(table.viewSections) - {table.rawViewSectionRef})
self.assertRecordSet(view.viewSections, [6])