Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions services/common/src/components/project/EmaApplicationsTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { USER_ROLES } from "@mds/common/constants/environment";
import CheckCircleOutlined from "@ant-design/icons/CheckCircleOutlined";
import { COLOR } from "@mds/common/constants/styles";
const { Paragraph } = Typography;
import { ProjectLeadContactType } from "@mds/common/interfaces";

const EmaApplicationsTab = () => {
const dispatch = useAppDispatch();
Expand All @@ -46,14 +47,22 @@ const EmaApplicationsTab = () => {
const hasMinesActApp = authorizations?.some(auth => auth.project_summary_authorization_type === "MINES_ACT_PERMIT");
const canEditMajorMineApplications = useAppSelector(userHasRole(USER_ROLES.role_edit_major_mine_applications));
const [editToggleLoading, setEditToggleLoading] = useState(false);
const project_lead_contact: ProjectLeadContactType[] = [];
const matches =
projectLeads?.filter((lead) =>
lead.party_guid.includes(project.project_lead_party_guid)
) ?? [];

const project_lead_contact =
projectLeads?.filter((lead) => lead.party_guid.includes(project.project_lead_party_guid)) ?? [];

if (project_lead_contact?.length > 0) {
project_lead_contact[0].is_project_lead_contact = true;
if (matches?.length > 0) {
project_lead_contact.push({
...matches[0],
is_project_lead_contact: true
});
} else {
project_lead_contact.push({ is_project_lead_contact: true, project_contact_guid: "n/a" });
project_lead_contact.push({
is_project_lead_contact: true,
project_contact_guid: "n/a"
});
}

const contactsAndProjectLead = [...project.contacts, project_lead_contact[0]];
Expand Down
3 changes: 2 additions & 1 deletion services/common/src/components/projects/ProjectContacts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ const ProjectContacts: FC<ProjectContactsProps> = ({ title, contacts }) => {
const isPrimary = c.is_primary;
const hasJobTitle = c.job_title;
const isProjectLeadContact = c.is_project_lead_contact;
const name = [c?.first_name, c?.last_name].join(" ").trim();
const lastName = c?.last_name ?? c?.party_name;
const name = [c?.first_name, lastName].join(" ").trim();
let jobTitle = ministryContactTypesHash[c.emli_contact_type_code];
const phone = c.phone_no ?? c.phone_number;

Expand Down
23 changes: 16 additions & 7 deletions services/common/src/components/projects/ProjectOverviewTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { getMinistryContactsByRegion } from "@mds/common/redux/slices/minespaceS
import { getPermits } from "@mds/common/redux/selectors/permitSelectors";
import { fetchPermits } from "@mds/common/redux/actionCreators/permitActionCreator";
import { formatDate } from "@mds/common/redux/utils/helpers";
import { IProjectSummaryAuthorization } from "@mds/common/interfaces";
import { IProjectSummaryAuthorization, ProjectLeadContactType } from "@mds/common/interfaces";

const SectionHeader = ({ children, titleText, isLast = false }) => {
return <Collapse
Expand Down Expand Up @@ -169,13 +169,22 @@ const ProjectOverviewTab: FC = () => {
}
});

const project_lead_contact =
projectLeads?.filter((lead) => lead.party_guid.includes(project.project_lead_party_guid)) ?? [];

if (project_lead_contact?.length > 0) {
project_lead_contact[0].is_project_lead_contact = true;
const project_lead_contact: ProjectLeadContactType[] = [];
const matches =
projectLeads?.filter((lead) =>
lead.party_guid.includes(project.project_lead_party_guid)
) ?? [];

if (matches?.length > 0) {
project_lead_contact.push({
...matches[0],
is_project_lead_contact: true
});
} else {
project_lead_contact.push({ is_project_lead_contact: true, project_contact_guid: "n/a" });
project_lead_contact.push({
is_project_lead_contact: true,
project_contact_guid: "n/a"
});
}

const contactsAndProjectLead = [...project.contacts, project_lead_contact[0]];
Expand Down
1 change: 1 addition & 0 deletions services/common/src/interfaces/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export * from "./noticeOfDeparture";
export * from "./mine.interface";
export * from "./acceptedFileTypes.type";
export * from "./projectLeadContactType.type";
export * from "./mineAlert.interface";
export * from "./mineAlertCreate.interface";
export * from "./mineComment.interface";
Expand Down
2 changes: 2 additions & 0 deletions services/common/src/interfaces/party/party.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,6 @@ export interface IParty {
phone_ter_ext?: string;
postnominal_letters?: string;
signature?: string;
is_project_lead_contact?: boolean;
project_contact_guid?: string;
}
8 changes: 8 additions & 0 deletions services/common/src/interfaces/projectLeadContactType.type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { IParty } from "@mds/common/interfaces";

export type ProjectLeadContactType =
| (IParty & { is_project_lead_contact: boolean })
| {
project_contact_guid: string;
is_project_lead_contact: boolean;
};
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ export interface IContact {
first_name: string;
last_name: string;
address?: IPartyAddress;
party_name?: string;
}
16 changes: 3 additions & 13 deletions services/minespace-web/src/components/pages/LandingPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,9 @@ export const LandingPage: FC = () => {
<Col {...colSpans}>
<Typography.Title level={4}>How do I get access?</Typography.Title>
<Typography.Paragraph>
You must have a <Typography.Text strong>Business BCeID</Typography.Text> and
then&nbsp;
{newSignupEnabled ? (
<>
click the <b>Join MineSpace</b> button to complete the sign-up process.
</>
) : (
<>
contact us at&nbsp;
<a href={`mailto:${Strings.MDS_EMAIL}`}>{Strings.MDS_EMAIL}</a> to request
access to MineSpace.
</>
)}
You must have a <Typography.Text strong>Business BCeID</Typography.Text> and request
access to MineSpace using the{" "}
<Typography.Text strong>Join MineSpace</Typography.Text> online request form.
</Typography.Paragraph>
<Typography.Paragraph strong>
If you have multiple employees who need to use MineSpace:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,16 @@ exports[`LandingPage renders properly 1`] = `
Business BCeID
</strong>
</span>
and then 
click the
<b>
Join MineSpace
</b>
button to complete the sign-up process.
and request access to MineSpace using the

<span
class="ant-typography"
>
<strong>
Join MineSpace
</strong>
</span>
online request form.
</div>
<div
class="ant-typography"
Expand Down
Loading