diff --git a/models/hr/src/index.ts b/models/hr/src/index.ts index d0fefe090a..d0dd70c791 100644 --- a/models/hr/src/index.ts +++ b/models/hr/src/index.ts @@ -78,7 +78,7 @@ export class TDepartment extends TSpace implements Department { export class TDepartmentMember extends TEmployeeAccount implements DepartmentMember {} @Mixin(hr.mixin.Staff, contact.class.Employee) -@UX(contact.string.Employee, hr.icon.HR) +@UX(hr.string.Staff, hr.icon.HR) export class TStaff extends TEmployee implements Staff { @Prop(TypeRef(hr.class.Department), hr.string.Department) department!: Ref @@ -314,6 +314,25 @@ export function createModel (builder: Builder): void { }, hr.action.EditRequest ) + + builder.createDoc( + view.class.Viewlet, + core.space.Model, + { + attachTo: hr.mixin.Staff, + descriptor: view.viewlet.Table, + config: [ + '', + { + key: '$lookup.channels', + sortingKey: ['$lookup.channels.lastMessage', 'channels'] + }, + 'modifiedOn' + ], + hiddenKeys: [] + }, + hr.viewlet.TableMember + ) } export { hrOperation } from './migration' diff --git a/plugins/contact-assets/lang/ru.json b/plugins/contact-assets/lang/ru.json index 247d620884..c1aae20f64 100644 --- a/plugins/contact-assets/lang/ru.json +++ b/plugins/contact-assets/lang/ru.json @@ -60,7 +60,7 @@ "CopyToClipboard": "Скопировать в буфер обмена", "Copied": "Скопировано", "ViewFullProfile": "Посмотреть профиль", - "Member": "Сотрудник", + "Member": "Сотрудник компании", "Members": "Сотрудники", "NoMembers": "Нет добавленных сотрудников", "AddMember": "Добавить сотрудника", diff --git a/plugins/hr-assets/lang/en.json b/plugins/hr-assets/lang/en.json index 7dc06767fe..d32dac1cc1 100644 --- a/plugins/hr-assets/lang/en.json +++ b/plugins/hr-assets/lang/en.json @@ -30,6 +30,10 @@ "PTO2": "PTO/2", "Overtime2": "Overtime/2", "EditRequest": "Edit {type}", - "Request": "Request" + "Request": "Request", + "Staff": "Worker", + "Members": "Members", + "NoMembers": "No members added", + "AddMember": "Add member" } } \ No newline at end of file diff --git a/plugins/hr-assets/lang/ru.json b/plugins/hr-assets/lang/ru.json index 8e459ef19e..5c06b1ff80 100644 --- a/plugins/hr-assets/lang/ru.json +++ b/plugins/hr-assets/lang/ru.json @@ -30,6 +30,11 @@ "PTO2": "PTO/2", "Overtime2": "Переработка/2", "EditRequest": "Редактировать {type}", - "Request": "Запрос" + "Request": "Запрос", + "Staff": "Работник", + "Member": "Сотрудник", + "Members": "Сотрудники", + "NoMembers": "Нет добавленных сотрудников", + "AddMember": "Добавить сотрудника" } } \ No newline at end of file diff --git a/plugins/hr-resources/src/components/DepartmentCard.svelte b/plugins/hr-resources/src/components/DepartmentCard.svelte index ffa1e3f816..954c152a75 100644 --- a/plugins/hr-resources/src/components/DepartmentCard.svelte +++ b/plugins/hr-resources/src/components/DepartmentCard.svelte @@ -13,20 +13,22 @@ // limitations under the License. -->
@@ -91,7 +95,7 @@
-
@@ -100,6 +104,7 @@
+
@@ -116,21 +121,23 @@ onEmployeeEdit={openLeadEditor} />
-
{#each currentDescendants as nested} - + {/each}
diff --git a/plugins/hr-resources/src/components/DepartmentStaff.svelte b/plugins/hr-resources/src/components/DepartmentStaff.svelte index 88dc501664..805fa64f69 100644 --- a/plugins/hr-resources/src/components/DepartmentStaff.svelte +++ b/plugins/hr-resources/src/components/DepartmentStaff.svelte @@ -14,22 +14,19 @@ -->
- -
- {#if employees.length > 0} + {#if (value?.members.length ?? 0) > 0} - - - - - - - - - {#each employees as value} - - - - - {/each} - -
- {#if value.$lookup?.department} - {value.$lookup.department.name} - {/if} -
+ {:else}
- -
{/if} diff --git a/plugins/hr-resources/src/components/PersonsPresenter.svelte b/plugins/hr-resources/src/components/PersonsPresenter.svelte new file mode 100644 index 0000000000..6ac68dd28c --- /dev/null +++ b/plugins/hr-resources/src/components/PersonsPresenter.svelte @@ -0,0 +1,56 @@ + + + +{#if value} +
+ {#each persons as p} +
+ +
+ {/each} +
+{/if} + + diff --git a/plugins/hr-resources/src/components/Structure.svelte b/plugins/hr-resources/src/components/Structure.svelte index 066a91982f..64fe540ff6 100644 --- a/plugins/hr-resources/src/components/Structure.svelte +++ b/plugins/hr-resources/src/components/Structure.svelte @@ -14,8 +14,8 @@ -->
@@ -82,6 +88,6 @@ {#if head} - + {/if} diff --git a/plugins/hr-resources/src/plugin.ts b/plugins/hr-resources/src/plugin.ts index 349bc9371e..62bbfb9890 100644 --- a/plugins/hr-resources/src/plugin.ts +++ b/plugins/hr-resources/src/plugin.ts @@ -37,6 +37,10 @@ export default mergeIds(hrId, hr, { EditRequest: '' as IntlString, CreateRequest: '' as IntlString, Today: '' as IntlString, - NoEmployeesInDepartment: '' as IntlString + NoEmployeesInDepartment: '' as IntlString, + Staff: '' as IntlString, + Members: '' as IntlString, + NoMembers: '' as IntlString, + AddMember: '' as IntlString } }) diff --git a/plugins/hr/package.json b/plugins/hr/package.json index 4da9e47ae2..0e015a6676 100644 --- a/plugins/hr/package.json +++ b/plugins/hr/package.json @@ -28,6 +28,7 @@ "dependencies": { "@anticrm/contact": "~0.6.5", "@anticrm/core": "~0.6.16", - "@anticrm/platform": "~0.6.6" + "@anticrm/platform": "~0.6.6", + "@anticrm/view": "~0.6.0" } } diff --git a/plugins/hr/src/index.ts b/plugins/hr/src/index.ts index e1284f1b6e..45432ee999 100644 --- a/plugins/hr/src/index.ts +++ b/plugins/hr/src/index.ts @@ -17,6 +17,7 @@ import type { Employee, EmployeeAccount } from '@anticrm/contact' import type { Arr, AttachedDoc, Class, Doc, Markup, Mixin, Ref, Space, Timestamp } from '@anticrm/core' import type { Asset, IntlString, Plugin } from '@anticrm/platform' import { plugin } from '@anticrm/platform' +import { Viewlet } from '@anticrm/view' /** * @public @@ -115,6 +116,9 @@ const hr = plugin(hrId, { Remote: '' as Ref, Overtime: '' as Ref, Overtime2: '' as Ref + }, + viewlet: { + TableMember: '' as Ref } })