Changed folder structure in shared/login folder

This commit is contained in:
Julius Gruber
2019-08-29 09:59:49 +02:00
parent ca1710c548
commit 3ee20ad17a
15 changed files with 44 additions and 47 deletions

View File

@@ -4,7 +4,7 @@
<img class="mb-4 login-logo" src="assets/images/dspace-logo.png">
<h1 class="h3 mb-0 font-weight-normal">{{"login.form.header" | translate}}</h1>
<!-- <ds-log-in></ds-log-in>-->
<ds-log-in-container></ds-log-in-container>
<ds-log-in></ds-log-in>
</div>
</div>
</div>

View File

@@ -4,7 +4,7 @@
<a href="#" id="dropdownLogin" (click)="$event.preventDefault()" ngbDropdownToggle class="px-1">{{ 'nav.login' | translate }}</a>
<div id="loginDropdownMenu" [ngClass]="{'pl-3 pr-3': (loading | async)}" ngbDropdownMenu aria-labelledby="dropdownLogin">
<!-- <ds-log-in></ds-log-in>-->
<ds-log-in-container></ds-log-in-container>
<ds-log-in></ds-log-in>
</div>
</div>
</li>

View File

@@ -1,22 +1,21 @@
import {Component, Injector, OnDestroy, OnInit} from '@angular/core';
import {Store} from '@ngrx/store';
import {LogInComponent} from '../password/log-in.component';
import {DynamicShibbolethComponent} from '../shibboleth/dynamic-shibboleth.component';
import {getAuthenticationMethods} from '../../../core/auth/selectors';
import {DynamicShibbolethComponent} from './methods/shibboleth/dynamic-shibboleth.component';
import {getAuthenticationMethods} from '../../core/auth/selectors';
import {map} from 'rxjs/operators';
import {AppState} from '../../../app.reducer';
import {AppState} from '../../app.reducer';
import {Observable} from 'rxjs';
import {DynamicLoginMethod} from './log-in-container.model';
import {AuthMethodConstants} from '../../../core/auth/models/auth-method.model';
import {AuthMethodConstants} from '../../core/auth/models/auth-method.model';
import {DynamicLoginMethod} from './log-in.model';
import {LogInPasswordComponent} from './methods/password/log-in-password.component';
@Component({
selector: 'ds-log-in-container',
templateUrl: './log-in-container.component.html',
styleUrls: ['./log-in-container.component.scss'],
selector: 'ds-log-in',
templateUrl: './log-in.component.html',
styleUrls: ['./log-in.component.scss'],
})
export class LogInContainerComponent implements OnDestroy, OnInit {
export class LogInComponent implements OnDestroy, OnInit {
public dynamicLoginMethods: Observable<DynamicLoginMethod[]>;
/**
@@ -56,7 +55,7 @@ export class LogInContainerComponent implements OnDestroy, OnInit {
map(((authMethods) => authMethods.map((authMethod) => {
switch (authMethod.authMethodConstant) {
case AuthMethodConstants.PASSWORD:
return new DynamicLoginMethod(authMethod.authMethodName, LogInComponent)
return new DynamicLoginMethod(authMethod.authMethodName, LogInPasswordComponent)
break;
case AuthMethodConstants.SHIBBOLETH:
this.shibbolethUrl = authMethod.location;

View File

@@ -5,19 +5,19 @@ import { FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
import { By } from '@angular/platform-browser';
import { Store, StoreModule } from '@ngrx/store';
import { LogInComponent } from './log-in.component';
import { authReducer } from '../../../core/auth/auth.reducer';
import { EPersonMock } from '../../testing/eperson-mock';
import { EPerson } from '../../../core/eperson/models/eperson.model';
import { LogInPasswordComponent } from './log-in.component';
import { authReducer } from '../../../../core/auth/auth.reducer';
import { EPersonMock } from '../../../testing/eperson-mock';
import { EPerson } from '../../../../core/eperson/models/eperson.model';
import { TranslateModule } from '@ngx-translate/core';
import { AuthService } from '../../../core/auth/auth.service';
import { AuthServiceStub } from '../../testing/auth-service-stub';
import { AppState } from '../../../app.reducer';
import { AuthService } from '../../../../core/auth/auth.service';
import { AuthServiceStub } from '../../../testing/auth-service-stub';
import { AppState } from '../../../../app.reducer';
describe('LogInComponent', () => {
let component: LogInComponent;
let fixture: ComponentFixture<LogInComponent>;
let component: LogInPasswordComponent;
let fixture: ComponentFixture<LogInPasswordComponent>;
let page: Page;
let user: EPerson;
@@ -41,7 +41,7 @@ describe('LogInComponent', () => {
TranslateModule.forRoot()
],
declarations: [
LogInComponent
LogInPasswordComponent
],
providers: [
{provide: AuthService, useClass: AuthServiceStub}
@@ -62,7 +62,7 @@ describe('LogInComponent', () => {
});
// create component and test fixture
fixture = TestBed.createComponent(LogInComponent);
fixture = TestBed.createComponent(LogInPasswordComponent);
// get test component from the fixture
component = fixture.componentInstance;
@@ -108,7 +108,7 @@ class Page {
public navigateSpy: jasmine.Spy;
public passwordInput: HTMLInputElement;
constructor(private component: LogInComponent, private fixture: ComponentFixture<LogInComponent>) {
constructor(private component: LogInPasswordComponent, private fixture: ComponentFixture<LogInPasswordComponent>) {
// use injector to get services
const injector = fixture.debugElement.injector;
const store = injector.get(Store);

View File

@@ -7,31 +7,31 @@ import {Observable} from 'rxjs';
import {
AuthenticateAction,
ResetAuthenticationMessagesAction, GetJWTafterShibbLoginAction
} from '../../../core/auth/auth.actions';
} from '../../../../core/auth/auth.actions';
import {
getAuthenticationError,
getAuthenticationInfo,
isAuthenticated,
isAuthenticationLoading,
} from '../../../core/auth/selectors';
import {CoreState} from '../../../core/core.reducers';
} from '../../../../core/auth/selectors';
import {CoreState} from '../../../../core/core.reducers';
import {isNotEmpty} from '../../empty.util';
import {fadeOut} from '../../animations/fade';
import {AuthService} from '../../../core/auth/auth.service';
import {isNotEmpty} from '../../../empty.util';
import {fadeOut} from '../../../animations/fade';
import {AuthService} from '../../../../core/auth/auth.service';
/**
* /users/sign-in
* @class LogInComponent
* @class LogInPasswordComponent
*/
@Component({
selector: 'ds-log-in',
templateUrl: './log-in.component.html',
styleUrls: ['./log-in.component.scss'],
selector: 'ds-log-in-password',
templateUrl: './log-in-password.component.html',
styleUrls: ['./log-in-password.component.scss'],
animations: [fadeOut]
})
export class LogInComponent implements OnDestroy, OnInit {
export class LogInPasswordComponent implements OnDestroy, OnInit {
/**
* The error if authentication fails.

View File

@@ -1 +1 @@
@import '../log-in/password/log-in.component';
@import '../log-in/methods/password/log-in-password.component';

View File

@@ -47,7 +47,6 @@ import { SearchResultGridElementComponent } from './object-grid/search-result-gr
import { ViewModeSwitchComponent } from './view-mode-switch/view-mode-switch.component';
import { GridThumbnailComponent } from './object-grid/grid-thumbnail/grid-thumbnail.component';
import { VarDirective } from './utils/var.directive';
import { LogInComponent } from './log-in/password/log-in.component';
import { AuthNavMenuComponent } from './auth-nav-menu/auth-nav-menu.component';
import { LogOutComponent } from './log-out/log-out.component';
import { FormComponent } from './form/form.component';
@@ -138,11 +137,9 @@ import { RoleDirective } from './roles/role.directive';
import { UserMenuComponent } from './auth-nav-menu/user-menu/user-menu.component';
import { ClaimedTaskActionsReturnToPoolComponent } from './mydspace-actions/claimed-task/return-to-pool/claimed-task-actions-return-to-pool.component';
import { ItemDetailPreviewFieldComponent } from './object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview-field/item-detail-preview-field.component';
import {LogInContainerComponent} from './log-in/log-in-container/log-in-container.component';
import {s} from '@angular/core/src/render3';
import {DynamicShibbolethComponent} from './log-in/shibboleth/dynamic-shibboleth.component';
import {DynamicShibbolethComponent} from './log-in/methods/shibboleth/dynamic-shibboleth.component';
import {LogInComponent} from './log-in/log-in.component';
import {LogInPasswordComponent} from './log-in/methods/password/log-in-password.component';
const MODULES = [
// Do NOT include UniversalModule, HttpModule, or JsonpModule here
@@ -263,8 +260,9 @@ const COMPONENTS = [
TypedItemSearchResultListElementComponent,
ItemTypeSwitcherComponent,
BrowseByComponent,
LogInContainerComponent,
DynamicShibbolethComponent
LogInComponent,
DynamicShibbolethComponent,
LogInPasswordComponent
];
const ENTRY_COMPONENTS = [
@@ -308,7 +306,7 @@ const ENTRY_COMPONENTS = [
PlainTextMetadataListElementComponent,
ItemMetadataListElementComponent,
MetadataRepresentationListElementComponent,
LogInComponent,
LogInPasswordComponent,
DynamicShibbolethComponent
];