Verified Commit 75c6aec1 authored by Alex ORLUC's avatar Alex ORLUC

FIX #10771 TIME 0:20 fix link user

parent 94efe786
......@@ -26,6 +26,6 @@
<div *ngIf="!externalUser.inMaarchParapheur" class="alert-message alert-message-danger" role="alert" style="margin-top: 30px;" [innerHTML]="lang.maarchParapheurAccountMsg + ' <b>' + externalUser.login + '</b> ' + lang.maarchParapheurAccountMsg2"></div>
</mat-dialog-content>
<mat-dialog-actions>
<button color="primary" mat-raised-button (click)="this.dialogRef.close(externalUser);">{{lang.validate}}</button>
<button color="primary" mat-raised-button (click)="this.dialogRef.close(externalUser);" [disabled]="externalUser.login === ''">{{lang.validate}}</button>
<button mat-raised-button (click)="this.dialogRef.close('');">{{lang.cancel}}</button>
</mat-dialog-actions>
\ No newline at end of file
......@@ -28,7 +28,7 @@ export class AccountLinkComponent extends AutoCompletePlugin {
}
ngOnInit(): void {
this.http.get(this.coreUrl + 'rest/autocomplete/maarchParapheurUsers', { params: { "search": this.data.user.lastname, "exludeAlreadyConnected": 'true' } })
this.http.get(this.coreUrl + 'rest/autocomplete/maarchParapheurUsers', { params: { "search": this.data.user.mail, "exludeAlreadyConnected": 'true' } })
.subscribe((dataUsers: any) => {
if ( dataUsers.length > 0) {
this.externalUser = dataUsers[0];
......@@ -67,6 +67,7 @@ export class AccountLinkComponent extends AutoCompletePlugin {
unlinkMaarchParapheurAccount() {
this.externalUser.inMaarchParapheur = false;
this.externalUser = this.data.user;
this.externalUser.login = this.data.user.user_id;
this.externalUser.email = this.data.user.mail;
}
}
......@@ -30,7 +30,7 @@
{{lang.changePassword}}
</p>
</a>
<a mat-list-item *ngIf="user.canCreateMaarchParapheurUser" (click)="linkMaarchParapheurAccount()"
<a mat-list-item *ngIf="user.canCreateMaarchParapheurUser || maarchParapheurLink.login === ''" (click)="linkMaarchParapheurAccount()"
title="{{lang.createUserInMaarchParapheur}}">
<mat-icon color="primary" mat-list-icon class="fa fa-link"></mat-icon>
<p mat-line>
......
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