added changes in playground UI
This commit is contained in:
parent
f43aa6c583
commit
24e413f6cf
|
|
@ -73,6 +73,7 @@ const PlayGround = () => {
|
||||||
const [currentPage, setCurrentPage] = useState(1);
|
const [currentPage, setCurrentPage] = useState(1);
|
||||||
const [totalPages, setTotalPages] = useState(0);
|
const [totalPages, setTotalPages] = useState(0);
|
||||||
const [imageColumn, setImageColumn] = useState(null);
|
const [imageColumn, setImageColumn] = useState(null);
|
||||||
|
const [dataFetched,setDataFetched] = useState(false)
|
||||||
const [query, setQuery] = useState("");
|
const [query, setQuery] = useState("");
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
const [paginationPages, setPaginationPages] = useState(null);
|
const [paginationPages, setPaginationPages] = useState(null);
|
||||||
|
|
@ -189,6 +190,7 @@ const PlayGround = () => {
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
if (data.status === "success") {
|
if (data.status === "success") {
|
||||||
|
setDataFetched(true)
|
||||||
setTotalData(data.results);
|
setTotalData(data.results);
|
||||||
var tmp = {};
|
var tmp = {};
|
||||||
tmp.type = type;
|
tmp.type = type;
|
||||||
|
|
@ -403,7 +405,7 @@ const PlayGround = () => {
|
||||||
ref={resultsContainerRef}
|
ref={resultsContainerRef}
|
||||||
className="d-flex w-100 justify-content-center"
|
className="d-flex w-100 justify-content-center"
|
||||||
>
|
>
|
||||||
{getTableData()}
|
{dataFetched && getTableData()}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{isLoading && <LoadingContainer />}
|
{isLoading && <LoadingContainer />}
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,7 @@ const QueryExecutor = () => {
|
||||||
const [query, setQuery] = useState("");
|
const [query, setQuery] = useState("");
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
const [paginationPages, setPaginationPages] = useState(null);
|
const [paginationPages, setPaginationPages] = useState(null);
|
||||||
|
const [dataFetched,setDataFetched] = useState(false)
|
||||||
const [limit, setLimit] = useState("");
|
const [limit, setLimit] = useState("");
|
||||||
const recordsPerPage = 50;
|
const recordsPerPage = 50;
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
@ -100,6 +101,7 @@ const QueryExecutor = () => {
|
||||||
}, [reduxPlaygroundPageNo]);
|
}, [reduxPlaygroundPageNo]);
|
||||||
|
|
||||||
const fetchQueryValue = async () => {
|
const fetchQueryValue = async () => {
|
||||||
|
setDataFetched(false)
|
||||||
if (query.includes("limit")) {
|
if (query.includes("limit")) {
|
||||||
alert("Please specify the limit in the input field.");
|
alert("Please specify the limit in the input field.");
|
||||||
return;
|
return;
|
||||||
|
|
@ -140,6 +142,7 @@ const QueryExecutor = () => {
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
if (data.status === "success") {
|
if (data.status === "success") {
|
||||||
|
setDataFetched(true)
|
||||||
setTotalData(data.results);
|
setTotalData(data.results);
|
||||||
dispatch(updatePlaygroundResults(data?.results));
|
dispatch(updatePlaygroundResults(data?.results));
|
||||||
const totalPageCount = Math.ceil(data?.results.length / recordsPerPage);
|
const totalPageCount = Math.ceil(data?.results.length / recordsPerPage);
|
||||||
|
|
@ -155,6 +158,11 @@ const QueryExecutor = () => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
console.log("datafetched ======= ",dataFetched)
|
||||||
|
},[dataFetched])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
dispatch(updatePlaygroundQuery(query));
|
dispatch(updatePlaygroundQuery(query));
|
||||||
}, [query]);
|
}, [query]);
|
||||||
|
|
@ -372,7 +380,7 @@ const QueryExecutor = () => {
|
||||||
id="results-container"
|
id="results-container"
|
||||||
className="d-flex w-100 justify-content-center"
|
className="d-flex w-100 justify-content-center"
|
||||||
>
|
>
|
||||||
{getTableData()}
|
{dataFetched && getTableData()}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{isLoading && <LoadingContainer />}
|
{isLoading && <LoadingContainer />}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue