@pb33f/cowboy-components 0.7.6 → 0.7.8
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/dist/components/auth/login-button.d.ts +5 -2
- package/dist/components/auth/login-button.js +38 -11
- package/dist/components/auth/login-panel.d.ts +2 -1
- package/dist/components/auth/login-panel.js +4 -3
- package/dist/components/auth/oauth-login.d.ts +1 -1
- package/dist/components/auth/oauth-login.js +3 -3
- package/dist/components/paginator/paginator.css.js +1 -1
- package/dist/components/paginator/paginator.d.ts +2 -0
- package/dist/components/paginator/paginator.js +6 -6
- package/dist/components/problems-overview/problems-overview.js +6 -0
- package/dist/components/the-doctor/sparks.d.ts +1 -0
- package/dist/components/the-doctor/sparks.js +36 -21
- package/dist/components/the-doctor/status-bar.css.js +10 -8
- package/dist/components/the-doctor/status-bar.d.ts +2 -0
- package/dist/components/the-doctor/status-bar.js +18 -8
- package/dist/components/the-doctor/the-doctor.d.ts +1 -0
- package/dist/components/the-doctor/the-doctor.js +9 -1
- package/dist/controllers/auth-controller.d.ts +2 -1
- package/dist/controllers/auth-controller.js +49 -20
- package/dist/controllers/diagnostic-controller.js +6 -2
- package/dist/controllers/docs-controller.js +9 -32
- package/dist/cowboy-components.umd.cjs +897 -896
- package/dist/css/pb33f-theme.css +1 -0
- package/dist/events/doctor.d.ts +2 -0
- package/dist/events/doctor.js +2 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -237,11 +237,15 @@ export class DiagnosticController extends EventTarget {
|
|
|
237
237
|
if (e.instance === 'https://pb33f.io/errors/no-credit-remaining') {
|
|
238
238
|
this.doc.statusBar.callsRemaining = 0;
|
|
239
239
|
this.doc.statusBar.visible = true;
|
|
240
|
+
let text = "Run out of credit, please authenticate for more or wait 24 hours.";
|
|
241
|
+
if (this.doc.authController.authenticated) {
|
|
242
|
+
text = "Run out of credit, please purchase more, or come back tomorrow for more free credits.";
|
|
243
|
+
}
|
|
240
244
|
this.doc.sendToast({
|
|
241
245
|
id: crypto.randomUUID(),
|
|
242
246
|
type: ToastType.ERROR,
|
|
243
|
-
body:
|
|
244
|
-
title: "Credit
|
|
247
|
+
body: text,
|
|
248
|
+
title: "💰 Credit Exhausted!",
|
|
245
249
|
});
|
|
246
250
|
}
|
|
247
251
|
else {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FunctionDocumentationBag, RuleDocumentationBag } from "../components/the-doctor/the-doctor";
|
|
2
2
|
import { LintingService } from "../services/linting-service";
|
|
3
3
|
import { ProblemDrawerEventType } from "../components/problem-list/details-drawer";
|
|
4
4
|
import { ToastType } from "../model/toast";
|
|
@@ -8,6 +8,13 @@ export class DocsController extends EventTarget {
|
|
|
8
8
|
this.doc = doc;
|
|
9
9
|
}
|
|
10
10
|
fetchDocs() {
|
|
11
|
+
const db = this.doc.bagManager.getBag(RuleDocumentationBag);
|
|
12
|
+
const fb = this.doc.bagManager.getBag(FunctionDocumentationBag);
|
|
13
|
+
this.doc.ruleDocsBag = db;
|
|
14
|
+
this.doc.functionDocsBag = fb;
|
|
15
|
+
if ((fb?.export().size ?? 0 > 0) && (db?.export().size ?? 0 > 0)) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
11
18
|
this.doc.activitySpinner.show();
|
|
12
19
|
const url = new URL(window.location.href);
|
|
13
20
|
const urlParam = url.searchParams.get('url');
|
|
@@ -26,8 +33,6 @@ export class DocsController extends EventTarget {
|
|
|
26
33
|
this.doc.platformUnavailable(e);
|
|
27
34
|
console.error("documentation service is down");
|
|
28
35
|
});
|
|
29
|
-
this.doc.ruleDocsBag = this.doc.bagManager.getBag(RuleDocumentationBag);
|
|
30
|
-
this.doc.functionDocsBag = this.doc.bagManager.getBag(FunctionDocumentationBag);
|
|
31
36
|
// populate docs via worker.
|
|
32
37
|
this.doc.ruleDocsWorker.addEventListener("message", (event) => {
|
|
33
38
|
const data = event.data;
|
|
@@ -43,14 +48,6 @@ export class DocsController extends EventTarget {
|
|
|
43
48
|
this.doc.activitySpinner.hide();
|
|
44
49
|
}
|
|
45
50
|
});
|
|
46
|
-
// let ruleDocs: string[] = [];
|
|
47
|
-
// let functionDocs: string[] = [];
|
|
48
|
-
// if (this.ruleDocsBag) {
|
|
49
|
-
// ruleDocs = Array.from(this.ruleDocsBag.export().keys());
|
|
50
|
-
// }
|
|
51
|
-
// if (this.functionDocsBag) {
|
|
52
|
-
// functionDocs = Array.from(this.functionDocsBag.export().keys());
|
|
53
|
-
// }
|
|
54
51
|
const fetchDocs = () => {
|
|
55
52
|
this.doc.ruleDocsWorker.postMessage({
|
|
56
53
|
start: true,
|
|
@@ -59,27 +56,7 @@ export class DocsController extends EventTarget {
|
|
|
59
56
|
existingFunctions: []
|
|
60
57
|
});
|
|
61
58
|
};
|
|
62
|
-
|
|
63
|
-
if (this.doc.docExpirationBag) {
|
|
64
|
-
const expiration = this.doc.docExpirationBag.get(DocumentationExpirationBag);
|
|
65
|
-
// if the docs are older than 15 days, refresh them.
|
|
66
|
-
if (expiration) {
|
|
67
|
-
const now = new Date().getTime();
|
|
68
|
-
const then = new Date(expiration).getTime();
|
|
69
|
-
// if (now - then > 1296000000) {
|
|
70
|
-
// fetchDocs();
|
|
71
|
-
// } else {
|
|
72
|
-
// this.activitySpinner.hide();
|
|
73
|
-
// }
|
|
74
|
-
fetchDocs(); // always fetch for now.
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
fetchDocs();
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
fetchDocs();
|
|
82
|
-
}
|
|
59
|
+
fetchDocs();
|
|
83
60
|
}
|
|
84
61
|
ruleDocsClicked(event) {
|
|
85
62
|
const ruleId = event.detail.rule;
|