diff --git a/models/recruit/src/index.ts b/models/recruit/src/index.ts index 4f4d125dd2..2fa4e73b3f 100644 --- a/models/recruit/src/index.ts +++ b/models/recruit/src/index.ts @@ -44,7 +44,7 @@ import { Applicant, Candidate, Candidates, Vacancy } from '@anticrm/recruit' import { KeyBinding } from '@anticrm/view' import recruit from './plugin' import { createReviewModel, reviewTableConfig, reviewTableOptions } from './review' -import { TOpinion, TReview, TReviewCategory } from './review-model' +import { TOpinion, TReview } from './review-model' @Model(recruit.class.Vacancy, task.class.SpaceWithStates) @UX(recruit.string.Vacancy, recruit.icon.Vacancy) @@ -123,7 +123,7 @@ export class TApplicant extends TTask implements Applicant { } export function createModel (builder: Builder): void { - builder.createModel(TVacancy, TCandidates, TCandidate, TApplicant, TReviewCategory, TReview, TOpinion) + builder.createModel(TVacancy, TCandidates, TCandidate, TApplicant, TReview, TOpinion) builder.mixin(recruit.class.Vacancy, core.class.Class, workbench.mixin.SpaceView, { view: { @@ -156,14 +156,7 @@ export function createModel (builder: Builder): void { icon: recruit.icon.RecruitApplication, hidden: false, navigatorModel: { - spaces: [ - { - label: recruit.string.ReviewCategory, - spaceClass: recruit.class.ReviewCategory, - addSpaceLabel: recruit.string.CreateReviewCategory, - createComponent: recruit.component.CreateReviewCategory - } - ], + spaces: [], specials: [ { id: vacanciesId, @@ -218,15 +211,19 @@ export function createModel (builder: Builder): void { } }, { - id: 'upcoming', - component: calendar.component.UpcomingEvents, + id: 'reviews', + component: calendar.component.Events, componentProps: { + viewLabel: recruit.string.Reviews, + viewIcon: recruit.icon.Review, _class: recruit.class.Review, options: reviewTableOptions, - config: reviewTableConfig + config: reviewTableConfig, + createLabel: recruit.string.ReviewCreateLabel, + createComponent: recruit.component.CreateReview }, icon: calendar.icon.Calendar, - label: calendar.string.UpcomingEvents, + label: recruit.string.Reviews, position: 'event' } ] @@ -343,10 +340,6 @@ export function createModel (builder: Builder): void { editor: recruit.component.EditVacancy }) - builder.mixin(recruit.class.ReviewCategory, core.class.Class, view.mixin.ObjectEditor, { - editor: recruit.component.EditReviewCategory - }) - builder.mixin(recruit.class.Applicant, core.class.Class, view.mixin.AttributePresenter, { presenter: recruit.component.ApplicationPresenter }) @@ -355,10 +348,6 @@ export function createModel (builder: Builder): void { presenter: recruit.component.VacancyPresenter }) - builder.mixin(recruit.class.ReviewCategory, core.class.Class, view.mixin.AttributePresenter, { - presenter: recruit.component.ReviewCategoryPresenter - }) - builder.mixin(recruit.class.Applicant, core.class.Class, view.mixin.ObjectValidator, { validator: recruit.validator.ApplicantValidator }) diff --git a/models/recruit/src/migration.ts b/models/recruit/src/migration.ts index 586f155dba..6c2f663eaf 100644 --- a/models/recruit/src/migration.ts +++ b/models/recruit/src/migration.ts @@ -13,8 +13,10 @@ // limitations under the License. // -import core, { Doc, Ref, Space, TxOperations } from '@anticrm/core' +import core, { Class, Doc, DOMAIN_TX, Ref, Space, TxOperations } from '@anticrm/core' import { createOrUpdate, MigrateOperation, MigrationClient, MigrationUpgradeClient } from '@anticrm/model' +import { DOMAIN_CALENDAR } from '@anticrm/model-calendar' +import { DOMAIN_SPACE } from '@anticrm/model-core' import tags, { TagCategory } from '@anticrm/model-tags' import { createKanbanTemplate, createSequence } from '@anticrm/model-task' import { getCategories } from '@anticrm/skillset' @@ -22,7 +24,31 @@ import { KanbanTemplate } from '@anticrm/task' import recruit from './plugin' export const recruitOperation: MigrateOperation = { - async migrate (client: MigrationClient): Promise {}, + async migrate (client: MigrationClient): Promise { + await client.update( + DOMAIN_CALENDAR, + { + _class: recruit.class.Review, + space: { $nin: [recruit.space.Reviews] } + }, + { + space: recruit.space.Reviews + } + ) + const categories = await client.find(DOMAIN_SPACE, { + _class: 'recruit:class:ReviewCategory' as Ref> + }) + for (const cat of categories) { + await client.delete(DOMAIN_SPACE, cat._id) + } + + const catTx = await client.find(DOMAIN_TX, { + objectClass: 'recruit:class:ReviewCategory' as Ref> + }) + for (const cat of catTx) { + await client.delete(DOMAIN_TX, cat._id) + } + }, async upgrade (client: MigrationUpgradeClient): Promise { const tx = new TxOperations(client, core.account.System) await createDefaults(tx) @@ -30,7 +56,7 @@ export const recruitOperation: MigrateOperation = { } async function createDefaults (tx: TxOperations): Promise { - await createSpace(tx) + await createSpaces(tx) await createOrUpdate( tx, @@ -66,44 +92,6 @@ async function createDefaults (tx: TxOperations): Promise { await createSequence(tx, recruit.class.Opinion) await createSequence(tx, recruit.class.Applicant) await createDefaultKanbanTemplate(tx) - await createReviewTemplates(tx) -} - -async function createReviewTemplates (tx: TxOperations): Promise { - if ((await tx.findOne(core.class.TxCreateDoc, { objectId: recruit.template.Interview })) === undefined) { - await createKanbanTemplate(tx, { - kanbanId: recruit.template.Interview, - space: recruit.space.ReviewTemplates as Ref as Ref, - title: 'Interview', - states: [ - { color: 9, title: 'Prepare' }, - { color: 10, title: 'Appointment' }, - { color: 1, title: 'Opinions' } - ], - doneStates: [ - { isWon: true, title: 'Pass' }, - { isWon: false, title: 'Failed' } - ] - }) - } - - if ((await tx.findOne(core.class.TxCreateDoc, { objectId: recruit.template.Task })) === undefined) { - await createKanbanTemplate(tx, { - kanbanId: recruit.template.Task, - space: recruit.space.ReviewTemplates as Ref as Ref, - title: 'Test task', - states: [ - { color: 9, title: 'Prepare' }, - { color: 10, title: 'Assigned' }, - { color: 1, title: 'Review' }, - { color: 4, title: 'Opinions' } - ], - doneStates: [ - { isWon: true, title: 'Pass' }, - { isWon: false, title: 'Failed' } - ] - }) - } } async function createDefaultKanbanTemplate (tx: TxOperations): Promise> { @@ -129,7 +117,7 @@ async function createDefaultKanbanTemplate (tx: TxOperations): Promise { +async function createSpaces (tx: TxOperations): Promise { const current = await tx.findOne(core.class.Space, { _id: recruit.space.CandidatesPublic }) @@ -147,4 +135,22 @@ async function createSpace (tx: TxOperations): Promise { recruit.space.CandidatesPublic ) } + + const currentReviews = await tx.findOne(core.class.Space, { + _id: recruit.space.Reviews + }) + if (currentReviews === undefined) { + await tx.createDoc( + core.class.Space, + core.space.Space, + { + name: 'Reviews', + description: 'Public reviews', + private: true, + members: [], + archived: false + }, + recruit.space.Reviews + ) + } } diff --git a/models/recruit/src/plugin.ts b/models/recruit/src/plugin.ts index 094cbb8864..27c8c89e50 100644 --- a/models/recruit/src/plugin.ts +++ b/models/recruit/src/plugin.ts @@ -64,7 +64,6 @@ export default mergeIds(recruitId, recruit, { ApplicationPresenter: '' as AnyComponent, ApplicationsPresenter: '' as AnyComponent, VacancyPresenter: '' as AnyComponent, - ReviewCategoryPresenter: '' as AnyComponent, EditApplication: '' as AnyComponent, TemplatesIcon: '' as AnyComponent, Applications: '' as AnyComponent, @@ -73,7 +72,6 @@ export default mergeIds(recruitId, recruit, { SkillsView: '' as AnyComponent, Vacancies: '' as AnyComponent, - CreateReviewCategory: '' as AnyComponent, CreateReview: '' as AnyComponent, Reviews: '' as AnyComponent, KanbanReviewCard: '' as AnyComponent, @@ -86,8 +84,6 @@ export default mergeIds(recruitId, recruit, { }, template: { DefaultVacancy: '' as Ref, - - Interview: '' as Ref, Task: '' as Ref }, completion: { diff --git a/models/recruit/src/review-model.ts b/models/recruit/src/review-model.ts index fa7c9885a5..0fe1650db9 100644 --- a/models/recruit/src/review-model.ts +++ b/models/recruit/src/review-model.ts @@ -5,18 +5,11 @@ import attachment from '@anticrm/model-attachment' import calendar, { TEvent } from '@anticrm/model-calendar' import chunter from '@anticrm/model-chunter' import contact from '@anticrm/model-contact' -import core, { TAttachedDoc, TSpace } from '@anticrm/model-core' +import core, { TAttachedDoc } from '@anticrm/model-core' import task from '@anticrm/model-task' -import { Candidate, Opinion, Review, ReviewCategory } from '@anticrm/recruit' +import { Candidate, Opinion, Review } from '@anticrm/recruit' import recruit from './plugin' -@Model(recruit.class.ReviewCategory, core.class.Space) -@UX(recruit.string.ReviewCategory, recruit.icon.Review) -export class TReviewCategory extends TSpace implements ReviewCategory { - @Prop(TypeString(), recruit.string.FullDescription) - fullDescription?: string -} - @Model(recruit.class.Review, calendar.class.Event) @UX(recruit.string.Review, recruit.icon.Review, recruit.string.ReviewShortLabel, 'number') export class TReview extends TEvent implements Review { diff --git a/models/recruit/src/review.ts b/models/recruit/src/review.ts index c56ac6f4c2..89ca2eacda 100644 --- a/models/recruit/src/review.ts +++ b/models/recruit/src/review.ts @@ -3,9 +3,7 @@ import { Builder } from '@anticrm/model' import calendar from '@anticrm/model-calendar' import contact from '@anticrm/model-contact' import core from '@anticrm/model-core' -import { actionTemplates } from '@anticrm/model-task' import view, { createAction } from '@anticrm/model-view' -import workbench from '@anticrm/model-workbench' import { Review } from '@anticrm/recruit' import { BuildModelKey } from '@anticrm/view' import recruit from './plugin' @@ -35,14 +33,6 @@ export const reviewTableConfig: (BuildModelKey | string)[] = [ ] export function createReviewModel (builder: Builder): void { - builder.mixin(recruit.class.ReviewCategory, core.class.Class, workbench.mixin.SpaceView, { - view: { - class: recruit.class.Review, - createItemDialog: recruit.component.CreateReview, - createItemLabel: recruit.string.ReviewCreateLabel - } - }) - builder.mixin(recruit.class.Review, core.class.Class, view.mixin.CollectionEditor, { editor: recruit.component.Reviews }) @@ -106,9 +96,6 @@ export function createReviewModel (builder: Builder): void { } }) - createAction(builder, { ...actionTemplates.archiveSpace, target: recruit.class.ReviewCategory }) - createAction(builder, { ...actionTemplates.unarchiveSpace, target: recruit.class.ReviewCategory }) - const reviewOptions: FindOptions = { lookup: { attachedTo: recruit.mixin.Candidate, diff --git a/packages/presentation/src/components/UsersPopup.svelte b/packages/presentation/src/components/UsersPopup.svelte index 1f73fbafa7..a0831eb313 100644 --- a/packages/presentation/src/components/UsersPopup.svelte +++ b/packages/presentation/src/components/UsersPopup.svelte @@ -115,12 +115,7 @@
- handleSelection(evt, evt.detail)} - > + {@const person = objects[item]}
{#if viewlets[selectedViewlet]} diff --git a/plugins/calendar-resources/src/index.ts b/plugins/calendar-resources/src/index.ts index a423f3acdd..4479f0a251 100644 --- a/plugins/calendar-resources/src/index.ts +++ b/plugins/calendar-resources/src/index.ts @@ -21,7 +21,7 @@ import SaveEventReminder from './components/SaveEventReminder.svelte' import DateTimePresenter from './components/DateTimePresenter.svelte' import DocReminder from './components/DocReminder.svelte' import PersonsPresenter from './components/PersonsPresenter.svelte' -import UpcomingEvents from './components/UpcomingEvents.svelte' +import Events from './components/Events.svelte' import ReminderPresenter from './components/ReminderPresenter.svelte' import ReminderViewlet from './components/activity/ReminderViewlet.svelte' import EditEvent from './components/EditEvent.svelte' @@ -37,7 +37,7 @@ export default async (): Promise => ({ ReminderPresenter, PersonsPresenter, CalendarView, - UpcomingEvents, + Events, DateTimePresenter, DocReminder, RemindersPopup diff --git a/plugins/calendar-resources/src/plugin.ts b/plugins/calendar-resources/src/plugin.ts index 518334ffb5..3e9b539980 100644 --- a/plugins/calendar-resources/src/plugin.ts +++ b/plugins/calendar-resources/src/plugin.ts @@ -33,7 +33,6 @@ export default mergeIds(calendarId, calendar, { ModeMonth: '' as IntlString, ModeYear: '' as IntlString, Today: '' as IntlString, - UpcomingEvents: '' as IntlString, TableView: '' as IntlString, DueMinutes: '' as IntlString, DueHours: '' as IntlString, diff --git a/plugins/calendar/src/index.ts b/plugins/calendar/src/index.ts index 4fd1c94b3f..bd8326ebe8 100644 --- a/plugins/calendar/src/index.ts +++ b/plugins/calendar/src/index.ts @@ -82,7 +82,7 @@ const calendarPlugin = plugin(calendarId, { }, component: { PersonsPresenter: '' as AnyComponent, - UpcomingEvents: '' as AnyComponent, + Events: '' as AnyComponent, DateTimePresenter: '' as AnyComponent, DocReminder: '' as AnyComponent, RemindersPopup: '' as AnyComponent diff --git a/plugins/contact-resources/src/components/Contacts.svelte b/plugins/contact-resources/src/components/Contacts.svelte index 568d6a9247..8533ec16c0 100644 --- a/plugins/contact-resources/src/components/Contacts.svelte +++ b/plugins/contact-resources/src/components/Contacts.svelte @@ -16,7 +16,7 @@ - - { - dispatch('close') - }} -> - - diff --git a/plugins/recruit-resources/src/components/review/EditReviewCategory.svelte b/plugins/recruit-resources/src/components/review/EditReviewCategory.svelte deleted file mode 100644 index 380e60fe11..0000000000 --- a/plugins/recruit-resources/src/components/review/EditReviewCategory.svelte +++ /dev/null @@ -1,264 +0,0 @@ - - - -
{ - dispatch('close') - }} -/> -
- {#if object} -
-
-
-
- {#if clazz.icon}{/if} -
-
- {object.name} -
-
-
{object.description}
-
-
{ - dispatch('close') - }} - > - -
-
-
- -
-
- {#each tabs as tab, i} -
{ - selected = i - }} - > -
- {/each} -
-
-
-
- {#if selected === 0} - - { - onChange('name', object.name) - }} - /> - { - onChange('description', object.description) - }} - /> - -
- Description -
- { - onChange('fullDescription', object.fullDescription) - }} - /> -
-
-
- -
- {:else if selected === 1} - - {:else if selected === 2} - - {/if} -
-
- {/if} -
- - diff --git a/plugins/recruit-resources/src/components/review/ReviewCategoryCard.svelte b/plugins/recruit-resources/src/components/review/ReviewCategoryCard.svelte deleted file mode 100644 index af48e95ea5..0000000000 --- a/plugins/recruit-resources/src/components/review/ReviewCategoryCard.svelte +++ /dev/null @@ -1,78 +0,0 @@ - - - -
-
Review category
- - {#if category} -
{ - closeTooltip() - closePopup() - closePanel() - const loc = getCurrentLocation() - loc.path[2] = category._id - loc.path.length = 3 - navigate(loc) - }} - > - {category.name} -
-
{category.description ?? ''}
- {/if} -
- - diff --git a/plugins/recruit-resources/src/components/review/ReviewCategoryPresenter.svelte b/plugins/recruit-resources/src/components/review/ReviewCategoryPresenter.svelte deleted file mode 100644 index 32709c6395..0000000000 --- a/plugins/recruit-resources/src/components/review/ReviewCategoryPresenter.svelte +++ /dev/null @@ -1,37 +0,0 @@ - - - -{#if value} -
-
- -
- {value.name} -
-{/if} diff --git a/plugins/recruit-resources/src/index.ts b/plugins/recruit-resources/src/index.ts index 0cd38c1520..1cbce6c050 100644 --- a/plugins/recruit-resources/src/index.ts +++ b/plugins/recruit-resources/src/index.ts @@ -33,13 +33,10 @@ import EditVacancy from './components/EditVacancy.svelte' import KanbanCard from './components/KanbanCard.svelte' import CreateOpinion from './components/review/CreateOpinion.svelte' import CreateReview from './components/review/CreateReview.svelte' -import CreateReviewCategory from './components/review/CreateReviewCategory.svelte' import EditReview from './components/review/EditReview.svelte' -import EditReviewCategory from './components/review/EditReviewCategory.svelte' import OpinionPresenter from './components/review/OpinionPresenter.svelte' import Opinions from './components/review/Opinions.svelte' import OpinionsPresenter from './components/review/OpinionsPresenter.svelte' -import ReviewCategoryPresenter from './components/review/ReviewCategoryPresenter.svelte' import ReviewPresenter from './components/review/ReviewPresenter.svelte' import Reviews from './components/review/Reviews.svelte' import SkillsView from './components/SkillsView.svelte' @@ -152,8 +149,6 @@ export default async (): Promise => ({ VacancyCountPresenter, VacancyModifiedPresenter, - CreateReviewCategory, - EditReviewCategory, CreateReview, ReviewPresenter, EditReview, @@ -161,7 +156,6 @@ export default async (): Promise => ({ Opinions, OpinionPresenter, OpinionsPresenter, - ReviewCategoryPresenter, ApplicationsView, NewCandidateHeader diff --git a/plugins/recruit/src/index.ts b/plugins/recruit/src/index.ts index 90ae3fef5f..beebd960b3 100644 --- a/plugins/recruit/src/index.ts +++ b/plugins/recruit/src/index.ts @@ -133,7 +133,7 @@ const recruit = plugin(recruitId, { }, space: { VacancyTemplates: '' as Ref, - ReviewTemplates: '' as Ref + Reviews: '' as Ref } }) diff --git a/plugins/tags-resources/src/components/TagsView.svelte b/plugins/tags-resources/src/components/TagsView.svelte index 032ffa1775..529bc7500e 100644 --- a/plugins/tags-resources/src/components/TagsView.svelte +++ b/plugins/tags-resources/src/components/TagsView.svelte @@ -17,7 +17,7 @@ import { IntlString, translate } from '@anticrm/platform' import { createQuery } from '@anticrm/presentation' import { TagCategory, TagElement } from '@anticrm/tags' - import { Button, Icon, Label, Scroller, SearchEdit, showPopup, IconAdd } from '@anticrm/ui' + import { Button, Icon, IconAdd, Label, SearchEdit, showPopup } from '@anticrm/ui' import { TableBrowser } from '@anticrm/view-resources' import tags from '../plugin' import CategoryBar from './CategoryBar.svelte' @@ -108,40 +108,38 @@ updateResultQuery(search, category) }} /> - - - + diff --git a/plugins/task-resources/src/components/AssignedTasks.svelte b/plugins/task-resources/src/components/AssignedTasks.svelte index 5258db760a..602163024f 100644 --- a/plugins/task-resources/src/components/AssignedTasks.svelte +++ b/plugins/task-resources/src/components/AssignedTasks.svelte @@ -20,7 +20,7 @@ import { createQuery, getClient } from '@anticrm/presentation' import tags, { selectedTagElements, TagCategory, TagElement } from '@anticrm/tags' import { DoneState, Task } from '@anticrm/task' - import { Component, Icon, Label, Scroller, SearchEdit } from '@anticrm/ui' + import { Component, Icon, Label, SearchEdit } from '@anticrm/ui' import { TableBrowser } from '@anticrm/view-resources' import task from '../plugin' @@ -99,31 +99,29 @@ on:change={(evt) => updateCategory(evt.detail)} /> - - - + diff --git a/plugins/task-resources/src/components/StatusTableView.svelte b/plugins/task-resources/src/components/StatusTableView.svelte index 6d686b2554..e4fc3e4a63 100644 --- a/plugins/task-resources/src/components/StatusTableView.svelte +++ b/plugins/task-resources/src/components/StatusTableView.svelte @@ -17,13 +17,12 @@ import { Class, DocumentQuery, FindOptions, Ref, SortingOrder } from '@anticrm/core' import { createQuery } from '@anticrm/presentation' import { DoneState, SpaceWithStates, State, Task } from '@anticrm/task' - import { ScrollBox } from '@anticrm/ui' import Label from '@anticrm/ui/src/components/Label.svelte' import { TableBrowser } from '@anticrm/view-resources' + import task from '../plugin' import Lost from './icons/Lost.svelte' import Won from './icons/Won.svelte' import StatesBar from './state/StatesBar.svelte' - import task from '../plugin' export let _class: Ref> export let space: Ref @@ -176,9 +175,7 @@
- - - +