fix: minor changes
This commit is contained in:
parent
d60bbfe4c3
commit
90766eb1e8
|
|
@ -44,6 +44,7 @@ export const CLINIC_STATUS = {
|
|||
'APPROVAL_PENDING_DOCUMENT_RESUBMITTED',
|
||||
INACTIVE: 'inactive',
|
||||
PAYMENT_DUE: "payment_due",
|
||||
SUBSCRIPTION_ENDED: "subscription_ended",
|
||||
};
|
||||
|
||||
export const CLINIC_DOCUMENT_STATUS = {
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ const checkVisibility = (item, i) => {
|
|||
if (hasRole) {
|
||||
// Determine if the link should be disabled
|
||||
// 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
|
||||
const targetPath = isDisabled ? "#" : `/${item.path}`;
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ import { hideAndShowFunctionality } from '../../views/Signup/signupAction';
|
|||
import Header from './components/Header';
|
||||
import Sidebar from './components/Sidebar';
|
||||
import { useStyles } from './mainLayoutStyles';
|
||||
import { selectClinicStatus } from '../../redux/userRoleSlice';
|
||||
|
||||
function MainLayout() {
|
||||
const classes = useStyles();
|
||||
|
|
@ -26,6 +27,8 @@ function MainLayout() {
|
|||
const [alertInfo, setAlertInfo] = useState({ message: '', show: false });
|
||||
const dispatch = useDispatch();
|
||||
|
||||
const clinicStatus = useSelector(selectClinicStatus);
|
||||
|
||||
const hideFeature = useSelector((state) => state?.signup?.hideFeatures);
|
||||
|
||||
const planDetails = useSelector((state) => state?.login?.user?.account);
|
||||
|
|
@ -134,14 +137,14 @@ function MainLayout() {
|
|||
className={classes.functionalityNotAvailableTextBold}
|
||||
variant="h1"
|
||||
>
|
||||
Note!
|
||||
{clinicStatus =="inactive" ? "Clinic is freezed" : "Note!"}
|
||||
</Typography>
|
||||
|
||||
<Typography
|
||||
className={classes.functionalityNotAvailableText}
|
||||
variant="h4"
|
||||
>
|
||||
This section will accessible after approval
|
||||
{clinicStatus =="inactive" ? `Please contact the AIHCR Admin` : "This section will accessible after approval"}
|
||||
</Typography>
|
||||
<LoadingButton
|
||||
variant="contained"
|
||||
|
|
|
|||
|
|
@ -458,11 +458,11 @@ const FileEvaluate = ({
|
|||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<Grid container>
|
||||
{/* <Grid container>
|
||||
<Grid item md={12} className={classes.previewFileTitle}>
|
||||
<Typography color="white">{previewFile.file}</Typography>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid> */}
|
||||
|
||||
<Grid xs={12} className={classes.previewImageGrid}>
|
||||
<ImagePreviewComponent
|
||||
|
|
|
|||
|
|
@ -187,7 +187,11 @@ const ClinicsList = () => {
|
|||
accessorFn: ({ status }) => (
|
||||
<>
|
||||
<Chip
|
||||
// className={classes.chipClass}
|
||||
sx={{
|
||||
position: "relative",
|
||||
left: "-10px",
|
||||
padding: "0px",
|
||||
}}
|
||||
label={
|
||||
status === CLINIC_STATUS.UNDER_REVIEW.toLowerCase() ? (
|
||||
"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,
|
||||
size: 100,
|
||||
|
|
|
|||
Loading…
Reference in New Issue