Hide meeting minutes for guests (#8881)

Signed-off-by: Anton Alexeyev <alexeyev.anton@gmail.com>
This commit is contained in:
Anton Alexeyev 2025-05-08 14:13:34 +07:00 committed by GitHub
parent 9f94b06d6a
commit d75d8604ec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 48 additions and 32 deletions

View File

@ -39,13 +39,21 @@
let editable: boolean = false
$: editable = hasAccountRole(me, AccountRole.Maintainer)
let canViewMinutes: boolean = false
$: canViewMinutes = hasAccountRole(me, AccountRole.User)
</script>
<div class="hulyComponent">
<Header adaptive={'disabled'}>
<Breadcrumb title={selectedFloor?.name ?? ''} size={'large'} isCurrent />
<svelte:fragment slot="beforeTitle">
<ViewletSelector bind:viewlet bind:preference bind:loading viewletQuery={{ attachTo: lovePlg.class.Floor }} />
<ViewletSelector
bind:viewlet
bind:preference
bind:loading
hidden={!canViewMinutes}
viewletQuery={{ attachTo: lovePlg.class.Floor }}
/>
</svelte:fragment>
<svelte:fragment slot="actions">
{#if editable}

View File

@ -14,6 +14,7 @@
-->
<script lang="ts">
import type { Class, Doc, Ref, Space } from '@hcengineering/core'
import { AccountRole, getCurrentAccount, hasAccountRole } from '@hcengineering/core'
import { Label, Section, Scroller } from '@hcengineering/ui'
import { Table, ViewletsSettingButton } from '@hcengineering/view-resources'
import { Viewlet, ViewletPreference } from '@hcengineering/view'
@ -26,11 +27,17 @@
export let readonly: boolean = false
export let meetings: number
const me = getCurrentAccount()
let viewlet: Viewlet | undefined
let preference: ViewletPreference | undefined
let loading = true
let canViewMinutes: boolean = false
$: canViewMinutes = hasAccountRole(me, AccountRole.User)
</script>
{#if canViewMinutes}
<Section label={love.string.MeetingMinutes} icon={love.icon.Cam}>
<svelte:fragment slot="header">
<ViewletsSettingButton
@ -63,3 +70,4 @@
{/if}
</svelte:fragment>
</Section>
{/if}