-
Notifications
You must be signed in to change notification settings - Fork 38
[FIX] Core typescript errors #3453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 9 commits
dacf66d
2c5a875
dbdd7ee
747b4a8
a00bc65
995ba06
fd303c1
620acb4
9588468
3c9baa9
9e0b654
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { IMineIncident } from "./mineIncident.interface"; | ||
import { IMineIncidentDocument } from "./mineIncidentDocument.interface"; | ||
|
||
export interface IMineIncidentForm extends IMineIncident { | ||
initial_incident_documents: IMineIncidentDocument[], | ||
final_report_documents: IMineIncidentDocument[], | ||
internal_ministry_documents: IMineIncidentDocument[] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,24 @@ | ||
export interface ISearchResult { | ||
result: { | ||
id: string; | ||
value: string; | ||
}; | ||
import { IDocument } from "../document"; | ||
import { IMine } from "../mine.interface"; | ||
import { IMineDocument } from "../mineDocument.interface"; | ||
import { IParty } from "../party"; | ||
import { IPermit, IPermitAmendmentDocument } from "../permits"; | ||
|
||
export interface ISearchResult<T> { | ||
result: T; | ||
score: number; | ||
type: string; | ||
} | ||
|
||
export interface ISimpleSearchResult { | ||
id: string; | ||
value: string; | ||
} | ||
|
||
export interface ISearchResultList { | ||
mine: ISearchResult<IMine>[], | ||
mine_documents: ISearchResult<IMineDocument>[], | ||
party: ISearchResult<IParty>[], | ||
permit: ISearchResult<IPermit>[], | ||
permit_documents: ISearchResult<IPermitAmendmentDocument>[], | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
import React, { FC, useState } from "react"; | ||
import { useParams } from "react-router-dom"; | ||
import { useDispatch, useSelector } from "react-redux"; | ||
import { change, formValueSelector, getFormValues } from "@mds/common/components/forms/form"; | ||
import { Col, Row } from "antd"; | ||
import { IMineIncident } from "@mds/common/interfaces"; | ||
|
@@ -27,6 +26,7 @@ import IncidentFormMinistryFollowup from "@/components/Forms/incidents/IncidentF | |
import { removeDocumentFromMineIncident } from "@mds/common/redux/actionCreators/incidentActionCreator"; | ||
import FormWrapper from "@mds/common/components/forms/FormWrapper"; | ||
import RenderSubmitButton from "@mds/common/components/forms/RenderSubmitButton"; | ||
import { useAppDispatch, useAppSelector } from "@mds/common/redux/rootState"; | ||
|
||
export const INITIAL_INCIDENT_DOCUMENTS_FORM_FIELD = "initial_incident_documents"; | ||
export const FINAL_REPORT_DOCUMENTS_FORM_FIELD = "final_report_documents"; | ||
|
@@ -56,20 +56,20 @@ export const IncidentForm: FC<IncidentFormProps> = (props) => { | |
const { isEditMode, handlers: parentHandlers } = props; | ||
const isNewIncident = Boolean(!mineIncidentGuid); | ||
|
||
const dispatch = useDispatch(); | ||
const dispatch = useAppDispatch(); | ||
|
||
const incidentDeterminationOptions = useSelector(getDropdownIncidentDeterminationOptions); | ||
const incidentStatusCodeHash = useSelector(getIncidentStatusCodeHash); | ||
const dangerousOccurenceSubparagraphOptions = useSelector( | ||
const incidentDeterminationOptions = useAppSelector(getDropdownIncidentDeterminationOptions); | ||
const incidentStatusCodeHash = useAppSelector(getIncidentStatusCodeHash); | ||
const dangerousOccurenceSubparagraphOptions = useAppSelector( | ||
getDangerousOccurrenceSubparagraphOptions | ||
); | ||
const incidentFollowUpActionOptions = useSelector(getDropdownIncidentFollowupActionOptions); | ||
const inspectorOptions = useSelector(getDropdownInspectors) || []; | ||
const incidentFollowUpActionOptions = useAppSelector(getDropdownIncidentFollowupActionOptions); | ||
const inspectorOptions = useAppSelector(getDropdownInspectors) || []; | ||
const selector = formValueSelector(FORM.ADD_EDIT_INCIDENT); | ||
const documents = useSelector((state) => selector(state, "documents")) || []; | ||
const formValues = useSelector((state) => getFormValues(FORM.ADD_EDIT_INCIDENT)(state)) || {}; | ||
const dropdownIncidentStatusCodeOptions = useSelector(getDropdownIncidentStatusCodeOptions); | ||
const isPristine = useSelector((state) => state.form[FORM.ADD_EDIT_INCIDENT]?.pristine); | ||
const documents = useAppSelector((state) => selector(state, "documents")) || []; | ||
const formValues = useAppSelector((state) => getFormValues(FORM.ADD_EDIT_INCIDENT)(state)) || {}; | ||
const dropdownIncidentStatusCodeOptions = useAppSelector(getDropdownIncidentStatusCodeOptions); | ||
const isPristine = useAppSelector((state) => state.form[FORM.ADD_EDIT_INCIDENT]?.pristine); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. perhaps a little out of scope, but there is a redux-form selector There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have refactored it a little :) |
||
|
||
const [uploadedFiles, setUploadedFiles] = useState([]); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we just want to add these properties to IOption? Because value/label is required in both and the rest is optional
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeeeeah it looks like where it's used is being passed into RenderSelect/RenderMultiSelect, which expects IOption for it. May as well make it the same
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, done