use demo role to show/hide features
This commit is contained in:
1 parent
63da8bd571
commit
7f9950b9e5
5 files changed
+16
-13
No files matched your search
@@ -24,9 +24,11 @@ const Account = ({ open = "profile" }) => {
|
||||
};
|
||||
const { user } = useSelector((state) => state.auth);
|
||||
|
||||
let tabList = ["Profile", "Team"];
|
||||
if (user.role.includes("superadmin")) {
|
||||
tabList.push("Password");
|
||||
let tabList = ["Profile", "Team", "Password"];
|
||||
|
||||
// Remove passwrod for demo
|
||||
if (user.role.includes("demo")) {
|
||||
tabList = tabList.filter((tab) => tab !== "Password");
|
||||
}
|
||||
const requiredRoles = ["superadmin", "admin"];
|
||||
const hideTeams = !requiredRoles.some((role) => user.role.includes(role));
|
||||
|
||||
@@ -15,6 +15,7 @@ import ArrowBackRoundedIcon from "@mui/icons-material/ArrowBackRounded";
|
||||
import PropTypes from "prop-types";
|
||||
import { logger } from "../../Utils/Logger";
|
||||
import "./index.css";
|
||||
const DEMO = import.meta.env.VITE_APP_DEMO;
|
||||
|
||||
/**
|
||||
* Displays the initial landing page.
|
||||
@@ -327,8 +328,8 @@ const Login = () => {
|
||||
};
|
||||
|
||||
const [form, setForm] = useState({
|
||||
email: "uptimedemo@demo.com",
|
||||
password: "Demouser1!",
|
||||
email: DEMO !== undefined ? "uptimedemo@demo.com" : "",
|
||||
password: DEMO !== undefined ? "Demouser1!" : "",
|
||||
});
|
||||
const [errors, setErrors] = useState({});
|
||||
const [step, setStep] = useState(0);
|
||||
|
||||
Reference in new issue
Block a user