@yuuvis/client-framework 3.8.3 → 3.9.0

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.
@@ -695,7 +695,8 @@ class SmartSearchEditController {
695
695
  this.exitFormMode();
696
696
  this.blocks.set(state.blocks.map((block) => this.#normalizeBlock(block)));
697
697
  this.combinator.set(state.combinator);
698
- this.fulltext.set(state.fulltext ?? { term: '', scope: 'all', types: [] });
698
+ const fulltext = state.fulltext ?? { term: '', scope: 'all', types: [] };
699
+ this.fulltext.set({ ...fulltext, types: fulltext.types.map((type) => this.#resolveIsSot(type)) });
699
700
  }
700
701
  /** Reset all search state back to its initial empty values. */
701
702
  reset() {
@@ -1177,11 +1178,24 @@ class SmartSearchEditController {
1177
1178
  this.#trackSeq(id);
1178
1179
  return {
1179
1180
  id,
1180
- types,
1181
+ types: types.map((type) => this.#resolveIsSot(type)),
1181
1182
  conditions: legacy.conditions ?? [],
1182
1183
  conditionCombinator: legacy.conditionCombinator ?? 'AND'
1183
1184
  };
1184
1185
  }
1186
+ /**
1187
+ * Re-derive a type's `isSot` flag from the live schema. `isSot` drives whether the
1188
+ * type restriction is emitted as `objectTypeId = …` or `system:secondaryObjectTypeIds
1189
+ * IN (…)`, so it must reflect the schema's current classification rather than whatever
1190
+ * was carried in by a persisted state (legacy saved queries predate the flag, and
1191
+ * externally-constructed types may omit it). Resolved via the schema (not the
1192
+ * `allowedTypes`-filtered list) so a saved type outside the current allow-list is still
1193
+ * corrected; unknown ids are left untouched.
1194
+ */
1195
+ #resolveIsSot(type) {
1196
+ const known = this.#system.getObjectType(type.id);
1197
+ return known ? { ...type, isSot: known.isSot } : type;
1198
+ }
1185
1199
  /**
1186
1200
  * Fields shared by *all* given types (the intersection by field id), shaped as
1187
1201
  * field suggestions. A field must be `queryable`, not in `skipProperties`, and