-
Notifications
You must be signed in to change notification settings - Fork 38
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
[MDS-5769] CRR - Edit Mode #2944
Conversation
return resp.data; | ||
}, | ||
{ | ||
fulfilled: (state, action) => { |
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.
the fulfilled/rejected config (also available: pending, settled- I just didn't need them) is pretty neat, but it can't dispatch actions and it can't trigger a toast notification. It can change the slice state though. That's why I gave a success toast message param to custom axios.
@@ -391,13 +403,14 @@ const ReportDetailsForm: FC<ReportDetailsFormProps> = ({ | |||
/> | |||
)} | |||
{isEditMode && ( | |||
<ReportSubmissions | |||
<ReportFileUpload |
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.
It's showing as a completely new file, but I changed ReportSubmissions --> ReportFileUpload, since we are only dealing with one submission and don't really need to parse its documents (much simpler here at least)
import { buildCreateSlice, asyncThunkCreator } from "@reduxjs/toolkit"; | ||
|
||
// https://redux-toolkit.js.org/api/createslice#createasyncthunk | ||
export const createAppSlice = buildCreateSlice({ |
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.
literally copied and pasted this from their documentation. For bundle size reasons.
@@ -55,3 +55,14 @@ def find_by_report_submission_id(cls, _id): | |||
def find_public_by_report_submission_id(cls, _id): | |||
return cls.query.filter_by(mine_report_submission_id=_id).filter_by( | |||
deleted_ind=False).filter_by(comment_visibility_ind=True).all() | |||
|
|||
def json(self): |
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.
testing got easier when I could call .json()
const instance = axios.create(); | ||
|
||
instance.interceptors.response.use( | ||
(response) => response, | ||
(response) => { |
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.
Nice!
console.log(action.error.stack); | ||
}; | ||
|
||
const submissionSlice = createAppSlice({ |
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.
This is cool! I like the concept of consolidating this functionality.
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.
Nice work! Love bringing in the slice 🥧
…urrent submission documents, modify the URL for reports page so it's not so specific to CCR
…on on reports table on CORE because currently reports page can't open in edit mode
…est that modifies different types of fields. Migrate mine_report_contacts to track by submission
f34eec5
to
512b782
Compare
…tory. remove unused imports
Quality Gate failed for 'bcgov-sonarcloud_mds_minespace-web'Failed conditions |
Quality Gate failed for 'bcgov-sonarcloud_mds_common'Failed conditions |
Quality Gate failed for 'bcgov-sonarcloud_mds_core-web'Failed conditions |
Quality Gate failed for 'bcgov-sonarcloud_mds_core-api'Failed conditions |
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.
Nice!
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.
Nice work 👍
Objective
MDS-5769
Why are you making this change? Provide a short explanation and/or screenshots