feat: User statuses (#10774)

* feat: User status

Signed-off-by: Artem Savchenko <armisav@gmail.com>

* Fix formatting

Signed-off-by: Artem Savchenko <armisav@gmail.com>

---------

Signed-off-by: Artem Savchenko <armisav@gmail.com>
This commit is contained in:
Artyom Savchenko
2026-04-16 15:02:29 +07:00
committed by GitHub
parent 44e4366255
commit 3e415cb0d2
26 changed files with 1196 additions and 49 deletions
@@ -13,8 +13,13 @@
// limitations under the License.
-->
<script lang="ts">
import contact, { formatName, getCurrentEmployee } from '@hcengineering/contact'
import { myEmployeeStore } from '@hcengineering/contact-resources'
import contact, { formatName, getCurrentEmployee, isWorkspaceMemberStatusVisible } from '@hcengineering/contact'
import {
myEmployeeStore,
loadWorkspaceMemberStatuses,
workspaceMemberStatusByAccountStore
} from '@hcengineering/contact-resources'
import contactResources from '@hcengineering/contact-resources/src/plugin'
import core, { AccountRole, getCurrentAccount, hasAccountRole } from '@hcengineering/core'
import rating, { type PersonRating } from '@hcengineering/rating'
import login, { loginId } from '@hcengineering/login'
@@ -60,6 +65,7 @@
)
onMount(() => {
loadWorkspaceMemberStatuses()
void getResource(setting.function.HasRoleCapability).then((checkCapability) => {
if (checkCapability != null) {
void checkCapability(RoleCapability.GenerateInviteLink).then((v: boolean) => {
@@ -70,6 +76,10 @@
})
$: person = $myEmployeeStore
$: ownWorkspaceStatus = $workspaceMemberStatusByAccountStore.get(account.uuid)
$: workspaceStatusActionLabel = isWorkspaceMemberStatusVisible(ownWorkspaceStatus)
? contactResources.string.WorkspaceStatusUpdateYour
: contactResources.string.WorkspaceStatusSetYour
function selectCategory (sp?: SettingsCategory): void {
closePopup()
@@ -142,6 +152,16 @@
}
})
}
if (hasAccountRole(account, AccountRole.User)) {
actions.push({
icon: contact.icon.User,
label: workspaceStatusActionLabel,
action: async () => {
closePopup()
showPopup(contact.component.WorkspaceMemberStatusEditor, {}, 'middle')
}
})
}
actions.push(...getMenu(items, ['main']))
if (hasAccountRole(account, AccountRole.User) && !isDisabled('invites') && canGenerateInviteLink) {
actions.push({