From ae6ee89582a5729beb6050a66e0615783ac1eb77 Mon Sep 17 00:00:00 2001 From: Denis Bykhov <80476319+BykhovDenis@users.noreply.github.com> Date: Wed, 1 Jun 2022 18:13:12 +0600 Subject: [PATCH] Extract special view (#1969) Signed-off-by: Denis Bykhov <80476319+BykhovDenis@users.noreply.github.com> --- models/inventory/src/index.ts | 9 +- models/inventory/src/plugin.ts | 1 - models/lead/src/index.ts | 7 +- models/lead/src/plugin.ts | 1 - models/recruit/src/index.ts | 24 +++- models/recruit/src/plugin.ts | 2 - models/workbench/src/plugin.ts | 3 +- .../src/components/Products.svelte | 106 ----------------- plugins/inventory-resources/src/index.ts | 6 +- .../src/components/Customers.svelte | 88 -------------- plugins/lead-resources/src/index.ts | 2 - .../src/components/Candidates.svelte | 107 ------------------ plugins/recruit-resources/src/index.ts | 4 - .../src/components/SpecialView.svelte} | 49 ++++---- plugins/workbench-resources/src/index.ts | 2 + 15 files changed, 67 insertions(+), 344 deletions(-) delete mode 100644 plugins/inventory-resources/src/components/Products.svelte delete mode 100644 plugins/lead-resources/src/components/Customers.svelte delete mode 100644 plugins/recruit-resources/src/components/Candidates.svelte rename plugins/{recruit-resources/src/components/ApplicationsView.svelte => workbench-resources/src/components/SpecialView.svelte} (62%) diff --git a/models/inventory/src/index.ts b/models/inventory/src/index.ts index 2b3918ada5..9b10dbce43 100644 --- a/models/inventory/src/index.ts +++ b/models/inventory/src/index.ts @@ -121,7 +121,14 @@ export function createModel (builder: Builder): void { id: 'Products', label: inventory.string.Products, icon: inventory.icon.Products, - component: inventory.component.Products + component: workbench.component.SpecialView, + componentProps: { + _class: inventory.class.Product, + icon: inventory.icon.Products, + label: inventory.string.Products, + createLabel: inventory.string.ProductCreateLabel, + createComponent: inventory.component.CreateProduct + } } ], spaces: [] diff --git a/models/inventory/src/plugin.ts b/models/inventory/src/plugin.ts index 178c74355a..3e86c41cb6 100644 --- a/models/inventory/src/plugin.ts +++ b/models/inventory/src/plugin.ts @@ -33,7 +33,6 @@ export default mergeIds(inventoryId, inventory, { }, component: { Categories: '' as AnyComponent, - Products: '' as AnyComponent, CreateProduct: '' as AnyComponent, EditProduct: '' as AnyComponent, CategoryPresenter: '' as AnyComponent, diff --git a/models/lead/src/index.ts b/models/lead/src/index.ts index f201ee50ed..0b4e2e8afb 100644 --- a/models/lead/src/index.ts +++ b/models/lead/src/index.ts @@ -106,7 +106,12 @@ export function createModel (builder: Builder): void { id: 'customers', label: lead.string.Customers, icon: contact.icon.Person, // <-- Put contact general icon here. - component: lead.component.Customers, + component: workbench.component.SpecialView, + componentProps: { + _class: lead.mixin.Customer, + icon: lead.icon.Lead, + label: lead.string.Customers + }, position: 'top' } ], diff --git a/models/lead/src/plugin.ts b/models/lead/src/plugin.ts index 048429df8e..3f55cf5b7b 100644 --- a/models/lead/src/plugin.ts +++ b/models/lead/src/plugin.ts @@ -41,7 +41,6 @@ export default mergeIds(leadId, lead, { KanbanCard: '' as AnyComponent, LeadPresenter: '' as AnyComponent, TemplatesIcon: '' as AnyComponent, - Customers: '' as AnyComponent, Leads: '' as AnyComponent, NewItemsHeader: '' as AnyComponent }, diff --git a/models/recruit/src/index.ts b/models/recruit/src/index.ts index 1147546a5f..ea2de9974f 100644 --- a/models/recruit/src/index.ts +++ b/models/recruit/src/index.ts @@ -173,18 +173,34 @@ export function createModel (builder: Builder): void { }, { id: applicantsId, - component: recruit.component.ApplicationsView, + component: workbench.component.SpecialView, icon: recruit.icon.Application, label: recruit.string.Applications, - createItemLabel: recruit.string.ApplicationCreateLabel, + componentProps: { + _class: recruit.class.Applicant, + icon: recruit.icon.Application, + label: recruit.string.Applications, + createLabel: recruit.string.ApplicationCreateLabel, + createComponent: recruit.component.CreateApplication, + descriptor: task.viewlet.StatusTable, + baseQuery: { + doneState: null + } + }, position: 'vacancy' }, { id: candidatesId, - component: recruit.component.Candidates, + component: workbench.component.SpecialView, icon: contact.icon.Person, label: recruit.string.Candidates, - createItemLabel: recruit.string.CandidateCreateLabel, + componentProps: { + _class: recruit.mixin.Candidate, + icon: contact.icon.Person, + label: recruit.string.Candidates, + createLabel: recruit.string.CandidateCreateLabel, + createComponent: recruit.component.CreateCandidate + }, position: 'vacancy' }, { diff --git a/models/recruit/src/plugin.ts b/models/recruit/src/plugin.ts index 8d307eaa68..2cc91b231e 100644 --- a/models/recruit/src/plugin.ts +++ b/models/recruit/src/plugin.ts @@ -66,7 +66,6 @@ export default mergeIds(recruitId, recruit, { EditApplication: '' as AnyComponent, TemplatesIcon: '' as AnyComponent, Applications: '' as AnyComponent, - Candidates: '' as AnyComponent, SkillsView: '' as AnyComponent, Vacancies: '' as AnyComponent, @@ -77,7 +76,6 @@ export default mergeIds(recruitId, recruit, { ReviewPresenter: '' as AnyComponent, Opinions: '' as AnyComponent, OpinionPresenter: '' as AnyComponent, - ApplicationsView: '' as AnyComponent, NewCandidateHeader: '' as AnyComponent }, template: { diff --git a/models/workbench/src/plugin.ts b/models/workbench/src/plugin.ts index 78c337fef1..192b8942c2 100644 --- a/models/workbench/src/plugin.ts +++ b/models/workbench/src/plugin.ts @@ -23,7 +23,8 @@ export default mergeIds(workbenchId, workbench, { component: { ApplicationPresenter: '' as AnyComponent, Archive: '' as AnyComponent, - SpaceBrowser: '' as AnyComponent + SpaceBrowser: '' as AnyComponent, + SpecialView: '' as AnyComponent }, string: { Application: '' as IntlString, diff --git a/plugins/inventory-resources/src/components/Products.svelte b/plugins/inventory-resources/src/components/Products.svelte deleted file mode 100644 index b93dd1e430..0000000000 --- a/plugins/inventory-resources/src/components/Products.svelte +++ /dev/null @@ -1,106 +0,0 @@ - - - -