Fix hide all attributes (#7583)

This commit is contained in:
Denis Bykhov 2025-01-03 07:53:31 +05:00 committed by GitHub
parent 5373501776
commit f44018f9ef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 52 additions and 42 deletions

View File

@ -510,6 +510,14 @@ export function createModel (builder: Builder): void {
value: true
})
builder.mixin(tracker.class.Milestone, core.class.Class, setting.mixin.Editable, {
value: true
})
builder.mixin(tracker.class.Component, core.class.Class, setting.mixin.Editable, {
value: true
})
builder.mixin(tracker.class.Issue, core.class.Class, view.mixin.LinkProvider, {
encode: tracker.function.GetIssueLinkFragment
})

View File

@ -29,6 +29,7 @@
export let showLabel: IntlString | undefined = undefined
export let draft = false
export let showHeader: boolean = true
export let isMainClass: boolean = false
const client = getClient()
const hierarchy = client.getHierarchy()
@ -53,50 +54,50 @@
$: collapsed = getCollapsed(_class, nonEmpty)
</script>
{#if keys.length}
{#if showHeader}
<!-- svelte-ignore a11y-click-events-have-key-events -->
<!-- svelte-ignore a11y-no-static-element-interactions -->
<div
class="attrbar-header"
class:collapsed
on:click={() => {
collapsed = !collapsed
}}
>
<div class="flex-row-center">
<span class="overflow-label">
<Label {label} />
</span>
<div class="icon-arrow">
<svg fill="var(--theme-dark-color)" viewBox="0 0 6 6" xmlns="http://www.w3.org/2000/svg">
<path d="M0,0L6,3L0,6Z" />
</svg>
</div>
</div>
<div class="tool">
{#if !$restrictionStore.disableNavigation}
<Button
icon={setting.icon.Setting}
kind={'link'}
size={'medium'}
showTooltip={{ label: setting.string.ClassSetting }}
on:click={(ev) => {
ev.stopPropagation()
const loc = getCurrentResolvedLocation()
loc.path[2] = settingId
loc.path[3] = 'setting'
loc.path[4] = 'classes'
loc.path.length = 5
loc.query = { _class }
loc.fragment = undefined
navigate(loc)
}}
/>
{/if}
{#if showHeader && (keys.length > 0 || isMainClass)}
<!-- svelte-ignore a11y-click-events-have-key-events -->
<!-- svelte-ignore a11y-no-static-element-interactions -->
<div
class="attrbar-header"
class:collapsed
on:click={() => {
collapsed = !collapsed
}}
>
<div class="flex-row-center">
<span class="overflow-label">
<Label {label} />
</span>
<div class="icon-arrow">
<svg fill="var(--theme-dark-color)" viewBox="0 0 6 6" xmlns="http://www.w3.org/2000/svg">
<path d="M0,0L6,3L0,6Z" />
</svg>
</div>
</div>
{/if}
<div class="tool">
{#if !$restrictionStore.disableNavigation}
<Button
icon={setting.icon.Setting}
kind={'link'}
size={'medium'}
showTooltip={{ label: setting.string.ClassSetting }}
on:click={(ev) => {
ev.stopPropagation()
const loc = getCurrentResolvedLocation()
loc.path[2] = settingId
loc.path[3] = 'setting'
loc.path[4] = 'classes'
loc.path.length = 5
loc.query = { _class }
loc.fragment = undefined
navigate(loc)
}}
/>
{/if}
</div>
</div>
{/if}
{#if keys.length}
<div class="collapsed-container" class:collapsed>
<AttributesBar {_class} {object} {keys} {readonly} {draft} on:update />
</div>

View File

@ -38,6 +38,7 @@
{allowedCollections}
{showHeader}
{readonly}
isMainClass
on:update
/>
{#each mixins as mixin}