diff --git a/models/chunter/src/index.ts b/models/chunter/src/index.ts index a1e046103c..cb921fae42 100644 --- a/models/chunter/src/index.ts +++ b/models/chunter/src/index.ts @@ -19,7 +19,6 @@ import type { Ref, Doc, Class, Domain } from '@anticrm/core' import { IndexKind } from '@anticrm/core' import core, { TSpace, TDoc, TAttachedDoc } from '@anticrm/model-core' import type { Backlink, Channel, Message, Comment } from '@anticrm/chunter' -import type { AnyComponent } from '@anticrm/ui' import activity from '@anticrm/activity' import workbench from '@anticrm/model-workbench' @@ -72,7 +71,6 @@ export function createModel (builder: Builder): void { builder.createDoc(view.class.Viewlet, core.space.Model, { attachTo: chunter.class.Message, descriptor: chunter.viewlet.Chat, - open: 'X' as AnyComponent, config: {} }) diff --git a/models/contact/src/index.ts b/models/contact/src/index.ts index a641ec9f7e..4b58a48fd4 100644 --- a/models/contact/src/index.ts +++ b/models/contact/src/index.ts @@ -78,8 +78,7 @@ export class TContact extends TDoc implements Contact { @Model(contact.class.Person, contact.class.Contact) @UX('Person' as IntlString, contact.icon.Person, undefined, 'name') -export class TPerson extends TContact implements Person { -} +export class TPerson extends TContact implements Person {} @Model(contact.class.Organization, contact.class.Contact) @UX('Organization' as IntlString, contact.icon.Company, undefined, 'name') @@ -124,17 +123,21 @@ export function createModel (builder: Builder): void { component: contact.component.CreateOrganization }) - builder.createDoc(workbench.class.Application, core.space.Model, { - label: contact.string.Contacts, - icon: contact.icon.Person, - hidden: false, - component: contact.component.Contacts - }, contact.app.Contacts) + builder.createDoc( + workbench.class.Application, + core.space.Model, + { + label: contact.string.Contacts, + icon: contact.icon.Person, + hidden: false, + component: contact.component.Contacts + }, + contact.app.Contacts + ) builder.createDoc(view.class.Viewlet, core.space.Model, { attachTo: contact.class.Contact, descriptor: view.viewlet.Table, - open: contact.component.EditContact, // eslint-disable-next-line @typescript-eslint/consistent-type-assertions options: {}, config: [ @@ -142,7 +145,7 @@ export function createModel (builder: Builder): void { 'city', { presenter: attachment.component.AttachmentsPresenter, label: 'Files', sortingKey: 'attachments' }, 'modifiedOn', - { presenter: contact.component.RolePresenter, label: 'Role' }, + { presenter: view.component.RolePresenter, label: 'Role' }, 'channels' ] }) diff --git a/models/contact/src/plugin.ts b/models/contact/src/plugin.ts index 0ef9bf59e2..a6ded5844b 100644 --- a/models/contact/src/plugin.ts +++ b/models/contact/src/plugin.ts @@ -31,14 +31,12 @@ export const ids = mergeIds(contactId, contact, { ChannelsPresenter: '' as AnyComponent, CreatePerson: '' as AnyComponent, EditPerson: '' as AnyComponent, - EditContact: '' as AnyComponent, EditOrganization: '' as AnyComponent, CreateOrganization: '' as AnyComponent, CreatePersons: '' as AnyComponent, CreateOrganizations: '' as AnyComponent, OrganizationPresenter: '' as AnyComponent, - Contacts: '' as AnyComponent, - RolePresenter: '' as AnyComponent + Contacts: '' as AnyComponent }, string: { Organizations: '' as IntlString, diff --git a/models/inventory/src/index.ts b/models/inventory/src/index.ts index d0d0175e96..77bda21d07 100644 --- a/models/inventory/src/index.ts +++ b/models/inventory/src/index.ts @@ -87,10 +87,13 @@ export function createModel (builder: Builder): void { editor: inventory.component.Variants }) + builder.mixin(inventory.class.Product, core.class.Class, view.mixin.ObjectEditor, { + editor: inventory.component.EditProduct + }) + builder.createDoc(view.class.Viewlet, core.space.Model, { attachTo: inventory.class.Product, descriptor: view.viewlet.Table, - open: inventory.component.EditProduct, // eslint-disable-next-line @typescript-eslint/consistent-type-assertions options: { lookup: { diff --git a/models/lead/src/index.ts b/models/lead/src/index.ts index 26c435854a..e404b803ea 100644 --- a/models/lead/src/index.ts +++ b/models/lead/src/index.ts @@ -27,7 +27,7 @@ import task, { TSpaceWithStates, TTask } from '@anticrm/model-task' import view from '@anticrm/model-view' import workbench from '@anticrm/model-workbench' import type { IntlString } from '@anticrm/platform' -import type { } from '@anticrm/view' +import type {} from '@anticrm/view' import lead from './plugin' @Model(lead.class.Funnel, task.class.SpaceWithStates) @@ -118,7 +118,6 @@ export function createModel (builder: Builder): void { builder.createDoc(view.class.Viewlet, core.space.Model, { attachTo: lead.class.Lead, descriptor: view.viewlet.Table, - open: contact.component.EditContact, // eslint-disable-next-line @typescript-eslint/consistent-type-assertions options: { lookup: { @@ -140,7 +139,6 @@ export function createModel (builder: Builder): void { builder.createDoc(view.class.Viewlet, core.space.Model, { attachTo: lead.class.Lead, descriptor: task.viewlet.Kanban, - open: contact.component.EditContact, // eslint-disable-next-line @typescript-eslint/consistent-type-assertions options: { lookup: { diff --git a/models/recruit/src/index.ts b/models/recruit/src/index.ts index 96d978e1af..631bacbdb5 100644 --- a/models/recruit/src/index.ts +++ b/models/recruit/src/index.ts @@ -150,7 +150,6 @@ export function createModel (builder: Builder): void { builder.createDoc(view.class.Viewlet, core.space.Model, { attachTo: recruit.mixin.Candidate, descriptor: view.viewlet.Table, - open: contact.component.EditContact, // eslint-disable-next-line @typescript-eslint/consistent-type-assertions options: { // lookup: { @@ -172,7 +171,6 @@ export function createModel (builder: Builder): void { builder.createDoc(view.class.Viewlet, core.space.Model, { attachTo: recruit.class.Applicant, descriptor: view.viewlet.Table, - open: contact.component.EditContact, // eslint-disable-next-line @typescript-eslint/consistent-type-assertions options: { lookup: { @@ -198,7 +196,6 @@ export function createModel (builder: Builder): void { builder.createDoc(view.class.Viewlet, core.space.Model, { attachTo: recruit.class.Applicant, descriptor: task.viewlet.Kanban, - open: contact.component.EditContact, // eslint-disable-next-line @typescript-eslint/consistent-type-assertions options: { lookup: { @@ -212,7 +209,6 @@ export function createModel (builder: Builder): void { builder.createDoc(view.class.Viewlet, core.space.Model, { attachTo: recruit.class.Applicant, descriptor: task.viewlet.StatusTable, - open: contact.component.EditContact, // eslint-disable-next-line @typescript-eslint/consistent-type-assertions options: { lookup: { diff --git a/models/task/src/index.ts b/models/task/src/index.ts index c560000a70..e3202cf69c 100644 --- a/models/task/src/index.ts +++ b/models/task/src/index.ts @@ -20,7 +20,20 @@ import attachment from '@anticrm/model-attachment' import type { Employee } from '@anticrm/contact' import contact from '@anticrm/contact' import { Arr, Class, Doc, Domain, DOMAIN_MODEL, FindOptions, Ref, Space, Timestamp } from '@anticrm/core' -import { Builder, Collection, Implements, Mixin, Model, Prop, Hidden, TypeBoolean, TypeDate, TypeRef, TypeString, UX } from '@anticrm/model' +import { + Builder, + Collection, + Implements, + Mixin, + Model, + Prop, + Hidden, + TypeBoolean, + TypeDate, + TypeRef, + TypeString, + UX +} from '@anticrm/model' import chunter from '@anticrm/model-chunter' import core, { TAttachedDoc, TClass, TDoc, TSpace } from '@anticrm/model-core' import view from '@anticrm/model-view' @@ -281,7 +294,6 @@ export function createModel (builder: Builder): void { builder.createDoc(view.class.Viewlet, core.space.Model, { attachTo: task.class.Issue, descriptor: view.viewlet.Table, - open: task.component.EditTask, // eslint-disable-next-line @typescript-eslint/consistent-type-assertions options: { lookup: { @@ -306,10 +318,13 @@ export function createModel (builder: Builder): void { editor: task.component.EditIssue }) + builder.mixin(task.class.Task, core.class.Class, view.mixin.ObjectEditorHeader, { + editor: task.component.TaskHeader + }) + builder.createDoc(view.class.Viewlet, core.space.Model, { attachTo: task.class.Issue, descriptor: task.viewlet.Kanban, - open: task.component.EditTask, // eslint-disable-next-line @typescript-eslint/consistent-type-assertions options: { lookup: { diff --git a/models/task/src/plugin.ts b/models/task/src/plugin.ts index 9708ac9d4c..11cd9e4578 100644 --- a/models/task/src/plugin.ts +++ b/models/task/src/plugin.ts @@ -46,7 +46,6 @@ export default mergeIds(taskId, task, { ProjectView: '' as AnyComponent, CreateProject: '' as AnyComponent, CreateTask: '' as AnyComponent, - EditTask: '' as AnyComponent, EditIssue: '' as AnyComponent, TaskPresenter: '' as AnyComponent, KanbanCard: '' as AnyComponent, @@ -57,7 +56,8 @@ export default mergeIds(taskId, task, { KanbanView: '' as AnyComponent, Todos: '' as AnyComponent, TodoItemPresenter: '' as AnyComponent, - StatusTableView: '' as AnyComponent + StatusTableView: '' as AnyComponent, + TaskHeader: '' as AnyComponent }, string: { Task: '' as IntlString, diff --git a/models/view/src/index.ts b/models/view/src/index.ts index f694d5f941..6530985b1c 100644 --- a/models/view/src/index.ts +++ b/models/view/src/index.ts @@ -19,7 +19,18 @@ import { Builder, Mixin, Model } from '@anticrm/model' import core, { TClass, TDoc } from '@anticrm/model-core' import type { Asset, IntlString, Resource, Status } from '@anticrm/platform' import type { AnyComponent } from '@anticrm/ui' -import type { Action, ActionTarget, AttributeEditor, AttributePresenter, ObjectEditor, ObjectFactory, ObjectValidator, Viewlet, ViewletDescriptor } from '@anticrm/view' +import type { + Action, + ActionTarget, + AttributeEditor, + AttributePresenter, + ObjectEditor, + ObjectEditorHeader, + ObjectFactory, + ObjectValidator, + Viewlet, + ViewletDescriptor +} from '@anticrm/view' import view from './plugin' @Mixin(view.mixin.AttributeEditor, core.class.Class) @@ -37,9 +48,14 @@ export class TObjectEditor extends TClass implements ObjectEditor { editor!: AnyComponent } +@Mixin(view.mixin.ObjectEditorHeader, core.class.Class) +export class TObjectEditorHeader extends TClass implements ObjectEditorHeader { + editor!: AnyComponent +} + @Mixin(view.mixin.ObjectValidator, core.class.Class) export class TObjectValidator extends TClass implements ObjectValidator { - validator!: Resource<((doc: T, client: Client) => Promise>)> + validator!: Resource<(doc: T, client: Client) => Promise>> } @Mixin(view.mixin.ObjectFactory, core.class.Class) @@ -75,7 +91,18 @@ export class TActionTarget extends TDoc implements ActionTarget { } export function createModel (builder: Builder): void { - builder.createModel(TAttributeEditor, TAttributePresenter, TObjectEditor, TViewletDescriptor, TViewlet, TAction, TActionTarget, TObjectValidator, TObjectFactory) + builder.createModel( + TAttributeEditor, + TAttributePresenter, + TObjectEditor, + TViewletDescriptor, + TViewlet, + TAction, + TActionTarget, + TObjectValidator, + TObjectFactory, + TObjectEditorHeader + ) builder.mixin(core.class.TypeString, core.class.Class, view.mixin.AttributeEditor, { editor: view.component.StringEditor @@ -105,28 +132,43 @@ export function createModel (builder: Builder): void { editor: view.component.DateEditor }) - builder.createDoc(view.class.ViewletDescriptor, core.space.Model, { - label: 'Table' as IntlString, - icon: view.icon.Table, - component: view.component.TableView - }, view.viewlet.Table) + builder.createDoc( + view.class.ViewletDescriptor, + core.space.Model, + { + label: 'Table' as IntlString, + icon: view.icon.Table, + component: view.component.TableView + }, + view.viewlet.Table + ) - builder.createDoc(view.class.Action, core.space.Model, { - label: 'Delete' as IntlString, - icon: view.icon.Delete, - action: view.actionImpl.Delete - }, view.action.Delete) + builder.createDoc( + view.class.Action, + core.space.Model, + { + label: 'Delete' as IntlString, + icon: view.icon.Delete, + action: view.actionImpl.Delete + }, + view.action.Delete + ) builder.createDoc(view.class.ActionTarget, core.space.Model, { target: core.class.Doc, action: view.action.Delete }) - builder.createDoc(view.class.Action, core.space.Model, { - label: 'Move' as IntlString, - icon: view.icon.Move, - action: view.actionImpl.Move - }, view.action.Move) + builder.createDoc( + view.class.Action, + core.space.Model, + { + label: 'Move' as IntlString, + icon: view.icon.Move, + action: view.actionImpl.Move + }, + view.action.Move + ) builder.createDoc(view.class.ActionTarget, core.space.Model, { target: core.class.Doc, diff --git a/models/view/src/plugin.ts b/models/view/src/plugin.ts index 8bfdca16b1..d8c7de3d60 100644 --- a/models/view/src/plugin.ts +++ b/models/view/src/plugin.ts @@ -36,6 +36,7 @@ export default mergeIds(viewId, view, { TimestampPresenter: '' as AnyComponent, DateEditor: '' as AnyComponent, DatePresenter: '' as AnyComponent, - TableView: '' as AnyComponent + TableView: '' as AnyComponent, + RolePresenter: '' as AnyComponent } }) diff --git a/plugins/contact-resources/src/components/EditContact.svelte b/plugins/contact-resources/src/components/EditContact.svelte deleted file mode 100644 index 66bb69002d..0000000000 --- a/plugins/contact-resources/src/components/EditContact.svelte +++ /dev/null @@ -1,247 +0,0 @@ - - - -{#if object !== undefined} - { - dispatch('close') - }} - > -
- {#if keys} - - {/if} -
-
- {#await getEditorOrDefault(selectedClass, object._class) then is} - { - updateKeys(ev.detail.ignoreKeys) - }} - on:click={(ev) => { - fullSize = true - rightSection = ev.detail.presenter - }} - /> - {/await} -
- {#if mixins.length > 0} -
-
{ selectedClass = objectClass._id; selectedMixin = undefined }}> -
- {#each mixins as mixin} -
{ selectedClass = mixin._id; selectedMixin = mixin }}> -
- {/each} -
- {/if} - {#each collectionKeys as collection} -
- {#await getCollectionEditor(collection) then is} - - {/await} -
- {/each} -
-{/if} - - diff --git a/plugins/contact-resources/src/components/OrganizationPresenter.svelte b/plugins/contact-resources/src/components/OrganizationPresenter.svelte index 6f85a59133..03b3250121 100644 --- a/plugins/contact-resources/src/components/OrganizationPresenter.svelte +++ b/plugins/contact-resources/src/components/OrganizationPresenter.svelte @@ -14,15 +14,15 @@ // limitations under the License. --> diff --git a/plugins/contact-resources/src/components/PersonPresenter.svelte b/plugins/contact-resources/src/components/PersonPresenter.svelte index 28d9b9d72e..f7197dd39f 100644 --- a/plugins/contact-resources/src/components/PersonPresenter.svelte +++ b/plugins/contact-resources/src/components/PersonPresenter.svelte @@ -17,12 +17,12 @@ import { formatName, Person } from '@anticrm/contact' import { Avatar } from '@anticrm/presentation' import { showPopup } from '@anticrm/ui' - import EditContact from './EditContact.svelte' + import { EditDoc } from '@anticrm/view-resources' export let value: Person async function onClick () { - showPopup(EditContact, { _id: value._id }, 'full') + showPopup(EditDoc, { _id: value._id, _class: value._class }, 'full') } diff --git a/plugins/contact-resources/src/index.ts b/plugins/contact-resources/src/index.ts index 79ade36792..b3d47d4cdf 100644 --- a/plugins/contact-resources/src/index.ts +++ b/plugins/contact-resources/src/index.ts @@ -20,7 +20,6 @@ import OrganizationPresenter from './components/OrganizationPresenter.svelte' import ChannelsPresenter from './components/ChannelsPresenter.svelte' import CreatePerson from './components/CreatePerson.svelte' import CreateOrganization from './components/CreateOrganization.svelte' -import EditContact from './components/EditContact.svelte' import EditPerson from './components/EditPerson.svelte' import EditOrganization from './components/EditOrganization.svelte' import CreatePersons from './components/CreatePersons.svelte' @@ -28,9 +27,8 @@ import CreateOrganizations from './components/CreateOrganizations.svelte' import SocialEditor from './components/SocialEditor.svelte' import Contacts from './components/Contacts.svelte' import { Resources } from '@anticrm/platform' -import RolePresenter from './components/RolePresenter.svelte' -export { ContactPresenter, EditContact } +export { ContactPresenter } export default async (): Promise => ({ component: { @@ -45,7 +43,6 @@ export default async (): Promise => ({ CreatePersons, CreateOrganizations, SocialEditor, - Contacts, - RolePresenter + Contacts } }) diff --git a/plugins/contact-resources/src/utils.ts b/plugins/contact-resources/src/utils.ts deleted file mode 100644 index 64dcc728b4..0000000000 --- a/plugins/contact-resources/src/utils.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Class, Doc, Ref } from '@anticrm/core' -import { getPlatformColorForText } from '@anticrm/ui' - -export function getMixinStyle (id: Ref>, selected: boolean): string { - const color = getPlatformColorForText(id as string) - return ` - background: ${color + (selected ? 'ff' : '33')}; - border: 1px solid ${color + (selected ? '0f' : '66')}; - ` -} diff --git a/plugins/inventory-resources/src/components/EditProduct.svelte b/plugins/inventory-resources/src/components/EditProduct.svelte index 125f5879df..e991db715c 100644 --- a/plugins/inventory-resources/src/components/EditProduct.svelte +++ b/plugins/inventory-resources/src/components/EditProduct.svelte @@ -14,139 +14,11 @@ // limitations under the License. --> - -{#if object !== undefined} - { - dispatch('close') - }} - > -
- {#if keys} - - {/if} -
- {#each collectionKeys as collection} -
- {#await getCollectionEditor(collection) then is} - - {/await} -
- {/each} -
-{/if} - - diff --git a/plugins/inventory-resources/src/components/ProductPresenter.svelte b/plugins/inventory-resources/src/components/ProductPresenter.svelte index e1fcead631..adf27826b3 100644 --- a/plugins/inventory-resources/src/components/ProductPresenter.svelte +++ b/plugins/inventory-resources/src/components/ProductPresenter.svelte @@ -16,14 +16,14 @@ diff --git a/plugins/lead-resources/src/components/EditLead.svelte b/plugins/lead-resources/src/components/EditLead.svelte index 0670ab8d69..58c62ef442 100644 --- a/plugins/lead-resources/src/components/EditLead.svelte +++ b/plugins/lead-resources/src/components/EditLead.svelte @@ -50,9 +50,9 @@ _class={contact.class.Contact} title={lead.string.Customer} caption={lead.string.SelectCustomer} - bind:value={object.customer} + bind:value={object.attachedTo} on:change={() => { - change('customer', object.customer) + change('attachedTo', object.attachedTo) }} /> diff --git a/plugins/lead-resources/src/components/KanbanCard.svelte b/plugins/lead-resources/src/components/KanbanCard.svelte index dde7c51960..03bcc948b7 100644 --- a/plugins/lead-resources/src/components/KanbanCard.svelte +++ b/plugins/lead-resources/src/components/KanbanCard.svelte @@ -20,9 +20,8 @@ import type { WithLookup } from '@anticrm/core' import type { Lead } from '@anticrm/lead' import { ActionIcon, IconMoreH, showPopup } from '@anticrm/ui' - import { ContextMenu } from '@anticrm/view-resources' + import { ContextMenu, EditDoc } from '@anticrm/view-resources' import lead from '../plugin' - import { EditTask } from '@anticrm/task-resources' export let object: WithLookup export let draggable: boolean @@ -32,7 +31,7 @@ } function showLead () { - showPopup(EditTask, { _id: object._id }, 'full') + showPopup(EditDoc, { _id: object._id, _class: object._class }, 'full') } diff --git a/plugins/lead-resources/src/components/LeadPresenter.svelte b/plugins/lead-resources/src/components/LeadPresenter.svelte index 927e27c5c8..29759d359c 100644 --- a/plugins/lead-resources/src/components/LeadPresenter.svelte +++ b/plugins/lead-resources/src/components/LeadPresenter.svelte @@ -17,13 +17,13 @@ import type { Lead } from '@anticrm/lead' import { closeTooltip, Icon, showPopup } from '@anticrm/ui' import lead from '../plugin' - import { EditTask } from '@anticrm/task-resources' + import { EditDoc } from '@anticrm/view-resources' export let value: Lead function show () { closeTooltip() - showPopup(EditTask, { _id: value._id }, 'full') + showPopup(EditDoc, { _id: value._id, _class: value._class }, 'full') } diff --git a/plugins/login-resources/src/utils.ts b/plugins/login-resources/src/utils.ts index 16d9d0276f..c4aca7c5a3 100644 --- a/plugins/login-resources/src/utils.ts +++ b/plugins/login-resources/src/utils.ts @@ -114,7 +114,7 @@ export async function createWorkspace (workspace: string): Promise<[Status, Logi } const overrideToken = getMetadata(login.metadata.OverrideLoginToken) - const email = getMetadata(login.metadata.LoginEmail) ?? '' + const email = fetchMetadataLocalStorage(login.metadata.LoginEmail) ?? '' if (overrideToken !== undefined) { const endpoint = getMetadata(login.metadata.OverrideEndpoint) if (endpoint !== undefined) { @@ -213,7 +213,7 @@ export async function selectWorkspace (workspace: string): Promise<[Status, Logi } const overrideToken = getMetadata(login.metadata.OverrideLoginToken) - const email = getMetadata(login.metadata.LoginEmail) ?? '' + const email = fetchMetadataLocalStorage(login.metadata.LoginEmail) ?? '' if (overrideToken !== undefined) { const endpoint = getMetadata(login.metadata.OverrideEndpoint) if (endpoint !== undefined) { diff --git a/plugins/recruit-resources/src/components/ApplicationPresenter.svelte b/plugins/recruit-resources/src/components/ApplicationPresenter.svelte index e3f45c289c..6de4ad0999 100644 --- a/plugins/recruit-resources/src/components/ApplicationPresenter.svelte +++ b/plugins/recruit-resources/src/components/ApplicationPresenter.svelte @@ -17,7 +17,7 @@ import type { Applicant } from '@anticrm/recruit' import { closeTooltip, Icon, showPopup } from '@anticrm/ui' import { getClient } from '@anticrm/presentation' - import { EditTask } from '@anticrm/task-resources' + import { EditDoc } from '@anticrm/view-resources' import recruit from '@anticrm/recruit' export let value: Applicant @@ -27,7 +27,7 @@ function show () { closeTooltip() - showPopup(EditTask, { _id: value._id }, 'full') + showPopup(EditDoc, { _id: value._id, _class: value._class }, 'full') } diff --git a/plugins/recruit-resources/src/components/KanbanCard.svelte b/plugins/recruit-resources/src/components/KanbanCard.svelte index 545ab7dff4..3b5a398112 100644 --- a/plugins/recruit-resources/src/components/KanbanCard.svelte +++ b/plugins/recruit-resources/src/components/KanbanCard.svelte @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. --> - @@ -37,7 +36,9 @@
-
{formatName(object.$lookup?.attachedTo?.name)}
+
+ {formatName(object.$lookup?.attachedTo?.name)} +
{object.$lookup?.attachedTo?.title ?? ''}
@@ -47,10 +48,10 @@
- {#if object.attachments ?? 0 > 0} + {#if (object.attachments ?? 0) > 0}
{/if} - {#if object.comments ?? 0 > 0} + {#if (object.comments ?? 0) > 0}
{/if}
@@ -63,11 +64,15 @@ display: flex; flex-direction: column; padding: 1rem 1.25rem; - background-color: rgba(222, 222, 240, .06); - border-radius: .75rem; + background-color: rgba(222, 222, 240, 0.06); + border-radius: 0.75rem; user-select: none; - &.draggable { cursor: grab; } + &.draggable { + cursor: grab; + } + } + .tool { + align-self: start; } - .tool { align-self: start; } diff --git a/plugins/task-resources/src/components/EditTask.svelte b/plugins/task-resources/src/components/EditTask.svelte deleted file mode 100644 index 2452b06779..0000000000 --- a/plugins/task-resources/src/components/EditTask.svelte +++ /dev/null @@ -1,120 +0,0 @@ - - - -{#if object !== undefined} - { - dispatch('close') - }} - > - - - {#await getEditor(object._class) then is} - { - getKeys(ev.detail.ignoreKeys) - }} - /> - {/await} - {#each collectionKeys as collection} -
- {#await getCollectionEditor(collection) then is} - - {/await} -
- {/each} -
-{/if} diff --git a/plugins/task-resources/src/components/TaskHeader.svelte b/plugins/task-resources/src/components/TaskHeader.svelte index 00014ea438..ac739733a7 100644 --- a/plugins/task-resources/src/components/TaskHeader.svelte +++ b/plugins/task-resources/src/components/TaskHeader.svelte @@ -16,12 +16,12 @@
diff --git a/plugins/task-resources/src/components/TaskPresenter.svelte b/plugins/task-resources/src/components/TaskPresenter.svelte index 08c34dbcd6..a3aed2fc97 100644 --- a/plugins/task-resources/src/components/TaskPresenter.svelte +++ b/plugins/task-resources/src/components/TaskPresenter.svelte @@ -16,9 +16,9 @@ diff --git a/plugins/task-resources/src/components/kanban/KanbanView.svelte b/plugins/task-resources/src/components/kanban/KanbanView.svelte index f29a637293..baef63275d 100644 --- a/plugins/task-resources/src/components/kanban/KanbanView.svelte +++ b/plugins/task-resources/src/components/kanban/KanbanView.svelte @@ -30,7 +30,6 @@ export let _class: Ref> export let space: Ref - export let open: AnyComponent export let search: string export let options: FindOptions | undefined export let config: string[] diff --git a/plugins/task-resources/src/components/state/StatePresenter.svelte b/plugins/task-resources/src/components/state/StatePresenter.svelte index 2ed8f971a3..fcf57669d9 100644 --- a/plugins/task-resources/src/components/state/StatePresenter.svelte +++ b/plugins/task-resources/src/components/state/StatePresenter.svelte @@ -13,31 +13,30 @@ // See the License for the specific language governing permissions and // limitations under the License. --> - {#if value} -
+
{value.title}
{/if} diff --git a/plugins/task-resources/src/components/state/StatesPopup.svelte b/plugins/task-resources/src/components/state/StatesPopup.svelte index f4e7709df1..aa50b22eb1 100644 --- a/plugins/task-resources/src/components/state/StatesPopup.svelte +++ b/plugins/task-resources/src/components/state/StatesPopup.svelte @@ -17,6 +17,7 @@ import { Ref, SortingOrder } from '@anticrm/core' import { createQuery } from '@anticrm/presentation' import task, { SpaceWithStates, State } from '@anticrm/task' + import { getPlatformColor } from '@anticrm/ui' import { createEventDispatcher } from 'svelte' export let space: Ref @@ -45,7 +46,7 @@ dispatch('close', state) }} > -
+
{state.title}
{/each} diff --git a/plugins/task-resources/src/index.ts b/plugins/task-resources/src/index.ts index 57db95678a..5cd7d6fac8 100644 --- a/plugins/task-resources/src/index.ts +++ b/plugins/task-resources/src/index.ts @@ -36,12 +36,12 @@ import Todos from './components/todos/Todos.svelte' import TodoItemPresenter from './components/todos/TodoItemPresenter.svelte' import TodoStatePresenter from './components/todos/TodoStatePresenter.svelte' import StatusTableView from './components/StatusTableView.svelte' +import TaskHeader from './components/TaskHeader.svelte' export { default as KanbanTemplateEditor } from './components/kanban/KanbanTemplateEditor.svelte' export { default as KanbanTemplateSelector } from './components/kanban/KanbanTemplateSelector.svelte' export { default as Tasks } from './components/Tasks.svelte' -export { default as EditTask } from './components/EditTask.svelte' async function createTask (object: Doc): Promise { showPopup(CreateTask, { parent: object._id, space: object.space }) @@ -108,7 +108,8 @@ export default async (): Promise => ({ Todos, TodoItemPresenter, TodoStatePresenter, - StatusTableView + StatusTableView, + TaskHeader }, actionImpl: { CreateTask: createTask, diff --git a/plugins/view-resources/package.json b/plugins/view-resources/package.json index 377ecf5de9..f4a8fb2e0f 100644 --- a/plugins/view-resources/package.json +++ b/plugins/view-resources/package.json @@ -32,6 +32,8 @@ "dependencies": { "svelte": "^3.37.0", "@anticrm/platform": "~0.6.5", + "@anticrm/contact": "~0.6.2", + "@anticrm/panel": "~0.6.0", "@anticrm/core": "~0.6.11", "@anticrm/view": "~0.6.0", "@anticrm/ui": "~0.6.0", diff --git a/plugins/view-resources/src/components/EditDoc.svelte b/plugins/view-resources/src/components/EditDoc.svelte new file mode 100644 index 0000000000..5f04942923 --- /dev/null +++ b/plugins/view-resources/src/components/EditDoc.svelte @@ -0,0 +1,308 @@ + + + +{#if object !== undefined} + {#await getTitle(object) then title} + { + dispatch('close') + }} + > +
+ {#await getHeaderEditor(object._class) then is} + {#if is} + + {:else} + + {/if} + {/await} +
+
+ {#await getEditorOrDefault(selectedClass, object._class) then is} + { + updateKeys(ev.detail.ignoreKeys) + }} + on:click={(ev) => { + fullSize = true + rightSection = ev.detail.presenter + }} + /> + {/await} +
+ {#if mixins.length > 0} +
+
{ + selectedClass = objectClass._id + selectedMixin = undefined + }} + > +
+ {#each mixins as mixin} +
{ + selectedClass = mixin._id + selectedMixin = mixin + }} + > +
+ {/each} +
+ {/if} + {#each collectionKeys as collection} +
+ {#await getCollectionEditor(collection) then is} + + {/await} +
+ {/each} +
+ {/await} +{/if} + + diff --git a/plugins/contact-resources/src/components/RolePresenter.svelte b/plugins/view-resources/src/components/RolePresenter.svelte similarity index 77% rename from plugins/contact-resources/src/components/RolePresenter.svelte rename to plugins/view-resources/src/components/RolePresenter.svelte index 0e8219169a..d86994cda5 100644 --- a/plugins/contact-resources/src/components/RolePresenter.svelte +++ b/plugins/view-resources/src/components/RolePresenter.svelte @@ -14,16 +14,14 @@ // limitations under the License. -->