Skip to content
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

Merged
merged 4 commits into from Jun 13, 2022

Conversation

quoideneuf
Copy link
Collaborator

@quoideneuf quoideneuf commented Apr 22, 2022

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.

image

image

image

@cdibella cdibella added this to the 3.2.1 milestone Apr 27, 2022
@quoideneuf quoideneuf force-pushed the ANW-616-spawn-resource-components branch 2 times, most recently from 6a308cf to 043e04d Compare April 27, 2022 22:21
@quoideneuf quoideneuf marked this pull request as ready for review April 27, 2022 22:22
@quoideneuf quoideneuf force-pushed the ANW-616-spawn-resource-components branch from 043e04d to 75f06c5 Compare April 27, 2022 22:26
@quoideneuf quoideneuf changed the title WIP - adding a spawn component feature to accession record toolbar ANW-616 - adding a spawn component feature to accession record toolbar Apr 27, 2022
@quoideneuf quoideneuf force-pushed the ANW-616-spawn-resource-components branch 5 times, most recently from cc19930 to ba33e00 Compare April 29, 2022 18:20
@brianzelip
Copy link
Collaborator

ANW-616-arch-objs

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:

  1. The "Archival Objects" breadcrumbs link leads to an "Unknown action" error with the following message: The action 'index' could not be found for ArchivalObjectsController.
  2. The "Other Level" Basic Information field is marked with an asterisk to denote a required field, yet the validation warning message doesn't list "Other Level" as needing input as it does for "Number", "Type", and "Level of Description".

@quoideneuf quoideneuf force-pushed the ANW-616-spawn-resource-components branch from 0f59a02 to a98a61f Compare May 20, 2022 13:56
@quoideneuf quoideneuf force-pushed the ANW-616-spawn-resource-components branch from a98a61f to 8c0c7e1 Compare May 20, 2022 17:23
@brianzelip brianzelip force-pushed the ANW-616-spawn-resource-components branch from ea54dbb to d56a9ed Compare May 23, 2022 10:25
to hide Other Level input when appropriate,
Remove self.config.label_plural which is always undefined and never used by the template
@brianzelip brianzelip force-pushed the ANW-616-spawn-resource-components branch from d56a9ed to b943d21 Compare May 23, 2022 10:42
@archival_object.position = params[:position]

if user_prefs['default_values']
if params[:accession_id]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

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?
Copy link
Member

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).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See latest commit

Copy link
Member

@mark-cooper mark-cooper left a 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.

Copy link
Member

@mark-cooper mark-cooper left a 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 👍

@quoideneuf quoideneuf force-pushed the ANW-616-spawn-resource-components branch from 39cecdd to c1c4e0f Compare June 7, 2022 15:09
Copy link
Collaborator

@brianzelip brianzelip left a 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.

@mark-cooper mark-cooper merged commit 9d42774 into master Jun 13, 2022
@mark-cooper mark-cooper deleted the ANW-616-spawn-resource-components branch June 13, 2022 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants