mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-24 02:25:00 +02:00
Adjust new inbox for readonly guest (#9533)
Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
+1
-1
Submodule communication updated: 34a153aa27...369b1b67b0
@@ -196,7 +196,7 @@ services:
|
||||
- GITHUB_URL=http://huly.local:3500
|
||||
- PRINT_URL=http://huly.local:4005
|
||||
- SIGN_URL=http://huly.local:4006
|
||||
- ANALYTICS_COLLECTOR_URL=http://huly.local:4017
|
||||
# - ANALYTICS_COLLECTOR_URL=http://huly.local:4017
|
||||
- DESKTOP_UPDATES_URL=https://dist.huly.io
|
||||
- DESKTOP_UPDATES_CHANNEL=dev
|
||||
- BRANDING_URL=http://huly.local:8087/branding.json
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
"LAST_NAME_FIRST": "true",
|
||||
"PRINT_URL": "http://huly.local:4005",
|
||||
"SIGN_URL": "http://huly.local:4006",
|
||||
"ANALYTICS_COLLECTOR_URL": "http://huly.local:4017",
|
||||
"AI_URL": "http://huly.local:4010",
|
||||
"BRANDING_URL": "/branding.json",
|
||||
"VERSION": null,
|
||||
|
||||
@@ -74,13 +74,18 @@ import core, {
|
||||
type Client as PlatformClient,
|
||||
SocialIdType,
|
||||
type Tx,
|
||||
type TxDomainEvent
|
||||
type TxDomainEvent,
|
||||
AccountRole
|
||||
} from '@hcengineering/core'
|
||||
import { onDestroy } from 'svelte'
|
||||
import { generateLinkPreviewId } from '@hcengineering/communication-shared'
|
||||
import { addNotification, NotificationSeverity, languageStore } from '@hcengineering/ui'
|
||||
import { translate } from '@hcengineering/platform'
|
||||
import view from '@hcengineering/view'
|
||||
|
||||
import { getCurrentWorkspaceUuid, getFilesUrl } from './file'
|
||||
import { addTxListener, removeTxListener, type TxListener } from './utils'
|
||||
import { get } from 'svelte/store'
|
||||
|
||||
export {
|
||||
createCollaboratorsQuery,
|
||||
@@ -437,6 +442,19 @@ class Client {
|
||||
}
|
||||
|
||||
private async sendEvent (event: Event): Promise<EventResult> {
|
||||
const lang = get(languageStore)
|
||||
if (getCurrentAccount().role === AccountRole.ReadOnlyGuest) {
|
||||
addNotification(
|
||||
await translate(view.string.ReadOnlyWarningTitle, {}, lang),
|
||||
await translate(view.string.ReadOnlyWarningMessage, {}, lang),
|
||||
view.component.ReadOnlyNotification,
|
||||
undefined,
|
||||
NotificationSeverity.Info,
|
||||
'readOnlyNotification'
|
||||
)
|
||||
return {}
|
||||
}
|
||||
|
||||
const ev: Event = { ...event, _id: generateId() }
|
||||
|
||||
const eventPromise: Promise<EventResult> = this.connection
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
import { createEventDispatcher } from 'svelte'
|
||||
import { getCommunicationClient } from '@hcengineering/presentation'
|
||||
import { CheckBox, Spinner } from '@hcengineering/ui'
|
||||
import { AccountRole, getCurrentAccount } from '@hcengineering/core'
|
||||
|
||||
import InboxNotification from './InboxNotification.svelte'
|
||||
import InboxCardIcon from './InboxCardIcon.svelte'
|
||||
@@ -26,6 +27,7 @@
|
||||
export let card: Card
|
||||
export let selected: boolean = false
|
||||
|
||||
const account = getCurrentAccount()
|
||||
const dispatch = createEventDispatcher()
|
||||
const communicationClient = getCommunicationClient()
|
||||
|
||||
@@ -53,13 +55,15 @@
|
||||
{card.title}
|
||||
</span>
|
||||
</div>
|
||||
<div class="inbox-card__remove">
|
||||
{#if isRemoving}
|
||||
<Spinner size="small" />
|
||||
{:else}
|
||||
<CheckBox kind="todo" size="medium" on:value={handleToggle} />
|
||||
{/if}
|
||||
</div>
|
||||
{#if account.role !== AccountRole.ReadOnlyGuest}
|
||||
<div class="inbox-card__remove">
|
||||
{#if isRemoving}
|
||||
<Spinner size="small" />
|
||||
{:else}
|
||||
<CheckBox kind="todo" size="medium" on:value={handleToggle} />
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<div class="inbox-card__content">
|
||||
|
||||
@@ -111,6 +111,7 @@ import MasterDetailView from './components/masterDetail/MasterDetailView.svelte'
|
||||
import AssociationPresenter from './components/AssociationPresenter.svelte'
|
||||
import TreeView from './components/TreeView.svelte'
|
||||
import MasterDetailBrowser from './components/masterDetail/MasterDetailBrowser.svelte'
|
||||
import ReadOnlyNotification from './components/ReadOnlyNotification.svelte'
|
||||
|
||||
import { blobImageMetadata, blobVideoMetadata } from './blob'
|
||||
|
||||
@@ -329,7 +330,8 @@ export default async (): Promise<Resources> => ({
|
||||
MasterDetailView,
|
||||
AssociationPresenter,
|
||||
TreeView,
|
||||
MasterDetailBrowser
|
||||
MasterDetailBrowser,
|
||||
ReadOnlyNotification
|
||||
},
|
||||
popup: {
|
||||
PositionElementAlignment
|
||||
|
||||
@@ -358,7 +358,8 @@ export class ReadOnlyAccessMiddleware extends BasePresentationMiddleware impleme
|
||||
await translate(view.string.ReadOnlyWarningMessage, {}, getCurrentLanguage()),
|
||||
ReadOnlyNotification,
|
||||
undefined,
|
||||
NotificationSeverity.Info
|
||||
NotificationSeverity.Info,
|
||||
'readOnlyNotification'
|
||||
)
|
||||
return {}
|
||||
}
|
||||
|
||||
@@ -179,7 +179,8 @@ const view = plugin(viewId, {
|
||||
FoldersBrowser: '' as AnyComponent,
|
||||
PersonIdPresenter: '' as AnyComponent,
|
||||
PersonIdFilter: '' as AnyComponent,
|
||||
RolePresenter: '' as AnyComponent
|
||||
RolePresenter: '' as AnyComponent,
|
||||
ReadOnlyNotification: '' as AnyComponent
|
||||
},
|
||||
ids: {
|
||||
IconWithEmoji: '' as Asset
|
||||
|
||||
Reference in New Issue
Block a user