Verified Commit 574c6201 authored by Alex ORLUC's avatar Alex ORLUC

FEAT #10619 TIME 1:30 add userlist signaturebook

parent 8fd5fc15
......@@ -154,6 +154,11 @@ class AutoCompleteController
}
return $response->withStatus(400)->withJson(['errors' => $errors]);
}
foreach ($curlResponse['response'] as $key => $value) {
$curlResponse['response'][$key]['idToDisplay'] = $value['firstname'] . ' ' . $value['lastname'];
$curlResponse['response'][$key]['externalId']['maarchParapheur'] = $value['id'];
}
return $response->withJson($curlResponse['response']);
} else {
return $response->withStatus(403)->withJson(['errors' => 'maarchParapheur is not enabled']);
......
......@@ -4,7 +4,7 @@
[matAutocomplete]="auto" [formControl]="userCtrl">
<mat-autocomplete #auto="matAutocomplete" (optionSelected)="addItem($event)" isOpen="true">
<mat-option *ngFor="let user of filteredUsers | async" [value]="user">
{{user.displayName}}
{{user.idToDisplay}}
</mat-option>
</mat-autocomplete>
</mat-form-field>
......
import { Component, Input, OnInit } from '@angular/core';
import { Component, Input, OnInit, ElementRef, ViewChild } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { LANG } from '../translate.component';
import { NotificationService } from '../notification.service';
import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop';
import { AutoCompletePlugin } from '../../plugins/autocomplete.plugin';
declare function $j(selector: any): any;
@Component({
selector: 'app-visa-workflow',
templateUrl: 'visa-workflow.component.html',
......@@ -92,4 +94,15 @@ export class VisaWorkflowComponent extends AutoCompletePlugin implements OnInit
return usersMissing;
}
addItem(event: any) {
const user = {
'externalId': event.option.value.externalId,
'labelToDisplay' : event.option.value.idToDisplay,
'requested_signature' : false,
}
this.visaWorkflow.items.push(user);
$j('#availableUsers').blur();
this.userCtrl.setValue('');
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment