Skip to content

Commit

Permalink
Removed constants global export
Browse files Browse the repository at this point in the history
  • Loading branch information
simensma-fresh committed Dec 17, 2024
1 parent 0ab5323 commit 11bf13c
Show file tree
Hide file tree
Showing 88 changed files with 120 additions and 158 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import DocumentTable from "./DocumentTable";
import FormWrapper from "../forms/FormWrapper";
import RenderCancelButton from "../forms/RenderCancelButton";
import RenderSubmitButton from "../forms/RenderSubmitButton";
import { FORM } from "@mds/common/constants";
import { FORM } from "@mds/common/constants/forms";

interface ArchiveDocumentModalProps {
documents: IMineDocument[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import DocumentTable from "./DocumentTable";
import FormWrapper from "../forms/FormWrapper";
import RenderCancelButton from "../forms/RenderCancelButton";
import RenderSubmitButton from "../forms/RenderSubmitButton";
import { FORM } from "@mds/common/constants";
import { FORM } from "@mds/common/constants/forms";

interface DeleteDocumentModalProps {
documents: MineDocument[];
Expand Down
4 changes: 2 additions & 2 deletions services/common/src/components/documents/DocumentLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import DownloadOutlined from "@ant-design/icons/DownloadOutlined";
import FileOutlined from "@ant-design/icons/FileOutlined";
import DeleteOutlined from "@ant-design/icons/DeleteOutlined";
import { getUserAccessData } from "@mds/common/redux/selectors/authenticationSelectors";
import { USER_ROLES } from "@mds/common/constants";
import { truncateFilename } from "@mds/common/redux/utils/helpers";
import { openDocument, isDocumentOpenable } from "../syncfusion/DocumentViewer";
import { downloadFileFromDocumentManager } from "@mds/common/redux/utils/actionlessNetworkCalls";
import LinkButton from "../common/LinkButton";
import { USER_ROLES } from "@mds/common/constants/environment";

const propTypes = {
documentManagerGuid: PropTypes.string.isRequired,
Expand All @@ -35,7 +35,7 @@ const defaultProps = {
truncateDocumentName: true,
deletePermission: null,
deleteFilePayload: {},
handleDelete: () => {},
handleDelete: () => { },
};

export const DocumentLink = (props) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import { closeModal } from "@mds/common/redux/actions/modalActions";
import ViewSpatialDetail from "./ViewSpatialDetail";
import { createDocmanSpatialBundle } from "@mds/common/redux/slices/spatialDataSlice";
import { OTHER_SPATIAL, XML } from "@mds/common/constants/fileTypes";
import { SPATIAL_DATA_STANDARDS_URL, MAX_DOCUMENT_NAME_LENGTHS } from "@mds/common/constants";
import { SPATIAL_DATA_STANDARDS_URL } from "@mds/common/constants/strings";
import { MAX_DOCUMENT_NAME_LENGTHS } from "@mds/common/constants/enums";

interface AddSpatialDocumentsModalProps {
formName: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import React from "react";
import { render } from "@testing-library/react";
import * as MOCK from "@mds/common/tests/mocks/dataMocks";
import { ReduxWrapper } from "@mds/common/tests/utils/ReduxWrapper";
import { MAJOR_MINES_APPLICATION_DOCUMENT_TYPE_CODE } from "@mds/common/constants";
import SpatialDocumentTable from "./SpatialDocumentTable";
import { MineDocument } from "@mds/common/models/documents/document";
import { MAJOR_MINES_APPLICATION_DOCUMENT_TYPE_CODE } from "@mds/common/constants/strings";

const spatialDocuments = MOCK.PROJECT_SUMMARY.documents
.filter(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
groupSpatialBundles,
spatialDataReducerType,
} from "@mds/common/redux/slices/spatialDataSlice";
import { MAJOR_MINES_APPLICATION_DOCUMENT_TYPE_CODE } from "@mds/common/constants";
import { MAJOR_MINES_APPLICATION_DOCUMENT_TYPE_CODE } from "@mds/common/constants/strings";

const spatialDocuments = MOCK.PROJECT_SUMMARY.documents.filter(
(d) => d.project_summary_document_type_code === MAJOR_MINES_APPLICATION_DOCUMENT_TYPE_CODE.SPATIAL
Expand Down
2 changes: 1 addition & 1 deletion services/common/src/components/forms/BaseInput.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { EMPTY_FIELD } from "@mds/common/constants";
import { EMPTY_FIELD } from "@mds/common/constants/strings";
import { Typography } from "antd";
import React, { FC, ReactNode } from "react";
import { WrappedFieldProps, WrappedFieldMetaProps, WrappedFieldInputProps } from "redux-form";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import "react-quill/dist/quill.snow.css";
import parse from "html-react-parser";
import DOMPurify from "dompurify";
import { getSystemFlag } from "@mds/common/redux/selectors/authenticationSelectors";
import { SystemFlagEnum } from "@mds/common/constants";
import { SystemFlagEnum } from "@mds/common/constants/enums";

const RenderRichTextEditor: FC<BaseInputProps> = ({
label,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { render, fireEvent } from "@testing-library/react";
import { ReduxWrapper } from "@mds/common/tests/utils/ReduxWrapper";
import { HelpGuideContent } from "./HelpGuide";
import { AUTHENTICATION } from "@mds/common/constants/reducerTypes";
import { SystemFlagEnum } from "@mds/common/constants";
import { SystemFlagEnum } from "@mds/common/constants/enums";
import { HELP_GUIDE_CORE, USER_ACCESS_DATA } from "@mds/common/tests/mocks/dataMocks";
import { EMPTY_HELP_KEY, helpReducerType } from "@mds/common/redux/slices/helpSlice";

Expand Down
2 changes: 1 addition & 1 deletion services/common/src/components/help/HelpGuide-ms.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { render, fireEvent } from "@testing-library/react";
import { ReduxWrapper } from "@mds/common/tests/utils/ReduxWrapper";
import HelpGuide, { HelpGuideContent } from "./HelpGuide";
import { AUTHENTICATION } from "@mds/common/constants/reducerTypes";
import { SystemFlagEnum } from "@mds/common/constants";
import { SystemFlagEnum } from "@mds/common/constants/enums";
import { MS_USER_ACCESS_DATA } from "@mds/common/tests/mocks/dataMocks";
import { helpReducerType } from "@mds/common/redux/slices/helpSlice";
import { BrowserRouter } from "react-router-dom";
Expand Down
4 changes: 3 additions & 1 deletion services/common/src/components/help/HelpGuide.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
isAuthenticated,
userHasRole,
} from "@mds/common/redux/selectors/authenticationSelectors";
import { FORM, SystemFlagEnum, USER_ROLES } from "@mds/common/constants";
import {
createHelp,
updateHelp,
Expand All @@ -30,6 +29,9 @@ import Loading from "../common/Loading";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faQuestionCircle } from "@fortawesome/pro-regular-svg-icons";
import { cancelConfirmWrapper } from "../forms/RenderCancelButton";
import { SystemFlagEnum } from "@mds/common/constants/enums";
import { USER_ROLES } from "@mds/common/constants/environment";
import { FORM } from "@mds/common/constants/forms";

interface HelpGuideProps {
helpKey: string;
Expand Down
2 changes: 1 addition & 1 deletion services/common/src/components/help/HelpGuideForm.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { FC } from "react";
import { Field } from "redux-form";
import RenderRichTextEditor from "../forms/RenderRichTextEditor";
import { FORM } from "@mds/common/constants";
import { FORM } from "@mds/common/constants/forms";
import FormWrapper from "../forms/FormWrapper";
import { formatSnakeCaseToSentenceCase } from "@mds/common/redux/utils/helpers";
import RenderRadioButtons from "../forms/RenderRadioButtons";
Expand Down
2 changes: 1 addition & 1 deletion services/common/src/components/projectSummary/Agent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React, { FC, useEffect, useState } from "react";
import { useSelector, useDispatch } from "react-redux";
import { Field, change, getFormValues } from "redux-form";
import { Col, Row, Typography, Alert } from "antd";
import { FORM } from "@mds/common/constants";
import RenderField from "@mds/common/components/forms/RenderField";
import RenderRadioButtons from "@mds/common/components/forms/RenderRadioButtons";
import RenderSelect from "@mds/common/components/forms/RenderSelect";
Expand All @@ -28,6 +27,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faCircleCheck, faCircleX, faSpinner } from "@fortawesome/pro-light-svg-icons";
import { IProjectSummaryForm } from "@mds/common/interfaces";
import { ProjectSummaryFormComponentProps } from "./ProjectSummaryForm";
import { FORM } from "@mds/common/constants/forms";

export const Agent: FC<ProjectSummaryFormComponentProps> = ({ fieldsDisabled }) => {
const dispatch = useDispatch();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
requiredRadioButton,
} from "@mds/common/redux/utils/Validate";
import RenderRadioButtons from "@mds/common/components/forms/RenderRadioButtons";
import { FORM } from "@mds/common/constants";
import { FORM } from "@mds/common/constants/forms";
import { CONTACTS_COUNTRY_OPTIONS } from "@mds/common/constants/strings";
import { IOrgbookCredential } from "@mds/common/interfaces/party";
import RenderOrgBookSearch from "@mds/common/components/forms/RenderOrgBookSearch";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
import { renderTextColumn } from "@mds/common/components/common/CoreTableCommonColumns";
import CoreTable from "@mds/common/components/common/CoreTable";
import { getPermits } from "@mds/common/redux/selectors/permitSelectors";
import { FORM } from "@mds/common/constants";
import { FORM } from "@mds/common/constants/forms";
import { IAuthorizationSummary, IProjectSummaryForm } from "@mds/common/interfaces";
import { FormContext } from "../forms/FormWrapper";
import { ProjectSummaryFormComponentProps } from "./ProjectSummaryForm";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import { render } from "@testing-library/react";
import FormWrapper from "@mds/common/components/forms/FormWrapper";
import { FORM } from "@mds/common/constants";
import { FORM } from "@mds/common/constants/forms";
import { PROJECTS } from "@mds/common/constants/reducerTypes";
import { ReduxWrapper } from "@mds/common/tests/utils/ReduxWrapper";
import { PROJECT } from "@mds/common/tests/mocks/dataMocks";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { getAmsAuthorizationTypes } from "@mds/common/redux/selectors/projectSel
import { required } from "@mds/common/redux/utils/Validate";
import RenderCheckbox from "../forms/RenderCheckbox";
import PageFoldScrollWrapper from "../common/PageFoldScrollWrapper";
import { FORM } from "@mds/common/constants";
import { FORM } from "@mds/common/constants/forms";
import { IProjectSummaryForm } from "@mds/common/interfaces";

const terms = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ import {
uploadedByColumn,
} from "../documents/DocumentColumns";
import ProjectSummaryFileUpload from "./ProjectSummaryFileUpload";
import {
ENVIRONMENT,
FORM,
PROJECT_SUMMARY_DOCUMENT_TYPE_CODE,
} from "@mds/common/constants";
import { postNewDocumentVersion } from "@mds/common/redux/actionCreators/documentActionCreator";
import LinkButton from "../common/LinkButton";
import * as API from "@mds/common/constants/API";
Expand All @@ -25,6 +20,9 @@ import { FormContext } from "../forms/FormWrapper";
import { useFeatureFlag } from "@mds/common/providers/featureFlags/useFeatureFlag";
import { IProjectSummaryForm } from "@mds/common/interfaces";
import { Feature } from "@mds/common/utils";
import { PROJECT_SUMMARY_DOCUMENT_TYPE_CODE } from "@mds/common/constants/strings";
import { FORM } from "@mds/common/constants/forms";
import { ENVIRONMENT } from "@mds/common/constants/environment";

const RenderOldDocuments = ({
documents,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import RenderAutoSizeField from "../forms/RenderAutoSizeField";
import { normalizePhone } from "@mds/common/redux/utils/helpers";
import { getRegionOptions } from "@mds/common/redux/slices/regionsSlice"
import { ProjectSummaryFormComponentProps } from "./ProjectSummaryForm";
import { FORM } from "@mds/common/constants";
import { FORM } from "@mds/common/constants/forms";
import { IProjectSummaryForm } from "@mds/common/interfaces";

export const FacilityOperator: FC<ProjectSummaryFormComponentProps> = ({ fieldsDisabled }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
max,
min,
} from "@mds/common/redux/utils/Validate";
import { FORM } from "@mds/common/constants";
import { FORM } from "@mds/common/constants/forms";
import RenderField from "../forms/RenderField";
import { getDropdownMunicipalities } from "@mds/common/redux/selectors/staticContentSelectors";
import RenderSelect from "@mds/common/components/forms/RenderSelect";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ import {
postalCodeWithCountry,
} from "@mds/common/redux/utils/Validate";
import { normalizePhone } from "@mds/common/redux/utils/helpers";
import { FORM, CONTACTS_COUNTRY_OPTIONS } from "@mds/common/constants";
import { IProjectSummaryForm } from "@mds/common/interfaces";
import { FORM } from "@mds/common/constants/forms";
import { CONTACTS_COUNTRY_OPTIONS } from "@mds/common/constants/strings";

const { Title, Paragraph } = Typography;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ import {
} from "@mds/common/redux/utils/Validate";
import { normalizePhone } from "@mds/common/redux/utils/helpers";
import LinkButton from "@mds/common/components/common/LinkButton";
import { FORM, CONTACTS_COUNTRY_OPTIONS } from "@mds/common/constants";
import RenderField from "@mds/common/components/forms/RenderField";
import RenderSelect from "@mds/common/components/forms/RenderSelect";
import { getDropdownProvinceOptions } from "@mds/common/redux/selectors/staticContentSelectors";
import { FormContext } from "../forms/FormWrapper";
import { IProjectSummaryForm } from "@mds/common/interfaces";
import { ProjectSummaryFormComponentProps } from "./ProjectSummaryForm";
import { FORM } from "@mds/common/constants/forms";
import { CONTACTS_COUNTRY_OPTIONS } from "@mds/common/constants/strings";

const RenderContacts = ({ fields, isDisabled }) => {
const dispatch = useDispatch();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
dateInFuture,
} from "@mds/common/redux/utils/Validate";
import Callout from "@mds/common/components/common/Callout";
import { FORM } from "@mds/common/constants";
import { FORM } from "@mds/common/constants/forms";
import RenderDate from "@mds/common/components/forms/RenderDate";
import { IProjectSummaryForm } from "@mds/common/interfaces";
import { ProjectSummaryFormComponentProps } from "./ProjectSummaryForm";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ import { Field, change } from "redux-form";
import { Button, Col, Row, Typography } from "antd";
import ProjectLinksTable from "@mds/common/components/projectSummary/ProjectLinksTable";
import { ILinkedProject, IProject } from "@mds/common/interfaces";
import {
FORM,
USER_ROLES,
} from "@mds/common/constants";
import { getProjectStatusDescription } from "../projects/projectUtils";
import { isProponent, userHasRole } from "@mds/common/redux/reducers/authenticationReducer";
import {
Expand All @@ -20,6 +16,7 @@ import RenderMultiSelect from "../forms/RenderMultiSelect";
import * as Strings from "@mds/common/constants/strings";
import { FormContext } from "../forms/FormWrapper";
import { ProjectSummaryFormComponentProps } from "./ProjectSummaryForm";
import { FORM } from "@mds/common/constants/forms";

interface ProjectLinksProps extends ProjectSummaryFormComponentProps {
viewProject: (record: ILinkedProject) => string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import MinistryCommentPanel from "@mds/common/components/comments/MinistryCommen
import { requiredList } from "@mds/common/redux/utils/Validate";
import { IGroupedDropdownList, IProjectSummaryForm, IProjectSummaryMinistryComment } from "@mds/common/interfaces";
import { Feature } from "@mds/common/utils";
import { USER_ROLES } from "@mds/common/constants";
import { USER_ROLES } from "@mds/common/constants/environment";
import ProjectCallout from "../projects/ProjectCallout";

const { Paragraph, Title } = Typography;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import CheckCircleOutlined from "@ant-design/icons/CheckCircleOutlined";
import ArrowLeftOutlined from "@ant-design/icons/ArrowLeftOutlined";
import CloseCircleOutlined from "@ant-design/icons/CloseCircleOutlined";
import LinkButton from "../common/LinkButton";
import { ENVIRONMENT, AMS_STATUS_CODE_FAIL } from "@mds/common/constants";
import * as API from "@mds/common/constants/API";
import { ENVIRONMENT } from "@mds/common/constants/environment";
import { AMS_STATUS_CODE_FAIL } from "@mds/common/constants/strings";

export const ProjectSubmissionStatusPage = () => {
const { projectGuid, status } = useParams<{ projectGuid: string; status: string }>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Alert, Divider, Modal, Popconfirm, Table, Typography } from "antd";
import { getUserInfo } from "@mds/common/redux/selectors/authenticationSelectors";
import { FilePondFile } from "filepond";
import { IDocument } from "@mds/common/interfaces/document";
import { MAX_DOCUMENT_NAME_LENGTHS } from "@mds/common/constants";
import { MAX_DOCUMENT_NAME_LENGTHS } from "@mds/common/constants/enums";

const notificationDisabledStatusCodes = [409]; // Define the notification disabled status codes

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from "react";
import { render } from "@testing-library/react";
import FormWrapper from "../forms/FormWrapper";
import { FORM, SystemFlagEnum } from "@mds/common/constants";
import { ProjectManagement } from "./ProjectManagement";
import { LegalLandOwnerInformation } from "./LegalLandOwnerInformation";
import { ReduxWrapper } from "@mds/common/tests/utils/ReduxWrapper";
Expand All @@ -20,6 +19,8 @@ import Declaration from "./Declaration";
import DocumentUpload from "./DocumentUpload";
import { FacilityOperator } from "./FacilityOperator";
import { BrowserRouter } from "react-router-dom";
import { SystemFlagEnum } from "@mds/common/constants/enums";
import { FORM } from "@mds/common/constants/forms";

const { formatProjectSummary } = exportForTesting;

Expand Down
14 changes: 4 additions & 10 deletions services/common/src/components/projects/ProjectCallout.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
import React, { FC, ReactElement } from "react";
import {
CALLOUT_SEVERITY,
MAJOR_MINE_APPLICATION_AND_IRT_STATUS_CODE_CODES,
PROJECT_STATUS_CODES,
PROJECT_SUMMARY_STATUS_CODES,
SystemFlagEnum,
} from "@mds/common/constants";
import Callout from "../common/Callout";
import { Alert, Col, Row } from "antd";
import { useSelector } from "react-redux";
import { getSystemFlag } from "@mds/common/redux/selectors/authenticationSelectors";
import { CALLOUT_SEVERITY } from "@mds/common/constants/strings";
import { MAJOR_MINE_APPLICATION_AND_IRT_STATUS_CODE_CODES, PROJECT_STATUS_CODES, PROJECT_SUMMARY_STATUS_CODES, SystemFlagEnum } from "@mds/common/constants/enums";

export const statusTextHash = (status: string, isCore: boolean) => {
return (
Expand Down Expand Up @@ -47,11 +42,10 @@ export const statusTextHash = (status: string, isCore: boolean) => {
CHR: {
severity: CALLOUT_SEVERITY.warning,
message: `This project requires changes by the mine. MineSpace users can update text fields and update documents.
Note: ${
isCore
Note: ${isCore
? "when the MineSpace user resubmits at this step the project status will be changed to under review."
: "Navigate to the submit section of the form to resubmit your application after making any changes to have them resubmitted to the ministry."
}`,
}`,
},
ASG: {
severity: CALLOUT_SEVERITY.success,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import Loading from "../common/Loading";
import { getProjectSummaryDocumentTypesHash } from "@mds/common/redux/selectors/staticContentSelectors";
import { IProject, IProjectSummaryAuthorization } from "@mds/common/interfaces/projects";
import { SystemFlagEnum } from "@mds/common/constants/enums";
import { CATEGORY_CODE } from "@mds/common/constants";
import { Feature } from "@mds/common/utils";
import { CATEGORY_CODE } from "@mds/common/constants/strings";

interface ProjectDocumentsTabProps {
project: IProject;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PROJECT_STATUS_CODES, SystemFlagEnum } from "@mds/common/constants";
import { PROJECT_STATUS_CODES, SystemFlagEnum } from "@mds/common/constants/enums";
import { areAuthEnvFieldsDisabled, areAuthFieldsDisabled, areDocumentFieldsDisabled, areFieldsDisabled } from "./projectUtils";

const enumValues = (<any>Object).values(PROJECT_STATUS_CODES);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import ReportDetailsForm from "./ReportDetailsForm";
import { Button } from "antd";
import * as MOCK from "@mds/common/tests/mocks/dataMocks";
import { AUTHENTICATION } from "@mds/common/constants/reducerTypes";
import { SystemFlagEnum, USER_ROLES } from "@mds/common/constants";
import { SystemFlagEnum } from "@mds/common/constants/enums";
import { USER_ROLES } from "@mds/common/constants/environment";

const mineReportSubmission = MOCK.MINE_REPORT_SUBMISSIONS[0];

Expand Down Expand Up @@ -43,7 +44,7 @@ describe("ReportDetailsForm", () => {
<Button htmlType="submit">Submit</Button>
</div>
}
handleSubmit={() => {}}
handleSubmit={() => { }}
/>
</ReduxWrapper>
);
Expand Down
Loading

0 comments on commit 11bf13c

Please sign in to comment.