diff --git a/ui/src/app/admin/action/collection.action.ts b/ui/src/app/admin/action/user-collection.action.ts similarity index 100% rename from ui/src/app/admin/action/collection.action.ts rename to ui/src/app/admin/action/user-collection.action.ts diff --git a/ui/src/app/admin/admin.component.ts b/ui/src/app/admin/admin.component.ts index 038d281b8..e4944bad5 100644 --- a/ui/src/app/admin/admin.component.ts +++ b/ui/src/app/admin/admin.component.ts @@ -3,7 +3,7 @@ import { LoadRoleRequest } from '../core/action/configuration.action'; import * as fromRoot from '../app.reducer'; import { Store } from '@ngrx/store'; -import { LoadAdminRequest } from './action/collection.action'; +import { LoadAdminRequest } from './action/user-collection.action'; @Component({ selector: 'admin-page', diff --git a/ui/src/app/admin/admin.module.ts b/ui/src/app/admin/admin.module.ts index 476575d1b..6ccd53c87 100644 --- a/ui/src/app/admin/admin.module.ts +++ b/ui/src/app/admin/admin.module.ts @@ -11,13 +11,15 @@ import { AdminManagementPageComponent } from './container/admin-management.compo import { AdminComponent } from './admin.component'; import { reducers } from './reducer'; import { AdminService } from './service/admin.service'; -import { AdminCollectionEffects } from './effect/collection.effect'; +import { AdminCollectionEffects } from './effect/user-collection.effect'; import { EffectsModule } from '@ngrx/effects'; import { DeleteUserDialogComponent } from './component/delete-user-dialog.component'; import { NgbModalModule } from '@ng-bootstrap/ng-bootstrap'; import { ActionRequiredPageComponent } from './container/action-required.component'; import { AccessRequestComponent } from './component/access-request.component'; import { UserManagementComponent } from './component/user-management.component'; +import { EnableMetadataComponent } from './component/enable-metadata.component'; +import { ManagerModule } from '../metadata/manager/manager.module'; @NgModule({ declarations: [ @@ -26,7 +28,8 @@ import { UserManagementComponent } from './component/user-management.component'; DeleteUserDialogComponent, UserManagementComponent, ActionRequiredPageComponent, - AccessRequestComponent + AccessRequestComponent, + EnableMetadataComponent ], entryComponents: [ DeleteUserDialogComponent @@ -41,7 +44,8 @@ import { UserManagementComponent } from './component/user-management.component'; HttpClientModule, SharedModule, I18nModule, - NgbModalModule + NgbModalModule, + ManagerModule ], providers: [ AdminService diff --git a/ui/src/app/admin/component/access-request.component.html b/ui/src/app/admin/component/access-request.component.html index a9b96b586..7beeee816 100644 --- a/ui/src/app/admin/component/access-request.component.html +++ b/ui/src/app/admin/component/access-request.component.html @@ -1,68 +1,53 @@ -
-
-
-
-
- User Access Request -
-
+ + +
+
+

There are no new user requests at this time.

- -
-
-

There are no new user requests at this time.

-
-
-
- -
-
-
-
-
-
- UserId -
-
{{ user.username }}
-
- Email -
-
{{ user.emailAddress }}
-
-
-
-
- Name -
-
{{ user.firstName }} {{ user.lastName }}
- -
- -
-
+
+ + +
+
+
+
+
+
+ UserId
-
- +
{{ user.username }}
+
+ Email +
+
{{ user.emailAddress }}
+
+
+
+
+ Name +
+
{{ user.firstName }} {{ user.lastName }}
+ +
+
+
+ +
- +
-
\ No newline at end of file + \ No newline at end of file diff --git a/ui/src/app/admin/component/enable-metadata.component.html b/ui/src/app/admin/component/enable-metadata.component.html new file mode 100644 index 000000000..2346caa2e --- /dev/null +++ b/ui/src/app/admin/component/enable-metadata.component.html @@ -0,0 +1,14 @@ + \ No newline at end of file diff --git a/ui/src/app/admin/component/enable-metadata.component.ts b/ui/src/app/admin/component/enable-metadata.component.ts new file mode 100644 index 000000000..d963a0a81 --- /dev/null +++ b/ui/src/app/admin/component/enable-metadata.component.ts @@ -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; + resolvers$: Observable; + loading$: Observable; + + total$: Observable; + page = 1; + limit = 8; + limited$: Observable; + + entitiesOpen$: Observable<{ [key: string]: boolean }>; + + constructor( + private store: Store, + 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'); + } + ); + } +} diff --git a/ui/src/app/admin/component/user-management.component.html b/ui/src/app/admin/component/user-management.component.html index 86ecfb6e0..14d1d52a6 100644 --- a/ui/src/app/admin/component/user-management.component.html +++ b/ui/src/app/admin/component/user-management.component.html @@ -1,47 +1,35 @@ -
-
-
-
-
- User Maintenance -
-
-
-
-
-

There are no users configured in the system for you to manage.

-
- - - - - - - - - - - - - - - - - - - -
UserIdNameEmailRoleDelete?
{{ user.username }}{{ user.firstName }} {{ user.lastName }}{{ user.emailAddress }} - - - -
-
-
-
\ No newline at end of file +
+

There are no users configured in the system for you to manage.

+
+ + + + + + + + + + + + + + + + + + + +
UserIdNameEmailRoleDelete?
{{ user.username }}{{ user.firstName }} {{ user.lastName }}{{ user.emailAddress }} + + + +
+ diff --git a/ui/src/app/admin/component/user-management.component.ts b/ui/src/app/admin/component/user-management.component.ts index 356f062ba..cecefa5ae 100644 --- a/ui/src/app/admin/component/user-management.component.ts +++ b/ui/src/app/admin/component/user-management.component.ts @@ -6,7 +6,7 @@ import * as fromRoot from '../../app.reducer'; import * as fromCore from '../../core/reducer'; import * as fromAdmin from '../reducer'; -import { UpdateAdminRequest, RemoveAdminRequest } from '../action/collection.action'; +import { UpdateAdminRequest, RemoveAdminRequest } from '../action/user-collection.action'; import { Admin } from '../model/admin'; import { DeleteUserDialogComponent } from '../component/delete-user-dialog.component'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; diff --git a/ui/src/app/admin/container/action-required.component.html b/ui/src/app/admin/container/action-required.component.html index 4bb706337..0d5c70823 100644 --- a/ui/src/app/admin/container/action-required.component.html +++ b/ui/src/app/admin/container/action-required.component.html @@ -1 +1,27 @@ - \ No newline at end of file +
+
+
+
+
+ Enable Metadata Sources +
+
+
+
+ +
+
+
+
+
+
+
+
+ User Access Request +
+
+
+ +
+
+ diff --git a/ui/src/app/admin/container/action-required.component.ts b/ui/src/app/admin/container/action-required.component.ts index 8f7aab548..f504f36e4 100644 --- a/ui/src/app/admin/container/action-required.component.ts +++ b/ui/src/app/admin/container/action-required.component.ts @@ -3,8 +3,6 @@ import { Store } from '@ngrx/store'; import * as fromRoot from '../../app.reducer'; -import { LoadNewUsersRequest } from '../action/collection.action'; - @Component({ selector: 'action-required-page', changeDetection: ChangeDetectionStrategy.OnPush, diff --git a/ui/src/app/admin/container/admin-management.component.html b/ui/src/app/admin/container/admin-management.component.html index 77864802b..8a07130d2 100644 --- a/ui/src/app/admin/container/admin-management.component.html +++ b/ui/src/app/admin/container/admin-management.component.html @@ -1 +1,15 @@ - \ No newline at end of file +
+
+
+
+
+ User Maintenance +
+
+
+
+ +
+
+
+ diff --git a/ui/src/app/admin/container/admin-management.component.ts b/ui/src/app/admin/container/admin-management.component.ts index 2773eadc2..1e29338bf 100644 --- a/ui/src/app/admin/container/admin-management.component.ts +++ b/ui/src/app/admin/container/admin-management.component.ts @@ -3,8 +3,6 @@ import { Store } from '@ngrx/store'; import * as fromRoot from '../../app.reducer'; -import { LoadAdminRequest } from '../action/collection.action'; - @Component({ selector: 'admin-management-page', changeDetection: ChangeDetectionStrategy.OnPush, diff --git a/ui/src/app/admin/effect/collection.effect.ts b/ui/src/app/admin/effect/user-collection.effect.ts similarity index 98% rename from ui/src/app/admin/effect/collection.effect.ts rename to ui/src/app/admin/effect/user-collection.effect.ts index 410166ed5..3fb2b966c 100644 --- a/ui/src/app/admin/effect/collection.effect.ts +++ b/ui/src/app/admin/effect/user-collection.effect.ts @@ -13,7 +13,7 @@ import { RemoveAdminRequest, RemoveAdminSuccess, LoadNewUsersRequest -} from '../action/collection.action'; +} from '../action/user-collection.action'; import { AdminService } from '../service/admin.service'; diff --git a/ui/src/app/admin/reducer/index.ts b/ui/src/app/admin/reducer/index.ts index 31a5265ea..f647e200e 100644 --- a/ui/src/app/admin/reducer/index.ts +++ b/ui/src/app/admin/reducer/index.ts @@ -1,6 +1,6 @@ import { createSelector, createFeatureSelector } from '@ngrx/store'; import * as fromRoot from '../../core/reducer'; -import * as fromCollection from './collection.reducer'; +import * as fromCollection from './user-collection.reducer'; export interface AdminState { collection: fromCollection.CollectionState; diff --git a/ui/src/app/admin/reducer/collection.reducer.spec.ts b/ui/src/app/admin/reducer/user-collection.reducer.spec.ts similarity index 93% rename from ui/src/app/admin/reducer/collection.reducer.spec.ts rename to ui/src/app/admin/reducer/user-collection.reducer.spec.ts index ac0349889..34b75defd 100644 --- a/ui/src/app/admin/reducer/collection.reducer.spec.ts +++ b/ui/src/app/admin/reducer/user-collection.reducer.spec.ts @@ -1,11 +1,11 @@ -import { reducer, initialState as snapshot } from './collection.reducer'; -import * as fromAdmin from './collection.reducer'; +import { reducer, initialState as snapshot } from './user-collection.reducer'; +import * as fromAdmin from './user-collection.reducer'; import { AdminCollectionActionTypes, LoadAdminSuccess, UpdateAdminSuccess, RemoveAdminSuccess -} from '../action/collection.action'; +} from '../action/user-collection.action'; import { Admin } from '../model/admin'; let users = [ diff --git a/ui/src/app/admin/reducer/collection.reducer.ts b/ui/src/app/admin/reducer/user-collection.reducer.ts similarity index 97% rename from ui/src/app/admin/reducer/collection.reducer.ts rename to ui/src/app/admin/reducer/user-collection.reducer.ts index 70d8ba9a4..e11be45ef 100644 --- a/ui/src/app/admin/reducer/collection.reducer.ts +++ b/ui/src/app/admin/reducer/user-collection.reducer.ts @@ -1,6 +1,6 @@ import { EntityState, EntityAdapter, createEntityAdapter } from '@ngrx/entity'; import { Admin } from '../model/admin'; -import { AdminCollectionActionsUnion, AdminCollectionActionTypes } from '../action/collection.action'; +import { AdminCollectionActionsUnion, AdminCollectionActionTypes } from '../action/user-collection.action'; export interface CollectionState extends EntityState { selectedAdminId: string | null; diff --git a/ui/src/app/metadata/manager/manager.module.ts b/ui/src/app/metadata/manager/manager.module.ts index 778d18c2d..e4e447641 100644 --- a/ui/src/app/metadata/manager/manager.module.ts +++ b/ui/src/app/metadata/manager/manager.module.ts @@ -45,6 +45,9 @@ import { I18nModule } from '../../i18n/i18n.module'; HttpClientModule, SharedModule, I18nModule + ], + exports: [ + ResolverItemComponent ] }) export class ManagerModule {