mirror of
https://github.com/hcengineering/platform.git
synced 2025-01-23 12:05:36 +00:00
Invite workspace (#1741)
Signed-off-by: budaeva <irina.budaeva@xored.com>
This commit is contained in:
parent
d9de0f24bd
commit
0046274c28
@ -41,6 +41,7 @@
|
||||
"@anticrm/login": "~0.6.1",
|
||||
"@anticrm/image-cropper": "~0.6.0",
|
||||
"@anticrm/client": "~0.6.2",
|
||||
"fast-equals": "^2.0.3"
|
||||
"fast-equals": "^2.0.3",
|
||||
"@anticrm/setting": "~0.6.1"
|
||||
}
|
||||
}
|
||||
|
@ -15,8 +15,10 @@
|
||||
<script lang="ts">
|
||||
import contact, { Employee, EmployeeAccount } from '@anticrm/contact'
|
||||
import { Account, DocumentQuery, Ref, SortingOrder, Space } from '@anticrm/core'
|
||||
import login from '@anticrm/login'
|
||||
import { translate } from '@anticrm/platform'
|
||||
import { IconAdd, Label, Scroller, SearchEdit } from '@anticrm/ui'
|
||||
import setting from '@anticrm/setting'
|
||||
import { IconAdd, Label, Scroller, SearchEdit, showPopup } from '@anticrm/ui'
|
||||
import { createEventDispatcher } from 'svelte'
|
||||
import presentation from '../plugin'
|
||||
import { getClient } from '../utils'
|
||||
@ -24,6 +26,7 @@
|
||||
|
||||
export let space: Space
|
||||
export let withAddButton: boolean = false
|
||||
export let withInviteWorkspaceButton: boolean = false
|
||||
|
||||
const client = getClient()
|
||||
const dispatch = createEventDispatcher()
|
||||
@ -60,6 +63,10 @@
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function inviteWorkspace (): void {
|
||||
showPopup(login.component.InviteLink, {})
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="flex-col h-full">
|
||||
@ -111,6 +118,13 @@
|
||||
</Scroller>
|
||||
{/if}
|
||||
{/await}
|
||||
{#if withInviteWorkspaceButton}
|
||||
<div class="item fs-title mb-4 mt-2">
|
||||
<div class="flex-row-center p-1" on:click={inviteWorkspace}>
|
||||
<Label label={setting.string.InviteWorkspace} />
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<style lang="scss">
|
||||
|
@ -106,7 +106,12 @@
|
||||
<span class="fs-title text-xl overflow-label mb-2 flex-no-shrink">
|
||||
<Label label={chunter.string.Members} />
|
||||
</span>
|
||||
<Members space={channel} withAddButton={true} on:addMembers={openAddMembersPopup} />
|
||||
<Members
|
||||
space={channel}
|
||||
withAddButton={true}
|
||||
withInviteWorkspaceButton={true}
|
||||
on:addMembers={openAddMembersPopup}
|
||||
/>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
@ -15,6 +15,7 @@
|
||||
//
|
||||
|
||||
import LoginApp from './components/LoginApp.svelte'
|
||||
import InviteLink from './components/InviteLink.svelte'
|
||||
|
||||
/*!
|
||||
* Anticrm Platform™ Login Plugin
|
||||
@ -25,7 +26,8 @@ import LoginApp from './components/LoginApp.svelte'
|
||||
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
||||
export default async () => ({
|
||||
component: {
|
||||
LoginApp
|
||||
LoginApp,
|
||||
InviteLink
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -37,6 +37,7 @@ export default plugin(loginId, {
|
||||
OverrideEndpoint: '' as Metadata<string>
|
||||
},
|
||||
component: {
|
||||
LoginApp: '' as AnyComponent
|
||||
LoginApp: '' as AnyComponent,
|
||||
InviteLink: '' as AnyComponent
|
||||
}
|
||||
})
|
||||
|
@ -24,6 +24,7 @@
|
||||
"Signout": "Sign out",
|
||||
"Settings": "Settings",
|
||||
"SelectWorkspace": "Select workspace",
|
||||
"InviteWorkspace": "Invite to workspace",
|
||||
"DeleteStatus": "Delete status",
|
||||
"DeleteStatusConfirm": "Do you want to delete this status?",
|
||||
"Reconnect": "Reconnect",
|
||||
|
@ -24,6 +24,7 @@
|
||||
"Signout": "Выйти",
|
||||
"Settings": "Настройки",
|
||||
"SelectWorkspace": "Выбрать пространство",
|
||||
"InviteWorkspace": "Пригласить в пространство",
|
||||
"DeleteStatus": "Удаление статуса",
|
||||
"DeleteStatusConfirm": "Вы действительно хотите удалить этот статус?",
|
||||
"Reconnect": "Переподключить",
|
||||
|
@ -1,7 +1,15 @@
|
||||
<script lang="ts">
|
||||
import { getClient } from '@anticrm/presentation'
|
||||
import setting, { SettingsCategory } from '@anticrm/setting'
|
||||
import { Component, getCurrentLocation, Label, location, navigate, setMetadataLocalStorage } from '@anticrm/ui'
|
||||
import {
|
||||
Component,
|
||||
getCurrentLocation,
|
||||
Label,
|
||||
location,
|
||||
navigate,
|
||||
setMetadataLocalStorage,
|
||||
showPopup
|
||||
} from '@anticrm/ui'
|
||||
import { onDestroy } from 'svelte'
|
||||
import CategoryElement from './CategoryElement.svelte'
|
||||
import login from '@anticrm/login'
|
||||
@ -43,6 +51,9 @@
|
||||
function selectWorkspace (): void {
|
||||
navigate({ path: [login.component.LoginApp, 'selectWorkspace'] })
|
||||
}
|
||||
function inviteWorkspace (): void {
|
||||
showPopup(login.component.InviteLink, {})
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="flex h-full">
|
||||
@ -64,6 +75,7 @@
|
||||
{/each}
|
||||
<div class="signout">
|
||||
<CategoryElement icon={setting.icon.Signout} label={setting.string.Signout} on:click={signOut} />
|
||||
<CategoryElement label={setting.string.InviteWorkspace} on:click={inviteWorkspace} />
|
||||
<CategoryElement
|
||||
icon={setting.icon.SelectWorkspace}
|
||||
label={setting.string.SelectWorkspace}
|
||||
|
@ -114,6 +114,7 @@ export default plugin(settingId, {
|
||||
EnterNewPassword: '' as IntlString,
|
||||
RepeatNewPassword: '' as IntlString,
|
||||
Signout: '' as IntlString,
|
||||
InviteWorkspace: '' as IntlString,
|
||||
SelectWorkspace: '' as IntlString,
|
||||
Reconnect: '' as IntlString
|
||||
},
|
||||
|
@ -18,7 +18,15 @@
|
||||
import login from '@anticrm/login'
|
||||
import { Avatar, createQuery, getClient } from '@anticrm/presentation'
|
||||
import setting, { SettingsCategory } from '@anticrm/setting'
|
||||
import { closePopup, getCurrentLocation, Icon, Label, navigate, setMetadataLocalStorage } from '@anticrm/ui'
|
||||
import {
|
||||
closePopup,
|
||||
getCurrentLocation,
|
||||
Icon,
|
||||
Label,
|
||||
navigate,
|
||||
setMetadataLocalStorage,
|
||||
showPopup
|
||||
} from '@anticrm/ui'
|
||||
|
||||
const client = getClient()
|
||||
async function getItems (): Promise<SettingsCategory[]> {
|
||||
@ -61,6 +69,10 @@
|
||||
navigate({ path: [login.component.LoginApp, 'selectWorkspace'] })
|
||||
}
|
||||
|
||||
function inviteWorkspace (): void {
|
||||
showPopup(login.component.InviteLink, {})
|
||||
}
|
||||
|
||||
function filterItems (items: SettingsCategory[]): SettingsCategory[] {
|
||||
return items?.filter((p) => p.name !== 'profile' && p.name !== 'password')
|
||||
}
|
||||
@ -108,6 +120,11 @@
|
||||
</div>
|
||||
<Label label={setting.string.SelectWorkspace} />
|
||||
</button>
|
||||
<button class="menu-item" on:click={inviteWorkspace}>
|
||||
<div class="ml-6">
|
||||
<Label label={setting.string.InviteWorkspace} />
|
||||
</div>
|
||||
</button>
|
||||
<button class="menu-item" on:click={signOut}>
|
||||
<div class="mr-2">
|
||||
<Icon icon={setting.icon.Signout} size={'small'} />
|
||||
|
Loading…
Reference in New Issue
Block a user