diff --git a/communication b/communication index 34a153aa27..369b1b67b0 160000 --- a/communication +++ b/communication @@ -1 +1 @@ -Subproject commit 34a153aa27678967cfb5606181fc9317f2b2540a +Subproject commit 369b1b67b03c094ffe86824602a4f74e3a00ac10 diff --git a/dev/docker-compose.min.yaml b/dev/docker-compose.min.yaml index 57a9dec657..89d13f614d 100644 --- a/dev/docker-compose.min.yaml +++ b/dev/docker-compose.min.yaml @@ -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 diff --git a/dev/prod/public/config.json b/dev/prod/public/config.json index 46702711ec..b614a2eda1 100644 --- a/dev/prod/public/config.json +++ b/dev/prod/public/config.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, diff --git a/packages/presentation/src/communication.ts b/packages/presentation/src/communication.ts index 87bf73c630..ad279c6ef7 100644 --- a/packages/presentation/src/communication.ts +++ b/packages/presentation/src/communication.ts @@ -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 { + 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 = this.connection diff --git a/plugins/inbox-resources/src/components/InboxCard.svelte b/plugins/inbox-resources/src/components/InboxCard.svelte index d4c94faab7..4cdb36a21b 100644 --- a/plugins/inbox-resources/src/components/InboxCard.svelte +++ b/plugins/inbox-resources/src/components/InboxCard.svelte @@ -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} -
- {#if isRemoving} - - {:else} - - {/if} -
+ {#if account.role !== AccountRole.ReadOnlyGuest} +
+ {#if isRemoving} + + {:else} + + {/if} +
+ {/if}
diff --git a/plugins/view-resources/src/index.ts b/plugins/view-resources/src/index.ts index 4af22c0635..89db953692 100644 --- a/plugins/view-resources/src/index.ts +++ b/plugins/view-resources/src/index.ts @@ -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 => ({ MasterDetailView, AssociationPresenter, TreeView, - MasterDetailBrowser + MasterDetailBrowser, + ReadOnlyNotification }, popup: { PositionElementAlignment diff --git a/plugins/view-resources/src/middleware.ts b/plugins/view-resources/src/middleware.ts index ab7c6f4118..a3e6dcf4d4 100644 --- a/plugins/view-resources/src/middleware.ts +++ b/plugins/view-resources/src/middleware.ts @@ -358,7 +358,8 @@ export class ReadOnlyAccessMiddleware extends BasePresentationMiddleware impleme await translate(view.string.ReadOnlyWarningMessage, {}, getCurrentLanguage()), ReadOnlyNotification, undefined, - NotificationSeverity.Info + NotificationSeverity.Info, + 'readOnlyNotification' ) return {} } diff --git a/plugins/view/src/index.ts b/plugins/view/src/index.ts index f7e79cc9cb..ae4774b1cd 100644 --- a/plugins/view/src/index.ts +++ b/plugins/view/src/index.ts @@ -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