@xpert-ai/plugin-live-dashboard 0.3.1 → 0.4.0
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/.xpertai-plugin/plugin.json +10 -2
- package/README.md +6 -0
- package/assets/branding/cover-v1.prompt.txt +27 -0
- package/assets/branding/cover-v1.webp +0 -0
- package/assets/previews/customer-brief.png +0 -0
- package/assets/previews/profit-atlas.png +0 -0
- package/assets/previews/trend-workspace.png +0 -0
- package/dist/index.js +6 -3
- package/dist/lib/agent.schema.d.ts +43 -37
- package/dist/lib/agent.schema.js +2 -1
- package/dist/lib/app-config.d.ts +62 -0
- package/dist/lib/app-config.js +38 -0
- package/dist/lib/artifact-type.provider.d.ts +15 -0
- package/dist/lib/artifact-type.provider.js +78 -0
- package/dist/lib/assistant-template.d.ts +1 -2
- package/dist/lib/assistant-template.js +3 -52
- package/dist/lib/content.provider.js +13 -5
- package/dist/lib/dashboard-navigation.d.ts +58 -14
- package/dist/lib/dashboard-navigation.js +11 -10
- package/dist/lib/dashboard-view.schema.d.ts +197 -46
- package/dist/lib/dashboard-view.schema.js +8 -1
- package/dist/lib/dashboard.service.d.ts +39 -2
- package/dist/lib/dashboard.service.js +52 -28
- package/dist/lib/document-libraries.d.ts +1 -1
- package/dist/lib/document-libraries.js +3 -2
- package/dist/lib/document-network.d.ts +1 -1
- package/dist/lib/document-network.js +2 -6
- package/dist/lib/editing-feedback.d.ts +5 -0
- package/dist/lib/editing-feedback.js +19 -0
- package/dist/lib/editing-patch.d.ts +22 -0
- package/dist/lib/editing-patch.js +46 -0
- package/dist/lib/editing-session.d.ts +167 -0
- package/dist/lib/editing-session.js +53 -0
- package/dist/lib/editing.d.ts +92 -60
- package/dist/lib/editing.js +36 -24
- package/dist/lib/html-guidance.d.ts +1 -1
- package/dist/lib/html-guidance.js +1 -1
- package/dist/lib/middleware.js +42 -18
- package/dist/lib/monitor.d.ts +70 -0
- package/dist/lib/monitor.js +101 -0
- package/dist/lib/plugin.js +4 -1
- package/dist/lib/project.d.ts +106 -0
- package/dist/lib/project.js +17 -0
- package/dist/lib/projects.schema.d.ts +49 -0
- package/dist/lib/projects.schema.js +7 -0
- package/dist/lib/projects.service.d.ts +23 -0
- package/dist/lib/projects.service.js +65 -0
- package/dist/lib/resource-card.js +1 -1
- package/dist/lib/runtime-context.d.ts +3 -0
- package/dist/lib/runtime-context.js +13 -0
- package/dist/lib/save-evidence.d.ts +1 -1
- package/dist/lib/templates.d.ts +2 -0
- package/dist/lib/templates.js +55 -0
- package/dist/lib/view.provider.d.ts +97 -7
- package/dist/lib/view.provider.js +39 -10
- package/dist/libraries/TREND-WORKSPACE-ICONS-LICENSE.txt +43 -0
- package/dist/libraries/catalog.json +1 -1
- package/dist/remote/app.css +1 -1
- package/dist/remote/app.js +33 -33
- package/dist/remote/build-manifest.json +115 -32
- package/dist/sandbox-actions/action.json +1 -1
- package/dist/sandbox-actions/bundle/host.js +2 -2
- package/dist/sandbox-actions/bundle/resource-cache.mjs +2 -1
- package/dist/sandbox-actions/bundle/validate.mjs +1 -1
- package/docs/docs.json +7 -0
- package/docs/frontend-libraries.mdx +12 -4
- package/docs/html-mode.md +3 -3
- package/docs/quick-start-acceptance.mdx +50 -0
- package/docs/quick-start.mdx +64 -0
- package/docs/superstore.mdx +38 -0
- package/docs/team-sharing.mdx +6 -2
- package/docs/trend-workspace-acceptance.mdx +43 -0
- package/docs/trend-workspace.mdx +30 -0
- package/docs/verification.mdx +4 -2
- package/docs/visual-styles-acceptance.mdx +40 -0
- package/docs/visual-styles.mdx +46 -0
- package/package.json +23 -17
- package/skills/live-dashboard/SKILL.md +27 -3
- package/skills/live-dashboard/examples/README.md +25 -0
- package/skills/live-dashboard/examples/catalog.json +79 -0
- package/skills/live-dashboard/examples/production-quality/README.md +25 -0
- package/skills/live-dashboard/examples/production-quality/dashboard.html +129 -0
- package/skills/live-dashboard/examples/production-quality/definition.json +67 -0
- package/skills/live-dashboard/examples/production-quality/demo.csv +7 -0
- package/skills/live-dashboard/examples/production-quality/demo.json +44 -0
- package/skills/live-dashboard/examples/production-quality/expected.json +26 -0
- package/skills/live-dashboard/examples/production-quality/preview.png +0 -0
- package/skills/live-dashboard/examples/production-quality/query.json +53 -0
- package/skills/live-dashboard/examples/regional-sales/README.md +25 -0
- package/skills/live-dashboard/examples/regional-sales/dashboard-create.json +35 -0
- package/skills/live-dashboard/examples/regional-sales/definition.json +35 -0
- package/skills/live-dashboard/examples/regional-sales/demo.csv +5 -0
- package/skills/live-dashboard/examples/regional-sales/demo.json +18 -0
- package/skills/live-dashboard/examples/regional-sales/expected.json +19 -0
- package/skills/live-dashboard/examples/regional-sales/preview.png +0 -0
- package/skills/live-dashboard/examples/regional-sales/query.json +45 -0
- package/skills/live-dashboard/examples/sales-overview/README.md +25 -0
- package/skills/live-dashboard/examples/sales-overview/dashboard.html +129 -0
- package/skills/live-dashboard/examples/sales-overview/definition.json +57 -0
- package/skills/live-dashboard/examples/sales-overview/demo.csv +7 -0
- package/skills/live-dashboard/examples/sales-overview/demo.json +38 -0
- package/skills/live-dashboard/examples/sales-overview/expected.json +22 -0
- package/skills/live-dashboard/examples/sales-overview/preview.png +0 -0
- package/skills/live-dashboard/examples/sales-overview/query.json +52 -0
- package/skills/live-dashboard/examples/superstore/README.md +64 -0
- package/skills/live-dashboard/examples/superstore/THIRD_PARTY_LICENSE.txt +207 -0
- package/skills/live-dashboard/examples/superstore/build_data.py +155 -0
- package/skills/live-dashboard/examples/superstore/build_pages.py +129 -0
- package/skills/live-dashboard/examples/superstore/checks.json +104 -0
- package/skills/live-dashboard/examples/superstore/customers-mobile-dark.png +0 -0
- package/skills/live-dashboard/examples/superstore/customers-select.png +0 -0
- package/skills/live-dashboard/examples/superstore/customers.html +316 -0
- package/skills/live-dashboard/examples/superstore/customers.png +0 -0
- package/skills/live-dashboard/examples/superstore/customers.queries.json +512 -0
- package/skills/live-dashboard/examples/superstore/expected.json +4069 -0
- package/skills/live-dashboard/examples/superstore/import.json +200 -0
- package/skills/live-dashboard/examples/superstore/orders.csv +10195 -0
- package/skills/live-dashboard/examples/superstore/overview-mobile-dark.png +0 -0
- package/skills/live-dashboard/examples/superstore/overview-select.png +0 -0
- package/skills/live-dashboard/examples/superstore/overview.html +310 -0
- package/skills/live-dashboard/examples/superstore/overview.png +0 -0
- package/skills/live-dashboard/examples/superstore/overview.queries.json +636 -0
- package/skills/live-dashboard/examples/superstore/page.js +109 -0
- package/skills/live-dashboard/examples/superstore/profitability-mobile-dark.png +0 -0
- package/skills/live-dashboard/examples/superstore/profitability-select.png +0 -0
- package/skills/live-dashboard/examples/superstore/profitability.html +307 -0
- package/skills/live-dashboard/examples/superstore/profitability.png +0 -0
- package/skills/live-dashboard/examples/superstore/profitability.queries.json +334 -0
- package/skills/live-dashboard/examples/superstore/provenance.json +24 -0
- package/skills/live-dashboard/examples/superstore/semantic-model.json +220 -0
- package/skills/live-dashboard/examples/superstore/test_data.py +62 -0
- package/skills/live-dashboard/references/html-runtime.md +1 -1
- package/skills/live-dashboard/themes/README.md +50 -0
- package/skills/live-dashboard/themes/customer-brief/README.md +47 -0
- package/skills/live-dashboard/themes/customer-brief/charts.js +17 -0
- package/skills/live-dashboard/themes/customer-brief/layout.html +22 -0
- package/skills/live-dashboard/themes/customer-brief/theme.css +108 -0
- package/skills/live-dashboard/themes/profit-atlas/README.md +43 -0
- package/skills/live-dashboard/themes/profit-atlas/charts.js +30 -0
- package/skills/live-dashboard/themes/profit-atlas/layout.html +19 -0
- package/skills/live-dashboard/themes/profit-atlas/theme.css +75 -0
- package/skills/live-dashboard/themes/trend-workspace/ICON_LICENSE.txt +43 -0
- package/skills/live-dashboard/themes/trend-workspace/README.md +144 -0
- package/skills/live-dashboard/themes/trend-workspace/charts.js +60 -0
- package/skills/live-dashboard/themes/trend-workspace/icons.js +11 -0
- package/skills/live-dashboard/themes/trend-workspace/layout.html +45 -0
- package/skills/live-dashboard/themes/trend-workspace/select.js +127 -0
- package/skills/live-dashboard/themes/trend-workspace/theme.css +137 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DashboardProjectsService } from './projects.service';
|
|
1
2
|
import type { XpertExtensionViewManifest, XpertResolvedViewHostContext, XpertViewActionRequest, XpertViewQuery } from '@xpert-ai/contracts';
|
|
2
3
|
import { type IXpertViewExtensionProvider } from '@xpert-ai/plugin-sdk';
|
|
3
4
|
import { DashboardService } from './dashboard.service';
|
|
@@ -8,7 +9,8 @@ export declare const FEATURE = "live_dashboard";
|
|
|
8
9
|
export declare class DashboardViewProvider implements IXpertViewExtensionProvider {
|
|
9
10
|
private readonly service;
|
|
10
11
|
private readonly sharing;
|
|
11
|
-
|
|
12
|
+
private readonly projects;
|
|
13
|
+
constructor(service: DashboardService, sharing: DashboardSharingService, projects: DashboardProjectsService);
|
|
12
14
|
supports(context: XpertResolvedViewHostContext): boolean;
|
|
13
15
|
getViewManifests(context: XpertResolvedViewHostContext, slot: string): XpertExtensionViewManifest[];
|
|
14
16
|
getRemoteComponentEntry(): Promise<{
|
|
@@ -17,7 +19,34 @@ export declare class DashboardViewProvider implements IXpertViewExtensionProvide
|
|
|
17
19
|
}>;
|
|
18
20
|
getViewData(context: XpertResolvedViewHostContext, viewKey: string, query: XpertViewQuery): Promise<{
|
|
19
21
|
meta: {
|
|
20
|
-
|
|
22
|
+
notice: "not_published";
|
|
23
|
+
navigationTarget: {
|
|
24
|
+
target: "workbench.view";
|
|
25
|
+
viewKey: "live-dashboard__live-dashboard";
|
|
26
|
+
};
|
|
27
|
+
access: import("./project").DashboardAccess;
|
|
28
|
+
mode: "draft" | "published";
|
|
29
|
+
currentProject: {
|
|
30
|
+
id: string;
|
|
31
|
+
name: string;
|
|
32
|
+
} | null;
|
|
33
|
+
dashboards: {
|
|
34
|
+
title: string | null | undefined;
|
|
35
|
+
draftRevision?: number | undefined;
|
|
36
|
+
canDelete: boolean;
|
|
37
|
+
artifactId: string;
|
|
38
|
+
versionId: string | null | undefined;
|
|
39
|
+
versionNumber: number | undefined;
|
|
40
|
+
updatedAt: string | Date | undefined;
|
|
41
|
+
}[];
|
|
42
|
+
pagination: {
|
|
43
|
+
page: number;
|
|
44
|
+
pageSize: number;
|
|
45
|
+
hasMore: boolean;
|
|
46
|
+
};
|
|
47
|
+
sources: import("@xpert-ai/contracts").AnalyticsSourceSummary[];
|
|
48
|
+
} | {
|
|
49
|
+
saved: {
|
|
21
50
|
manifest: {
|
|
22
51
|
schema: "xpert.live-dashboard";
|
|
23
52
|
id: string;
|
|
@@ -52,6 +81,7 @@ export declare class DashboardViewProvider implements IXpertViewExtensionProvide
|
|
|
52
81
|
} | undefined;
|
|
53
82
|
};
|
|
54
83
|
dependencies: import("@xpert-ai/plugin-sdk/artifact-document").ArtifactDocumentDependencyAsset[];
|
|
84
|
+
contentHash: string;
|
|
55
85
|
draftId?: string | undefined;
|
|
56
86
|
draftRevision?: number | undefined;
|
|
57
87
|
baseVersionId?: string | null | undefined;
|
|
@@ -61,8 +91,8 @@ export declare class DashboardViewProvider implements IXpertViewExtensionProvide
|
|
|
61
91
|
artifactId: string;
|
|
62
92
|
versionId: string | null | undefined;
|
|
63
93
|
versionNumber: number | undefined;
|
|
64
|
-
}
|
|
65
|
-
versions
|
|
94
|
+
};
|
|
95
|
+
versions: {
|
|
66
96
|
current: boolean;
|
|
67
97
|
artifactId: string;
|
|
68
98
|
versionId: string | null | undefined;
|
|
@@ -73,11 +103,39 @@ export declare class DashboardViewProvider implements IXpertViewExtensionProvide
|
|
|
73
103
|
navigationTarget: {
|
|
74
104
|
target: "workbench.view";
|
|
75
105
|
viewKey: "live-dashboard__live-dashboard";
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
106
|
+
};
|
|
107
|
+
access: import("./project").DashboardAccess;
|
|
108
|
+
mode: "draft" | "published";
|
|
109
|
+
currentProject: {
|
|
110
|
+
id: string;
|
|
111
|
+
name: string;
|
|
112
|
+
} | null;
|
|
113
|
+
dashboards: {
|
|
114
|
+
title: string | null | undefined;
|
|
115
|
+
draftRevision?: number | undefined;
|
|
116
|
+
canDelete: boolean;
|
|
117
|
+
artifactId: string;
|
|
118
|
+
versionId: string | null | undefined;
|
|
119
|
+
versionNumber: number | undefined;
|
|
120
|
+
updatedAt: string | Date | undefined;
|
|
121
|
+
}[];
|
|
122
|
+
pagination: {
|
|
123
|
+
page: number;
|
|
124
|
+
pageSize: number;
|
|
125
|
+
hasMore: boolean;
|
|
126
|
+
};
|
|
127
|
+
sources: import("@xpert-ai/contracts").AnalyticsSourceSummary[];
|
|
128
|
+
} | {
|
|
129
|
+
navigationTarget: {
|
|
130
|
+
target: "workbench.view";
|
|
79
131
|
viewKey: "live-dashboard__live-dashboard";
|
|
80
132
|
};
|
|
133
|
+
access: import("./project").DashboardAccess;
|
|
134
|
+
mode: "draft" | "published";
|
|
135
|
+
currentProject: {
|
|
136
|
+
id: string;
|
|
137
|
+
name: string;
|
|
138
|
+
} | null;
|
|
81
139
|
dashboards: {
|
|
82
140
|
title: string | null | undefined;
|
|
83
141
|
draftRevision?: number | undefined;
|
|
@@ -87,10 +145,42 @@ export declare class DashboardViewProvider implements IXpertViewExtensionProvide
|
|
|
87
145
|
versionNumber: number | undefined;
|
|
88
146
|
updatedAt: string | Date | undefined;
|
|
89
147
|
}[];
|
|
148
|
+
pagination: {
|
|
149
|
+
page: number;
|
|
150
|
+
pageSize: number;
|
|
151
|
+
hasMore: boolean;
|
|
152
|
+
};
|
|
90
153
|
sources: import("@xpert-ai/contracts").AnalyticsSourceSummary[];
|
|
91
154
|
};
|
|
92
155
|
}>;
|
|
93
156
|
executeViewAction(context: XpertResolvedViewHostContext, viewKey: string, action: string, request: XpertViewActionRequest): Promise<{
|
|
157
|
+
success: boolean;
|
|
158
|
+
data: {
|
|
159
|
+
items: {
|
|
160
|
+
title: string | null | undefined;
|
|
161
|
+
draftRevision?: number | undefined;
|
|
162
|
+
canDelete: boolean;
|
|
163
|
+
artifactId: string;
|
|
164
|
+
versionId: string | null | undefined;
|
|
165
|
+
versionNumber: number | undefined;
|
|
166
|
+
updatedAt: string | Date | undefined;
|
|
167
|
+
}[];
|
|
168
|
+
page: number;
|
|
169
|
+
hasMore: boolean;
|
|
170
|
+
};
|
|
171
|
+
refresh: boolean;
|
|
172
|
+
} | {
|
|
173
|
+
success: boolean;
|
|
174
|
+
data: {
|
|
175
|
+
items: {
|
|
176
|
+
id: string;
|
|
177
|
+
name: string;
|
|
178
|
+
}[];
|
|
179
|
+
page: number;
|
|
180
|
+
hasMore: boolean;
|
|
181
|
+
};
|
|
182
|
+
refresh: boolean;
|
|
183
|
+
} | {
|
|
94
184
|
success: boolean;
|
|
95
185
|
data: {
|
|
96
186
|
published: {
|
|
@@ -10,6 +10,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.DashboardViewProvider = exports.FEATURE = exports.VIEW_PROVIDER = exports.VIEW_KEY = void 0;
|
|
13
|
+
const projects_service_1 = require("./projects.service");
|
|
13
14
|
const common_1 = require("@nestjs/common");
|
|
14
15
|
const v3_1 = require("zod/v3");
|
|
15
16
|
const contracts_1 = require("@xpert-ai/contracts");
|
|
@@ -20,33 +21,42 @@ const sharing_service_1 = require("./sharing.service");
|
|
|
20
21
|
const dashboard_schema_1 = require("./dashboard.schema");
|
|
21
22
|
const dashboard_receipt_1 = require("./dashboard-receipt");
|
|
22
23
|
const dashboard_navigation_1 = require("./dashboard-navigation");
|
|
24
|
+
const project_1 = require("./project");
|
|
23
25
|
const dashboard_icon_1 = require("./dashboard-icon");
|
|
24
26
|
exports.VIEW_KEY = 'live-dashboard';
|
|
25
27
|
exports.VIEW_PROVIDER = 'live-dashboard';
|
|
26
28
|
exports.FEATURE = 'live_dashboard';
|
|
27
29
|
const text = (en_US, zh_Hans) => ({ en_US, zh_Hans });
|
|
28
30
|
let DashboardViewProvider = class DashboardViewProvider {
|
|
29
|
-
constructor(service, sharing) {
|
|
31
|
+
constructor(service, sharing, projects) {
|
|
30
32
|
this.service = service;
|
|
31
33
|
this.sharing = sharing;
|
|
34
|
+
this.projects = projects;
|
|
32
35
|
}
|
|
33
|
-
supports(context) { return context.hostType === 'agent'
|
|
36
|
+
supports(context) { return context.hostType === 'agent'; }
|
|
34
37
|
getViewManifests(context, slot) {
|
|
35
|
-
if (!(context
|
|
38
|
+
if (!this.supports(context) || !['agent.workbench', 'agent.workbench.fixed', 'agent.workbench.main'].includes(slot))
|
|
36
39
|
return [];
|
|
37
40
|
return [{ key: exports.VIEW_KEY, title: text('Live dashboards', '实时看板'), hostType: context.hostType, slot, order: 35,
|
|
38
41
|
icon: dashboard_icon_1.dashboardIcon, refreshable: true, activation: { projectResource: true, requiredFeatures: [exports.FEATURE] },
|
|
39
42
|
source: { provider: exports.VIEW_PROVIDER, plugin: dashboard_service_1.PLUGIN_NAME },
|
|
40
|
-
workbench: { fixed: true, openMode: 'on-demand', menu: { enabled: true, label: text('Live dashboards', '实时看板'), icon: dashboard_icon_1.dashboardIcon, order: 35 } },
|
|
43
|
+
workbench: { projectType: project_1.DASHBOARD_PROJECT_TYPE, fixed: true, openMode: 'on-demand', menu: { enabled: true, label: text('Live dashboards', '实时看板'), icon: dashboard_icon_1.dashboardIcon, order: 35 } },
|
|
41
44
|
view: { type: 'remote_component', runtime: 'react', protocolVersion: 1, component: { isolation: 'iframe', entry: exports.VIEW_KEY }, dataSource: { mode: 'platform' } },
|
|
42
|
-
dataSource: { mode: 'platform', querySchema: { supportsSelection: true, supportsParameters: true }, cache: { enabled: false } },
|
|
45
|
+
dataSource: { mode: 'platform', querySchema: { supportsSelection: true, supportsParameters: true, supportsPagination: true, defaultPageSize: 50 }, cache: { enabled: false } },
|
|
43
46
|
clientCommands: [{ key: 'workbench.content.status' }, { key: 'workbench.content.resolve' }, { key: contracts_1.ASSISTANT_CONTEXT_SET_COMMAND, label: text('Select dashboard for Assistant', '设置助理当前看板') },
|
|
47
|
+
{ key: contracts_1.ASSISTANT_CHAT_SEND_MESSAGE_COMMAND, label: text('Create with Assistant', '交给助理制作') },
|
|
44
48
|
{ key: contracts_1.ARTIFACT_PRESENTATION_OPEN_COMMAND, label: text('Open shared page', '打开独立页面') },
|
|
45
49
|
{ key: contracts_1.WORKBENCH_NAVIGATION_OPEN_COMMAND, label: text('Open dashboard', '打开看板') }],
|
|
46
50
|
hostEvents: { subscriptions: [{ key: 'dashboard-created', event: 'assistant.tool.completed',
|
|
47
51
|
filter: { toolNames: dashboard_receipt_1.DASHBOARD_MUTATION_TOOLS }, action: { type: 'forward', debounceMs: 0 } }] },
|
|
48
52
|
actions: [
|
|
49
|
-
...[
|
|
53
|
+
...[
|
|
54
|
+
{ key: 'dashboards', label: text('Select dashboard', '选择看板') },
|
|
55
|
+
{ key: 'projects', label: text('Select project', '选择项目') },
|
|
56
|
+
{ key: 'share-status', label: text('Sharing status', '分享状态') },
|
|
57
|
+
{ key: 'share', label: text('Team sharing', '团队分享') },
|
|
58
|
+
{ key: 'revoke-share', label: text('Revoke sharing', '撤销分享') }
|
|
59
|
+
].map(({ key, label }) => ({ key, label, actionType: 'invoke', placement: 'toolbar', inputSchema: { type: 'object', properties: {}, additionalProperties: true } })),
|
|
50
60
|
{ key: 'delete', label: text('Delete dashboard', '删除看板'), actionType: 'invoke', placement: 'toolbar', inputSchema: { type: 'object', properties: {}, additionalProperties: true } },
|
|
51
61
|
{ key: 'publish', label: text('Publish draft', '发布草稿'), actionType: 'invoke', placement: 'toolbar', inputSchema: { type: 'object', properties: {}, additionalProperties: true } },
|
|
52
62
|
{ key: 'save', label: text('Save', '保存'), actionType: 'invoke', placement: 'toolbar', inputSchema: { type: 'object', properties: {}, additionalProperties: true } },
|
|
@@ -58,12 +68,31 @@ let DashboardViewProvider = class DashboardViewProvider {
|
|
|
58
68
|
async getViewData(context, viewKey, query) {
|
|
59
69
|
assertView(viewKey);
|
|
60
70
|
const params = dashboard_navigation_1.dashboardNavigationSchema.parse(query);
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
71
|
+
const access = await this.service.access(context);
|
|
72
|
+
const currentProject = await this.projects.current(context);
|
|
73
|
+
const mode = params.newDashboard ? 'draft' : params.mode ?? (access.canReadDraft ? 'draft' : 'published');
|
|
74
|
+
if (mode === 'draft' && !access.canReadDraft)
|
|
75
|
+
throw new common_1.ForbiddenException('DASHBOARD_DRAFT_ACCESS_DENIED');
|
|
76
|
+
const page = await this.service.listPage(context, params.page, params.pageSize);
|
|
77
|
+
const versions = params.artifactId ? await this.service.history(context, params.artifactId) : undefined;
|
|
78
|
+
const unavailable = params.artifactId && mode === 'published' && !params.versionId && !versions?.some(version => version.current);
|
|
79
|
+
return { meta: { navigationTarget: (0, dashboard_navigation_1.dashboardNavigationTarget)(context), access, mode, currentProject,
|
|
80
|
+
dashboards: page.items, pagination: { page: page.page, pageSize: page.pageSize, hasMore: page.hasMore },
|
|
81
|
+
sources: access.canEdit ? await this.service.sources(context) : [],
|
|
82
|
+
...(unavailable ? { notice: 'not_published' } : params.artifactId ? {
|
|
83
|
+
saved: await this.service.openDocument(context, params.artifactId, params.versionId, params.draftRevision, mode), versions
|
|
84
|
+
} : {}) } };
|
|
64
85
|
}
|
|
65
86
|
async executeViewAction(context, viewKey, action, request) {
|
|
66
87
|
assertView(viewKey);
|
|
88
|
+
if (action === 'dashboards') {
|
|
89
|
+
const parsed = projects_service_1.projectSearchSchema.safeParse(request.input);
|
|
90
|
+
if (!parsed.success)
|
|
91
|
+
throw new common_1.BadRequestException('DASHBOARD_INVALID_PICKER_QUERY');
|
|
92
|
+
return { success: true, data: await this.service.searchPage(context, parsed.data), refresh: false };
|
|
93
|
+
}
|
|
94
|
+
if (action === 'projects')
|
|
95
|
+
return { success: true, data: await this.projects.list(context, projects_service_1.projectSearchSchema.parse(request.input)), refresh: false };
|
|
67
96
|
if (action === 'share')
|
|
68
97
|
return { success: true, data: await this.sharing.share(context, sharing_service_1.shareInput.parse(request.input)), refresh: false };
|
|
69
98
|
if (action === 'share-status' || action === 'revoke-share') {
|
|
@@ -106,7 +135,7 @@ let DashboardViewProvider = class DashboardViewProvider {
|
|
|
106
135
|
exports.DashboardViewProvider = DashboardViewProvider;
|
|
107
136
|
exports.DashboardViewProvider = DashboardViewProvider = __decorate([
|
|
108
137
|
(0, plugin_sdk_1.ViewExtensionProvider)(exports.VIEW_PROVIDER),
|
|
109
|
-
__metadata("design:paramtypes", [dashboard_service_1.DashboardService, sharing_service_1.DashboardSharingService])
|
|
138
|
+
__metadata("design:paramtypes", [dashboard_service_1.DashboardService, sharing_service_1.DashboardSharingService, projects_service_1.DashboardProjectsService])
|
|
110
139
|
], DashboardViewProvider);
|
|
111
140
|
function assertView(key) { if (key !== exports.VIEW_KEY)
|
|
112
141
|
throw new common_1.BadRequestException('DASHBOARD_VIEW_UNSUPPORTED'); }
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
ISC License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Lucide Icons and Contributors
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
7
|
+
copyright notice and this permission notice appear in all copies.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
10
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
11
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
12
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
13
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
14
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
15
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
The following Lucide icons are derived from the Feather project:
|
|
20
|
+
|
|
21
|
+
airplay, alert-circle, alert-octagon, alert-triangle, aperture, arrow-down-circle, arrow-down-left, arrow-down-right, arrow-down, arrow-left-circle, arrow-left, arrow-right-circle, arrow-right, arrow-up-circle, arrow-up-left, arrow-up-right, arrow-up, at-sign, calendar, cast, check, chevron-down, chevron-left, chevron-right, chevron-up, chevrons-down, chevrons-left, chevrons-right, chevrons-up, circle, clipboard, clock, code, columns, command, compass, corner-down-left, corner-down-right, corner-left-down, corner-left-up, corner-right-down, corner-right-up, corner-up-left, corner-up-right, crosshair, database, divide-circle, divide-square, dollar-sign, download, external-link, feather, frown, hash, headphones, help-circle, info, italic, key, layout, life-buoy, link-2, link, loader, lock, log-in, log-out, maximize, meh, minimize, minimize-2, minus-circle, minus-square, minus, monitor, moon, more-horizontal, more-vertical, move, music, navigation-2, navigation, octagon, pause-circle, percent, plus-circle, plus-square, plus, power, radio, rss, search, server, share, shopping-bag, sidebar, smartphone, smile, square, table-2, tablet, target, terminal, trash-2, trash, triangle, tv, type, upload, x-circle, x-octagon, x-square, x, zoom-in, zoom-out
|
|
22
|
+
|
|
23
|
+
The MIT License (MIT) (for the icons listed above)
|
|
24
|
+
|
|
25
|
+
Copyright (c) 2013-present Cole Bemis
|
|
26
|
+
|
|
27
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
28
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
29
|
+
in the Software without restriction, including without limitation the rights
|
|
30
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
31
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
32
|
+
furnished to do so, subject to the following conditions:
|
|
33
|
+
|
|
34
|
+
The above copyright notice and this permission notice shall be included in all
|
|
35
|
+
copies or substantial portions of the Software.
|
|
36
|
+
|
|
37
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
38
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
39
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
40
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
41
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
42
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
43
|
+
SOFTWARE.
|