Merge remote-tracking branch 'origin/dev' into api-v1.10.0

This commit is contained in:
Taha Yassine Kraiem 2023-02-24 18:13:11 +01:00
commit 0713179946
5 changed files with 37 additions and 29 deletions

View file

@ -6,7 +6,7 @@ on:
- dev
paths:
- "ee/utilities/**"
- "utilities/*/**"
- "utilities/**"
- "!utilities/.gitignore"
- "!utilities/*-dev.sh"

View file

@ -5,7 +5,7 @@ on:
branches:
- dev
paths:
- "utilities/*/**"
- "utilities/**"
- "!utilities/.gitignore"
- "!utilities/*-dev.sh"

View file

@ -1,11 +1,11 @@
{
"name": "utilities-server",
"name": "assist-server",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "utilities-server",
"name": "assist-server",
"version": "1.0.0",
"license": "Elastic License 2.0 (ELv2)",
"dependencies": {
@ -117,9 +117,9 @@
}
},
"node_modules/@types/node": {
"version": "18.13.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.13.0.tgz",
"integrity": "sha512-gC3TazRzGoOnoKAhUx+Q0t8S9Tzs74z7m0ipwGpSqQrleP14hKxP4/JUeEQcD3W1/aIpnWl8pHowI7WokuZpXg=="
"version": "18.14.1",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.14.1.tgz",
"integrity": "sha512-QH+37Qds3E0eDlReeboBxfHbX9omAcBCXEzswCu6jySP642jiM3cYSIkU/REqwhCUqXdonHFuBfJDiAJxMNhaQ=="
},
"node_modules/accepts": {
"version": "1.3.8",
@ -355,9 +355,9 @@
}
},
"node_modules/engine.io": {
"version": "6.4.0",
"resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.4.0.tgz",
"integrity": "sha512-OgxY1c/RuCSeO/rTr8DIFXx76IzUUft86R7/P7MMbbkuzeqJoTNw2lmeD91IyGz41QYleIIjWeMJGgug043sfQ==",
"version": "6.4.1",
"resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.4.1.tgz",
"integrity": "sha512-JFYQurD/nbsA5BSPmbaOSLa3tSVj8L6o4srSwXXY3NqE+gGUNmmPTbhn8tjzcCtSqhFgIeqef81ngny8JM25hw==",
"dependencies": {
"@types/cookie": "^0.4.1",
"@types/cors": "^2.8.12",
@ -1002,14 +1002,14 @@
}
},
"node_modules/socket.io": {
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.6.0.tgz",
"integrity": "sha512-b65bp6INPk/BMMrIgVvX12x3Q+NqlGqSlTuvKQWt0BUJ3Hyy3JangBl7fEoWZTXbOKlCqNPbQ6MbWgok/km28w==",
"version": "4.6.1",
"resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.6.1.tgz",
"integrity": "sha512-KMcaAi4l/8+xEjkRICl6ak8ySoxsYG+gG6/XfRCPJPQ/haCRIJBTL4wIl8YCsmtaBovcAXGLOShyVWQ/FG8GZA==",
"dependencies": {
"accepts": "~1.3.4",
"base64id": "~2.0.0",
"debug": "~4.3.2",
"engine.io": "~6.4.0",
"engine.io": "~6.4.1",
"socket.io-adapter": "~2.5.2",
"socket.io-parser": "~4.2.1"
},

View file

@ -189,19 +189,19 @@ export default class DashboardStore {
return new Promise((resolve, reject) => {
dashboardService
.saveDashboard(dashboard)
.then((_dashboard) => {
.then((_dashboard: any) => {
runInAction(() => {
if (isCreating) {
toast.success('Dashboard created successfully');
this.addDashboard(new Dashboard().fromJson(_dashboard));
} else {
toast.success('Dashboard successfully updated ');
this.updateDashboard(new Dashboard().fromJson(_dashboard));
this.syncDashboardInfo(_dashboard.dashboardId!, _dashboard);
}
resolve(_dashboard);
});
})
.catch((error) => {
.catch(() => {
toast.error('Error saving dashboard');
reject();
})
@ -213,6 +213,14 @@ export default class DashboardStore {
});
}
syncDashboardInfo(id: string, info: { name: string, description: string, isPublic: boolean, createdAt: number }) {
if (this.selectedDashboard !== null) {
this.selectedDashboard.update(info)
const index = this.dashboards.findIndex((d) => d.dashboardId === id);
Object.assign(this.dashboards[index], info)
}
}
saveMetric(metric: Widget, dashboardId: string): Promise<any> {
const isCreating = !metric.widgetId;
return dashboardService.saveMetric(metric, dashboardId).then((metric) => {

View file

@ -1,11 +1,11 @@
{
"name": "utilities-server",
"name": "assist-server",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "utilities-server",
"name": "assist-server",
"version": "1.0.0",
"license": "Elastic License 2.0 (ELv2)",
"dependencies": {
@ -45,9 +45,9 @@
}
},
"node_modules/@types/node": {
"version": "18.13.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.13.0.tgz",
"integrity": "sha512-gC3TazRzGoOnoKAhUx+Q0t8S9Tzs74z7m0ipwGpSqQrleP14hKxP4/JUeEQcD3W1/aIpnWl8pHowI7WokuZpXg=="
"version": "18.14.1",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.14.1.tgz",
"integrity": "sha512-QH+37Qds3E0eDlReeboBxfHbX9omAcBCXEzswCu6jySP642jiM3cYSIkU/REqwhCUqXdonHFuBfJDiAJxMNhaQ=="
},
"node_modules/accepts": {
"version": "1.3.8",
@ -254,9 +254,9 @@
}
},
"node_modules/engine.io": {
"version": "6.4.0",
"resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.4.0.tgz",
"integrity": "sha512-OgxY1c/RuCSeO/rTr8DIFXx76IzUUft86R7/P7MMbbkuzeqJoTNw2lmeD91IyGz41QYleIIjWeMJGgug043sfQ==",
"version": "6.4.1",
"resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.4.1.tgz",
"integrity": "sha512-JFYQurD/nbsA5BSPmbaOSLa3tSVj8L6o4srSwXXY3NqE+gGUNmmPTbhn8tjzcCtSqhFgIeqef81ngny8JM25hw==",
"dependencies": {
"@types/cookie": "^0.4.1",
"@types/cors": "^2.8.12",
@ -862,14 +862,14 @@
}
},
"node_modules/socket.io": {
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.6.0.tgz",
"integrity": "sha512-b65bp6INPk/BMMrIgVvX12x3Q+NqlGqSlTuvKQWt0BUJ3Hyy3JangBl7fEoWZTXbOKlCqNPbQ6MbWgok/km28w==",
"version": "4.6.1",
"resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.6.1.tgz",
"integrity": "sha512-KMcaAi4l/8+xEjkRICl6ak8ySoxsYG+gG6/XfRCPJPQ/haCRIJBTL4wIl8YCsmtaBovcAXGLOShyVWQ/FG8GZA==",
"dependencies": {
"accepts": "~1.3.4",
"base64id": "~2.0.0",
"debug": "~4.3.2",
"engine.io": "~6.4.0",
"engine.io": "~6.4.1",
"socket.io-adapter": "~2.5.2",
"socket.io-parser": "~4.2.1"
},