Skip to content

Commit

Permalink
114077: Made ProfilePageMetadataFormComponent themeable
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandrevryghem committed Apr 14, 2024
1 parent 404ccd9 commit f5f00ca
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { ThemedComponent } from '../../shared/theme-support/themed.component';
import { Component, Input } from '@angular/core';
import { ProfilePageMetadataFormComponent } from './profile-page-metadata-form.component';
import { EPerson } from '../../core/eperson/models/eperson.model';

/**
* Themed wrapper for {@link ProfilePageMetadataFormComponent}
*/
@Component({
selector: 'ds-themed-profile-page-metadata-form',
templateUrl: '../../shared/theme-support/themed.component.html',
})
export class ThemedProfilePageMetadataFormComponent extends ThemedComponent<ProfilePageMetadataFormComponent> {

@Input() user: EPerson;

protected inAndOutputNames: (keyof ProfilePageMetadataFormComponent & keyof this)[] = [
'user',
];

protected getComponentName(): string {
return 'ProfilePageMetadataFormComponent';
}

protected importThemedComponent(themeName: string): Promise<any> {
return import(`../../../themes/${themeName}/app/profile-page/profile-page-metadata-form/profile-page-metadata-form.component`);
}

protected importUnthemedComponent(): Promise<any> {
return import('./profile-page-metadata-form.component');
}

}
2 changes: 1 addition & 1 deletion src/app/profile-page/profile-page.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h3 class="mb-4">{{'profile.head' | translate}}</h3>
<div class="card mb-4">
<div class="card-header">{{'profile.card.identify' | translate}}</div>
<div class="card-body">
<ds-profile-page-metadata-form [user]="user"></ds-profile-page-metadata-form>
<ds-themed-profile-page-metadata-form [user]="user"></ds-themed-profile-page-metadata-form>
</div>
</div>
<div *ngIf="canChangePassword$ | async" class="card mb-4 security-section">
Expand Down
3 changes: 3 additions & 0 deletions src/app/profile-page/profile-page.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { ThemedProfilePageComponent } from './themed-profile-page.component';
import { FormModule } from '../shared/form/form.module';
import { UiSwitchModule } from 'ngx-ui-switch';
import { ProfileClaimItemModalComponent } from './profile-claim-item-modal/profile-claim-item-modal.component';
import { ThemedProfilePageMetadataFormComponent } from './profile-page-metadata-form/themed-profile-page-metadata-form.component';


@NgModule({
Expand All @@ -26,6 +27,7 @@ import { ProfileClaimItemModalComponent } from './profile-claim-item-modal/profi
ProfilePageComponent,
ThemedProfilePageComponent,
ProfilePageMetadataFormComponent,
ThemedProfilePageMetadataFormComponent,
ProfilePageSecurityFormComponent,
ProfilePageResearcherFormComponent
],
Expand All @@ -34,6 +36,7 @@ import { ProfileClaimItemModalComponent } from './profile-claim-item-modal/profi
ThemedProfilePageComponent,
ProfileClaimItemModalComponent,
ProfilePageMetadataFormComponent,
ThemedProfilePageMetadataFormComponent,
ProfilePageSecurityFormComponent,
ProfilePageResearcherFormComponent
]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Component } from '@angular/core';
import { ProfilePageMetadataFormComponent as BaseComponent } from '../../../../../app/profile-page/profile-page-metadata-form/profile-page-metadata-form.component';

@Component({
selector: 'ds-profile-page-metadata-form',
templateUrl: '../../../../../app/profile-page/profile-page-metadata-form/profile-page-metadata-form.component.html'
// templateUrl: './profile-page-metadata-form.component.html'
})
export class ProfilePageMetadataFormComponent extends BaseComponent {
}
2 changes: 2 additions & 0 deletions src/themes/custom/lazy-theme.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ import { ItemStatusComponent } from './app/item-page/edit-item-page/item-status/
import { EditBitstreamPageComponent } from './app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component';
import { FormModule } from '../../app/shared/form/form.module';
import { RequestCopyModule } from 'src/app/request-copy/request-copy.module';
import { ProfilePageMetadataFormComponent } from './app/profile-page/profile-page-metadata-form/profile-page-metadata-form.component';

const DECLARATIONS = [
FileSectionComponent,
Expand Down Expand Up @@ -239,6 +240,7 @@ const DECLARATIONS = [
SubmissionSectionUploadFileComponent,
ItemStatusComponent,
EditBitstreamPageComponent,
ProfilePageMetadataFormComponent,
];

@NgModule({
Expand Down

0 comments on commit f5f00ca

Please sign in to comment.