qcobjectsnewapp 2.4.3 → 2.4.4

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/VERSION CHANGED
@@ -1 +1 @@
1
- 2.4.3
1
+ 2.4.4
@@ -0,0 +1,71 @@
1
+ <!doctype html>
2
+ <html class="no-js" lang="en">
3
+
4
+ <head>
5
+ <meta charset="utf-8" />
6
+ <meta name="viewport" content="initial-scale=1.0, width=device-width" />
7
+ <!-- This is a wide open CSP declaration. To lock this down for production, see below. -->
8
+ <meta http-equiv="Content-Security-Policy"
9
+ content="default-src * 'self' 'unsafe-inline' 'unsafe-eval' data: gap: https://ssl.gstatic.com; img-src * 'self' data:; child-src *; style-src * 'self' 'unsafe-inline' 'unsafe-eval'; script-src * 'self' 'unsafe-inline' 'unsafe-eval'; connect-src * 'self' 'unsafe-inline' 'unsafe-eval';media-src *">
10
+ <title>QCObjects Demo</title>
11
+ </head>
12
+
13
+ <body>
14
+
15
+
16
+ <my-grid cols=4 componentClass="org.qcobjects.components.grid.GridComponent"
17
+ serviceClass="MyTestService">
18
+ </my-grid>
19
+
20
+ <script type="module">
21
+ import "../QCObjects.js";
22
+ CONFIG.set("sourceType", "module");
23
+ CONFIG.set("useLocalSDK", true); // on the frontend side you can chose whether to load the SDK from sdk.qcobjects.dev or from your local website
24
+
25
+ logger.debugEnabled = true;
26
+
27
+ Package("com.qcobjects.demo.grid", [
28
+ class MyTestService extends JSONService {
29
+ name = 'myservice';
30
+ external = true;
31
+ cached = false;
32
+ method = 'GET';
33
+ headers = { 'Content-Type': 'application/json' };
34
+ url = 'https://api.github.com/orgs/QuickCorp/repos';
35
+ withCredentials = false;
36
+
37
+ /**
38
+ * Creates the instance for MyTestService
39
+ */
40
+ constructor() {
41
+ super(...arguments);
42
+
43
+ }
44
+
45
+ done({ request, service }) {
46
+ logger.debug(request);
47
+ let result = JSON.parse(service.template).reverse().map(function (project) {
48
+ return {
49
+ id: project.id,
50
+ description: project.description,
51
+ title: project.name,
52
+ url: project.html_url,
53
+ image: `https://via.placeholder.com/150/FFFF00/000000?text=${encodeURI(project.name)}`
54
+ };
55
+ });
56
+
57
+ service.template = JSON.stringify({
58
+ result: result
59
+ });
60
+ }
61
+
62
+
63
+ }
64
+
65
+ ])
66
+
67
+ RegisterWidgets("my-grid")
68
+ </script>
69
+ </body>
70
+
71
+ </html>
@@ -0,0 +1,53 @@
1
+ <!doctype html>
2
+ <html class="no-js" lang="en">
3
+
4
+ <head>
5
+ <meta charset="utf-8" />
6
+ <meta name="viewport" content="initial-scale=1.0, width=device-width" />
7
+ <!-- This is a wide open CSP declaration. To lock this down for production, see below. -->
8
+ <meta http-equiv="Content-Security-Policy"
9
+ content="default-src * 'self' 'unsafe-inline' 'unsafe-eval' data: gap: https://ssl.gstatic.com; img-src * 'self' data:; child-src *; style-src * 'self' 'unsafe-inline' 'unsafe-eval'; script-src * 'self' 'unsafe-inline' 'unsafe-eval'; connect-src * 'self' 'unsafe-inline' 'unsafe-eval';media-src *">
10
+ <title>QCObjects Demo</title>
11
+ </head>
12
+
13
+ <body>
14
+
15
+ <my-list componentClass="ListComponent" serviceClass="MyTestService" label-field="name"
16
+ value-field="html_url"></my-list>
17
+
18
+ <script type="module">
19
+ import "../QCObjects.js";
20
+ CONFIG.set("sourceType", "module");
21
+ CONFIG.set("useLocalSDK", true); // on the frontend side you can chose whether to load the SDK from sdk.qcobjects.dev or from your local website
22
+ logger.debugEnabled = true;
23
+
24
+ Package("com.qcobjects.demo.list", [
25
+ class MyTestService extends JSONService {
26
+ name = 'myservice';
27
+ external = true;
28
+ cached = false;
29
+ method = 'GET';
30
+ headers = { 'Content-Type': 'application/json' };
31
+ url = 'https://api.github.com/orgs/QuickCorp/repos';
32
+ withCredentials = false;
33
+
34
+ /**
35
+ * Creates the instance for MyTestService
36
+ */
37
+ constructor() {
38
+ super(...arguments);
39
+ }
40
+
41
+ done(standardResponse) {
42
+ }
43
+ }
44
+
45
+ ]);
46
+
47
+
48
+ RegisterWidgets("my-list");
49
+
50
+ </script>
51
+ </body>
52
+
53
+ </html>
@@ -0,0 +1,61 @@
1
+ <!doctype html>
2
+ <html class="no-js" lang="en">
3
+
4
+ <head>
5
+ <meta charset="utf-8" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <!-- This is a wide open CSP declaration. To lock this down for production, see below. -->
8
+ <meta http-equiv="Content-Security-Policy"
9
+ content="default-src * 'self' 'unsafe-inline' 'unsafe-eval' data: gap: https://ssl.gstatic.com; img-src * 'self' data:; child-src *; style-src * 'self' 'unsafe-inline' 'unsafe-eval'; script-src * 'self' 'unsafe-inline' 'unsafe-eval'; connect-src * 'self' 'unsafe-inline' 'unsafe-eval';media-src *">
10
+ <title>QCObjects Demo</title>
11
+ </head>
12
+
13
+ <body>
14
+
15
+
16
+ <custom-notification template-source="inline" componentClass="CustomNotificationComponent"></custom-notification>
17
+
18
+ <script type="module">
19
+ import "../QCObjects.js";
20
+ CONFIG.set("sourceType", "module");
21
+ CONFIG.set("useLocalSDK", true); // on the frontend side you can chose whether to load the SDK from sdk.qcobjects.dev or from your local website
22
+ logger.debugEnabled = true;
23
+
24
+ Package("com.qcobjects.demo.notification", [
25
+ class CustomNotificationComponent extends Component {
26
+ message_start = "Initializing page!";
27
+ message_end = "Page was loaded successfully!";
28
+ template = "...loading";
29
+
30
+ /**
31
+ * Creates the instance for CustomNotificationComponent
32
+ */
33
+ constructor() {
34
+ super(...arguments);
35
+ NotificationComponent.success(this.message_start)
36
+
37
+ }
38
+
39
+ /**
40
+ * What is inside this function is executed after the component loading is done
41
+ *
42
+ * @param {*} standardResponse it brings all information of the component
43
+ */
44
+ done(standardResponse) {
45
+
46
+ /* in this case we will call a notification after the component is loaded*/
47
+ return Promise.resolve (
48
+ NotificationComponent.success(this.message_end)
49
+ );
50
+ }
51
+
52
+ }
53
+
54
+ ]);
55
+
56
+
57
+ RegisterWidgets("custom-notification")
58
+ </script>
59
+ </body>
60
+
61
+ </html>
@@ -0,0 +1,75 @@
1
+ <!doctype html>
2
+ <html class="no-js" lang="en">
3
+
4
+ <head>
5
+ <meta charset="utf-8" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <!-- This is a wide open CSP declaration. To lock this down for production, see below. -->
8
+ <meta http-equiv="Content-Security-Policy"
9
+ content="default-src * 'self' 'unsafe-inline' 'unsafe-eval' data: gap: https://ssl.gstatic.com; img-src * 'self' data:; child-src *; style-src * 'self' 'unsafe-inline' 'unsafe-eval'; script-src * 'self' 'unsafe-inline' 'unsafe-eval'; connect-src * 'self' 'unsafe-inline' 'unsafe-eval';media-src *">
10
+ <title>QCObjects Demo</title>
11
+ <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/qcobjects/2.4.20/QCObjects.js"></script>
12
+ </head>
13
+
14
+ <body>
15
+
16
+
17
+ <my-slider componentClass="org.qcobjects.components.slider.SliderComponent" serviceClass="GitHubRepoListService"></my-slider>
18
+
19
+ <script type="module">
20
+ import "../QCObjects.js";
21
+ CONFIG.set("sourceType", "module");
22
+ CONFIG.set("useLocalSDK", true); // on the frontend side you can chose whether to load the SDK from sdk.qcobjects.dev or from your local website
23
+ logger.debugEnabled = true;
24
+
25
+ Package("com.qcobjects.demo.slider.service", [
26
+ class GitHubRepoListService extends Service {
27
+ name = 'myservice';
28
+ external = true;
29
+ cached = false;
30
+ method = 'GET';
31
+ headers = { 'Content-Type': 'application/json' };
32
+ url = 'https://api.github.com/orgs/QuickCorp/repos';
33
+ withCredentials = false;
34
+
35
+ /**
36
+ * Creates the instance for MyTestService
37
+ */
38
+ constructor() {
39
+ super(...arguments);
40
+ }
41
+
42
+ /**
43
+ * What is inside this function is executed after the component loading is done
44
+ *
45
+ * @param {*} standardResponse it brings all information of the component
46
+ */
47
+ done({ request, service }) {
48
+ logger.debug(request);
49
+
50
+ /* in this case we will parse response and use only the fields we need */
51
+ service.template = JSON.stringify({
52
+ result: JSON.parse(service.template).reverse().map(function (project) {
53
+ return {
54
+ id: project.id,
55
+ description: project.description,
56
+ title: project.name,
57
+ link: project.html_url,
58
+ image: `https://via.placeholder.com/350/999990/000000?text=${encodeURI(project.name)}`,
59
+ label: "Go to repo",
60
+ category: project.name
61
+ };
62
+ })
63
+ });
64
+ }
65
+
66
+
67
+ }
68
+
69
+ ]);
70
+
71
+ RegisterWidgets("my-slider")
72
+ </script>
73
+ </body>
74
+
75
+ </html>
package/js/init.js CHANGED
@@ -43,7 +43,7 @@ CONFIG.set("serviceWorkerURI","/sw.js"); //QCObjects will register an launch thi
43
43
 
44
44
  // if Component.cached is true, all the Class('Component') declarations will save the template in a localStorage cache
45
45
  // until a cached=false attribute is found in a <component> html declaration
46
- Component.cached=false;
46
+ Component.cached=true;
47
47
 
48
48
  /**
49
49
  * Main import sentence.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qcobjectsnewapp",
3
- "version": "2.4.3",
3
+ "version": "2.4.4",
4
4
  "description": "App template for New App in QCObjects",
5
5
  "main": "js/init.js",
6
6
  "scripts": {
@@ -35,16 +35,16 @@
35
35
  "eslint": "^8.2.0",
36
36
  "eslint-config-qcobjects": "^0.0.13",
37
37
  "jasmine": "^3.6.3",
38
- "qcobjects": "^2.4.40",
38
+ "qcobjects": "^2.4.43",
39
39
  "qcobjects-cli": "^2.4.25"
40
40
  },
41
41
  "dependencies": {
42
42
  "grunt": "^1.4.1",
43
43
  "grunt-contrib-jasmine": "^4.0.0",
44
44
  "nyc": "^15.1.0",
45
- "qcobjects": "^2.4.40",
45
+ "qcobjects": "^2.4.43",
46
46
  "qcobjects-cli": "^2.4.25",
47
- "qcobjects-sdk": "^2.4.26"
47
+ "qcobjects-sdk": "^2.4.28"
48
48
  },
49
49
  "engines": {
50
50
  "npm": ">=8.10.0",