diff --git a/frontend/public/images/finalize.gif b/frontend/public/images/finalize.gif new file mode 100644 index 00000000..f2656fa6 Binary files /dev/null and b/frontend/public/images/finalize.gif differ diff --git a/frontend/src/views/Welcome.jsx b/frontend/src/views/Welcome.jsx index 45857f8a..e508e1ab 100644 --- a/frontend/src/views/Welcome.jsx +++ b/frontend/src/views/Welcome.jsx @@ -458,7 +458,7 @@ const Welcome = (props) => { }) } - navigate("/getting-started?message=Skipped intro") + navigate("/workflows?message=Skipped intro") }}> diff --git a/frontend/src/views/Workflows.jsx b/frontend/src/views/Workflows.jsx index b1ec083f..47b025fe 100644 --- a/frontend/src/views/Workflows.jsx +++ b/frontend/src/views/Workflows.jsx @@ -15,7 +15,9 @@ import { isMobile } from "react-device-detect" import { Badge, + Divider, Avatar, + Drawer, Grid, InputLabel, Select, @@ -37,6 +39,7 @@ import { DialogActions, DialogContent, Checkbox, + LinearProgress, ListItemText, } from "@material-ui/core"; @@ -71,10 +74,15 @@ import { CloudDownload as CloudDownloadIcon, ExpandLess as ExpandLessIcon, ExpandMore as ExpandMoreIcon, + Done as DoneIcon, + CheckCircle as CheckCircleIcon, + RadioButtonUnchecked as RadioButtonUncheckedIcon, + ArrowLeft as ArrowLeftIcon, + ArrowRight as ArrowRightIcon, } from "@material-ui/icons"; //import NestedMenuItem from "material-ui-nested-menu-item"; -//import {Search as SearchIcon, ArrowUpward as ArrowUpwardIcon, Visibility as VisibilityIcon, Done as DoneIcon, Close as CloseIcon, Error as ErrorIcon, FindReplace as FindreplaceIcon, ArrowLeft as ArrowLeftIcon, Cached as CachedIcon, DirectionsRun as DirectionsRunIcon, Add as AddIcon, Polymer as PolymerIcon, FormatListNumbered as FormatListNumberedIcon, Create as CreateIcon, PlayArrow as PlayArrowIcon, AspectRatio as AspectRatioIcon, MoreVert as MoreVertIcon, Apps as AppsIcon, Schedule as ScheduleIcon, FavoriteBorder as FavoriteBorderIcon, Pause as PauseIcon, Delete as DeleteIcon, AddCircleOutline as AddCircleOutlineIcon, Save as SaveIcon, KeyboardArrowLeft as KeyboardArrowLeftIcon, KeyboardArrowRight as KeyboardArrowRightIcon, ArrowBack as ArrowBackIcon, Settings as SettingsIcon, LockOpen as LockOpenIcon, ExpandMore as ExpandMoreIcon, VpnKey as VpnKeyIcon} from '@material-ui/icons'; +//import {Search as SearchIcon, ArrowUpward as ArrowUpwardIcon, Visibility as VisibilityIcon, Close as CloseIcon, Error as ErrorIcon, FindReplace as FindreplaceIcon, ArrowLeft as ArrowLeftIcon, Cached as CachedIcon, DirectionsRun as DirectionsRunIcon, Add as AddIcon, Polymer as PolymerIcon, FormatListNumbered as FormatListNumberedIcon, Create as CreateIcon, PlayArrow as PlayArrowIcon, AspectRatio as AspectRatioIcon, MoreVert as MoreVertIcon, Apps as AppsIcon, Schedule as ScheduleIcon, FavoriteBorder as FavoriteBorderIcon, Pause as PauseIcon, Delete as DeleteIcon, AddCircleOutline as AddCircleOutlineIcon, Save as SaveIcon, KeyboardArrowLeft as KeyboardArrowLeftIcon, KeyboardArrowRight as KeyboardArrowRightIcon, ArrowBack as ArrowBackIcon, Settings as SettingsIcon, LockOpen as LockOpenIcon, ExpandMore as ExpandMoreIcon, VpnKey as VpnKeyIcon} from '@material-ui/icons'; //https://next.material-ui.com/components/material-icons/ import { DataGrid, GridToolbar } from "@mui/x-data-grid"; @@ -554,6 +562,54 @@ const Workflows = (props) => { const [showMoreClicked, setShowMoreClicked] = React.useState(false); const [usecases, setUsecases] = React.useState([]); const [appFramework, setAppFramework] = React.useState({}); + const [drawerOpen, setDrawerOpen] = React.useState(false) + const [videoViewOpen, setVideoViewOpen] = React.useState(false) + const [gettingStartedItems, setGettingStartedItems] = React.useState([]) + const drawerWidth = drawerOpen ? 325 : 0 + + const sidebarKey = "getting_started_sidebar" + if (isLoggedIn === true && gettingStartedItems.length === 0 && (userdata.tutorials !== undefined && userdata.tutorials !== null && userdata.tutorials.length > 0) && workflowDone === true) { + + const activeFiltered = userdata.tutorials.filter((item) => item.active === true) + if (activeFiltered.length > 0) { + var newfiltered = [] + for (var key in activeFiltered) { + if (activeFiltered[key].name === "Discover Usecases") { + if (workflows.length > 1) { + activeFiltered[key].done = true + activeFiltered[key].description = `${workflows.length} workflows created` + } + } + + newfiltered.push(activeFiltered[key]) + } + setGettingStartedItems(activeFiltered) + + const doneFiltered = activeFiltered.filter((item) => item.done === true) + if (doneFiltered.length > 0) { + console.log("DONE: ", doneFiltered) + } + + const sidebar = localStorage.getItem(sidebarKey); + if (sidebar === null || sidebar === undefined) { + console.log("No sidebar defined") + + localStorage.setItem(sidebarKey, "open"); + setDrawerOpen(true) + } else { + console.log("Got sidebar: ", sidebar) + + if (sidebar === "open") { + console.log("OPEN the thingy!") + setDrawerOpen(true) + } else { + console.log("Close the thingy!") + setDrawerOpen(false) + } + } + } + + } const isCloud = window.location.host === "localhost:3002" || @@ -914,8 +970,10 @@ const Workflows = (props) => { if (isDropzone) { setIsDropzone(false); } + }, [isDropzone]); + const getFramework = () => { fetch(globalUrl + "/api/v1/apps/frameworkConfiguration", { method: "GET", @@ -1029,7 +1087,9 @@ const Workflows = (props) => { // Ensures the zooming happens only once per load setTimeout(() => { setFirstLoad(false) + }, 100) + } else { if (isLoggedIn) { alert.error("An error occurred while loading workflows"); @@ -1142,9 +1202,9 @@ const Workflows = (props) => { color: "#ffffff", width: "100%", display: "flex", - minWidth: isMobile ? "100%" : 1024, - maxWidth: isMobile ? "100%" : 1024, - margin: "auto", + minWidth: isMobile ? "100%" : drawerWidth > 0 ? 824 : 1024, + maxWidth: isMobile ? "100%" : drawerWidth > 0 ? 824 : 1024, + margin: drawerWidth === 0 ? "auto" : `auto ${drawerWidth+100} auto auto`, paddingBottom: 200, }; @@ -2881,8 +2941,8 @@ const Workflows = (props) => { const workflowViewStyle = { flex: viewSize.workflowView, - marginLeft: "10px", - marginRight: "10px", + marginLeft: 10, + marginRight: 10, }; if (viewSize.workflowView === 0) { @@ -3072,9 +3132,10 @@ const Workflows = (props) => { const WorkflowView = () => { if (workflows.length === 0) { - if ((userdata.tutorials !== undefined && userdata.tutorials !== null && !userdata.tutorials.includes("getting-started")) || userdata.tutorials === null) { - return ; - } + // Not going there yet + //if ((userdata.tutorials !== undefined && userdata.tutorials !== null && !userdata.tutorials.includes("getting-started")) || userdata.tutorials === null) { + // return ; + //} return (
@@ -3600,6 +3661,158 @@ const Workflows = (props) => { ) : null; + + //const + //const [percentDone, setPercentDone] = React.useState(0) + const percentDone = gettingStartedItems.filter((item) => item.done).length / gettingStartedItems.length * 100 + + const GettingStartedItem = ({item, index}) => { + const [clicked, setClicked] = React.useState(false) + const doneIcon = item.done ? : + + return ( +
setClicked(true)} + > + + {doneIcon} {index + 1}. {item.name} + + {clicked ? + + + {item.description} + + + + + + : + null + } +
+ ) + } + + const gettingStartedDrawer = + +
+ + Getting Started + + + { + e.preventDefault(); + setDrawerOpen(false) + + localStorage.setItem(sidebarKey, "closed"); + }} + > + + + +
+
+ + Setup progress: {isNaN(percentDone) ? 0 : percentDone}% + + + + + + Follow these steps to get you up and running! + + + { + setVideoViewOpen(true) + }}> + Watch 2-min introduction video + +
+
+ {gettingStartedItems.map((item, index) => { + return ( + + ) + })} +
+
+ + const videoView = + { + setVideoViewOpen(false) + }} + PaperProps={{ + style: { + backgroundColor: surfaceColor, + color: "white", + minWidth: 560, + minHeight: 415, + textAlign: "center", + }, + }} + > + + Welcome to Shuffle! + + + + { + e.preventDefault(); + setVideoViewOpen(false) + }} + > + + + + + + + const loadedCheck = isLoaded && isLoggedIn && workflowDone ? (
@@ -3624,6 +3837,19 @@ const Workflows = (props) => { {publishModal} {workflowDownloadModalOpen} + {!drawerOpen ?
+ + { + setDrawerOpen(true) + localStorage.setItem(sidebarKey, "open"); + }}> + + + +
: null} + {isMobile ? null : gettingStartedDrawer} + {videoView} + {modalOpen === true ?