Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import { createTestComponent } from '@dspace/core/testing/utils.test';
import { StoreModule } from '@ngrx/store';
import { TranslateModule } from '@ngx-translate/core';

import { getMockThemeService } from '../../theme-support/test/theme-service.mock';
import { ThemeService } from '../../theme-support/theme.service';
import { LogInContainerComponent } from './log-in-container.component';

describe('LogInContainerComponent', () => {
Expand Down Expand Up @@ -56,6 +58,7 @@ describe('LogInContainerComponent', () => {
{ provide: AuthorizationDataService, useClass: AuthorizationDataServiceStub },
{ provide: HardRedirectService, useValue: hardRedirectService },
LogInContainerComponent,
{ provide: ThemeService, useValue: getMockThemeService() },
],
schemas: [
CUSTOM_ELEMENTS_SCHEMA,
Expand Down
4 changes: 2 additions & 2 deletions src/app/shared/log-in/methods/auth-methods.type.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { LogInExternalProviderComponent } from './log-in-external-provider/log-in-external-provider.component';
import { LogInPasswordComponent } from './password/log-in-password.component';
import { ThemedLogInPasswordComponent } from './password/themed-log-in-password.component';

export type AuthMethodTypeComponent =
typeof LogInPasswordComponent |
typeof ThemedLogInPasswordComponent |
typeof LogInExternalProviderComponent;
5 changes: 3 additions & 2 deletions src/app/shared/log-in/methods/log-in.methods-decorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ import { AuthMethodType } from '@dspace/core/auth/models/auth.method-type';

import { AuthMethodTypeComponent } from './auth-methods.type';
import { LogInExternalProviderComponent } from './log-in-external-provider/log-in-external-provider.component';
import { LogInPasswordComponent } from './password/log-in-password.component';
import { ThemedLogInPasswordComponent } from './password/themed-log-in-password.component';


export const AUTH_METHOD_FOR_DECORATOR_MAP = new Map<AuthMethodType, AuthMethodTypeComponent>([
[AuthMethodType.Password, LogInPasswordComponent],
[AuthMethodType.Password, ThemedLogInPasswordComponent],
[AuthMethodType.Shibboleth, LogInExternalProviderComponent],
[AuthMethodType.Oidc, LogInExternalProviderComponent],
[AuthMethodType.Orcid, LogInExternalProviderComponent],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ import { BrowserOnlyPipe } from '../../../utils/browser-only.pipe';
* @class LogInPasswordComponent
*/
@Component({
selector: 'ds-log-in-password',
selector: 'ds-base-log-in-password',
templateUrl: './log-in-password.component.html',
styleUrls: ['./log-in-password.component.scss'],
animations: [fadeOut],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { Component } from '@angular/core';

import { ThemedComponent } from '../../../theme-support/themed.component';
import { LogInPasswordComponent } from './log-in-password.component';

/**
* Themed wrapper for LogInPasswordComponent
*/
@Component({
selector: 'ds-log-in-password',
styleUrls: [],
templateUrl: '../../../theme-support/themed.component.html',
imports: [
LogInPasswordComponent,
],
})
export class ThemedLogInPasswordComponent extends ThemedComponent<LogInPasswordComponent> {
protected getComponentName(): string {
return 'LogInPasswordComponent';
}

protected importThemedComponent(themeName: string): Promise<any> {
return import(`../../../../../themes/${themeName}/app/shared/log-in/methods/password/log-in-password.component`);
}

protected importUnthemedComponent(): Promise<any> {
return import(`./log-in-password.component`);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { AsyncPipe } from '@angular/common';
import { Component } from '@angular/core';
import {
FormsModule,
ReactiveFormsModule,
} from '@angular/forms';
import { RouterLink } from '@angular/router';
import { TranslateModule } from '@ngx-translate/core';

import { fadeOut } from '../../../../../../../app/shared/animations/fade';
import { BtnDisabledDirective } from '../../../../../../../app/shared/btn-disabled.directive';
import { LogInPasswordComponent as BaseComponent } from '../../../../../../../app/shared/log-in/methods/password/log-in-password.component';
import { BrowserOnlyPipe } from '../../../../../../../app/shared/utils/browser-only.pipe';

/**
* /users/sign-in
* @class LogInPasswordComponent
*/
@Component({
selector: 'ds-themed-log-in-password',
// templateUrl: './log-in-password.component.html',
templateUrl: '../../../../../../../app/shared/log-in/methods/password/log-in-password.component.html',
// styleUrls: ['./log-in-password.component.scss'],
styleUrls: ['../../../../../../../app/shared/log-in/methods/password/log-in-password.component.scss'],
animations: [fadeOut],
imports: [
AsyncPipe,
BrowserOnlyPipe,
BtnDisabledDirective,
FormsModule,
ReactiveFormsModule,
RouterLink,
TranslateModule,
],
})
export class LogInPasswordComponent extends BaseComponent {

}
2 changes: 2 additions & 0 deletions src/themes/custom/eager-theme.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { EditItemSelectorComponent } from './app/shared/dso-selector/modal-wrapp
import { FileDownloadLinkComponent } from './app/shared/file-download-link/file-download-link.component';
import { LangSwitchComponent } from './app/shared/lang-switch/lang-switch.component';
import { LogInComponent } from './app/shared/log-in/log-in.component';
import { LogInPasswordComponent } from './app/shared/log-in/methods/password/log-in-password.component';
import { BrowseEntryListElementComponent } from './app/shared/object-list/browse-entry-list-element/browse-entry-list-element.component';
import { CollectionListElementComponent } from './app/shared/object-list/collection-list-element/collection-list-element.component';
import { CommunityListElementComponent } from './app/shared/object-list/community-list-element/community-list-element.component';
Expand Down Expand Up @@ -72,6 +73,7 @@ const DECLARATIONS = [
EditItemSelectorComponent,
LogInComponent,
LangSwitchComponent,
LogInPasswordComponent,
];

@NgModule({
Expand Down
Loading