-
Notifications
You must be signed in to change notification settings - Fork 26
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
Herbarium form modal (reusable Location-creation UI) #2260
Conversation
Remove map_outlet arg
Sort out .has-id, mapOutletConnected
@mo-nathan @JoeCohen Please take a minute to test this manually at two places:
Fungaria is admittedly a minor use case, but I would like to roll this UI out also for Projects and User Profiles, potentially reducing a step in both of these forms. |
Joe, I'm afraid you'll have to wait here in the modal until the sheriff comes. |
Thanks Joe for all the feedback. I’m just trying out the flow you did, and i get a different result, when i click “Create” on the fungarium modal: |
Also add turbo custom actions for adding/removing classes
I spent a while on the Create Fungarium stuff inside the Create Observation stuff and my assessment is that it isn’t worth it. The use case I spent the most time on was creating an observation that I want to deposit at the MBLWHOI Library Herbarium (see https://mblwhoilibrary.org/special-collections/mblwhoi-library-herbarium/). The first issue I ran into is that it isn’t clear from the Create Observation UI whether the fungarium/herbarium even exists when I enter the name for it. Given that it doesn’t seem worth adding to the Create Observation workflow. Creating a fungarium should be a rare event. I don’t see the justification for making it really easy to do from the UI. Out of the 7477 herbaria in the system, only 1629 have any associated observations, and only 746 have more than one. Beyond that, the embedded location creation UI seems to be wonky. I can create this herbarium through the Create Fungaria UI and I can create the location itself through the create location UI. It’s only when it’s embedded in the Create Observation UI that it gets weird. I did a screen capture showing the weirdness and uploaded it through Slack since it's too big for GitHub. |
Comments about "keepBtn"
help_block: Less margin after
I think i've resolved the Location-name-editing issue @mo-nathan discovered as well as we can. In terms of Google Maps API's responses, our constraint here is that when we're geolocating a place name, Google only returns one (what they deem the “BEST MATCHING PLACE”) unless we use their Places API and spend an order of magnitude more credits per request. With lat/lngs, the situation is different. Google freely returns an array of matching locations of descending specificity, and we sift through them to only show the types of locations we are interested in. But when geolocating a place name, we don’t get any choice. If Google picks a street address, as it does when we enter
and Google returns
all we can do is remove the street number component from the hash of address components. This will not change the bounding box, which is still that of the street number/address. @mo-nathan I noticed incidentally that the mysterious number "1531" is also appended to the location if you try to geolocate "Quissett Campus" as an observation location on main, currently. UPDATE It's the ZIP+4 code. Adding this to the list of keys ignored in recomposing addresses. |
I revised the PR description at the top with the actual priorities motivating all this work, and a description of what's reusable. Realized the original description overemphasized the fungarium creation aspect, which I agree is not very important or valuable. |
Ignore "postal_code_suffix" also
Going to go ahead and merge this. |
herbarium_record_herbarium_name
andherbarium_record_herbarium_id
fields of the create obs form from the Rails controller response, without writing JS (other than the reusable Turbo methods)location
is created when form submittedherbarium
andlocation
are created, and herbarium applied to observationherbarium_record
Successfully creating a Fungarium in the modal form now populates that new fungarium in the Observation form, and allows you to continue creating the obs.
Background: on the observation form, the "Create fungarium" link kind of interrupts the flow of creating an obs.