mirror of
https://github.com/hcengineering/platform.git
synced 2025-05-04 14:28:15 +00:00
Fixes Archive in Recruit (#1168)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
parent
a4af938871
commit
027d15034a
@ -14,7 +14,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import { Account, Arr, Domain, DOMAIN_MODEL, IndexKind, Ref, Space } from '@anticrm/core'
|
import { Account, Arr, Domain, DOMAIN_MODEL, IndexKind, Ref, Space } from '@anticrm/core'
|
||||||
import { Index, Model, Prop, TypeBoolean, TypeString } from '@anticrm/model'
|
import { Index, Model, Prop, TypeBoolean, TypeString, UX } from '@anticrm/model'
|
||||||
import core from './component'
|
import core from './component'
|
||||||
import { TDoc } from './core'
|
import { TDoc } from './core'
|
||||||
|
|
||||||
@ -23,6 +23,7 @@ export const DOMAIN_SPACE = 'space' as Domain
|
|||||||
// S P A C E
|
// S P A C E
|
||||||
|
|
||||||
@Model(core.class.Space, core.class.Doc, DOMAIN_SPACE)
|
@Model(core.class.Space, core.class.Doc, DOMAIN_SPACE)
|
||||||
|
@UX(core.string.Space)
|
||||||
export class TSpace extends TDoc implements Space {
|
export class TSpace extends TDoc implements Space {
|
||||||
@Prop(TypeString(), core.string.Name)
|
@Prop(TypeString(), core.string.Name)
|
||||||
@Index(IndexKind.FullText)
|
@Index(IndexKind.FullText)
|
||||||
|
@ -71,7 +71,6 @@ export default mergeIds(recruitId, recruit, {
|
|||||||
Vacancies: '' as AnyComponent,
|
Vacancies: '' as AnyComponent,
|
||||||
|
|
||||||
CreateReviewCategory: '' as AnyComponent,
|
CreateReviewCategory: '' as AnyComponent,
|
||||||
EditReviewCategory: '' as AnyComponent,
|
|
||||||
CreateReview: '' as AnyComponent,
|
CreateReview: '' as AnyComponent,
|
||||||
Reviews: '' as AnyComponent,
|
Reviews: '' as AnyComponent,
|
||||||
KanbanReviewCard: '' as AnyComponent,
|
KanbanReviewCard: '' as AnyComponent,
|
||||||
|
@ -215,6 +215,10 @@ export function createModel (builder: Builder): void {
|
|||||||
},
|
},
|
||||||
view.action.Move
|
view.action.Move
|
||||||
)
|
)
|
||||||
|
|
||||||
|
builder.mixin(core.class.Space, core.class.Class, view.mixin.AttributePresenter, {
|
||||||
|
presenter: view.component.ObjectPresenter
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export default view
|
export default view
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
export let inline: boolean = false
|
export let inline: boolean = false
|
||||||
|
|
||||||
function show () {
|
function show () {
|
||||||
// showPanel(recruit.component.EditVacancy, value._id, value._class, 'right')
|
showPanel(recruit.component.EditReviewCategory, value._id, value._class, 'right')
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -114,6 +114,7 @@ export default mergeIds(recruitId, recruit, {
|
|||||||
VacancyItemPresenter: '' as AnyComponent,
|
VacancyItemPresenter: '' as AnyComponent,
|
||||||
VacancyCountPresenter: '' as AnyComponent,
|
VacancyCountPresenter: '' as AnyComponent,
|
||||||
OpinionsPresenter: '' as AnyComponent,
|
OpinionsPresenter: '' as AnyComponent,
|
||||||
VacancyModifiedPresenter: '' as AnyComponent
|
VacancyModifiedPresenter: '' as AnyComponent,
|
||||||
|
EditReviewCategory: '' as AnyComponent
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -14,13 +14,15 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { Class, Doc, Ref } from '@anticrm/core'
|
import type { Class, Doc, Ref, Type } from '@anticrm/core'
|
||||||
import { createQuery, getClient } from '@anticrm/presentation'
|
import { createQuery, getClient } from '@anticrm/presentation'
|
||||||
import { AttributeModel } from '@anticrm/view'
|
import { AttributeModel } from '@anticrm/view'
|
||||||
import { getObjectPresenter } from '../utils'
|
import { getObjectPresenter } from '../utils'
|
||||||
|
|
||||||
export let objectId: Ref<Doc>
|
export let objectId: Ref<Doc>
|
||||||
export let _class: Ref<Class<Doc>>
|
export let _class: Ref<Class<Doc>>
|
||||||
|
export let value: Doc | undefined
|
||||||
|
export let attributeType: Type<any>
|
||||||
|
|
||||||
const client = getClient()
|
const client = getClient()
|
||||||
let presenter: AttributeModel | undefined
|
let presenter: AttributeModel | undefined
|
||||||
@ -28,7 +30,11 @@
|
|||||||
const docQuery = createQuery()
|
const docQuery = createQuery()
|
||||||
let doc: Doc | undefined
|
let doc: Doc | undefined
|
||||||
|
|
||||||
$: docQuery.query(_class, { _id: objectId }, (r) => { doc = r.shift() })
|
$: if (value === undefined) {
|
||||||
|
docQuery.query(_class, { _id: objectId }, (r) => { doc = r.shift() })
|
||||||
|
} else {
|
||||||
|
doc = value
|
||||||
|
}
|
||||||
|
|
||||||
$: if (doc !== undefined) {
|
$: if (doc !== undefined) {
|
||||||
getObjectPresenter(client, doc._class, { key: '' }).then(p => {
|
getObjectPresenter(client, doc._class, { key: '' }).then(p => {
|
||||||
@ -38,5 +44,5 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if presenter}
|
{#if presenter}
|
||||||
<svelte:component this={presenter.presenter} value={doc} inline />
|
<svelte:component this={presenter.presenter} value={doc} {attributeType} inline />
|
||||||
{/if}
|
{/if}
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
"ShowMenu": "Show menu",
|
"ShowMenu": "Show menu",
|
||||||
"HideMenu": "Hide menu",
|
"HideMenu": "Hide menu",
|
||||||
"Archive": "Archive",
|
"Archive": "Archive",
|
||||||
"Archived": "Archived {object}",
|
"Archived": "Archive",
|
||||||
"Open": "Open",
|
"Open": "Open",
|
||||||
"General": "General",
|
"General": "General",
|
||||||
"Members": "Members",
|
"Members": "Members",
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
"ShowMenu": "Показать меню",
|
"ShowMenu": "Показать меню",
|
||||||
"HideMenu": "Спрятать меню",
|
"HideMenu": "Спрятать меню",
|
||||||
"Archive": "Архив",
|
"Archive": "Архив",
|
||||||
"Archived": "Архивировал {object}",
|
"Archived": "Архив",
|
||||||
"Open": "Открыть",
|
"Open": "Открыть",
|
||||||
"General": "Общее",
|
"General": "Общее",
|
||||||
"Members": "Участники",
|
"Members": "Участники",
|
||||||
|
@ -13,10 +13,7 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
-->
|
-->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { Space } from '@anticrm/core'
|
|
||||||
import core 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 { Icon, Label } from '@anticrm/ui'
|
||||||
import view from '@anticrm/view'
|
import view from '@anticrm/view'
|
||||||
import { Table } from '@anticrm/view-resources'
|
import { Table } from '@anticrm/view-resources'
|
||||||
@ -25,46 +22,16 @@
|
|||||||
import { getSpecialSpaceClass } from '../utils'
|
import { getSpecialSpaceClass } from '../utils'
|
||||||
|
|
||||||
export let model: NavigatorModel | undefined
|
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>
|
</script>
|
||||||
|
|
||||||
<div class="flex-col h-full">
|
<div class="flex-col h-full">
|
||||||
<div class="flex-row-center header">
|
<div class="flex-row-center header">
|
||||||
<div class="content-color mr-3"><Icon icon={view.icon.Archive} size={'medium'} /></div>
|
<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>
|
</div>
|
||||||
{#if spaceSample !== undefined && model}
|
{#if model}
|
||||||
<Table
|
<Table
|
||||||
_class={spaceSample._class}
|
_class={core.class.Space}
|
||||||
config={['', '$lookup._class.label', 'modifiedOn']}
|
config={['', '$lookup._class.label', 'modifiedOn']}
|
||||||
options={{
|
options={{
|
||||||
lookup: {
|
lookup: {
|
||||||
|
Loading…
Reference in New Issue
Block a user