sr-npm 1.7.621 → 1.7.622

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.
@@ -0,0 +1,7 @@
1
+ import globals from "globals";
2
+ import { defineConfig } from "eslint/config";
3
+
4
+ export default defineConfig([
5
+ { files: ["**/*.js"], languageOptions: { sourceType: "commonjs" } },
6
+ { files: ["**/*.{js,mjs,cjs}"], languageOptions: { globals: globals.browser } },
7
+ ]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.621",
3
+ "version": "1.7.622",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -28,6 +28,8 @@
28
28
  "tests-utils": "^1.0.7"
29
29
  },
30
30
  "devDependencies": {
31
+ "eslint": "^9.38.0",
32
+ "globals": "^16.4.0",
31
33
  "prettier": "^3.6.2"
32
34
  }
33
35
  }
@@ -23,6 +23,7 @@ async function careersMultiBoxesPageOnReady(_$w) {
23
23
 
24
24
  await loadJobs(_$w);
25
25
  await loadFilters(_$w);
26
+ //selected values repeater on item ready
26
27
  _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.SELECTED_VALUES_REPEATER).onItemReady(($item, itemData) => {
27
28
  $item(CAREERS_MULTI_BOXES_PAGE_CONSTS.SELECTED_VALUES_REPEATER_ITEM_LABEL).text = itemData.label || '';
28
29
 
@@ -100,8 +101,8 @@ async function loadJobs(_$w) {
100
101
  // Build CheckboxGroup options for this field
101
102
  const fieldValues = valuesByFieldId.get(fieldId) || [];
102
103
  const originalOptions = fieldValues.map(v => ({
103
- label: v.title ,
104
- value: v._id
104
+ valueLabel: v.title ,
105
+ valueId: v._id
105
106
  }));
106
107
  optionsByFieldId.set(fieldId, originalOptions);
107
108
  console.log("optionsByFieldId: ",optionsByFieldId)
@@ -256,13 +257,12 @@ async function refreshFacetCounts(_$w) {
256
257
  const selectedItems = [];
257
258
  for (const [fieldId, valueIds] of selectedByField.entries()) {
258
259
  const opts = optionsByFieldId.get(fieldId) || [];
259
- const byId = new Map(opts.map(o => [o.value, o.label]));
260
+ //const byId = new Map(opts.map(o => [o.value, o.label]));
260
261
  for (const id of valueIds) {
261
- const label = byId.get(id);
262
- if (label) {
262
+ const found = opts.find((option) => option.valueId === id);
263
+ const label = found.valueLabel;
263
264
  //selectedItems.push({ _id: `${fieldId}:${id}`, label, fieldId, valueId: id });
264
265
  selectedItems.push({ label, fieldId, _id: id }); //_id is the valueId
265
- }
266
266
  }
267
267
  }
268
268
  _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.SELECTED_VALUES_REPEATER).data = selectedItems;