mirror of
https://github.com/qlik-oss/PLSmartPivot.git
synced 2025-12-19 18:27:32 -05:00
New preview image and fixed snapshot
-SnapshotApi doesn't have a getProperties so fetching the source properties from qlik-app instead. -The snapshot still cannot be rendered in the "printing-snapshot" test page because of limitations on that page.
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 123 B After Width: | Height: | Size: 7.5 KiB |
@@ -108,7 +108,12 @@ DataCell.propTypes = {
|
|||||||
}).isRequired,
|
}).isRequired,
|
||||||
qlik: PropTypes.shape({
|
qlik: PropTypes.shape({
|
||||||
backendApi: PropTypes.shape({
|
backendApi: PropTypes.shape({
|
||||||
selectValues: PropTypes.func.isRequired
|
selectValues: function (props, propName) {
|
||||||
|
if (props.isSnapshot || typeof props[propName] === 'function') {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return new Error('Missing implementation of qlik.backendApi.selectValues.');
|
||||||
|
}
|
||||||
}).isRequired
|
}).isRequired
|
||||||
}).isRequired,
|
}).isRequired,
|
||||||
styleBuilder: PropTypes.shape({
|
styleBuilder: PropTypes.shape({
|
||||||
|
|||||||
@@ -46,7 +46,12 @@ RowHeader.propTypes = {
|
|||||||
}).isRequired,
|
}).isRequired,
|
||||||
qlik: PropTypes.shape({
|
qlik: PropTypes.shape({
|
||||||
backendApi: PropTypes.shape({
|
backendApi: PropTypes.shape({
|
||||||
selectValues: PropTypes.func.isRequired
|
selectValues: function (props, propName) {
|
||||||
|
if (props.isSnapshot || typeof props[propName] === 'function') {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return new Error('Missing implementation of qlik.backendApi.selectValues.');
|
||||||
|
}
|
||||||
}).isRequired
|
}).isRequired
|
||||||
}).isRequired,
|
}).isRequired,
|
||||||
rowStyle: PropTypes.shape({}).isRequired,
|
rowStyle: PropTypes.shape({}).isRequired,
|
||||||
|
|||||||
@@ -67,12 +67,20 @@ function getDimensionIndexes (dimensionsInformation, designDimensionIndex) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function initializeCubes ({ component, layout }) {
|
export async function initializeCubes ({ component, layout }) {
|
||||||
const properties = await component.backendApi.getProperties();
|
|
||||||
const originCubeDefinition = properties.qHyperCubeDef;
|
|
||||||
const app = qlik.currApp(component);
|
const app = qlik.currApp(component);
|
||||||
const designDimensionIndex = findDesignDimension(layout.qHyperCube.qDataPages[0].qMatrix);
|
const designDimensionIndex = findDesignDimension(layout.qHyperCube.qDataPages[0].qMatrix);
|
||||||
const dimensionsInformation = layout.qHyperCube.qDimensionInfo;
|
const dimensionsInformation = layout.qHyperCube.qDimensionInfo;
|
||||||
const dimensionIndexes = getDimensionIndexes(dimensionsInformation, designDimensionIndex);
|
const dimensionIndexes = getDimensionIndexes(dimensionsInformation, designDimensionIndex);
|
||||||
|
|
||||||
|
let properties;
|
||||||
|
if (component.backendApi.isSnapshot) {
|
||||||
|
// Fetch properties of source
|
||||||
|
properties = (await app.getObjectProperties(layout.sourceObjectId)).properties;
|
||||||
|
} else {
|
||||||
|
properties = await component.backendApi.getProperties();
|
||||||
|
}
|
||||||
|
|
||||||
|
const originCubeDefinition = properties.qHyperCubeDef;
|
||||||
const designCube = await buildDesignCube(originCubeDefinition, dimensionIndexes, app);
|
const designCube = await buildDesignCube(originCubeDefinition, dimensionIndexes, app);
|
||||||
const dataCube = await buildDataCube(originCubeDefinition, dimensionIndexes, app);
|
const dataCube = await buildDataCube(originCubeDefinition, dimensionIndexes, app);
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,12 @@ ColumnHeader.propTypes = {
|
|||||||
}).isRequired,
|
}).isRequired,
|
||||||
qlik: PropTypes.shape({
|
qlik: PropTypes.shape({
|
||||||
backendApi: PropTypes.shape({
|
backendApi: PropTypes.shape({
|
||||||
selectValues: PropTypes.func.isRequired
|
selectValues: function (props, propName) {
|
||||||
|
if (props.isSnapshot || typeof props[propName] === 'function') {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return new Error('Missing implementation of qlik.backendApi.selectValues.');
|
||||||
|
}
|
||||||
}).isRequired
|
}).isRequired
|
||||||
}).isRequired,
|
}).isRequired,
|
||||||
styling: PropTypes.shape({
|
styling: PropTypes.shape({
|
||||||
|
|||||||
@@ -126,7 +126,12 @@ HeadersTable.propTypes = {
|
|||||||
general: PropTypes.shape({}).isRequired,
|
general: PropTypes.shape({}).isRequired,
|
||||||
qlik: PropTypes.shape({
|
qlik: PropTypes.shape({
|
||||||
backendApi: PropTypes.shape({
|
backendApi: PropTypes.shape({
|
||||||
selectValues: PropTypes.func.isRequired
|
selectValues: function (props, propName) {
|
||||||
|
if (props.isSnapshot || typeof props[propName] === 'function') {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return new Error('Missing implementation of qlik.backendApi.selectValues.');
|
||||||
|
}
|
||||||
}).isRequired
|
}).isRequired
|
||||||
}).isRequired,
|
}).isRequired,
|
||||||
styling: PropTypes.shape({
|
styling: PropTypes.shape({
|
||||||
|
|||||||
Reference in New Issue
Block a user