move
This commit is contained in:
@@ -157,18 +157,4 @@ export class UmbContentWorkspaceDataManager<
|
||||
.map((x) => new UmbVariantId(x.culture, x.segment)) ?? []
|
||||
);
|
||||
}
|
||||
|
||||
override async constructData(selectedVariantIds: Array<UmbVariantId>) {
|
||||
let selection = selectedVariantIds;
|
||||
|
||||
// If we vary by segment we need to save all segments for a selected culture.
|
||||
if (this._variesBySegment === true) {
|
||||
const dataVariants = this.getCurrent()?.variants ?? [];
|
||||
const selectedCultures = selectedVariantIds.map((x) => x.culture);
|
||||
const selectedCulturesIncludingSegments = dataVariants.filter((x) => selectedCultures.includes(x.culture));
|
||||
selection = selectedCulturesIncludingSegments.map((x) => UmbVariantId.Create(x));
|
||||
}
|
||||
|
||||
return super.constructData(selection);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,6 +84,15 @@ export class UmbElementWorkspaceDataManager<ModelType extends UmbElementDetailMo
|
||||
variantsToStore = [...selectedVariants, invariantVariantId];
|
||||
}
|
||||
|
||||
// If we vary by segment we need to save all segments for a selected culture.
|
||||
if (this._variesBySegment === true) {
|
||||
const dataSegments = this.getCurrent()!.values.map((x) => x.segment);
|
||||
variantsToStore = [
|
||||
...variantsToStore,
|
||||
...dataSegments.flatMap((segment) => variantsToStore.map((variant) => variant.toSegment(segment))),
|
||||
];
|
||||
}
|
||||
|
||||
const data = this.getCurrent();
|
||||
if (!data) throw new Error('Current data is missing');
|
||||
//if (!data.unique) throw new Error('Unique of current data is missing');
|
||||
|
||||
Reference in New Issue
Block a user