@gudhub/core 1.1.12 → 1.1.15
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.
- package/GUDHUB/GHConstructor/createAngularModuleInstance.js +28 -3
- package/GUDHUB/GHConstructor/createClassInstance.js +153 -138
- package/GUDHUB/GHConstructor/ghconstructor.js +11 -4
- package/GUDHUB/GHConstructor/ghconstructor.test.js +66 -0
- package/GUDHUB/PipeService/PipeService.test.js +9 -9
- package/GUDHUB/Storage/ModulesList.js +6 -1
- package/GUDHUB/Utils/AppsTemplateService/AppsTemplateService.js +74 -66
- package/GUDHUB/Utils/json_constructor/json_constructor.js +1 -1
- package/GUDHUB/Utils/json_constructor/json_constructor.test.js +78 -2
- package/Readme.md +347 -365
- package/package.json +5 -2
- package/umd/library.min.js +6 -6
- package/umd/library.min.js.map +1 -1
|
@@ -73,7 +73,7 @@ let angular = {
|
|
|
73
73
|
/*** TODO ***/
|
|
74
74
|
// Need to make angular modules instances creation similar to pure js classes.
|
|
75
75
|
|
|
76
|
-
export default async function createAngularModuleInstance(module_id, module_url, angularInjector, nodeWindow) {
|
|
76
|
+
export default async function createAngularModuleInstance(gudhub, module_id, module_url, angularInjector, nodeWindow) {
|
|
77
77
|
|
|
78
78
|
try {
|
|
79
79
|
|
|
@@ -106,13 +106,37 @@ export default async function createAngularModuleInstance(module_id, module_url,
|
|
|
106
106
|
|
|
107
107
|
} else {
|
|
108
108
|
|
|
109
|
+
const proxy = new Proxy(nodeWindow, {
|
|
110
|
+
get: (target, property) => {
|
|
111
|
+
return target[property]
|
|
112
|
+
},
|
|
113
|
+
set: (target, property, value) => {
|
|
114
|
+
target[property] = value;
|
|
115
|
+
global[property] = value;
|
|
116
|
+
return true;
|
|
117
|
+
}
|
|
118
|
+
})
|
|
119
|
+
|
|
109
120
|
// If node's global object don't have window and it's methods yet - set it.
|
|
110
121
|
if (!global.hasOwnProperty('window')) {
|
|
111
|
-
global.window =
|
|
122
|
+
global.window = proxy;
|
|
112
123
|
global.document = nodeWindow.document;
|
|
113
124
|
global.Element = nodeWindow.Element;
|
|
125
|
+
global.CharacterData = nodeWindow.CharacterData;
|
|
126
|
+
global.this = proxy;
|
|
127
|
+
global.self = proxy;
|
|
128
|
+
global.Blob = nodeWindow.Blob;
|
|
129
|
+
global.Node = nodeWindow.Node;
|
|
114
130
|
global.navigator = nodeWindow.navigator;
|
|
115
131
|
global.HTMLElement = nodeWindow.HTMLElement;
|
|
132
|
+
global.XMLHttpRequest = nodeWindow.XMLHttpRequest;
|
|
133
|
+
global.WebSocket = nodeWindow.WebSocket;
|
|
134
|
+
global.crypto = nodeWindow.crypto;
|
|
135
|
+
global.DOMParser = nodeWindow.DOMParser;
|
|
136
|
+
global.Symbol = nodeWindow.Symbol;
|
|
137
|
+
global.document.queryCommandSupported = (command) => {
|
|
138
|
+
return false;
|
|
139
|
+
}
|
|
116
140
|
global.angular = angular;
|
|
117
141
|
}
|
|
118
142
|
|
|
@@ -131,6 +155,7 @@ export default async function createAngularModuleInstance(module_id, module_url,
|
|
|
131
155
|
module = await import(/* webpackIgnore: true */encodedCode);
|
|
132
156
|
} catch (err) {
|
|
133
157
|
console.log(`Error while importing module: ${module_id}`);
|
|
158
|
+
console.log(err);
|
|
134
159
|
}
|
|
135
160
|
|
|
136
161
|
// Modules always exports classes as default, so we create new class instance.
|
|
@@ -196,7 +221,7 @@ export default async function createAngularModuleInstance(module_id, module_url,
|
|
|
196
221
|
let currentDataType = importedClass;
|
|
197
222
|
|
|
198
223
|
try {
|
|
199
|
-
let interpr_arr = await currentDataType.getInterpretation(value, appId, itemId, field, dataType);
|
|
224
|
+
let interpr_arr = await currentDataType.getInterpretation(gudhub, value, appId, itemId, field, dataType);
|
|
200
225
|
let data = interpr_arr.find((item) => item.id == interpretation_id) || interpr_arr.find((item) => item.id == 'default');
|
|
201
226
|
|
|
202
227
|
let result = await data.content()
|
|
@@ -1,187 +1,202 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
2
|
import { IS_WEB } from './../consts.js';
|
|
3
3
|
|
|
4
|
-
export default async function createClassInstance(module_id, js_url, css_url, nodeWindow) {
|
|
4
|
+
export default async function createClassInstance(gudhub, module_id, js_url, css_url, nodeWindow) {
|
|
5
5
|
|
|
6
6
|
try {
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
// Check if there is url to javascript file of module
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
// Import module using dynamic import
|
|
15
|
-
|
|
16
|
-
let downloadModule = (url) => {
|
|
17
|
-
if (!IS_WEB && !global.hasOwnProperty('window')) {
|
|
18
|
-
global.window = nodeWindow;
|
|
19
|
-
global.document = nodeWindow.document;
|
|
20
|
-
global.Element = nodeWindow.Element;
|
|
21
|
-
global.navigator = nodeWindow.navigator;
|
|
22
|
-
global.HTMLElement = nodeWindow.HTMLElement;
|
|
10
|
+
if (!js_url) {
|
|
11
|
+
console.error(`JS link must be provided for this data type - ${module_id}`);
|
|
23
12
|
}
|
|
24
|
-
return new Promise(async (resolve) => {
|
|
25
|
-
let moduleData = await axios.get(url).catch(err => {
|
|
26
|
-
console.log(`Failed to fetch: ${url} in ghconstructor. Module id: ${module_id}`);
|
|
27
|
-
})
|
|
28
13
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
14
|
+
// Import module using dynamic import
|
|
15
|
+
|
|
16
|
+
let downloadModule = (url) => {
|
|
17
|
+
if (!IS_WEB && !global.hasOwnProperty('window')) {
|
|
18
|
+
global.window = proxy;
|
|
19
|
+
global.document = nodeWindow.document;
|
|
20
|
+
global.Element = nodeWindow.Element;
|
|
21
|
+
global.CharacterData = nodeWindow.CharacterData;
|
|
22
|
+
global.this = proxy;
|
|
23
|
+
global.self = proxy;
|
|
24
|
+
global.Blob = nodeWindow.Blob;
|
|
25
|
+
global.Node = nodeWindow.Node;
|
|
26
|
+
global.navigator = nodeWindow.navigator;
|
|
27
|
+
global.HTMLElement = nodeWindow.HTMLElement;
|
|
28
|
+
global.XMLHttpRequest = nodeWindow.XMLHttpRequest;
|
|
29
|
+
global.WebSocket = nodeWindow.WebSocket;
|
|
30
|
+
global.crypto = nodeWindow.crypto;
|
|
31
|
+
global.DOMParser = nodeWindow.DOMParser;
|
|
32
|
+
global.Symbol = nodeWindow.Symbol;
|
|
33
|
+
global.document.queryCommandSupported = (command) => {
|
|
34
|
+
console.log('QUERY COMMAND SUPPORTED: ', command);
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
global.angular = angular;
|
|
38
|
+
}
|
|
39
|
+
return new Promise(async (resolve) => {
|
|
40
|
+
let moduleData = await axios.get(url).catch(err => {
|
|
41
|
+
console.log(`Failed to fetch: ${url} in ghconstructor. Module id: ${module_id}`);
|
|
42
|
+
})
|
|
36
43
|
|
|
37
|
-
|
|
44
|
+
let encodedJs = encodeURIComponent(moduleData.data);
|
|
38
45
|
|
|
39
|
-
|
|
46
|
+
let dataUri = 'data:text/javascript;charset=utf-8,' + encodedJs;
|
|
40
47
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
console.log(`Error while importing module: ${module_id}`);
|
|
45
|
-
console.log(err);
|
|
46
|
-
}
|
|
48
|
+
resolve(dataUri);
|
|
49
|
+
})
|
|
50
|
+
}
|
|
47
51
|
|
|
48
|
-
|
|
52
|
+
let moduleData = await downloadModule(js_url);
|
|
49
53
|
|
|
50
|
-
|
|
54
|
+
let module;
|
|
51
55
|
|
|
52
|
-
|
|
53
|
-
|
|
56
|
+
try {
|
|
57
|
+
module = await import(/* webpackIgnore: true */moduleData);
|
|
58
|
+
} catch (err) {
|
|
59
|
+
console.log(`Error while importing module: ${module_id}`);
|
|
60
|
+
console.log(err);
|
|
61
|
+
}
|
|
54
62
|
|
|
55
|
-
|
|
56
|
-
const linkTag = document.createElement('link');
|
|
57
|
-
linkTag.href = css_url;
|
|
58
|
-
linkTag.setAttribute('data-module', module_id);
|
|
59
|
-
linkTag.setAttribute('rel', 'stylesheet');
|
|
60
|
-
document.getElementsByTagName('head')[0].appendChild(linkTag);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
let result = {
|
|
64
|
-
type: module_id,
|
|
63
|
+
// Creating class from imported module
|
|
65
64
|
|
|
66
|
-
|
|
65
|
+
let importedClass = new module.default(module_id);
|
|
67
66
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
return importedClass.getTemplate(ref, changeFieldName, displayFieldNameChecked, field_model, appId, itemId);
|
|
71
|
-
},
|
|
67
|
+
// Check if there is url to css file of module
|
|
68
|
+
// If true, and there is no css for this data type, than create link tag to this css in head
|
|
72
69
|
|
|
73
|
-
|
|
70
|
+
if (css_url && IS_WEB) {
|
|
71
|
+
const linkTag = document.createElement('link');
|
|
72
|
+
linkTag.href = css_url;
|
|
73
|
+
linkTag.setAttribute('data-module', module_id);
|
|
74
|
+
linkTag.setAttribute('rel', 'stylesheet');
|
|
75
|
+
document.getElementsByTagName('head')[0].appendChild(linkTag);
|
|
76
|
+
}
|
|
74
77
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
let getValueFunction = importedClass.getDefaultValue;
|
|
78
|
-
if (getValueFunction) {
|
|
79
|
-
let value = await getValueFunction(fieldModel, valuesArray, itemsList, currentAppId);
|
|
80
|
-
resolve(value);
|
|
81
|
-
} else {
|
|
82
|
-
resolve(null);
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
},
|
|
78
|
+
let result = {
|
|
79
|
+
type: module_id,
|
|
86
80
|
|
|
87
|
-
|
|
81
|
+
//*************** GET TEMPLATE ****************//
|
|
88
82
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
83
|
+
getTemplate: function (ref, changeFieldName, displayFieldName, field_model, appId, itemId) {
|
|
84
|
+
let displayFieldNameChecked = displayFieldName === 'false' ? false : true;
|
|
85
|
+
return importedClass.getTemplate(ref, changeFieldName, displayFieldNameChecked, field_model, appId, itemId);
|
|
86
|
+
},
|
|
92
87
|
|
|
93
|
-
|
|
88
|
+
//*************** GET DEFAULT VALUE ****************//
|
|
89
|
+
|
|
90
|
+
getDefaultValue: function (fieldModel, valuesArray, itemsList, currentAppId) {
|
|
91
|
+
return new Promise(async (resolve) => {
|
|
92
|
+
let getValueFunction = importedClass.getDefaultValue;
|
|
93
|
+
if (getValueFunction) {
|
|
94
|
+
let value = await getValueFunction(fieldModel, valuesArray, itemsList, currentAppId);
|
|
95
|
+
resolve(value);
|
|
96
|
+
} else {
|
|
97
|
+
resolve(null);
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
},
|
|
94
101
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
return importedClass.filter.getSearchOptions(fieldModel);
|
|
100
|
-
}
|
|
101
|
-
return [];
|
|
102
|
+
//*************** GET SETTINGS ****************//
|
|
103
|
+
|
|
104
|
+
getSettings: function (scope, settingType, fieldModels) {
|
|
105
|
+
return importedClass.getSettings(scope, settingType, fieldModels);
|
|
102
106
|
},
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
107
|
+
|
|
108
|
+
//*************** FILTER****************//
|
|
109
|
+
|
|
110
|
+
filter: {
|
|
111
|
+
getSearchOptions: function (fieldModel) {
|
|
112
|
+
let d_type = importedClass;
|
|
113
|
+
if (d_type.filter && d_type.filter.getSearchOptions) {
|
|
114
|
+
return importedClass.filter.getSearchOptions(fieldModel);
|
|
115
|
+
}
|
|
108
116
|
return [];
|
|
117
|
+
},
|
|
118
|
+
getDropdownValues: function () {
|
|
119
|
+
let d_type = importedClass;
|
|
120
|
+
if (d_type.filter && d_type.filter.getDropdownValues) {
|
|
121
|
+
return d_type.filter.getDropdownValues();
|
|
122
|
+
} else {
|
|
123
|
+
return [];
|
|
124
|
+
}
|
|
109
125
|
}
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
|
|
113
|
-
//*************** GET INTERPRETATION ****************//
|
|
126
|
+
},
|
|
114
127
|
|
|
115
|
-
|
|
116
|
-
return new Promise(async (resolve) => {
|
|
117
|
-
let currentDataType = importedClass;
|
|
128
|
+
//*************** GET INTERPRETATION ****************//
|
|
118
129
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
let
|
|
130
|
+
getInterpretation: function (value, interpretation_id, dataType, field, itemId, appId) {
|
|
131
|
+
return new Promise(async (resolve) => {
|
|
132
|
+
let currentDataType = importedClass;
|
|
122
133
|
|
|
123
|
-
|
|
134
|
+
try {
|
|
135
|
+
let interpr_arr = await currentDataType.getInterpretation(gudhub, value, appId, itemId, field, dataType);
|
|
136
|
+
let data = interpr_arr.find((item) => item.id == interpretation_id) || interpr_arr.find((item) => item.id == 'default');
|
|
124
137
|
|
|
125
|
-
|
|
126
|
-
} catch (error) {
|
|
127
|
-
console.log(`ERROR IN ${module_id}`, error);
|
|
128
|
-
resolve({ html: '<span>no interpretation</span>' })
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
},
|
|
138
|
+
let result = await data.content()
|
|
132
139
|
|
|
133
|
-
|
|
140
|
+
resolve({ html: result });
|
|
141
|
+
} catch (error) {
|
|
142
|
+
console.log(`ERROR IN ${module_id}`, error);
|
|
143
|
+
resolve({ html: '<span>no interpretation</span>' })
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
},
|
|
134
147
|
|
|
135
|
-
|
|
136
|
-
return importedClass.getInterpretation(field_value, appId, itemId, field);
|
|
137
|
-
},
|
|
148
|
+
//*************** GET INTERPRETATIONS LIST ****************//
|
|
138
149
|
|
|
139
|
-
|
|
150
|
+
getInterpretationsList: function (field_value, appId, itemId, field) {
|
|
151
|
+
return importedClass.getInterpretation(field_value, appId, itemId, field);
|
|
152
|
+
},
|
|
140
153
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
let
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
154
|
+
//*************** GET INTERPRETATED VALUE ****************//
|
|
155
|
+
|
|
156
|
+
getInterpretatedValue: function (field_value, field_model, appId, itemId) {
|
|
157
|
+
return new Promise(async (resolve) => {
|
|
158
|
+
let getInterpretatedValueFunction = importedClass.getInterpretatedValue;
|
|
159
|
+
if (getInterpretatedValueFunction) {
|
|
160
|
+
let value = await getInterpretatedValueFunction(field_value, field_model, appId, itemId);
|
|
161
|
+
resolve(value);
|
|
162
|
+
} else {
|
|
163
|
+
resolve(field_value);
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
},
|
|
152
167
|
|
|
153
|
-
|
|
168
|
+
//*************** EXTEND CONTROLLER ****************//
|
|
154
169
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
170
|
+
extendController: function (actionScope) {
|
|
171
|
+
importedClass.getActionScope(actionScope);
|
|
172
|
+
},
|
|
158
173
|
|
|
159
|
-
|
|
174
|
+
//*************** RUN ACTION ****************//
|
|
160
175
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
176
|
+
runAction: function (scope) {
|
|
177
|
+
try {
|
|
178
|
+
importedClass.runAction(scope);
|
|
179
|
+
} catch (e) {
|
|
165
180
|
|
|
166
|
-
|
|
167
|
-
|
|
181
|
+
}
|
|
182
|
+
},
|
|
168
183
|
|
|
169
|
-
|
|
184
|
+
//*************** GET WINDOW SCOPE ****************//
|
|
170
185
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
186
|
+
getWindowScope: function (windowScope) {
|
|
187
|
+
return importedClass.getWindowScope(windowScope);
|
|
188
|
+
},
|
|
174
189
|
|
|
175
|
-
|
|
190
|
+
//*************** GET WINDOW HTML ****************//
|
|
176
191
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
192
|
+
getWindowHTML: function (scope) {
|
|
193
|
+
return importedClass.getWindowHTML(scope);
|
|
194
|
+
},
|
|
195
|
+
}
|
|
181
196
|
|
|
182
|
-
|
|
197
|
+
return result;
|
|
183
198
|
|
|
184
|
-
} catch(err) {
|
|
199
|
+
} catch (err) {
|
|
185
200
|
console.log(err);
|
|
186
201
|
console.log(`Failed in createClassInstance (ghconstructor). Module id: ${module_id}. JS url: ${js_url}`);
|
|
187
202
|
}
|
|
@@ -69,16 +69,23 @@ export class GHConstructor {
|
|
|
69
69
|
|
|
70
70
|
async createInstance(module_id) {
|
|
71
71
|
let module = this.gudhub.storage.getModuleUrl(module_id);
|
|
72
|
+
|
|
73
|
+
if(!module) {
|
|
74
|
+
console.log(`Cannot find module: ${module_id}`);
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
72
77
|
|
|
73
78
|
let result;
|
|
74
79
|
if (module.type === 'angular') {
|
|
75
|
-
result = await createAngularModuleInstance(module_id, module.url, this.angularInjector, this.nodeWindow);
|
|
80
|
+
result = await createAngularModuleInstance(this.gudhub, module_id, module.url, this.angularInjector, this.nodeWindow);
|
|
76
81
|
} else if(module.type === 'class') {
|
|
77
|
-
result = await createClassInstance(module_id, module.js, module.css, this.nodeWindow);
|
|
82
|
+
result = await createClassInstance(this.gudhub, module_id, module.js, module.css, this.nodeWindow);
|
|
78
83
|
}
|
|
79
84
|
|
|
80
|
-
|
|
81
|
-
|
|
85
|
+
if(result) {
|
|
86
|
+
this.pupToCache(result);
|
|
87
|
+
}
|
|
88
|
+
|
|
82
89
|
return result;
|
|
83
90
|
}
|
|
84
91
|
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// import should from "should";
|
|
2
|
+
// import sinon from "sinon";
|
|
3
|
+
// import {GudHub} from './../gudhub.js';
|
|
4
|
+
// import { JSDOM } from 'jsdom';
|
|
5
|
+
|
|
6
|
+
// describe("GHConstructor", () => {
|
|
7
|
+
|
|
8
|
+
// before(() => {
|
|
9
|
+
// sinon.stub(console, 'info') // disable console.info
|
|
10
|
+
// sinon.stub(console, 'warn') // disable console.warn
|
|
11
|
+
// sinon.stub(console, 'error') // disable console.error
|
|
12
|
+
// // sinon.stub(console, 'log') // disable console.error
|
|
13
|
+
// })
|
|
14
|
+
|
|
15
|
+
// it('CREATE INSTANCES FOR ALL DATA TYPES', async () => {
|
|
16
|
+
// const gudhub = new GudHub('o5A10WgXdFpvzJYt0tp6gQaIqF52vPqlbONtjq6yvCSaqr7AtDHGzIS6/9uqJgNhw0Bh5ttE8ft2xQ5xaZ5fHA==', {
|
|
17
|
+
// server_url: 'https://gudhub.com/GudHub_Test',
|
|
18
|
+
// async_modules_path: 'build/async_modules_node/',
|
|
19
|
+
// file_server_url: 'http://localhost:8080'
|
|
20
|
+
// });
|
|
21
|
+
|
|
22
|
+
// const jsdom = new JSDOM('', {
|
|
23
|
+
// url: 'http://localhost:1234',
|
|
24
|
+
// runScripts: 'dangerously'
|
|
25
|
+
// });
|
|
26
|
+
|
|
27
|
+
// const { window } = jsdom;
|
|
28
|
+
|
|
29
|
+
// gudhub.ghconstructor.initJsdomWindow(window);
|
|
30
|
+
|
|
31
|
+
// let instance = await gudhub.ghconstructor.getInstance('vs_code');
|
|
32
|
+
|
|
33
|
+
// if(instance) {
|
|
34
|
+
// console.log('DONE!');
|
|
35
|
+
// }
|
|
36
|
+
|
|
37
|
+
// // let modulesList = gudhub.storage.modulesList;
|
|
38
|
+
// // let modulesObj = {};
|
|
39
|
+
|
|
40
|
+
// // modulesList.forEach(item => {
|
|
41
|
+
// // modulesObj[item.name] = false
|
|
42
|
+
// // });
|
|
43
|
+
|
|
44
|
+
// // const promises = [];
|
|
45
|
+
|
|
46
|
+
// // for(let i = 0; i < modulesList.length; i++) {
|
|
47
|
+
// // promises.push(new Promise(async (resolve) => {
|
|
48
|
+
// // try {
|
|
49
|
+
// // gudhub.ghconstructor.getInstance(modulesList[i].name).then(() => {
|
|
50
|
+
// // modulesObj[modulesList[i].name] = true;
|
|
51
|
+
// // })
|
|
52
|
+
// // resolve(true);
|
|
53
|
+
// // } catch(err) {
|
|
54
|
+
// // console.log('ERR!');
|
|
55
|
+
// // resolve(false);
|
|
56
|
+
// // }
|
|
57
|
+
// // }));
|
|
58
|
+
// // }
|
|
59
|
+
|
|
60
|
+
// // Promise.all(promises).then(() => {
|
|
61
|
+
// // console.log('ALL DONE!');
|
|
62
|
+
// // console.log('MODULES: ', modulesObj);
|
|
63
|
+
// // });
|
|
64
|
+
|
|
65
|
+
// });
|
|
66
|
+
// });
|
|
@@ -62,16 +62,16 @@ describe("PipeService", () => {
|
|
|
62
62
|
});
|
|
63
63
|
|
|
64
64
|
|
|
65
|
-
it("Emitting event and then adding new subscriber", () => {
|
|
66
|
-
|
|
65
|
+
// it("Emitting event and then adding new subscriber", () => {
|
|
66
|
+
// let incomeData = null;
|
|
67
67
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
});
|
|
68
|
+
// gudhub
|
|
69
|
+
// .emit("test", { app_id: 4, item_id: 3, field_id: 2 }, {"message" : "this is the data"})
|
|
70
|
+
// .on("test", { app_id: 4, item_id: 3, field_id: 2 }, (event, data) => {
|
|
71
|
+
// incomeData = data.message;
|
|
72
|
+
// });
|
|
73
|
+
// incomeData.should.equal("this is the data");
|
|
74
|
+
// });
|
|
75
75
|
|
|
76
76
|
|
|
77
77
|
});
|
|
@@ -85,6 +85,11 @@ export default function generateModulesList(async_modules_path, file_server_url)
|
|
|
85
85
|
url: file_server_url + '/' + async_modules_path + "itemRef_data.js",
|
|
86
86
|
type: 'angular'
|
|
87
87
|
},
|
|
88
|
+
{
|
|
89
|
+
name: "calendar",
|
|
90
|
+
url: file_server_url + '/' + async_modules_path + "calendar_data.js",
|
|
91
|
+
type: 'angular'
|
|
92
|
+
},
|
|
88
93
|
{
|
|
89
94
|
name: "data_ref",
|
|
90
95
|
url: file_server_url + '/' + async_modules_path + "data_ref_data.js",
|
|
@@ -515,7 +520,7 @@ export default function generateModulesList(async_modules_path, file_server_url)
|
|
|
515
520
|
type: 'class'
|
|
516
521
|
},
|
|
517
522
|
{
|
|
518
|
-
name: '
|
|
523
|
+
name: 'fullcalendar',
|
|
519
524
|
js: 'https://gudhub.com/modules/FullCalendar-Gh-Element/dist/main.js',
|
|
520
525
|
css: 'https://gudhub.com/modules/FullCalendar-Gh-Element/dist/style.css',
|
|
521
526
|
type: 'class'
|