amplia-iiot / wiwi-wizard-example

Example of WIWI type wizard

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

wiwi-wizard-example

Example project of a WIWI type wizard

Getting started

Clone the project

Installing all dependencies of project

This project use yarn: https://yarnpkg.com/en/docs/install

yarn

or

yarn install

Bundle with webpack

The project offers the following script that packages the project using webpack

npm run bundle

Install wizard on web OpenGate UX

Installation and management wizard on the web OpenGate UX is done through the following commands:

Register

npm run register

Update

npm run update

Delete

npm run delete

Publish

npm run publish [register|update|delete] [url of api-web] [domain] [user name] [password]

They will ask for the following information:

  1. Type url of api-web (http://localhost:3977): default http://localhost:3977
  2. domain: domain of user that exists in the platform OpenGate
  3. user name: user that exists in the platform OpenGate
  4. password: password of user

Generate version

This project offers the following script that version the project using npm

npm version [ major | minor | patch ]

Notes of version

0.1.0, 1.0.x

This version is compatible with opengate-web version >= 8.13.x

Ohters

Configure wizard

By default the web, when launching the wizard will use the following configuration:

{
    template: 'modules/wizard/client/views/wizard.client.view.html',
    controller:  name_of_wizard + 'Controller',
    windowClass: name_of_wizard + '-wizard'
}

Where name_of_wizard will be : meta-widget.json -> actions[name_of_action][name_of_wizard]

That is, the controller of the wizard must have the same name as the controller to be configured:

If the name_de_wizard equals exampleWizard, the angular controller should be called exampleWizardController

You can configure all this by adding the configuration of the new wizard in the following way in the run block of the configured angular module: src/config/wizard.config.js

angular
        .module('wiwi.wizard')
        .run(function ($enabledWizards) {
            $enabledWizards.wizards.exampleWizard = $enabledWizards.getCommonConfig({
                template: 'modules/wizard/client/views/wizard.client.view.html',
                controller: 'exampleWizardController',
                windowClass: 'exampleWizard-wizard'
            });
        });
  • template: optional parameter. If it is not added, the base html on which the wizard is based will be the one with the default website: 'modules/wizard/client/views/wizard.client.view.html'
  • controller: mandatory parameter. Wizard's main controller
  • windowClass: mandatory parameter. Class to add to the wizard

About

Example of WIWI type wizard

License:MIT License


Languages

Language:JavaScript 99.3%Language:HTML 0.7%