diff --git a/dev/generator/src/recruit.ts b/dev/generator/src/recruit.ts index a7930bf276..4aff1560c2 100644 --- a/dev/generator/src/recruit.ts +++ b/dev/generator/src/recruit.ts @@ -86,7 +86,6 @@ async function genVacansyApplicants ( description: faker.lorem.sentences(2), fullDescription: faker.lorem.sentences(10), location: faker.address.city(), - company: faker.company.companyName(), members: accountIds, private: false, archived: false diff --git a/dev/tool/src/importer.ts b/dev/tool/src/importer.ts index b3d7930757..43f3d32ec1 100644 --- a/dev/tool/src/importer.ts +++ b/dev/tool/src/importer.ts @@ -237,7 +237,6 @@ async function createUpdateVacancy (client: TxOperations, statuses: any): Promis description: '', fullDescription: '', location: '', - company: '', members: [], archived: false, private: false diff --git a/models/contact/src/index.ts b/models/contact/src/index.ts index 0374058147..f59a7b6ea3 100644 --- a/models/contact/src/index.ts +++ b/models/contact/src/index.ts @@ -165,6 +165,10 @@ export function createModel (builder: Builder): void { editor: contact.component.EditOrganization }) + builder.mixin(contact.class.Organization, core.class.Class, view.mixin.AttributeEditor, { + editor: contact.component.OrganizationEditor + }) + builder.mixin(contact.class.Channel, core.class.Class, view.mixin.AttributePresenter, { presenter: contact.component.ChannelsPresenter }) diff --git a/models/contact/src/plugin.ts b/models/contact/src/plugin.ts index 6a2448378f..90b5a09b97 100644 --- a/models/contact/src/plugin.ts +++ b/models/contact/src/plugin.ts @@ -34,7 +34,8 @@ export default mergeIds(contactId, contact, { CreateOrganizations: '' as AnyComponent, OrganizationPresenter: '' as AnyComponent, Contacts: '' as AnyComponent, - EmployeeAccountPresenter: '' as AnyComponent + EmployeeAccountPresenter: '' as AnyComponent, + OrganizationEditor: '' as AnyComponent }, string: { Persons: '' as IntlString, @@ -47,7 +48,6 @@ export default mergeIds(contactId, contact, { Channel: '' as IntlString, ChannelProvider: '' as IntlString, Person: '' as IntlString, - Organization: '' as IntlString, Employee: '' as IntlString, Value: '' as IntlString, Phone: '' as IntlString, diff --git a/models/recruit/src/index.ts b/models/recruit/src/index.ts index 78b7ee5faf..771590b13c 100644 --- a/models/recruit/src/index.ts +++ b/models/recruit/src/index.ts @@ -13,7 +13,7 @@ // limitations under the License. // -import type { Employee } from '@anticrm/contact' +import type { Employee, Organization } from '@anticrm/contact' import { Doc, FindOptions, IndexKind, Lookup, Ref, Timestamp } from '@anticrm/core' import { Builder, @@ -60,9 +60,8 @@ export class TVacancy extends TSpaceWithStates implements Vacancy { @Index(IndexKind.FullText) location?: string - @Prop(TypeString(), recruit.string.Company, contact.icon.Company) - @Index(IndexKind.FullText) - company?: string + @Prop(TypeRef(contact.class.Organization), recruit.string.Company, contact.icon.Company) + company?: Ref @Prop(Collection(chunter.class.Comment), chunter.string.Comments) comments?: number diff --git a/models/recruit/src/review-model.ts b/models/recruit/src/review-model.ts index 71c7c8d14c..13d77c7bc2 100644 --- a/models/recruit/src/review-model.ts +++ b/models/recruit/src/review-model.ts @@ -1,4 +1,4 @@ -import { Employee } from '@anticrm/contact' +import { Employee, Organization } from '@anticrm/contact' import { Domain, IndexKind, Ref, Timestamp } from '@anticrm/core' import { Collection, Index, Model, Prop, TypeDate, TypeMarkup, TypeRef, TypeString, UX } from '@anticrm/model' import attachment from '@anticrm/model-attachment' @@ -14,6 +14,9 @@ import recruit from './plugin' export class TReviewCategory extends TSpaceWithStates implements ReviewCategory { @Prop(TypeString(), recruit.string.FullDescription) fullDescription?: string + + @Prop(TypeRef(contact.class.Organization), recruit.string.Company, contact.icon.Company) + company?: Ref } @Model(recruit.class.Review, task.class.Task) diff --git a/packages/ui/img/google.svg b/packages/ui/img/google.svg deleted file mode 100644 index d165497322..0000000000 --- a/packages/ui/img/google.svg +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - diff --git a/packages/ui/img/tesla.svg b/packages/ui/img/tesla.svg deleted file mode 100644 index 6eac18dd43..0000000000 --- a/packages/ui/img/tesla.svg +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/packages/ui/src/components/Dropdown.svelte b/packages/ui/src/components/Dropdown.svelte index a62b81115b..27f041232c 100644 --- a/packages/ui/src/components/Dropdown.svelte +++ b/packages/ui/src/components/Dropdown.svelte @@ -24,13 +24,10 @@ import DropdownPopup from './DropdownPopup.svelte' import Add from './icons/Add.svelte' - import tesla from '../../img/tesla.svg' - import google from '../../img/google.svg' - export let icon: Asset | AnySvelteComponent = Add export let label: IntlString - export let placeholder: string - export let items: ListItem[] = [{ item: tesla, label: 'Tesla' }, { item: google, label: 'Google' }] + export let placeholder: IntlString + export let items: ListItem[] = [] export let selected: ListItem | undefined = undefined export let show: boolean = false @@ -51,7 +48,7 @@ btn.focus() if (!opened) { opened = true - showPopup(DropdownPopup, { title: label, items }, container, (result) => { + showPopup(DropdownPopup, { title: label, items, icon }, container, (result) => { if (result) selected = result opened = false }) @@ -59,8 +56,8 @@ }} >
container.click()}> - {#if selected} - {selected.label} + {#if selected && selected.image} + {selected.label} {:else} {#if typeof (icon) === 'string'} @@ -73,7 +70,7 @@
- {#if selected}{selected.label}{:else}{placeholder}{/if} + {#if selected}{selected.label}{:else}
diff --git a/packages/ui/src/components/DropdownPopup.svelte b/packages/ui/src/components/DropdownPopup.svelte index a279b7e3c0..7cd6e224b7 100644 --- a/packages/ui/src/components/DropdownPopup.svelte +++ b/packages/ui/src/components/DropdownPopup.svelte @@ -13,16 +13,18 @@ // limitations under the License. --> + +
{ + if (!opened) { + opened = true + showPopup(DropdownPopup, { title: label, items, icon }, container, (result) => { + if (result) setValue(result) + opened = false + }) + } +}}> + {#if selected}{selected.label}{:else}
+ + diff --git a/plugins/contact-resources/src/components/OrganizationSelector.svelte b/plugins/contact-resources/src/components/OrganizationSelector.svelte new file mode 100644 index 0000000000..f5e9d2d9e0 --- /dev/null +++ b/plugins/contact-resources/src/components/OrganizationSelector.svelte @@ -0,0 +1,58 @@ + + + + + \ No newline at end of file diff --git a/plugins/contact-resources/src/index.ts b/plugins/contact-resources/src/index.ts index 5d19c2c90b..5d396c7d94 100644 --- a/plugins/contact-resources/src/index.ts +++ b/plugins/contact-resources/src/index.ts @@ -35,8 +35,10 @@ import PersonPresenter from './components/PersonPresenter.svelte' import SocialEditor from './components/SocialEditor.svelte' import contact from './plugin' import EmployeeAccountPresenter from './components/EmployeeAccountPresenter.svelte' +import OrganizationEditor from './components/OrganizationEditor.svelte' +import OrganizationSelector from './components/OrganizationSelector.svelte' -export { Channels, ChannelsEditor, ContactPresenter, ChannelsView } +export { Channels, ChannelsEditor, ContactPresenter, ChannelsView, OrganizationSelector } async function queryContact (_class: Ref>, client: Client, search: string): Promise { return (await client.findAll(_class, { name: { $like: `%${search}%` } }, { limit: 200 })).map(e => ({ @@ -51,6 +53,7 @@ async function queryContact (_class: Ref>, client: Client, search export default async (): Promise => ({ component: { + OrganizationEditor, ContactPresenter, PersonPresenter, OrganizationPresenter, diff --git a/plugins/contact-resources/src/plugin.ts b/plugins/contact-resources/src/plugin.ts index f61bf6b776..39e2611e76 100644 --- a/plugins/contact-resources/src/plugin.ts +++ b/plugins/contact-resources/src/plugin.ts @@ -32,6 +32,7 @@ export default mergeIds(contactId, contact, { PersonsNamePlaceholder: '' as IntlString, CreateOrganizations: '' as IntlString, Organizations: '' as IntlString, + Organization: '' as IntlString, SelectFolder: '' as IntlString, OrganizationsFolder: '' as IntlString, PersonsFolder: '' as IntlString, diff --git a/plugins/recruit-resources/src/components/CreateVacancy.svelte b/plugins/recruit-resources/src/components/CreateVacancy.svelte index 9d742bbd12..1df885efa1 100644 --- a/plugins/recruit-resources/src/components/CreateVacancy.svelte +++ b/plugins/recruit-resources/src/components/CreateVacancy.svelte @@ -14,13 +14,14 @@ -->