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: project change intervals on preset change #1063

Closed

Conversation

david-code
Copy link
Contributor

@david-code david-code commented Dec 19, 2023

Description

  • Change project depth intervals when preset changes
  • Delete old project intervals
  • Delete old depth dependent data

Checklist

  • Corresponding issue has been opened
  • New tests added

Related Issues

Fixes #....

Verification steps

David Code Howard added 7 commits December 18, 2023 13:54
Ran into a bug on the frontend when I tried creating a new
project. This commit makes sure that the project has a soil project
settings associated it. It also allows this to be disabled if we're
creating a project from somewhere where the project soil settings is
not necessary.
with transaction.atomic():
result = super().save(*args, **kwargs)
if "depth_interval_preset" in dirty_fields or not self.id:
# delete project intervals...
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# delete project intervals...
# delete project intervals

Copy link
Member

@shrouxm shrouxm left a comment

Choose a reason for hiding this comment

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

comment: my thinking when designing the backend data format for this was that the preset data would be stored on the client rather than updated in the backend. so the actual project depth interval rows would only represent the depth intervals for a custom depth interval selection, and when a preset is selected the client just ignores those values. this was intended to be a low implementation/UX complexity safeguard against accidental data deletion (since otherwise the only thing preventing someone from deleting all their project data by changing the preset is a confirmation dialog that can easily be mis-clicked). this definitely makes the API more consistent which is nice, but i'm not sure we should go ahead with it until we can replace that safeguard

@david-code
Copy link
Contributor Author

Superseded by #1081, closing

@david-code david-code closed this Jan 10, 2024
@david-code david-code deleted the feat/project-change-intervals-on-preset-change branch January 10, 2024 15:28
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.

3 participants