Skip to content

Commit

Permalink
Merged in task/main-cris/DSC-2099 (pull request DSpace#2654)
Browse files Browse the repository at this point in the history
[DSC-2099] Fix problem with change detection

Approved-by: Andrea Barbasso
  • Loading branch information
atarix83 authored and Andrea Barbasso committed Dec 23, 2024
2 parents 634d63f + fd44d74 commit 447884c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/app/my-dspace-page/my-dspace-page.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<ds-my-dspace-new-submission *dsShowOnlyForRole="[roleTypeEnum.Submitter]"></ds-my-dspace-new-submission>
</div>

<ds-search *ngIf="configuration && context"
[configuration]="configuration"
<ds-search *ngIf="configuration() && context()"
[configuration]="configuration()"
[configurationList]="(configurationList$ | async)"
[context]="context"
[context]="context()"
[viewModeList]="viewModeList"
[projection]="projection"
[showThumbnails]="false">
Expand Down
4 changes: 2 additions & 2 deletions src/app/my-dspace-page/my-dspace-page.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ describe('MyDSpacePageComponent', () => {
);

flush();
expect(comp.configuration).toBe(MyDSpaceConfigurationValueType.Workspace);
expect(comp.context).toBe(Context.Workspace);
expect(comp.configuration()).toBe(MyDSpaceConfigurationValueType.Workspace);
expect(comp.context()).toBe(Context.Workspace);
}));
});
9 changes: 5 additions & 4 deletions src/app/my-dspace-page/my-dspace-page.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
Component,
Inject,
OnInit,
signal,
} from '@angular/core';
import { Observable } from 'rxjs';
import { take } from 'rxjs/operators';
Expand Down Expand Up @@ -65,12 +66,12 @@ export class MyDSpacePageComponent implements OnInit {
/**
* The start context to use in the search: workspace or workflow
*/
context: Context;
context = signal<Context>(null);

/**
* The start configuration to use in the search: workspace or workflow
*/
configuration: string;
configuration = signal<string>(null);

/**
* Variable for enumeration RoleType
Expand Down Expand Up @@ -108,8 +109,8 @@ export class MyDSpacePageComponent implements OnInit {
this.configurationList$ = this.searchConfigService.getAvailableConfigurationOptions();

this.configurationList$.pipe(take(1)).subscribe((configurationList: SearchConfigurationOption[]) => {
this.configuration = configurationList[0].value;
this.context = configurationList[0].context;
this.configuration.set(configurationList[0].value);
this.context.set(configurationList[0].context);
});

}
Expand Down

0 comments on commit 447884c

Please sign in to comment.