diff --git a/models/hr/src/index.ts b/models/hr/src/index.ts index 4b5721c0b9..d2c5d4b127 100644 --- a/models/hr/src/index.ts +++ b/models/hr/src/index.ts @@ -308,6 +308,27 @@ export function createModel (builder: Builder): void { hr.action.EditDepartment ) + createAction( + builder, + { + action: view.actionImpl.ShowPopup, + actionProps: { + component: hr.component.CreateDepartment, + element: 'top', + fillProps: { + _id: 'space' + } + }, + label: hr.string.CreateDepartment, + icon: hr.icon.Department, + input: 'focus', + category: hr.category.HR, + target: hr.class.Department, + context: { mode: 'context', application: hr.app.HR, group: 'create' } + }, + hr.action.CreateDepartment + ) + createAction( builder, { @@ -339,7 +360,8 @@ export function createModel (builder: Builder): void { input: 'any', category: hr.category.HR, target: hr.class.Request, - context: { mode: 'context', application: hr.app.HR, group: 'create' } + context: { mode: 'context', application: hr.app.HR, group: 'create' }, + override: [view.action.Open] }, hr.action.EditRequest ) @@ -350,7 +372,7 @@ export function createModel (builder: Builder): void { action: hr.actionImpl.EditRequestType, actionProps: {}, label: hr.string.EditRequestType, - icon: view.icon.Open, + icon: view.icon.Edit, input: 'any', category: hr.category.HR, target: hr.class.Request, diff --git a/models/hr/src/plugin.ts b/models/hr/src/plugin.ts index c61b506028..cdf87e474d 100644 --- a/models/hr/src/plugin.ts +++ b/models/hr/src/plugin.ts @@ -41,6 +41,7 @@ export default mergeIds(hrId, hr, { }, component: { Structure: '' as AnyComponent, + CreateDepartment: '' as AnyComponent, EditDepartment: '' as AnyComponent, DepartmentStaff: '' as AnyComponent, DepartmentEditor: '' as AnyComponent, @@ -54,6 +55,7 @@ export default mergeIds(hrId, hr, { HR: '' as Ref }, action: { + CreateDepartment: '' as Ref, EditDepartment: '' as Ref, ArchiveDepartment: '' as Ref, EditRequest: '' as Ref, diff --git a/packages/ui/src/components/Scroller.svelte b/packages/ui/src/components/Scroller.svelte index bf50d7a7bd..e28e12f265 100644 --- a/packages/ui/src/components/Scroller.svelte +++ b/packages/ui/src/components/Scroller.svelte @@ -235,7 +235,7 @@ )` divScroll.style.webkitMaskImage = gradient } - if (divHScroll && horizontal) { + if (divHScroll && horizontal && !noFade) { const gradientH = `linear-gradient( 90deg, rgba(0, 0, 0, 1) ${shiftLeft}px, diff --git a/plugins/hr-resources/src/components/schedule/MonthView.svelte b/plugins/hr-resources/src/components/schedule/MonthView.svelte index 337e652ec5..3ab2f3a0eb 100644 --- a/plugins/hr-resources/src/components/schedule/MonthView.svelte +++ b/plugins/hr-resources/src/components/schedule/MonthView.svelte @@ -250,7 +250,7 @@ {#if rows.length} {@const dep = departmentById.get(department)} - +
{#key [containerWidthRem, columnWidthRem, headerWidthRem]} @@ -314,7 +314,14 @@ {#each tracks as track, trackIndex} {#each track.elements as element} {@const request = element.request} -
+
1} />
{/each} diff --git a/plugins/hr-resources/src/components/schedule/ScheduleRequest.svelte b/plugins/hr-resources/src/components/schedule/ScheduleRequest.svelte index 5051378096..4456e055ce 100644 --- a/plugins/hr-resources/src/components/schedule/ScheduleRequest.svelte +++ b/plugins/hr-resources/src/components/schedule/ScheduleRequest.svelte @@ -16,7 +16,7 @@ import hr, { Request, RequestType } from '@hcengineering/hr' import { getClient } from '@hcengineering/presentation' import { closeTooltip, Icon, Label, showPopup } from '@hcengineering/ui' - import { ContextMenu, HTMLPresenter } from '@hcengineering/view-resources' + import { ContextMenu } from '@hcengineering/view-resources' export let request: Request export let editable: boolean = false @@ -30,10 +30,8 @@ }) } - function isAvailable (type: RequestType, request: Request): boolean { - // TODO Move availability to the Request model - const available = type.value >= 0 - return available + function isAvailable (type: RequestType): boolean { + return type.value >= 0 } function click (e: MouseEvent, request: Request) { @@ -43,11 +41,13 @@ closeTooltip() showPopup(ContextMenu, { object: request }, e.target as HTMLElement) } + + $: description = shouldShowDescription ? request.description.replace(/<[^>]*>/g, '').trim() : '' {#await getType(request) then type} {#if type} - {@const available = isAvailable(type, request)} + {@const available = isAvailable(type)}
- {#if request.description !== ''} - + {#if description !== ''} + {description} {:else if type}