fix: minor changes
This commit is contained in:
parent
d60bbfe4c3
commit
90766eb1e8
|
|
@ -44,6 +44,7 @@ export const CLINIC_STATUS = {
|
||||||
'APPROVAL_PENDING_DOCUMENT_RESUBMITTED',
|
'APPROVAL_PENDING_DOCUMENT_RESUBMITTED',
|
||||||
INACTIVE: 'inactive',
|
INACTIVE: 'inactive',
|
||||||
PAYMENT_DUE: "payment_due",
|
PAYMENT_DUE: "payment_due",
|
||||||
|
SUBSCRIPTION_ENDED: "subscription_ended",
|
||||||
};
|
};
|
||||||
|
|
||||||
export const CLINIC_DOCUMENT_STATUS = {
|
export const CLINIC_DOCUMENT_STATUS = {
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ const checkVisibility = (item, i) => {
|
||||||
if (hasRole) {
|
if (hasRole) {
|
||||||
// Determine if the link should be disabled
|
// Determine if the link should be disabled
|
||||||
// FIXED LOGIC: If clinic status is rejected, only allow "/" and "/docs" paths
|
// FIXED LOGIC: If clinic status is rejected, only allow "/" and "/docs" paths
|
||||||
const isDisabled = (clinicStatus === "rejected" || clinicStatus === "under_review" || clinicStatus === "payment_due") && !(item.path == "" || item.path == "docs");
|
const isDisabled = (clinicStatus == "under_review" || clinicStatus == "inactive" || clinicStatus == "rejected" || clinicStatus == "subscription_ended") && !(item.path == "" || item.path == "docs");
|
||||||
|
|
||||||
// Set the correct target path
|
// Set the correct target path
|
||||||
const targetPath = isDisabled ? "#" : `/${item.path}`;
|
const targetPath = isDisabled ? "#" : `/${item.path}`;
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ import { hideAndShowFunctionality } from '../../views/Signup/signupAction';
|
||||||
import Header from './components/Header';
|
import Header from './components/Header';
|
||||||
import Sidebar from './components/Sidebar';
|
import Sidebar from './components/Sidebar';
|
||||||
import { useStyles } from './mainLayoutStyles';
|
import { useStyles } from './mainLayoutStyles';
|
||||||
|
import { selectClinicStatus } from '../../redux/userRoleSlice';
|
||||||
|
|
||||||
function MainLayout() {
|
function MainLayout() {
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
|
|
@ -26,6 +27,8 @@ function MainLayout() {
|
||||||
const [alertInfo, setAlertInfo] = useState({ message: '', show: false });
|
const [alertInfo, setAlertInfo] = useState({ message: '', show: false });
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
|
|
||||||
|
const clinicStatus = useSelector(selectClinicStatus);
|
||||||
|
|
||||||
const hideFeature = useSelector((state) => state?.signup?.hideFeatures);
|
const hideFeature = useSelector((state) => state?.signup?.hideFeatures);
|
||||||
|
|
||||||
const planDetails = useSelector((state) => state?.login?.user?.account);
|
const planDetails = useSelector((state) => state?.login?.user?.account);
|
||||||
|
|
@ -134,14 +137,14 @@ function MainLayout() {
|
||||||
className={classes.functionalityNotAvailableTextBold}
|
className={classes.functionalityNotAvailableTextBold}
|
||||||
variant="h1"
|
variant="h1"
|
||||||
>
|
>
|
||||||
Note!
|
{clinicStatus =="inactive" ? "Clinic is freezed" : "Note!"}
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|
||||||
<Typography
|
<Typography
|
||||||
className={classes.functionalityNotAvailableText}
|
className={classes.functionalityNotAvailableText}
|
||||||
variant="h4"
|
variant="h4"
|
||||||
>
|
>
|
||||||
This section will accessible after approval
|
{clinicStatus =="inactive" ? `Please contact the AIHCR Admin` : "This section will accessible after approval"}
|
||||||
</Typography>
|
</Typography>
|
||||||
<LoadingButton
|
<LoadingButton
|
||||||
variant="contained"
|
variant="contained"
|
||||||
|
|
|
||||||
|
|
@ -458,11 +458,11 @@ const FileEvaluate = ({
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<Grid container>
|
{/* <Grid container>
|
||||||
<Grid item md={12} className={classes.previewFileTitle}>
|
<Grid item md={12} className={classes.previewFileTitle}>
|
||||||
<Typography color="white">{previewFile.file}</Typography>
|
<Typography color="white">{previewFile.file}</Typography>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid> */}
|
||||||
|
|
||||||
<Grid xs={12} className={classes.previewImageGrid}>
|
<Grid xs={12} className={classes.previewImageGrid}>
|
||||||
<ImagePreviewComponent
|
<ImagePreviewComponent
|
||||||
|
|
|
||||||
|
|
@ -187,7 +187,11 @@ const ClinicsList = () => {
|
||||||
accessorFn: ({ status }) => (
|
accessorFn: ({ status }) => (
|
||||||
<>
|
<>
|
||||||
<Chip
|
<Chip
|
||||||
// className={classes.chipClass}
|
sx={{
|
||||||
|
position: "relative",
|
||||||
|
left: "-10px",
|
||||||
|
padding: "0px",
|
||||||
|
}}
|
||||||
label={
|
label={
|
||||||
status === CLINIC_STATUS.UNDER_REVIEW.toLowerCase() ? (
|
status === CLINIC_STATUS.UNDER_REVIEW.toLowerCase() ? (
|
||||||
"Under Review"
|
"Under Review"
|
||||||
|
|
@ -306,6 +310,48 @@ const ClinicsList = () => {
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
enableSorting: false,
|
||||||
|
accessorKey: "status",
|
||||||
|
header: "Status",
|
||||||
|
size: 150,
|
||||||
|
Cell: ({ row }) => {
|
||||||
|
const status =
|
||||||
|
row.original.status === CLINIC_STATUS.INACTIVE
|
||||||
|
? "Inactive"
|
||||||
|
: row.original.status === CLINIC_STATUS.SUBSCRIPTION_ENDED
|
||||||
|
? "Subscription Ended"
|
||||||
|
: "Active";
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Chip
|
||||||
|
label={status}
|
||||||
|
sx={{
|
||||||
|
position: "relative",
|
||||||
|
left: "-10px",
|
||||||
|
padding: "0px",
|
||||||
|
}}
|
||||||
|
style={{
|
||||||
|
backgroundColor:
|
||||||
|
row.original.status === CLINIC_STATUS.INACTIVE
|
||||||
|
? theme.palette.orange.light
|
||||||
|
: row.original.status ===
|
||||||
|
CLINIC_STATUS.SUBSCRIPTION_ENDED
|
||||||
|
? theme.palette.warning.light
|
||||||
|
: theme.palette.blue.light,
|
||||||
|
color:
|
||||||
|
row.original.status === CLINIC_STATUS.INACTIVE
|
||||||
|
? theme.palette.orange.main
|
||||||
|
: row.original.status ===
|
||||||
|
CLINIC_STATUS.SUBSCRIPTION_ENDED
|
||||||
|
? theme.palette.warning.main
|
||||||
|
: theme.palette.blue.main,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
enableSorting: false,
|
enableSorting: false,
|
||||||
size: 100,
|
size: 100,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue