Changes associated with #2026

While creating a new EPerson -
* Reset password button is not displayed.
* Submit button label changed from 'Save' to 'Create'.
This commit is contained in:
Aman Budgujar
2023-03-02 18:20:14 +05:30
parent 4cf1feef07
commit 0090088cb3
4 changed files with 31 additions and 1 deletions

View File

@@ -13,12 +13,13 @@
[formGroup]="formGroup"
[formLayout]="formLayout"
[displayCancel]="false"
[submitLabel]="submitLabel"
(submitForm)="onSubmit()">
<div before class="btn-group">
<button (click)="onCancel()"
class="btn btn-outline-secondary"><i class="fas fa-arrow-left"></i> {{messagePrefix + '.return' | translate}}</button>
</div>
<div between class="btn-group">
<div *ngIf="displayResetPassword" between class="btn-group">
<button class="btn btn-primary" [disabled]="!(canReset$ | async)" (click)="resetPassword()">
<i class="fa fa-key"></i> {{'admin.access-control.epeople.actions.reset' | translate}}
</button>

View File

@@ -165,6 +165,16 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
*/
isImpersonated = false;
/**
* A boolean that indicate if to display EPersonForm's Rest password button
*/
displayResetPassword = false;
/**
* A string that indicate the label of Submit button
*/
submitLabel = 'form.create';
/**
* Subscription to email field value change
*/
@@ -188,6 +198,8 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
this.epersonInitial = eperson;
if (hasValue(eperson)) {
this.isImpersonated = this.authService.isImpersonatingUser(eperson.id);
this.displayResetPassword = true;
this.submitLabel = 'form.submit';
}
}));
}

View File

@@ -14,6 +14,8 @@
<tr class="text-center">
<th>{{'resource-policies.form.eperson-group-list.table.headers.id' | translate}}</th>
<th>{{'resource-policies.form.eperson-group-list.table.headers.name' | translate}}</th>
<th *ngIf="isListOfEPerson">{{'resource-policies.form.eperson-group-list.table.headers.identity' | translate}}</th>
<th *ngIf="!isListOfEPerson">{{'resource-policies.form.eperson-group-list.table.headers.collcomm' | translate}}</th>
<th>{{'resource-policies.form.eperson-group-list.table.headers.action' | translate}}</th>
</tr>
</thead>
@@ -22,6 +24,11 @@
[class.table-primary]="isSelected(entry) | async">
<td>{{entry.id}}</td>
<td>{{dsoNameService.getName(entry)}}</td>
<td *ngIf="isListOfEPerson">
{{'resource-policies.form.eperson-group-list.cell.email' | translate}} {{entry.email}}<br/>
{{'resource-policies.form.eperson-group-list.cell.netid' | translate}} {{entry.netid}}
</td>
<td *ngIf="!isListOfEPerson">{{(entry.object | async)?.payload?.name}}</td>
<td class="text-center">
<button class="btn btn-sm btn-outline-primary" (click)="emitSelect(entry)">
{{'resource-policies.form.eperson-group-list.select.btn' | translate}}

View File

@@ -1751,6 +1751,8 @@
"form.submit": "Save",
"form.create": "Create",
"form.repeatable.sort.tip": "Drop the item in the new position",
@@ -3659,6 +3661,10 @@
"resource-policies.form.eperson-group-list.table.headers.name": "Name",
"resource-policies.form.eperson-group-list.table.headers.collcomm": "Collection/Community",
"resource-policies.form.eperson-group-list.table.headers.identity": "Identity",
"resource-policies.form.eperson-group-list.modal.header": "Cannot change type",
"resource-policies.form.eperson-group-list.modal.text1.toGroup": "It is not possible to replace an ePerson with a group.",
@@ -3669,6 +3675,10 @@
"resource-policies.form.eperson-group-list.modal.close": "Ok",
"resource-policies.form.eperson-group-list.cell.email": "Email: ",
"resource-policies.form.eperson-group-list.cell.netid": "NetID: ",
"resource-policies.form.date.end.label": "End Date",
"resource-policies.form.date.start.label": "Start Date",