mirror of
https://github.com/qlik-oss/nebula.js.git
synced 2025-12-19 17:58:43 -05:00
fix: hypercube handler path with slash
This commit is contained in:
@@ -120,6 +120,6 @@ const conversion = {
|
||||
hypercube,
|
||||
};
|
||||
|
||||
export { utils, arrayUtil, helpers };
|
||||
export { utils, arrayUtil, helpers, getPath };
|
||||
|
||||
export default conversion;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user