mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-09 19:27:44 +02:00
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:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user