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

feat: new UX for submitting changes #224

Merged
merged 8 commits into from
Jul 4, 2023
Merged

feat: new UX for submitting changes #224

merged 8 commits into from
Jul 4, 2023

Conversation

diivi
Copy link
Member

@diivi diivi commented Feb 9, 2023

What

  • Floating Action Button that appears when a change is made to the nodeObject

Screenshot

image

Fixes bug(s)

@diivi diivi requested a review from a team as a code owner February 9, 2023 15:04
@diivi diivi requested a review from nobeeakon February 9, 2023 15:05
useEffect(() => {
if (nodeObject && originalNodeObject) {
const changesMade =
JSON.stringify(nodeObject) !== JSON.stringify(originalNodeObject);
Copy link
Collaborator

Choose a reason for hiding this comment

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

JSON.stringify does not ensure that the strings will have the same shape. Let's use https://www.npmjs.com/package/fast-deep-equal for this. Also, no need for this to be a state, it can be a derived value

</Button>
{/* Fab for submitting edits */}
{changesMade && (
<Fab
Copy link
Collaborator

Choose a reason for hiding this comment

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

could we add some background color for the Fab, just so that the button is not floating on top of the content?

const [updateChildren, setUpdateChildren] = useState([]); // Storing updates of children in node
const [open, setOpen] = useState(false); // Used for Dialog component
const [changesMade, setChangesMade] = useState(false); // Used for displaying Fab
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can probably name this to isNewChange?

Copy link
Collaborator

Choose a reason for hiding this comment

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

what about hasChanges

@@ -54,6 +67,7 @@ const AccumulateAllComponents = ({ id, taxonomyName, branchName }) => {
});
}
setNodeObject(duplicateNode);
setOriginalNodeObject(JSON.parse(JSON.stringify(duplicateNode))); // Deep copy
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we need the parse and stringify?

@aadarsh-ram
Copy link
Collaborator

@diivi Can you resolve the conflicts? This PR seems to be stalled for a long time. Is there anything you need help with?

@diivi
Copy link
Member Author

diivi commented May 24, 2023

@diivi Can you resolve the conflicts? This PR seems to be stalled for a long time. Is there anything you need help with?

Unfortunately, I don't have access to the device I set this project up on, so I'll have to set it up again some time 😞

Copy link
Collaborator

@aadarsh-ram aadarsh-ram left a comment

Choose a reason for hiding this comment

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

@eeshaanSA Check out the comments and also run lint before you're committing.

<ListAllEntryProperties
nodeObject={nodeObject}
setNodeObject={setNodeObject}
/>
{changesMade && (
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please change the variable name to hasChanges. This makes it more understandable.

Comment on lines 162 to 163
minHeight : "50px",
borderRadius : "20px",
Copy link
Collaborator

Choose a reason for hiding this comment

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

If possible, please make the dimensions in relative units. Will be easier when everything is being made responsive.

@eeshaanSA
Copy link
Contributor

eeshaanSA commented Jun 28, 2023

@eeshaanSA Check out the comments and also run lint before you're committing.

thanks. On it.

Copy link
Collaborator

@aadarsh-ram aadarsh-ram left a comment

Choose a reason for hiding this comment

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

Thanks @eeshaanSA @diivi!

@aadarsh-ram aadarsh-ram merged commit 8525351 into main Jul 4, 2023
7 checks passed
@aadarsh-ram aadarsh-ram deleted the new-save-ux branch July 4, 2023 19:20
@diivi
Copy link
Member Author

diivi commented Jul 5, 2023

@eeshaanSA thanks for taking this past the finish line!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

4 participants