fix: hypercube handler path with slash

This commit is contained in:
Donya Mashaallahpoor
2025-10-16 10:53:18 +02:00
parent 6b088ff1c0
commit 41e0671653
3 changed files with 21 additions and 9 deletions

View File

@@ -120,6 +120,6 @@ const conversion = {
hypercube,
};
export { utils, arrayUtil, helpers };
export { utils, arrayUtil, helpers, getPath };
export default conversion;

View File

@@ -1,6 +1,6 @@
/* eslint-disable no-underscore-dangle */
import EventEmitter from 'node-event-emitter';
import { convertTo as conversionConvertTo, helpers } from '@nebula.js/conversion';
import { convertTo as conversionConvertTo, helpers, getPath } from '@nebula.js/conversion';
import { HyperCubeHandler } from '@nebula.js/supernova';
import glueCell from './components/glue';
import getPatches from './utils/patcher';
@@ -11,6 +11,22 @@ import saveSoftProperties from './utils/save-soft-properties';
const noopi = () => {};
const getHandlerPath = (cellRef) => {
const qae = cellRef.current.getQae();
let path = getPath(qae);
if (!path) {
return undefined;
}
const steps = path.split('/');
if (steps.length && steps.indexOf('qHyperCubeDef') > -1) {
path = 'qHyperCubeDef';
}
return path;
};
export default function viz({
model,
halo,
@@ -120,15 +136,10 @@ export default function viz({
*/
async getHypercubePropertyHandler() {
await rendered;
const qae = cellRef.current.getQae();
if (!qae?.data?.targets?.[0]?.propertyPath) {
return undefined;
}
const path = qae.data.targets[0].propertyPath;
const dataDefinition = cellRef.current.getExtensionDefinition().data;
const properties = await model.getEffectiveProperties();
const path = getHandlerPath(cellRef);
if (path && dataDefinition) {
const args = {
@@ -140,6 +151,7 @@ export default function viz({
globalChangeListeners: undefined,
path,
};
return new HyperCubeHandler(args);
}

View File

@@ -109,7 +109,7 @@ class HyperCubeHandler extends DataPropertyHandler {
super.setProperties(properties);
this.hcProperties = this.path ? utils.getValue(properties, `${this.path}.qHyperCubeDef`) : properties.qHyperCubeDef;
this.hcProperties = this.path ? utils.getValue(properties, this.path) : properties;
if (!this.hcProperties) {
return;