disable unlink action in profile section when email is the as the main profile's mail

This commit is contained in:
Bernaldo Mihasi 2023-06-06 11:16:19 +03:00
parent 730b60598a
commit f20b420c2c
12 changed files with 24 additions and 2 deletions

View File

@ -59,8 +59,8 @@
<span *ngIf="userCredential.provider === authProviderEnum.Configurable" class="configurableIcon"></span>
<span *ngIf="userCredential.provider === authProviderEnum.Zenodo" class="zenodoIcon"></span>
<!-- <div class="col-auto"></div> -->
<div *ngIf="i != 0" class="col-auto d-flex align-items-center unlink-mail" (click)="removeAccount(userCredential)">
<mat-icon [matTooltip]="'USER-PROFILE.ACTIONS.UNLINK-ACCOUNT' | translate" matTooltipPosition="right">link_off</mat-icon>
<div *ngIf="i != 0" class="col-auto d-flex align-items-center unlink-mail" (click)="userCredential.email !== userCredentials[0].email && removeAccount(userCredential)">
<mat-icon [matTooltip]="(userCredential.email !== userCredentials[0].email) ? ('USER-PROFILE.ACTIONS.UNLINK-ACCOUNT' | translate) : ('USER-PROFILE.ACTIONS.UNLINK-ACCOUNT-DISABLED' | translate)" matTooltipPosition="right" [ngClass]="{'disable-unlink':userCredential.email === userCredentials[0].email}">link_off</mat-icon>
</div>
</div>
</div>

View File

@ -210,6 +210,18 @@
background-color: #f4f8f9;
}
.disable-unlink{
opacity: 0.3;
}
.disable-unlink:hover{
cursor: not-allowed;
}
.disable-unlink:active{
pointer-events: none;
}
.add-new-btn {
margin-top: 2rem;
}

View File

@ -1748,6 +1748,7 @@
"LINK-NEW": "Link new",
"LINK-NEW-ACCOUNT": "Link new account",
"UNLINK-ACCOUNT": "Unlink",
"UNLINK-ACCOUNT-DISABLED": "You can't unlink your main profile's email",
"ADD": "Add",
"CANCEL": "Cancel"
}

View File

@ -1748,6 +1748,7 @@
"LINK-NEW": "Link new",
"LINK-NEW-ACCOUNT": "Link new account",
"UNLINK-ACCOUNT": "Unlink",
"UNLINK-ACCOUNT-DISABLED": "You can't unlink your main profile's email",
"ADD": "Add",
"CANCEL": "Cancel"
}

View File

@ -1748,6 +1748,7 @@
"LINK-NEW": "Nuevo enlace",
"LINK-NEW-ACCOUNT": "Enlazar nueva cuenta",
"UNLINK-ACCOUNT": "Unlink",
"UNLINK-ACCOUNT-DISABLED": "You can't unlink your main profile's email",
"ADD": "Añadir",
"CANCEL": "Cancelar"
}

View File

@ -1748,6 +1748,7 @@
"LINK-NEW": "Link new",
"LINK-NEW-ACCOUNT": "Link new account",
"UNLINK-ACCOUNT": "Unlink",
"UNLINK-ACCOUNT-DISABLED": "You can't unlink your main profile's email",
"ADD": "Add",
"CANCEL": "Cancel"
}

View File

@ -1748,6 +1748,7 @@
"LINK-NEW": "Poveži novo",
"LINK-NEW-ACCOUNT": "Poveži novi korisnički račun",
"UNLINK-ACCOUNT": "Unlink",
"UNLINK-ACCOUNT-DISABLED": "You can't unlink your main profile's email",
"ADD": "Unesi",
"CANCEL": "Poništi"
}

View File

@ -1748,6 +1748,7 @@
"LINK-NEW": "Połącz nowy",
"LINK-NEW-ACCOUNT": "Połącz nowe konto",
"UNLINK-ACCOUNT": "Unlink",
"UNLINK-ACCOUNT-DISABLED": "You can't unlink your main profile's email",
"ADD": "Dodaj",
"CANCEL": "Anuluj"
}

View File

@ -1748,6 +1748,7 @@
"LINK-NEW": "Ligar a nova(o)",
"LINK-NEW-ACCOUNT": "Ligar a nova conta",
"UNLINK-ACCOUNT": "Unlink",
"UNLINK-ACCOUNT-DISABLED": "You can't unlink your main profile's email",
"ADD": "Adicionar",
"CANCEL": "Cancelar"
}

View File

@ -1748,6 +1748,7 @@
"LINK-NEW": "Link new",
"LINK-NEW-ACCOUNT": "Link new account",
"UNLINK-ACCOUNT": "Unlink",
"UNLINK-ACCOUNT-DISABLED": "You can't unlink your main profile's email",
"ADD": "Add",
"CANCEL": "Cancel"
}

View File

@ -1748,6 +1748,7 @@
"LINK-NEW": "Link new",
"LINK-NEW-ACCOUNT": "Link new account",
"UNLINK-ACCOUNT": "Unlink",
"UNLINK-ACCOUNT-DISABLED": "You can't unlink your main profile's email",
"ADD": "Add",
"CANCEL": "Cancel"
}

View File

@ -1748,6 +1748,7 @@
"LINK-NEW": "Yeni bağlantı",
"LINK-NEW-ACCOUNT": "Yeni hesabı bağla",
"UNLINK-ACCOUNT": "Unlink",
"UNLINK-ACCOUNT-DISABLED": "You can't unlink your main profile's email",
"ADD": "Ekle",
"CANCEL": "İptal"
}