Update Member Enrollment

This commit is contained in:
R
2022-09-02 13:12:23 +07:00
parent 2215f61db4
commit b2ef1bfd57
30 changed files with 229 additions and 74 deletions

0
frontend/client-portal/.env.development Executable file → Normal file
View File

View File

View File

View File

0
frontend/dashboard/.env.development Executable file → Normal file
View File

0
frontend/dashboard/public/fonts/CircularStd-Bold.otf Executable file → Normal file
View File

0
frontend/dashboard/public/fonts/CircularStd-Book.otf Executable file → Normal file
View File

0
frontend/dashboard/public/fonts/CircularStd-Medium.otf Executable file → Normal file
View File

View File

@@ -13,6 +13,7 @@ import { useParams, useSearchParams } from 'react-router-dom';
import axios from '../../../utils/axios';
import { LaravelPaginatedData } from '../../../@types/paginated-data';
import BasePagination from '../../../components/BasePagination';
import { enqueueSnackbar } from 'notistack';
export default function PlanList() {
const { themeStretch } = useSettings();
@@ -97,10 +98,10 @@ export default function PlanList() {
// alert('Succesfully read '+ response.data.total_successed_row + ' with ' + response.data.total_failed_row + ' failed rows');
})
.catch(response => {
alert('Looks like something went wrong. Please check your data and try again. ' + response.message)
enqueueSnackbar('Looks like something went wrong. Please check your data and try again. ' + response.message, { variant: 'error' })
})
} else {
alert('No File Selected')
enqueueSnackbar('No File Selected', { variant: 'warning' })
}
}

View File

@@ -14,6 +14,7 @@ import axios from '../../../utils/axios';
import { LaravelPaginatedData } from '../../../@types/paginated-data';
import { Icd } from '../../../@types/diagnosis';
import BasePagination from '../../../components/BasePagination';
import { enqueueSnackbar } from 'notistack';
export default function List() {
const { themeStretch } = useSettings();
@@ -97,10 +98,10 @@ export default function List() {
// alert('Succesfully read '+ response.data.total_successed_row + ' with ' + response.data.total_failed_row + ' failed rows');
})
.catch(response => {
alert('Looks like something went wrong. Please check your data and try again. ' + response.message)
enqueueSnackbar('Looks like something went wrong. Please check your data and try again. ' + response.message, { variant: 'error' })
})
} else {
alert('No File Selected')
enqueueSnackbar('No File Selected', { variant: 'warning' })
}
}

View File

@@ -133,7 +133,7 @@ export default function CorporateForm({ isEdit, currentCorporate }: Props) {
setCorporateGroups(res.data.corporate_groups)
})
.catch((err) => {
enqueueSnackbar("Opps, failed to get Corporate Group List", "error")
enqueueSnackbar("Opps, failed to get Corporate Group List", { variant: 'error' })
})
// eslint-disable-next-line react-hooks/exhaustive-deps
@@ -282,7 +282,9 @@ export default function CorporateForm({ isEdit, currentCorporate }: Props) {
{/* // TODO Use Autocomplete */}
{( values.type == 'subcorporate' && <RHFSelect name="parent_id" label="Parent Corporate Group" placeholder="Parent Corporate Group">
<option value="" />
{corporate_groups.map((option, index) => (
{corporate_groups
.filter((option) => option.value != values.id)
.map((option, index) => (
<option key={index} value={option.value}>
{option.label}
</option>

View File

@@ -365,6 +365,22 @@ export default function Corporates() {
</Grid>
</Grid>
</Grid>
<Typography sx={{ fontWeight: '600', mb: 1, mt: 2 }}>Sub Corporate</Typography>
<Grid container>
<Grid item xs={12}>
<Grid container>
<Grid item xs={6}>
Sub Corporates ({row.sub_corporates.length})
</Grid>
<Grid item xs={6}>
: {row.sub_corporates?.map((corp) => corp.name).join(', ')}
</Grid>
</Grid>
</Grid>
</Grid>
</Box>
</Collapse>
</TableCell>

View File

@@ -15,6 +15,7 @@ import { Plan } from '../../../@types/corporates';
import { LaravelPaginatedData } from '../../../@types/paginated-data';
import { Member } from '../../../@types/member';
import BasePagination from '../../../components/BasePagination';
import { enqueueSnackbar } from 'notistack';
export default function CorporatePlanList() {
const { themeStretch } = useSettings();
@@ -140,10 +141,10 @@ export default function CorporatePlanList() {
setImportResult(response.data)
})
.catch(response => {
alert('Looks like something went wrong. Please check your data and try again. ' + response.message)
enqueueSnackbar('Looks like something went wrong. Please check your data and try again. ' + response.message, { variant: 'error' })
})
} else {
alert('No File Selected')
enqueueSnackbar('No File Selected', { variant: 'warning' })
}
}

View File

@@ -14,6 +14,7 @@ import axios from '../../../utils/axios';
import { Plan } from '../../../@types/corporates';
import { LaravelPaginatedData } from '../../../@types/paginated-data';
import BasePagination from '../../../components/BasePagination';
import { enqueueSnackbar } from 'notistack';
export default function CorporatePlanList() {
const { themeStretch } = useSettings();
@@ -98,10 +99,10 @@ export default function CorporatePlanList() {
// alert('Succesfully read '+ response.data.total_successed_row + ' with ' + response.data.total_failed_row + ' failed rows');
})
.catch(response => {
alert('Looks like something went wrong. Please check your data and try again. ' + response.message)
enqueueSnackbar('Looks like something went wrong. Please check your data and try again. ' + response.message, { variant: 'error' })
})
} else {
alert('No File Selected')
enqueueSnackbar('No File Selected', { variant: 'warning' })
}
}

View File

@@ -14,6 +14,7 @@ import axios from '../../../utils/axios';
import { LaravelPaginatedData } from '../../../@types/paginated-data';
import { Icd } from '../../../@types/diagnosis';
import BasePagination from '../../../components/BasePagination';
import { enqueueSnackbar } from 'notistack';
export default function List() {
const { themeStretch } = useSettings();
@@ -97,10 +98,10 @@ export default function List() {
// alert('Succesfully read '+ response.data.total_successed_row + ' with ' + response.data.total_failed_row + ' failed rows');
})
.catch(response => {
alert('Looks like something went wrong. Please check your data and try again. ' + response.message)
enqueueSnackbar('Looks like something went wrong. Please check your data and try again. ' + response.message, { variant: 'error' })
})
} else {
alert('No File Selected')
enqueueSnackbar('No File Selected', { variant: 'warning' })
}
}

View File

@@ -97,10 +97,10 @@ export default function List() {
// alert('Succesfully read '+ response.data.total_successed_row + ' with ' + response.data.total_failed_row + ' failed rows');
})
.catch(response => {
alert('Looks like something went wrong. Please check your data and try again. ' + response.message)
enqueueSnackbar('Looks like something went wrong. Please check your data and try again. ' + response.message, { variant: 'error' })
})
} else {
alert('No File Selected')
enqueueSnackbar('No File Selected', { variant: 'warning' })
}
}

View File

@@ -98,10 +98,10 @@ export default function List() {
// alert('Succesfully read '+ response.data.total_successed_row + ' with ' + response.data.total_failed_row + ' failed rows');
})
.catch(response => {
alert('Looks like something went wrong. Please check your data and try again. ' + response.message)
enqueueSnackbar('Looks like something went wrong. Please check your data and try again. ' + response.message, { variant: 'error' })
})
} else {
alert('No File Selected')
enqueueSnackbar('No File Selected', { variant: 'warning' })
}
}

View File

@@ -71,7 +71,7 @@ export default function VerifyCodeForm() {
await new Promise((resolve) => setTimeout(resolve, 500));
console.log('code:', Object.values(data).join(''));
enqueueSnackbar('Verify success!');
enqueueSnackbar('Verify success!', { variant: 'success' });
navigate('/dashboard', { replace: true });
} catch (error) {