Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Cristian_Dorbesi
Partner - Contributor III
Partner - Contributor III

Nebula extension. Properties panel data from App.

Hi community.

I'm trying to migrate a relatively simple extension from the 'old' extensions (capability API) to the new Nebula.js framework.
On the property panel from old extension, I'm retrieving the list of alternate states available on the app by simply doing this (querying all the app alternate states defined):

alternateStateDropdown: {
    type: "items",
    label: "Alternate State Settings",
    items: {
        alternateState: {
            type: "string",
            component: "dropdown",
            label: "Alternate state",
            ref: "alternateState",
            expression: "optional",
            options: function() {
                var app = qlik.currApp();
                return app.getAppLayout().then(function(appLayout) {
                    // Add the default state manually
                    var states = [{
                        value: "$",
                        label: "Default"
                    }];
                    appLayout.layout.qStateNames.map(function(stateName) {
                        states.push({
                            value: stateName,
                            label: stateName
                        });
                    });
                    return states;
                });
            },
        }
    }

 

However, I cannot find how to do this with Nebula. The 'galaxy'/env passed to ext.js doesn't seem to provide any access to this kind of data.

export default function ext(galaxy) {
}


On the main index.js, I tried to
- Import useApp from Nebula
- Send that into ext.js
However, the use useApp hook this way doesn't seem to be valid. It seems I can only use it within the component() function?

import { useElement, useApp, useAppLayout } from '@nebula.js/stardust';
import properties from './object-properties';
import data from './data';
import ext from './ext';
 
export default function supernova(galaxy) {
  return {
    qae: {
      properties,
      data,
    },
    ext: ext(galaxy,useApp),
    component() {
      const element = useElement();
      const app = useApp();
      const layout = useAppLayout();

      console.log(app);
      console.log(layout);
      console.log(app.getAppLayout());
  app.getAppLayout().then(function(la) {
        console.log("test2");
        console.log(la);
        console.log("test2---");
      });


I have no clue how to continue. How do i get into the extensions properties panel apps data? Or is it not possible at all to make what I want?

Any help is appreciated. Thanks!

 

 

 

Cristian Dorbesi
Labels (4)
0 Replies