@studyportals/fawkes 7.2.2-21 → 7.2.2-22

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.
@@ -3,6 +3,7 @@ export declare enum FilterCombinations {
3
3
  AREA_ATTENDANCE = "areaAttendance",
4
4
  AREA_DISCIPLINE = "areaDiscipline",
5
5
  COUNTRY = "country",
6
+ DEGREE = "degree",
6
7
  COUNTRY_DEGREE = "countryDegree",
7
8
  COUNTRY_DURATION = "countryDuration",
8
9
  COUNTRY_FORMAT = "countryFormat",
@@ -4,6 +4,7 @@ export var FilterCombinations;
4
4
  FilterCombinations["AREA_ATTENDANCE"] = "areaAttendance";
5
5
  FilterCombinations["AREA_DISCIPLINE"] = "areaDiscipline";
6
6
  FilterCombinations["COUNTRY"] = "country";
7
+ FilterCombinations["DEGREE"] = "degree";
7
8
  FilterCombinations["COUNTRY_DEGREE"] = "countryDegree";
8
9
  FilterCombinations["COUNTRY_DURATION"] = "countryDuration";
9
10
  FilterCombinations["COUNTRY_FORMAT"] = "countryFormat";
@@ -1,5 +1,6 @@
1
1
  import { Area, Attendance, AttendanceDegree, Continent, ContinentTuitionFee, Country, CountryAttendance, CountryAttendanceDegree, CountryDegree, CountryDuration, CountryDurationDegree, CountryEducationalForm, CountryFormat, CountryTuitionFee, DegreeAttendanceDiscipline, DegreeCountryAttendance, DegreeCountryDiscipline, DegreeCountryTuitionFee, Discipline, DisciplineArea, DisciplineAttendance, DisciplineContinent, DisciplineCountry, DisciplineCountryEducationalForm, DisciplineDegree, DisciplineDuration, DisciplineEducationalForm, DisciplineFormat, DisciplineTuitionFee, DisciplineTuitionFeeAttendance, SpecialProgrammes, TuitionFee, Unfiltered } from './policies';
2
2
  import { DependencyTypes } from '../enums/DependencyTypes';
3
+ import { Degree } from './policies/Degree';
3
4
  export class SearchIndexabilityManager {
4
5
  policies;
5
6
  constructor(portalType, seoInfoBase, filterState, applicationState) {
@@ -25,6 +26,7 @@ export class SearchIndexabilityManager {
25
26
  new CountryEducationalForm(dependencies),
26
27
  new CountryFormat(dependencies),
27
28
  new CountryTuitionFee(dependencies),
29
+ new Degree(dependencies),
28
30
  new DegreeAttendanceDiscipline(dependencies),
29
31
  new DegreeCountryAttendance(dependencies),
30
32
  new DegreeCountryDiscipline(dependencies),
@@ -0,0 +1,15 @@
1
+ import { FilterKey } from '@studyportals/search-filters';
2
+ import { OnlyFiltersSelectedRule } from '../../common/rules/OnlyFiltersSelectedRule';
3
+ import { SingleValueSelectedForFilterRule } from '../../common/rules/SingleValueSelectedForFilterRule';
4
+ import { FilterCombinations } from '../../enums/FilterCombinations';
5
+ import { ProgrammesBaseIndexabilityPolicy } from '../ProgrammesBaseIndexabilityPolicy';
6
+ import { IProgrammeSeoDependencies } from '../types/IProgrammeSeoDependencies';
7
+ export declare class Degree extends ProgrammesBaseIndexabilityPolicy {
8
+ readonly name: string;
9
+ readonly description: string;
10
+ readonly filterKeys: FilterKey[];
11
+ protected readonly rules: (SingleValueSelectedForFilterRule | OnlyFiltersSelectedRule)[];
12
+ constructor(dependencies: IProgrammeSeoDependencies);
13
+ protected generateUrls(): Promise<string[]>;
14
+ get filterCombination(): FilterCombinations;
15
+ }
@@ -0,0 +1,38 @@
1
+ import { FilterKey } from '@studyportals/search-filters';
2
+ import { OnlyFiltersSelectedRule } from '../../common/rules/OnlyFiltersSelectedRule';
3
+ import { SingleValueSelectedForFilterRule } from '../../common/rules/SingleValueSelectedForFilterRule';
4
+ import { FilterCombinations } from '../../enums/FilterCombinations';
5
+ import { ProgrammesBaseIndexabilityPolicy } from '../ProgrammesBaseIndexabilityPolicy';
6
+ import { DegreePresenter } from '../../presenters/DegreePresenter';
7
+ export class Degree extends ProgrammesBaseIndexabilityPolicy {
8
+ name = 'Degree Policy';
9
+ description = 'Controls indexing of pages filtered by degree.';
10
+ filterKeys = [FilterKey.DEGREE_TYPE];
11
+ rules = [
12
+ new SingleValueSelectedForFilterRule(FilterKey.DEGREE_TYPE),
13
+ new OnlyFiltersSelectedRule([FilterKey.DEGREE_TYPE])
14
+ ];
15
+ constructor(dependencies) {
16
+ super(dependencies);
17
+ this.initateBaseRules();
18
+ }
19
+ async generateUrls() {
20
+ const degreeFragments = DegreePresenter.getInstance().getFragments();
21
+ const paths = [];
22
+ for (const pageNumber of this.indexablePageNumbers) {
23
+ for (const degree of degreeFragments) {
24
+ const filterKeyValues = new Map([
25
+ [FilterKey.DEGREE_TYPE, [degree.id]],
26
+ ]);
27
+ const result = await this.checkRulesForSitemapWithPageNumber(filterKeyValues, pageNumber);
28
+ if (result) {
29
+ paths.push(this.getPathWithPageNumber(degree.path, pageNumber));
30
+ }
31
+ }
32
+ }
33
+ return paths;
34
+ }
35
+ get filterCombination() {
36
+ return FilterCombinations.DEGREE;
37
+ }
38
+ }
@@ -13,6 +13,7 @@ import { SpecialProgrammesPresenter } from '../presenters/SpecialProgrammesPrese
13
13
  import { DurationPresenter } from '../presenters/DurationPresenter';
14
14
  import { EducationalFormPresenter } from '../presenters/EducationalFormPresenter';
15
15
  import { FormatPresenter } from '../presenters/FormatPresenter';
16
+ import { Degree } from '../programmes/policies/Degree';
16
17
  export class ProgrammesSitemapUrlGeneratorManager extends BaseSitemapUrlGeneratorManager {
17
18
  portalType;
18
19
  policies;
@@ -34,6 +35,7 @@ export class ProgrammesSitemapUrlGeneratorManager extends BaseSitemapUrlGenerato
34
35
  new Country(dependencies),
35
36
  new CountryAttendance(dependencies),
36
37
  new Discipline(dependencies),
38
+ new Degree(dependencies),
37
39
  new SpecialProgrammes(dependencies),
38
40
  new TuitionFee(dependencies),
39
41
  new Unfiltered(dependencies),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@studyportals/fawkes",
3
- "version": "7.2.2-21",
3
+ "version": "7.2.2-22",
4
4
  "description": "A package to centralize SEO related logic for SBLP and Sitemap Generator.",
5
5
  "files": [
6
6
  "./dist"