Skip to content

Commit ac40726

Browse files
Merge branch 'created-themeable-ProfilePageMetadataFormComponent_contribute-7.6' into minor-themed-component-fixes_contribute-main
# Conflicts: # src/app/profile-page/profile-page.module.ts # src/themes/custom/lazy-theme.module.ts
2 parents 74f8757 + f5f00ca commit ac40726

8 files changed

Lines changed: 65 additions & 6 deletions

File tree

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import {
2+
Component,
3+
Input,
4+
} from '@angular/core';
5+
6+
import { EPerson } from '../../core/eperson/models/eperson.model';
7+
import { ThemedComponent } from '../../shared/theme-support/themed.component';
8+
import { ProfilePageMetadataFormComponent } from './profile-page-metadata-form.component';
9+
10+
/**
11+
* Themed wrapper for {@link ProfilePageMetadataFormComponent}
12+
*/
13+
@Component({
14+
selector: 'ds-themed-profile-page-metadata-form',
15+
templateUrl: '../../shared/theme-support/themed.component.html',
16+
standalone: true,
17+
})
18+
export class ThemedProfilePageMetadataFormComponent extends ThemedComponent<ProfilePageMetadataFormComponent> {
19+
20+
@Input() user: EPerson;
21+
22+
protected inAndOutputNames: (keyof ProfilePageMetadataFormComponent & keyof this)[] = [
23+
'user',
24+
];
25+
26+
protected getComponentName(): string {
27+
return 'ProfilePageMetadataFormComponent';
28+
}
29+
30+
protected importThemedComponent(themeName: string): Promise<any> {
31+
return import(`../../../themes/${themeName}/app/profile-page/profile-page-metadata-form/profile-page-metadata-form.component`);
32+
}
33+
34+
protected importUnthemedComponent(): Promise<any> {
35+
return import('./profile-page-metadata-form.component');
36+
}
37+
38+
}

src/app/profile-page/profile-page.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ <h1>{{'profile.title' | translate}}</h1>
1515
<div class="card mb-4">
1616
<div class="card-header">{{'profile.card.identify' | translate}}</div>
1717
<div class="card-body">
18-
<ds-profile-page-metadata-form [user]="user"></ds-profile-page-metadata-form>
18+
<ds-themed-profile-page-metadata-form [user]="user"></ds-themed-profile-page-metadata-form>
1919
</div>
2020
</div>
2121
<div *ngIf="canChangePassword$ | async" class="card mb-4 security-section">

src/app/profile-page/profile-page.component.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ import {
4141
import { createPaginatedList } from '../shared/testing/utils.test';
4242
import { VarDirective } from '../shared/utils/var.directive';
4343
import { ProfilePageComponent } from './profile-page.component';
44-
import { ProfilePageMetadataFormComponent } from './profile-page-metadata-form/profile-page-metadata-form.component';
44+
import { ThemedProfilePageMetadataFormComponent } from './profile-page-metadata-form/themed-profile-page-metadata-form.component';
4545
import { ProfilePageResearcherFormComponent } from './profile-page-researcher-form/profile-page-researcher-form.component';
4646
import { ProfilePageSecurityFormComponent } from './profile-page-security-form/profile-page-security-form.component';
4747

@@ -129,7 +129,7 @@ describe('ProfilePageComponent', () => {
129129
.overrideComponent(ProfilePageComponent, {
130130
remove: {
131131
imports: [
132-
ProfilePageMetadataFormComponent,
132+
ThemedProfilePageMetadataFormComponent,
133133
ProfilePageSecurityFormComponent,
134134
ProfilePageResearcherFormComponent,
135135
SuggestionsNotificationComponent,

src/app/profile-page/profile-page.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ import { NotificationsService } from '../shared/notifications/notifications.serv
4848
import { followLink } from '../shared/utils/follow-link-config.model';
4949
import { VarDirective } from '../shared/utils/var.directive';
5050
import { ProfilePageMetadataFormComponent } from './profile-page-metadata-form/profile-page-metadata-form.component';
51+
import { ThemedProfilePageMetadataFormComponent } from './profile-page-metadata-form/themed-profile-page-metadata-form.component';
5152
import { ProfilePageResearcherFormComponent } from './profile-page-researcher-form/profile-page-researcher-form.component';
5253
import { ProfilePageSecurityFormComponent } from './profile-page-security-form/profile-page-security-form.component';
5354

@@ -56,7 +57,7 @@ import { ProfilePageSecurityFormComponent } from './profile-page-security-form/p
5657
styleUrls: ['./profile-page.component.scss'],
5758
templateUrl: './profile-page.component.html',
5859
imports: [
59-
ProfilePageMetadataFormComponent,
60+
ThemedProfilePageMetadataFormComponent,
6061
ProfilePageSecurityFormComponent,
6162
AsyncPipe,
6263
TranslateModule,

src/themes/custom/app/profile-page/profile-page-metadata-form/profile-page-metadata-form.component.html

Whitespace-only changes.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { NgIf } from '@angular/common';
2+
import { Component } from '@angular/core';
3+
4+
import { ProfilePageMetadataFormComponent as BaseComponent } from '../../../../../app/profile-page/profile-page-metadata-form/profile-page-metadata-form.component';
5+
import { FormComponent } from '../../../../../app/shared/form/form.component';
6+
7+
@Component({
8+
selector: 'ds-profile-page-metadata-form',
9+
templateUrl: '../../../../../app/profile-page/profile-page-metadata-form/profile-page-metadata-form.component.html',
10+
// templateUrl: './profile-page-metadata-form.component.html',
11+
imports: [
12+
FormComponent,
13+
NgIf,
14+
],
15+
standalone: true,
16+
})
17+
export class ProfilePageMetadataFormComponent extends BaseComponent {
18+
}

src/themes/custom/app/profile-page/profile-page.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { TranslateModule } from '@ngx-translate/core';
88

99
import { SuggestionsNotificationComponent } from '../../../../app/notifications/suggestions-notification/suggestions-notification.component';
1010
import { ProfilePageComponent as BaseComponent } from '../../../../app/profile-page/profile-page.component';
11-
import { ProfilePageMetadataFormComponent } from '../../../../app/profile-page/profile-page-metadata-form/profile-page-metadata-form.component';
11+
import { ThemedProfilePageMetadataFormComponent } from '../../../../app/profile-page/profile-page-metadata-form/themed-profile-page-metadata-form.component';
1212
import { ProfilePageResearcherFormComponent } from '../../../../app/profile-page/profile-page-researcher-form/profile-page-researcher-form.component';
1313
import { ProfilePageSecurityFormComponent } from '../../../../app/profile-page/profile-page-security-form/profile-page-security-form.component';
1414
import { VarDirective } from '../../../../app/shared/utils/var.directive';
@@ -21,7 +21,7 @@ import { VarDirective } from '../../../../app/shared/utils/var.directive';
2121
templateUrl: '../../../../app/profile-page/profile-page.component.html',
2222
standalone: true,
2323
imports: [
24-
ProfilePageMetadataFormComponent,
24+
ThemedProfilePageMetadataFormComponent,
2525
ProfilePageSecurityFormComponent,
2626
SuggestionsNotificationComponent,
2727
AsyncPipe,

src/themes/custom/lazy-theme.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ import { MyDSpacePageComponent } from './app/my-dspace-page/my-dspace-page.compo
5454
import { ExpandableNavbarSectionComponent } from './app/navbar/expandable-navbar-section/expandable-navbar-section.component';
5555
import { PageNotFoundComponent } from './app/pagenotfound/pagenotfound.component';
5656
import { ProfilePageComponent } from './app/profile-page/profile-page.component';
57+
import { ProfilePageMetadataFormComponent } from './app/profile-page/profile-page-metadata-form/profile-page-metadata-form.component';
5758
import { RegisterEmailFormComponent } from './app/register-email-form/register-email-form.component';
5859
import { CreateProfileComponent } from './app/register-page/create-profile/create-profile.component';
5960
import { RegisterEmailComponent } from './app/register-page/register-email/register-email.component';
@@ -188,6 +189,7 @@ const DECLARATIONS = [
188189
ItemListPreviewComponent,
189190
MetadataImportPageComponent,
190191
ItemDetailPreviewFieldComponent,
192+
ProfilePageMetadataFormComponent,
191193
];
192194

193195
@NgModule({

0 commit comments

Comments
 (0)