From 2369d5c8e66ef10de78d50e1fd12ad051e103ccc Mon Sep 17 00:00:00 2001 From: Barunes Padhy Date: Thu, 13 Jun 2024 17:55:02 +0300 Subject: [PATCH] Code polish --- .../src/components/shared/card-list-viewer.jsx | 1 - .../src/components/shared/category-bar.jsx | 2 +- .../editable-ui/src/components/shared/publish.jsx | 12 ++++++++++-- frontend/viewable-ui/src/components/home.jsx | 2 +- frontend/viewable-ui/src/index.css | 9 +-------- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/frontend/editable-ui/src/components/shared/card-list-viewer.jsx b/frontend/editable-ui/src/components/shared/card-list-viewer.jsx index 5f644c6..56b9aae 100755 --- a/frontend/editable-ui/src/components/shared/card-list-viewer.jsx +++ b/frontend/editable-ui/src/components/shared/card-list-viewer.jsx @@ -10,7 +10,6 @@ import { } from 'reactstrap'; import { Link } from 'react-router-dom'; import ModalComponent from './modal-component'; -import MediaUpload from './media-upload.jsx' function CardListViewer(props) { diff --git a/frontend/editable-ui/src/components/shared/category-bar.jsx b/frontend/editable-ui/src/components/shared/category-bar.jsx index f681ac4..1e77431 100755 --- a/frontend/editable-ui/src/components/shared/category-bar.jsx +++ b/frontend/editable-ui/src/components/shared/category-bar.jsx @@ -1,7 +1,7 @@ import { useEffect, useState } from 'react'; import EditableDataService from '../../services/editable-data-service'; import { Link } from 'react-router-dom'; -import { Container, Row, Col, Button, Spinner, ListGroup, ListGroupItem, ButtonGroup } from 'reactstrap'; +import { Container, Row, Col, Button, Spinner, ButtonGroup } from 'reactstrap'; function CategoryBar(props) { diff --git a/frontend/editable-ui/src/components/shared/publish.jsx b/frontend/editable-ui/src/components/shared/publish.jsx index 95f912a..4bf3c61 100644 --- a/frontend/editable-ui/src/components/shared/publish.jsx +++ b/frontend/editable-ui/src/components/shared/publish.jsx @@ -1,9 +1,10 @@ import React, { useState, useEffect } from 'react'; -import { Button, Modal, ModalHeader, ModalBody, ModalFooter } from 'reactstrap'; +import { Button, Modal, ModalHeader, ModalBody, ModalFooter, Spinner } from 'reactstrap'; import EditableDataService from '../../services/editable-data-service'; function Publish(props) { const [publishMethods, setPublishMethods] = useState(null) + const [publishSpinner, setPublishSpinner] = useState(false) useEffect(() => { fetchPublishMethods() @@ -19,7 +20,6 @@ function Publish(props) { "name": value["name"] }) )) - console.log(publishMethods) setPublishMethods(publishMethods) } catch (error) { props.notificationToggler('Error fetching methods', 'danger') @@ -28,10 +28,13 @@ function Publish(props) { const publishData = async (deploy_method) => { try { + setPublishSpinner(true) const response = await EditableDataService.getData(`/data/publish/${deploy_method}/`); props.notificationToggler('Deployment Sucess') + setPublishSpinner(false) } catch (error) { props.notificationToggler('Deployment Failed', 'danger') + setPublishSpinner(false) } }; @@ -57,6 +60,11 @@ function Publish(props) { ):"" } + { publishSpinner ? +
+ Publishing +
: "" + }