-
Notifications
You must be signed in to change notification settings - Fork 6
Update checkConfig class and to benefit configuration flows to use checkConfig #228
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
0f40f53
updated frontend to use checkConfigs instead of EligibiltyChecks in b…
Michael-Dratch 8dcb9c4
update library schema parsing for new check format
Michael-Dratch d3607d5
added module to checkConfig
Michael-Dratch 6313a67
remove uneeded logs
Michael-Dratch 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
64 changes: 0 additions & 64 deletions
64
builder-api/src/main/java/org/acme/model/domain/InputDefinition.java
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -87,11 +87,33 @@ public List<EligibilityCheck> getLatestVersionPublishedCustomChecks(String userI | |
| .collect(java.util.stream.Collectors.toMap( | ||
| check -> getPublishedPrefix(check), | ||
| check -> check, | ||
| (check1, check2) -> check1.getVersion() > check2.getVersion() ? check1 : check2 | ||
| (check1, check2) -> compareVersions(check1.getVersion(), check2.getVersion()) > 0 ? check1 : check2 | ||
| )); | ||
| return new ArrayList<>(latestVersionMap.values()); | ||
| } | ||
|
|
||
| private static int compareVersions(String v1, String v2) { | ||
|
Collaborator
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. nit: I'd really love a file for util functions related to version numbers, but that can be a future change. |
||
| int[] a = normalize(v1); | ||
| int[] b = normalize(v2); | ||
|
|
||
| for (int i = 0; i < 3; i++) { | ||
| if (a[i] != b[i]) { | ||
| return a[i] - b[i]; | ||
| } | ||
| } | ||
| return 0; | ||
| } | ||
|
|
||
| private static int[] normalize(String version) { | ||
| String[] parts = version.split("\\."); | ||
| int[] nums = new int[] {0, 0, 0}; | ||
|
|
||
| for (int i = 0; i < parts.length && i < 3; i++) { | ||
| nums[i] = Integer.parseInt(parts[i]); | ||
| } | ||
| return nums; | ||
| } | ||
|
|
||
| public List<EligibilityCheck> getPublishedCheckVersions(EligibilityCheck workingCustomCheck){ | ||
| Map<String, String> fieldValues = Map.of( | ||
| "ownerId", workingCustomCheck.getOwnerId(), | ||
|
|
||
This file contains hidden or 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 hidden or 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.
issue: I'm wondering about
moduleand whether that should be here too. We can already derive it from thecheckId, but that's true ofversionas well, so maybe we don't even needversionhere as it's own param? We should try to decide if anything already incheckIdis pulled fromcheckId, or if it's stored redundantly.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'll add module, I'm worried that storing data in the id itself was a bad idea and would like to rely more on the actual attributes
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.
Sounds good 🫡
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.
For what it's worth I think the composite property was a cool idea, but it may make sense to make an Index in the Firestore Database for that purpose instead.