Skip to content

Commit

Permalink
[MDS-5353] ESUP Modal updates (#2705)
Browse files Browse the repository at this point in the history
* Add Explosives Permit form and Remove token after complete download

New form has been created to handle the addition of explosives permits. Form will handle business rules validations, state, and UI. Ant.design and redux-form have been used to handle state management and UI.

In addition, a minor bug fix was implemented in the document.py file to ensure that the cache for downloading documents get deleted after the download operation completes. This is to prevent reuse of the same token for downloading multiple documents, which could be a potential security vulnerability.

Styles have also been tweaked for MinePermitTable, Modal, and new styles for ExplosivesPermits have been created.

Re-ordered import statements to keep maintain consistency and readability across the code base.

* "Remove unnecessary defaultProps from DocumentTable component

The defaultProps object in DocumentTable.tsx was removed because it was not being used bring any value to the declared component. The methods: openModal and closeModal, defined in this object, were not applied in the component. It enhances readability by removing unused parts of code."

* Remove unused dataIndex from ExplosivesPermitTable

* address PR comments
  • Loading branch information
matbusby-fw authored Oct 10, 2023
1 parent acb483d commit 9b568e1
Show file tree
Hide file tree
Showing 24 changed files with 1,456 additions and 201 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ ms:

extra:
@echo "+\n++ Building tertiary services ...\n+"
@docker-compose $(DC_FILE) up -d minespace docgen-api
@docker-compose $(DC_FILE) up -d docgen-api

# Simply for legacy support, this command will be retired shortly
fe:
Expand Down
1 change: 1 addition & 0 deletions services/common/src/utils/featureFlag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export enum Feature {
DOCUMENTS_REPLACE_FILE = "major_project_replace_file",
MAJOR_PROJECT_ALL_DOCUMENTS = "major_project_all_documents",
MAJOR_PROJECT_DECISION_PACKAGE = "major_project_decision_package",
ESUP_PERMIT_AMENDMENT = "esup_permit_amendment",
FLAGSMITH = "flagsmith",
TSF_V2 = "tsf_v2",
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ def process_magazines(magazines, updated_magazines, type):
if explosives_permit_magazine_id:
magazine = ExplosivesPermitMagazine.find_by_explosives_permit_magazine_id(
explosives_permit_magazine_id)
magazine.update_from_data(magazine_data)
if magazine:
magazine.update_from_data(magazine_data)
else:
magazine = ExplosivesPermitMagazine.create_from_data(type, magazine_data)
magazines.append(magazine)
Expand Down
15 changes: 15 additions & 0 deletions services/core-web/src/assets/icons/violet-edit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from "react";
import Icon from "@ant-design/icons";

const EditSvg = () => (
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path
d="M21.1784 8.88387L8.55161 21.5079L4.20485 21.9886C2.94506 22.1281 1.8728 21.0656 2.01224 19.7965L2.49307 15.4507L15.1198 2.82664C16.2209 1.72576 18 1.72576 19.0963 2.82664L21.1736 4.9034C22.2747 6.00428 22.2747 7.7878 21.1784 8.88387ZM16.4277 10.3693L13.634 7.57628L4.70011 16.5131L4.3491 19.6523L7.48896 19.3013L16.4277 10.3693ZM19.5435 6.53789L17.4663 4.46113C17.2692 4.26403 16.947 4.26403 16.7547 4.46113L15.2689 5.94659L18.0626 8.73965L19.5483 7.25418C19.7407 7.05228 19.7407 6.73499 19.5435 6.53789Z"
fill="#5e46a1"
/>
</svg>
);

const VioletEditIcon = (props) => <Icon component={EditSvg} {...props} />;

export default VioletEditIcon;
Loading

0 comments on commit 9b568e1

Please sign in to comment.