Merged in bug-fixing-11-jan-24 (pull request #19)
Bug fixing 11 jan 24 Approved-by: Tiago Ribeiro
This commit is contained in:
@@ -260,7 +260,7 @@ export default function AdminDashboard({user}: Props) {
|
|||||||
/>
|
/>
|
||||||
<IconCard
|
<IconCard
|
||||||
onClick={() => setPage("inactiveCorporate")}
|
onClick={() => setPage("inactiveCorporate")}
|
||||||
Icon={BsPerson}
|
Icon={BsBank}
|
||||||
label="Inactive Corporate"
|
label="Inactive Corporate"
|
||||||
value={
|
value={
|
||||||
users.filter((x) => x.type === "corporate" && (x.status === "disabled" || moment().isAfter(x.subscriptionExpirationDate)))
|
users.filter((x) => x.type === "corporate" && (x.status === "disabled" || moment().isAfter(x.subscriptionExpirationDate)))
|
||||||
|
|||||||
@@ -40,9 +40,9 @@ export default function AgentDashboard({user}: Props) {
|
|||||||
const inactiveReferredCorporateFilter = (x: User) =>
|
const inactiveReferredCorporateFilter = (x: User) =>
|
||||||
referredCorporateFilter(x) && (x.status === "disabled" || moment().isAfter(x.subscriptionExpirationDate));
|
referredCorporateFilter(x) && (x.status === "disabled" || moment().isAfter(x.subscriptionExpirationDate));
|
||||||
|
|
||||||
const UserDisplay = (displayUser: User) => (
|
const UserDisplay = ({ displayUser, allowClick = true }: {displayUser: User, allowClick?: boolean}) => (
|
||||||
<div
|
<div
|
||||||
onClick={() => setSelectedUser(displayUser)}
|
onClick={() => allowClick && setSelectedUser(displayUser)}
|
||||||
className="flex w-full p-4 gap-4 items-center hover:bg-mti-purple-ultralight cursor-pointer transition ease-in-out duration-300">
|
className="flex w-full p-4 gap-4 items-center hover:bg-mti-purple-ultralight cursor-pointer transition ease-in-out duration-300">
|
||||||
<img src={displayUser.profilePicture} alt={displayUser.name} className="rounded-full w-10 h-10" />
|
<img src={displayUser.profilePicture} alt={displayUser.name} className="rounded-full w-10 h-10" />
|
||||||
<div className="flex flex-col gap-1 items-start">
|
<div className="flex flex-col gap-1 items-start">
|
||||||
@@ -66,7 +66,7 @@ export default function AgentDashboard({user}: Props) {
|
|||||||
<BsArrowLeft className="text-xl" />
|
<BsArrowLeft className="text-xl" />
|
||||||
<span>Back</span>
|
<span>Back</span>
|
||||||
</div>
|
</div>
|
||||||
<h2 className="text-2xl font-semibold">Corporate ({users.filter(referredCorporateFilter).length})</h2>
|
<h2 className="text-2xl font-semibold">Referred Corporate ({users.filter(referredCorporateFilter).length})</h2>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<UserList user={user} filters={[referredCorporateFilter]} />
|
<UserList user={user} filters={[referredCorporateFilter]} />
|
||||||
@@ -84,7 +84,7 @@ export default function AgentDashboard({user}: Props) {
|
|||||||
<BsArrowLeft className="text-xl" />
|
<BsArrowLeft className="text-xl" />
|
||||||
<span>Back</span>
|
<span>Back</span>
|
||||||
</div>
|
</div>
|
||||||
<h2 className="text-2xl font-semibold">Inactive Corporate ({users.filter(inactiveReferredCorporateFilter).length})</h2>
|
<h2 className="text-2xl font-semibold">Inactive Referred Corporate ({users.filter(inactiveReferredCorporateFilter).length})</h2>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<UserList user={user} filters={[inactiveReferredCorporateFilter]} />
|
<UserList user={user} filters={[inactiveReferredCorporateFilter]} />
|
||||||
@@ -117,15 +117,15 @@ export default function AgentDashboard({user}: Props) {
|
|||||||
<section className="flex flex-wrap gap-2 items-center -lg:justify-center lg:gap-4 text-center">
|
<section className="flex flex-wrap gap-2 items-center -lg:justify-center lg:gap-4 text-center">
|
||||||
<IconCard
|
<IconCard
|
||||||
onClick={() => setPage("referredCorporate")}
|
onClick={() => setPage("referredCorporate")}
|
||||||
Icon={BsPersonFill}
|
Icon={BsBank}
|
||||||
label="Corporate"
|
label="Referred Corporate"
|
||||||
value={users.filter(referredCorporateFilter).length}
|
value={users.filter(referredCorporateFilter).length}
|
||||||
color="purple"
|
color="purple"
|
||||||
/>
|
/>
|
||||||
<IconCard
|
<IconCard
|
||||||
onClick={() => setPage("inactiveReferredCorporate")}
|
onClick={() => setPage("inactiveReferredCorporate")}
|
||||||
Icon={BsPersonFill}
|
Icon={BsBank}
|
||||||
label="Inactive Corporate"
|
label="Inactive Referred Corporate"
|
||||||
value={users.filter(inactiveReferredCorporateFilter).length}
|
value={users.filter(inactiveReferredCorporateFilter).length}
|
||||||
color="rose"
|
color="rose"
|
||||||
/>
|
/>
|
||||||
@@ -140,13 +140,13 @@ export default function AgentDashboard({user}: Props) {
|
|||||||
|
|
||||||
<section className="grid grid-cols-1 md:grid-cols-2 gap-4 w-full justify-between">
|
<section className="grid grid-cols-1 md:grid-cols-2 gap-4 w-full justify-between">
|
||||||
<div className="bg-white shadow flex flex-col rounded-xl w-full">
|
<div className="bg-white shadow flex flex-col rounded-xl w-full">
|
||||||
<span className="p-4">Latest Corporate</span>
|
<span className="p-4">Latest Referred Corporate</span>
|
||||||
<div className="flex flex-col items-start h-96 overflow-scroll scrollbar-hide">
|
<div className="flex flex-col items-start h-96 overflow-scroll scrollbar-hide">
|
||||||
{users
|
{users
|
||||||
.filter(referredCorporateFilter)
|
.filter(referredCorporateFilter)
|
||||||
.sort((a, b) => dateSorter(a, b, "desc", "registrationDate"))
|
.sort((a, b) => dateSorter(a, b, "desc", "registrationDate"))
|
||||||
.map((x) => (
|
.map((x) => (
|
||||||
<UserDisplay key={x.id} {...x} />
|
<UserDisplay key={x.id} displayUser={x} />
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -157,12 +157,12 @@ export default function AgentDashboard({user}: Props) {
|
|||||||
.filter(corporateFilter)
|
.filter(corporateFilter)
|
||||||
.sort((a, b) => dateSorter(a, b, "desc", "registrationDate"))
|
.sort((a, b) => dateSorter(a, b, "desc", "registrationDate"))
|
||||||
.map((x) => (
|
.map((x) => (
|
||||||
<UserDisplay key={x.id} {...x} />
|
<UserDisplay key={x.id} displayUser={x} allowClick={false} />
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="bg-white shadow flex flex-col rounded-xl w-full">
|
<div className="bg-white shadow flex flex-col rounded-xl w-full">
|
||||||
<span className="p-4">Corporate expiring in 1 month</span>
|
<span className="p-4">Referenced corporate expiring in 1 month</span>
|
||||||
<div className="flex flex-col items-start h-96 overflow-scroll scrollbar-hide">
|
<div className="flex flex-col items-start h-96 overflow-scroll scrollbar-hide">
|
||||||
{users
|
{users
|
||||||
.filter(
|
.filter(
|
||||||
@@ -172,7 +172,7 @@ export default function AgentDashboard({user}: Props) {
|
|||||||
moment().isBefore(moment(x.subscriptionExpirationDate)),
|
moment().isBefore(moment(x.subscriptionExpirationDate)),
|
||||||
)
|
)
|
||||||
.map((x) => (
|
.map((x) => (
|
||||||
<UserDisplay key={x.id} {...x} />
|
<UserDisplay key={x.id} displayUser={x} />
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -103,13 +103,13 @@ const GroupTestReport = ({
|
|||||||
{title}
|
{title}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
<View style={styles.textPadding}>
|
<View style={styles.textMargin}>
|
||||||
<Text style={defaultTextStyle}>Date of Test: {date}</Text>
|
<Text style={defaultTextStyle}>Date of Test: {date}</Text>
|
||||||
</View>
|
</View>
|
||||||
<Text style={[styles.textFont, styles.textBold, { fontSize: 11 }]}>
|
<Text style={[styles.textFont, styles.textBold, { fontSize: 11 }]}>
|
||||||
Candidate Information:
|
Candidate Information:
|
||||||
</Text>
|
</Text>
|
||||||
<View style={styles.textPadding}>
|
<View style={styles.textMargin}>
|
||||||
<Text style={defaultTextStyle}>Name: {name}</Text>
|
<Text style={defaultTextStyle}>Name: {name}</Text>
|
||||||
<Text style={defaultTextStyle}>ID: {id}</Text>
|
<Text style={defaultTextStyle}>ID: {id}</Text>
|
||||||
<Text style={defaultTextStyle}>Email: {email}</Text>
|
<Text style={defaultTextStyle}>Email: {email}</Text>
|
||||||
@@ -193,10 +193,8 @@ const GroupTestReport = ({
|
|||||||
]}
|
]}
|
||||||
key={label}
|
key={label}
|
||||||
>
|
>
|
||||||
<Text style={customStyles.tableCell}>
|
<Text style={customStyles.tableCell}>{label}</Text>
|
||||||
{label}
|
<View style={[customStyles.tableCell, { flex: 2 }]}>
|
||||||
</Text>
|
|
||||||
<View style={[customStyles.tableCell, { flex: 2}]}>
|
|
||||||
<ProgressBar
|
<ProgressBar
|
||||||
width={200}
|
width={200}
|
||||||
height={18}
|
height={18}
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ export const styles = StyleSheet.create({
|
|||||||
title: {
|
title: {
|
||||||
textTransform: "uppercase",
|
textTransform: "uppercase",
|
||||||
},
|
},
|
||||||
textPadding: {
|
textMargin: {
|
||||||
margin: "8px",
|
marginVertical: "8px",
|
||||||
},
|
},
|
||||||
separator: {
|
separator: {
|
||||||
width: "100%",
|
width: "100%",
|
||||||
|
|||||||
@@ -3,15 +3,20 @@ import { styles } from "./styles";
|
|||||||
import { View, Text } from "@react-pdf/renderer";
|
import { View, Text } from "@react-pdf/renderer";
|
||||||
|
|
||||||
const TestReportFooter = () => (
|
const TestReportFooter = () => (
|
||||||
<View style={[{ paddingTop: 30, fontSize: 5, position: 'absolute', bottom: 30, left: 35, right: 35 }, styles.textFont,]}>
|
<View
|
||||||
<View
|
style={[
|
||||||
style={[
|
{
|
||||||
styles.spacedRow,
|
paddingTop: 30,
|
||||||
{
|
fontSize: 5,
|
||||||
paddingHorizontal: 10,
|
position: "absolute",
|
||||||
},
|
bottom: 30,
|
||||||
]}
|
left: 35,
|
||||||
>
|
right: 35,
|
||||||
|
},
|
||||||
|
styles.textFont,
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<View style={[styles.spacedRow, styles.textMargin]}>
|
||||||
<View>
|
<View>
|
||||||
<Text>Validity</Text>
|
<Text>Validity</Text>
|
||||||
<Text>
|
<Text>
|
||||||
@@ -52,4 +57,4 @@ const TestReportFooter = () => (
|
|||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
|
|
||||||
export default TestReportFooter;
|
export default TestReportFooter;
|
||||||
|
|||||||
@@ -68,19 +68,19 @@ const TestReport = ({
|
|||||||
{title}
|
{title}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
<View style={styles.textPadding}>
|
<View style={styles.textMargin}>
|
||||||
<Text style={defaultTextStyle}>Date of Test: {date}</Text>
|
<Text style={defaultTextStyle}>Date of Test: {date}</Text>
|
||||||
</View>
|
</View>
|
||||||
<Text style={[styles.textFont, styles.textBold, { fontSize: 11 }]}>
|
<Text style={[styles.textFont, styles.textBold, { fontSize: 11 }]}>
|
||||||
Candidate Information:
|
Candidate Information:
|
||||||
</Text>
|
</Text>
|
||||||
<View style={styles.textPadding}>
|
<View style={styles.textMargin}>
|
||||||
<Text style={defaultTextStyle}>Name: {name}</Text>
|
<Text style={defaultTextStyle}>Name: {name}</Text>
|
||||||
<Text style={defaultTextStyle}>ID: {id}</Text>
|
<Text style={defaultTextStyle}>ID: {id}</Text>
|
||||||
<Text style={defaultTextStyle}>Email: {email}</Text>
|
<Text style={defaultTextStyle}>Email: {email}</Text>
|
||||||
<Text style={defaultTextStyle}>Gender: {gender}</Text>
|
<Text style={defaultTextStyle}>Gender: {gender}</Text>
|
||||||
</View>
|
</View>
|
||||||
<View style={{ height: '120px' }}>
|
<View style={{ height: "120px" }}>
|
||||||
<Text
|
<Text
|
||||||
style={[
|
style={[
|
||||||
styles.textFont,
|
styles.textFont,
|
||||||
@@ -131,7 +131,9 @@ const TestReport = ({
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{testDetails
|
{testDetails
|
||||||
.filter(({ suggestions, evaluation }) => suggestions || evaluation)
|
.filter(
|
||||||
|
({ suggestions, evaluation }) => suggestions || evaluation
|
||||||
|
)
|
||||||
.map(({ module, suggestions, evaluation }) => (
|
.map(({ module, suggestions, evaluation }) => (
|
||||||
<View key={module} style={customStyles.testDetails}>
|
<View key={module} style={customStyles.testDetails}>
|
||||||
<Text style={[...defaultSkillsTitleStyle, styles.textBold]}>
|
<Text style={[...defaultSkillsTitleStyle, styles.textBold]}>
|
||||||
@@ -139,15 +141,11 @@ const TestReport = ({
|
|||||||
</Text>
|
</Text>
|
||||||
<Text style={defaultSkillsTextStyle}>{evaluation}</Text>
|
<Text style={defaultSkillsTextStyle}>{evaluation}</Text>
|
||||||
<Text style={defaultSkillsTextStyle}>{suggestions}</Text>
|
<Text style={defaultSkillsTextStyle}>{suggestions}</Text>
|
||||||
|
|
||||||
</View>
|
</View>
|
||||||
))}
|
))}
|
||||||
</View>
|
</View>
|
||||||
<View style={styles.alignRightRow}>
|
<View style={styles.alignRightRow}>
|
||||||
<Image
|
<Image src={qrcode} style={styles.qrcode} />
|
||||||
src={qrcode}
|
|
||||||
style={styles.qrcode}
|
|
||||||
/>
|
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View style={[{ paddingBottom: 30 }, styles.separator]}></View>
|
<View style={[{ paddingBottom: 30 }, styles.separator]}></View>
|
||||||
|
|||||||
Reference in New Issue
Block a user