-
Notifications
You must be signed in to change notification settings - Fork 4
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
Ability to view temp records in the crashes list and also soft-delete them #1495
Merged
Merged
Changes from 19 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
8bfb5ee
update metadata permissions etc
roseeichelmann fbd5886
add is_deleted = false where clause
roseeichelmann 4efedfa
soft delete mutations
roseeichelmann 771726d
handle soft delete
roseeichelmann 1c59d64
default to private dr false on temp record creation
roseeichelmann b1a4eb1
add/remove permissions for these tables
roseeichelmann 9fc34eb
create a separate soft delete mutation for person records
roseeichelmann e53e78f
pass useremail
roseeichelmann 0479b04
loop thru each unit and soft delete all the person records, then dele…
roseeichelmann b551433
fix dom warning
roseeichelmann c1f9c75
dont actually need to query person id here
roseeichelmann 121a69c
update comment
roseeichelmann c1e6764
format these
roseeichelmann d90f9d5
remove is_temp_record to fix inconsistent metadata this doesnt exist …
roseeichelmann 72fad68
add permissions
roseeichelmann 4a9180a
adjust all other views to filter out soft deleted records
roseeichelmann 337fbd1
add record locator to fatalities view, filter out soft deleted records
roseeichelmann 58d2748
use record locator instead of crash id
roseeichelmann e7bafc2
wow there was such a better more simple way to do this i had an enlig…
roseeichelmann 52c42a8
toggle off successful record alert whenever temp record is deleted
roseeichelmann 7f16699
query is_temp_record
roseeichelmann 8eaa702
remove secondary address is missing
roseeichelmann 378d0cb
different message from missing crash diagram if a temp record
roseeichelmann a1b32e8
remove the this cannot be undone message
roseeichelmann File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -173,6 +173,7 @@ create or replace view person_injury_metrics_view as ( | |
left join | ||
public.crashes as crashes | ||
on units.crash_id = crashes.id | ||
where people.is_deleted = false | ||
); | ||
|
||
create or replace view unit_injury_metrics_view as | ||
|
@@ -215,6 +216,7 @@ create or replace view unit_injury_metrics_view as | |
left join | ||
person_injury_metrics_view | ||
on units.id = person_injury_metrics_view.unit_id | ||
where units.is_deleted = false | ||
group by | ||
units.id | ||
); | ||
|
@@ -320,6 +322,7 @@ create or replace view crash_injury_metrics_view as | |
left join | ||
person_injury_metrics_view | ||
on crashes.id = person_injury_metrics_view.crash_id | ||
where crashes.is_deleted = false | ||
group by | ||
crashes.id, | ||
crashes.crash_id | ||
|
@@ -419,6 +422,7 @@ left join | |
left join | ||
lookups.injry_sev_lkp | ||
on lookups.injry_sev_lkp.id = crash_injury_metrics_view.crash_injry_sev_id | ||
where crashes.is_deleted = false | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. crashes list view only has records that havent been soft deleted now |
||
order by id asc; | ||
|
||
create view locations_list_view as ( | ||
|
@@ -561,7 +565,7 @@ left join lateral ( | |
left join | ||
lookups.collsn_lkp | ||
on public.crashes.fhe_collsn_id = lookups.collsn_lkp.id | ||
where crashes.crash_timestamp >= (now() - '5 years'::interval)::date | ||
where crashes.is_deleted = false and crashes.crash_timestamp >= (now() - '5 years'::interval)::date | ||
union all | ||
select | ||
aab.form_id as crash_id, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updating all of these views to filter out soft deleted records
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i made a todo that we should index those columns 👍