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

Do not forget current household when clicking on policy display carousel #947

Merged
merged 1 commit into from
Dec 11, 2023

Conversation

abhcs
Copy link
Collaborator

@abhcs abhcs commented Dec 10, 2023

Fixed #485.

According to the bug reproduction video, the household got lost after clicking on the current reform item in the policy's right sidebar. I fixed the issue by copying the existing search parameters for the new URL instead of creating the new URL from scratch.

On carrying out the policy edits suggested by the reproduction video, I noticed that the placeholder in the parameter editor did not reflect the last edit. This was due to a bug introduced in pull request #839 where I ignored the reform when creating the placeholder text. This bug is also fixed here.

Finally, I have also added a space before the 'This parameter is yearly.' sentence.

🤖[deprecated] Generated by Copilot at 3ba1cf0

Summary

🐛♻️📏

Fixed a bug and refactored some components in the policy input and display pages. Improved the input field value and rendering for ParameterEditor.jsx and the URL state management for PolicyDisplay in PolicyRightSidebar.jsx.

We are the masters of the policy display
We fix the bugs and make the input obey
We use the hooks to manage the URL state
We refactor the code and make it great

Walkthrough

  • Fix a bug that caused the input field to show the wrong value for reformed parameters before the start date (link, link)
  • Refactor the URL state management in PolicyDisplay component in PolicyRightSidebar.jsx (link, link)
  • Add a space before the sentence that describes the period of the parameter in ParameterEditor.jsx (link)

@@ -117,7 +116,7 @@ export default function ParameterEditor(props) {
);

const timePeriodSentence = parameter.period
? `This parameter is ${parameter.period}ly.`
? ` This parameter is ${parameter.period}ly.`
Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you!

newSearchParams,
)}`;
navigate(newUrl);
const newSearchParams = copySearchParams(searchParams);
Copy link
Contributor

Choose a reason for hiding this comment

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

Ah yep makes sense.

@nikhilwoodruff nikhilwoodruff merged commit c918f1c into PolicyEngine:master Dec 11, 2023
3 checks passed
@abhcs abhcs deleted the fix-issue-485 branch December 16, 2023 22:02
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.

Household sometimes doesn't persist after creating a reform
2 participants