Requested changes implemented - basic functionality working

This commit is contained in:
Julius Gruber
2019-09-19 13:43:36 +02:00
parent 62cbba5982
commit 52ef2acb08
14 changed files with 33 additions and 21 deletions

View File

@@ -3,6 +3,7 @@ import { RouterModule } from '@angular/router';
import { PageNotFoundComponent } from './pagenotfound/pagenotfound.component';
import { AuthenticatedGuard } from './core/auth/authenticated.guard';
import { ShibbolethComponent } from './+login-page/shibbolethTargetPage/shibboleth.component';
const ITEM_MODULE_PATH = 'items';
export function getItemModulePath() {
@@ -39,6 +40,7 @@ export function getAdminModulePath() {
{ path: 'submit', loadChildren: './+submit-page/submit-page.module#SubmitPageModule' },
{ path: 'workspaceitems', loadChildren: './+workspaceitems-edit-page/workspaceitems-edit-page.module#WorkspaceitemsEditPageModule' },
{ path: 'workflowitems', loadChildren: './+workflowitems-edit-page/workflowitems-edit-page.module#WorkflowItemsEditPageModule' },
{ path: 'shibboleth', pathMatch: 'full', component: ShibbolethComponent },
{ path: '**', pathMatch: 'full', component: PageNotFoundComponent },
])
],

View File

@@ -58,11 +58,10 @@ export class AuthEffects {
})
);
/**
/* /!**
* Authenticate user.
* @method authenticate
*/
/*
*!/
@Effect()
public shibbolethAuthenticate$: Observable<Action> = this.actions$.pipe(
ofType(AuthActionTypes.START_SHIBBOLETH_AUTHENTICATION),
@@ -73,8 +72,7 @@ export class AuthEffects {
catchError((error) => observableOf(new AuthenticationErrorAction(error)))
);
})
);
*/
);*/
/**
* Shib Login.

View File

@@ -106,7 +106,7 @@ export class AuthInterceptor implements HttpInterceptor {
return authMethodModels;
}
private makeAuthStatusObject(authenticated: boolean, accessToken?: string, error?: string, httpHeaders?: HttpHeaders,): AuthStatus {
private makeAuthStatusObject(authenticated: boolean, accessToken?: string, error?: string, httpHeaders?: HttpHeaders): AuthStatus {
const authStatus = new AuthStatus();
// let authMethods: AuthMethodModel[];
if (httpHeaders) {

View File

@@ -1,4 +1,4 @@
import {AuthMethodType} from '../../../shared/log-in/authMethods-type';
import {AuthMethodType} from '../../../shared/log-in/methods/authMethods-type';
export class AuthMethodModel {
authMethodType: AuthMethodType;

View File

@@ -1,5 +1,5 @@
import { Component, ContentChild, Injector, Input, OnInit, ViewChild, ViewChildren } from '@angular/core';
import { rendersAuthMethodType } from '../authMethods-decorator';
import { rendersAuthMethodType } from '../methods/authMethods-decorator';
import { AuthMethodModel } from '../../../core/auth/models/auth-method.model';
import { select, Store } from '@ngrx/store';
import { CoreState } from '../../../core/core.reducers';

View File

@@ -7,10 +7,10 @@ import { CoreState } from '../../core/core.reducers';
@Component({
selector: 'ds-auth-methods',
templateUrl: './authMethods.component.html',
styleUrls: ['./authMethods.component.scss']
templateUrl: './log-in.component.html',
styleUrls: ['./log-in.component.scss']
})
export class AuthMethodsComponent implements OnInit {
export class LogInComponent implements OnInit {
/**
* The authentication methods data
* @type {AuthMethodModel[]}
@@ -33,7 +33,7 @@ export class AuthMethodsComponent implements OnInit {
}
ngOnInit(): void {
this.authMethodData = this.authMethodData = this.store.select(getAuthenticationMethods);
this.authMethodData = this.store.pipe(select(getAuthenticationMethods));
// set loading
this.loading = this.store.pipe(select(isAuthenticationLoading));

View File

@@ -20,8 +20,8 @@ import { CoreState } from '../../../../core/core.reducers';
import { isNotEmpty } from '../../../empty.util';
import { fadeOut } from '../../../animations/fade';
import { AuthService } from '../../../../core/auth/auth.service';
import { AuthMethodType } from '../../authMethods-type';
import { renderAuthMethodFor } from '../../authMethods-decorator';
import { AuthMethodType } from '../authMethods-type';
import { renderAuthMethodFor } from '../authMethods-decorator';
/**
* /users/sign-in

View File

@@ -3,9 +3,17 @@
<button class="btn btn-lg btn-primary btn-block mt-3" type="submit"
[disabled]="!shibbForm.valid"
>{{"login.shibbForm.submit" | translate}}</button>
</form>
<!--
<div *ngIf="!(loading | async) && !(isAuthenticated | async)" class="form-login px-4 py-3">
<button class="btn btn-lg btn-primary btn-block mt-3"
type="submit"
[formControl]="shibbButton"
(click)="submit()"
>{{"login.shibbForm.submit" | translate}}</button>
</div>
-->

View File

@@ -1,8 +1,8 @@
import { Component, EventEmitter, Inject, Input, OnInit, Output, QueryList, ViewChildren } from '@angular/core';
import { renderAuthMethodFor } from '../../authMethods-decorator';
import { AuthMethodType } from '../../authMethods-type';
import { renderAuthMethodFor } from '../authMethods-decorator';
import { AuthMethodType } from '../authMethods-type';
import { AuthMethodModel } from '../../../../core/auth/models/auth-method.model';
import { FormBuilder, FormGroup } from '@angular/forms';
import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
import { select, Store } from '@ngrx/store';
import { CoreState } from '../../../../core/core.reducers';
import { StartShibbolethAuthenticationAction } from '../../../../core/auth/auth.actions';
@@ -42,6 +42,8 @@ export class DynamicShibbolethComponent implements OnInit {
private host: string;
// public shibbButton: FormControl;
/**
* @constructor
*/
@@ -63,6 +65,8 @@ export class DynamicShibbolethComponent implements OnInit {
shibbButton: [''],
});
// this.shibbButton = new FormControl('');
// set isAuthenticated
this.isAuthenticated = this.store.pipe(select(isAuthenticated));

View File

@@ -141,7 +141,7 @@ import {DynamicShibbolethComponent} from './log-in/methods/shibboleth/dynamic-sh
// import {LogInComponent} from './log-in/log-in.component';
import {LogInPasswordComponent} from './log-in/methods/password/log-in-password.component';
import { LoginContainerComponent } from './log-in/container/login-container.component';
import { AuthMethodsComponent } from './log-in/authMethods.component';
import { LogInComponent } from './log-in/log-in.component';
const MODULES = [
// Do NOT include UniversalModule, HttpModule, or JsonpModule here
@@ -266,7 +266,7 @@ const COMPONENTS = [
DynamicShibbolethComponent,
LogInPasswordComponent,
LoginContainerComponent,
AuthMethodsComponent
LogInComponent
];
const ENTRY_COMPONENTS = [