-
Notifications
You must be signed in to change notification settings - Fork 9
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
Field of law improvements #2342
Conversation
RISDEV-0000
RISDEV-5347
RISDEV-0000
RISDEV-0000
RISDEV-5347
RISDEV-5347
RISDEV-5349
RISDEV-5344
RISDEV-5344
RISDEV-0000
RISDEV-0000
RISDEV-0000
RISDEV-3581
RISDEV-5344
RISDEV-0000
RISDEV-5347
RISDEV-5344
# Conflicts: # frontend/src/services/comboboxItemService.ts
RISDEV-5344
RISDEV-5344
RISDEV-5414
a8cb6a7
to
667bad3
Compare
RISDEV-5414
RISDEV-5414
RISDEV-5417
RISDEV-5414
RISDEV-3581
RISDEV-3581
RISDEV-3581
RISDEV-3581
RISDEV-5342
RISDEV-3581
RISDEV-3581
RISDEV-3581
RISDEV-3581
RISDEV-5541
RISDEV-5541
# Conflicts: # frontend/src/components/FieldOfLawMain.vue
RISDEV-0000
RISDEV-3581
RISDEV-3581
RISDEV-3581
RISDEV-3581
RISDEV-3581
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.
@elaydis @leonie-koch Wow, I am very impressed! This is such a huge improvement, using this component feels great. Great job! 👏 I left a lot of comments, feel free to resolve them without comment/explanation if not relevant. :-)
frontend/test/components/periodicalEvaluation/handover/periodicalEditionHandover.spec.ts
Outdated
Show resolved
Hide resolved
...end/src/main/java/de/bund/digitalservice/ris/caselaw/adapter/database/jpa/FieldOfLawDTO.java
Outdated
Show resolved
Hide resolved
@@ -88,14 +88,14 @@ public List<FieldOfLaw> findBySearchTerms(String[] searchTerms) { | |||
} | |||
|
|||
return listWithFirstSearchTerm.stream() | |||
.filter(fieldOfLawDTO -> returnTrueIfInTextOrIdentifier(fieldOfLawDTO, searchTerms)) | |||
.filter(fieldOfLawDTO -> returnTrueIfInText(fieldOfLawDTO, searchTerms)) |
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.
question: Why do we query the database with only one search term instead of all?
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.
hmm not sure if I understand the question correctly 🤔 you mean write a query that directly queries with identifier and text combined in the database?
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.
Above we query the database with only the first searchTerm:
repository.findAllByNotationAndIdentifierContainingIgnoreCaseOrTextContainingIgnoreCase(
searchTerms[0])
Then we filter the results in memory.
An alternative would be to directly filter for multiple searchTerms in the database (the same we do for the first search term, but for each term and then connected via AND
)
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 just checkend and apparently the jpa method name magic does not support arrays, so you would need either native SQL or better use the Criteria API. -> The same as comment above, we can ignore this.
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.
💡 thanks for checking this! criteria API sounds really promising
@@ -18,9 +18,16 @@ public interface FieldOfLawRepository { | |||
|
|||
List<FieldOfLaw> findBySearchTerms(String[] searchTerms); | |||
|
|||
List<FieldOfLaw> findByNormStr(String normStr); | |||
List<FieldOfLaw> findByNorm(String normStr); |
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.
non-blocking idea: Instead of having specific methods for all, write one method with the criteriaAPI and dynamically construct the query with the search parameters that are present.
...nd/digitalservice/ris/caselaw/adapter/database/jpa/PostgresFieldOfLawRepositoryImplTest.java
Outdated
Show resolved
Hide resolved
RISDEV-3581
RISDEV-3581
RISDEV-3581
RISDEV-3581
@kiwikern again thank you so much for taking the time and leaving all those helpful comments 🫶 I will merge now and look into improving the backend tomorrow so that users already get the new experience they were promised |
RISDEV-5342