Invite workspace (#1741)

Signed-off-by: budaeva <irina.budaeva@xored.com>
This commit is contained in:
budaeva 2022-05-13 18:00:12 +07:00 committed by GitHub
parent d9de0f24bd
commit 0046274c28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 62 additions and 7 deletions

View File

@ -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"
}
}

View File

@ -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">

View File

@ -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>

View File

@ -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
}
})

View File

@ -37,6 +37,7 @@ export default plugin(loginId, {
OverrideEndpoint: '' as Metadata<string>
},
component: {
LoginApp: '' as AnyComponent
LoginApp: '' as AnyComponent,
InviteLink: '' as AnyComponent
}
})

View File

@ -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",

View File

@ -24,6 +24,7 @@
"Signout": "Выйти",
"Settings": "Настройки",
"SelectWorkspace": "Выбрать пространство",
"InviteWorkspace": "Пригласить в пространство",
"DeleteStatus": "Удаление статуса",
"DeleteStatusConfirm": "Вы действительно хотите удалить этот статус?",
"Reconnect": "Переподключить",

View File

@ -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}

View File

@ -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
},

View File

@ -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'} />