@kumologica/sdk 3.4.0-beta8 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/cli/.DS_Store +0 -0
  2. package/cli/commands/test.js +11 -7
  3. package/cli/utils/logger.js +6 -1
  4. package/fixtures/.DS_Store +0 -0
  5. package/package.json +4 -4
  6. package/src/app/main-process/modal-newproject.js +4 -1
  7. package/src/app/main-process/modal-renameTab.js +106 -0
  8. package/src/app/main.js +22 -0
  9. package/src/app/ui/editor-api/lib/editor/index.js +8 -0
  10. package/src/app/ui/editor-api/lib/editor/ui.js +21 -1
  11. package/src/app/ui/editor-client/public/red/red.js +314 -167
  12. package/src/app/ui/editor-client/public/red/red.min.js +2 -2
  13. package/src/app/ui/editor-client/public/red/style.min.css +1 -1
  14. package/src/app/ui/editor-client/src/js/modals/modal-rename-tab.js +74 -0
  15. package/src/app/ui/editor-client/src/js/red.js +1 -0
  16. package/src/app/ui/editor-client/src/js/ui/common/tabs.js +5 -2
  17. package/src/app/ui/editor-client/src/js/ui/logviewer.js +4 -4
  18. package/src/app/ui/editor-client/src/js/ui/palette-explorer.js +210 -155
  19. package/src/app/ui/editor-client/src/js/ui/project-info.js +2 -2
  20. package/src/app/ui/editor-client/src/js/ui/search.js +1 -1
  21. package/src/app/ui/editor-client/src/js/ui/sidebar.js +1 -1
  22. package/src/app/ui/editor-client/src/js/ui/terminal.js +2 -2
  23. package/src/app/ui/editor-client/src/js/ui/workspaces.js +14 -0
  24. package/src/app/ui/editor-client/src/sass/modals/modalNewTab.scss +1 -0
  25. package/src/app/ui/editor-client/src/sass/search.scss +6 -3
  26. package/src/app/ui/editor-client/src/sass/terminal.scss +6 -3
  27. package/src/app/ui/editor-client/src/sass/workspace.scss +2 -0
  28. package/src/app/ui/editor-client/templates/index.mst +4 -2
  29. package/src/app/ui/editor-client/templates/modals/modalRenameTab.mst +78 -0
  30. package/src/server/DesignerServer.js +4 -0
package/cli/.DS_Store ADDED
Binary file
@@ -8,7 +8,7 @@ const { TestSuiteRunner } = require('./test-commands/TestSuiteRunner');
8
8
  const { DesignerServer } = require('../../src/server/DesignerServer');
9
9
  const { logError, logNotice, logInfo, logFatal } = require('../utils/logger');
10
10
 
11
- const isDirectory = util.isDirectorySync;
11
+ const isDirectory = util.isDir.sync;
12
12
 
13
13
 
14
14
  exports.command = 'test [project_directory]';
@@ -56,16 +56,20 @@ exports.handler = ({ project_directory, testcase, iterative }) => {
56
56
  }
57
57
 
58
58
  async function runTestOnNewServer(flowFilePath, testcaseSelected, iterative) {
59
- let designerServer = new DesignerServer(
60
- flowFilePath,
61
- false,
62
- {
59
+ let options = {
60
+ flowPath: flowFilePath,
61
+ safe: false,
62
+ cliParams: {
63
63
  loglevel: "error",
64
64
  noadmin: true
65
- });
65
+ }
66
+ }
67
+
68
+ let designerServer = new DesignerServer(options);
69
+
66
70
 
67
71
  try {
68
- await designerServer.listen();
72
+ await designerServer.start();
69
73
  logInfo(`> Flow file: ${path.resolve(flowFilePath)} \n`);
70
74
  let testSuiteRunner = new TestSuiteRunner(designerServer);
71
75
 
@@ -5,6 +5,10 @@ function logError(message) {
5
5
  console.log(chalk.red(message));
6
6
  }
7
7
 
8
+ function logFatal(message) {
9
+ console.log(chalk.red(message));
10
+ }
11
+
8
12
  function logNotice(message) {
9
13
  console.log(chalk.yellow(message));
10
14
  }
@@ -16,5 +20,6 @@ function logInfo(message) {
16
20
  module.exports = {
17
21
  logError,
18
22
  logNotice,
19
- logInfo
23
+ logInfo,
24
+ logFatal
20
25
  }
Binary file
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@kumologica/sdk",
3
+ "version": "3.4.0",
3
4
  "productName": "Kumologica Designer",
4
5
  "copyright": "Copyright 2020 Kumologica Pty Ltd, All Rights Reserved.",
5
6
  "author": "Kumologica Pty Ltd <contact@kumologica.com>",
6
- "version": "3.4.0-beta8",
7
7
  "description": "Kumologica Designer, harnessing Serverless for your cloud integration needs",
8
8
  "main": "src/app/main.js",
9
9
  "files": [
@@ -64,9 +64,9 @@
64
64
  "license": "Proprietary",
65
65
  "dependencies": {
66
66
  "@electron/remote": "^2.0.8",
67
- "@kumologica/builder": "3.4.0-beta8",
68
- "@kumologica/devkit": "3.4.0-beta8",
69
- "@kumologica/runtime": "3.4.0-beta8",
67
+ "@kumologica/builder": "3.4.0",
68
+ "@kumologica/devkit": "3.4.0",
69
+ "@kumologica/runtime": "3.4.0",
70
70
  "adm-zip": "0.4.13",
71
71
  "ajv": "8.10.0",
72
72
  "archive-type": "^4.0.0",
@@ -76,7 +76,10 @@ class ModalNewProject {
76
76
  }
77
77
 
78
78
  close() {
79
- this.window.close();
79
+ if (this.window){
80
+ this.window.close();
81
+ }
82
+
80
83
  }
81
84
  get window() {
82
85
  return this.window;
@@ -0,0 +1,106 @@
1
+ const electron = require('electron');
2
+ const path = require('path');
3
+ const url = require('url');
4
+ const { BrowserWindow } = electron;
5
+ const { isMac, isWin } = require('../util');
6
+ const preloadJsPath = path.join(__dirname, '..', 'preload.js');
7
+ const editorManager = require('./editor-manager');
8
+
9
+ class ModalRenameTab {
10
+ window = null;
11
+
12
+ constructor(parentWindow, cancellable, params) {
13
+ this.port = editorManager.getPort();
14
+ this.cancellable = cancellable;
15
+ this.tabId = params.tabId;
16
+ this.oldTabName = params.oldTabName;
17
+ let windowOptions = {
18
+ parent: parentWindow,
19
+ modal: true,
20
+ width: 540,
21
+ height: 220, //290,
22
+ minimizable: false,
23
+ maximizable: false,
24
+ resizable: true,
25
+ icon: "./src/assets/kumologica-app.png",
26
+ titleBarStyle: 'hiddenInset',
27
+ backgroundColor: '#fff',
28
+ webPreferences: {
29
+ nodeIntegration: false,
30
+ preload: preloadJsPath,
31
+ enableRemoteModule: true,
32
+ contextIsolation: false,
33
+ additionalArguments: [`--port=${this.port}`]
34
+ },
35
+ show: false,
36
+ };
37
+
38
+ this.window = new BrowserWindow(windowOptions);
39
+ if (isMac){
40
+ this.window.setWindowButtonVisibility(false);
41
+ }
42
+
43
+ require("@electron/remote/main").enable(this.window.webContents);
44
+ // this.window.webContents.openDevTools();
45
+
46
+ this.window.webContents.on('did-finish-load', async () => {
47
+ // Send params to modal
48
+ this.window.webContents.send('receiveProps', {
49
+ payload: {
50
+ tabId: this.tabId,
51
+ oldTabName: this.oldTabName,
52
+ }
53
+ });
54
+ })
55
+
56
+ this.window.on('focus', () => this.window.webContents.send('focus'));
57
+ this.window.on('blur', () => this.window.webContents.send('blur'));
58
+
59
+ this.window.once('ready-to-show', () => {
60
+ this.window.show();
61
+ });
62
+
63
+ this.window.on('page-title-updated', (e) => {
64
+ e.preventDefault();
65
+ });
66
+
67
+ this.window.on('closed', () => {
68
+ // Dereference the window object, usually you would store windows
69
+ // in an array if your app supports multi windows, this is the time
70
+ // when you should delete the corresponding element.
71
+ this.window = null;
72
+ });
73
+ }
74
+
75
+ load() {
76
+ this.window.loadURL(
77
+ url.format({
78
+ pathname: `127.0.0.1:${this.port}/__renameTab`,
79
+ protocol: 'http:',
80
+ slashes: true,
81
+ }),
82
+ {
83
+ userAgent: 'Kumologica Designer'
84
+ }
85
+ );
86
+ this.window.removeMenu();
87
+ }
88
+ show() {
89
+ this.window.show();
90
+ }
91
+ reload() {
92
+ this.window.reload();
93
+ }
94
+
95
+ close() {
96
+ this.window.close();
97
+ }
98
+ get window() {
99
+ return this.window;
100
+ }
101
+ isCancellable() {
102
+ return this.cancellable;
103
+ }
104
+ }
105
+
106
+ module.exports = ModalRenameTab;
package/src/app/main.js CHANGED
@@ -29,6 +29,7 @@ const MainWindow = require('./main-process/main-window');
29
29
  const ModalNewProject = require('./main-process/modal-newproject');
30
30
  const ModalHome = require('./main-process/modal-home');
31
31
  const ModalNewTab = require('./main-process/modal-newtab');
32
+ const ModalRenameTab = require('./main-process/modal-renameTab');
32
33
  const ModalWelcome = require('./main-process/modal-welcome');
33
34
  const EventEmitter = require('events');
34
35
  const ModalNodeLibrary = require('./main-process/modal-nodelibrary');
@@ -232,6 +233,11 @@ ipcMain.on('navigator:open-new-tab-dialog', ()=> {
232
233
  currentModalWindow = new ModalNewTab(mainWindow.window, true);
233
234
  currentModalWindow.load();
234
235
  });
236
+ ipcMain.on('navigator:open-rename-tab-dialog', (event, payload)=> {
237
+ const { tabId, oldTabName } = payload;
238
+ currentModalWindow = new ModalRenameTab(mainWindow.window, true, {tabId, oldTabName});
239
+ currentModalWindow.load();
240
+ });
235
241
 
236
242
  // ***** Events from modal-node-library *****
237
243
 
@@ -351,12 +357,28 @@ ipcMain.on('open-new-tab-dialog:close', async(event, payload)=> {
351
357
  }
352
358
  });
353
359
 
360
+ ipcMain.on('open-rename-tab-dialog:close', async(event, payload)=> {
361
+ if (currentModalWindow.isCancellable()) {
362
+ currentModalWindow.close();
363
+ } else {
364
+ // Exit app by closing all windows
365
+ currentModalWindow.close();
366
+ mainWindow.close();
367
+ }
368
+ });
369
+
354
370
  ipcMain.on('open-new-tab-dialog:create-tab', async(event, payload)=> {
355
371
  currentModalWindow.close();
356
372
  let tabName = payload['createTabName'];
357
373
  mainWindow.sendEventToRenderer('create-new-tab', { tabName });
358
374
  });
359
375
 
376
+ ipcMain.on('open-rename-tab-dialog:rename-tab', async(event, payload)=> {
377
+ currentModalWindow.close();
378
+ const {tabId, newTabName} = payload;
379
+ mainWindow.sendEventToRenderer('explorer:rename-tab', { tabId, newTabName });
380
+ });
381
+
360
382
 
361
383
  function showNewProjectDialog(cancellable) {
362
384
  currentModalWindow = new ModalNewProject(mainWindow.window, cancellable);
@@ -106,6 +106,14 @@ module.exports = {
106
106
  ui.modalNewTab
107
107
  );
108
108
 
109
+ editorApp.get(
110
+ '/__renameTab',
111
+ ensureInvocationFromDesigner,
112
+ ensureRuntimeStarted,
113
+ ui.ensureSlash,
114
+ ui.modalRenameTab
115
+ );
116
+
109
117
  // Serve the ModalNodeLibrary page
110
118
  editorApp.get(
111
119
  '/__nodeLibrary',
@@ -59,6 +59,15 @@ let modalNewTabTemplatePath = path.join(
59
59
  );
60
60
  let modalNewTabTemplate;
61
61
 
62
+ // Modal for rename tabs
63
+ let modalRenameTabTemplatePath = path.join(
64
+ editorClientDir,
65
+ 'templates',
66
+ 'modals',
67
+ 'modalRenameTab.mst'
68
+ );
69
+ let modalRenameTabTemplate;
70
+
62
71
  // Modal for library nodes
63
72
  let modalNodeLibraryPath = path.join(
64
73
  editorClientDir,
@@ -91,13 +100,20 @@ module.exports = {
91
100
  );
92
101
  Mustache.parse(modalNewProjectTemplate);
93
102
 
94
- // Parse the modalNewProject page
103
+ // Parse the modalNewTab page
95
104
  modalNewTabTemplate = fs.readFileSync(
96
105
  modalNewTabTemplatePath,
97
106
  'utf8'
98
107
  );
99
108
  Mustache.parse(modalNewTabTemplate);
100
109
 
110
+ // Parse the RenameTab page
111
+ modalRenameTabTemplate = fs.readFileSync(
112
+ modalRenameTabTemplatePath,
113
+ 'utf8'
114
+ );
115
+ Mustache.parse(modalRenameTabTemplate);
116
+
101
117
  // Parse the modalNodeLibary page
102
118
  modalNodeLibraryTemplate = fs.readFileSync(modalNodeLibraryPath, 'utf8');
103
119
  Mustache.parse(modalNodeLibraryTemplate);
@@ -154,6 +170,10 @@ module.exports = {
154
170
  res.send(Mustache.render(modalNewTabTemplate, theme.context()));
155
171
  },
156
172
 
173
+ modalRenameTab: function(req, res) {
174
+ res.send(Mustache.render(modalRenameTabTemplate, theme.context()));
175
+ },
176
+
157
177
  modalHomePage: function(req, res) {
158
178
  res.send(Mustache.render(modalHomeTemplate, theme.context()));
159
179
  },