Minor frontend fixes
This commit is contained in:
@@ -22,7 +22,6 @@ import CreateIcon from '@mui/icons-material/Create'
|
|||||||
import { toast } from 'react-toastify'
|
import { toast } from 'react-toastify'
|
||||||
import YAML from "yaml";
|
import YAML from "yaml";
|
||||||
|
|
||||||
|
|
||||||
const AppCreationModal = ({ open, onClose, theme, globalUrl, isCloud }) => {
|
const AppCreationModal = ({ open, onClose, theme, globalUrl, isCloud }) => {
|
||||||
const [openApiModal, setOpenApiModal] = useState(false)
|
const [openApiModal, setOpenApiModal] = useState(false)
|
||||||
const [generateAppModal, setGenerateAppModal] = useState(false)
|
const [generateAppModal, setGenerateAppModal] = useState(false)
|
||||||
@@ -257,26 +256,27 @@ const AppCreationModal = ({ open, onClose, theme, globalUrl, isCloud }) => {
|
|||||||
body: openApidata,
|
body: openApidata,
|
||||||
credentials: "include",
|
credentials: "include",
|
||||||
})
|
})
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
|
|
||||||
setValidation(false);
|
setValidation(false);
|
||||||
return response.json();
|
return response.json();
|
||||||
})
|
})
|
||||||
.then((responseJson) => {
|
.then((responseJson) => {
|
||||||
if (responseJson.success) {
|
if (responseJson?.success === true) {
|
||||||
setAppValidation(responseJson.id);
|
setAppValidation(responseJson?.id)
|
||||||
} else {
|
navigate(`/apps/new?id=${responseJson?.id}`)
|
||||||
if (responseJson.reason !== undefined) {
|
} else {
|
||||||
setOpenApiError(responseJson.reason);
|
if (responseJson.reason !== undefined) {
|
||||||
}
|
setOpenApiError(responseJson.reason)
|
||||||
toast("An error occurred in the response");
|
}
|
||||||
}
|
toast("An error occurred in the response");
|
||||||
})
|
}
|
||||||
.catch((error) => {
|
})
|
||||||
setValidation(false);
|
.catch((error) => {
|
||||||
toast(error.toString());
|
setValidation(false);
|
||||||
setOpenApiError(error.toString());
|
toast(error.toString());
|
||||||
});
|
setOpenApiError(error.toString());
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const redirectOpenApi = () => {
|
const redirectOpenApi = () => {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import React, { useState, useEffect, useContext, useCallback, memo, useMemo, useRef } from "react";
|
import React, { useState, useEffect, useContext, useCallback, memo, useMemo, useRef } from "react";
|
||||||
import theme from "../theme.jsx";
|
import theme from "../theme.jsx";
|
||||||
import { isMobile } from "react-device-detect";
|
import { isMobile } from "react-device-detect";
|
||||||
|
|
||||||
import { useLocation, useNavigate } from "react-router-dom";
|
import { useLocation, useNavigate } from "react-router-dom";
|
||||||
import {
|
import {
|
||||||
TextField, Button, Typography, MenuItem, Select, Tabs, Tab, Zoom,
|
TextField, Button, Typography, MenuItem, Select, Tabs, Tab, Zoom,
|
||||||
|
|||||||
Reference in New Issue
Block a user