UBERF-5382: Allow to disable component edit for some cases (#4574)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2024-02-08 14:18:33 +07:00 committed by GitHub
parent 643f34bf96
commit 8838320fbb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 4 deletions

View File

@ -161,7 +161,7 @@ export function devTool (
}
console.log('assigning to workspace', workspaceInfo)
try {
await assignWorkspace(db, productId, email, workspaceInfo?.workspaceUrl ?? workspaceInfo.workspace)
await assignWorkspace(db, productId, email, workspaceInfo.workspace)
} catch (err: any) {
console.error(err)
}

View File

@ -1,6 +1,6 @@
<script lang="ts">
import { AttachmentStyleBoxEditor } from '@hcengineering/attachment-resources'
import { getClient } from '@hcengineering/presentation'
import { getClient, getDocRules } from '@hcengineering/presentation'
import { Component } from '@hcengineering/tracker'
import { EditBox, Label } from '@hcengineering/ui'
import { createEventDispatcher, onMount } from 'svelte'
@ -15,8 +15,10 @@
let oldLabel = ''
let rawLabel = ''
function change<K extends keyof Component> (field: K, value: Component[K]) {
client.update(object, { [field]: value })
$: rulesQuery = getDocRules<Component>(object, 'label')
function change<K extends keyof Component> (field: K, value: Component[K]): void {
void client.update(object, { [field]: value })
}
$: if (oldLabel !== object.label) {
@ -33,6 +35,7 @@
<EditBox
bind:value={rawLabel}
placeholder={tracker.string.Component}
disabled={rulesQuery?.disableEdit ?? false}
kind="large-style"
on:blur={() => {
const trimmedLabel = rawLabel.trim()