Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions foundations/core/packages/core/lang/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
"ArchiveSpaceDescription": "Umožňuje uživatelům archivovat prostor",
"AutoJoin": "Automatické připojení",
"AutoJoinDescr": "Automaticky připojit nové zaměstnance k tomuto prostoru",
"AutoJoinGuests": "Automaticky připojit hosty",
"AutoJoinGuestsDescr": "Pokud je zapnuto, hosté pracovního prostoru se při aktivaci přidají do tohoto prostoru",
"RBAC": "Řízení přístupu na základě rolí",
"RBACDescr": "Vyžadovat řízení přístupu na základě rolí pro provádění akcí v tomto prostoru",
"BlobSize": "Velikost",
Expand Down
2 changes: 2 additions & 0 deletions foundations/core/packages/core/lang/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
"ArchiveSpaceDescription": "Gewährt Benutzern die Möglichkeit, den Arbeitsbereich zu archivieren",
"AutoJoin": "Automatisch beitreten",
"AutoJoinDescr": "Neue Mitarbeiter automatisch diesem Arbeitsbereich hinzufügen",
"AutoJoinGuests": "Gäste automatisch hinzufügen",
"AutoJoinGuestsDescr": "Wenn aktiviert, werden Arbeitsbereichs-Gäste bei der Aktivierung diesem Bereich hinzugefügt",
"RBAC": "Rollenbasierte Zugriffskontrolle",
"RBACDescr": "Erfordert rollenbasierten Zugriff, um Aktionen in diesem Arbeitsbereich auszuführen",
"BlobSize": "Größe",
Expand Down
2 changes: 2 additions & 0 deletions foundations/core/packages/core/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
"ArchiveSpaceDescription": "Grants users ability to archive the space",
"AutoJoin": "Auto join",
"AutoJoinDescr": "Automatically join new employees to this space",
"AutoJoinGuests": "Auto-join guests",
"AutoJoinGuestsDescr": "When enabled, workspace guests are added to this space on activation",
"RBAC": "Role-based access control",
"RBACDescr": "Require role-based access to perform actions in this space",
"BlobSize": "Size",
Expand Down
2 changes: 2 additions & 0 deletions foundations/core/packages/core/lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
"ArchiveSpaceDescription": "Concede a los usuarios la capacidad de archivar el espacio",
"AutoJoin": "Auto unirse",
"AutoJoinDescr": "Unirse automáticamente a los nuevos empleados a este espacio",
"AutoJoinGuests": "Unir invitados automáticamente",
"AutoJoinGuestsDescr": "Si está activado, los invitados del espacio de trabajo se añaden a este espacio al activarse",
"RBAC": "Control de acceso basado en roles",
"RBACDescr": "Requerir acceso basado en roles para realizar acciones en este espacio",
"BlobSize": "Tamaño",
Expand Down
2 changes: 2 additions & 0 deletions foundations/core/packages/core/lang/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
"ArchiveSpaceDescription": "Accorde aux utilisateurs la capacité d'archiver l'espace",
"AutoJoin": "Rejoindre automatiquement",
"AutoJoinDescr": "Ajouter automatiquement les nouveaux employés à cet espace",
"AutoJoinGuests": "Rejoindre automatiquement les invités",
"AutoJoinGuestsDescr": "Si activé, les invités de l’espace de travail sont ajoutés à cet espace à l’activation",
"RBAC": "Contrôle d'accès basé sur les rôles",
"RBACDescr": "Exiger un accès basé sur les rôles pour effectuer des actions dans cet espace",
"BlobSize": "Taille",
Expand Down
2 changes: 2 additions & 0 deletions foundations/core/packages/core/lang/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
"ArchiveSpaceDescription": "Concede agli utenti la possibilità di archiviare lo spazio",
"AutoJoin": "Partecipazione automatica",
"AutoJoinDescr": "Aggiungi automaticamente i nuovi dipendenti a questo spazio",
"AutoJoinGuests": "Partecipazione automatica ospiti",
"AutoJoinGuestsDescr": "Se abilitato, gli ospiti del workspace vengono aggiunti a questo spazio all’attivazione",
"RBAC": "Controllo accessi basato sui ruoli",
"RBACDescr": "Richiedi accesso basato sui ruoli per eseguire azioni in questo spazio",
"BlobSize": "Dimensione",
Expand Down
2 changes: 2 additions & 0 deletions foundations/core/packages/core/lang/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
"ArchiveSpaceDescription": "ユーザーにスペースをアーカイブする権限を付与します",
"AutoJoin": "自動参加",
"AutoJoinDescr": "新しいユーザーを自動的にこのスペースに参加させます",
"AutoJoinGuests": "ゲストの自動参加",
"AutoJoinGuestsDescr": "有効にすると、ワークスペースのゲストは有効化時にこのスペースのメンバーに追加されます",
"RBAC": "ロールベースアクセス制御",
"RBACDescr": "このスペースでの操作を実行するためにロールベースのアクセスを要求します",
"BlobSize": "サイズ",
Expand Down
2 changes: 2 additions & 0 deletions foundations/core/packages/core/lang/pt-br.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
"ArchiveSpaceDescription": "Concede aos usuários a capacidade de arquivar o espaço",
"AutoJoin": "Auto adesão",
"AutoJoinDescr": "Adesão automática de novos funcionários a este espaço",
"AutoJoinGuests": "Adesão automática de convidados",
"AutoJoinGuestsDescr": "Se ativado, convidados do espaço de trabalho são adicionados a este espaço na ativação",
"RBAC": "Controle de acesso baseado em funções",
"RBACDescr": "Exigir acesso baseado em funções para executar ações neste espaço",
"BlobSize": "Tamanho",
Expand Down
2 changes: 2 additions & 0 deletions foundations/core/packages/core/lang/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
"ArchiveSpaceDescription": "Concede aos usuários a capacidade de arquivar o espaço",
"AutoJoin": "Auto adesão",
"AutoJoinDescr": "Adesão automática de novos funcionários a este espaço",
"AutoJoinGuests": "Adesão automática de convidados",
"AutoJoinGuestsDescr": "Se ativado, convidados do espaço de trabalho são adicionados a este espaço na ativação",
"RBAC": "Controle de acesso baseado em funções",
"RBACDescr": "Exigir acesso baseado em funções para executar ações neste espaço",
"BlobSize": "Tamanho",
Expand Down
2 changes: 2 additions & 0 deletions foundations/core/packages/core/lang/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
"ArchiveSpaceDescription": "Дает пользователям разрешение архивировать пространство",
"AutoJoin": "Автоприсоединение",
"AutoJoinDescr": "Автоматически присоединять новых сотрудников к этому пространству",
"AutoJoinGuests": "Автоприсоединение гостей",
"AutoJoinGuestsDescr": "При активации добавлять гостей воркспейса в участники этого пространства",
"RBAC": "Ролевой доступ",
"RBACDescr": "Требовать ролевой доступ для выполнения действий в этом пространстве",
"BlobSize": "Размер",
Expand Down
2 changes: 2 additions & 0 deletions foundations/core/packages/core/lang/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
"ArchiveSpaceDescription": "Kullanıcılara alanı arşivleme yetkisi verir",
"AutoJoin": "Otomatik katıl",
"AutoJoinDescr": "Yeni çalışanları bu alana otomatik olarak ekle",
"AutoJoinGuests": "Misafirleri otomatik katıl",
"AutoJoinGuestsDescr": "Etkinleştirilirse, çalışma alanı misafirleri etkinleştirmede bu alana eklenir",
"RBAC": "Rol tabanlı erişim kontrolü",
"RBACDescr": "Bu alanda işlemleri gerçekleştirmek için rol tabanlı erişim gerektir",
"BlobSize": "Boyut",
Expand Down
2 changes: 2 additions & 0 deletions foundations/core/packages/core/lang/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
"ArchiveSpaceDescription": "授予用户归档空间的权限",
"AutoJoin": "自动加入",
"AutoJoinDescr": "自动将新员工加入此空间",
"AutoJoinGuests": "访客自动加入",
"AutoJoinGuestsDescr": "启用后,工作区访客在激活时会加入此空间",
"RBAC": "基于角色的访问控制",
"RBACDescr": "要求基于角色的访问权限以在此空间中执行操作",
"BlobSize": "大小",
Expand Down
27 changes: 27 additions & 0 deletions foundations/core/packages/core/src/__tests__/autoJoinRoles.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//
// Copyright © 2026 Hardcore Engineering Inc.
//
// Licensed under the Eclipse Public License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. You may
// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//

import { AccountRole } from '../classes'
import { setWorkspaceGuestAutoJoinRoles } from '../autoJoinRoles'

describe('autoJoinRoles', () => {
test('setWorkspaceGuestAutoJoinRoles toggles Guest only', () => {
expect(setWorkspaceGuestAutoJoinRoles(undefined, false)).toEqual([])
expect(setWorkspaceGuestAutoJoinRoles([AccountRole.User], true).sort()).toEqual(
[AccountRole.User, AccountRole.Guest].sort()
)
expect(setWorkspaceGuestAutoJoinRoles([AccountRole.Guest, AccountRole.User], false)).toEqual([AccountRole.User])
})
})
33 changes: 33 additions & 0 deletions foundations/core/packages/core/src/autoJoinRoles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//
// Copyright © 2026 Hardcore Engineering Inc.
//
// Licensed under the Eclipse Public License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. You may
// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//

import { AccountRole } from './classes'

/**
* Toggle {@link AccountRole.Guest} in {@link Space.autoJoinForRoles}; other roles are preserved.
* @public
*/
export function setWorkspaceGuestAutoJoinRoles (
existing: AccountRole[] | undefined,
includeGuest: boolean
): AccountRole[] {
const next = new Set(existing ?? [])
if (includeGuest) {
next.add(AccountRole.Guest)
} else {
next.delete(AccountRole.Guest)
}
return Array.from(next)
}
2 changes: 2 additions & 0 deletions foundations/core/packages/core/src/classes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,8 @@ export interface Space extends Doc {
archived: boolean
owners?: AccountUuid[]
autoJoin?: boolean
/** If it includes {@link AccountRole.Guest}, that guest is auto-added to members on activation (see OnEmployeeCreate). */
autoJoinForRoles?: AccountRole[]
}

/**
Expand Down
2 changes: 2 additions & 0 deletions foundations/core/packages/core/src/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,8 @@ export default plugin(coreId, {
ArchiveSpaceDescription: '' as IntlString,
AutoJoin: '' as IntlString,
AutoJoinDescr: '' as IntlString,
AutoJoinGuests: '' as IntlString,
AutoJoinGuestsDescr: '' as IntlString,
RBAC: '' as IntlString,
RBACDescr: '' as IntlString,
Version: '' as IntlString
Expand Down
1 change: 1 addition & 0 deletions foundations/core/packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import core from './component'

export * from './classes'
export * from './autoJoinRoles'
export * from './client'
export * from './collaboration'
export {
Expand Down
13 changes: 12 additions & 1 deletion models/chunter/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,18 @@ export function createModel (builder: Builder): void {
})

builder.mixin(chunter.class.DirectMessage, core.class.Class, chunter.mixin.ObjectChatPanel, {
ignoreKeys: ['archived', 'collaborators', 'lastMessage', 'pinned', 'topic', 'description', 'members', 'owners']
ignoreKeys: [
'archived',
'collaborators',
'lastMessage',
'pinned',
'topic',
'description',
'members',
'owners',
'autoJoin',
'autoJoinForRoles'
]
})

builder.createDoc(activity.class.ReplyProvider, core.space.Model, {
Expand Down
3 changes: 3 additions & 0 deletions models/core/src/security.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ export class TSpace extends TDoc implements Space {

@Prop(TypeBoolean(), core.string.AutoJoin)
autoJoin?: boolean

@Prop(ArrOf(TypeString()), core.string.AutoJoinGuests)
autoJoinForRoles?: AccountRole[]
}

@Model(core.class.SystemSpace, core.class.Space)
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/Toggle.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
const dispatch = createEventDispatcher()
</script>

<label {id} class="toggle" use:tooltip={showTooltip} class:disabled>
<label {id} class="toggle" use:tooltip={showTooltip} class:disabled {...$$restProps}>
<input
class="chBox"
type="checkbox"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,16 @@
-->
<script lang="ts">
import { AccountArrayEditor, employeeRefByAccountUuidStore } from '@hcengineering/contact-resources'
import core, { AccountUuid, Data, Ref, RolesAssignment, getCurrentAccount, notEmpty } from '@hcengineering/core'
import core, {
AccountRole,
AccountUuid,
Data,
Ref,
RolesAssignment,
getCurrentAccount,
notEmpty,
setWorkspaceGuestAutoJoinRoles
} from '@hcengineering/core'
import presentation, { Card, getClient } from '@hcengineering/presentation'
import { EditBox, Label, Toggle } from '@hcengineering/ui'
import { createEventDispatcher } from 'svelte'
Expand Down Expand Up @@ -98,6 +107,16 @@
}
}

function normalizeAutoJoinForRoles (roles: AccountRole[]): AccountRole[] | undefined {
return roles.length > 0 ? [...roles] : undefined
}

let autoJoinForRoles: AccountRole[] = space?.autoJoinForRoles != null ? hierarchy.clone(space.autoJoinForRoles) : []

function setGuestAutoJoin (enabled: boolean): void {
autoJoinForRoles = setWorkspaceGuestAutoJoinRoles(autoJoinForRoles, enabled)
}

function getData (): Data<CardSpace> {
return {
name,
Expand All @@ -106,6 +125,7 @@
members,
owners,
autoJoin,
autoJoinForRoles: normalizeAutoJoinForRoles(autoJoinForRoles),
archived: false,
type: card.spaceType.SpaceType,
types,
Expand Down Expand Up @@ -256,6 +276,19 @@
<Toggle id={'space-autoJoin'} bind:on={autoJoin} />
</div>

<div class="antiGrid-row">
<div class="antiGrid-row__header withDesciption">
<Label label={core.string.AutoJoinGuests} />
<span><Label label={core.string.AutoJoinGuestsDescr} /></span>
</div>
<Toggle
on={autoJoinForRoles.includes(AccountRole.Guest)}
on:change={(ev) => {
setGuestAutoJoin(ev.detail)
}}
/>
</div>

<div class="antiGrid-row">
<div class="antiGrid-row__header withDesciption">
<Label label={core.string.RBAC} />
Expand Down
4 changes: 3 additions & 1 deletion plugins/chunter-resources/src/components/EditChannel.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@
{#if _class === chunter.class.Channel}
<div class="flex-col-center">
<span class="fs-title text-xl overflow-label mt-4 mb-2"><Label label={chunter.string.Settings} /></span>
<EditChannelSettingsTab {channel} on:close />
{#key channel._id}
<EditChannelSettingsTab {channel} on:close />
{/key}
</div>
{/if}
</svelte:fragment>
Expand Down
Loading
Loading