mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-23 03:22:19 +03:00
UBERF-5382: Allow to disable component edit for some cases (#4574)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
parent
643f34bf96
commit
8838320fbb
@ -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)
|
||||
}
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user