diff --git a/services/common/src/components/common/ActionMenu.tsx b/services/common/src/components/common/ActionMenu.tsx index 0a957e0d9e..1511621519 100644 --- a/services/common/src/components/common/ActionMenu.tsx +++ b/services/common/src/components/common/ActionMenu.tsx @@ -1,14 +1,9 @@ +import React, { FC, ReactNode } from "react"; import { Button, Dropdown, Modal } from "antd"; -import { CaretDownOutlined } from "@ant-design/icons"; -import React, { FC } from "react"; +import CaretDownOutlined from "@ant-design/icons/CaretDownOutlined"; +import DownOutlined from "@ant-design/icons/DownOutlined"; import { ITableAction } from "@mds/common/components/common/CoreTableCommonColumns"; -interface ActionMenuProps { - record: any; - actionItems: ITableAction[]; - category: string; -} - export const deleteConfirmWrapper = (recordDescription: string, onOk: () => void) => { const title = `Confirm Deletion`; const content = `Are you sure you want to delete this ${recordDescription}?`; @@ -39,11 +34,39 @@ export const generateActionMenuItems = (actionItems: ITableAction[], record) => }); }; +export interface IHeaderAction { + key: string; + label: string; + icon?: ReactNode; + clickFunction: () => void | Promise; +} +// Looks like a button, intended for page-scope, not record-scope in the actions +export const ActionMenuButton: FC<{ buttonText?: string; actions: IHeaderAction[] }> = ({ + actions, + buttonText = "Action", +}) => { + const items = generateActionMenuItems((actions as unknown) as ITableAction[], null); + + return ( + + + + ); +}; + +interface ActionMenuProps { + record: any; + actionItems: ITableAction[]; + category: string; +} const ActionMenu: FC = ({ record, actionItems, category }) => { const items = generateActionMenuItems(actionItems, record); return ( - diff --git a/services/common/src/components/common/CoreButton.spec.tsx b/services/common/src/components/common/CoreButton.spec.tsx new file mode 100644 index 0000000000..204f284d2c --- /dev/null +++ b/services/common/src/components/common/CoreButton.spec.tsx @@ -0,0 +1,48 @@ +import React from "react"; +import { render } from "@testing-library/react"; +import FileOutlined from "@ant-design/icons/FileOutlined"; +import CoreButton, { CoreButtonProps } from "./CoreButton"; + +const propsArray: CoreButtonProps[] = [ + { + type: "default", + ghost: true, + className: "test-class ", + icon: , + htmlType: "reset", + }, + { + type: "primary", + children: ( + <> + Text with icon + + + ), + }, + { type: "ghost", htmlType: "submit", size: "large", loading: { delay: 10 } }, + { type: "dashed", size: "small", children: }, + { type: "link", style: { color: "green" }, href: "https://www.example.com", target: "blank" }, + { type: "text", disabled: true, shape: "round", prefixCls: "test-prefix" }, + { type: "tertiary", ghost: true, children:
button label
}, + { type: "filled-tertiary", loading: true, block: true, danger: true }, +]; + +describe("Buttons", () => { + it("renders all buttons properly", () => { + const { container } = render( + <> + {propsArray.map(({ children, ...props }) => { + return children ? ( + + {children} + + ) : ( + + ); + })} + + ); + expect(container).toMatchSnapshot(); + }); +}); diff --git a/services/common/src/components/common/CoreButton.tsx b/services/common/src/components/common/CoreButton.tsx new file mode 100644 index 0000000000..93420650a9 --- /dev/null +++ b/services/common/src/components/common/CoreButton.tsx @@ -0,0 +1,33 @@ +import React, { FC } from "react"; +import { Button, ButtonProps } from "antd"; +import { ButtonType } from "antd/lib/button"; + +// DO NOT put antd button types in here: default, primary, ghost, dashed, link, text +declare const AdditionalTypes: ["tertiary", "filled-tertiary"]; +// Additional doesn't exist at compile-time, I have not found a way around this. :( +// for now the two arrays should be duplicated. +const additionalTypes = ["tertiary", "filled-tertiary"]; + +type CoreCustomType = typeof AdditionalTypes[number]; + +// this one is the default because it's not used anywhere in the system, +// therefore it can be styled freely +const defaultButtonType = "dashed"; + +export interface CoreButtonProps extends Omit { + type: ButtonType | CoreCustomType; +} + +const CoreButton: FC = ({ type, className, children, ...props }) => { + const isAntdType = additionalTypes.includes(type); + const buttonType = isAntdType ? defaultButtonType : (type as ButtonType); + const buttonClassName = ["core-btn", `core-btn-${type}`, className].join(" ").trim(); + + return ( + + ); +}; + +export default CoreButton; diff --git a/services/common/src/components/common/CorePageHeader.spec.tsx b/services/common/src/components/common/CorePageHeader.spec.tsx new file mode 100644 index 0000000000..1496fc38ab --- /dev/null +++ b/services/common/src/components/common/CorePageHeader.spec.tsx @@ -0,0 +1,43 @@ +import React from "react"; +import { render } from "@testing-library/react"; +import CorePageHeader from "./CorePageHeader"; +import { ReduxWrapper } from "@mds/common/tests/utils/ReduxWrapper"; +import { MINES } from "@mds/common/constants/reducerTypes"; +import * as MOCK from "@mds/common/tests/mocks/dataMocks"; +import { BrowserRouter } from "react-router-dom"; + +const initialState = { + [MINES]: MOCK.MINES, +}; + +describe("CorePageHeader", () => { + it("renders properly", () => { + const { container } = render( + + + Overview Content, + }, + ], + defaultActiveKey: "overview", + }} + /> + + + ); + expect(container).toMatchSnapshot(); + }); +}); diff --git a/services/common/src/components/common/CorePageHeader.tsx b/services/common/src/components/common/CorePageHeader.tsx new file mode 100644 index 0000000000..b319de69c1 --- /dev/null +++ b/services/common/src/components/common/CorePageHeader.tsx @@ -0,0 +1,105 @@ +import React, { FC, ReactNode, useEffect } from "react"; +import { useDispatch, useSelector } from "react-redux"; +import { Col, Row, Tabs, TabsProps, Typography } from "antd"; +import { Link } from "react-router-dom"; +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; +import CoreTag from "./CoreTag"; + +import CompanyIcon from "@mds/common/assets/icons/CompanyIcon"; +import { faLocationDot } from "@fortawesome/pro-light-svg-icons"; +import { getMineById } from "@mds/common/redux/selectors/mineSelectors"; +import { fetchMineRecordById } from "@mds/common/redux/actionCreators/mineActionCreator"; + +interface BreadCrumb { + route: string; + text: string; +} + +interface CorePageHeaderProps { + entityLabel: string; + entityType: string; + mineGuid: string; + current_permittee: string; // would be ideal to get this from the mine + breadCrumbs?: BreadCrumb[]; + tabProps?: TabsProps; + extraElement?: ReactNode; +} + +const { Title, Text } = Typography; + +const CorePageHeader: FC = ({ + mineGuid, + current_permittee, + entityLabel, + entityType, + breadCrumbs, + tabProps, + extraElement, +}) => { + const mine = useSelector((state) => getMineById(state, mineGuid)); + const dispatch = useDispatch(); + + useEffect(() => { + if (!mine) { + dispatch(fetchMineRecordById(mineGuid)); + } + }, [mineGuid]); + + return ( +
+
+ + + {breadCrumbs.map((crumb) => { + return ( + + + {crumb.text} + {" "} + /{" "} + + ); + })} + + {entityType} {entityLabel} + + + + + + + + + {entityType} {entityLabel} + + + + } + text={mine?.mine_name} + link={GLOBAL_ROUTES?.MINE_DASHBOARD.dynamicRoute(mineGuid)} + /> + + {current_permittee && ( + + } text={current_permittee} /> + + )} + + + + {extraElement && {extraElement}} + +
+ {tabProps && ( + + )} +
+ ); +}; + +export default CorePageHeader; diff --git a/services/common/src/components/common/CoreTableCommonColumns.tsx b/services/common/src/components/common/CoreTableCommonColumns.tsx index 87aa0ea99a..c647d07cdd 100644 --- a/services/common/src/components/common/CoreTableCommonColumns.tsx +++ b/services/common/src/components/common/CoreTableCommonColumns.tsx @@ -117,7 +117,7 @@ export const renderActionsColumn = ({
{items.length > 0 && ( - diff --git a/services/common/src/components/common/CoreTag.tsx b/services/common/src/components/common/CoreTag.tsx index 0dad963d44..55e3168bd0 100644 --- a/services/common/src/components/common/CoreTag.tsx +++ b/services/common/src/components/common/CoreTag.tsx @@ -1,16 +1,28 @@ import React, { FC, ReactNode } from "react"; import { Row, Typography } from "antd"; +import { Link } from "react-router-dom"; interface TagProps { text: string; icon: ReactNode; + link?: string; } -const CoreTag: FC = ({ text, icon }) => { +const CoreTag: FC = ({ text, icon, link }) => { + const getText = () => { + return link ? ( + + {text} + + ) : ( + text + ); + }; + return ( {icon} - {text} + {getText()} ); }; diff --git a/services/common/src/components/common/ScrollSidePageWrapper.tsx b/services/common/src/components/common/ScrollSidePageWrapper.tsx index 617a6af266..d1c5cb06cc 100644 --- a/services/common/src/components/common/ScrollSidePageWrapper.tsx +++ b/services/common/src/components/common/ScrollSidePageWrapper.tsx @@ -6,7 +6,7 @@ import { getSystemFlag } from "@mds/common/redux/selectors/authenticationSelecto interface ScrollSidePageWrapperProps { content: ReactNode; - menuProps: ScrollSideMenuProps; + menuProps?: ScrollSideMenuProps; header: ReactNode; headerHeight?: number; } @@ -25,7 +25,7 @@ const ScrollSidePageWrapper: FC = ({ const isCore = systemFlag === SystemFlagEnum.core; const systemHeaderHeight = isCore ? coreHeaderHeight : msHeaderHeight; - const contentPaddingY = isCore ? 15 : 26; + const contentPaddingY = isCore ? 24 : 26; const handleScroll = () => { let isMounted = true; @@ -47,7 +47,7 @@ const ScrollSidePageWrapper: FC = ({ handleScroll(); }, []); - const hasMenu = menuProps.menuOptions.length > 0; + const hasMenu = Boolean(menuProps); const hasHeader = Boolean(header); const contentClass = [hasMenu && "side-menu--content", isFixedTop && "with-fixed-top"] @@ -73,7 +73,7 @@ const ScrollSidePageWrapper: FC = ({ className={isFixedTop ? "side-menu--fixed" : "side-menu"} style={{ top: menuTopOffset }} > - {/* the 15 matches the margin/padding on the menu/content. Looks nicer */} + {/* the 24 matches the margin/padding on the menu/content. Looks nicer */}
)} diff --git a/services/common/src/components/common/__snapshots__/CoreButton.spec.tsx.snap b/services/common/src/components/common/__snapshots__/CoreButton.spec.tsx.snap new file mode 100644 index 0000000000..cc960248a6 --- /dev/null +++ b/services/common/src/components/common/__snapshots__/CoreButton.spec.tsx.snap @@ -0,0 +1,169 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Buttons renders all buttons properly 1`] = ` +
+ + + + + + + +
+`; diff --git a/services/common/src/components/common/__snapshots__/CorePageHeader.spec.tsx.snap b/services/common/src/components/common/__snapshots__/CorePageHeader.spec.tsx.snap new file mode 100644 index 0000000000..2e35b62af1 --- /dev/null +++ b/services/common/src/components/common/__snapshots__/CorePageHeader.spec.tsx.snap @@ -0,0 +1,346 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`CorePageHeader renders properly 1`] = ` +
+
+
+
+
+ + All Llamas + + + / + + + Specific Llamas + + + / + + + Llama + + George + +
+
+
+
+
+
+

+ Llama + + George +

+
+
+
+ + + + mine3 + + +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + Permit Holder + +
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+ Overview Content +
+
+
+
+
+
+
+`; diff --git a/services/common/src/components/documents/DocumentTable.spec.tsx b/services/common/src/components/documents/DocumentTable.spec.tsx new file mode 100644 index 0000000000..875edaf875 --- /dev/null +++ b/services/common/src/components/documents/DocumentTable.spec.tsx @@ -0,0 +1,19 @@ +import React from "react"; +import { render } from "@testing-library/react"; +import * as MOCK from "@mds/common/tests/mocks/dataMocks"; +import DocumentTable from "./DocumentTable"; +import { MineDocument } from "@mds/common/models/documents/document"; +import { ReduxWrapper } from "@mds/common/tests/utils/ReduxWrapper"; + +const documents = MOCK.PROJECT_SUMMARY.documents.map((d) => new MineDocument(d)); + +describe("DocumentTable", () => { + it("renders properly", () => { + const { container } = render( + + + + ); + expect(container).toMatchSnapshot(); + }); +}); diff --git a/services/common/src/components/documents/__snapshots__/DocumentTable.spec.tsx.snap b/services/common/src/components/documents/__snapshots__/DocumentTable.spec.tsx.snap new file mode 100644 index 0000000000..6a59702c87 --- /dev/null +++ b/services/common/src/components/documents/__snapshots__/DocumentTable.spec.tsx.snap @@ -0,0 +1,739 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`DocumentTable renders properly 1`] = ` +
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + File Name + + + + + + + + + + + +
+
+
+ + Category + + + + + + + + + + + +
+
+
+ + Uploaded + + + + + + + + + + + +
+
+
+
+ + +
+
+
+ N/A +
+
+
+ Jun 26 2024 +
+
+
+ +
+
+
+ + +
+
+
+ N/A +
+
+
+ Jun 26 2024 +
+
+
+ +
+
+
+ + +
+
+
+ N/A +
+
+
+ Jun 26 2024 +
+
+
+ +
+
+
+ + +
+
+
+ N/A +
+
+
+ Jun 26 2024 +
+
+
+ +
+
+
+ + +
+
+
+ N/A +
+
+
+ Jun 26 2024 +
+
+
+ +
+
+
+ + +
+
+
+ N/A +
+
+
+ Jun 21 2024 +
+
+
+ +
+
+
+
+
+
+
+
+
+
+`; diff --git a/services/common/src/components/documents/spatial/__snapshots__/AddSpatialDocumentsModal.spec.tsx.snap b/services/common/src/components/documents/spatial/__snapshots__/AddSpatialDocumentsModal.spec.tsx.snap index f5f703406d..322f0e0244 100644 --- a/services/common/src/components/documents/spatial/__snapshots__/AddSpatialDocumentsModal.spec.tsx.snap +++ b/services/common/src/components/documents/spatial/__snapshots__/AddSpatialDocumentsModal.spec.tsx.snap @@ -232,7 +232,7 @@ exports[`AddSpatialDocumentsModal renders properly 1`] = ` class="ant-row ant-row-end" > + ); }; diff --git a/services/common/src/components/forms/__snapshots__/RenderCancelButton.spec.tsx.snap b/services/common/src/components/forms/__snapshots__/RenderCancelButton.spec.tsx.snap index f86ec102ff..a5c0633f38 100644 --- a/services/common/src/components/forms/__snapshots__/RenderCancelButton.spec.tsx.snap +++ b/services/common/src/components/forms/__snapshots__/RenderCancelButton.spec.tsx.snap @@ -8,7 +8,7 @@ exports[`RenderCancelButton component renders properly, does not show confirm on > + )} {isEditMode ? ( diff --git a/services/core-web/src/components/common/DocumentActions.tsx b/services/core-web/src/components/common/DocumentActions.tsx index 61c3450781..fe718fc481 100644 --- a/services/core-web/src/components/common/DocumentActions.tsx +++ b/services/core-web/src/components/common/DocumentActions.tsx @@ -65,7 +65,7 @@ export const DocumentActions: FC = (props) => { return (
- - ), - }, - { - key: "1", - icon: , - label: ( - - ), - }, - ]; - - const renderBulkActions = () => { - let element = ( - - ); - if (documentsCanBulkDropDown) { - element = ( - - - - ); - } - - return enableBulkActions &&
{element}
; - }; - - const handleRowSelectionChange = (value) => { - setRowSelection(value); - }; - - const rowSelectionObject: any = { - onChange: (selectedRowKeys: React.Key[], selectedRows: any) => { - handleRowSelectionChange(selectedRows); - }, - }; - - const bulkActionsProps = enableBulkActions - ? { - rowSelection: { - type: "checkbox", - ...rowSelectionObject, - }, - } - : {}; - - const versionProps = showVersionHistory - ? { - expandProps: { - childrenColumnName: "versions", - matchChildColumnsToParent: true, - recordDescription: "version history", - rowExpandable: (record) => record.number_prev_versions > 0, - }, - } - : {}; - - const coreTableProps = { - condition: isLoaded, - dataSource: documents, - columns: columns, - ...bulkActionsProps, - ...versionProps, - ...minimalProps, - }; - - return ( -
- - {renderBulkActions()} - {} -
- ); -}; - -export default DocumentTable; diff --git a/services/core-web/src/components/dashboard/customHomePage/SubscriptionTable.js b/services/core-web/src/components/dashboard/customHomePage/SubscriptionTable.js index 618cc3e6f6..4eabd5b72a 100644 --- a/services/core-web/src/components/dashboard/customHomePage/SubscriptionTable.js +++ b/services/core-web/src/components/dashboard/customHomePage/SubscriptionTable.js @@ -72,7 +72,7 @@ export class SubscriptionTable extends Component { dataIndex: "mineName", render: (text, record) => (
- {text} + {text}
), }, diff --git a/services/core-web/src/components/dashboard/minesHomePage/MineList.js b/services/core-web/src/components/dashboard/minesHomePage/MineList.js index 8eb393d3e0..7e759c7d2d 100644 --- a/services/core-web/src/components/dashboard/minesHomePage/MineList.js +++ b/services/core-web/src/components/dashboard/minesHomePage/MineList.js @@ -37,7 +37,7 @@ const columns = [ sorter: true, width: 150, render: (text, record) => ( - + {text} {record.verified_status && record.verified_status.healthy_ind && ( {
- + {props.mine.mine_name} {verifiedStatus && verifiedStatus.healthy_ind && ( { TSF {tsf}
{/* - +
diff --git a/services/core-web/src/components/mine/ContactInfo/ViewPartyRelationships.js b/services/core-web/src/components/mine/ContactInfo/ViewPartyRelationships.js index adcf5f1f9e..89609fba6d 100644 --- a/services/core-web/src/components/mine/ContactInfo/ViewPartyRelationships.js +++ b/services/core-web/src/components/mine/ContactInfo/ViewPartyRelationships.js @@ -400,20 +400,20 @@ export class ViewPartyRelationships extends Component { return ( partyRelationshipsInGroup.length !== 0 && [ - +

{this.getGroupTitle(group)}

, - + {partyRelationshipsInGroup.map((partyRelationship) => this.renderPartyRelationship(partyRelationship) )} {this.renderInactiveRelationships(partyRelationshipsInGroup)} , -
+


, @@ -437,7 +437,7 @@ export class ViewPartyRelationships extends Component { okText: "Ok", cancelText: "Cancel", onConfirm: () => - this.props.history.push(router.MINE_SUMMARY.dynamicRoute(this.props.mine.mine_guid)), + this.props.history.push(router.MINE_DASHBOARD.dynamicRoute(this.props.mine.mine_guid)), }, }[selectedPartyRelationshipType]); @@ -469,7 +469,6 @@ export class ViewPartyRelationships extends Component { placement="topRight" {...this.confirmationProps(this.state.selectedPartyRelationshipType)} > - {/* eslint-disable-next-line jsx-a11y/control-has-associated-label */} - - -
- ); -}; - -export default ViewPermitConditions; diff --git a/services/core-web/src/components/mine/Permit/__snapshots__/PermitConditions.spec.tsx.snap b/services/core-web/src/components/mine/Permit/__snapshots__/PermitConditions.spec.tsx.snap new file mode 100644 index 0000000000..a3f8a5cc02 --- /dev/null +++ b/services/core-web/src/components/mine/Permit/__snapshots__/PermitConditions.spec.tsx.snap @@ -0,0 +1,505 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`PermitConditions renders properly 1`] = ` +
+
+ +
+
+
+

+ Permit Conditions +

+
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+
+
+
+
+

+ Health and Safety + ( + 1 + ) +

+ +
+
+
+
+
+

+ 1. + + Section decade check including. +

+
+
+
+
+
+

+ Environmental Land and Watercourses + ( + 2 + ) +

+ +
+
+
+
+
+

+ 1. + + International clear those TV individual look. +

+
+
+

+ a. + + See store understand company interview value factor. +

+
+
+

+ i. + + Mr item fall study although. +

+
+
+
+
+
+
+

+ b. + + words words words sub-section +

+
+
+

+ i. + + a condition added underneath the section, with a lot of detail added to it, which is probably important for documents like permits +

+
+
+

+ 1. + + a detailed list item desribing exactly what must be done to accomplish the parent condition +

+
+
+
+
+

+ 2. + + but, that wasn't quite enough information, another list item will expand on other responsibilities associated with this permit +

+
+
+
+
+

+ 3. + + good things come in 3s, so another list item is added to the condition +

+
+
+

+ a. + + we want to show nesting to 5 levels, so one list item gets a child +

+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ 2. + + Another condition under the ELC condition category code, and it may even be long enough to take up 2 lines +

+
+
+

+ a. + + It should probably have a sub-item because that's pretty fun and normal for permit conditions. Really it should be long enough to have it cut off at some point if we just add more words, but the question is how many will be necessary? +

+
+
+
+
+
+
+
+

+ Reclamation and Closure Program + ( + 1 + ) +

+ +
+
+
+
+
+

+ 1. + + Reflect miss police tough such single force. +

+
+
+
+
+
+
+
+
+
+
+`; diff --git a/services/core-web/src/components/mine/Projects/DecisionPackageTab.js b/services/core-web/src/components/mine/Projects/DecisionPackageTab.js index 8d44a64884..88712afe8a 100644 --- a/services/core-web/src/components/mine/Projects/DecisionPackageTab.js +++ b/services/core-web/src/components/mine/Projects/DecisionPackageTab.js @@ -18,7 +18,7 @@ import { EDIT_OUTLINE_VIOLET } from "@/constants/assets"; import * as routes from "@/constants/routes"; import customPropTypes from "@/customPropTypes"; import ScrollSideMenu from "@mds/common/components/common/ScrollSideMenu"; -import DocumentTable from "@/components/common/DocumentTable"; +import DocumentTable from "@mds/common/components/documents/DocumentTable"; import UpdateDecisionPackageStatusForm from "@/components/Forms/majorMineApplication/UpdateDecisionPackageStatusForm"; import { modalConfig } from "@/components/modalContent/config"; import { getProjectDecisionPackageStatusCodesHash } from "@mds/common/redux/selectors/staticContentSelectors"; diff --git a/services/core-web/src/components/mine/Projects/MajorMineApplicationTab.js b/services/core-web/src/components/mine/Projects/MajorMineApplicationTab.js index 7c1f4d54f1..1d627ac938 100644 --- a/services/core-web/src/components/mine/Projects/MajorMineApplicationTab.js +++ b/services/core-web/src/components/mine/Projects/MajorMineApplicationTab.js @@ -16,7 +16,7 @@ import { getProject } from "@mds/common/redux/selectors/projectSelectors"; import * as routes from "@/constants/routes"; import UpdateMajorMineAppStatusForm from "@/components/Forms/majorMineApplication/UpdateMajorMineAppStatusForm"; import CustomPropTypes from "@/customPropTypes"; -import DocumentTable from "@/components/common/DocumentTable"; +import DocumentTable from "@mds/common/components/documents/DocumentTable"; import ScrollSideMenu from "@mds/common/components/common/ScrollSideMenu"; import { fetchMineDocuments } from "@mds/common/redux/actionCreators/mineActionCreator"; import { getMineDocuments } from "@mds/common/redux/selectors/mineSelectors"; diff --git a/services/core-web/src/components/mine/Projects/Project.tsx b/services/core-web/src/components/mine/Projects/Project.tsx index f4698892e4..2cfdda3ec5 100644 --- a/services/core-web/src/components/mine/Projects/Project.tsx +++ b/services/core-web/src/components/mine/Projects/Project.tsx @@ -16,7 +16,6 @@ import DecisionPackageTab from "@/components/mine/Projects/DecisionPackageTab"; import ProjectDescriptionTab from "@mds/common/components/project/ProjectDescriptionTab"; import { useFeatureFlag } from "@mds/common/providers/featureFlags/useFeatureFlag"; import ScrollSidePageWrapper from "@mds/common/components/common/ScrollSidePageWrapper"; -import { ScrollSideMenuProps } from "@mds/common/components/common/ScrollSideMenu"; import ProjectDocumentsTab from "@mds/common/components/projects/ProjectDocumentsTab"; const Project: FC = () => { @@ -165,23 +164,11 @@ const Project: FC = () => { }, ].filter(Boolean); - const sideBarRoute = { - url: GLOBAL_ROUTES?.EDIT_PROJECT, - params: [projectGuid, activeTab], - }; - - const scrollSideMenuProp: ScrollSideMenuProps = { - menuOptions: [], - featureUrlRoute: sideBarRoute.url.hashRoute, - featureUrlRouteArguments: sideBarRoute.params, - }; - return (
{ className: hideColumn(!props.isDashboardView), render: (text, record) => (
- {text} + {text}
), }, diff --git a/services/core-web/src/components/mine/Reports/ReportPage.tsx b/services/core-web/src/components/mine/Reports/ReportPage.tsx index a0c73935c7..e9c93d1d84 100644 --- a/services/core-web/src/components/mine/Reports/ReportPage.tsx +++ b/services/core-web/src/components/mine/Reports/ReportPage.tsx @@ -12,7 +12,6 @@ import { FORM, IMineReportSubmission, MINE_REPORT_STATUS_HASH, - MINE_REPORT_SUBMISSION_CODES, MineReportTypeUrlParam, } from "@mds/common"; import { getMineById } from "@mds/common/redux/selectors/mineSelectors"; @@ -42,9 +41,6 @@ const ReportPage: FC = () => { getLatestReportSubmission(state, reportGuid) ); - const [selectedStatus, setSelectedStatus] = useState( - latestSubmission?.mine_report_submission_status_code - ); const [isLoaded, setIsLoaded] = useState(Boolean(latestSubmission && mine)); const [isEditMode, setIsEditMode] = useState(false); @@ -69,10 +65,6 @@ const ReportPage: FC = () => { } }, [mineGuid, reportGuid]); - useEffect(() => { - setSelectedStatus(latestSubmission?.mine_report_submission_status_code); - }, [latestSubmission?.mine_report_submission_status_code]); - const cancelConfirmWrapper = (cancelFunction) => !isFormDirty ? cancelFunction() @@ -175,7 +167,7 @@ const ReportPage: FC = () => { className="page-header-title-tag tag-primary" > {mine?.mine_name} diff --git a/services/core-web/src/components/mine/Securities/MineBondTable.js b/services/core-web/src/components/mine/Securities/MineBondTable.js index b97330fdfc..09ad151421 100644 --- a/services/core-web/src/components/mine/Securities/MineBondTable.js +++ b/services/core-web/src/components/mine/Securities/MineBondTable.js @@ -99,8 +99,8 @@ export const MineBondTable = (props) => { return ( -
+
+
- Current Permittee - + +
-
-
+
+ +
+
-
-
-
- + + + +
-
-
-

- Permit Overview -

+

+ Permit Overview +

+
-
-
-

- Permit Details -

-
-
- - Issue Date - -
-
- Apr 01 2020 -
-
-
-
- - Authorization End Date - -
-
-
-
-
+ Permit Details +
- - Permitee - +
+ + Issue Date + +
+
+ Apr 01 2020 +
- Current Permittee +
+ + Authorization End Date + +
+
-
-
- - Permit Type - -
-
- Permit Amendment +
+ + Permitee + +
+
+ Current Permittee +
- - Permit Number - +
+ + Permit Type + +
+
+ Permit Amendment +
- C-12345 +
+ + Permit Number + +
+
+ C-12345 +
-
-
- - Tenure - +
+ + Tenure + +
+
+ Mineral, Placer +
- Mineral, Placer +
+ + Commodity + +
+
+ - +
- - Commodity - +
+ + Disturbance + +
+
+ - +
- - +
+ + Inspection Fee Status + +
+
+ - +
-
-
- - Disturbance - -
-
- - +
+ + Fee Exemption Note + +
+
+ +
- - Inspection Fee Status - -
-
- - +
+ + Description + +
+
+ Amendment +
-
-
-
- - Fee Exemption Note - -
-
- -
-
-
-
+ class="ant-divider ant-divider-horizontal" + role="separator" + />
- - Description - +
+ + Security + +
+
+ $ + 8000000.00 +
- Amendment +
+ + Security Received + +
+
+ Apr 03 2019 +
-
- diff --git a/services/core-web/src/tests/components/mine/Reports/__snapshots__/MineReportTable.spec.tsx.snap b/services/core-web/src/tests/components/mine/Reports/__snapshots__/MineReportTable.spec.tsx.snap index c9aa79c284..4f02cf91c6 100644 --- a/services/core-web/src/tests/components/mine/Reports/__snapshots__/MineReportTable.spec.tsx.snap +++ b/services/core-web/src/tests/components/mine/Reports/__snapshots__/MineReportTable.spec.tsx.snap @@ -543,7 +543,7 @@ exports[`MineReportTable renders properly 1`] = ` >
- ), - }, - ]; - - const renderBulkActions = () => { - const element = ( - - - - ); - return ( - enableBulkActions && ( -
{element}
- ) - ); - }; - - const handleRowSelectionChange = (value) => { - setRowSelection(value); - }; - - const rowSelectionObject: any = { - onChange: (selectedRowKeys: React.Key[], selectedRows: any) => { - handleRowSelectionChange(selectedRows); - }, - }; - - const bulkActionsProps = enableBulkActions - ? { - rowSelection: { - type: "checkbox", - ...rowSelectionObject, - }, - } - : {}; - - const versionProps = showVersionHistory - ? { - expandProps: { - childrenColumnName: "versions", - matchChildColumnsToParent: true, - recordDescription: "version history", - rowExpandable: (record) => record.number_prev_versions > 0, - }, - } - : {}; - - const coreTableProps = { - condition: isLoaded, - dataSource: documents, - columns: columns, - ...bulkActionsProps, - ...versionProps, - ...minimalProps, - }; - - return ( -
- {renderBulkActions()} - {} -
- ); -}; - -const mapStateToProps = (state) => ({ - userRoles: getUserAccessData(state), -}); - -// eslint-disable-next-line @typescript-eslint/no-shadow -const mapDispatchToProps = (dispatch) => - bindActionCreators( - { - openModal, - closeModal, - archiveMineDocuments, - openDocument, - }, - dispatch - ); - -export default connect(mapStateToProps, mapDispatchToProps)(DocumentTable); diff --git a/services/minespace-web/src/components/common/wrappers/ModalWrapper.tsx b/services/minespace-web/src/components/common/wrappers/ModalWrapper.tsx index fd18611a76..d926114a57 100644 --- a/services/minespace-web/src/components/common/wrappers/ModalWrapper.tsx +++ b/services/minespace-web/src/components/common/wrappers/ModalWrapper.tsx @@ -9,7 +9,7 @@ const ModalWrapper: FC = () => { const ChildComponent = useSelector(getContent); const childProps = useSelector(getProps); const dispatch = useDispatch(); - const dispatchCloseModal = () => dispatch(closeModal); + const dispatchCloseModal = () => dispatch(closeModal()); return ( diff --git a/services/minespace-web/src/components/dashboard/mine/variances/VarianceDetails.js b/services/minespace-web/src/components/dashboard/mine/variances/VarianceDetails.js index e542823419..780a0e5cde 100644 --- a/services/minespace-web/src/components/dashboard/mine/variances/VarianceDetails.js +++ b/services/minespace-web/src/components/dashboard/mine/variances/VarianceDetails.js @@ -3,7 +3,7 @@ import PropTypes from "prop-types"; import { Descriptions } from "antd"; import { formatDate } from "@common/utils/helpers"; import CustomPropTypes from "@/customPropTypes"; -import DocumentTable from "@/components/common/DocumentTable"; +import DocumentTable from "@mds/common/components/documents/DocumentTable"; import { documentNameColumn, uploadDateColumn } from "@/components/common/DocumentColumns"; import * as Strings from "@/constants/strings"; import { renderCategoryColumn } from "@mds/common/components/common/CoreTableCommonColumns"; diff --git a/services/minespace-web/src/components/modalContent/informationRequirementsTable/ViewFileHistoryModal.js b/services/minespace-web/src/components/modalContent/informationRequirementsTable/ViewFileHistoryModal.js index d583c676ae..83dea18b8d 100644 --- a/services/minespace-web/src/components/modalContent/informationRequirementsTable/ViewFileHistoryModal.js +++ b/services/minespace-web/src/components/modalContent/informationRequirementsTable/ViewFileHistoryModal.js @@ -2,7 +2,7 @@ import React from "react"; import PropTypes from "prop-types"; import { Button } from "antd"; import CustomPropTypes from "@/customPropTypes"; -import DocumentTable from "@/components/common/DocumentTable"; +import DocumentTable from "@mds/common/components/documents/DocumentTable"; import { renderCategoryColumn, renderDateColumn, diff --git a/services/minespace-web/src/components/pages/Project/DocumentsPage.js b/services/minespace-web/src/components/pages/Project/DocumentsPage.js index e59f7b1d63..1a4cb5b4bd 100644 --- a/services/minespace-web/src/components/pages/Project/DocumentsPage.js +++ b/services/minespace-web/src/components/pages/Project/DocumentsPage.js @@ -2,7 +2,7 @@ import React from "react"; import { Row, Col, Typography } from "antd"; import { withRouter } from "react-router-dom"; import PropTypes from "prop-types"; -import DocumentTable from "@/components/common/DocumentTable"; +import DocumentTable from "@mds/common/components/documents/DocumentTable"; const propTypes = { title: PropTypes.string.isRequired, diff --git a/services/minespace-web/src/styles/components/ScrollSideMenuWrapper.scss b/services/minespace-web/src/styles/components/ScrollSideMenuWrapper.scss index c3b4d6a8da..bd7fcb32e1 100644 --- a/services/minespace-web/src/styles/components/ScrollSideMenuWrapper.scss +++ b/services/minespace-web/src/styles/components/ScrollSideMenuWrapper.scss @@ -23,7 +23,7 @@ .ant-anchor-link { line-height: 2.2; border-bottom: none; - padding: 6px 16px; + padding: 11px 16px; } .ant-anchor-link-title { diff --git a/services/minespace-web/src/tests/components/Forms/incidents/__snapshots__/IncidentForm.spec.js.snap b/services/minespace-web/src/tests/components/Forms/incidents/__snapshots__/IncidentForm.spec.js.snap index 797678a754..836eb3d64d 100644 --- a/services/minespace-web/src/tests/components/Forms/incidents/__snapshots__/IncidentForm.spec.js.snap +++ b/services/minespace-web/src/tests/components/Forms/incidents/__snapshots__/IncidentForm.spec.js.snap @@ -573,7 +573,7 @@ exports[`IncidentForm renders properly 1`] = `
- - Primary Document - Spatial Components - Supporting Documents - { - props.isViewOnly = true; - props.documents = MOCK.VARIANCE.documents; - props.documentCategoryOptionsHash = MOCK.VARIANCE_DOCUMENT_CATEGORY_OPTIONS_HASH; - props.userInfo = { client_roles: ["mds_minespace_proponents"] }; -}; - -const setupDispatchProps = () => { - dispatchProps.removeDocument = jest.fn(() => Promise.resolve()); -}; - -beforeEach(() => { - setupProps(); - setupDispatchProps(); -}); - -describe("DocumentTable", () => { - it("renders properly", () => { - const component = shallow( - true, - }} - > - - - ); - expect(component).toMatchSnapshot(); - }); -}); diff --git a/services/minespace-web/src/tests/components/common/__snapshots__/DocumentTable.spec.js.snap b/services/minespace-web/src/tests/components/common/__snapshots__/DocumentTable.spec.js.snap deleted file mode 100644 index bcd38d1139..0000000000 --- a/services/minespace-web/src/tests/components/common/__snapshots__/DocumentTable.spec.js.snap +++ /dev/null @@ -1,33 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`DocumentTable renders properly 1`] = ` - -`; diff --git a/services/minespace-web/src/tests/components/dashboard/mine/variances/__snapshots__/VarianceDetails.spec.js.snap b/services/minespace-web/src/tests/components/dashboard/mine/variances/__snapshots__/VarianceDetails.spec.js.snap index 334f7af5e5..4630c6c93d 100644 --- a/services/minespace-web/src/tests/components/dashboard/mine/variances/__snapshots__/VarianceDetails.spec.js.snap +++ b/services/minespace-web/src/tests/components/dashboard/mine/variances/__snapshots__/VarianceDetails.spec.js.snap @@ -28,7 +28,7 @@ exports[`VarianceDetails renders properly 1`] = ` notesss - -