-
Notifications
You must be signed in to change notification settings - Fork 14
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
4791 add report versioning #5533
Open
fergie-nz
wants to merge
32
commits into
develop
Choose a base branch
from
4791-add-report-versioning
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+411
β76
Open
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
e6c170b
Add versioning sort to ReportRepo
fergie-nz 841e2f3
Add code and is_custom filters
fergie-nz 1d1548d
Add only upsert standard reports
fergie-nz 50d3403
Also add check for don't upsert old report versions
fergie-nz 7d3ed26
Fix loop logic
fergie-nz 9cb8f7c
Add code to report node api
fergie-nz 3bc4682
Add version to schema
fergie-nz 9cf6c6b
Add front end mapping
fergie-nz 5a8975c
Add version compare package
fergie-nz 1e94997
Add version compare when comparing version strings
fergie-nz deeae60
Merge branch 'v2.4.0' into 4791-add-report-versioning
fergie-nz 834f2a2
Remove front end report filtering
fergie-nz d9240a8
Add get latest report version to service layer
fergie-nz c7ba894
Remove unnecessary changes
fergie-nz 8b3bed3
Simplify upsert logic
fergie-nz 920bd33
Remove unused repo function
fergie-nz f494a95
Remove unused imports
fergie-nz aefe758
Reset formatting
fergie-nz df99155
Rename to count
fergie-nz 2a11c29
Add mock reports
fergie-nz a5ccccc
Format reports
fergie-nz 2ee5a38
Add basic filter method scaffold
fergie-nz 89a2a20
Add check for correct version to show
fergie-nz 2808db6
Add sub query for metadata only
fergie-nz fd484a0
minimise changes in cli
fergie-nz 700e1a4
remove unwanted changes
fergie-nz 916974f
remove unwanted changes
fergie-nz 516f705
Remove unused pagination
fergie-nz 0c66f6a
Rename fields
fergie-nz 9503c67
Add clippy recommendations
fergie-nz 14afadc
Rename variable for ease of understanding
fergie-nz b618482
Remove unused struct
fergie-nz 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
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
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 |
---|---|---|
|
@@ -93,6 +93,26 @@ impl Default for ReportRow { | |
} | ||
} | ||
|
||
#[derive(Clone, Insertable, Queryable, Debug, PartialEq, Eq, AsChangeset, Selectable)] | ||
#[diesel(table_name = report)] | ||
pub struct ReportMetaDataRow { | ||
pub id: String, | ||
pub is_custom: bool, | ||
pub version: String, | ||
pub code: String, | ||
} | ||
|
||
impl Default for ReportMetaDataRow { | ||
fn default() -> Self { | ||
Self { | ||
id: Default::default(), | ||
is_custom: true, | ||
version: Default::default(), | ||
code: Default::default(), | ||
} | ||
} | ||
} | ||
|
||
pub struct ReportRowRepository<'a> { | ||
connection: &'a StorageConnection, | ||
} | ||
|
@@ -110,19 +130,6 @@ impl<'a> ReportRowRepository<'a> { | |
Ok(result) | ||
} | ||
|
||
pub fn find_one_by_code_and_version( | ||
&self, | ||
code: &str, | ||
version: &str, | ||
) -> Result<Option<ReportRow>, RepositoryError> { | ||
let result = report_dsl::report | ||
.filter(report_dsl::code.eq(code)) | ||
.filter(report_dsl::version.eq(version)) | ||
.first(self.connection.lock().connection()) | ||
.optional()?; | ||
Ok(result) | ||
} | ||
|
||
Comment on lines
-113
to
-125
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. Removing as not anymore |
||
pub fn upsert_one(&self, row: &ReportRow) -> Result<(), RepositoryError> { | ||
diesel::insert_into(report_dsl::report) | ||
.values(row) | ||
|
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.
I have removed pagination as we won't use it for these queries.