@studyportals/fawkes 8.7.2-14 → 8.7.2-15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,5 @@
1
1
  import { DependencyTypes } from '../enums/DependencyTypes';
2
- import { Area, AreaAttendance, Attendance, Continent, Country, CountryAttendance, Unfiltered, RankedArea, RankedAttendance, RankedAttendanceDiscipline, RankedContinent, RankedContinentAttendance, RankedCountry, RankedCountryAttendance,
3
- // RankedCountryDiscipline,
4
- //RankedDiscipline,
5
- RankedUnfiltered, CountryCity, CountryAreaCity } from '../organisations/policies';
2
+ import { Area, AreaAttendance, Attendance, Continent, Country, CountryAttendance, Unfiltered, RankedArea, RankedAttendance, RankedAttendanceDiscipline, RankedContinent, RankedContinentAttendance, RankedCountry, RankedCountryAttendance, RankedCountryDiscipline, RankedDiscipline, RankedUnfiltered, CountryCity, CountryAreaCity } from '../organisations/policies';
6
3
  export class SearchIndexabilityManager {
7
4
  policies;
8
5
  constructor(portalType, seoInfoBase, filterState, sortingState, applicationState) {
@@ -31,8 +28,8 @@ export class SearchIndexabilityManager {
31
28
  new RankedContinentAttendance(dependencies),
32
29
  new RankedCountry(dependencies),
33
30
  new RankedCountryAttendance(dependencies),
34
- // new RankedCountryDiscipline(dependencies),
35
- // new RankedDiscipline(dependencies),
31
+ new RankedCountryDiscipline(dependencies),
32
+ new RankedDiscipline(dependencies),
36
33
  new RankedUnfiltered(dependencies)
37
34
  ];
38
35
  }
@@ -17,22 +17,28 @@ export class RankedCountryDiscipline extends RankedOrganisationsSeoIndexabilityP
17
17
  super(dependencies);
18
18
  }
19
19
  async generateUrls() {
20
- const countryFragments = CountryPresenter.getInstance().getFragments();
21
- const disciplineFragments = DisciplinePresenter.getInstance().getFragments();
22
- const paths = [];
23
- for (const country of countryFragments) {
24
- for (const discipline of disciplineFragments) {
25
- const filterKeyValues = new Map([
26
- [FilterKey.COUNTRY, [country.id]],
27
- [FilterKey.DISCIPLINES, [discipline.id]],
28
- ]);
29
- const result = await this.checkRulesForSitemap(filterKeyValues);
30
- if (result) {
31
- paths.push(this.getPathWithSortingOption(`${country.path}/${discipline.path}`));
20
+ try {
21
+ const countryFragments = CountryPresenter.getInstance().getFragments();
22
+ const disciplineFragments = DisciplinePresenter.getInstance().getFragments();
23
+ const paths = [];
24
+ for (const country of countryFragments) {
25
+ for (const discipline of disciplineFragments) {
26
+ const filterKeyValues = new Map([
27
+ [FilterKey.COUNTRY, [country.id]],
28
+ [FilterKey.DISCIPLINES, [discipline.id]]
29
+ ]);
30
+ const result = await this.checkRulesForSitemap(filterKeyValues);
31
+ if (result) {
32
+ paths.push(this.getPathWithSortingOption(`${country.path}/${discipline.path}`));
33
+ }
32
34
  }
33
35
  }
36
+ return paths;
37
+ }
38
+ catch (error) {
39
+ console.error('Error generating URLs for RankedCountryDiscipline:', error);
40
+ return [];
34
41
  }
35
- return paths;
36
42
  }
37
43
  get filterCombination() {
38
44
  return FilterCombinations.RANKED_DISCIPLINE_COUNTRY;
@@ -15,18 +15,22 @@ export class RankedDiscipline extends RankedOrganisationsSeoIndexabilityPolicy {
15
15
  super(dependencies);
16
16
  }
17
17
  async generateUrls() {
18
- const disciplineFragments = DisciplinePresenter.getInstance().getFragments();
19
- const paths = [];
20
- for (const discipline of disciplineFragments) {
21
- const filterKeyValues = new Map([
22
- [FilterKey.DISCIPLINES, [discipline.id]]
23
- ]);
24
- const result = await this.checkRulesForSitemap(filterKeyValues);
25
- if (result) {
26
- paths.push(this.getPathWithSortingOption(discipline.path));
18
+ try {
19
+ const disciplineFragments = DisciplinePresenter.getInstance().getFragments();
20
+ const paths = [];
21
+ for (const discipline of disciplineFragments) {
22
+ const filterKeyValues = new Map([[FilterKey.DISCIPLINES, [discipline.id]]]);
23
+ const result = await this.checkRulesForSitemap(filterKeyValues);
24
+ if (result) {
25
+ paths.push(this.getPathWithSortingOption(discipline.path));
26
+ }
27
27
  }
28
+ return paths;
29
+ }
30
+ catch (error) {
31
+ console.error('Error generating URLs for RankedDiscipline:', error);
32
+ return [];
28
33
  }
29
- return paths;
30
34
  }
31
35
  get filterCombination() {
32
36
  return FilterCombinations.RANKED_DISCIPLINE;
@@ -9,11 +9,17 @@ export class RankedUnfiltered extends RankedOrganisationsSeoIndexabilityPolicy {
9
9
  super(dependencies);
10
10
  }
11
11
  async generateUrls() {
12
- const filterKeyValues = new Map([]);
13
- if (await this.checkRulesForSitemap(filterKeyValues)) {
14
- return [this.getPathWithSortingOption('')];
12
+ try {
13
+ const filterKeyValues = new Map([]);
14
+ if (await this.checkRulesForSitemap(filterKeyValues)) {
15
+ return [this.getPathWithSortingOption('')];
16
+ }
17
+ return [];
18
+ }
19
+ catch (error) {
20
+ console.error('Error generating URLs for RankedUnfiltered:', error);
21
+ return [];
15
22
  }
16
- return [];
17
23
  }
18
24
  get filterCombination() {
19
25
  return FilterCombinations.RANKED_UNFILTERED;
@@ -17,6 +17,7 @@ export class BaseSitemapUrlGeneratorManager {
17
17
  for (const presenter of this.presenters.values()) {
18
18
  const count = presenter.getFragments().length;
19
19
  this.filterKeyValueCounts.set(presenter.filterKey, count);
20
+ console.debug(`Set filter key value count for ${presenter.filterKey}: ${count}`); // eslint-disable-line no-console
20
21
  }
21
22
  }
22
23
  getPolicies() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@studyportals/fawkes",
3
- "version": "8.7.2-14",
3
+ "version": "8.7.2-15",
4
4
  "description": "A package to centralize SEO related logic for SBLP and Sitemap Generator.",
5
5
  "files": [
6
6
  "./dist"