Mapping /usecase2 and some small changes on app modal

This commit is contained in:
monilprajapati
2024-11-21 00:24:28 +05:30
parent 4f390a797c
commit 6a422a1eb0
4 changed files with 44 additions and 23 deletions
+14
View File
@@ -24,6 +24,7 @@ import DashboardView from "./views/DashboardViews.jsx";
import AdminSetup from "./views/AdminSetup"; import AdminSetup from "./views/AdminSetup";
import Admin from "./views/Admin"; import Admin from "./views/Admin";
import Docs from "./views/Docs.jsx"; import Docs from "./views/Docs.jsx";
import Usecases2 from "./views/Usecases2.jsx";
//import Introduction from "./views/Introduction"; //import Introduction from "./views/Introduction";
import SetAuthentication from "./views/SetAuthentication"; import SetAuthentication from "./views/SetAuthentication";
import SetAuthenticationSSO from "./views/SetAuthenticationSSO"; import SetAuthenticationSSO from "./views/SetAuthenticationSSO";
@@ -383,6 +384,19 @@ const App = (message, props) => {
{...props} {...props}
/> />
} }
/>
<Route
exact
path="/usecases2"
element={
<Usecases2
userdata={userdata}
isLoaded={isLoaded}
isLoggedIn={isLoggedIn}
globalUrl={globalUrl}
{...props}
/>
}
/> />
<Route <Route
exact exact
+27 -20
View File
@@ -19,10 +19,9 @@ import LaunchIcon from '@mui/icons-material/Launch';
import CheckCircleIcon from '@mui/icons-material/CheckCircle'; import CheckCircleIcon from '@mui/icons-material/CheckCircle';
import { CloudDownloadOutlined } from '@mui/icons-material'; import { CloudDownloadOutlined } from '@mui/icons-material';
const AppModal = ({ open, onClose, data, userdata }) => { const AppModal = ({ open, onClose, app, userdata }) => {
console.log("App data: ", data) console.log("App data: ", app)
console.log("userdata: ", userdata)
const isCloud = const isCloud =
window.location.host === "localhost:3002" || window.location.host === "localhost:3002" ||
@@ -30,7 +29,7 @@ const AppModal = ({ open, onClose, data, userdata }) => {
? true ? true
: false; : false;
var newAppname = data?.name; var newAppname = app?.name;
if (newAppname === undefined) { if (newAppname === undefined) {
newAppname = "Undefined"; newAppname = "Undefined";
} else { } else {
@@ -38,7 +37,7 @@ const AppModal = ({ open, onClose, data, userdata }) => {
newAppname = newAppname.replaceAll("_", " "); newAppname = newAppname.replaceAll("_", " ");
} }
var canEditApp = userdata.admin === "true" || userdata.id === data?.owner || data?.owner === "" || (userdata.admin === "true" && userdata.active_org.id === data?.reference_org) || !data?.generated var canEditApp = userdata.admin === "true" || userdata.id === app?.owner || app?.owner === "" || (userdata.admin === "true" && userdata.active_org.id === app?.reference_org) || !app?.generated
return ( return (
@@ -86,8 +85,8 @@ const AppModal = ({ open, onClose, data, userdata }) => {
<div style={{ display: "flex", flexDirection: "row", gap: 10, fontFamily: "Inter" }}> <div style={{ display: "flex", flexDirection: "row", gap: 10, fontFamily: "Inter" }}>
<img <img
alt={data?.name} alt={app?.name}
src={data?.large_image} src={app?.large_image}
style={{ style={{
borderRadius: 4, borderRadius: 4,
maxWidth: 100, maxWidth: 100,
@@ -110,7 +109,7 @@ const AppModal = ({ open, onClose, data, userdata }) => {
isCloud && ( isCloud && (
<a <a
rel="noopener noreferrer" rel="noopener noreferrer"
href={"https://shuffler.io/apps/" + data?.id} href={"https://shuffler.io/apps/" + app?.id}
style={{ textDecoration: "none", color: "#f85a3e", marginTop: "-2px" }} style={{ textDecoration: "none", color: "#f85a3e", marginTop: "-2px" }}
target="_blank" target="_blank"
> >
@@ -130,7 +129,7 @@ const AppModal = ({ open, onClose, data, userdata }) => {
variant="body2" variant="body2"
color="textSecondary" color="textSecondary"
> >
{data?.categories ? data.categories.join(", ") : "Communication"} {app?.categories ? app.categories.join(", ") : "Communication"}
</Typography> </Typography>
</div> </div>
</div> </div>
@@ -202,7 +201,7 @@ const AppModal = ({ open, onClose, data, userdata }) => {
mb: 0.3, mb: 0.3,
color: '#fff' color: '#fff'
}}> }}>
{data?.actions?.length} {app?.actions?.length}
</Typography> </Typography>
<Typography variant="body2" sx={{ color: 'rgba(255, 255, 255, 0.7)' }}> <Typography variant="body2" sx={{ color: 'rgba(255, 255, 255, 0.7)' }}>
Actions Actions
@@ -215,14 +214,22 @@ const AppModal = ({ open, onClose, data, userdata }) => {
paddingTop: "5px" paddingTop: "5px"
}}> }}>
<div style={{ display: 'flex', alignItems: 'center', gap: '4px', marginBottom: "5px" }}> <div style={{ display: 'flex', alignItems: 'center', gap: '4px', marginBottom: "5px" }}>
<CheckCircleIcon sx={{ color: '#4CAF50' }} /> {
<Typography variant="body1" sx={{ app?.collection ? (
fontWeight: 500, <>
color: '#fff', <CheckCircleIcon sx={{ color: '#4CAF50' }} />
marginTop: "1px" <Typography variant="body1" sx={{
}}> fontWeight: 500,
Google Collection color: '#fff',
</Typography> marginTop: "1px"
}}>
app.collection
</Typography>
</>
) : "No collection yet"
}
</div> </div>
<Typography variant="body2" sx={{ color: 'rgba(255, 255, 255, 0.7)', marginLeft: "1px" }}> <Typography variant="body2" sx={{ color: 'rgba(255, 255, 255, 0.7)', marginLeft: "1px" }}>
Part of a collection Part of a collection
@@ -256,7 +263,7 @@ const AppModal = ({ open, onClose, data, userdata }) => {
}}> }}>
<Stack direction="row" spacing={-1}> <Stack direction="row" spacing={-1}>
<Avatar <Avatar
src={data?.large_image} src={app?.large_image}
sx={{ sx={{
width: 32, width: 32,
height: 32, height: 32,
@@ -267,7 +274,7 @@ const AppModal = ({ open, onClose, data, userdata }) => {
}} }}
/> />
<Avatar <Avatar
src={data?.large_image} src={app?.large_image}
sx={{ sx={{
width: 32, width: 32,
height: 32, height: 32,
+1 -1
View File
@@ -984,7 +984,7 @@ const Apps2 = (props) => {
<AppModal <AppModal
open={openModal} open={openModal}
onClose={handleAppModalClose} onClose={handleAppModalClose}
data={selectedApp} app={selectedApp}
userdata={userdata} userdata={userdata}
/> />
<div style={boxStyle}> <div style={boxStyle}>
+2 -2
View File
@@ -692,7 +692,7 @@ const UsecaseListComponent = (props) => {
// This is the start of a dashboard that can be used. // This is the start of a dashboard that can be used.
// What data do we fill in here? Idk // What data do we fill in here? Idk
const Dashboard = (props) => { const Usecases2 = (props) => {
const { globalUrl, isLoggedIn, userdata } = props; const { globalUrl, isLoggedIn, userdata } = props;
//const alert = useAlert(); //const alert = useAlert();
const { leftSideBarOpenByClick} = useContext(Context); const { leftSideBarOpenByClick} = useContext(Context);
@@ -1250,4 +1250,4 @@ const Dashboard = (props) => {
return dataWrapper return dataWrapper
}; };
export default Dashboard; export default Usecases2;