From 48a83b19b8ec52a9820a65228f09011b1e86c36e Mon Sep 17 00:00:00 2001 From: Dave Seah Date: Sat, 11 Aug 2018 07:21:35 -0400 Subject: [PATCH 01/10] dev-ds/unisys-react-refactor: new UNISYS.Component class replaces React.Component. It adds UNISYS methods so it is no longer necessary to create UMOD and UDATA instances. Instead, just include UNISYS and call UNISYS.SystemInitialize() in the root constructor, passing the module.id there. AutoCompleteDemo is not yet converted. --- build/app/assets/htmldemos/simple/simple.html | 1 + build/app/assets/index.ejs | 4 +- build/app/init-appshell.jsx | 31 ++--- build/app/init.jsx | 45 ++++---- build/app/settings.js | 17 +-- build/app/unisys/client-datalink-class.js | 8 +- build/app/unisys/client-lifecycle.js | 16 +-- build/app/unisys/client-messager-class.js | 2 +- build/app/unisys/client-module-class.js | 2 +- build/app/unisys/client-network.js | 2 +- build/app/unisys/client-react-component.jsx | 73 ++++++++++++ build/app/unisys/client-state.js | 2 +- build/app/unisys/client.js | 107 ++++++++++-------- build/app/unisys/server-network.js | 2 +- build/app/view/AppDefault.jsx | 1 + build/app/view/dev-db/DevDB.jsx | 51 +++------ build/app/view/dev-db/DevDBLogic.js | 11 +- build/app/view/dev-react/DevReact.jsx | 83 ++++++++++++++ build/app/view/dev-react/DevReactLogic.js | 96 ++++++++++++++++ build/app/view/dev-unisys/DevUnisys.jsx | 16 +-- build/app/view/dev-unisys/DevUnisysLogic.js | 6 +- 21 files changed, 400 insertions(+), 176 deletions(-) create mode 100644 build/app/unisys/client-react-component.jsx create mode 100644 build/app/view/dev-react/DevReact.jsx create mode 100644 build/app/view/dev-react/DevReactLogic.js diff --git a/build/app/assets/htmldemos/simple/simple.html b/build/app/assets/htmldemos/simple/simple.html index d4c7bfafb..9047f2ccf 100644 --- a/build/app/assets/htmldemos/simple/simple.html +++ b/build/app/assets/htmldemos/simple/simple.html @@ -22,6 +22,7 @@

Simple HTML in an IFRAME

require("babel-polyfill"); // enables regenerators for async/await // demonstrate that NetCreate system libraries are available const STORE = require('system/datastore'); + const UNISYS = require('unisys/client'); const $ = require('jquery'); $('body').append('

JQUERY ADDED THIS. Now D3 will turn me orange.

'); // d3 is loaded diff --git a/build/app/assets/index.ejs b/build/app/assets/index.ejs index 070cba645..8b24cf3b4 100644 --- a/build/app/assets/index.ejs +++ b/build/app/assets/index.ejs @@ -31,9 +31,7 @@ uport : '<%=uport%>' } }; - window.NC_DBG = { - inc : false - } + window.NC_DBG = false; diff --git a/build/app/init-appshell.jsx b/build/app/init-appshell.jsx index 3ec506874..9059c85fa 100644 --- a/build/app/init-appshell.jsx +++ b/build/app/init-appshell.jsx @@ -60,10 +60,10 @@ const AutoCompleteDemo = require('view/autocompletedemo/AutoCompleteDemo'); const DevUnisys = require('view/dev-unisys/DevUnisys'); const DevDB = require('view/dev-db/DevDB'); + const DevReact = require('view/dev-react/DevReact'); // const Prototype = require('view/prototype/Prototype'); // const D3Test = require('view/d3test/D3Test'); - /** (2) ROUTED FUNCTIONS *****************************************************\ Used by render()'s to load a plain html page that is located at app/htmldemos// @@ -90,7 +90,6 @@ ); } - /** (3) NO ROUTE *************************************************************\ Used by render()'s when there are no matching routes \*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ @@ -101,8 +100,6 @@ ); } - - /** APPLICATION NAVBAR + SWITCHED ROUTER VIEW ********************************\ The application shell consists of a navbar implemented with Reactstrap @@ -136,7 +133,6 @@ class AppShell extends React.Component { To add a new HTML, add the link to both the