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"> <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> <h1 class="h3 mb-0 font-weight-normal">{{"login.form.header" | translate}}</h1>
<!-- <ds-log-in></ds-log-in>--> <!-- <ds-log-in></ds-log-in>-->
<ds-log-in-container></ds-log-in-container> <ds-log-in></ds-log-in>
</div> </div>
</div> </div>
</div> </div>

View File

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

View File

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

View File

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

View File

@@ -7,31 +7,31 @@ import {Observable} from 'rxjs';
import { import {
AuthenticateAction, AuthenticateAction,
ResetAuthenticationMessagesAction, GetJWTafterShibbLoginAction ResetAuthenticationMessagesAction, GetJWTafterShibbLoginAction
} from '../../../core/auth/auth.actions'; } from '../../../../core/auth/auth.actions';
import { import {
getAuthenticationError, getAuthenticationError,
getAuthenticationInfo, getAuthenticationInfo,
isAuthenticated, isAuthenticated,
isAuthenticationLoading, isAuthenticationLoading,
} from '../../../core/auth/selectors'; } from '../../../../core/auth/selectors';
import {CoreState} from '../../../core/core.reducers'; import {CoreState} from '../../../../core/core.reducers';
import {isNotEmpty} from '../../empty.util'; import {isNotEmpty} from '../../../empty.util';
import {fadeOut} from '../../animations/fade'; import {fadeOut} from '../../../animations/fade';
import {AuthService} from '../../../core/auth/auth.service'; import {AuthService} from '../../../../core/auth/auth.service';
/** /**
* /users/sign-in * /users/sign-in
* @class LogInComponent * @class LogInPasswordComponent
*/ */
@Component({ @Component({
selector: 'ds-log-in', selector: 'ds-log-in-password',
templateUrl: './log-in.component.html', templateUrl: './log-in-password.component.html',
styleUrls: ['./log-in.component.scss'], styleUrls: ['./log-in-password.component.scss'],
animations: [fadeOut] animations: [fadeOut]
}) })
export class LogInComponent implements OnDestroy, OnInit { export class LogInPasswordComponent implements OnDestroy, OnInit {
/** /**
* The error if authentication fails. * 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 { ViewModeSwitchComponent } from './view-mode-switch/view-mode-switch.component';
import { GridThumbnailComponent } from './object-grid/grid-thumbnail/grid-thumbnail.component'; import { GridThumbnailComponent } from './object-grid/grid-thumbnail/grid-thumbnail.component';
import { VarDirective } from './utils/var.directive'; 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 { AuthNavMenuComponent } from './auth-nav-menu/auth-nav-menu.component';
import { LogOutComponent } from './log-out/log-out.component'; import { LogOutComponent } from './log-out/log-out.component';
import { FormComponent } from './form/form.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 { 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 { 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 { 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 {DynamicShibbolethComponent} from './log-in/methods/shibboleth/dynamic-shibboleth.component';
import {s} from '@angular/core/src/render3'; import {LogInComponent} from './log-in/log-in.component';
import {DynamicShibbolethComponent} from './log-in/shibboleth/dynamic-shibboleth.component'; import {LogInPasswordComponent} from './log-in/methods/password/log-in-password.component';
const MODULES = [ const MODULES = [
// Do NOT include UniversalModule, HttpModule, or JsonpModule here // Do NOT include UniversalModule, HttpModule, or JsonpModule here
@@ -263,8 +260,9 @@ const COMPONENTS = [
TypedItemSearchResultListElementComponent, TypedItemSearchResultListElementComponent,
ItemTypeSwitcherComponent, ItemTypeSwitcherComponent,
BrowseByComponent, BrowseByComponent,
LogInContainerComponent, LogInComponent,
DynamicShibbolethComponent DynamicShibbolethComponent,
LogInPasswordComponent
]; ];
const ENTRY_COMPONENTS = [ const ENTRY_COMPONENTS = [
@@ -308,7 +306,7 @@ const ENTRY_COMPONENTS = [
PlainTextMetadataListElementComponent, PlainTextMetadataListElementComponent,
ItemMetadataListElementComponent, ItemMetadataListElementComponent,
MetadataRepresentationListElementComponent, MetadataRepresentationListElementComponent,
LogInComponent, LogInPasswordComponent,
DynamicShibbolethComponent DynamicShibbolethComponent
]; ];