Skip to content

Commit c61a9ab

Browse files
committed
Merge branch 'NAE-2115' into NAE-2119
2 parents 05c5b16 + 0e5ab38 commit c61a9ab

20 files changed

+47
-78
lines changed

projects/netgrif-components-core/src/lib/authorization/permission/permission.service.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ describe('PermissionService', () => {
4949
title: 'string',
5050
caseColor: 'string',
5151
caseTitle: 'string',
52-
user: undefined,
52+
userId: undefined,
5353
roles: {
5454
assignRole: {
5555
assign: true,
@@ -83,7 +83,7 @@ describe('PermissionService', () => {
8383
title: 'string',
8484
caseColor: 'string',
8585
caseTitle: 'string',
86-
user: undefined,
86+
userId: undefined,
8787
roles: {
8888
assignRole: {
8989
assign: false,
@@ -117,7 +117,7 @@ describe('PermissionService', () => {
117117
title: 'string',
118118
caseColor: 'string',
119119
caseTitle: 'string',
120-
user: undefined,
120+
userId: undefined,
121121
roles: {},
122122
startDate: undefined,
123123
finishDate: undefined,
@@ -155,7 +155,7 @@ describe('PermissionService', () => {
155155
title: 'string',
156156
caseColor: 'string',
157157
caseTitle: 'string',
158-
user: undefined,
158+
userId: undefined,
159159
roles: {},
160160
startDate: undefined,
161161
finishDate: undefined,

projects/netgrif-components-core/src/lib/authorization/permission/permission.service.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,30 +61,30 @@ export class PermissionService {
6161
&& (
6262
(
6363
task.assignPolicy === AssignPolicy.manual
64-
&& !task.user
64+
&& !task.userId
6565
&& this.hasTaskPermission(task, PermissionType.ASSIGN)
6666
)
6767
);
6868
}
6969

7070
public canCancel(task: Task | undefined): boolean {
71-
return !!task && !!task.user
71+
return !!task && !!task.userId
7272
&& this.hasTaskPermission(task, PermissionType.CANCEL)
7373
&& ((task.assignedUserPolicy === undefined || task.assignedUserPolicy.cancel === undefined)
7474
|| task.assignedUserPolicy.cancel);
7575
}
7676

7777
public canReassign(task: Task | undefined): boolean {
78-
return !!task && !!task.user && this.userComparator.compareUsers(task.user)
78+
return !!task && !!task.userId && this.userComparator.compareUsers(task.userId)
7979
&& this.hasTaskPermission(task, PermissionType.DELEGATE)
8080
&& ((task.assignedUserPolicy === undefined || task.assignedUserPolicy.reassign === undefined)
8181
|| task.assignedUserPolicy.reassign);
8282
}
8383

8484
public canFinish(task: Task | undefined): boolean {
8585
return !!task
86-
&& !!task.user
87-
&& this.userComparator.compareUsers(task.user)
86+
&& !!task.userId
87+
&& this.userComparator.compareUsers(task.userId)
8888
&& this.hasTaskPermission(task, PermissionType.FINISH);
8989
}
9090

projects/netgrif-components-core/src/lib/panel/task-panel/abstract-task-panel.component.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ class TestWrapperComponent {
242242
delegateTitle: 'string',
243243
caseColor: 'string',
244244
caseTitle: 'string',
245-
user: undefined,
245+
userId: undefined,
246246
roles: {},
247247
startDate: undefined,
248248
finishDate: undefined,
@@ -293,7 +293,7 @@ class MyTaskResources {
293293
title: 'string',
294294
caseColor: 'string',
295295
caseTitle: 'string',
296-
user: undefined,
296+
userId: undefined,
297297
roles: {},
298298
startDate: undefined,
299299
finishDate: undefined,
@@ -344,7 +344,7 @@ class MyTaskResources {
344344
title: 'string',
345345
caseColor: 'string',
346346
caseTitle: 'string',
347-
user: undefined,
347+
userId: undefined,
348348
roles: {},
349349
startDate: undefined,
350350
finishDate: undefined,

projects/netgrif-components-core/src/lib/panel/task-panel/abstract-task-panel.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ export abstract class AbstractTaskPanelComponent extends AbstractPanelWithImmedi
406406
}
407407
return {value: 'low', icon: 'south', type: 'meta'};
408408
case TaskMetaField.USER:
409-
return {value: task.user ? task.user.fullName : '', icon: 'account_circle', type: 'meta'};
409+
return {value: task.userId ? task.userId : '', icon: 'account_circle', type: 'meta'};
410410
case TaskMetaField.ASSIGN_DATE:
411411
return {
412412
value: task.startDate ? toMoment(task.startDate).format(DATE_TIME_FORMAT_STRING) : '',

projects/netgrif-components-core/src/lib/resources/interface/task.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export interface Task {
2929
/**
3030
* See [UserSmall]{@link UserResourceSmall#}
3131
*/
32-
user: UserResourceSmall;
32+
userId: string;
3333
/**
3434
* ***Example:***
3535
*

projects/netgrif-components-core/src/lib/task-content/services/task-content.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ export abstract class TaskContentService implements OnDestroy {
208208
*/
209209
public updateStateData(eventOutcome: TaskEventOutcome): void {
210210
if (this._task) {
211-
this._task.user = eventOutcome.task.user;
211+
this._task.userId = eventOutcome.task.userId;
212212
this._task.startDate = eventOutcome.task.startDate;
213213
this._task.finishDate = eventOutcome.task.finishDate;
214214
}

projects/netgrif-components-core/src/lib/task/services/assign-policy.service.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ describe('AssignPolicyService', () => {
7272
title: 'string',
7373
caseColor: 'string',
7474
caseTitle: 'string',
75-
user: undefined,
75+
userId: undefined,
7676
userRefs: undefined,
7777
roles: {
7878
assignRole: {

projects/netgrif-components-core/src/lib/task/services/assign-policy.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ export class AssignPolicyService extends TaskHandlingService {
134134
* @param afterAction the action that should be performed when the assign policy (and all following policies) finishes
135135
*/
136136
protected autoAssignClosedPolicy(afterAction: Subject<boolean>): void {
137-
if (!this._userComparatorService.compareUsers(this._task.user)) {
137+
if (!this._userComparatorService.compareUsers(this._task.userId)) {
138138
this._taskOperations.close();
139139
afterAction.next(false);
140140
afterAction.complete();

projects/netgrif-components-core/src/lib/task/services/assign-task.service.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ describe('AssignTaskService', () => {
7777
title: '',
7878
caseColor: '',
7979
caseTitle: '',
80-
user: undefined,
80+
userId: undefined,
8181
userRefs: undefined,
8282
roles: {},
8383
startDate: [1],
@@ -123,7 +123,7 @@ describe('AssignTaskService', () => {
123123
title: '',
124124
caseColor: '',
125125
caseTitle: '',
126-
user: null,
126+
userId: null,
127127
roles: {
128128
role: 'perform'
129129
},

projects/netgrif-components-core/src/lib/task/services/assign-task.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export class AssignTaskService extends TaskHandlingService {
6565
public assign(afterAction: AfterAction = new AfterAction()): void {
6666
this._eventQueue.scheduleEvent(new QueuedEvent(
6767
() => {
68-
return !this._safeTask.user;
68+
return !this._safeTask.userId;
6969
},
7070
nextEvent => {
7171
this.performAssignRequest(afterAction, nextEvent, this._taskViewService !== null && !this._taskViewService.allowMultiOpen);

0 commit comments

Comments
 (0)