onestop
onestop copied to clipboard
1313 named save search
The big feature added is a ModalFormUncontrolled
component. I copied most of the OneStopDialog
component and then tweaked things around to allow for an inputs
prop, which is an array of objects defining a few fields to create a pair of <label>
and <input>
elements inside a modal form. These inputs are uncontrolled to make it simpler to use the component, however I can easily see wanting a controlled version for any future functionality that needs to be more complicated.
I am also not totally convinced the inputs
prop should be a list of objects (basically a list of input specs). Instead it could be a list of arbitrary components similar to how the FlexRow
component works. But again, adding that kind of flexibility might be better suited to a future use-case when it is needed.
closes #1313
I was wanting to see this in the UI, do I need to be logged in to see the save/delete search dialog?
It looks like this merge is complaining about code coverage, btw.
Delete is broken: If I click delete it the saved search doesn't go to deselected, it acts like it's still saved. Plus if I click the save search again it pops up the delete dialog. If i go to my dashboard it says I have no searches and then if I perform the same search as before the save search icon is deselected.
Delete asks for search name. Intended? When I click the save search button after it is already highlighted (as in it is saved) then when it pops up the delete dialog it seems to want me to type in the search name to delete it?
Codecov Report
Merging #1481 (56acf09) into master (875be14) will increase coverage by
0.04%
. The diff coverage is58.49%
.
@@ Coverage Diff @@
## master #1481 +/- ##
============================================
+ Coverage 61.95% 62.00% +0.04%
Complexity 945 945
============================================
Files 338 339 +1
Lines 9999 10033 +34
Branches 1135 1148 +13
============================================
+ Hits 6195 6221 +26
Misses 3295 3295
- Partials 509 517 +8
Impacted Files | Coverage Δ | Complexity Δ | |
---|---|---|---|
...nt/src/components/user/dashboard/UserDashboard.jsx | 25.00% <ø> (ø) |
0.00 <0.00> (ø) |
|
.../components/user/savedSearches/UserSavedSearch.jsx | 29.41% <0.00%> (ø) |
0.00 <0.00> (ø) |
|
...src/components/results/collections/Collections.jsx | 50.87% <31.81%> (-1.05%) |
0.00 <0.00> (ø) |
|
...components/common/dialog/ModalFormUncontrolled.jsx | 82.14% <82.14%> (ø) |
0.00 <0.00> (?) |
|
client/src/components/common/input/Button.jsx | 55.73% <100.00%> (+0.73%) |
0.00 <0.00> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 875be14...56acf09. Read the comment docs.
Need more tests.
Questions: You can save a search without any text in there. Is this okay? It seems to behave as if you had named it. How hard would it be to give focus to the text field upon opening the save search dialog?
Made a small change in Collections file to have it be clearer what was being returned.