@wavemaker/angular-codegen 11.0.1-next.139047 → 11.0.1-next.139249

Sign up to get free protection for your applications and to get access to all the features.
@@ -74,8 +74,8 @@ const setMobileProjectType = (angularJson) => {
74
74
  const addMobileSpecificStyles = async (deployUrl) => {
75
75
  if (isDevBuild) {
76
76
  $("body").append(
77
- `<script> const WMStylesPath ="${deployUrl}/wm-android-styles.js" </script>`
78
- )
77
+ `<script type="text/javascript" defer="true" src="${deployUrl}/wm-android-styles.js"></script>`
78
+ );
79
79
  }
80
80
 
81
81
  if (isProdBuild) {
@@ -92,40 +92,20 @@ const addMobileSpecificStyles = async (deployUrl) => {
92
92
  }
93
93
  }
94
94
 
95
- const addScriptForWMStylesPath = () => {
96
- // Add print css on load
97
- $("body").append(`<script>
98
- (function () {
99
- if (typeof WMStylesPath !== "undefined") {
100
- let styleType = WMStylesPath.split(".").pop();
101
- let styleNode;
102
- if(styleType==="css"){
103
- styleNode = document.createElement("link");
104
- styleNode.type = "text/css";
105
- styleNode.rel = "stylesheet";
106
- styleNode.href = WMStylesPath;
107
- }
108
- else if(styleType==="js"){
109
- styleNode = document.createElement("script");
110
- styleNode.type = "text/javascript";
111
- styleNode.src = WMStylesPath;
112
- styleNode.defer = true;
113
- }
114
-
115
- styleNode && document
116
- .getElementsByTagName("head")[0]
117
- .appendChild(styleNode);
118
- }
119
- })()
120
- window.onload = function() {
121
- var printCssNode = document.createElement('link');
122
- printCssNode.type = 'text/css';
123
- printCssNode.rel = 'stylesheet';
124
- printCssNode.href = 'print.css';
125
- printCssNode.media = 'print';
126
- document.getElementsByTagName("head")[0].appendChild(printCssNode);
127
- }
128
- </script>`);
95
+ const addScriptForWMStylesPath = (wm_styles_path) => {
96
+ let styleType = wm_styles_path.split(".").pop();
97
+ if(styleType==="css"){
98
+ $("head").append(
99
+ `<link rel="stylesheet" type="text/css" href="${wm_styles_path}"/>`
100
+ );
101
+ } else {
102
+ $("body").append(
103
+ `<script type="text/javascript" defer="true" src="${wm_styles_path}"></script>`
104
+ );
105
+ }
106
+ $("head").append(
107
+ `<link rel="stylesheet" type="text/css" media="print" href="print.css"/>`
108
+ );
129
109
  }
130
110
 
131
111
  /**
@@ -155,9 +135,9 @@ const SKIP_UPDATE = ['index.html', 'manifest.json'];
155
135
  /**
156
136
  * Checks if a file's name has been changed during the build process
157
137
  * and if changed, returns an updated file path.
158
- *
138
+ *
159
139
  * @param {string} deployUrl deployment url
160
- * @param {string} url an absolute url to check if its filename has changed
140
+ * @param {string} url an absolute url to check if its filename has changed
161
141
  * @param {object} updatedFileNames a map from old filenames to new filenames
162
142
  * @returns {string} an updated file path
163
143
  */
@@ -176,8 +156,8 @@ const getUpdatedFileName = (deployUrl, url, updatedFileNames) => {
176
156
  /**
177
157
  * Checks if a file's content has been changed during the build process
178
158
  * and if changed, returns a new hash to be updated in ngsw.json
179
- *
180
- * @param {string} url an absolute url to check if its filename has changed
159
+ *
160
+ * @param {string} url an absolute url to check if its filename has changed
181
161
  * @param {object} updatedFileHashes a map from filenames to file hashes
182
162
  * @returns {string} an updated file hash
183
163
  */
@@ -191,7 +171,7 @@ const getUpdatedFileHashes = (url, oldHash, updatedFileHashes) => {
191
171
 
192
172
  /**
193
173
  * Get the path of the icon without '/ng-bundle'
194
- *
174
+ *
195
175
  * @param {string} iconPath path with '/ng-bundle'
196
176
  * @returns {string} path of the icon without '/ng-bundle'
197
177
  */
@@ -202,7 +182,7 @@ const getIconPath = (iconPath) => {
202
182
 
203
183
  /**
204
184
  * Updates name, location and content of PWA related assets.
205
- *
185
+ *
206
186
  * @param {string} deployUrl deployment url
207
187
  * @param {object} updatedFileNames a map from old filenames to new filenames
208
188
  * @returns {void}
@@ -245,7 +225,7 @@ const updatePwaAssets = (deployUrl, updatedFileNames, updatedFileHashes) => {
245
225
 
246
226
  /**
247
227
  * Generated sha1 hash for the content supplied.
248
- *
228
+ *
249
229
  * @param {string} content the content to be hashed
250
230
  * @returns {string} the hash value
251
231
  */
@@ -291,26 +271,23 @@ const generateSha1 = (content) => {
291
271
  const serviceWorkerEnabled = build['configurations']['production']['serviceWorker'];
292
272
  const updatedFilenames = {}
293
273
  const updatedFileHashes = {}
274
+ let wm_styles_path;
294
275
 
295
276
  if (isMobileProject) {
296
277
  await addMobileSpecificStyles(deployUrl);
297
278
  } else {
298
279
  if (isDevBuild) {
299
- $("head").append(
300
- `<script> const WMStylesPath = "${deployUrl}/wm-styles.js" </script>`
301
- )
280
+ wm_styles_path = `${deployUrl}/wm-styles.js`;
302
281
  } else {
303
282
  const fileName = 'wm-styles';
304
283
  const hash = await generateHash(`${opPath}/${fileName}.css`);
305
284
  copyCssFiles(hash, updatedFilenames);
306
285
  const updatedFileName = `${fileName}.${hash}.css`
307
- $("head").append(
308
- `<script> const WMStylesPath = "${deployUrl}/${updatedFileName}" </script>`
309
- );
286
+ wm_styles_path = `${deployUrl}/${updatedFileName}`;
310
287
  }
311
288
  }
312
289
 
313
- addScriptForWMStylesPath();
290
+ addScriptForWMStylesPath(wm_styles_path);
314
291
  const htmlContent = $.html();
315
292
  await writeFile(`./dist/index.html`, htmlContent);
316
293
 
@@ -39,7 +39,7 @@
39
39
  "angular2-websocket": "0.9.7",
40
40
  "core-js": "2.5.4",
41
41
  "d3": "3.5.17",
42
- "fullcalendar": "5.0.0",
42
+ "fullcalendar": "3.10.0",
43
43
  "hammerjs": "2.0.8",
44
44
  "he": "1.2.0",
45
45
  "iscroll": "5.2.0",
@@ -9614,9 +9614,13 @@
9614
9614
  }
9615
9615
  },
9616
9616
  "node_modules/fullcalendar": {
9617
- "version": "5.0.0",
9618
- "resolved": "https://registry.npmjs.org/fullcalendar/-/fullcalendar-5.0.0.tgz",
9619
- "integrity": "sha512-O1y3LIh77r4UYzi2TZl+XY3fhnwig7wyef5cdrsYrIxX55QLRXtTTzXz719lGsuBShDLmwn31tPhg85AF8s++w=="
9617
+ "version": "3.10.0",
9618
+ "resolved": "https://registry.npmjs.org/fullcalendar/-/fullcalendar-3.10.0.tgz",
9619
+ "integrity": "sha512-0OtsHhmdYhtFmQwXzyo8VqHzYgamg+zVOoytv5N13gI+iF6CGjevpCi/yBaQs0O4wY3OAp8I688IxdNYe0iAvw==",
9620
+ "peerDependencies": {
9621
+ "jquery": "2 - 3",
9622
+ "moment": "^2.20.1"
9623
+ }
9620
9624
  },
9621
9625
  "node_modules/function-bind": {
9622
9626
  "version": "1.1.1",
@@ -14061,7 +14065,6 @@
14061
14065
  "version": "2.24.0",
14062
14066
  "resolved": "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz",
14063
14067
  "integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==",
14064
- "dev": true,
14065
14068
  "engines": {
14066
14069
  "node": "*"
14067
14070
  }
@@ -31936,9 +31939,10 @@
31936
31939
  "optional": true
31937
31940
  },
31938
31941
  "fullcalendar": {
31939
- "version": "5.0.0",
31940
- "resolved": "https://registry.npmjs.org/fullcalendar/-/fullcalendar-5.0.0.tgz",
31941
- "integrity": "sha512-O1y3LIh77r4UYzi2TZl+XY3fhnwig7wyef5cdrsYrIxX55QLRXtTTzXz719lGsuBShDLmwn31tPhg85AF8s++w=="
31942
+ "version": "3.10.0",
31943
+ "resolved": "https://registry.npmjs.org/fullcalendar/-/fullcalendar-3.10.0.tgz",
31944
+ "integrity": "sha512-0OtsHhmdYhtFmQwXzyo8VqHzYgamg+zVOoytv5N13gI+iF6CGjevpCi/yBaQs0O4wY3OAp8I688IxdNYe0iAvw==",
31945
+ "requires": {}
31942
31946
  },
31943
31947
  "function-bind": {
31944
31948
  "version": "1.1.1",
@@ -35436,8 +35440,7 @@
35436
35440
  "moment": {
35437
35441
  "version": "2.24.0",
35438
35442
  "resolved": "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz",
35439
- "integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==",
35440
- "dev": true
35443
+ "integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg=="
35441
35444
  },
35442
35445
  "morgan": {
35443
35446
  "version": "1.10.0",
@@ -49,7 +49,7 @@
49
49
  "angular2-websocket": "0.9.7",
50
50
  "core-js": "2.5.4",
51
51
  "d3": "3.5.17",
52
- "fullcalendar": "5.0.0",
52
+ "fullcalendar": "3.10.0",
53
53
  "hammerjs": "2.0.8",
54
54
  "he": "1.2.0",
55
55
  "iscroll": "5.2.0",
@@ -68,7 +68,7 @@
68
68
  "tslib": "^2.0.0",
69
69
  "x2js": "3.2.6",
70
70
  "zone.js": "~0.10.3",
71
- "@wavemaker/app-ng-runtime": "11.0.1-next.139047"
71
+ "@wavemaker/app-ng-runtime": "11.0.1-next.139249"
72
72
  },
73
73
  "devDependencies": {
74
74
  "@ampproject/rollup-plugin-closure-compiler": "0.8.5",