diff --git a/matsen-tool/src/app/_helpers/api.converter.ts b/matsen-tool/src/app/_helpers/api.converter.ts
index d5d1aab..17b89e7 100644
--- a/matsen-tool/src/app/_helpers/api.converter.ts
+++ b/matsen-tool/src/app/_helpers/api.converter.ts
@@ -10,4 +10,12 @@ export class ApiConverter {
}
return "";
}
+
+ public static convertDate(dateString: string | null) {
+ if (dateString !== null) {
+ const date = new Date(dateString);
+ return date.toISOString().slice(0, 16);
+ }
+ return "";
+ }
}
\ No newline at end of file
diff --git a/matsen-tool/src/app/partners/partners-detail/partners-detail.component.html b/matsen-tool/src/app/partners/partners-detail/partners-detail.component.html
index 0198fff..2d7afa2 100644
--- a/matsen-tool/src/app/partners/partners-detail/partners-detail.component.html
+++ b/matsen-tool/src/app/partners/partners-detail/partners-detail.component.html
@@ -111,7 +111,7 @@
aria-controls="collapseExample">
-
-
+
+
{{'form.due-date' | translate}} {{'form.mandatory' | translate}}.
diff --git a/matsen-tool/src/app/tasks/new-task/new-task.component.ts b/matsen-tool/src/app/tasks/new-task/new-task.component.ts
index 08ed4f3..e0fa9cb 100644
--- a/matsen-tool/src/app/tasks/new-task/new-task.component.ts
+++ b/matsen-tool/src/app/tasks/new-task/new-task.component.ts
@@ -1,5 +1,5 @@
import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
-import {TaskJsonld, TaskService} from "@app/core/api/v1";
+import {TaskJsonld, TaskService, UserJsonld, UserService} from "@app/core/api/v1";
import {ModalStatus} from "@app/_helpers/modal.states";
import {FormGroupInitializer} from "@app/_helpers/formgroup.initializer";
import {FormGroup} from "@angular/forms";
@@ -19,12 +19,13 @@ export class NewTaskComponent implements OnInit {
protected taskForm: FormGroup;
protected taskSub: Subscription;
+ protected dueAtValue: string;
protected users = [
- { id: '/api/users/1', name: 'Daniel Knudsen' },
- { id: '/api/users/2', name: 'Florian Eisenmenger' },
- { id: '/api/users/3', name: 'Francis Donelly' },
- { id: '/api/users/4', name: 'Jaylen Schmitt' },
+ { id: '/api/users/63', name: 'Daniel Knudsen' },
+ { id: '/api/users/64', name: 'Florian Eisenmenger' },
+ { id: '/api/users/65', name: 'Francis Donielly' },
+ { id: '/api/users/66', name: 'Jaylen Schmiett' },
];
protected formatter = (apiData: any) => apiData.name;
@@ -34,25 +35,42 @@ export class NewTaskComponent implements OnInit {
debounceTime(200),
distinctUntilChanged(),
filter((term) => term.length >= 2),
- map((term) => this.users.filter((state) => new RegExp(term, 'mi').test(state.name)).slice(0, 10)),
+ map((term) => this.users.filter((user) => new RegExp(term, 'mi').test(user.name)).slice(0, 10)),
+ // map((term) => {
+ // this.userService.usersGetCollection(0, 50, term, term).subscribe(data => {
+ // const users: Array
= data["hydra:member"];
+ // let res: { id: any; name: any }[] = [];
+ // users.forEach(user => {
+ // res.push({
+ // id: user.id,
+ // name: user.firstName + " " + user.lastName
+ // });
+ // });
+ // return res;
+ // });
+ // })
);
constructor(
- private taskService: TaskService
+ private taskService: TaskService,
+ private userService: UserService
) {
this.taskForm = taskForm;
this.taskSub = new Subscription();
+ this.dueAtValue = "";
}
ngOnInit(): void {
- console.log(this.task);
+ console.log(this.dueAtValue);
this.taskForm = FormGroupInitializer.initFormGroup(this.taskForm, this.task);
}
onAssignedToSelect(selectedItem: any): void {
this.taskForm.get('assignedTo')?.setValue(selectedItem.item.id);
- console.log(selectedItem);
- console.log(this.taskForm);
+ }
+
+ onDueAtChange(selectedItem: any) {
+ this.taskForm.get('dueAt')?.setValue(selectedItem.target.value);
}
onSubmit() {