@studyportals/fawkes 7.4.2-10 → 7.4.2-12
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.
|
@@ -6,6 +6,7 @@ export var FilterCombinations;
|
|
|
6
6
|
FilterCombinations["COUNTRY"] = "country";
|
|
7
7
|
FilterCombinations["DEGREE"] = "degree";
|
|
8
8
|
FilterCombinations["DURATION"] = "duration";
|
|
9
|
+
FilterCombinations["FORMAT"] = "format";
|
|
9
10
|
FilterCombinations["COUNTRY_DEGREE"] = "countryDegree";
|
|
10
11
|
FilterCombinations["COUNTRY_DURATION"] = "countryDuration";
|
|
11
12
|
FilterCombinations["COUNTRY_FORMAT"] = "countryFormat";
|
|
@@ -8,7 +8,10 @@ export class Duration extends ProgrammesBaseIndexabilityPolicy {
|
|
|
8
8
|
name = 'Duration Policy';
|
|
9
9
|
description = 'Governs indexing of duration-level filtered pages. (1 year - 2 year)';
|
|
10
10
|
filterKeys = [FilterKey.DURATION];
|
|
11
|
-
rules = [
|
|
11
|
+
rules = [
|
|
12
|
+
new SingleValueSelectedForFilterRule(FilterKey.DURATION),
|
|
13
|
+
new OnlyFiltersSelectedRule([FilterKey.DURATION])
|
|
14
|
+
];
|
|
12
15
|
constructor(dependencies) {
|
|
13
16
|
super(dependencies);
|
|
14
17
|
this.initateBaseRules();
|
|
@@ -17,11 +20,13 @@ export class Duration extends ProgrammesBaseIndexabilityPolicy {
|
|
|
17
20
|
const durationFragments = DurationPresenter.getInstance().getFragments();
|
|
18
21
|
const allowedDurationIds = [DurationFilterOptionValue.ONE_YEAR, DurationFilterOptionValue.TWO_YEARS];
|
|
19
22
|
const allowedDurations = durationFragments.filter(duration => allowedDurationIds.includes(duration.id));
|
|
23
|
+
console.log("Allowed Durations are: " + allowedDurations.map(duration => duration.id).join(", ")); // eslint-disable-line
|
|
20
24
|
const paths = [];
|
|
21
25
|
for (const pageNumber of this.indexablePageNumbers) {
|
|
22
26
|
for (const duration of allowedDurations) {
|
|
23
27
|
const filterKeyValues = new Map([[FilterKey.DURATION, [duration.id]]]);
|
|
24
28
|
const result = await this.checkRulesForSitemapWithPageNumber(filterKeyValues, pageNumber);
|
|
29
|
+
console.log("Checking duration: " + duration.id + " on page: " + pageNumber + " Result: " + result); // eslint-disable-line
|
|
25
30
|
if (result) {
|
|
26
31
|
paths.push(this.getPathWithPageNumber(duration.path, pageNumber));
|
|
27
32
|
}
|
|
@@ -20,13 +20,11 @@ export class Format extends ProgrammesBaseIndexabilityPolicy {
|
|
|
20
20
|
const formatFragments = FormatPresenter.getInstance().getFragments();
|
|
21
21
|
const allowedFormatIds = [FormatFilterOptionValue.PART_TIME, FormatFilterOptionValue.FULL_TIME];
|
|
22
22
|
const allowedFormats = formatFragments.filter(format => allowedFormatIds.includes(format.id));
|
|
23
|
-
console.log("Allowed Formats are: " + allowedFormats.map(format => format.id).join(", ")); // eslint-disable-line
|
|
24
23
|
const paths = [];
|
|
25
24
|
for (const pageNumber of this.indexablePageNumbers) {
|
|
26
25
|
for (const format of allowedFormats) {
|
|
27
26
|
const filterKeyValues = new Map([[FilterKey.ATTENDANCE, [format.id]]]);
|
|
28
27
|
const result = await this.checkRulesForSitemapWithPageNumber(filterKeyValues, pageNumber);
|
|
29
|
-
console.log("Checking format: " + format.id + " on page: " + pageNumber + " Result: " + result); // eslint-disable-line
|
|
30
28
|
if (result) {
|
|
31
29
|
paths.push(this.getPathWithPageNumber(format.path, pageNumber));
|
|
32
30
|
}
|
|
@@ -35,6 +33,6 @@ export class Format extends ProgrammesBaseIndexabilityPolicy {
|
|
|
35
33
|
return paths;
|
|
36
34
|
}
|
|
37
35
|
get filterCombination() {
|
|
38
|
-
return FilterCombinations.
|
|
36
|
+
return FilterCombinations.FORMAT;
|
|
39
37
|
}
|
|
40
38
|
}
|