-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding structure for source management
- Loading branch information
Showing
17 changed files
with
230 additions
and
125 deletions.
There are no files selected for viewing
File renamed without changes.
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
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
107 changes: 46 additions & 61 deletions
107
ui/src/app/admin/component/access-request.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 |
---|---|---|
@@ -1,68 +1,53 @@ | ||
<section class="section"> | ||
<div class="section-body border border-top-0 border-primary"> | ||
<div class="section-header bg-primary p-2 text-light"> | ||
<div class="row justify-content-between"> | ||
<div class="col-12"> | ||
<span class="lead" translate="label.user-access-request">User Access Request</span> | ||
</div> | ||
</div> | ||
|
||
<ng-container> | ||
<div class="d-flex justify-content-center"> | ||
<div class="w-25 alert alert-info m-3" *ngIf="!(hasUsers$ | async)"> | ||
<p>There are no new user requests at this time.</p> | ||
</div> | ||
<ng-container> | ||
<div class="d-flex justify-content-center"> | ||
<div class="w-25 alert alert-info m-3" *ngIf="!(hasUsers$ | async)"> | ||
<p>There are no new user requests at this time.</p> | ||
</div> | ||
</div> | ||
</ng-container> | ||
<ng-container *ngIf="hasUsers$ | async"> | ||
<div *ngFor="let user of users$ | async; let i = index;"> | ||
<div class="p-3 bg-light border-light rounded m-3"> | ||
<div class="row align-items-center"> | ||
<div class="col-10"> | ||
<div class="row"> | ||
<div class="col text-right font-weight-bold" translate="label.user-id"> | ||
UserId | ||
</div> | ||
<div class="col">{{ user.username }}</div> | ||
<div class="col text-right font-weight-bold" translate="label.email"> | ||
</div> | ||
<div class="col">{{ user.emailAddress }}</div> | ||
</div> | ||
<div class="w-100 my-1"></div> | ||
<div class="row"> | ||
<div class="col text-right font-weight-bold" translate="label.name"> | ||
Name | ||
</div> | ||
<div class="col">{{ user.firstName }} {{ user.lastName }}</div> | ||
<label [for]="'role-' + i" class="d-block col text-right font-weight-bold" translate="label.role"> | ||
Role | ||
</label> | ||
<div class="col"> | ||
<select | ||
[id]="'role-' + i" | ||
[name]="user.username" | ||
[ngModel]="user.role" | ||
class="form-control form-control-sm" | ||
disableValidation | ||
(change)="setUserRole(user, $event.target.value)"> | ||
<option *ngFor="let role of roles$ | async" [value]="role">{{ role }}</option> | ||
</select> | ||
</div> | ||
</div> | ||
</div> | ||
</ng-container> | ||
<ng-container *ngIf="hasUsers$ | async"> | ||
<div *ngFor="let user of users$ | async; let i = index;"> | ||
<div class="p-3 bg-light border-light rounded m-3"> | ||
<div class="row align-items-center"> | ||
<div class="col-10"> | ||
<div class="row"> | ||
<div class="col text-right font-weight-bold" translate="label.user-id"> | ||
UserId | ||
</div> | ||
<div class="col-2 text-right"> | ||
<button class="btn btn-danger btn-sm" (click)="deleteUser(user.username)"> | ||
<i class="fa fa-trash fa-lg"></i> | ||
| ||
<span translate="label.delete-request"> | ||
Delete Request | ||
</span> | ||
</button> | ||
<div class="col">{{ user.username }}</div> | ||
<div class="col text-right font-weight-bold" translate="label.email"> | ||
</div> | ||
<div class="col">{{ user.emailAddress }}</div> | ||
</div> | ||
<div class="w-100 my-1"></div> | ||
<div class="row"> | ||
<div class="col text-right font-weight-bold" translate="label.name"> | ||
Name | ||
</div> | ||
<div class="col">{{ user.firstName }} {{ user.lastName }}</div> | ||
<label [for]="'role-' + i" class="d-block col text-right font-weight-bold" translate="label.role"> | ||
Role | ||
</label> | ||
<div class="col"> | ||
<select [id]="'role-' + i" [name]="user.username" [ngModel]="user.role" class="form-control form-control-sm" | ||
disableValidation (change)="setUserRole(user, $event.target.value)"> | ||
<option *ngFor="let role of roles$ | async" [value]="role">{{ role }}</option> | ||
</select> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="col-2 text-right"> | ||
<button class="btn btn-danger btn-sm" (click)="deleteUser(user.username)"> | ||
<i class="fa fa-trash fa-lg"></i> | ||
| ||
<span translate="label.delete-request"> | ||
Delete Request | ||
</span> | ||
</button> | ||
</div> | ||
</div> | ||
</ng-container> | ||
</div> | ||
</div> | ||
</section> | ||
</ng-container> |
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,14 @@ | ||
<ul class="list-unstyled m-0"> | ||
<li *ngFor="let resolver of limited$ | async; index as i" | ||
[ngClass]="{'mt-2': i > 0}" | ||
aria-label="Provider Item Accordion. Press Spacebar to open"> | ||
<resolver-item | ||
[entity]="resolver" | ||
[isOpen]="(entitiesOpen$ | async)[resolver.getId()]" | ||
(select)="edit(resolver)" | ||
(toggle)="toggleEntity(resolver)" | ||
(preview)="openPreviewDialog(resolver)" | ||
(delete)="deleteResolver(resolver)"> | ||
</resolver-item> | ||
</li> | ||
</ul> |
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,75 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
import { Router } from '@angular/router'; | ||
import { Store } from '@ngrx/store'; | ||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; | ||
import { Observable } from 'rxjs'; | ||
import { map } from 'rxjs/operators'; | ||
|
||
import { MetadataEntity, MetadataResolver } from '../../metadata/domain/model'; | ||
import * as fromDashboard from '../../metadata/manager/reducer'; | ||
import { ToggleEntityDisplay } from '../../metadata/manager/action/manager.action'; | ||
import { DeleteDialogComponent } from '../../metadata/manager/component/delete-dialog.component'; | ||
import { PreviewEntity } from '../../metadata/domain/action/entity.action'; | ||
import { RemoveDraftRequest } from '../../metadata/resolver/action/draft.action'; | ||
import { LoadResolverRequest } from '../../metadata/resolver/action/collection.action'; | ||
|
||
@Component({ | ||
selector: 'enable-metadata', | ||
templateUrl: './enable-metadata.component.html' | ||
}) | ||
|
||
export class EnableMetadataComponent implements OnInit { | ||
searchQuery$: Observable<string>; | ||
resolvers$: Observable<MetadataEntity[]>; | ||
loading$: Observable<boolean>; | ||
|
||
total$: Observable<number>; | ||
page = 1; | ||
limit = 8; | ||
limited$: Observable<MetadataEntity[]>; | ||
|
||
entitiesOpen$: Observable<{ [key: string]: boolean }>; | ||
|
||
constructor( | ||
private store: Store<fromDashboard.DashboardState>, | ||
private router: Router, | ||
private modalService: NgbModal | ||
) { | ||
this.resolvers$ = store.select(fromDashboard.getSearchResults); | ||
this.searchQuery$ = store.select(fromDashboard.getSearchQuery); | ||
this.loading$ = store.select(fromDashboard.getSearchLoading); | ||
this.entitiesOpen$ = store.select(fromDashboard.getOpenProviders); | ||
|
||
this.total$ = this.resolvers$.pipe(map(list => list.length)); | ||
} | ||
|
||
ngOnInit(): void { | ||
this.store.dispatch(new LoadResolverRequest()); | ||
} | ||
|
||
edit(entity: MetadataEntity): void { | ||
this.router.navigate(['metadata', 'resolver', entity.getId(), 'edit']); | ||
} | ||
|
||
toggleEntity(entity: MetadataEntity): void { | ||
this.store.dispatch(new ToggleEntityDisplay(entity.getId())); | ||
} | ||
|
||
openPreviewDialog(entity: MetadataEntity): void { | ||
this.store.dispatch(new PreviewEntity({ id: entity.getId(), entity })); | ||
} | ||
|
||
deleteResolver(entity: MetadataResolver): void { | ||
this.modalService | ||
.open(DeleteDialogComponent) | ||
.result | ||
.then( | ||
success => { | ||
this.store.dispatch(new RemoveDraftRequest(entity)); | ||
}, | ||
err => { | ||
console.log('Cancelled'); | ||
} | ||
); | ||
} | ||
} |
82 changes: 35 additions & 47 deletions
82
ui/src/app/admin/component/user-management.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 |
---|---|---|
@@ -1,47 +1,35 @@ | ||
<section class="section"> | ||
<div class="section-body border border-top-0 border-primary"> | ||
<div class="section-header bg-primary p-2 text-light"> | ||
<div class="row justify-content-between"> | ||
<div class="col-12"> | ||
<span class="lead" translate="label.user-maintenance">User Maintenance</span> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="p-3"> | ||
<div class="alert alert-info" *ngIf="!(hasUsers$ | async)"> | ||
<p>There are no users configured in the system for you to manage.</p> | ||
</div> | ||
<table class="table table-striped" *ngIf="hasUsers$ | async"> | ||
<thead class="thead-primary"> | ||
<tr> | ||
<th scope="col" translate="label.user-id">UserId</th> | ||
<th scope="col" translate="label.name">Name</th> | ||
<th scope="col" translate="label.email">Email</th> | ||
<th scope="col" translate="label.role">Role</th> | ||
<th scope="col" translate="label.delete">Delete?</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr *ngFor="let user of users$ | async"> | ||
<th>{{ user.username }}</th> | ||
<td>{{ user.firstName }} {{ user.lastName }}</td> | ||
<td>{{ user.emailAddress }}</td> | ||
<td> | ||
<select [name]="user.username" [ngModel]="user.role" class="form-control" (change)="setUserRole(user, $event.target.value)"> | ||
<option *ngFor="let role of roles$ | async" [value]="role">{{ role }}</option> | ||
</select> | ||
</td> | ||
<td> | ||
<button class="btn btn-link" (click)="deleteUser(user.username)"> | ||
<span class="sr-only" translate="label.delete-user"> | ||
Delete User | ||
</span> | ||
<i class="fa fa-trash fa-lg text-danger"></i> | ||
</button> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
</section> | ||
<div class="alert alert-info" *ngIf="!(hasUsers$ | async)"> | ||
<p>There are no users configured in the system for you to manage.</p> | ||
</div> | ||
<table class="table table-striped" *ngIf="hasUsers$ | async"> | ||
<thead class="thead-primary"> | ||
<tr> | ||
<th scope="col" translate="label.user-id">UserId</th> | ||
<th scope="col" translate="label.name">Name</th> | ||
<th scope="col" translate="label.email">Email</th> | ||
<th scope="col" translate="label.role">Role</th> | ||
<th scope="col" translate="label.delete">Delete?</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr *ngFor="let user of users$ | async"> | ||
<th>{{ user.username }}</th> | ||
<td>{{ user.firstName }} {{ user.lastName }}</td> | ||
<td>{{ user.emailAddress }}</td> | ||
<td> | ||
<select [name]="user.username" [ngModel]="user.role" class="form-control" (change)="setUserRole(user, $event.target.value)"> | ||
<option *ngFor="let role of roles$ | async" [value]="role">{{ role }}</option> | ||
</select> | ||
</td> | ||
<td> | ||
<button class="btn btn-link" (click)="deleteUser(user.username)"> | ||
<span class="sr-only" translate="label.delete-user"> | ||
Delete User | ||
</span> | ||
<i class="fa fa-trash fa-lg text-danger"></i> | ||
</button> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
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
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 |
---|---|---|
@@ -1 +1,27 @@ | ||
<access-request-component></access-request-component> | ||
<section class="section"> | ||
<div class="section-body border border-top-0 border-primary"> | ||
<div class="section-header bg-primary p-2 text-light"> | ||
<div class="row justify-content-between"> | ||
<div class="col-12"> | ||
<span class="lead" translate="label.enable-metadata-sources">Enable Metadata Sources</span> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="p-3"> | ||
<enable-metadata></enable-metadata> | ||
</div> | ||
</div> | ||
</section> | ||
<section class="section"> | ||
<div class="section-body border border-top-0 border-primary"> | ||
<div class="section-header bg-primary p-2 text-light"> | ||
<div class="row justify-content-between"> | ||
<div class="col-12"> | ||
<span class="lead" translate="label.user-access-request">User Access Request</span> | ||
</div> | ||
</div> | ||
</div> | ||
<access-request-component></access-request-component> | ||
</div> | ||
</section> | ||
|
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
Oops, something went wrong.