Fixes Archive in Recruit (#1168)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev
2022-03-18 16:58:34 +07:00
committed by GitHub
parent a4af938871
commit 027d15034a
9 changed files with 23 additions and 45 deletions
@@ -13,10 +13,7 @@
// limitations under the License.
-->
<script lang="ts">
import type { Space } from '@anticrm/core'
import core from '@anticrm/core'
import { translate } from '@anticrm/platform'
import { createQuery } from '@anticrm/presentation'
import { Icon, Label } from '@anticrm/ui'
import view from '@anticrm/view'
import { Table } from '@anticrm/view-resources'
@@ -25,46 +22,16 @@
import { getSpecialSpaceClass } from '../utils'
export let model: NavigatorModel | undefined
const query = createQuery()
let spaceSample: Space | undefined
$: if (model) {
query.query(
core.class.Space,
{
_class: { $in: getSpecialSpaceClass(model) },
archived: true
},
(result) => {
spaceSample = result[0]
},
{ limit: 1 }
)
}
let spaceName = ''
$: {
const spaceClass = spaceSample?._class ?? ''
const spaceModel = model?.spaces.find((x) => x.spaceClass === spaceClass)
const label = spaceModel?.label
if (label) {
translate(label, {}).then((l) => {
spaceName = l.toLowerCase()
})
}
}
</script>
<div class="flex-col h-full">
<div class="flex-row-center header">
<div class="content-color mr-3"><Icon icon={view.icon.Archive} size={'medium'} /></div>
<div class="fs-title"><Label label={workbench.string.Archived} params={{ object: spaceName }} /></div>
<div class="fs-title"><Label label={workbench.string.Archived}/></div>
</div>
{#if spaceSample !== undefined && model}
{#if model}
<Table
_class={spaceSample._class}
_class={core.class.Space}
config={['', '$lookup._class.label', 'modifiedOn']}
options={{
lookup: {