musora-content-services 1.0.225 → 1.0.228
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/CHANGELOG.md +6 -0
- package/link_mcs.sh +0 -0
- package/package.json +1 -1
- package/src/contentTypeConfig.js +8 -5
- package/src/filterBuilder.js +0 -0
- package/src/services/config.js +2 -0
- package/src/services/dataContext.js +0 -0
- package/test/live/contentProgressLive.test.js +0 -0
- package/test/live/railcontentLive.test.js +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [1.0.228](https://github.com/railroadmedia/musora-content-services/compare/v1.0.227...v1.0.228) (2024-12-09)
|
|
6
|
+
|
|
7
|
+
### [1.0.227](https://github.com/railroadmedia/musora-content-services/compare/v1.0.226...v1.0.227) (2024-12-08)
|
|
8
|
+
|
|
9
|
+
### [1.0.226](https://github.com/railroadmedia/musora-content-services/compare/v1.0.225...v1.0.226) (2024-12-06)
|
|
10
|
+
|
|
5
11
|
### [1.0.225](https://github.com/railroadmedia/musora-content-services/compare/v1.0.224...v1.0.225) (2024-12-06)
|
|
6
12
|
|
|
7
13
|
### [1.0.224](https://github.com/railroadmedia/musora-content-services/compare/v1.0.223...v1.0.224) (2024-12-06)
|
package/link_mcs.sh
CHANGED
|
File without changes
|
package/package.json
CHANGED
package/src/contentTypeConfig.js
CHANGED
|
@@ -437,13 +437,16 @@ function getFieldsForContentType(contentType, asQueryString = true) {
|
|
|
437
437
|
* @returns {string} - A string that can be used in a groq query
|
|
438
438
|
*/
|
|
439
439
|
function filtersToGroq(filters, selectedFilters = []) {
|
|
440
|
+
if (!filters) {
|
|
441
|
+
filters = [];
|
|
442
|
+
}
|
|
440
443
|
|
|
441
444
|
//Account for multiple railcontent id's
|
|
442
|
-
|
|
445
|
+
let multipleIdFilters = '';
|
|
443
446
|
filters.forEach(item => {
|
|
444
|
-
if(item.includes('railcontent_id in')) {
|
|
447
|
+
if (item.includes('railcontent_id in')) {
|
|
445
448
|
filters.pop(item);
|
|
446
|
-
multipleIdFilters
|
|
449
|
+
multipleIdFilters += ` && ${item} `;
|
|
447
450
|
}
|
|
448
451
|
})
|
|
449
452
|
|
|
@@ -504,12 +507,12 @@ function filtersToGroq(filters, selectedFilters = []) {
|
|
|
504
507
|
}).filter(Boolean).join(' ');
|
|
505
508
|
|
|
506
509
|
//Return
|
|
507
|
-
return
|
|
510
|
+
return `${multipleIdFilters} ${filterClauses}`;
|
|
508
511
|
}
|
|
509
512
|
|
|
510
513
|
function groupFilters(filters) {
|
|
511
514
|
if (filters.length === 0) return {};
|
|
512
|
-
|
|
515
|
+
|
|
513
516
|
return filters.reduce((acc, filter) => {
|
|
514
517
|
const [category, value] = filter.split(',');
|
|
515
518
|
if (!acc[category]) acc[category] = [];
|
package/src/filterBuilder.js
CHANGED
|
File without changes
|
package/src/services/config.js
CHANGED
|
@@ -37,6 +37,7 @@ const excludeFromGeneratedIndex = [];
|
|
|
37
37
|
* @param {string} config.railcontentConfig.authToken - The bearer authorization token.
|
|
38
38
|
* @param {Object} config.localStorage - Cache to use for localStorage
|
|
39
39
|
* @param {boolean} config.isMA - Variable that tells if the library is used by MA or FEW
|
|
40
|
+
* @param {string} config.localTimezoneString - The local timezone string in format: America/Vancouver
|
|
40
41
|
|
|
41
42
|
*
|
|
42
43
|
* @example
|
|
@@ -64,6 +65,7 @@ function initializeService(config) {
|
|
|
64
65
|
globalConfig.railcontentConfig = config.railcontentConfig;
|
|
65
66
|
globalConfig.localStorage = config.localStorage;
|
|
66
67
|
globalConfig.isMA = config.isMA || false;
|
|
68
|
+
globalConfig.localTimezoneString = config.localTimezoneString || null;
|
|
67
69
|
}
|
|
68
70
|
|
|
69
71
|
// Export both the initialization function and the config object
|
|
File without changes
|
|
File without changes
|
|
File without changes
|