Skip to content

Commit

Permalink
fix: initialize map contributors before list contributors
Browse files Browse the repository at this point in the history
  • Loading branch information
QuCMGisaia committed Nov 22, 2024
1 parent bc1d353 commit 3e2ee0c
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,25 @@ export class ArlasWuiComponent implements OnInit {
if (this.arlasStartupService.shouldRunApp && !this.arlasStartupService.emptyMode) {
this.collections = [...new Set(Array.from(this.collaborativeService.registry.values()).map(c => c.collection))];

/** Map */
// Set MapContributors
const mapContributors = [];
this.contributorService.getMapContributors().forEach(mapContrib => {
mapContrib.colorGenerator = this.colorService.colorGenerator;
if (!!this.resultlistContributors) {
const resultlistContrbutor: ResultListContributor = this.resultlistContributors
.find(resultlistContrib => resultlistContrib.collection === mapContrib.collection);
if (!!resultlistContrbutor) {
mapContrib.searchSize = resultlistContrbutor.pageSize;
mapContrib.searchSort = resultlistContrbutor.sort;
} else {
mapContrib.searchSize = 50;
}
}
mapContributors.push(mapContrib);
});
this.mapService.setContributors(mapContributors);

/** Resultlist */
/** Retrieve displayable resultlists */
const hiddenListsTabsSet = new Set(this.hiddenResultlistTabs);
Expand All @@ -91,25 +110,6 @@ export class ArlasWuiComponent implements OnInit {
});
this.resultlistService.setContributors(this.resultlistContributors, resultListsConfig);

/** Map */
// Set MapContributors
const mapContributors = [];
this.contributorService.getMapContributors().forEach(mapContrib => {
mapContrib.colorGenerator = this.colorService.colorGenerator;
if (!!this.resultlistContributors) {
const resultlistContrbutor: ResultListContributor = this.resultlistContributors
.find(resultlistContrib => resultlistContrib.collection === mapContrib.collection);
if (!!resultlistContrbutor) {
mapContrib.searchSize = resultlistContrbutor.pageSize;
mapContrib.searchSort = resultlistContrbutor.sort;
} else {
mapContrib.searchSize = 50;
}
}
mapContributors.push(mapContrib);
});
this.mapService.setContributors(mapContributors);

zip(...this.collections.map(c => this.collaborativeService.describe(c)))
.pipe(takeUntil(this._onDestroy$))
.subscribe(cdrs => {
Expand Down

0 comments on commit 3e2ee0c

Please sign in to comment.