Skip to content

Commit

Permalink
Merge 58f2a5b into 8f1df19
Browse files Browse the repository at this point in the history
  • Loading branch information
MarieVerdonck committed Mar 18, 2020
2 parents 8f1df19 + 58f2a5b commit ed8e3d6
Show file tree
Hide file tree
Showing 22 changed files with 1,935 additions and 43 deletions.
66 changes: 65 additions & 1 deletion resources/i18n/en.json5
Expand Up @@ -170,6 +170,70 @@



"admin.access-control.epeople.title": "DSpace Angular :: EPeople",

"admin.access-control.epeople.head": "EPeople",

"admin.access-control.epeople.search.head": "Search",

"admin.access-control.epeople.search.scope.name": "Name",

"admin.access-control.epeople.search.scope.email": "E-mail (exact)",

"admin.access-control.epeople.search.scope.metadata": "Metadata",

"admin.access-control.epeople.search.button": "Search",

"admin.access-control.epeople.button.add": "Add EPerson",

"admin.access-control.epeople.table.id": "ID",

"admin.access-control.epeople.table.name": "Name",

"admin.access-control.epeople.table.email": "E-mail",

"admin.access-control.epeople.table.edit": "Edit",

"item.access-control.epeople.table.edit.buttons.edit": "Edit",

"item.access-control.epeople.table.edit.buttons.remove": "Remove",

"admin.access-control.epeople.no-items": "No EPeople to show.",

"admin.access-control.epeople.form.create": "Create EPerson",

"admin.access-control.epeople.form.edit": "Edit EPerson",

"admin.access-control.epeople.form.firstName": "First name",

"admin.access-control.epeople.form.lastName": "Last name",

"admin.access-control.epeople.form.email": "E-mail",

"admin.access-control.epeople.form.emailHint": "Must be valid e-mail address",

"admin.access-control.epeople.form.canLogIn": "Can log in",

"admin.access-control.epeople.form.requireCertificate": "Requires certificate",

"admin.access-control.epeople.form.notification.created.success": "Successfully created EPerson \"{{name}}\"",

"admin.access-control.epeople.form.notification.created.failure": "Failed to create EPerson \"{{name}}\"",

"admin.access-control.epeople.form.notification.created.failure.emailInUse": "Failed to create EPerson \"{{name}}\", email \"{{email}}\" already in use.",

"admin.access-control.epeople.form.notification.edited.failure.emailInUse": "Failed to edit EPerson \"{{name}}\", email \"{{email}}\" already in use.",

"admin.access-control.epeople.form.notification.edited.success": "Successfully edited EPerson \"{{name}}\"",

"admin.access-control.epeople.form.notification.edited.failure": "Failed to edit EPerson \"{{name}}\"",

"admin.access-control.epeople.notification.deleted.failure": "Failed to delete EPerson: \"{{name}}\"",

"admin.access-control.epeople.notification.deleted.success": "Successfully deleted EPerson: \"{{name}}\"",



"admin.search.breadcrumbs": "Administrative Search",

"admin.search.collection.edit": "Edit",
Expand Down Expand Up @@ -1500,7 +1564,7 @@
"relationships.isSingleVolumeOf": "Journal Volume",

"relationships.isVolumeOf": "Journal Volumes",

"relationships.isContributorOf": "Contributors",


Expand Down
@@ -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 src/app/+admin/admin-access-control/admin-access-control.module.ts
@@ -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 {

}
@@ -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
@@ -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>

0 comments on commit ed8e3d6

Please sign in to comment.