From ea0ad5efe74f98bcd10cee60870bb1c685bb1fa8 Mon Sep 17 00:00:00 2001
From: Sinn
Date: Wed, 4 Dec 2024 17:41:03 -0800
Subject: [PATCH 1/6] adjustments around Assigned status
---
.../projectSummary/AuthorizationsInvolved.tsx | 2 +-
.../projectSummary/ProjectManagement.tsx | 12 ++++++++++--
.../projectSummary/ProjectSummaryForm.tsx | 6 +++---
.../ProjectManagement.spec.tsx.snap | 4 ++--
.../components/projects/projectUtils.spec.ts | 12 ++++++------
.../src/components/projects/projectUtils.ts | 17 ++++++-----------
.../projects/projectSummary.interface.ts | 1 +
.../project_summary/models/project_summary.py | 6 +++---
.../resources/project_summary.py | 14 ++++++++------
.../components/mine/Projects/ProjectSummary.tsx | 10 +++-------
10 files changed, 43 insertions(+), 41 deletions(-)
diff --git a/services/common/src/components/projectSummary/AuthorizationsInvolved.tsx b/services/common/src/components/projectSummary/AuthorizationsInvolved.tsx
index 39374585cf..422b8eee56 100644
--- a/services/common/src/components/projectSummary/AuthorizationsInvolved.tsx
+++ b/services/common/src/components/projectSummary/AuthorizationsInvolved.tsx
@@ -571,7 +571,7 @@ export const AuthorizationsInvolved: FC = ({ f
const systemFlag = useSelector(getSystemFlag);
const isCore = systemFlag === SystemFlagEnum.core;
- const envFieldsDisabled = areAuthEnvFieldsDisabled(systemFlag, formValues?.status_code);
+ const envFieldsDisabled = areAuthEnvFieldsDisabled(systemFlag, formValues?.status_code, formValues?.confirmation_of_submission);
const handleChange = (e, code) => {
if (e.target.checked) {
diff --git a/services/common/src/components/projectSummary/ProjectManagement.tsx b/services/common/src/components/projectSummary/ProjectManagement.tsx
index 8da41ccf47..2e4f3229c3 100644
--- a/services/common/src/components/projectSummary/ProjectManagement.tsx
+++ b/services/common/src/components/projectSummary/ProjectManagement.tsx
@@ -107,10 +107,18 @@ export const ProjectManagement: FC = () => {
component={RenderSelect}
data={projectLeadData}
/>
+ {isProjectLeadAssigned && (
+
+ Warning: Unassigning the project lead will set the Project Description status to
+ 'Submitted' in MineSpace. Ensure the status is correct before proceeding.
+
+ )}
{!isNewProject && !isProjectLeadAssigned && (
Please assign a Project Lead to this project.
}
+ message="Assign a Project Lead"
+ description={Assigning a Project Lead will set the Project Description status
+ to 'Assigned' in Core and 'Submitted' in MineSpace. Please ensure the project
+ is set at the correct status before continuing.
}
type="warning"
showIcon
/>
diff --git a/services/common/src/components/projectSummary/ProjectSummaryForm.tsx b/services/common/src/components/projectSummary/ProjectSummaryForm.tsx
index 18d16bff86..b3914d75b7 100644
--- a/services/common/src/components/projectSummary/ProjectSummaryForm.tsx
+++ b/services/common/src/components/projectSummary/ProjectSummaryForm.tsx
@@ -99,11 +99,11 @@ export const ProjectSummaryForm: FC = ({
getProjectSummaryAuthorizationTypesArray
);
const formValues = useSelector(getFormValues(FORM.ADD_EDIT_PROJECT_SUMMARY)) as IProjectSummaryForm;
- const { status_code } = formValues ?? {};
+ const { status_code, confirmation_of_submission } = formValues ?? {};
- const fieldsDisabled = areFieldsDisabled(systemFlag, status_code);
+ const fieldsDisabled = areFieldsDisabled(systemFlag, status_code, confirmation_of_submission);
const docFieldsDisabled = areDocumentFieldsDisabled(systemFlag, status_code);
- const authFieldsDisabled = areAuthFieldsDisabled(systemFlag, status_code);
+ const authFieldsDisabled = areAuthFieldsDisabled(systemFlag, status_code, confirmation_of_submission);
const handleTransformPayload = (valuesFromForm: any) => {
return formatProjectPayload(valuesFromForm, { projectSummaryAuthorizationTypesArray });
diff --git a/services/common/src/components/projectSummary/__snapshots__/ProjectManagement.spec.tsx.snap b/services/common/src/components/projectSummary/__snapshots__/ProjectManagement.spec.tsx.snap
index 4d3d3fee0d..5d8eb78cb2 100644
--- a/services/common/src/components/projectSummary/__snapshots__/ProjectManagement.spec.tsx.snap
+++ b/services/common/src/components/projectSummary/__snapshots__/ProjectManagement.spec.tsx.snap
@@ -360,13 +360,13 @@ exports[`Project Management renders properly 1`] = `
- This project does not have a Project Lead
+ Assign a Project Lead
- Please assign a Project Lead to this project.
+ Assigning a Project Lead will set the Project Description status to 'Assigned' in Core and 'Submitted' in MineSpace. Please ensure the project is set at the correct status before continuing.
diff --git a/services/common/src/components/projects/projectUtils.spec.ts b/services/common/src/components/projects/projectUtils.spec.ts
index f37cf954d5..43839a4657 100644
--- a/services/common/src/components/projects/projectUtils.spec.ts
+++ b/services/common/src/components/projects/projectUtils.spec.ts
@@ -9,8 +9,8 @@ const TEST_PARAMETERS = [
testFunction: areFieldsDisabled,
coreDisabledStatuses: ["WDN", "COM"],
coreEnabledStatuses: ["DFT", "SUB", "ASG", "UNR", "CHR", "OHD"],
- msDisabledStatuses: ["SUB", "ASG", "UNR", "WDN", "OHD", "COM"],
- msEnabledStatuses: ["DFT", "CHR"],
+ msDisabledStatuses: ["SUB", "UNR", "WDN", "OHD", "COM"],
+ msEnabledStatuses: ["DFT", "CHR", "ASG"],
},
{
label: "areDocumentFieldsDisabled",
@@ -25,16 +25,16 @@ const TEST_PARAMETERS = [
testFunction: areAuthFieldsDisabled,
coreDisabledStatuses: ["WDN", "COM", "CHR", "UNR"],
coreEnabledStatuses: ["DFT", "SUB", "ASG", "OHD"],
- msDisabledStatuses: ["UNR", "WDN", "OHD", "COM", "SUB", "ASG", "CHR"],
- msEnabledStatuses: ["DFT"],
+ msDisabledStatuses: ["UNR", "WDN", "OHD", "COM", "SUB", "CHR"],
+ msEnabledStatuses: ["DFT", "ASG"],
},
{
label: "areAuthEnvFieldsDisabled",
testFunction: areAuthEnvFieldsDisabled,
coreDisabledStatuses: ["WDN", "COM", "ASG", "UNR", "CHR", "OHD", "SUB"],
coreEnabledStatuses: ["DFT"],
- msDisabledStatuses: ["UNR", "WDN", "OHD", "COM", "SUB", "ASG", "CHR"],
- msEnabledStatuses: ["DFT"],
+ msDisabledStatuses: ["UNR", "WDN", "OHD", "COM", "SUB", "CHR"],
+ msEnabledStatuses: ["DFT", "ASG"],
}
];
diff --git a/services/common/src/components/projects/projectUtils.ts b/services/common/src/components/projects/projectUtils.ts
index 4f0d47ac3c..d40af6ab12 100644
--- a/services/common/src/components/projects/projectUtils.ts
+++ b/services/common/src/components/projects/projectUtils.ts
@@ -1,27 +1,23 @@
import { PROJECT_STATUS_CODES, SystemFlagEnum } from "@mds/common/constants/enums";
import { memoize } from "lodash";
-export const areFieldsDisabled = memoize((systemFlag: SystemFlagEnum, projectSummaryStatusCode: string) => {
+export const areFieldsDisabled = memoize((systemFlag: SystemFlagEnum, projectSummaryStatusCode: string, confirmationOfSubmission?: boolean) => {
// Return false (enabled) if status = "" => "Not Started"
const isStatusInEnum = (Object).values(PROJECT_STATUS_CODES).includes(projectSummaryStatusCode);
-
if (!isStatusInEnum) return false;
const projectSummaryStatus = projectSummaryStatusCode as PROJECT_STATUS_CODES;
-
const disabledStatuses = [PROJECT_STATUS_CODES.WDN, PROJECT_STATUS_CODES.COM];
-
const enabledStatuses = systemFlag === SystemFlagEnum.core
? [PROJECT_STATUS_CODES.DFT, PROJECT_STATUS_CODES.ASG, PROJECT_STATUS_CODES.UNR, PROJECT_STATUS_CODES.CHR, PROJECT_STATUS_CODES.OHD, PROJECT_STATUS_CODES.SUB]
- : [PROJECT_STATUS_CODES.DFT, PROJECT_STATUS_CODES.CHR];
+ : [PROJECT_STATUS_CODES.DFT, PROJECT_STATUS_CODES.CHR, ...(!confirmationOfSubmission ? [PROJECT_STATUS_CODES.ASG] : [])];
if (disabledStatuses.includes(projectSummaryStatus)) return true;
return !enabledStatuses.includes(projectSummaryStatus);
-
},
(systemFlag: SystemFlagEnum, projectSummaryStatusCode: string) => `${systemFlag}_${projectSummaryStatusCode}`);
-export const areAuthFieldsDisabled = memoize((systemFlag: SystemFlagEnum, projectSummaryStatusCode: string) => {
- const fieldsDisabled = areFieldsDisabled(systemFlag, projectSummaryStatusCode);
+export const areAuthFieldsDisabled = memoize((systemFlag: SystemFlagEnum, projectSummaryStatusCode: string, confirmationOfSubmission?: boolean) => {
+ const fieldsDisabled = areFieldsDisabled(systemFlag, projectSummaryStatusCode, confirmationOfSubmission);
if (fieldsDisabled) return true;
const extraDisabledStatuses = [PROJECT_STATUS_CODES.CHR, PROJECT_STATUS_CODES.UNR];
@@ -29,8 +25,8 @@ export const areAuthFieldsDisabled = memoize((systemFlag: SystemFlagEnum, projec
return authDisabled;
}, (systemFlag: SystemFlagEnum, projectSummaryStatusCode: string) => `${systemFlag}_${projectSummaryStatusCode}`);
-export const areAuthEnvFieldsDisabled = memoize((systemFlag, projectSummaryStatusCode) => {
- const authFieldsDisabled = areAuthFieldsDisabled(systemFlag, projectSummaryStatusCode);
+export const areAuthEnvFieldsDisabled = memoize((systemFlag: SystemFlagEnum, projectSummaryStatusCode: string, confirmationOfSubmission?: boolean) => {
+ const authFieldsDisabled = areAuthFieldsDisabled(systemFlag, projectSummaryStatusCode, confirmationOfSubmission);
if (authFieldsDisabled) return true;
const extraDisabledStatuses = systemFlag === SystemFlagEnum.core
@@ -56,7 +52,6 @@ export const areDocumentFieldsDisabled = memoize((systemFlag: SystemFlagEnum, pr
if (disabledStatuses.includes(projectSummaryStatus)) return true;
return !enabledStatuses.includes(projectSummaryStatus);
-
},
(systemFlag: SystemFlagEnum, projectSummaryStatusCode: string) => `${systemFlag}_${projectSummaryStatusCode}`);
diff --git a/services/common/src/interfaces/projects/projectSummary.interface.ts b/services/common/src/interfaces/projects/projectSummary.interface.ts
index fb3bd5693a..1dbbeef19b 100644
--- a/services/common/src/interfaces/projects/projectSummary.interface.ts
+++ b/services/common/src/interfaces/projects/projectSummary.interface.ts
@@ -64,4 +64,5 @@ export interface IProjectSummaryForm extends Omit None:
'COM': [PERM_RECL_EMAIL, project_lead_email]
}
- send_ms_email = self.status_code != "DFT"
+ send_ms_email = self.status_code != "DFT" and self.status_code != "ASG"
emli_recipients = emli_emails.get(self.status_code)
cc = [MDS_EMAIL]
diff --git a/services/core-api/app/api/projects/project_summary/resources/project_summary.py b/services/core-api/app/api/projects/project_summary/resources/project_summary.py
index 61840870c4..3b641055a0 100644
--- a/services/core-api/app/api/projects/project_summary/resources/project_summary.py
+++ b/services/core-api/app/api/projects/project_summary/resources/project_summary.py
@@ -18,6 +18,7 @@
from app.api.activity.utils import trigger_notification
from app.api.projects.project.project_util import notify_file_updates
from decimal import Decimal
+from app.api.activity.models.activity_notification import ActivityRecipients
PAGE_DEFAULT = 1
PER_PAGE_DEFAULT = 25
@@ -206,7 +207,7 @@ def put(self, project_guid, project_summary_guid):
project = Project.find_by_project_guid(project_guid)
data = self.parser.parse_args()
is_historic = data.get('is_historic')
-
+ activity_recipients = ActivityRecipients.all_users
project_summary_validation = project_summary.validate_project_summary(data, is_historic)
if any(project_summary_validation[i] != [] for i in project_summary_validation):
current_app.logger.error(f'Project Summary schema validation failed with errors: {project_summary_validation}')
@@ -279,6 +280,7 @@ def put(self, project_guid, project_summary_guid):
if project_summary.status_code == 'ASG':
message = f'{project.project_title} for {project.mine_name} has been assigned'
+ activity_recipients = ActivityRecipients.core_users
if project_summary.status_code == 'CHR':
message = f'Changes have been requested by the ministry for {project.project_title} at {project.mine_name}'
@@ -294,12 +296,12 @@ def put(self, project_guid, project_summary_guid):
if project_summary.status_code == 'COM':
message = f'The status of the project description {project.project_title} for {project.mine_name} has been completed'
-
- project_summary.send_project_summary_email(mine, message)
- trigger_notification(message, ActivityType.major_mine_desc_submitted, project.mine, 'ProjectSummary',
- project_summary.project_summary_guid, extra_data)
-
+ if message != '':
+ project_summary.send_project_summary_email(mine, message)
+ trigger_notification(message, ActivityType.major_mine_desc_submitted, project.mine, 'ProjectSummary',
+ project_summary.project_summary_guid, extra_data, None, activity_recipients)
+
# notify on document updates
if has_new_documents:
notify_file_updates(project, mine, project_summary.status_code)
diff --git a/services/core-web/src/components/mine/Projects/ProjectSummary.tsx b/services/core-web/src/components/mine/Projects/ProjectSummary.tsx
index 0b549bca97..887711a2d6 100644
--- a/services/core-web/src/components/mine/Projects/ProjectSummary.tsx
+++ b/services/core-web/src/components/mine/Projects/ProjectSummary.tsx
@@ -215,19 +215,15 @@ export const ProjectSummary: FC = () => {
if (!status_code || isNewProject) {
status_code = "DFT";
- } else if (!newActiveTab) {
- if (isCore) {
- status_code = formValues.status_code;
- } else {
- status_code = "SUB";
- }
+ } else if (!newActiveTab && status_code === "DFT") {
+ status_code = "SUB";
is_historic = false;
if (amsFeatureEnabled) {
message = null;
}
}
- if (isCore && !isNewProject) {
+ if (!isNewProject && newActiveTab) {
status_code = formValues.status_code;
}
From 3dff330fa423c762a40af3fdc943b383e1922773 Mon Sep 17 00:00:00 2001
From: Sinn
Date: Thu, 5 Dec 2024 09:47:02 -0800
Subject: [PATCH 2/6] update tests
---
.../resources/test_project_summary_emails.py | 13 +------------
.../resources/test_project_summary_resource.py | 2 +-
2 files changed, 2 insertions(+), 13 deletions(-)
diff --git a/services/core-api/tests/projects/project_summaries/resources/test_project_summary_emails.py b/services/core-api/tests/projects/project_summaries/resources/test_project_summary_emails.py
index bb1271c200..187e708d77 100644
--- a/services/core-api/tests/projects/project_summaries/resources/test_project_summary_emails.py
+++ b/services/core-api/tests/projects/project_summaries/resources/test_project_summary_emails.py
@@ -40,21 +40,10 @@ def test_sub_to_asg(mock_send_template_email, test_client, db_session, auth_head
"message": f'{updated_project_summary_title} for {project_summary.project.mine_name} has been assigned',
"core_project_summary_link": f'{Config.CORE_WEB_URL}/pre-applications/{project_summary.project.project_guid}/overview'
}
-
- minespace_context = {
- "mine": {
- "mine_name": project_summary.mine_name,
- "mine_no": project_summary.project.mine_no,
- },
- "message": f'{updated_project_summary_title} for {project_summary.project.mine_name} has been assigned',
- "minespace_project_summary_link": f'{Config.MINESPACE_PROD_URL}/projects/{project_summary.project.project_guid}/overview',
- "ema_auth_link": f'{Config.EMA_AUTH_LINK}',
- }
# ARGS: subject, recipients, body, context, cc (ignore comparison with ANY)
emli_call = call(f'Project Description Notification for {project_summary.mine_name}', ANY, ANY, emli_context, cc=[MDS_EMAIL])
- ms_call = call(f'Project Description Notification for {project_summary.mine_name}', ANY, ANY, minespace_context, cc=[MDS_EMAIL])
assert put_resp.status_code == 200
- calls = [emli_call, ms_call]
+ calls = [emli_call]
mock_send_template_email.assert_has_calls(calls, True)
\ No newline at end of file
diff --git a/services/core-api/tests/projects/project_summaries/resources/test_project_summary_resource.py b/services/core-api/tests/projects/project_summaries/resources/test_project_summary_resource.py
index 66511a3f71..67ae51568c 100644
--- a/services/core-api/tests/projects/project_summaries/resources/test_project_summary_resource.py
+++ b/services/core-api/tests/projects/project_summaries/resources/test_project_summary_resource.py
@@ -78,7 +78,7 @@ def test_update_project_summary_assign_project_lead(test_client, db_session, aut
data['mine_guid'] = project_summary.project.mine_guid
data['project_summary_title'] = project_summary.project_summary_title
data['project_summary_description'] = project_summary.project_summary_description
- data['status_code'] = 'DFT'
+ data['status_code'] = 'SUB'
data['confirmation_of_submission'] = True
data['project_lead_party_guid'] = party.party_guid
data['is_historic'] = False
From 6a658cb0a6ee7a58b960eb29109df42fb8635d03 Mon Sep 17 00:00:00 2001
From: Sinn
Date: Thu, 5 Dec 2024 10:58:25 -0800
Subject: [PATCH 3/6] attempting to fix test error
---
.../resources/test_project_summary_resource.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/services/core-api/tests/projects/project_summaries/resources/test_project_summary_resource.py b/services/core-api/tests/projects/project_summaries/resources/test_project_summary_resource.py
index 67ae51568c..c2aa2af272 100644
--- a/services/core-api/tests/projects/project_summaries/resources/test_project_summary_resource.py
+++ b/services/core-api/tests/projects/project_summaries/resources/test_project_summary_resource.py
@@ -67,7 +67,7 @@ def test_delete_project_summary_bad_status_code(test_client, db_session, auth_he
def test_update_project_summary_assign_project_lead(test_client, db_session, auth_headers):
'''Assigning a project lead will change status code to ASG'''
project = ProjectFactory(project_summary=0)
- project_summary = ProjectSummaryFactory(project=project)
+ project_summary = ProjectSummaryFactory(project=project, set_status_code='DFT')
party = PartyFactory(person=True)
data = {}
@@ -78,7 +78,7 @@ def test_update_project_summary_assign_project_lead(test_client, db_session, aut
data['mine_guid'] = project_summary.project.mine_guid
data['project_summary_title'] = project_summary.project_summary_title
data['project_summary_description'] = project_summary.project_summary_description
- data['status_code'] = 'SUB'
+ data['status_code'] = 'DFT'
data['confirmation_of_submission'] = True
data['project_lead_party_guid'] = party.party_guid
data['is_historic'] = False
From 01a5b5cc2fdc8d0f9a5ee7d6f29ced7b2e39d5be Mon Sep 17 00:00:00 2001
From: Sinn
Date: Tue, 10 Dec 2024 10:53:04 -0800
Subject: [PATCH 4/6] addressing pr comments
---
.../components/projects/projectUtils.spec.ts | 30 +++++++++++++------
.../mine/Projects/ProjectSummary.tsx | 6 ----
2 files changed, 21 insertions(+), 15 deletions(-)
diff --git a/services/common/src/components/projects/projectUtils.spec.ts b/services/common/src/components/projects/projectUtils.spec.ts
index 43839a4657..c619ef861c 100644
--- a/services/common/src/components/projects/projectUtils.spec.ts
+++ b/services/common/src/components/projects/projectUtils.spec.ts
@@ -9,8 +9,8 @@ const TEST_PARAMETERS = [
testFunction: areFieldsDisabled,
coreDisabledStatuses: ["WDN", "COM"],
coreEnabledStatuses: ["DFT", "SUB", "ASG", "UNR", "CHR", "OHD"],
- msDisabledStatuses: ["SUB", "UNR", "WDN", "OHD", "COM"],
- msEnabledStatuses: ["DFT", "CHR", "ASG"],
+ msDisabledStatuses: ["SUB", "ASG", "UNR", "WDN", "OHD", "COM"],
+ msEnabledStatuses: ["DFT", "CHR"],
},
{
label: "areDocumentFieldsDisabled",
@@ -25,16 +25,16 @@ const TEST_PARAMETERS = [
testFunction: areAuthFieldsDisabled,
coreDisabledStatuses: ["WDN", "COM", "CHR", "UNR"],
coreEnabledStatuses: ["DFT", "SUB", "ASG", "OHD"],
- msDisabledStatuses: ["UNR", "WDN", "OHD", "COM", "SUB", "CHR"],
- msEnabledStatuses: ["DFT", "ASG"],
+ msDisabledStatuses: ["UNR", "WDN", "OHD", "COM", "SUB", "ASG", "CHR"],
+ msEnabledStatuses: ["DFT"],
},
{
label: "areAuthEnvFieldsDisabled",
testFunction: areAuthEnvFieldsDisabled,
coreDisabledStatuses: ["WDN", "COM", "ASG", "UNR", "CHR", "OHD", "SUB"],
coreEnabledStatuses: ["DFT"],
- msDisabledStatuses: ["UNR", "WDN", "OHD", "COM", "SUB", "CHR"],
- msEnabledStatuses: ["DFT", "ASG"],
+ msDisabledStatuses: ["UNR", "WDN", "OHD", "COM", "SUB", "ASG", "CHR"],
+ msEnabledStatuses: ["DFT"],
}
];
@@ -59,9 +59,20 @@ TEST_PARAMETERS.forEach(
expect(result).toBe(true);
});
});
+
+ if (label !== "areDocumentFieldsDisabled") {
+ const noSubmissionMinespaceDisabledStatuses = [...msDisabledStatuses].filter((status) => status !== "ASG");
+ noSubmissionMinespaceDisabledStatuses.forEach((status) => {
+ it(`MS status: ${status} Should return true (disabled) when submission has not occured`, () => {
+ const result = testFunction(SystemFlagEnum.ms, status);
+ expect(result).toBe(true);
+ });
+ })
+ }
+
msDisabledStatuses.forEach((status) => {
- it(`MS status: ${status} Should return true (disabled)`, () => {
- const result = testFunction(SystemFlagEnum.ms, status);
+ it(`MS status: ${status} Should return true (disabled) when submission has occured`, () => {
+ const result = testFunction(SystemFlagEnum.ms, status, true);
expect(result).toBe(true);
});
});
@@ -72,8 +83,9 @@ TEST_PARAMETERS.forEach(
expect(result).toBe(false);
});
});
+
msEnabledStatuses.forEach((status) => {
- it(`MS status: ${status} Should return false (enabled)`, () => {
+ it(`MS status: ${status} Should return false (enabled) when submission has occured`, () => {
const result = testFunction(SystemFlagEnum.ms, status);
expect(result).toBe(false);
});
diff --git a/services/core-web/src/components/mine/Projects/ProjectSummary.tsx b/services/core-web/src/components/mine/Projects/ProjectSummary.tsx
index 887711a2d6..b9a9d67e5e 100644
--- a/services/core-web/src/components/mine/Projects/ProjectSummary.tsx
+++ b/services/core-web/src/components/mine/Projects/ProjectSummary.tsx
@@ -18,7 +18,6 @@ import {
AMS_STATUS_CODES_SUCCESS,
AMS_STATUS_CODE_FAIL,
AMS_ENVIRONMENTAL_MANAGEMENT_ACT_TYPES,
- SystemFlagEnum,
} from "@mds/common";
import { getMineById } from "@mds/common/redux/reducers/mineReducer";
import withFeatureFlag from "@mds/common/providers/featureFlags/withFeatureFlag";
@@ -37,7 +36,6 @@ import ProjectSummaryForm, {
} from "@mds/common/components/projectSummary/ProjectSummaryForm";
import { fetchRegions } from "@mds/common/redux/slices/regionsSlice";
import { clearProjectSummary } from "@mds/common/redux/actions/projectActions";
-import { getSystemFlag } from "@mds/common/redux/selectors/authenticationSelectors";
import { cancelConfirmWrapper } from "@mds/common/components/forms/RenderCancelButton";
import { fetchActivities } from "@mds/common/redux/actionCreators/activityActionCreator";
import { getUserInfo } from "@mds/common/redux/selectors/authenticationSelectors";
@@ -54,10 +52,6 @@ export const ProjectSummary: FC = () => {
mode: string;
}>();
const userInfo = useSelector(getUserInfo);
-
- const systemFlag = useSelector(getSystemFlag);
- const isCore = systemFlag === SystemFlagEnum.core;
-
const mine = useSelector((state) => getMineById(state, mineGuid));
const formattedProjectSummary = useSelector(getFormattedProjectSummary);
const project = useSelector(getProject);
From 9c11b45d80f867a4d5661971566426c9f0c62f68 Mon Sep 17 00:00:00 2001
From: Sinn
Date: Tue, 10 Dec 2024 10:55:26 -0800
Subject: [PATCH 5/6] removing text
---
services/common/src/components/projects/projectUtils.spec.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/services/common/src/components/projects/projectUtils.spec.ts b/services/common/src/components/projects/projectUtils.spec.ts
index c619ef861c..9e2c750bf3 100644
--- a/services/common/src/components/projects/projectUtils.spec.ts
+++ b/services/common/src/components/projects/projectUtils.spec.ts
@@ -85,7 +85,7 @@ TEST_PARAMETERS.forEach(
});
msEnabledStatuses.forEach((status) => {
- it(`MS status: ${status} Should return false (enabled) when submission has occured`, () => {
+ it(`MS status: ${status} Should return false (enabled)`, () => {
const result = testFunction(SystemFlagEnum.ms, status);
expect(result).toBe(false);
});
From 13786905fb4edd199269bbcc9aec1be1a4ac6c4e Mon Sep 17 00:00:00 2001
From: Sinn
Date: Wed, 11 Dec 2024 12:46:59 -0800
Subject: [PATCH 6/6] fix for cypress error
---
.../common/src/components/project/ProjectDescriptionTab.tsx | 2 +-
.../__snapshots__/ProjectDescriptionTab.spec.tsx.snap | 1 +
services/core-web/cypress/e2e/majorprojects.cy.ts | 6 ++++++
3 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/services/common/src/components/project/ProjectDescriptionTab.tsx b/services/common/src/components/project/ProjectDescriptionTab.tsx
index 4d4f10f1b0..c8180a85f6 100644
--- a/services/common/src/components/project/ProjectDescriptionTab.tsx
+++ b/services/common/src/components/project/ProjectDescriptionTab.tsx
@@ -395,7 +395,7 @@ const ProjectDescriptionTab = () => {
Project Description Overview
-
+
View Project Description Details
diff --git a/services/common/src/components/project/__snapshots__/ProjectDescriptionTab.spec.tsx.snap b/services/common/src/components/project/__snapshots__/ProjectDescriptionTab.spec.tsx.snap
index b8da1de048..a687f63768 100644
--- a/services/common/src/components/project/__snapshots__/ProjectDescriptionTab.spec.tsx.snap
+++ b/services/common/src/components/project/__snapshots__/ProjectDescriptionTab.spec.tsx.snap
@@ -27,6 +27,7 @@ exports[`ProjectDescriptionTab renders properly 1`] = `
>
diff --git a/services/core-web/cypress/e2e/majorprojects.cy.ts b/services/core-web/cypress/e2e/majorprojects.cy.ts
index 35dc1cbfd7..00a4c119e2 100644
--- a/services/core-web/cypress/e2e/majorprojects.cy.ts
+++ b/services/core-web/cypress/e2e/majorprojects.cy.ts
@@ -18,6 +18,12 @@ describe("Major Projects", () => {
it("should upload and download a document successfully", () => {
const fileName = "dummy.pdf";
+ cy.get('body').then((element) => {
+ if (element.find("button[data-cy=view-project-description-details-button]").length > 0) {
+ cy.contains("View Project Description Details").click();
+ }
+ })
+
cy.contains("Document Upload").click();
cy.contains("Edit Project Description").click();