Merge remote-tracking branch 'origin/dev-refactor' into main-dev
This commit is contained in:
@@ -118,7 +118,7 @@ const BarChartInput = (props: Props) => {
|
|||||||
// visualizationSocket.emit("v1:viz-3D-widget:add", adding3dWidget);
|
// visualizationSocket.emit("v1:viz-3D-widget:add", adding3dWidget);
|
||||||
|
|
||||||
// }
|
// }
|
||||||
let response = await addingWidgets(selectedZone.zoneUuid, organization, newWidget,projectId);
|
let response = await addingWidgets(selectedZone.zoneUuid, organization, newWidget,projectId, selectedVersion?.versionId || "");
|
||||||
|
|
||||||
|
|
||||||
if(response.message==="Widget updated successfully"){
|
if(response.message==="Widget updated successfully"){
|
||||||
|
|||||||
@@ -234,7 +234,7 @@ const LineGrapInput = (props: Props) => {
|
|||||||
// if (visualizationSocket) {
|
// if (visualizationSocket) {
|
||||||
// visualizationSocket.emit("v1:viz-3D-widget:add", adding3dWidget);
|
// visualizationSocket.emit("v1:viz-3D-widget:add", adding3dWidget);
|
||||||
// }
|
// }
|
||||||
let response = await addingWidgets(selectedZone.zoneUuid, organization, newWidget, projectId);
|
let response = await addingWidgets(selectedZone.zoneUuid, organization, newWidget, projectId, selectedVersion?.versionId || "");
|
||||||
|
|
||||||
if (response.message === "Widget updated successfully") {
|
if (response.message === "Widget updated successfully") {
|
||||||
|
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ const PieChartInput = (props: Props) => {
|
|||||||
// visualizationSocket.emit("v1:viz-3D-widget:add", adding3dWidget);
|
// visualizationSocket.emit("v1:viz-3D-widget:add", adding3dWidget);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
let response = await addingWidgets(selectedZone.zoneUuid, organization, newWidget, projectId);
|
let response = await addingWidgets(selectedZone.zoneUuid, organization, newWidget, projectId, selectedVersion?.versionId || "");
|
||||||
|
|
||||||
if (response.message === "Widget updated successfully") {
|
if (response.message === "Widget updated successfully") {
|
||||||
|
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ const Progress1Input = (props: Props) => {
|
|||||||
// if (visualizationSocket) {
|
// if (visualizationSocket) {
|
||||||
// visualizationSocket.emit("v1:viz-3D-widget:add", adding3dWidget);
|
// visualizationSocket.emit("v1:viz-3D-widget:add", adding3dWidget);
|
||||||
// }
|
// }
|
||||||
let response = await addingWidgets(selectedZone.zoneUuid, organization, newWidget, projectId);
|
let response = await addingWidgets(selectedZone.zoneUuid, organization, newWidget, projectId, selectedVersion?.versionId || "");
|
||||||
|
|
||||||
if (response.message === "Widget updated successfully") {
|
if (response.message === "Widget updated successfully") {
|
||||||
|
|
||||||
|
|||||||
@@ -43,11 +43,11 @@ const Progress2Input = (props: Props) => {
|
|||||||
setDropDownData(response.data);
|
setDropDownData(response.data);
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
echo.error("Failed to fetch zone data");
|
echo.error("Failed to fetch zone data");
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
fetchZoneData();
|
fetchZoneData();
|
||||||
@@ -69,16 +69,16 @@ const Progress2Input = (props: Props) => {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
if (response.status === 200) {
|
if (response.status === 200) {
|
||||||
|
|
||||||
setSelections(response.data.Datastructure.measurements);
|
setSelections(response.data.Datastructure.measurements);
|
||||||
setDuration(response.data.Datastructure.duration);
|
setDuration(response.data.Datastructure.duration);
|
||||||
setWidgetName(response.data.widgetName);
|
setWidgetName(response.data.widgetName);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
echo.error("Failed to fetch saved inputs");
|
echo.error("Failed to fetch saved inputs");
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -108,7 +108,7 @@ const Progress2Input = (props: Props) => {
|
|||||||
duration: inputDuration,
|
duration: inputDuration,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// const adding3dWidget = {
|
// const adding3dWidget = {
|
||||||
// organization: organization,
|
// organization: organization,
|
||||||
// widget: newWidget,
|
// widget: newWidget,
|
||||||
@@ -119,14 +119,14 @@ const Progress2Input = (props: Props) => {
|
|||||||
// visualizationSocket.emit("v1:viz-3D-widget:add", adding3dWidget);
|
// visualizationSocket.emit("v1:viz-3D-widget:add", adding3dWidget);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
let response = await addingWidgets(selectedZone.zoneUuid, organization, newWidget,projectId);
|
let response = await addingWidgets(selectedZone.zoneUuid, organization, newWidget, projectId, selectedVersion?.versionId || "");
|
||||||
|
|
||||||
if(response.message==="Widget updated successfully"){
|
if (response.message === "Widget updated successfully") {
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}else{
|
} else {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// try {
|
// try {
|
||||||
|
|||||||
@@ -4,7 +4,8 @@ export const addingWidgets = async (
|
|||||||
zoneUuid: string,
|
zoneUuid: string,
|
||||||
organization: string,
|
organization: string,
|
||||||
widget: {},
|
widget: {},
|
||||||
projectId?: string
|
projectId?: string,
|
||||||
|
versionId?: string
|
||||||
) => {
|
) => {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -16,7 +17,7 @@ export const addingWidgets = async (
|
|||||||
token: localStorage.getItem("token") || "",
|
token: localStorage.getItem("token") || "",
|
||||||
refresh_token: localStorage.getItem("refreshToken") || "",
|
refresh_token: localStorage.getItem("refreshToken") || "",
|
||||||
},
|
},
|
||||||
body: JSON.stringify({ organization, zoneUuid, widget, projectId }),
|
body: JSON.stringify({ organization, zoneUuid, widget, projectId, versionId }),
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
|
|||||||
Reference in New Issue
Block a user