-
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
Closes #2554: Generalize Suggestion box to support controlled vocabulary #2555
Closes #2554: Generalize Suggestion box to support controlled vocabulary #2555
Conversation
357ae52
to
be984a2
Compare
...erse-webapp/src/main/java/edu/harvard/iq/dataverse/ControlledVocabularyValueServiceBean.java
Outdated
Show resolved
Hide resolved
...va/edu/harvard/iq/dataverse/dataset/metadata/inputRenderer/SuggestionInputFieldRenderer.java
Outdated
Show resolved
Hide resolved
...va/edu/harvard/iq/dataverse/dataset/metadata/inputRenderer/SuggestionInputFieldRenderer.java
Outdated
Show resolved
Hide resolved
...va/edu/harvard/iq/dataverse/dataset/metadata/inputRenderer/suggestion/SuggestionHandler.java
Show resolved
Hide resolved
...java/edu/harvard/iq/dataverse/validation/field/validators/ControlledVocabularyValidator.java
Outdated
Show resolved
Hide resolved
73247e2
to
99ec619
Compare
99ec619
to
f3f5931
Compare
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.
In general looks fine, just address the comment in the README, please.
README.md
Outdated
Starting integration tests dependencies: | ||
|
||
```bash | ||
./mvnw docker:start -Dtest.solr.port=8984 -pl dataverse-webapp |
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.
It might be a bit misleading to list those commands in that order, as you don't need to start/stop the dependencies when you want to execute all the tests or a single test on the command line. The verify
command will start the dependencies on it's own.
The start/stop commands are only useful when you want to execute some tests through the IDE during development.
Maybe a section with something similar to this:
Integration test dependencies can be started manually in order to execute integration tests through the IDE:
./mvnw docker:start -Dtest.solr.port=8984 -pl dataverse-webapp
Once started, all the integration tests can be run through the IDE. When finished, containers can be stopped with:
./mvnw docker:stop -pl dataverse-webapp
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.
Improved
.findFirst() | ||
.map(entry -> { | ||
Map<String, String> filterValues = new HashMap<>(); | ||
// Assuming getFieldValue() returns an Optional or similar |
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.
Is this a leftover after refactoring or something?
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.
Removed
Map<String, String> filterValues = new HashMap<>(); | ||
// Assuming getFieldValue() returns an Optional or similar | ||
filterValues.put(entry.getValue(), entry.getKey()); | ||
return filterValues; |
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.
To me the name getFilterValue
seems a bit misleading, but tbh not sure what would be a better one.
The main issue is that the contract between isDependentOnSiblings
, getAllowedFilters
and this method is not very obvious.
For instance, I wonder if it wouldn't be clearer to have getAllowedFilters
return a list of FilterConfig
objects. Those filter objects would tell how a value for that filter can be retrieved, either from dataset fields or from db filter configuration.
But I feel that would require a bigger refactoring
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've added improved comment.
…ary values Co-authored-by: Sylwester Niewczas <[email protected]> Co-authored-by: Krzysztof Mądry <[email protected]> Co-authored-by: Filipe Dias Lewandowski Signed-off-by: Daniel Korbel <[email protected]>
f3f5931
to
8b1ade7
Compare
Extended functionality for the Suggestion input to support dictionaries (with a controlled vocabulary).
Adds optional validator to verify is value coming from controlled vocabulary or not.
Issue: #2554