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
ANW-616 - adding a spawn component feature to accession record toolbar #2691
Conversation
6a308cf
to
043e04d
Compare
043e04d
to
75f06c5
Compare
cc19930
to
ba33e00
Compare
The above screenshot was taken after spawning a new Archival Object, then clicking the save button without filling in any further information about the newly spawned archival object. Two items to note here:
|
0f59a02
to
a98a61f
Compare
a98a61f
to
8c0c7e1
Compare
ea54dbb
to
d56a9ed
Compare
to hide Other Level input when appropriate, Remove self.config.label_plural which is always undefined and never used by the template
d56a9ed
to
b943d21
Compare
@archival_object.position = params[:position] | ||
|
||
if user_prefs['default_values'] | ||
if params[:accession_id] |
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.
This part should be updated to apply default values first then spawned values second. cf. #2686
https://github.com/archivesspace/archivesspace/blob/master/frontend/app/controllers/accessions_controller.rb#L42-L46
https://github.com/archivesspace/archivesspace/blob/master/frontend/app/controllers/resources_controller.rb#L48-L55
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.
Should be fixed in latest commit
rights_statement.clone.tap {|r| r.delete('identifier')} | ||
} | ||
|
||
if !self.extents || self.extents.empty? |
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.
This has the effect of expanding the form sections in the UI (extents/dates/lang_materials). Is that intended? It's done for resources but I think those are all mandatory required fields in that context (and this is not done for accessions).
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.
See latest commit
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.
When spawning an archival object I think it might be useful to apply / update the resource and archival object id in the query string so it's transparent what is happening at all times. Without this if you hit refresh on the spawned object page it loses the resource / parent and you can't save [Must be a object (you provided a String)]. This also makes the "Select Resource" button inoperable.
You can spawn directly which is nice i.e. http://localhost:3000/archival_objects/new?accession_id=1&resource_id=1&archival_object_id=1 -- although using "Select Resource" after this does update the selection but not the url params (similar to above) so that could be confusing. Always updating the query params would be good I think, but not critical.
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.
The modal (resource) into modal (archival object) flow works nicely 👍
39cecdd
to
c1c4e0f
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.
Looks good. I see the query parameters being updated as Mark pointed out.
Adds an "Archival Object" option to the "spawn" dropdown of the Accession toolbar.
Because components (i.e., Archival Objects) need to be situated in a Resource and a parent Archival object, the new Archival Object form now pops up two modals if the resource and parent aren't present in form or in the URL. See screenshots.