Skip to content
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

Merged
merged 10 commits into from
Feb 13, 2024
Merged

[MDS-5769] CRR - Edit Mode #2944

merged 10 commits into from
Feb 13, 2024

Conversation

taraepp
Copy link
Collaborator

@taraepp taraepp commented Feb 8, 2024

Objective

  • bring over data fields from mine report to mine report submission in order to track changes
  • also, be able to save and update reports both on MS & CORE
    • currently MS users only able to add documents, not make any other changes
    • CORE users able to change everything, including updating the status
    • comments not implemented
    • contacts implemented (after another push...)
    • documents can only be added at this time

MDS-5769

Why are you making this change? Provide a short explanation and/or screenshots

return resp.data;
},
{
fulfilled: (state, action) => {
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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({
Copy link
Collaborator Author

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):
Copy link
Collaborator Author

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) => {
Copy link
Collaborator

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({
Copy link
Collaborator

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.

matbusby-fw
matbusby-fw previously approved these changes Feb 9, 2024
Copy link
Collaborator

@matbusby-fw matbusby-fw left a 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 🥧

asinn134
asinn134 previously approved these changes Feb 9, 2024
@taraepp taraepp dismissed stale reviews from asinn134 and matbusby-fw via d10cabd February 9, 2024 22:55
Copy link

Quality Gate Failed Quality Gate failed for 'bcgov-sonarcloud_mds_minespace-web'

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

Copy link

Quality Gate Failed Quality Gate failed for 'bcgov-sonarcloud_mds_common'

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

Copy link

Quality Gate Failed Quality Gate failed for 'bcgov-sonarcloud_mds_core-web'

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

Copy link

Quality Gate Failed Quality Gate failed for 'bcgov-sonarcloud_mds_core-api'

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

Copy link
Contributor

@henryoforeh-dev henryoforeh-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Copy link
Collaborator

@asinn134 asinn134 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work 👍

@henryoforeh-dev henryoforeh-dev merged commit 51e5436 into develop Feb 13, 2024
16 of 20 checks passed
@henryoforeh-dev henryoforeh-dev deleted the mds-5769-crr-edit branch February 13, 2024 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants