qcobjectsnewapp 2.5.15-ts → 2.5.16-ts
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 +1 -1
- package/package.json +5 -4
- package/public/js/init.js +2 -2
- package/public/js/init.js.map +2 -2
- package/public/js/packages/com.qcobjects.services.github.js +1 -1
- package/public/js/packages/com.qcobjects.services.github.js.map +2 -2
- package/public/js/packages/org.quickcorp.custom.controllers.js +2 -2
- package/public/js/packages/org.quickcorp.custom.controllers.js.map +2 -2
- package/public/js/packages/org.quickcorp.custom.js +2 -2
- package/public/js/packages/org.quickcorp.custom.js.map +2 -2
- package/src/js/packages/com.qcobjects.services.github.ts +10 -10
- package/src/js/packages/com.qcobjects.services.newapp.ts +1 -1
- package/src/js/packages/org.quickcorp.custom.components.ts +4 -4
- package/src/js/packages/org.quickcorp.custom.controllers.ts +16 -16
- package/src/js/packages/org.quickcorp.custom.effects.ts +1 -1
- package/src/js/packages/org.quickcorp.custom.views.ts +4 -4
- package/tsconfig.json +20 -5
|
@@ -29,7 +29,7 @@ type ItemProject = {
|
|
|
29
29
|
description:string;
|
|
30
30
|
title:string;
|
|
31
31
|
url:string;
|
|
32
|
-
image
|
|
32
|
+
image?:string;
|
|
33
33
|
};
|
|
34
34
|
type ItemsProject = Array<ItemProject>;
|
|
35
35
|
|
|
@@ -73,7 +73,7 @@ Package("com.qcobjects.services.github", [
|
|
|
73
73
|
*
|
|
74
74
|
* @type {{ "Content-Type": string; }}
|
|
75
75
|
*/
|
|
76
|
-
headers = { "Content-Type": "application/json" };
|
|
76
|
+
headers = { "Content-Type": "application/json", "charset": "utf-8" };
|
|
77
77
|
|
|
78
78
|
/**
|
|
79
79
|
* URL for the service call
|
|
@@ -98,7 +98,7 @@ Package("com.qcobjects.services.github", [
|
|
|
98
98
|
*/
|
|
99
99
|
done({ request, service }: StandardResponse) {
|
|
100
100
|
|
|
101
|
-
const result:ItemsProject = (JSON.parse(service.template) as Array<Project>)
|
|
101
|
+
const result:ItemsProject = (JSON.parse(service.template as string) as Array<Project>)
|
|
102
102
|
.reverse().map(function (project: Project) {
|
|
103
103
|
return {
|
|
104
104
|
id: project.id,
|
|
@@ -122,13 +122,13 @@ Package("com.qcobjects.services.github", [
|
|
|
122
122
|
external = true;
|
|
123
123
|
cached = false;
|
|
124
124
|
method = "GET";
|
|
125
|
-
headers = { "Content-Type": "application/json" };
|
|
125
|
+
headers = { "Content-Type": "application/json", "charset": "utf-8" };
|
|
126
126
|
url = "https://api.github.com/search/repositories?q=qcobjects";
|
|
127
127
|
withCredentials = false;
|
|
128
128
|
|
|
129
129
|
done({ request, service }: StandardResponse) {
|
|
130
|
-
logger.debug(request);
|
|
131
|
-
const result:ItemsProject = (JSON.parse(service.template) as GitHubTagServiceResponse)
|
|
130
|
+
logger.debug(String(request));
|
|
131
|
+
const result:ItemsProject = (JSON.parse(service.template as string) as GitHubTagServiceResponse)
|
|
132
132
|
.items.map(function (project: Project) {
|
|
133
133
|
return {
|
|
134
134
|
id: project.id,
|
|
@@ -152,12 +152,12 @@ Package("com.qcobjects.services.github", [
|
|
|
152
152
|
external = true;
|
|
153
153
|
cached = false;
|
|
154
154
|
method = "GET";
|
|
155
|
-
headers = { "Content-Type": "application/json" };
|
|
155
|
+
headers = { "Content-Type": "application/json", "charset": "utf-8" };
|
|
156
156
|
url = "https://api.github.com/repos/QuickCorp/QCObjects/tags";
|
|
157
157
|
withCredentials = false;
|
|
158
158
|
|
|
159
159
|
done({ service }: StandardResponse) {
|
|
160
|
-
const latest = JSON.parse(service.template)[0];
|
|
160
|
+
const latest = JSON.parse(service.template as string)[0];
|
|
161
161
|
service.template = {
|
|
162
162
|
version: latest.name
|
|
163
163
|
};
|
|
@@ -170,12 +170,12 @@ Package("com.qcobjects.services.github", [
|
|
|
170
170
|
external = true;
|
|
171
171
|
cached = false;
|
|
172
172
|
method = "GET";
|
|
173
|
-
headers = { "Content-Type": "application/json" };
|
|
173
|
+
headers = { "Content-Type": "application/json", "charset": "utf-8" };
|
|
174
174
|
url = "https://api.github.com/repos/QuickCorp/QCObjects";
|
|
175
175
|
withCredentials = false;
|
|
176
176
|
|
|
177
177
|
done({ service }: StandardResponse) {
|
|
178
|
-
const repo:Project = (JSON.parse(service.template) as Project);
|
|
178
|
+
const repo:Project = (JSON.parse(service.template as string) as Project);
|
|
179
179
|
service.template = {
|
|
180
180
|
forks: repo.forks_count,
|
|
181
181
|
stars: repo.stargazers_count,
|
|
@@ -17,7 +17,7 @@ Package("com.qcobjects.services.newapp", [
|
|
|
17
17
|
return (/<base href="\/admin\/" target="_self">/).test(template);
|
|
18
18
|
};
|
|
19
19
|
standardResponse.service.template = _DataStringify({
|
|
20
|
-
hasAdmin: hasAdmin(standardResponse.service.template)
|
|
20
|
+
hasAdmin: hasAdmin(standardResponse.service.template as unknown as string)
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { Package, Component,
|
|
3
|
+
import { Package, Component, type TComponentParams, type TComponentDoneResponse, logger } from "qcobjects";
|
|
4
4
|
|
|
5
5
|
type ComponentServiceData = Component & {
|
|
6
6
|
serviceData:any;
|
|
@@ -50,7 +50,7 @@ class AdminCheckComponent extends Component {
|
|
|
50
50
|
shadowed = true;
|
|
51
51
|
tplsource = "inline";
|
|
52
52
|
|
|
53
|
-
constructor (o:
|
|
53
|
+
constructor (o:TComponentParams){
|
|
54
54
|
o.body?.setAttribute("serviceClass", "AdminCheckService");
|
|
55
55
|
o.body?.setAttribute("response-to", "data");
|
|
56
56
|
super(o);
|
|
@@ -121,7 +121,7 @@ class AdminSidebarOption extends AdminCheckComponent {
|
|
|
121
121
|
</div>
|
|
122
122
|
`;
|
|
123
123
|
|
|
124
|
-
done (standardResponse:
|
|
124
|
+
done (standardResponse:TComponentDoneResponse):Promise<TComponentDoneResponse>{
|
|
125
125
|
const component = standardResponse.component as ComponentServiceData;
|
|
126
126
|
console.log(component.serviceData);
|
|
127
127
|
try {
|
|
@@ -168,7 +168,7 @@ class AdminButton extends AdminCheckComponent {
|
|
|
168
168
|
</div>
|
|
169
169
|
`;
|
|
170
170
|
|
|
171
|
-
done (standardResponse:
|
|
171
|
+
done (standardResponse:TComponentDoneResponse):Promise<TComponentDoneResponse>{
|
|
172
172
|
const component = standardResponse.component as ComponentServiceData;
|
|
173
173
|
console.log(component.serviceData);
|
|
174
174
|
try {
|
|
@@ -4,20 +4,20 @@
|
|
|
4
4
|
"use strict";
|
|
5
5
|
|
|
6
6
|
import { Package, Controller, logger, _DOMCreateElement, set,
|
|
7
|
-
type Effect, New, ClassFactory, type
|
|
8
|
-
type
|
|
7
|
+
type Effect, New, ClassFactory, type IQCObjectsElement,
|
|
8
|
+
type IQCObjectsShadowedElement, type Component, type TControllerParams } from "qcobjects";
|
|
9
9
|
import { Fade } from "qcobjects-sdk";
|
|
10
10
|
|
|
11
11
|
Package("org.quickcorp.custom.controllers", [
|
|
12
12
|
class MainController extends Controller {
|
|
13
13
|
static loaded: boolean;
|
|
14
|
-
constructor(controller:
|
|
14
|
+
constructor(controller:TControllerParams) {
|
|
15
15
|
logger.debug("Initializing MainController...");
|
|
16
16
|
super(controller);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
done(...args: never[]) {
|
|
20
|
-
const _ret_ = super.done(
|
|
20
|
+
const _ret_ = super.done();
|
|
21
21
|
if (!MainController.loaded) {
|
|
22
22
|
const s = _DOMCreateElement("style");
|
|
23
23
|
s.innerHTML = `
|
|
@@ -37,10 +37,10 @@ Package("org.quickcorp.custom.controllers", [
|
|
|
37
37
|
componentRoot!: any;
|
|
38
38
|
component: Component;
|
|
39
39
|
|
|
40
|
-
constructor(controller:
|
|
40
|
+
constructor(controller:TControllerParams) {
|
|
41
41
|
logger.debug("Initializing SideNavController...");
|
|
42
42
|
super(controller);
|
|
43
|
-
this.component = controller.component;
|
|
43
|
+
this.component = controller.component as unknown as Component;
|
|
44
44
|
if (this.component.shadowed) {
|
|
45
45
|
this.componentRoot = this.component.shadowRoot;
|
|
46
46
|
} else {
|
|
@@ -53,7 +53,7 @@ Package("org.quickcorp.custom.controllers", [
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
done(...args: any[]) {
|
|
56
|
-
const _ret_ = super.done(
|
|
56
|
+
const _ret_ = super.done();
|
|
57
57
|
this.bindControls();
|
|
58
58
|
this.close();
|
|
59
59
|
return _ret_;
|
|
@@ -61,7 +61,7 @@ Package("org.quickcorp.custom.controllers", [
|
|
|
61
61
|
|
|
62
62
|
bindControls() {
|
|
63
63
|
if (this.componentRoot) {
|
|
64
|
-
const navLinks = (this.componentRoot as
|
|
64
|
+
const navLinks = (this.componentRoot as IQCObjectsElement)?.subelements("a[href]");
|
|
65
65
|
navLinks?.map((link: HTMLElement) => {
|
|
66
66
|
link.addEventListener("click", () => this.close());
|
|
67
67
|
return link;
|
|
@@ -78,8 +78,8 @@ Package("org.quickcorp.custom.controllers", [
|
|
|
78
78
|
// eslint-disable-next-line no-extra-boolean-cast
|
|
79
79
|
if (!!this.componentRoot?.parentElement) {
|
|
80
80
|
if (this.componentRoot.parentElement !== null) {
|
|
81
|
-
(this.componentRoot.parentElement as
|
|
82
|
-
(this.componentRoot.parentElement as
|
|
81
|
+
(this.componentRoot.parentElement as IQCObjectsElement).subelements(".navbtn")[0].style.display = "none";
|
|
82
|
+
(this.componentRoot.parentElement as IQCObjectsElement).subelements(".closebtn")[0].style.display = "block";
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
}
|
|
@@ -95,8 +95,8 @@ Package("org.quickcorp.custom.controllers", [
|
|
|
95
95
|
this.componentRoot?.classList.remove("open");
|
|
96
96
|
// eslint-disable-next-line no-extra-boolean-cast
|
|
97
97
|
if (!!this.componentRoot?.parentElement) {
|
|
98
|
-
(this.componentRoot.parentElement as
|
|
99
|
-
(this.componentRoot.parentElement as
|
|
98
|
+
(this.componentRoot.parentElement as IQCObjectsElement).subelements(".navbtn")[0].style.display = "block";
|
|
99
|
+
(this.componentRoot.parentElement as IQCObjectsElement).subelements(".closebtn")[0].style.display = "none";
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
this.visibility = false;
|
|
@@ -116,15 +116,15 @@ Package("org.quickcorp.custom.controllers", [
|
|
|
116
116
|
installer: any;
|
|
117
117
|
component!: Component;
|
|
118
118
|
|
|
119
|
-
constructor(controller:
|
|
119
|
+
constructor(controller: TControllerParams) {
|
|
120
120
|
super(controller);
|
|
121
121
|
logger.debug("Header controller initialized");
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
loadInstallerButton() {
|
|
125
125
|
const componentRoot = this.component.shadowed
|
|
126
|
-
? (this.component.shadowRoot as
|
|
127
|
-
: (this.component.body as
|
|
126
|
+
? (this.component.shadowRoot as IQCObjectsShadowedElement)
|
|
127
|
+
: (this.component.body as IQCObjectsElement);
|
|
128
128
|
if (typeof componentRoot === "undefined" || componentRoot === null) {
|
|
129
129
|
logger.debug("HeaderController has no component root yet, skipping installer button");
|
|
130
130
|
return;
|
|
@@ -138,7 +138,7 @@ Package("org.quickcorp.custom.controllers", [
|
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
done(...args: never[]) {
|
|
141
|
-
const _ret_ = super.done(
|
|
141
|
+
const _ret_ = super.done();
|
|
142
142
|
this.loadInstallerButton();
|
|
143
143
|
return _ret_;
|
|
144
144
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { Package,
|
|
3
|
+
import { Package, type IQCObjectsElement, View } from "qcobjects";
|
|
4
4
|
|
|
5
5
|
Package("org.quickcorp.custom.views", [
|
|
6
6
|
|
|
@@ -9,9 +9,9 @@ Package("org.quickcorp.custom.views", [
|
|
|
9
9
|
const _ret_ = super.done(args);
|
|
10
10
|
const component = this.component;
|
|
11
11
|
if (component !== undefined && component.body !== undefined) {
|
|
12
|
-
(component.body as
|
|
13
|
-
(component.body as
|
|
14
|
-
(component.body as
|
|
12
|
+
(component.body as IQCObjectsElement).style.display = "block";
|
|
13
|
+
(component.body as IQCObjectsElement).style.width = "100px";
|
|
14
|
+
(component.body as IQCObjectsElement).style.height = "100px";
|
|
15
15
|
}
|
|
16
16
|
return _ret_;
|
|
17
17
|
}
|
package/tsconfig.json
CHANGED
|
@@ -18,9 +18,24 @@
|
|
|
18
18
|
"outDir": "build",
|
|
19
19
|
"baseUrl": ".",
|
|
20
20
|
"paths": {
|
|
21
|
-
"types": [
|
|
22
|
-
|
|
21
|
+
"types": [
|
|
22
|
+
"./node_modules/qcobjects/src/types/global/index.d.ts"
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
"strictPropertyInitialization": false,
|
|
26
|
+
"types": [
|
|
27
|
+
"node"
|
|
28
|
+
],
|
|
29
|
+
"typeRoots": [
|
|
30
|
+
"./node_modules/@types"
|
|
31
|
+
],
|
|
32
|
+
"skipLibCheck": true
|
|
23
33
|
},
|
|
24
|
-
"include": [
|
|
25
|
-
|
|
26
|
-
|
|
34
|
+
"include": [
|
|
35
|
+
"src/**/*.ts"
|
|
36
|
+
],
|
|
37
|
+
"exclude": [
|
|
38
|
+
"src/**/*.spec.js",
|
|
39
|
+
"src/*.js"
|
|
40
|
+
]
|
|
41
|
+
}
|