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

[Issue 81]: List view last action sorting and filtering #98

Merged
merged 3 commits into from
Jul 22, 2024

Conversation

wwelling
Copy link

@wwelling wwelling commented Jul 22, 2024

  • Add one to one action log on submission
  • Keep last action up to date when saving or deleting action log
  • Update dynamic submission list query to filter and sort action log entry and date
  • Add exception handler for file not found

image

Here is a migration script to update all last actions on submission.

WITH submissions AS (
  SELECT * 
  FROM submission 
  WHERE last_action_id IS NULL
),
last_action_logs AS (
  SELECT DISTINCT ON (s.id) al.id AS aid, s.id AS sid 
  FROM action_log al
  JOIN submissions s ON al.action_logs_id = s.id
  ORDER BY s.id, al.action_date DESC
)
UPDATE submission s
SET last_action_id = las.aid
FROM last_action_logs las
WHERE s.id = las.sid;

Here is the migration script to update the submission list columns:

UPDATE submission_list_column SET input_type_id = 8 WHERE id = 57;
UPDATE submission_list_column_value_path SET value_path = 'lastAction' WHERE submission_list_column_id = 56;
INSERT INTO submission_list_column_value_path (submission_list_column_id, value_path, value_path_order) VALUES (56, 'entry', 1), (57, 'lastAction', 0), (57, 'actionDate', 1);

@wwelling wwelling requested a review from qtamu July 22, 2024 18:02
@wwelling wwelling linked an issue Jul 22, 2024 that may be closed by this pull request
@coveralls
Copy link

Pull Request Test Coverage Report for Build 10045981059

Details

  • 17 of 79 (21.52%) changed or added relevant lines in 4 files are covered.
  • 20 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.2%) to 60.125%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/main/java/org/tdl/vireo/controller/advice/CustomResponseEntityExceptionHandler.java 0 3 0.0%
src/main/java/org/tdl/vireo/model/repo/impl/ActionLogRepoImpl.java 14 27 51.85%
src/main/java/org/tdl/vireo/model/repo/impl/SubmissionRepoImpl.java 0 46 0.0%
Files with Coverage Reduction New Missed Lines %
src/main/java/org/tdl/vireo/model/repo/impl/SubmissionRepoImpl.java 20 5.21%
Totals Coverage Status
Change from base Build 10010900184: -0.2%
Covered Lines: 8455
Relevant Lines: 13681

💛 - Coveralls

@wwelling wwelling merged commit 6d39d39 into sprint2-staging Jul 22, 2024
1 of 2 checks passed
@wwelling wwelling changed the title List view last action sorting and filtering [Issue 81]: List view last action sorting and filtering Jul 31, 2024
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.

Last Event display without values in List view
3 participants