@studyportals/fawkes 7.2.2-6 → 7.2.2-9
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/dist/src/programmes/SearchIndexabilityManager.js +2 -1
- package/dist/src/programmes/policies/DegreeAttendanceDiscipline.d.ts +1 -2
- package/dist/src/programmes/policies/DegreeAttendanceDiscipline.js +0 -2
- package/dist/src/programmes/policies/DegreeCountryAttendance.d.ts +2 -4
- package/dist/src/programmes/policies/DegreeCountryAttendance.js +3 -7
- package/dist/src/programmes/policies/index.d.ts +1 -0
- package/dist/src/programmes/policies/index.js +1 -0
- package/dist/src/programmes/rules/DegreeCountryAttendanceSpecificRule.d.ts +5 -1
- package/dist/src/programmes/rules/DegreeCountryAttendanceSpecificRule.js +50 -9
- package/dist/src/programmes/rules/DegreeCountrySpecificRule.js +2 -2
- package/dist/src/programmes/rules/DegreeDisciplineRule.js +0 -2
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Area, Attendance, Continent, ContinentTuitionFee, Country, CountryAttendance, CountryDuration, CountryEducationalForm, CountryFormat, CountryTuitionFee, DegreeAttendanceDiscipline, DegreeCountryAttendance, DegreeCountryDiscipline, DegreeCountryTuitionFee, Discipline, DisciplineArea, DisciplineAttendance, DisciplineContinent, DisciplineCountry, DisciplineCountryEducationalForm, DisciplineDuration, DisciplineEducationalForm, DisciplineFormat, DisciplineTuitionFee, DisciplineTuitionFeeAttendance, SpecialProgrammes, TuitionFee, Unfiltered } from './policies';
|
|
1
|
+
import { Area, Attendance, Continent, ContinentTuitionFee, Country, CountryAttendance, CountryDuration, 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
3
|
export class SearchIndexabilityManager {
|
|
4
4
|
policies;
|
|
@@ -31,6 +31,7 @@ export class SearchIndexabilityManager {
|
|
|
31
31
|
new DisciplineContinent(dependencies),
|
|
32
32
|
new DisciplineCountry(dependencies),
|
|
33
33
|
new DisciplineCountryEducationalForm(dependencies),
|
|
34
|
+
new DisciplineDegree(dependencies),
|
|
34
35
|
new DisciplineDuration(dependencies),
|
|
35
36
|
new DisciplineEducationalForm(dependencies),
|
|
36
37
|
new DisciplineFormat(dependencies),
|
|
@@ -2,7 +2,6 @@ import { FilterKey } from '@studyportals/search-filters';
|
|
|
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 { DegreeAttendanceDisciplineRule } from '../rules/DegreeAttendanceDisciplineRule';
|
|
6
5
|
import { DegreeAttendanceDisciplineSpecificRule } from '../rules/DegreeAttendanceDisciplineSpecificRule';
|
|
7
6
|
import { ProgrammesBaseIndexabilityPolicy } from '../ProgrammesBaseIndexabilityPolicy';
|
|
8
7
|
import { IProgrammeSeoDependencies } from '../types/IProgrammeSeoDependencies';
|
|
@@ -10,7 +9,7 @@ export declare class DegreeAttendanceDiscipline extends ProgrammesBaseIndexabili
|
|
|
10
9
|
readonly name: string;
|
|
11
10
|
readonly description: string;
|
|
12
11
|
readonly filterKeys: FilterKey[];
|
|
13
|
-
protected readonly rules: (SingleValueSelectedForFilterRule | OnlyFiltersSelectedRule |
|
|
12
|
+
protected readonly rules: (SingleValueSelectedForFilterRule | OnlyFiltersSelectedRule | DegreeAttendanceDisciplineSpecificRule)[];
|
|
14
13
|
constructor(dependencies: IProgrammeSeoDependencies);
|
|
15
14
|
protected generateUrls(): Promise<string[]>;
|
|
16
15
|
get filterCombination(): FilterCombinations;
|
|
@@ -3,7 +3,6 @@ import { DegreeTypeFilterOptionValue } from '@studyportals/search-filters';
|
|
|
3
3
|
import { OnlyFiltersSelectedRule } from '../../common/rules/OnlyFiltersSelectedRule';
|
|
4
4
|
import { SingleValueSelectedForFilterRule } from '../../common/rules/SingleValueSelectedForFilterRule';
|
|
5
5
|
import { FilterCombinations } from '../../enums/FilterCombinations';
|
|
6
|
-
import { DegreeAttendanceDisciplineRule } from '../rules/DegreeAttendanceDisciplineRule';
|
|
7
6
|
import { DegreeAttendanceDisciplineSpecificRule } from '../rules/DegreeAttendanceDisciplineSpecificRule';
|
|
8
7
|
import { ProgrammesBaseIndexabilityPolicy } from '../ProgrammesBaseIndexabilityPolicy';
|
|
9
8
|
import { DegreePresenter } from '../../presenters/DegreePresenter';
|
|
@@ -19,7 +18,6 @@ export class DegreeAttendanceDiscipline extends ProgrammesBaseIndexabilityPolicy
|
|
|
19
18
|
new SingleValueSelectedForFilterRule(FilterKey.DISCIPLINES),
|
|
20
19
|
new OnlyFiltersSelectedRule([FilterKey.DEGREE_TYPE, FilterKey.DELIVERY_METHOD, FilterKey.DISCIPLINES]),
|
|
21
20
|
new DegreeAttendanceDisciplineSpecificRule(),
|
|
22
|
-
new DegreeAttendanceDisciplineRule()
|
|
23
21
|
];
|
|
24
22
|
constructor(dependencies) {
|
|
25
23
|
super(dependencies);
|
|
@@ -2,17 +2,15 @@ import { FilterKey } from '@studyportals/search-filters';
|
|
|
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 { MbaCountryAttendanceRule } from '../rules/MbaCountryAttendanceRule';
|
|
6
|
-
import { MasterOfLawsCountryAttendanceRule } from '../rules/MasterOfLawsCountryAttendanceRule';
|
|
7
|
-
import { MasterOfPhilosophyCountryAttendanceRule } from '../rules/MasterOfPhilosophyCountryAttendanceRule';
|
|
8
5
|
import { DegreeCountryAttendanceSpecificRule } from '../rules/DegreeCountryAttendanceSpecificRule';
|
|
9
6
|
import { ProgrammesBaseIndexabilityPolicy } from '../ProgrammesBaseIndexabilityPolicy';
|
|
10
7
|
import { IProgrammeSeoDependencies } from '../types/IProgrammeSeoDependencies';
|
|
8
|
+
import { OnlineAttendanceRule } from '../../common/rules/OnlineAttendanceRule';
|
|
11
9
|
export declare class DegreeCountryAttendance extends ProgrammesBaseIndexabilityPolicy {
|
|
12
10
|
readonly name: string;
|
|
13
11
|
readonly description: string;
|
|
14
12
|
readonly filterKeys: FilterKey[];
|
|
15
|
-
protected readonly rules: (SingleValueSelectedForFilterRule | OnlyFiltersSelectedRule |
|
|
13
|
+
protected readonly rules: (SingleValueSelectedForFilterRule | OnlyFiltersSelectedRule | OnlineAttendanceRule | DegreeCountryAttendanceSpecificRule)[];
|
|
16
14
|
constructor(dependencies: IProgrammeSeoDependencies);
|
|
17
15
|
protected generateUrls(): Promise<string[]>;
|
|
18
16
|
get filterCombination(): FilterCombinations;
|
|
@@ -3,14 +3,12 @@ import { DegreeTypeFilterOptionValue } from '@studyportals/search-filters';
|
|
|
3
3
|
import { OnlyFiltersSelectedRule } from '../../common/rules/OnlyFiltersSelectedRule';
|
|
4
4
|
import { SingleValueSelectedForFilterRule } from '../../common/rules/SingleValueSelectedForFilterRule';
|
|
5
5
|
import { FilterCombinations } from '../../enums/FilterCombinations';
|
|
6
|
-
import { MbaCountryAttendanceRule } from '../rules/MbaCountryAttendanceRule';
|
|
7
|
-
import { MasterOfLawsCountryAttendanceRule } from '../rules/MasterOfLawsCountryAttendanceRule';
|
|
8
|
-
import { MasterOfPhilosophyCountryAttendanceRule } from '../rules/MasterOfPhilosophyCountryAttendanceRule';
|
|
9
6
|
import { DegreeCountryAttendanceSpecificRule } from '../rules/DegreeCountryAttendanceSpecificRule';
|
|
10
7
|
import { ProgrammesBaseIndexabilityPolicy } from '../ProgrammesBaseIndexabilityPolicy';
|
|
11
8
|
import { DegreePresenter } from '../../presenters/DegreePresenter';
|
|
12
9
|
import { CountryPresenter } from '../../presenters/CountryPresenter';
|
|
13
10
|
import { AttendancePresenter } from '../../presenters/AttendancePresenter';
|
|
11
|
+
import { OnlineAttendanceRule } from '../../common/rules/OnlineAttendanceRule';
|
|
14
12
|
export class DegreeCountryAttendance extends ProgrammesBaseIndexabilityPolicy {
|
|
15
13
|
name = 'Degree Country Attendance Policy';
|
|
16
14
|
description = 'Determines indexing rules for pages filtered by degree type, country, and attendance.';
|
|
@@ -20,10 +18,8 @@ export class DegreeCountryAttendance extends ProgrammesBaseIndexabilityPolicy {
|
|
|
20
18
|
new SingleValueSelectedForFilterRule(FilterKey.COUNTRY),
|
|
21
19
|
new SingleValueSelectedForFilterRule(FilterKey.DELIVERY_METHOD),
|
|
22
20
|
new OnlyFiltersSelectedRule([FilterKey.DEGREE_TYPE, FilterKey.COUNTRY, FilterKey.DELIVERY_METHOD]),
|
|
21
|
+
new OnlineAttendanceRule(),
|
|
23
22
|
new DegreeCountryAttendanceSpecificRule(),
|
|
24
|
-
new MbaCountryAttendanceRule(),
|
|
25
|
-
new MasterOfLawsCountryAttendanceRule(),
|
|
26
|
-
new MasterOfPhilosophyCountryAttendanceRule()
|
|
27
23
|
];
|
|
28
24
|
constructor(dependencies) {
|
|
29
25
|
super(dependencies);
|
|
@@ -41,7 +37,7 @@ export class DegreeCountryAttendance extends ProgrammesBaseIndexabilityPolicy {
|
|
|
41
37
|
if (!onlineAttendance) {
|
|
42
38
|
return paths;
|
|
43
39
|
}
|
|
44
|
-
const llmAllowedCountryIds = ['82', '30', '
|
|
40
|
+
const llmAllowedCountryIds = ['82', '30', '56', '108'];
|
|
45
41
|
const mphilAllowedCountryIds = ['82', '30', '108'];
|
|
46
42
|
for (const pageNumber of this.indexablePageNumbers) {
|
|
47
43
|
if (mba) {
|
|
@@ -16,6 +16,7 @@ export * from './DegreeAttendanceDiscipline';
|
|
|
16
16
|
export * from './DegreeCountryAttendance';
|
|
17
17
|
export * from './DegreeCountryDiscipline';
|
|
18
18
|
export * from './DegreeCountryTuitionFee';
|
|
19
|
+
export * from './DisciplineDegree';
|
|
19
20
|
export * from './Discipline';
|
|
20
21
|
export * from './DisciplineArea';
|
|
21
22
|
export * from './DisciplineAttendance';
|
|
@@ -16,6 +16,7 @@ export * from './DegreeAttendanceDiscipline';
|
|
|
16
16
|
export * from './DegreeCountryAttendance';
|
|
17
17
|
export * from './DegreeCountryDiscipline';
|
|
18
18
|
export * from './DegreeCountryTuitionFee';
|
|
19
|
+
export * from './DisciplineDegree';
|
|
19
20
|
export * from './Discipline';
|
|
20
21
|
export * from './DisciplineArea';
|
|
21
22
|
export * from './DisciplineAttendance';
|
|
@@ -2,9 +2,13 @@ import { ISearchDependencies } from '../../common/ISearchDependencies';
|
|
|
2
2
|
import { FilterKeyValuesMap } from '../../common/FilterKeyValuesMap';
|
|
3
3
|
import { BaseProgrammeRule } from '../BaseProgrammeRule';
|
|
4
4
|
export declare class DegreeCountryAttendanceSpecificRule extends BaseProgrammeRule {
|
|
5
|
-
private
|
|
5
|
+
private mba;
|
|
6
|
+
private readonly countryIdsByDegree;
|
|
6
7
|
getName(): string;
|
|
7
8
|
getDescription(): string;
|
|
8
9
|
forSearch(dependencies: ISearchDependencies): Promise<boolean>;
|
|
9
10
|
forSitemapGenerator(filterKeyValues: FilterKeyValuesMap): Promise<boolean>;
|
|
11
|
+
private isValidForMbaDegree;
|
|
12
|
+
private isValidForMphillDegree;
|
|
13
|
+
private isValidForLlmDegree;
|
|
10
14
|
}
|
|
@@ -2,11 +2,11 @@ import { FilterKey } from '@studyportals/search-filters';
|
|
|
2
2
|
import { DegreeTypeFilterOptionValue } from '@studyportals/search-filters';
|
|
3
3
|
import { BaseProgrammeRule } from '../BaseProgrammeRule';
|
|
4
4
|
export class DegreeCountryAttendanceSpecificRule extends BaseProgrammeRule {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
DegreeTypeFilterOptionValue.LLM,
|
|
8
|
-
DegreeTypeFilterOptionValue.MPHIL
|
|
9
|
-
|
|
5
|
+
mba = DegreeTypeFilterOptionValue.MBA.valueOf();
|
|
6
|
+
countryIdsByDegree = {
|
|
7
|
+
[DegreeTypeFilterOptionValue.LLM.valueOf()]: ['82', '30', '56', '108'],
|
|
8
|
+
[DegreeTypeFilterOptionValue.MPHIL.valueOf()]: ['82', '30', '108'],
|
|
9
|
+
};
|
|
10
10
|
getName() {
|
|
11
11
|
return 'DegreeCountryAttendanceSpecificRule';
|
|
12
12
|
}
|
|
@@ -16,17 +16,58 @@ export class DegreeCountryAttendanceSpecificRule extends BaseProgrammeRule {
|
|
|
16
16
|
forSearch(dependencies) {
|
|
17
17
|
const { seoInfoBase, filterState } = dependencies;
|
|
18
18
|
const degreeTypeValue = seoInfoBase.getFilterOptionValueBy(FilterKey.DEGREE_TYPE, filterState);
|
|
19
|
-
|
|
19
|
+
const countryValue = seoInfoBase.getFilterOptionValueBy(FilterKey.COUNTRY, filterState);
|
|
20
|
+
const attendanceValue = seoInfoBase.getFilterOptionValueBy(FilterKey.DELIVERY_METHOD, filterState);
|
|
21
|
+
if (!degreeTypeValue || !countryValue || !attendanceValue) {
|
|
20
22
|
return Promise.resolve(false);
|
|
21
23
|
}
|
|
22
|
-
|
|
24
|
+
if (attendanceValue !== 'online') {
|
|
25
|
+
return Promise.resolve(false);
|
|
26
|
+
}
|
|
27
|
+
if (this.isValidForMbaDegree(degreeTypeValue)) {
|
|
28
|
+
return Promise.resolve(true);
|
|
29
|
+
}
|
|
30
|
+
if (this.isValidForMphillDegree(degreeTypeValue, countryValue)) {
|
|
31
|
+
return Promise.resolve(true);
|
|
32
|
+
}
|
|
33
|
+
if (this.isValidForLlmDegree(degreeTypeValue, countryValue)) {
|
|
34
|
+
return Promise.resolve(true);
|
|
35
|
+
}
|
|
36
|
+
return Promise.resolve(false);
|
|
23
37
|
}
|
|
24
38
|
forSitemapGenerator(filterKeyValues) {
|
|
25
39
|
const degreeTypeValues = filterKeyValues.get(FilterKey.DEGREE_TYPE);
|
|
26
|
-
|
|
40
|
+
const countryValues = filterKeyValues.get(FilterKey.COUNTRY);
|
|
41
|
+
const attendanceValues = filterKeyValues.get(FilterKey.DELIVERY_METHOD);
|
|
42
|
+
if (!degreeTypeValues?.length || !countryValues?.length || !attendanceValues?.length) {
|
|
27
43
|
return Promise.resolve(false);
|
|
28
44
|
}
|
|
29
45
|
const degreeTypeValue = degreeTypeValues[0];
|
|
30
|
-
|
|
46
|
+
const countryValue = countryValues[0];
|
|
47
|
+
const attendanceValue = attendanceValues[0];
|
|
48
|
+
if (attendanceValue !== 'online') {
|
|
49
|
+
return Promise.resolve(false);
|
|
50
|
+
}
|
|
51
|
+
if (this.isValidForMbaDegree(degreeTypeValue)) {
|
|
52
|
+
return Promise.resolve(true);
|
|
53
|
+
}
|
|
54
|
+
if (this.isValidForMphillDegree(degreeTypeValue, countryValue)) {
|
|
55
|
+
return Promise.resolve(true);
|
|
56
|
+
}
|
|
57
|
+
if (this.isValidForLlmDegree(degreeTypeValue, countryValue)) {
|
|
58
|
+
return Promise.resolve(true);
|
|
59
|
+
}
|
|
60
|
+
return Promise.resolve(false);
|
|
61
|
+
}
|
|
62
|
+
isValidForMbaDegree(degreeTypeValue) {
|
|
63
|
+
return degreeTypeValue === this.mba;
|
|
64
|
+
}
|
|
65
|
+
isValidForMphillDegree(degreeTypeValue, countryValue) {
|
|
66
|
+
return degreeTypeValue === DegreeTypeFilterOptionValue.MPHIL.valueOf() &&
|
|
67
|
+
this.countryIdsByDegree[DegreeTypeFilterOptionValue.MPHIL.valueOf()].includes(countryValue);
|
|
68
|
+
}
|
|
69
|
+
isValidForLlmDegree(degreeTypeValue, countryValue) {
|
|
70
|
+
return degreeTypeValue === DegreeTypeFilterOptionValue.LLM.valueOf() &&
|
|
71
|
+
this.countryIdsByDegree[DegreeTypeFilterOptionValue.LLM.valueOf()].includes(countryValue);
|
|
31
72
|
}
|
|
32
73
|
}
|
|
@@ -3,9 +3,9 @@ import { DegreeTypeFilterOptionValue } from '@studyportals/search-filters';
|
|
|
3
3
|
import { BaseProgrammeRule } from '../BaseProgrammeRule';
|
|
4
4
|
export class DegreeCountrySpecificRule extends BaseProgrammeRule {
|
|
5
5
|
validCombinations = {
|
|
6
|
-
[DegreeTypeFilterOptionValue.MSC]: ['82', '
|
|
6
|
+
[DegreeTypeFilterOptionValue.MSC]: ['82', '56', '11', '30'],
|
|
7
7
|
[DegreeTypeFilterOptionValue.MBA]: ['82', '30'],
|
|
8
|
-
[DegreeTypeFilterOptionValue.MED]: ['202', '
|
|
8
|
+
[DegreeTypeFilterOptionValue.MED]: ['202', '56']
|
|
9
9
|
};
|
|
10
10
|
getName() {
|
|
11
11
|
return 'DegreeCountrySpecificRule';
|
|
@@ -93,8 +93,6 @@ export class DegreeDisciplineRule extends BaseProgrammeRule {
|
|
|
93
93
|
const { seoInfoBase, filterState } = dependencies;
|
|
94
94
|
const degreeTypeValue = seoInfoBase.getFilterOptionValueBy(FilterKey.DEGREE_TYPE, filterState);
|
|
95
95
|
const disciplineValue = seoInfoBase.getFilterOptionValueBy(FilterKey.DISCIPLINES, filterState);
|
|
96
|
-
// eslint-disable-next-line no-console
|
|
97
|
-
console.log("For search - Degree Type:", degreeTypeValue, "Discipline:", disciplineValue);
|
|
98
96
|
if (!degreeTypeValue || !disciplineValue) {
|
|
99
97
|
return Promise.resolve(false);
|
|
100
98
|
}
|