@pb33f/cowboy-components 0.7.7 → 0.7.9
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 +4 -2
- package/dist/components/auth/login-button.js +25 -7
- package/dist/components/auth/login-panel.d.ts +1 -1
- package/dist/components/auth/login-panel.js +1 -1
- package/dist/components/auth/oauth-login.d.ts +1 -1
- package/dist/components/auth/oauth-login.js +3 -3
- package/dist/components/the-doctor/status-bar.js +3 -3
- package/dist/components/the-doctor/the-doctor.css.js +16 -0
- package/dist/components/the-doctor/the-doctor.d.ts +3 -0
- package/dist/components/the-doctor/the-doctor.js +50 -3
- package/dist/components/time-vortex/tardis-control.css.js +0 -16
- package/dist/components/workspaces/workspace-destroy-dialog.d.ts +17 -0
- package/dist/components/workspaces/workspace-destroy-dialog.js +85 -0
- package/dist/components/workspaces/workspace-form.d.ts +22 -0
- package/dist/components/workspaces/workspace-form.js +194 -0
- package/dist/components/workspaces/workspace-view.css.d.ts +2 -0
- package/dist/components/workspaces/workspace-view.css.js +40 -0
- package/dist/components/workspaces/workspace-view.d.ts +30 -0
- package/dist/components/workspaces/workspace-view.js +196 -0
- package/dist/controllers/auth-controller.d.ts +1 -0
- package/dist/controllers/auth-controller.js +26 -8
- package/dist/controllers/diagnostic-controller.d.ts +1 -0
- package/dist/controllers/diagnostic-controller.js +15 -10
- package/dist/controllers/docs-controller.js +9 -33
- package/dist/controllers/workspace-controller.d.ts +15 -0
- package/dist/controllers/workspace-controller.js +156 -0
- package/dist/cowboy-components.umd.cjs +1559 -1095
- package/dist/css/badges.css.d.ts +2 -0
- package/dist/css/badges.css.js +12 -0
- package/dist/css/button.css.js +1 -1
- package/dist/css/forms.css.js +127 -1
- package/dist/css/lists.css.js +8 -0
- package/dist/css/pb33f-theme.css +1 -0
- package/dist/css/spinner.css.js +29 -0
- package/dist/events/doctor.d.ts +15 -0
- package/dist/events/doctor.js +10 -0
- package/dist/model/form-types.d.ts +32 -0
- package/dist/model/form-types.js +19 -0
- package/dist/model/formable.d.ts +51 -0
- package/dist/model/formable.js +542 -0
- package/dist/model/workspace.d.ts +6 -0
- package/dist/model/workspace.js +1 -0
- package/dist/monacoeditorwork/yaml.worker..bundle.js +14801 -14800
- package/dist/services/workspace-service.d.ts +10 -0
- package/dist/services/workspace-service.js +132 -0
- package/dist/style.css +1 -1
- package/package.json +7 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
import { SlDialog } from "@shoelace-style/shoelace";
|
|
3
|
-
import { OAuthLogin } from "./oauth-login";
|
|
3
|
+
import { OAuthLogin } from "./oauth-login.js";
|
|
4
4
|
export declare class LoginButton extends LitElement {
|
|
5
5
|
static styles: import("lit").CSSResult[];
|
|
6
6
|
authDialog: SlDialog;
|
|
@@ -8,11 +8,13 @@ export declare class LoginButton extends LitElement {
|
|
|
8
8
|
buttonLabel: string;
|
|
9
9
|
redirectUrl: string;
|
|
10
10
|
textLink: boolean;
|
|
11
|
+
stateCheck: boolean;
|
|
11
12
|
oauthLogin: OAuthLogin;
|
|
12
13
|
private controller;
|
|
13
14
|
constructor();
|
|
15
|
+
protected firstUpdated(): void;
|
|
14
16
|
updated(): void;
|
|
15
|
-
render(): import("lit-html").TemplateResult<1
|
|
17
|
+
render(): import("lit-html").TemplateResult<1> | null;
|
|
16
18
|
anonView(): import("lit-html").TemplateResult<1>;
|
|
17
19
|
hide(): void;
|
|
18
20
|
authenticatedView(): import("lit-html").TemplateResult<1>;
|
|
@@ -6,13 +6,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
import { html, LitElement } from "lit";
|
|
8
8
|
import { customElement, property, query } from "lit/decorators.js";
|
|
9
|
-
import { AuthController } from "../../controllers/auth-controller";
|
|
10
|
-
import buttonCss from "../../css/button.css";
|
|
11
|
-
import modalCss from "../../css/modal.css";
|
|
12
|
-
import loginButtonCss from "./login-button.css";
|
|
13
|
-
import tooltipCss from "../../css/tooltip.css";
|
|
14
|
-
import { LogoutRequested } from "../../events/doctor";
|
|
15
|
-
import linksCss from "../../css/links.css";
|
|
9
|
+
import { AuthController } from "../../controllers/auth-controller.js";
|
|
10
|
+
import buttonCss from "../../css/button.css.js";
|
|
11
|
+
import modalCss from "../../css/modal.css.js";
|
|
12
|
+
import loginButtonCss from "./login-button.css.js";
|
|
13
|
+
import tooltipCss from "../../css/tooltip.css.js";
|
|
14
|
+
import { LogoutRequested } from "../../events/doctor.js";
|
|
15
|
+
import linksCss from "../../css/links.css.js";
|
|
16
16
|
let LoginButton = class LoginButton extends LitElement {
|
|
17
17
|
constructor() {
|
|
18
18
|
super();
|
|
@@ -21,6 +21,18 @@ let LoginButton = class LoginButton extends LitElement {
|
|
|
21
21
|
this.buttonLabel = 'Authenticate';
|
|
22
22
|
this.redirectUrl = '';
|
|
23
23
|
this.textLink = false;
|
|
24
|
+
this.stateCheck = false;
|
|
25
|
+
}
|
|
26
|
+
firstUpdated() {
|
|
27
|
+
if (this.stateCheck) {
|
|
28
|
+
this.controller.checkState().then(() => {
|
|
29
|
+
this.stateCheck = false;
|
|
30
|
+
this.requestUpdate();
|
|
31
|
+
}).finally(() => {
|
|
32
|
+
this.stateCheck = false;
|
|
33
|
+
this.requestUpdate();
|
|
34
|
+
});
|
|
35
|
+
}
|
|
24
36
|
}
|
|
25
37
|
updated() {
|
|
26
38
|
if (this.oauthLogin) {
|
|
@@ -28,6 +40,9 @@ let LoginButton = class LoginButton extends LitElement {
|
|
|
28
40
|
}
|
|
29
41
|
}
|
|
30
42
|
render() {
|
|
43
|
+
if (this.stateCheck) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
31
46
|
let out = this.anonView();
|
|
32
47
|
if (this.controller.authenticated) {
|
|
33
48
|
out = this.authenticatedView();
|
|
@@ -106,6 +121,9 @@ __decorate([
|
|
|
106
121
|
__decorate([
|
|
107
122
|
property({ type: Boolean })
|
|
108
123
|
], LoginButton.prototype, "textLink", void 0);
|
|
124
|
+
__decorate([
|
|
125
|
+
property({ type: Boolean })
|
|
126
|
+
], LoginButton.prototype, "stateCheck", void 0);
|
|
109
127
|
__decorate([
|
|
110
128
|
query('pb33f-oauth-login')
|
|
111
129
|
], LoginButton.prototype, "oauthLogin", void 0);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
|
-
import { AuthController } from "../../controllers/auth-controller";
|
|
2
|
+
import { AuthController } from "../../controllers/auth-controller.js";
|
|
3
3
|
export declare class LoginPanel extends LitElement {
|
|
4
4
|
static styles: import("lit").CSSResult[];
|
|
5
5
|
title: string;
|
|
@@ -6,7 +6,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
import { html, LitElement } from "lit";
|
|
8
8
|
import { customElement, property } from "lit/decorators.js";
|
|
9
|
-
import loginButtonCss from "./login-button.css";
|
|
9
|
+
import loginButtonCss from "./login-button.css.js";
|
|
10
10
|
let LoginPanel = class LoginPanel extends LitElement {
|
|
11
11
|
constructor() {
|
|
12
12
|
super();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
import '../electric-box/electric-box.js';
|
|
3
3
|
import { SlAnimation, SlButton } from "@shoelace-style/shoelace";
|
|
4
|
-
import { ElectricBox } from "../electric-box/electric-box";
|
|
4
|
+
import { ElectricBox } from "../electric-box/electric-box.js";
|
|
5
5
|
export declare class OAuthLogin extends LitElement {
|
|
6
6
|
static styles: import("lit").CSSResult[];
|
|
7
7
|
title: string;
|
|
@@ -6,10 +6,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
import { html, LitElement } from "lit";
|
|
8
8
|
import { customElement, property, query, state } from "lit/decorators.js";
|
|
9
|
-
import oauthLoginCss from "./oauth-login.css";
|
|
10
|
-
import buttonCss from "../../css/button.css";
|
|
9
|
+
import oauthLoginCss from "./oauth-login.css.js";
|
|
10
|
+
import buttonCss from "../../css/button.css.js";
|
|
11
11
|
import '../electric-box/electric-box.js';
|
|
12
|
-
import { AuthenticationGithubRequested } from "../../events/doctor";
|
|
12
|
+
import { AuthenticationGithubRequested } from "../../events/doctor.js";
|
|
13
13
|
let OAuthLogin = class OAuthLogin extends LitElement {
|
|
14
14
|
constructor() {
|
|
15
15
|
super();
|
|
@@ -9,8 +9,8 @@ import { html, LitElement } from "lit";
|
|
|
9
9
|
import buttonCss from "../../css/button.css.js";
|
|
10
10
|
import statusBarCss from "./status-bar.css.js";
|
|
11
11
|
import linksCss from "../../css/links.css.js";
|
|
12
|
-
import dialogCss from "../../css/dialog.css";
|
|
13
|
-
import { OpenAuthentication } from "../../events/doctor";
|
|
12
|
+
import dialogCss from "../../css/dialog.css.js";
|
|
13
|
+
import { OpenAuthentication } from "../../events/doctor.js";
|
|
14
14
|
let StatusBar = class StatusBar extends LitElement {
|
|
15
15
|
constructor() {
|
|
16
16
|
super();
|
|
@@ -50,7 +50,7 @@ let StatusBar = class StatusBar extends LitElement {
|
|
|
50
50
|
return html `
|
|
51
51
|
<div class="status-bar ${clazz}">
|
|
52
52
|
<sl-dialog label="Purchase Credit" class="dialog-overview">
|
|
53
|
-
<p>Still working on this, coming soon!
|
|
53
|
+
<p>Still working on this, coming soon! Come back tomorrow for more free credit.
|
|
54
54
|
</p>
|
|
55
55
|
<sl-button slot="footer" variant="primary" @click="${this.closeDialog}">Close</sl-button>
|
|
56
56
|
</sl-dialog>
|
|
@@ -48,6 +48,22 @@ export default css `
|
|
|
48
48
|
box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
|
|
49
49
|
background: var(--secondary-color-lowalpha);
|
|
50
50
|
padding: var(--global-padding);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.workspace-icon {
|
|
54
|
+
font-size: 1.25rem;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.workspace-icon::part(base) {
|
|
58
|
+
padding: 0;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.workspace-icon.active {
|
|
62
|
+
color: var(--primary-color);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.tab.hidden {
|
|
66
|
+
display: none;
|
|
51
67
|
}
|
|
52
68
|
|
|
53
69
|
|
|
@@ -54,6 +54,7 @@ import { DocsController } from '../../controllers/docs-controller.js';
|
|
|
54
54
|
import { ModelController } from '../../controllers/model-controller.js';
|
|
55
55
|
import { DiagnosticController } from '../../controllers/diagnostic-controller.js';
|
|
56
56
|
import { StateController } from '../../controllers/state-controller.js';
|
|
57
|
+
import { WorkspaceController } from "../../controllers/workspace-controller";
|
|
57
58
|
export declare const GraphBag = "pb33f-doctor-graph";
|
|
58
59
|
export declare const PanelStateBag = "pb33f-doctor-panel-state";
|
|
59
60
|
export declare const RolodexResponseBag = "pb33f-doctor-rolodex-response";
|
|
@@ -178,6 +179,7 @@ export declare class TheDoctor extends LitElement {
|
|
|
178
179
|
readonly modelController: ModelController;
|
|
179
180
|
readonly diagnosticController: DiagnosticController;
|
|
180
181
|
readonly stateController: StateController;
|
|
182
|
+
readonly workspaceController: WorkspaceController;
|
|
181
183
|
editorMap: Map<string, SpecEditor>;
|
|
182
184
|
selectedEditorTab: string;
|
|
183
185
|
sidebarClosed: boolean;
|
|
@@ -226,6 +228,7 @@ export declare class TheDoctor extends LitElement {
|
|
|
226
228
|
platformUnavailable(error: PlatformError | null): void;
|
|
227
229
|
builtInRulesetSelected(): void;
|
|
228
230
|
runDiagnostics(): void;
|
|
231
|
+
reboot(): void;
|
|
229
232
|
boostrap(): void;
|
|
230
233
|
confirmExport(): void;
|
|
231
234
|
closeWelcome(): void;
|
|
@@ -16,7 +16,7 @@ import '@shoelace-style/shoelace/dist/components/avatar/avatar.js';
|
|
|
16
16
|
import { customElement, property, query, state } from "lit/decorators.js";
|
|
17
17
|
import { html, LitElement } from "lit";
|
|
18
18
|
import { SpecEditor } from "../editor/editor.js";
|
|
19
|
-
import { ActiveView, AddToast, ArchiveURLRequested, BuiltInRulesetChanged, CreditEmpty, CustomRulesetEnabled, DocumentReferenceClicked, EditorClicked, EditorUpdated, ExplorerEqualizerChanged, ExplorerEqualizerFiltered, ExplorerNodeClicked, ExportRuleset, LoadRenderedNodeIntoInspector, ModelTreeNodeClicked, NodeReferenceClicked, NukeWorkspaceEvent, OpenProblemDrawer, OpenSettings, ProblemClicked, RolodexRootFileSelected, RolodexTreeNodeClicked, RuleClicked, RulesetSaved, RuleViolationClicked, StartSessionFailed, } from "../../events/doctor.js";
|
|
19
|
+
import { ActiveView, AddToast, ArchiveURLRequested, BuiltInRulesetChanged, CreditEmpty, CustomRulesetEnabled, DocumentReferenceClicked, EditorClicked, EditorUpdated, ExplorerEqualizerChanged, ExplorerEqualizerFiltered, ExplorerNodeClicked, ExportRuleset, LoadRenderedNodeIntoInspector, ModelTreeNodeClicked, NodeReferenceClicked, NukeWorkspaceEvent, OpenProblemDrawer, OpenSettings, ProblemClicked, Reboot, RolodexRootFileSelected, RolodexTreeNodeClicked, RuleClicked, RulesetSaved, RuleViolationClicked, StartSessionFailed, } from "../../events/doctor.js";
|
|
20
20
|
import { ProblemDetailsDrawer } from "../problem-list/details-drawer.js";
|
|
21
21
|
import { CreateBagManager } from "@pb33f/saddlebag";
|
|
22
22
|
import { LintingService } from "../../services/linting-service.js";
|
|
@@ -66,6 +66,8 @@ import { DocsController } from '../../controllers/docs-controller.js';
|
|
|
66
66
|
import { ModelController } from '../../controllers/model-controller.js';
|
|
67
67
|
import { DiagnosticController } from '../../controllers/diagnostic-controller.js';
|
|
68
68
|
import { StateController } from '../../controllers/state-controller.js';
|
|
69
|
+
import { WorkspaceController } from "../../controllers/workspace-controller";
|
|
70
|
+
import { WorkspaceService } from 'src/services/workspace-service.js';
|
|
69
71
|
export const GraphBag = "pb33f-doctor-graph";
|
|
70
72
|
export const PanelStateBag = "pb33f-doctor-panel-state";
|
|
71
73
|
export const RolodexResponseBag = "pb33f-doctor-rolodex-response";
|
|
@@ -113,6 +115,7 @@ let TheDoctor = class TheDoctor extends LitElement {
|
|
|
113
115
|
ModelService.doctorEndpoint = this.doctorEndpoint;
|
|
114
116
|
AuthService.doctorEndpoint = this.doctorEndpoint;
|
|
115
117
|
TimelineService.doctorEndpoint = this.doctorEndpoint;
|
|
118
|
+
WorkspaceService.doctorEndpoint = this.doctorEndpoint;
|
|
116
119
|
this.timeVortex = new TimeVortex();
|
|
117
120
|
// bus it up
|
|
118
121
|
this.bus = CreateBus();
|
|
@@ -156,6 +159,7 @@ let TheDoctor = class TheDoctor extends LitElement {
|
|
|
156
159
|
this.problemController = new ProblemController(this);
|
|
157
160
|
this.docsController = new DocsController(this);
|
|
158
161
|
this.diagnosticController = new DiagnosticController(this);
|
|
162
|
+
this.workspaceController = new WorkspaceController(this);
|
|
159
163
|
this.settingsComponent = new DoctorSettings();
|
|
160
164
|
this.editorMap = new Map();
|
|
161
165
|
this.editorMap.set("spec", this.editor);
|
|
@@ -197,9 +201,14 @@ let TheDoctor = class TheDoctor extends LitElement {
|
|
|
197
201
|
}
|
|
198
202
|
this.creditTicker.visible = true;
|
|
199
203
|
this.brokerController.connectToBroker();
|
|
204
|
+
// if the session is authenticated, then fetch a list of workspaces for the user.
|
|
205
|
+
if (this.authController.authenticated) {
|
|
206
|
+
this.workspaceController.getWorkspaces();
|
|
207
|
+
}
|
|
200
208
|
};
|
|
201
209
|
// create auth controller
|
|
202
210
|
this.authController = new AuthController(this, sessionCallback, true);
|
|
211
|
+
this.authController.start();
|
|
203
212
|
// listen for auth state changes.
|
|
204
213
|
//@ts-ignore
|
|
205
214
|
this.addEventListener(EditorUpdated, this.specController.specChanged.bind(this.specController));
|
|
@@ -252,6 +261,7 @@ let TheDoctor = class TheDoctor extends LitElement {
|
|
|
252
261
|
this.authController.addEventListener(CreditEmpty, this.creditEmpty.bind(this));
|
|
253
262
|
//@ts-ignore
|
|
254
263
|
this.addEventListener(LoadRenderedNodeIntoInspector, this.loadRenderedNodeIntoInspector.bind(this));
|
|
264
|
+
this.addEventListener(Reboot, this.reboot.bind(this));
|
|
255
265
|
// hijack navigation buttons.
|
|
256
266
|
window.addEventListener('popstate', (e) => {
|
|
257
267
|
const state = e.state;
|
|
@@ -431,6 +441,21 @@ let TheDoctor = class TheDoctor extends LitElement {
|
|
|
431
441
|
this.diagnosticController.lintSpec(this.editor.getValue());
|
|
432
442
|
}
|
|
433
443
|
}
|
|
444
|
+
reboot() {
|
|
445
|
+
// for when we need to switch workspaces, and everything needs an update.
|
|
446
|
+
ModelService.getCurrentSpec().then((result) => {
|
|
447
|
+
this.rolodexController.queryRolodex();
|
|
448
|
+
this.timeVortex.checkHistory();
|
|
449
|
+
this.editor.setValue(result, true);
|
|
450
|
+
this.rolodexActivePath = "";
|
|
451
|
+
this.specController.specChanged(new CustomEvent(EditorUpdated, {
|
|
452
|
+
detail: {
|
|
453
|
+
content: result,
|
|
454
|
+
id: "spec"
|
|
455
|
+
}
|
|
456
|
+
}));
|
|
457
|
+
});
|
|
458
|
+
}
|
|
434
459
|
boostrap() {
|
|
435
460
|
// if the url is set in the query string, fetch it and run a lint with the URL
|
|
436
461
|
const url = new URL(window.location.href);
|
|
@@ -571,12 +596,14 @@ let TheDoctor = class TheDoctor extends LitElement {
|
|
|
571
596
|
title: "Safari Warning"
|
|
572
597
|
});
|
|
573
598
|
}
|
|
599
|
+
this.workspaceController.workspaceView.active = false;
|
|
574
600
|
}
|
|
575
601
|
hideMinimapIcon() {
|
|
576
602
|
this.minimapIconVisible = false;
|
|
577
603
|
}
|
|
578
604
|
hideDiagnosisButton() {
|
|
579
605
|
this.showDiagnosisButton = false;
|
|
606
|
+
this.workspaceController.workspaceView.active = false;
|
|
580
607
|
}
|
|
581
608
|
enableDiagnosisButton() {
|
|
582
609
|
if (!this.autoDiagnose) {
|
|
@@ -778,8 +805,20 @@ let TheDoctor = class TheDoctor extends LitElement {
|
|
|
778
805
|
<sl-tab-group class="tab-group" @sl-tab-show="${this.selectEditorTab}"
|
|
779
806
|
id="editor-controls">
|
|
780
807
|
|
|
781
|
-
<sl-tab slot="nav" panel="
|
|
808
|
+
<sl-tab slot="nav" panel="workspaces" class="tab ${!this.authController.authenticated ? 'hidden' : ''}" id="workspaces"
|
|
809
|
+
@click="${() => {
|
|
810
|
+
this.selectedEditorTab = 'workspaces';
|
|
811
|
+
this.toggleExplorer();
|
|
812
|
+
this.hideDiagnosisButton();
|
|
813
|
+
this.workspaceController.workspaceView.active = true;
|
|
814
|
+
}}">
|
|
815
|
+
<sl-icon-button name="person-workspace"
|
|
816
|
+
class="workspace-icon ${this.selectedEditorTab === 'workspaces' ? 'active' : ''}"></sl-icon-button>
|
|
817
|
+
</sl-tab>
|
|
818
|
+
|
|
819
|
+
<sl-tab slot="nav" panel="spec" class="tab" id="spec" active
|
|
782
820
|
@click="${() => {
|
|
821
|
+
this.selectedEditorTab = 'spec';
|
|
783
822
|
this.closeExplorer();
|
|
784
823
|
this.enableDiagnosisButton();
|
|
785
824
|
}}">
|
|
@@ -787,6 +826,7 @@ let TheDoctor = class TheDoctor extends LitElement {
|
|
|
787
826
|
</sl-tab>
|
|
788
827
|
<sl-tab slot="nav" panel="explorer" class="tab" id="explorer"
|
|
789
828
|
@click="${() => {
|
|
829
|
+
this.selectedEditorTab = 'explorer';
|
|
790
830
|
this.toggleExplorer();
|
|
791
831
|
this.hideDiagnosisButton();
|
|
792
832
|
}}">Explorer
|
|
@@ -860,9 +900,16 @@ let TheDoctor = class TheDoctor extends LitElement {
|
|
|
860
900
|
</sl-tab-panel>
|
|
861
901
|
|
|
862
902
|
<sl-tab-panel name="docs" class="tab-panel" style="height: calc(100vh - 100px)">
|
|
863
|
-
|
|
903
|
+
|
|
864
904
|
</sl-tab-panel>
|
|
865
905
|
|
|
906
|
+
${this.authController.authenticated ? html `
|
|
907
|
+
|
|
908
|
+
<sl-tab-panel name="workspaces" class="tab-panel">
|
|
909
|
+
${this.workspaceController.workspaceView}
|
|
910
|
+
</sl-tab-panel>
|
|
911
|
+
` : ''}
|
|
912
|
+
|
|
866
913
|
</sl-tab-group>
|
|
867
914
|
</div>
|
|
868
915
|
${mainPanelView}
|
|
@@ -98,23 +98,7 @@ export default css `
|
|
|
98
98
|
text-align: center;
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
.spinner-icon {
|
|
102
|
-
display: block;
|
|
103
|
-
margin: 20px auto 0 auto;
|
|
104
|
-
width: 200px;
|
|
105
|
-
color: var(--primary-color);
|
|
106
|
-
font-size: 6rem;
|
|
107
|
-
animation: spin 2s linear infinite;
|
|
108
|
-
}
|
|
109
101
|
|
|
110
|
-
@keyframes spin {
|
|
111
|
-
0% {
|
|
112
|
-
transform: rotate(0deg);
|
|
113
|
-
}
|
|
114
|
-
100% {
|
|
115
|
-
transform: rotate(360deg);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
102
|
|
|
119
103
|
.tardis-split-panel {
|
|
120
104
|
--min: 300px;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
import { Workspace } from "../../model/workspace.js";
|
|
3
|
+
import { SlDialog } from "@shoelace-style/shoelace";
|
|
4
|
+
import { PlatformError } from "../../model/errors.js";
|
|
5
|
+
export declare class WorkspaceDestroyView extends LitElement {
|
|
6
|
+
static styles: import("lit").CSSResult[];
|
|
7
|
+
destroyWorkspaceDialog: SlDialog;
|
|
8
|
+
workspace: Workspace | undefined;
|
|
9
|
+
error: PlatformError | undefined;
|
|
10
|
+
show(): void;
|
|
11
|
+
hide(): Promise<void>;
|
|
12
|
+
setError(error: PlatformError): void;
|
|
13
|
+
clearError(): void;
|
|
14
|
+
private handleCancel;
|
|
15
|
+
private handleDestroy;
|
|
16
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { html, LitElement } from "lit";
|
|
8
|
+
import { customElement, property, state, query } from "lit/decorators.js";
|
|
9
|
+
import { AttentionType } from "../attention-box/attention-box.js";
|
|
10
|
+
import dialogCss from "../../css/dialog.css.js";
|
|
11
|
+
import buttonsCss from "../../css/button.css.js";
|
|
12
|
+
import hrCss from "../../css/hr.css.js";
|
|
13
|
+
let WorkspaceDestroyView = class WorkspaceDestroyView extends LitElement {
|
|
14
|
+
show() {
|
|
15
|
+
this.destroyWorkspaceDialog.show();
|
|
16
|
+
}
|
|
17
|
+
hide() {
|
|
18
|
+
this.error = undefined;
|
|
19
|
+
return this.destroyWorkspaceDialog.hide();
|
|
20
|
+
}
|
|
21
|
+
setError(error) {
|
|
22
|
+
this.error = error;
|
|
23
|
+
}
|
|
24
|
+
clearError() {
|
|
25
|
+
this.error = undefined;
|
|
26
|
+
}
|
|
27
|
+
handleCancel() {
|
|
28
|
+
this.dispatchEvent(new CustomEvent('cancel', {
|
|
29
|
+
bubbles: true,
|
|
30
|
+
composed: true
|
|
31
|
+
}));
|
|
32
|
+
}
|
|
33
|
+
handleDestroy() {
|
|
34
|
+
this.dispatchEvent(new CustomEvent('destroy', {
|
|
35
|
+
bubbles: true,
|
|
36
|
+
composed: true,
|
|
37
|
+
detail: this.workspace
|
|
38
|
+
}));
|
|
39
|
+
}
|
|
40
|
+
render() {
|
|
41
|
+
let attentionBox = html `
|
|
42
|
+
<pb33f-attention-box type="${AttentionType.Warning}" headerText="This is a permanent, destructive process">
|
|
43
|
+
All files, records, history and scores for this workspace will be wiped out permanently. There is no
|
|
44
|
+
undo process, if you hit OK - the workspace will be nuked and permanently destroyed.
|
|
45
|
+
</pb33f-attention-box>`;
|
|
46
|
+
if (this.error) {
|
|
47
|
+
attentionBox = html `
|
|
48
|
+
<pb33f-attention-box type="${AttentionType.Error}"
|
|
49
|
+
headerText="Workspace could not be deleted">
|
|
50
|
+
Something went wrong: <strong>${this.error.detail}</strong>
|
|
51
|
+
</pb33f-attention-box>`;
|
|
52
|
+
}
|
|
53
|
+
return html `
|
|
54
|
+
<sl-dialog id="destroy-workspace" label="Delete workspace, are you sure?">
|
|
55
|
+
You're about to destroy the workspace '<strong>${this.workspace?.name}</strong>'
|
|
56
|
+
<hr/>
|
|
57
|
+
|
|
58
|
+
${attentionBox}
|
|
59
|
+
|
|
60
|
+
<sl-button @click="${this.handleCancel}" class="cancel-button">
|
|
61
|
+
Cancel
|
|
62
|
+
</sl-button>
|
|
63
|
+
|
|
64
|
+
<sl-button @click="${this.handleDestroy}" style="float: right" class="danger">
|
|
65
|
+
Do it, destroy it.
|
|
66
|
+
</sl-button>
|
|
67
|
+
|
|
68
|
+
</sl-dialog>
|
|
69
|
+
`;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
WorkspaceDestroyView.styles = [dialogCss, buttonsCss, hrCss];
|
|
73
|
+
__decorate([
|
|
74
|
+
query('sl-dialog#destroy-workspace')
|
|
75
|
+
], WorkspaceDestroyView.prototype, "destroyWorkspaceDialog", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
property()
|
|
78
|
+
], WorkspaceDestroyView.prototype, "workspace", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
state()
|
|
81
|
+
], WorkspaceDestroyView.prototype, "error", void 0);
|
|
82
|
+
WorkspaceDestroyView = __decorate([
|
|
83
|
+
customElement("pb33f-workspace-destroy-dialog")
|
|
84
|
+
], WorkspaceDestroyView);
|
|
85
|
+
export { WorkspaceDestroyView };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SlDialog } from "@shoelace-style/shoelace";
|
|
2
|
+
import { Formable } from "../../model/formable.js";
|
|
3
|
+
import { Workspace } from "../../model/workspace.js";
|
|
4
|
+
import { PlatformError } from "../../model/errors.js";
|
|
5
|
+
export declare class WorkspaceForm extends Formable {
|
|
6
|
+
static styles: import("lit").CSSResult[];
|
|
7
|
+
workspaceDialog: SlDialog;
|
|
8
|
+
active: boolean;
|
|
9
|
+
open: boolean;
|
|
10
|
+
workspaceModel: Workspace;
|
|
11
|
+
isEditMode: boolean;
|
|
12
|
+
constructor();
|
|
13
|
+
private handleFormDirty;
|
|
14
|
+
setEditMode(workspace: Workspace): void;
|
|
15
|
+
setCreateMode(): void;
|
|
16
|
+
close(): void;
|
|
17
|
+
completed(ws: Workspace): void;
|
|
18
|
+
private handleSubmit;
|
|
19
|
+
handleError(err: PlatformError): void;
|
|
20
|
+
handleSuccess(workspace: Workspace): void;
|
|
21
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
22
|
+
}
|