@studyportals/fawkes 7.5.0 → 7.5.1-2
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.
- package/README.md +176 -176
- package/dist/src/enums/FilterCombinations.d.ts +23 -1
- package/dist/src/enums/FilterCombinations.js +23 -1
- package/dist/src/organisations/OrganisationsRuleBasedIndexabilityPolicy.d.ts +11 -0
- package/dist/src/organisations/OrganisationsRuleBasedIndexabilityPolicy.js +19 -0
- package/dist/src/organisations/rules/OnlineAttendanceRule.d.ts +6 -0
- package/dist/src/organisations/rules/OnlineAttendanceRule.js +14 -0
- package/dist/src/presenters/AttendancePresenter.js +4 -0
- package/dist/src/presenters/FormatPresenter.js +4 -1
- package/dist/src/presenters/SpecialProgrammesPresenter.js +4 -0
- package/dist/src/programmes/IProgrammeSearchApplicationState.d.ts +4 -0
- package/dist/src/programmes/IProgrammeSearchApplicationState.js +1 -0
- package/dist/src/programmes/IProgrammeSearchDependencies.d.ts +7 -0
- package/dist/src/programmes/IProgrammeSearchDependencies.js +1 -0
- package/dist/src/programmes/IProgrammesSeoDependencies.d.ts +2 -0
- package/dist/src/programmes/IProgrammesSeoDependencies.js +1 -0
- package/dist/src/programmes/ProgrammesBaseIndexabilityPolicy.js +1 -0
- package/dist/src/programmes/SearchIndexabilityManager.js +27 -3
- package/dist/src/programmes/policies/AttendanceArea.d.ts +16 -0
- package/dist/src/programmes/policies/AttendanceArea.js +48 -0
- package/dist/src/programmes/policies/AttendanceContinent.d.ts +16 -0
- package/dist/src/programmes/policies/AttendanceContinent.js +46 -0
- package/dist/src/programmes/policies/AttendanceDegree.d.ts +3 -3
- package/dist/src/programmes/policies/AttendanceDegree.js +8 -5
- package/dist/src/programmes/policies/AttendanceDuration.d.ts +16 -0
- package/dist/src/programmes/policies/AttendanceDuration.js +48 -0
- package/dist/src/programmes/policies/AttendanceFormat.d.ts +16 -0
- package/dist/src/programmes/policies/AttendanceFormat.js +48 -0
- package/dist/src/programmes/policies/AttendanceTuitionFee.d.ts +17 -0
- package/dist/src/programmes/policies/AttendanceTuitionFee.js +51 -0
- package/dist/src/programmes/policies/ContinentDuration.d.ts +15 -0
- package/dist/src/programmes/policies/ContinentDuration.js +46 -0
- package/dist/src/programmes/policies/ContinentFormat.d.ts +16 -0
- package/dist/src/programmes/policies/ContinentFormat.js +48 -0
- package/dist/src/programmes/policies/ContinentSpecialProgrammes.d.ts +16 -0
- package/dist/src/programmes/policies/ContinentSpecialProgrammes.js +48 -0
- package/dist/src/programmes/policies/CountryAttendanceDegree.js +1 -1
- package/dist/src/programmes/policies/CountryDuration.d.ts +2 -2
- package/dist/src/programmes/policies/CountryDuration.js +6 -4
- package/dist/src/programmes/policies/CountryDurationDegree.js +1 -1
- package/dist/src/programmes/policies/CountryEducationalForm.js +1 -1
- package/dist/src/programmes/policies/CountrySpecialProgrammes.d.ts +16 -0
- package/dist/src/programmes/policies/CountrySpecialProgrammes.js +48 -0
- package/dist/src/programmes/policies/DegreeArea.d.ts +15 -0
- package/dist/src/programmes/policies/DegreeArea.js +46 -0
- package/dist/src/programmes/policies/DegreeAreaTuitionFee.d.ts +15 -0
- package/dist/src/programmes/policies/DegreeAreaTuitionFee.js +52 -0
- package/dist/src/programmes/policies/DegreeAttendanceDiscipline.d.ts +2 -1
- package/dist/src/programmes/policies/DegreeAttendanceDiscipline.js +12 -12
- package/dist/src/programmes/policies/DegreeAttendanceFormat.d.ts +15 -0
- package/dist/src/programmes/policies/DegreeAttendanceFormat.js +52 -0
- package/dist/src/programmes/policies/DegreeAttendanceSpecialProgrammes.d.ts +16 -0
- package/dist/src/programmes/policies/DegreeAttendanceSpecialProgrammes.js +56 -0
- package/dist/src/programmes/policies/DegreeAttendanceTuitionFee.d.ts +18 -0
- package/dist/src/programmes/policies/DegreeAttendanceTuitionFee.js +59 -0
- package/dist/src/programmes/policies/DegreeContinent.d.ts +16 -0
- package/dist/src/programmes/policies/DegreeContinent.js +46 -0
- package/dist/src/programmes/policies/DegreeContinentTuitionFee.d.ts +16 -0
- package/dist/src/programmes/policies/DegreeContinentTuitionFee.js +52 -0
- package/dist/src/programmes/policies/DegreeDuration.d.ts +17 -0
- package/dist/src/programmes/policies/DegreeDuration.js +50 -0
- package/dist/src/programmes/policies/DegreeFormat.d.ts +16 -0
- package/dist/src/programmes/policies/DegreeFormat.js +49 -0
- package/dist/src/programmes/policies/DegreeFormatTuitionFee.d.ts +16 -0
- package/dist/src/programmes/policies/DegreeFormatTuitionFee.js +52 -0
- package/dist/src/programmes/policies/DegreeSpecialProgrammes.d.ts +15 -0
- package/dist/src/programmes/policies/DegreeSpecialProgrammes.js +48 -0
- package/dist/src/programmes/policies/DegreeTuitionFee.d.ts +16 -0
- package/dist/src/programmes/policies/DegreeTuitionFee.js +49 -0
- package/dist/src/programmes/policies/DisciplineArea.d.ts +1 -1
- package/dist/src/programmes/policies/DisciplineArea.js +1 -1
- package/dist/src/programmes/policies/DisciplineContinentAttendance.d.ts +16 -0
- package/dist/src/programmes/policies/DisciplineContinentAttendance.js +54 -0
- package/dist/src/programmes/policies/DisciplineCountryAttendance.d.ts +16 -0
- package/dist/src/programmes/policies/DisciplineCountryAttendance.js +54 -0
- package/dist/src/programmes/policies/DisciplineCountryDegree.js +1 -1
- package/dist/src/programmes/policies/DisciplineCountryEducationalForm.js +1 -1
- package/dist/src/programmes/policies/DisciplineCountryFormat.d.ts +15 -0
- package/dist/src/programmes/policies/DisciplineCountryFormat.js +52 -0
- package/dist/src/programmes/policies/DisciplineEducationalForm.js +1 -1
- package/dist/src/programmes/policies/DisciplineSpecialProgrammes.d.ts +16 -0
- package/dist/src/programmes/policies/DisciplineSpecialProgrammes.js +48 -0
- package/dist/src/programmes/policies/Duration.d.ts +15 -0
- package/dist/src/programmes/policies/Duration.js +38 -0
- package/dist/src/programmes/policies/Format.d.ts +15 -0
- package/dist/src/programmes/policies/Format.js +38 -0
- package/dist/src/programmes/policies/SpecialProgrammes.d.ts +1 -2
- package/dist/src/programmes/policies/SpecialProgrammes.js +0 -2
- package/dist/src/programmes/policies/index.d.ts +26 -1
- package/dist/src/programmes/policies/index.js +26 -1
- package/dist/src/programmes/rules/BlendedOrOnlineAttendanceRule.d.ts +6 -0
- package/dist/src/programmes/rules/BlendedOrOnlineAttendanceRule.js +18 -0
- package/dist/src/programmes/rules/DegreeCountrySpecificRule.d.ts +10 -0
- package/dist/src/programmes/rules/DegreeCountrySpecificRule.js +43 -0
- package/dist/src/programmes/rules/DegreeCountryTuitionFeeRule.d.ts +11 -0
- package/dist/src/programmes/rules/DegreeCountryTuitionFeeRule.js +41 -0
- package/dist/src/programmes/rules/ErasmusOrExecutiveSpecialProgrammeRule.d.ts +6 -0
- package/dist/src/programmes/rules/ErasmusOrExecutiveSpecialProgrammeRule.js +19 -0
- package/dist/src/programmes/rules/ErasmusOrJointSpecialProgrammesRule.js +2 -2
- package/dist/src/programmes/rules/ErasmusSpecialProgrammeRule.d.ts +6 -0
- package/dist/src/programmes/rules/ErasmusSpecialProgrammeRule.js +19 -0
- package/dist/src/programmes/rules/MBACountryAttendanceRule.d.ts +11 -0
- package/dist/src/programmes/rules/MBACountryAttendanceRule.js +40 -0
- package/dist/src/programmes/rules/MasterOfEducationCountryDisciplineRule.d.ts +11 -0
- package/dist/src/programmes/rules/MasterOfEducationCountryDisciplineRule.js +69 -0
- package/dist/src/programmes/rules/MasterOfLawsCountryAttendanceRule.d.ts +12 -0
- package/dist/src/programmes/rules/MasterOfLawsCountryAttendanceRule.js +44 -0
- package/dist/src/programmes/rules/MasterOfLawsCountryTuitionFeeRule.d.ts +12 -0
- package/dist/src/programmes/rules/MasterOfLawsCountryTuitionFeeRule.js +47 -0
- package/dist/src/programmes/rules/MasterOfPhilosophyCountryAttendanceRule.d.ts +12 -0
- package/dist/src/programmes/rules/MasterOfPhilosophyCountryAttendanceRule.js +44 -0
- package/dist/src/programmes/rules/OneOrTwoYearDurationRule.d.ts +6 -0
- package/dist/src/programmes/rules/OneOrTwoYearDurationRule.js +19 -0
- package/dist/src/programmes/rules/OneYearOnlyRule.d.ts +11 -0
- package/dist/src/programmes/rules/OneYearOnlyRule.js +34 -0
- package/dist/src/programmes/rules/OnlineAttendanceRule.d.ts +6 -0
- package/dist/src/programmes/rules/OnlineAttendanceRule.js +15 -0
- package/dist/src/programmes/rules/TwoYearDurationRule.d.ts +6 -0
- package/dist/src/programmes/rules/TwoYearDurationRule.js +19 -0
- package/dist/src/sitemap-generator/ProgrammesSitemapUrlGeneratorManager.js +27 -3
- package/package.json +105 -105
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { FilterKey } from '@studyportals/search-filters/server-side';
|
|
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 { DisciplinePresenter } from '../../presenters/DisciplinePresenter';
|
|
7
|
+
import { CountryPresenter } from '../../presenters/CountryPresenter';
|
|
8
|
+
import { FormatPresenter } from '../../presenters/FormatPresenter';
|
|
9
|
+
export class DisciplineCountryFormat extends ProgrammesBaseIndexabilityPolicy {
|
|
10
|
+
name = 'Discipline Country Format Policy';
|
|
11
|
+
description = 'Determines indexing rules for pages filtered by both discipline, country, and format.';
|
|
12
|
+
filterKeys = [FilterKey.DISCIPLINES, FilterKey.COUNTRY, FilterKey.ATTENDANCE];
|
|
13
|
+
rules = [
|
|
14
|
+
new SingleValueSelectedForFilterRule(FilterKey.DISCIPLINES),
|
|
15
|
+
new SingleValueSelectedForFilterRule(FilterKey.COUNTRY),
|
|
16
|
+
new SingleValueSelectedForFilterRule(FilterKey.ATTENDANCE),
|
|
17
|
+
new OnlyFiltersSelectedRule([FilterKey.DISCIPLINES, FilterKey.COUNTRY, FilterKey.ATTENDANCE]),
|
|
18
|
+
];
|
|
19
|
+
constructor(dependencies) {
|
|
20
|
+
super(dependencies);
|
|
21
|
+
this.initateBaseRules();
|
|
22
|
+
}
|
|
23
|
+
async generateUrls() {
|
|
24
|
+
const disciplineFragments = DisciplinePresenter.getInstance().getFragments();
|
|
25
|
+
const countryFragments = CountryPresenter.getInstance().getFragments();
|
|
26
|
+
const formatFragments = FormatPresenter.getInstance().getFragments();
|
|
27
|
+
const paths = [];
|
|
28
|
+
const allowedFormatIds = ['parttime'];
|
|
29
|
+
const allowedFormats = formatFragments.filter(a => allowedFormatIds.includes(a.id));
|
|
30
|
+
for (const pageNumber of this.indexablePageNumbers) {
|
|
31
|
+
for (const discipline of disciplineFragments) {
|
|
32
|
+
for (const country of countryFragments) {
|
|
33
|
+
for (const format of allowedFormats) {
|
|
34
|
+
const filterKeyValues = new Map([
|
|
35
|
+
[FilterKey.DISCIPLINES, [discipline.id]],
|
|
36
|
+
[FilterKey.COUNTRY, [country.id]],
|
|
37
|
+
[FilterKey.ATTENDANCE, [format.id]]
|
|
38
|
+
]);
|
|
39
|
+
const result = await this.checkRulesForSitemapWithPageNumber(filterKeyValues, pageNumber);
|
|
40
|
+
if (result) {
|
|
41
|
+
paths.push(this.getPathWithPageNumber(`${format.path}/${discipline.path}/${country.path}`, pageNumber));
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return paths;
|
|
48
|
+
}
|
|
49
|
+
get filterCombination() {
|
|
50
|
+
return FilterCombinations.DISCIPLINE_COUNTRY_ATTENDANCE;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -8,7 +8,7 @@ import { DisciplinePresenter } from '../../presenters/DisciplinePresenter';
|
|
|
8
8
|
import { EducationalFormPresenter } from '../../presenters/EducationalFormPresenter';
|
|
9
9
|
export class DisciplineEducationalForm extends ProgrammesBaseIndexabilityPolicy {
|
|
10
10
|
name = 'Discipline Educational Form Policy';
|
|
11
|
-
description = `Determines indexing rules for pages filtered by both discipline,
|
|
11
|
+
description = `Determines indexing rules for pages filtered by both discipline,
|
|
12
12
|
and educational form (academic, semester, summer school, etc.).`;
|
|
13
13
|
filterKeys = [FilterKey.DISCIPLINES, FilterKey.EDUCATIONAL_FORM];
|
|
14
14
|
rules = [
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FilterKey } from '@studyportals/search-filters/server-side';
|
|
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
|
+
import { ErasmusSpecialProgrammeRule } from '../rules/ErasmusSpecialProgrammeRule';
|
|
8
|
+
export declare class DisciplineSpecialProgrammes extends ProgrammesBaseIndexabilityPolicy {
|
|
9
|
+
readonly name: string;
|
|
10
|
+
readonly description: string;
|
|
11
|
+
readonly filterKeys: FilterKey[];
|
|
12
|
+
protected readonly rules: (SingleValueSelectedForFilterRule | OnlyFiltersSelectedRule | ErasmusSpecialProgrammeRule)[];
|
|
13
|
+
constructor(dependencies: IProgrammeSeoDependencies);
|
|
14
|
+
protected generateUrls(): Promise<string[]>;
|
|
15
|
+
get filterCombination(): FilterCombinations;
|
|
16
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { FilterKey } from '@studyportals/search-filters/server-side';
|
|
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 { DisciplinePresenter } from '../../presenters/DisciplinePresenter';
|
|
7
|
+
import { SpecialProgrammesPresenter } from '../../presenters/SpecialProgrammesPresenter';
|
|
8
|
+
import { ErasmusSpecialProgrammeRule } from '../rules/ErasmusSpecialProgrammeRule';
|
|
9
|
+
export class DisciplineSpecialProgrammes extends ProgrammesBaseIndexabilityPolicy {
|
|
10
|
+
name = 'Discipline Special Programmes Policy';
|
|
11
|
+
description = 'Determines indexing rules for pages filtered by discipline and special programmes (Erasmus Mundus).';
|
|
12
|
+
filterKeys = [FilterKey.DISCIPLINES, FilterKey.SPECIAL_PROGRAMMES];
|
|
13
|
+
rules = [
|
|
14
|
+
new SingleValueSelectedForFilterRule(FilterKey.SPECIAL_PROGRAMMES),
|
|
15
|
+
new SingleValueSelectedForFilterRule(FilterKey.DISCIPLINES),
|
|
16
|
+
new OnlyFiltersSelectedRule([FilterKey.SPECIAL_PROGRAMMES, FilterKey.DISCIPLINES]),
|
|
17
|
+
new ErasmusSpecialProgrammeRule()
|
|
18
|
+
];
|
|
19
|
+
constructor(dependencies) {
|
|
20
|
+
super(dependencies);
|
|
21
|
+
this.initateBaseRules();
|
|
22
|
+
}
|
|
23
|
+
async generateUrls() {
|
|
24
|
+
const specialProgrammesFragments = SpecialProgrammesPresenter.getInstance().getFragments();
|
|
25
|
+
const disciplineFragments = DisciplinePresenter.getInstance().getFragments();
|
|
26
|
+
const paths = [];
|
|
27
|
+
const validSpecialProgrammesIds = ['erasmus'];
|
|
28
|
+
const validSpecialProgrammes = specialProgrammesFragments.filter(specialProgramme => validSpecialProgrammesIds.includes(specialProgramme.id));
|
|
29
|
+
for (const pageNumber of this.indexablePageNumbers) {
|
|
30
|
+
for (const specialProgramme of validSpecialProgrammes) {
|
|
31
|
+
for (const discipline of disciplineFragments) {
|
|
32
|
+
const filterKeyValues = new Map([
|
|
33
|
+
[FilterKey.SPECIAL_PROGRAMMES, [specialProgramme.id]],
|
|
34
|
+
[FilterKey.DISCIPLINES, [discipline.id]]
|
|
35
|
+
]);
|
|
36
|
+
const result = await this.checkRulesForSitemapWithPageNumber(filterKeyValues, pageNumber);
|
|
37
|
+
if (result) {
|
|
38
|
+
paths.push(this.getPathWithPageNumber(`${discipline.path}/${specialProgramme.path}`, pageNumber));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return paths;
|
|
44
|
+
}
|
|
45
|
+
get filterCombination() {
|
|
46
|
+
return FilterCombinations.DISCIPLINE_SPECIAL_PROGRAMMES;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FilterKey } from '@studyportals/search-filters/server-side';
|
|
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 Duration 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 { DurationFilterOptionValue, FilterKey } from '@studyportals/search-filters/server-side';
|
|
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 { DurationPresenter } from '../../presenters/DurationPresenter';
|
|
7
|
+
export class Duration extends ProgrammesBaseIndexabilityPolicy {
|
|
8
|
+
name = 'Duration Policy';
|
|
9
|
+
description = 'Governs indexing of duration-level filtered pages. (1 year - 2 year)';
|
|
10
|
+
filterKeys = [FilterKey.DURATION];
|
|
11
|
+
rules = [
|
|
12
|
+
new SingleValueSelectedForFilterRule(FilterKey.DURATION),
|
|
13
|
+
new OnlyFiltersSelectedRule([FilterKey.DURATION])
|
|
14
|
+
];
|
|
15
|
+
constructor(dependencies) {
|
|
16
|
+
super(dependencies);
|
|
17
|
+
this.initateBaseRules();
|
|
18
|
+
}
|
|
19
|
+
async generateUrls() {
|
|
20
|
+
const durationFragments = DurationPresenter.getInstance().getFragments();
|
|
21
|
+
const allowedDurationIds = [DurationFilterOptionValue.ONE_YEAR, DurationFilterOptionValue.TWO_YEARS];
|
|
22
|
+
const allowedDurations = durationFragments.filter(duration => allowedDurationIds.includes(duration.id));
|
|
23
|
+
const paths = [];
|
|
24
|
+
for (const pageNumber of this.indexablePageNumbers) {
|
|
25
|
+
for (const duration of allowedDurations) {
|
|
26
|
+
const filterKeyValues = new Map([[FilterKey.DURATION, [duration.id]]]);
|
|
27
|
+
const result = await this.checkRulesForSitemapWithPageNumber(filterKeyValues, pageNumber);
|
|
28
|
+
if (result) {
|
|
29
|
+
paths.push(this.getPathWithPageNumber(duration.path, pageNumber));
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return paths;
|
|
34
|
+
}
|
|
35
|
+
get filterCombination() {
|
|
36
|
+
return FilterCombinations.DURATION;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FilterKey } from '@studyportals/search-filters/server-side';
|
|
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 Format 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, FormatFilterOptionValue } from '@studyportals/search-filters/server-side';
|
|
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 { FormatPresenter } from '../../presenters/FormatPresenter';
|
|
7
|
+
export class Format extends ProgrammesBaseIndexabilityPolicy {
|
|
8
|
+
name = 'Format Policy';
|
|
9
|
+
description = 'Governs indexing of format-level filtered pages.';
|
|
10
|
+
filterKeys = [FilterKey.ATTENDANCE];
|
|
11
|
+
rules = [
|
|
12
|
+
new SingleValueSelectedForFilterRule(FilterKey.ATTENDANCE),
|
|
13
|
+
new OnlyFiltersSelectedRule([FilterKey.ATTENDANCE])
|
|
14
|
+
];
|
|
15
|
+
constructor(dependencies) {
|
|
16
|
+
super(dependencies);
|
|
17
|
+
this.initateBaseRules();
|
|
18
|
+
}
|
|
19
|
+
async generateUrls() {
|
|
20
|
+
const formatFragments = FormatPresenter.getInstance().getFragments();
|
|
21
|
+
const allowedFormatIds = [FormatFilterOptionValue.PART_TIME, FormatFilterOptionValue.FULL_TIME];
|
|
22
|
+
const allowedFormats = formatFragments.filter(format => allowedFormatIds.includes(format.id));
|
|
23
|
+
const paths = [];
|
|
24
|
+
for (const pageNumber of this.indexablePageNumbers) {
|
|
25
|
+
for (const format of allowedFormats) {
|
|
26
|
+
const filterKeyValues = new Map([[FilterKey.ATTENDANCE, [format.id]]]);
|
|
27
|
+
const result = await this.checkRulesForSitemapWithPageNumber(filterKeyValues, pageNumber);
|
|
28
|
+
if (result) {
|
|
29
|
+
paths.push(this.getPathWithPageNumber(format.path, pageNumber));
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return paths;
|
|
34
|
+
}
|
|
35
|
+
get filterCombination() {
|
|
36
|
+
return FilterCombinations.FORMAT;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -2,14 +2,13 @@ import { FilterKey } from '@studyportals/search-filters/server-side';
|
|
|
2
2
|
import { OnlyFiltersSelectedRule } from '../../common/rules/OnlyFiltersSelectedRule';
|
|
3
3
|
import { SingleValueSelectedForFilterRule } from '../../common/rules/SingleValueSelectedForFilterRule';
|
|
4
4
|
import { FilterCombinations } from '../../enums/FilterCombinations';
|
|
5
|
-
import { ErasmusOrJointSpecialProgrammesRule } from '../rules/ErasmusOrJointSpecialProgrammesRule';
|
|
6
5
|
import { ProgrammesBaseIndexabilityPolicy } from '../ProgrammesBaseIndexabilityPolicy';
|
|
7
6
|
import { IProgrammeSeoDependencies } from '../types/IProgrammeSeoDependencies';
|
|
8
7
|
export declare class SpecialProgrammes extends ProgrammesBaseIndexabilityPolicy {
|
|
9
8
|
readonly name: string;
|
|
10
9
|
readonly description: string;
|
|
11
10
|
readonly filterKeys: FilterKey[];
|
|
12
|
-
protected readonly rules: (SingleValueSelectedForFilterRule | OnlyFiltersSelectedRule
|
|
11
|
+
protected readonly rules: (SingleValueSelectedForFilterRule | OnlyFiltersSelectedRule)[];
|
|
13
12
|
constructor(dependencies: IProgrammeSeoDependencies);
|
|
14
13
|
protected generateUrls(): Promise<string[]>;
|
|
15
14
|
get filterCombination(): FilterCombinations;
|
|
@@ -2,7 +2,6 @@ import { FilterKey } from '@studyportals/search-filters/server-side';
|
|
|
2
2
|
import { OnlyFiltersSelectedRule } from '../../common/rules/OnlyFiltersSelectedRule';
|
|
3
3
|
import { SingleValueSelectedForFilterRule } from '../../common/rules/SingleValueSelectedForFilterRule';
|
|
4
4
|
import { FilterCombinations } from '../../enums/FilterCombinations';
|
|
5
|
-
import { ErasmusOrJointSpecialProgrammesRule } from '../rules/ErasmusOrJointSpecialProgrammesRule';
|
|
6
5
|
import { ProgrammesBaseIndexabilityPolicy } from '../ProgrammesBaseIndexabilityPolicy';
|
|
7
6
|
import { SpecialProgrammesPresenter } from '../../presenters/SpecialProgrammesPresenter';
|
|
8
7
|
export class SpecialProgrammes extends ProgrammesBaseIndexabilityPolicy {
|
|
@@ -12,7 +11,6 @@ export class SpecialProgrammes extends ProgrammesBaseIndexabilityPolicy {
|
|
|
12
11
|
rules = [
|
|
13
12
|
new SingleValueSelectedForFilterRule(FilterKey.SPECIAL_PROGRAMMES),
|
|
14
13
|
new OnlyFiltersSelectedRule([FilterKey.SPECIAL_PROGRAMMES]),
|
|
15
|
-
new ErasmusOrJointSpecialProgrammesRule()
|
|
16
14
|
];
|
|
17
15
|
constructor(dependencies) {
|
|
18
16
|
super(dependencies);
|
|
@@ -18,7 +18,6 @@ export * from './DegreeCountryDiscipline';
|
|
|
18
18
|
export * from './DegreeCountryTuitionFee';
|
|
19
19
|
export * from './DisciplineDegree';
|
|
20
20
|
export * from './Discipline';
|
|
21
|
-
export * from './DisciplineArea';
|
|
22
21
|
export * from './DisciplineAttendance';
|
|
23
22
|
export * from './DisciplineContinent';
|
|
24
23
|
export * from './DisciplineCountry';
|
|
@@ -32,3 +31,29 @@ export * from './DisciplineTuitionFeeAttendance';
|
|
|
32
31
|
export * from './SpecialProgrammes';
|
|
33
32
|
export * from './TuitionFee';
|
|
34
33
|
export * from './Unfiltered';
|
|
34
|
+
export * from './Format';
|
|
35
|
+
export * from './DegreeFormat';
|
|
36
|
+
export * from './DegreeAttendanceTuitionFee';
|
|
37
|
+
export * from './DegreeArea';
|
|
38
|
+
export * from './DegreeTuitionFee';
|
|
39
|
+
export * from './DegreeAttendanceTuitionFee';
|
|
40
|
+
export * from './DegreeContinent';
|
|
41
|
+
export * from './AttendanceTuitionFee';
|
|
42
|
+
export * from './Duration';
|
|
43
|
+
export * from './AttendanceDuration';
|
|
44
|
+
export * from './DegreeAreaTuitionFee';
|
|
45
|
+
export * from './DisciplineContinentAttendance';
|
|
46
|
+
export * from './DegreeContinentTuitionFee';
|
|
47
|
+
export * from './AttendanceFormat';
|
|
48
|
+
export * from './ContinentFormat';
|
|
49
|
+
export * from './AttendanceContinent';
|
|
50
|
+
export * from './DegreeDuration';
|
|
51
|
+
export * from './ContinentSpecialProgrammes';
|
|
52
|
+
export * from './CountrySpecialProgrammes';
|
|
53
|
+
export * from './AttendanceArea';
|
|
54
|
+
export * from './DegreeFormatTuitionFee';
|
|
55
|
+
export * from './ContinentDuration';
|
|
56
|
+
export * from './DegreeAttendanceFormat';
|
|
57
|
+
export * from './DisciplineCountryAttendance';
|
|
58
|
+
export * from './DisciplineCountryFormat';
|
|
59
|
+
export * from './DegreeSpecialProgrammes';
|
|
@@ -18,7 +18,6 @@ export * from './DegreeCountryDiscipline';
|
|
|
18
18
|
export * from './DegreeCountryTuitionFee';
|
|
19
19
|
export * from './DisciplineDegree';
|
|
20
20
|
export * from './Discipline';
|
|
21
|
-
export * from './DisciplineArea';
|
|
22
21
|
export * from './DisciplineAttendance';
|
|
23
22
|
export * from './DisciplineContinent';
|
|
24
23
|
export * from './DisciplineCountry';
|
|
@@ -32,3 +31,29 @@ export * from './DisciplineTuitionFeeAttendance';
|
|
|
32
31
|
export * from './SpecialProgrammes';
|
|
33
32
|
export * from './TuitionFee';
|
|
34
33
|
export * from './Unfiltered';
|
|
34
|
+
export * from './Format';
|
|
35
|
+
export * from './DegreeFormat';
|
|
36
|
+
export * from './DegreeAttendanceTuitionFee';
|
|
37
|
+
export * from './DegreeArea';
|
|
38
|
+
export * from './DegreeTuitionFee';
|
|
39
|
+
export * from './DegreeAttendanceTuitionFee';
|
|
40
|
+
export * from './DegreeContinent';
|
|
41
|
+
export * from './AttendanceTuitionFee';
|
|
42
|
+
export * from './Duration';
|
|
43
|
+
export * from './AttendanceDuration';
|
|
44
|
+
export * from './DegreeAreaTuitionFee';
|
|
45
|
+
export * from './DisciplineContinentAttendance';
|
|
46
|
+
export * from './DegreeContinentTuitionFee';
|
|
47
|
+
export * from './AttendanceFormat';
|
|
48
|
+
export * from './ContinentFormat';
|
|
49
|
+
export * from './AttendanceContinent';
|
|
50
|
+
export * from './DegreeDuration';
|
|
51
|
+
export * from './ContinentSpecialProgrammes';
|
|
52
|
+
export * from './CountrySpecialProgrammes';
|
|
53
|
+
export * from './AttendanceArea';
|
|
54
|
+
export * from './DegreeFormatTuitionFee';
|
|
55
|
+
export * from './ContinentDuration';
|
|
56
|
+
export * from './DegreeAttendanceFormat';
|
|
57
|
+
export * from './DisciplineCountryAttendance';
|
|
58
|
+
export * from './DisciplineCountryFormat';
|
|
59
|
+
export * from './DegreeSpecialProgrammes';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FilterKey } from '@studyportals/search-filters/server-side';
|
|
2
|
+
import { AttendanceFilterOptionValue } from '@studyportals/search-filters/server-side';
|
|
3
|
+
import { BaseProgrammeFilterKeyValueRule } from '../BaseProgrammeFilterKeyValueRule';
|
|
4
|
+
export class BlendedOrOnlineAttendanceRule extends BaseProgrammeFilterKeyValueRule {
|
|
5
|
+
constructor() {
|
|
6
|
+
const filterKeyValues = new Map([[
|
|
7
|
+
FilterKey.DELIVERY_METHOD,
|
|
8
|
+
[AttendanceFilterOptionValue.BLENDED, AttendanceFilterOptionValue.ONLINE]
|
|
9
|
+
]]);
|
|
10
|
+
super(filterKeyValues);
|
|
11
|
+
}
|
|
12
|
+
getName() {
|
|
13
|
+
return 'BlendedOrOnlineAttendanceRule';
|
|
14
|
+
}
|
|
15
|
+
getDescription() {
|
|
16
|
+
return 'Is indexable if the selected delivery method is blended or online.';
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ISearchDependencies } from '../../common/ISearchDependencies';
|
|
2
|
+
import { FilterKeyValuesMap } from '../../common/FilterKeyValuesMap';
|
|
3
|
+
import { BaseProgrammeRule } from '../BaseProgrammeRule';
|
|
4
|
+
export declare class DegreeCountrySpecificRule extends BaseProgrammeRule {
|
|
5
|
+
private readonly validCombinations;
|
|
6
|
+
getName(): string;
|
|
7
|
+
getDescription(): string;
|
|
8
|
+
forSearch(dependencies: ISearchDependencies): Promise<boolean>;
|
|
9
|
+
forSitemapGenerator(filterKeyValues: FilterKeyValuesMap): Promise<boolean>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { FilterKey } from '@studyportals/search-filters';
|
|
2
|
+
import { DegreeTypeFilterOptionValue } from '@studyportals/search-filters';
|
|
3
|
+
import { BaseProgrammeRule } from '../BaseProgrammeRule';
|
|
4
|
+
export class DegreeCountrySpecificRule extends BaseProgrammeRule {
|
|
5
|
+
validCombinations = {
|
|
6
|
+
[DegreeTypeFilterOptionValue.MSC]: ['82', '56', '11', '30'],
|
|
7
|
+
[DegreeTypeFilterOptionValue.MBA]: ['82', '30'],
|
|
8
|
+
[DegreeTypeFilterOptionValue.MED]: ['202', '56']
|
|
9
|
+
};
|
|
10
|
+
getName() {
|
|
11
|
+
return 'DegreeCountrySpecificRule';
|
|
12
|
+
}
|
|
13
|
+
getDescription() {
|
|
14
|
+
return 'Indexes: master-of-science (USA, Canada, Germany, UK); master-of-business-administration (USA, UK); master-of-education (Australia, Canada)';
|
|
15
|
+
}
|
|
16
|
+
forSearch(dependencies) {
|
|
17
|
+
const { seoInfoBase, filterState } = dependencies;
|
|
18
|
+
const degreeTypeValue = seoInfoBase.getFilterOptionValueBy(FilterKey.DEGREE_TYPE, filterState);
|
|
19
|
+
const countryValue = seoInfoBase.getFilterOptionValueBy(FilterKey.COUNTRY, filterState);
|
|
20
|
+
if (!degreeTypeValue || !countryValue) {
|
|
21
|
+
return Promise.resolve(false);
|
|
22
|
+
}
|
|
23
|
+
const allowedCountries = this.validCombinations[degreeTypeValue];
|
|
24
|
+
if (!allowedCountries) {
|
|
25
|
+
return Promise.resolve(false);
|
|
26
|
+
}
|
|
27
|
+
return Promise.resolve(allowedCountries.includes(countryValue));
|
|
28
|
+
}
|
|
29
|
+
forSitemapGenerator(filterKeyValues) {
|
|
30
|
+
const degreeTypeValues = filterKeyValues.get(FilterKey.DEGREE_TYPE);
|
|
31
|
+
const countryValues = filterKeyValues.get(FilterKey.COUNTRY);
|
|
32
|
+
if (!degreeTypeValues?.length || !countryValues?.length) {
|
|
33
|
+
return Promise.resolve(false);
|
|
34
|
+
}
|
|
35
|
+
const degreeTypeValue = degreeTypeValues[0];
|
|
36
|
+
const countryValue = countryValues[0];
|
|
37
|
+
const allowedCountries = this.validCombinations[degreeTypeValue];
|
|
38
|
+
if (!allowedCountries) {
|
|
39
|
+
return Promise.resolve(false);
|
|
40
|
+
}
|
|
41
|
+
return Promise.resolve(allowedCountries.includes(countryValue));
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ISearchDependencies } from '../../common/ISearchDependencies';
|
|
2
|
+
import { FilterKeyValuesMap } from '../../common/FilterKeyValuesMap';
|
|
3
|
+
import { BaseProgrammeRule } from '../BaseProgrammeRule';
|
|
4
|
+
export declare class DegreeCountryTuitionFeeRule extends BaseProgrammeRule {
|
|
5
|
+
private readonly degreeValue;
|
|
6
|
+
private readonly tuitionFeeValue;
|
|
7
|
+
getName(): string;
|
|
8
|
+
getDescription(): string;
|
|
9
|
+
forSearch(dependencies: ISearchDependencies): Promise<boolean>;
|
|
10
|
+
forSitemapGenerator(filterKeyValues: FilterKeyValuesMap): Promise<boolean>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { FilterKey } from '@studyportals/search-filters';
|
|
2
|
+
import { DegreeTypeFilterOptionValue } from '@studyportals/search-filters';
|
|
3
|
+
import { TuitionFeeFilterOptionValue } from '@studyportals/search-filters';
|
|
4
|
+
import { BaseProgrammeRule } from '../BaseProgrammeRule';
|
|
5
|
+
export class DegreeCountryTuitionFeeRule extends BaseProgrammeRule {
|
|
6
|
+
degreeValue = DegreeTypeFilterOptionValue.MBA;
|
|
7
|
+
tuitionFeeValue = TuitionFeeFilterOptionValue.ZERO_TO_TWO_THOUSAND_FIVE_HUNDRED;
|
|
8
|
+
getName() {
|
|
9
|
+
return 'DegreeCountryTuitionFeeRule';
|
|
10
|
+
}
|
|
11
|
+
getDescription() {
|
|
12
|
+
return 'Indexes: master-of-business-administration + all countries + affordable tuition (0-2500)';
|
|
13
|
+
}
|
|
14
|
+
forSearch(dependencies) {
|
|
15
|
+
const { seoInfoBase, filterState } = dependencies;
|
|
16
|
+
const degreeTypeValue = seoInfoBase.getFilterOptionValueBy(FilterKey.DEGREE_TYPE, filterState);
|
|
17
|
+
const countryValue = seoInfoBase.getFilterOptionValueBy(FilterKey.COUNTRY, filterState);
|
|
18
|
+
const tuitionFeeValue = seoInfoBase.getFilterOptionValueBy(FilterKey.TUITION_FEE, filterState);
|
|
19
|
+
if (degreeTypeValue !== this.degreeValue) {
|
|
20
|
+
return Promise.resolve(true);
|
|
21
|
+
}
|
|
22
|
+
if (!countryValue || !tuitionFeeValue) {
|
|
23
|
+
return Promise.resolve(false);
|
|
24
|
+
}
|
|
25
|
+
return Promise.resolve(tuitionFeeValue === this.tuitionFeeValue);
|
|
26
|
+
}
|
|
27
|
+
forSitemapGenerator(filterKeyValues) {
|
|
28
|
+
const degreeTypeValues = filterKeyValues.get(FilterKey.DEGREE_TYPE);
|
|
29
|
+
const countryValues = filterKeyValues.get(FilterKey.COUNTRY);
|
|
30
|
+
const tuitionFeeValues = filterKeyValues.get(FilterKey.TUITION_FEE);
|
|
31
|
+
if (!degreeTypeValues?.length || !countryValues?.length || !tuitionFeeValues?.length) {
|
|
32
|
+
return Promise.resolve(false);
|
|
33
|
+
}
|
|
34
|
+
const degreeTypeValue = degreeTypeValues[0];
|
|
35
|
+
const tuitionFeeValue = tuitionFeeValues[0];
|
|
36
|
+
if (degreeTypeValue !== this.degreeValue) {
|
|
37
|
+
return Promise.resolve(true);
|
|
38
|
+
}
|
|
39
|
+
return Promise.resolve(tuitionFeeValue === this.tuitionFeeValue);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { FilterKey } from '@studyportals/search-filters/server-side';
|
|
2
|
+
import { SpecialProgrammesFilterOptionValue } from '@studyportals/search-filters/server-side';
|
|
3
|
+
import { BaseProgrammeFilterKeyValueRule } from '../BaseProgrammeFilterKeyValueRule';
|
|
4
|
+
export class ErasmusOrExecutiveSpecialProgrammeRule extends BaseProgrammeFilterKeyValueRule {
|
|
5
|
+
constructor() {
|
|
6
|
+
const filterKeyValues = new Map([[
|
|
7
|
+
FilterKey.SPECIAL_PROGRAMMES,
|
|
8
|
+
[SpecialProgrammesFilterOptionValue.ERASMUS_MUNDUS, SpecialProgrammesFilterOptionValue.EXECUTIVE_PROGRAMMES]
|
|
9
|
+
]
|
|
10
|
+
]);
|
|
11
|
+
super(filterKeyValues);
|
|
12
|
+
}
|
|
13
|
+
getName() {
|
|
14
|
+
return 'ErasmusOrExecutiveSpecialProgrammeRule';
|
|
15
|
+
}
|
|
16
|
+
getDescription() {
|
|
17
|
+
return 'Is indexable if the selected special programme is Erasmus Mundus or Executive Programmes.';
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FilterKey } from '@studyportals/search-filters
|
|
2
|
-
import { SpecialProgrammesFilterOptionValue } from '@studyportals/search-filters
|
|
1
|
+
import { FilterKey } from '@studyportals/search-filters';
|
|
2
|
+
import { SpecialProgrammesFilterOptionValue } from '@studyportals/search-filters';
|
|
3
3
|
import { BaseProgrammeRule } from '../BaseProgrammeRule';
|
|
4
4
|
export class ErasmusOrJointSpecialProgrammesRule extends BaseProgrammeRule {
|
|
5
5
|
forSearch(dependencies) {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { FilterKey } from '@studyportals/search-filters/server-side';
|
|
2
|
+
import { SpecialProgrammesFilterOptionValue } from '@studyportals/search-filters/server-side';
|
|
3
|
+
import { BaseProgrammeFilterKeyValueRule } from '../BaseProgrammeFilterKeyValueRule';
|
|
4
|
+
export class ErasmusSpecialProgrammeRule extends BaseProgrammeFilterKeyValueRule {
|
|
5
|
+
constructor() {
|
|
6
|
+
const filterKeyValues = new Map([[
|
|
7
|
+
FilterKey.SPECIAL_PROGRAMMES,
|
|
8
|
+
[SpecialProgrammesFilterOptionValue.ERASMUS_MUNDUS]
|
|
9
|
+
]
|
|
10
|
+
]);
|
|
11
|
+
super(filterKeyValues);
|
|
12
|
+
}
|
|
13
|
+
getName() {
|
|
14
|
+
return 'ErasmusSpecialProgrammeRule';
|
|
15
|
+
}
|
|
16
|
+
getDescription() {
|
|
17
|
+
return 'Is indexable if the selected special programme is Erasmus Mundus.';
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ISearchDependencies } from '../../common/ISearchDependencies';
|
|
2
|
+
import { FilterKeyValuesMap } from '../../common/FilterKeyValuesMap';
|
|
3
|
+
import { BaseProgrammeRule } from '../BaseProgrammeRule';
|
|
4
|
+
export declare class MbaCountryAttendanceRule extends BaseProgrammeRule {
|
|
5
|
+
private readonly degreeValue;
|
|
6
|
+
private readonly attendanceValue;
|
|
7
|
+
getName(): string;
|
|
8
|
+
getDescription(): string;
|
|
9
|
+
forSearch(dependencies: ISearchDependencies): Promise<boolean>;
|
|
10
|
+
forSitemapGenerator(filterKeyValues: FilterKeyValuesMap): Promise<boolean>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { FilterKey } from '@studyportals/search-filters';
|
|
2
|
+
import { DegreeTypeFilterOptionValue } from '@studyportals/search-filters';
|
|
3
|
+
import { BaseProgrammeRule } from '../BaseProgrammeRule';
|
|
4
|
+
export class MbaCountryAttendanceRule extends BaseProgrammeRule {
|
|
5
|
+
degreeValue = DegreeTypeFilterOptionValue.MBA;
|
|
6
|
+
attendanceValue = 'online';
|
|
7
|
+
getName() {
|
|
8
|
+
return 'MbaCountryAttendanceRule';
|
|
9
|
+
}
|
|
10
|
+
getDescription() {
|
|
11
|
+
return 'Indexes: master-of-business-administration + all countries + online attendance';
|
|
12
|
+
}
|
|
13
|
+
forSearch(dependencies) {
|
|
14
|
+
const { seoInfoBase, filterState } = dependencies;
|
|
15
|
+
const degreeTypeValue = seoInfoBase.getFilterOptionValueBy(FilterKey.DEGREE_TYPE, filterState);
|
|
16
|
+
const countryValue = seoInfoBase.getFilterOptionValueBy(FilterKey.COUNTRY, filterState);
|
|
17
|
+
const attendanceValue = seoInfoBase.getFilterOptionValueBy(FilterKey.DELIVERY_METHOD, filterState);
|
|
18
|
+
if (degreeTypeValue !== this.degreeValue) {
|
|
19
|
+
return Promise.resolve(true);
|
|
20
|
+
}
|
|
21
|
+
if (!countryValue || !attendanceValue) {
|
|
22
|
+
return Promise.resolve(false);
|
|
23
|
+
}
|
|
24
|
+
return Promise.resolve(attendanceValue === this.attendanceValue);
|
|
25
|
+
}
|
|
26
|
+
forSitemapGenerator(filterKeyValues) {
|
|
27
|
+
const degreeTypeValues = filterKeyValues.get(FilterKey.DEGREE_TYPE);
|
|
28
|
+
const countryValues = filterKeyValues.get(FilterKey.COUNTRY);
|
|
29
|
+
const attendanceValues = filterKeyValues.get(FilterKey.DELIVERY_METHOD);
|
|
30
|
+
if (!degreeTypeValues?.length || !countryValues?.length || !attendanceValues?.length) {
|
|
31
|
+
return Promise.resolve(false);
|
|
32
|
+
}
|
|
33
|
+
const degreeTypeValue = degreeTypeValues[0];
|
|
34
|
+
const attendanceValue = attendanceValues[0];
|
|
35
|
+
if (degreeTypeValue !== this.degreeValue) {
|
|
36
|
+
return Promise.resolve(true);
|
|
37
|
+
}
|
|
38
|
+
return Promise.resolve(attendanceValue === this.attendanceValue);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ISearchDependencies } from '../../common/ISearchDependencies';
|
|
2
|
+
import { FilterKeyValuesMap } from '../../common/FilterKeyValuesMap';
|
|
3
|
+
import { BaseProgrammeRule } from '../BaseProgrammeRule';
|
|
4
|
+
export declare class MasterOfEducationCountryDisciplineRule extends BaseProgrammeRule {
|
|
5
|
+
private readonly educationDisciplineIds;
|
|
6
|
+
private readonly allowedCountryIds;
|
|
7
|
+
getName(): string;
|
|
8
|
+
getDescription(): string;
|
|
9
|
+
forSearch(dependencies: ISearchDependencies): Promise<boolean>;
|
|
10
|
+
forSitemapGenerator(filterKeyValues: FilterKeyValuesMap): Promise<boolean>;
|
|
11
|
+
}
|