mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-29 04:55:03 +02:00
Fix main section lock (#10837)
* Fix main section lock Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com> * Fix formatting Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com> --------- Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
@@ -63,7 +63,12 @@
|
||||
async function toggleLock (ev: MouseEvent): Promise<void> {
|
||||
ev.stopPropagation()
|
||||
const op = isLocked ? '$pull' : '$push'
|
||||
await client.update(value, { [op]: { readonlySections: value._class } })
|
||||
const targets = isLocked
|
||||
? hierarchy.getAncestors(value._class).filter((p) => value.readonlySections?.includes(p))
|
||||
: [value._class]
|
||||
for (const target of targets) {
|
||||
await client.update(value, { [op]: { readonlySections: target } })
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user