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

#2104 delete manufac #2143

Merged
merged 26 commits into from
Apr 19, 2024
Merged

#2104 delete manufac #2143

merged 26 commits into from
Apr 19, 2024

Conversation

will-anderson0
Copy link
Contributor

@will-anderson0 will-anderson0 commented Feb 18, 2024

Changes

I made the delete button next to the manufacturers so you can delete them and there is a warning that pops up to check if you want to confirm.

Notes

The actual deletion of the manufacturers works but only visually, it does not delete out of the database so when you go to create a new manufacturer it loads everything that should have been deleted plus the manufacturer you just made. I tried to make an endpoint to delete the manufacturer but I am not sure where I went wrong.

Screenshots

image image image

To Do

Any remaining things that need to get done

  • Delete the manufacturer out of the database, currently only deletes visually

Checklist

It can be helpful to check the Checks and Files changed tabs.
Please review the contributor guide and reach out to your Tech Lead if anything is unclear.
Please request reviewers and ping on slack only after you've gone through this whole checklist.

  • All commits are tagged with the ticket number
  • No linting errors / newline at end of file warnings
  • All code follows repository-configured prettier formatting
  • No merge conflicts
  • All checks passing
  • Screenshots of UI changes (see Screenshots section)
  • Remove any non-applicable sections of this template
  • Assign the PR to yourself
  • No yarn.lock changes (unless dependencies have changed)
  • Request reviewers & ping on Slack
  • PR is linked to the ticket (fill in the closes line below)

Closes #2104

Copy link
Contributor

@ryanhowe28 ryanhowe28 left a comment

Choose a reason for hiding this comment

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

Should not have yarn lock changes

src/frontend/src/apis/bom.api.ts Outdated Show resolved Hide resolved
src/frontend/src/hooks/bom.hooks.ts Show resolved Hide resolved
src/frontend/src/components/ManufacturerDeleteButton.tsx Outdated Show resolved Hide resolved
src/frontend/src/components/ManufacturerDeleteButton.tsx Outdated Show resolved Hide resolved
src/frontend/src/components/ManufacturerDeleteButton.tsx Outdated Show resolved Hide resolved
Copy link
Contributor

@ryanhowe28 ryanhowe28 left a comment

Choose a reason for hiding this comment

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

Something got extremely messed up all of your checks are failing right now. Think it had to do with your yarn lock stuff

Copy link
Contributor

@ryanhowe28 ryanhowe28 left a comment

Choose a reason for hiding this comment

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

Looks pretty good, just small changes

ryanhowe28
ryanhowe28 previously approved these changes Feb 29, 2024
Copy link
Contributor

@ryanhowe28 ryanhowe28 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@walker-sean walker-sean left a comment

Choose a reason for hiding this comment

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

Nice job so far!

Copy link
Contributor

@RChandler234 RChandler234 left a comment

Choose a reason for hiding this comment

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

right now the endpoint is erroring but not actually showing the error in the frontend, I think removing the two asyncs should fix it, but lmk if it doesn't

Copy link
Contributor

@RChandler234 RChandler234 left a comment

Choose a reason for hiding this comment

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

This one's weirder than I initially thought, get me at the meeting tmrw and I can explain how to do it more, but basically, we're going to have to go back to soft deleting manufacturers in the database (gonna require a schema change and changing the backend endpoints a bit)

Copy link
Contributor

@ryanhowe28 ryanhowe28 left a comment

Choose a reason for hiding this comment

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

  1. Change the schema to have a dateDeleted field for a manufacturer, kinda opposite of what this PR did, this will be a custom migration so we dont wanna do a prisma migrate but we will need to manually edit the sql files ourselves, #1989 hard deleted delete manufacturer endpoint #2044

  2. edit the endpoints that this effects

Copy link
Contributor

@ryanhowe28 ryanhowe28 left a comment

Choose a reason for hiding this comment

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

Then we are going to wanna display the manufacturers where the query args say it is true, remember what reid was showing in the meeting, will probably need to add it in, take a look at some of the other stuff we have dateDeleted for and see how they do it

Copy link
Contributor

@RChandler234 RChandler234 left a comment

Choose a reason for hiding this comment

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

LGTM 🔥

@RChandler234 RChandler234 merged commit 416c36b into develop Apr 19, 2024
4 checks passed
@RChandler234 RChandler234 deleted the #2104-delete-manufac branch April 19, 2024 01:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Delete Manufacturer Frontend
4 participants