Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
1,935 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/app/+admin/admin-access-control/admin-access-control-routing.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { RouterModule } from '@angular/router'; | ||
import { EPeopleRegistryComponent } from './epeople-registry/epeople-registry.component'; | ||
|
||
@NgModule({ | ||
imports: [ | ||
RouterModule.forChild([ | ||
{ path: 'epeople', component: EPeopleRegistryComponent, data: { title: 'admin.access-control.epeople.title' } }, | ||
]) | ||
] | ||
}) | ||
/** | ||
* Routing module for the AccessControl section of the admin sidebar | ||
*/ | ||
export class AdminAccessControlRoutingModule { | ||
|
||
} |
29 changes: 29 additions & 0 deletions
29
src/app/+admin/admin-access-control/admin-access-control.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { CommonModule } from '@angular/common'; | ||
import { NgModule } from '@angular/core'; | ||
import { RouterModule } from '@angular/router'; | ||
import { TranslateModule } from '@ngx-translate/core'; | ||
import { SharedModule } from '../../shared/shared.module'; | ||
import { AdminAccessControlRoutingModule } from './admin-access-control-routing.module'; | ||
import { EPeopleRegistryComponent } from './epeople-registry/epeople-registry.component'; | ||
import { EPersonFormComponent } from './epeople-registry/eperson-form/eperson-form.component'; | ||
|
||
@NgModule({ | ||
imports: [ | ||
CommonModule, | ||
SharedModule, | ||
RouterModule, | ||
TranslateModule, | ||
AdminAccessControlRoutingModule | ||
], | ||
declarations: [ | ||
EPeopleRegistryComponent, | ||
EPersonFormComponent | ||
], | ||
entryComponents: [] | ||
}) | ||
/** | ||
* This module handles all components related to the access control pages | ||
*/ | ||
export class AdminAccessControlModule { | ||
|
||
} |
49 changes: 49 additions & 0 deletions
49
src/app/+admin/admin-access-control/epeople-registry/epeople-registry.actions.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { Action } from '@ngrx/store'; | ||
import { EPerson } from '../../../core/eperson/models/eperson.model'; | ||
import { type } from '../../../shared/ngrx/type'; | ||
|
||
/** | ||
* For each action type in an action group, make a simple | ||
* enum object for all of this group's action types. | ||
* | ||
* The 'type' utility function coerces strings into string | ||
* literal types and runs a simple check to guarantee all | ||
* action types in the application are unique. | ||
*/ | ||
export const EPeopleRegistryActionTypes = { | ||
|
||
EDIT_EPERSON: type('dspace/epeople-registry/EDIT_EPERSON'), | ||
CANCEL_EDIT_EPERSON: type('dspace/epeople-registry/CANCEL_EDIT_EPERSON'), | ||
}; | ||
|
||
/* tslint:disable:max-classes-per-file */ | ||
/** | ||
* Used to edit an EPerson in the EPeople registry | ||
*/ | ||
export class EPeopleRegistryEditEPersonAction implements Action { | ||
type = EPeopleRegistryActionTypes.EDIT_EPERSON; | ||
|
||
eperson: EPerson; | ||
|
||
constructor(eperson: EPerson) { | ||
this.eperson = eperson; | ||
} | ||
} | ||
|
||
/** | ||
* Used to cancel the editing of an EPerson in the EPeople registry | ||
*/ | ||
export class EPeopleRegistryCancelEPersonAction implements Action { | ||
type = EPeopleRegistryActionTypes.CANCEL_EDIT_EPERSON; | ||
} | ||
|
||
/* tslint:enable:max-classes-per-file */ | ||
|
||
/** | ||
* Export a type alias of all actions in this action group | ||
* so that reducers can easily compose action types | ||
* These are all the actions to perform on the EPeople registry state | ||
*/ | ||
export type EPeopleRegistryAction | ||
= EPeopleRegistryEditEPersonAction | ||
| EPeopleRegistryCancelEPersonAction |
90 changes: 90 additions & 0 deletions
90
src/app/+admin/admin-access-control/epeople-registry/epeople-registry.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
<div class="container"> | ||
<div class="epeople-registry row"> | ||
<div class="col-12"> | ||
|
||
<h2 id="header" class="border-bottom pb-2">{{labelPrefix + 'head' | translate}}</h2> | ||
|
||
<ds-eperson-form *ngIf="isEPersonFormShown" (submitForm)="forceUpdateEPeople()" | ||
(cancelForm)="isEPersonFormShown = false"></ds-eperson-form> | ||
|
||
<div *ngIf="!isEPersonFormShown" class="button-row top d-flex pb-2"> | ||
<button class="mr-auto btn btn-success addEPerson-button" | ||
(click)="isEPersonFormShown = true"> | ||
<i class="fas fa-plus"></i> | ||
<span class="d-none d-sm-inline">{{labelPrefix + 'button.add' | translate}}</span> | ||
</button> | ||
</div> | ||
|
||
<h3 id="search" class="border-bottom pb-2">{{labelPrefix + 'search.head' | translate}}</h3> | ||
<form [formGroup]="searchForm" (ngSubmit)="search(searchForm.value)" class="row"> | ||
<div class="col-12 col-sm-3"> | ||
<select name="scope" id="scope" formControlName="scope" class="form-control" aria-label="Search scope"> | ||
<option value="metadata">{{labelPrefix + 'search.scope.metadata' | translate}}</option> | ||
<option value="email">{{labelPrefix + 'search.scope.email' | translate}}</option> | ||
</select> | ||
</div> | ||
<div class="col-sm-9 col-12"> | ||
<div class="form-group input-group"> | ||
<input type="text" name="query" id="query" formControlName="query" | ||
class="form-control" aria-label="Search input"> | ||
<span class="input-group-append"> | ||
<button type="submit" | ||
class="search-button btn btn-secondary">{{ labelPrefix + 'search.button' | translate }}</button> | ||
</span> | ||
</div> | ||
</div> | ||
</form> | ||
|
||
<ds-pagination | ||
*ngIf="(ePeople | async)?.payload?.totalElements > 0" | ||
[paginationOptions]="config" | ||
[pageInfoState]="(ePeople | async)?.payload" | ||
[collectionSize]="(ePeople | async)?.payload?.totalElements" | ||
[hideGear]="true" | ||
[hidePagerWhenSinglePage]="true" | ||
(pageChange)="onPageChange($event)"> | ||
|
||
<div class="table-responsive"> | ||
<table id="epeople" class="table table-striped table-hover table-bordered"> | ||
<thead> | ||
<tr> | ||
<th scope="col">{{labelPrefix + 'table.id' | translate}}</th> | ||
<th scope="col">{{labelPrefix + 'table.name' | translate}}</th> | ||
<th scope="col">{{labelPrefix + 'table.email' | translate}}</th> | ||
<th>{{labelPrefix + 'table.edit' | translate}}</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr *ngFor="let eperson of (ePeople | async)?.payload?.page" | ||
[ngClass]="{'table-primary' : isActive(eperson) | async}"> | ||
<td>{{eperson.id}}</td> | ||
<td>{{eperson.name}}</td> | ||
<td>{{eperson.email}}</td> | ||
<td> | ||
<div class="btn-group edit-field"> | ||
<button (click)="toggleEditEPerson(eperson)" | ||
class="btn btn-outline-primary btn-sm access-control-editEPersonButton" | ||
title="{{labelPrefix + 'table.edit.buttons.edit' | translate}}"> | ||
<i class="fas fa-edit fa-fw"></i> | ||
</button> | ||
<button (click)="deleteEPerson(eperson)" | ||
class="btn btn-outline-danger btn-sm access-control-deleteEPersonButton" | ||
title="{{labelPrefix + 'table.edit.buttons.remove' | translate}}"> | ||
<i class="fas fa-trash-alt fa-fw"></i> | ||
</button> | ||
</div> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
|
||
</ds-pagination> | ||
|
||
<div *ngIf="(ePeople | async)?.payload?.totalElements == 0" class="alert alert-info w-100 mb-2" role="alert"> | ||
{{labelPrefix + 'no-items' | translate}} | ||
</div> | ||
|
||
</div> | ||
</div> | ||
</div> |
Oops, something went wrong.