sr-npm 1.7.141 → 1.7.143

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.141",
3
+ "version": "1.7.143",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -260,8 +260,34 @@ async function updateCount(_$w) {
260
260
  }
261
261
 
262
262
  async function handleDepartmentParam(_$w,department) {
263
- console.log("department inside handleDepartmentParam", department.replace('-', ' '));
264
- _$w('#dropdownDepartment').value = department.replace('-', ' ');
263
+ const departmentValue = department.replace('-', ' ');
264
+ console.log("department inside handleDepartmentParam", departmentValue);
265
+
266
+ // Debug: Check dropdown options
267
+ await _$w('#dataset2').refresh();
268
+ const dropdownOptions = _$w('#dropdownDepartment').options;
269
+ console.log("dropdown options:", dropdownOptions);
270
+
271
+ // Try setting the value
272
+ _$w('#dropdownDepartment').value = departmentValue;
273
+ console.log("after setting, dropdown value:", _$w('#dropdownDepartment').value);
274
+
275
+ // If value didn't set, try finding exact match
276
+ if (!_$w('#dropdownDepartment').value) {
277
+ const matchingOption = dropdownOptions.find(option =>
278
+ option.label.toLowerCase() === departmentValue.toLowerCase() ||
279
+ option.value.toLowerCase() === departmentValue.toLowerCase()
280
+ );
281
+
282
+ if (matchingOption) {
283
+ console.log("found matching option:", matchingOption);
284
+ _$w('#dropdownDepartment').value = matchingOption.value;
285
+ console.log("after setting matching option, dropdown value:", _$w('#dropdownDepartment').value);
286
+ } else {
287
+ console.log("no matching option found for:", departmentValue);
288
+ }
289
+ }
290
+
265
291
  console.log("before applyFilters_$w('#dropdownDepartment').value", _$w('#dropdownDepartment').value);
266
292
 
267
293
  await applyFilters(_$w, true); // Skip URL update since we're handling initial URL params