ANW-1763: Add "Create and Link" for Related Accessions#3830
ANW-1763: Add "Create and Link" for Related Accessions#3830brianzelip merged 3 commits intomasterfrom
Conversation
|
@thimios this still needs work but the basic functions are there. I need to get rid of the extra Create and Cancel buttons. I tried to reuse the full form and didn't think about that. Looks like that weird formatting you found in my last PR is in many files. So still cleaning up and need to add specs. Took some time trying to wrap my head around some of our helper functions. |
Pull Request Test Coverage Report for Build 21668976405Details
💛 - Coveralls |
|
@Zeff looks good! |
cadd8e3 to
f2f913f
Compare
aa81074 to
48eb162
Compare
brianzelip
left a comment
There was a problem hiding this comment.
@Zeff looks great! The patterns here match the other three record types for including the linker Create option.
I notice that Accessions also have frontend/app/views/accession_links/_accession_linker.html.erb, which is the linker used by Archival Objects. (I'm not sure why this is the case.)
So this PR adds the Create option for the Related Accessions linker for the Resources and Accessions forms, but not the Archival Object form, see below:
Can you look into extending the linker Create option to this second accession linker?
Great catch! Digging in. |
48eb162 to
c0cdeb2
Compare
brianzelip
left a comment
There was a problem hiding this comment.
@Zeff I noticed on the "Create modal" that pops up via the "Accession Links" subform on an Archival Object form which you just added, there's no modal header. The modal header should contain the heading "Create Accession" and a close button, but it's not there. It's possible this is unrelated to your work.
Can you please look into correcting this?
Screenshots
No header on an Archival Object "Accession Links" subform Create modal
With header on the Archival Object "Subjects" subform Create modal
(This subform is just beneath the "Accession Links" subform)
With header on the Resource "Related Accessions" Create modal
Fixed with latest commit. |
| wait_for_ajax | ||
| end | ||
|
|
||
| When('the user clicks {string} in the dropdown menu') do |menu_item| |
There was a problem hiding this comment.
Could this step be replaced by this already existing one? https://github.com/archivesspace/archivesspace/blob/master/e2e-tests/staff_features/shared/step_definitions.rb#L135
| wait_for_ajax | ||
| end | ||
|
|
||
| Then('the related accession creation modal should be displayed') do |
There was a problem hiding this comment.
Rephrase as "the Related Accession creation modal is displayed" to follow the language of the rest of the test suite
| end | ||
| end | ||
|
|
||
| When('the user fills in the inline accession form') do |table| |
There was a problem hiding this comment.
Can we reuse the "the user fills in... " steps from file: https://github.com/archivesspace/archivesspace/blob/master/e2e-tests/staff_features/shared/step_definitions.rb for example https://github.com/archivesspace/archivesspace/blob/master/e2e-tests/staff_features/shared/step_definitions.rb#L147 and the ones after that instead of creating this new step here?
See also how the other creation scenarios are written, such as: https://github.com/archivesspace/archivesspace/blob/master/e2e-tests/staff_features/resources/resource_create.feature
There was a problem hiding this comment.
Fixed. Ultimately, I was able to get rid of two of my step definitions with reusing the shared ones. Took a little tweaking. Also, I missed the selector pattern that was being used and fixed that in a few places as well where I went with the modal ID.
Thanks, @thimios! This is definitely better. I'd love to spend some time in this to really get our e2e tests in my head and do even more cleanup.
You'll notice the entire feature was updated ... it was a line ending issue. In addition to the few step changes, changed all the line endings from CR/LF to LF. Not sure how that happened. Might have been my editor.
cc2250e to
7537d52
Compare
| And the user fills in 'accession_title_' with 'Test Related Accession' in the modal | ||
| And the user fills in 'accession_accession_date_' with '2026-01-05' in the modal | ||
| And the user clicks on 'Create and Link' in the modal | ||
| Then the modal should close |
There was a problem hiding this comment.
Let's remove this assertion as discussed
| And the user fills in 'accession_accession_date_' with '2026-01-05' in the modal | ||
| And the user clicks on 'Create and Link' in the modal | ||
| Then the modal should close | ||
| And the accession 'Test Related Accession' should appear in the related accessions linker |
There was a problem hiding this comment.
Let's remove also this then step from here
| Then the modal should close | ||
| And the accession 'Test Related Accession' should appear in the related accessions linker | ||
|
|
||
| When the user saves the resource |
There was a problem hiding this comment.
Use the 'click the "save resource" step'
7537d52 to
725d765
Compare
|
@thimios I believe I was able to address the few things you mentioned, but overall I actually:
So thanks for your guidance here. I feel a lot better about it in its current state. Ultimately, I found several other things I would like to change, but chose to stop as we should just refactor later. For example, in the helper.rb file, there's a step definition called "Given a Resource has been created", which would make you think you will end on a resource page, but it actually ends on an archival object page because it does more than just create a resource. So my step, 'When the user navigates to edit the resource" is a hack to get around that, but I didn't want to keep fixing these things and hold up the release. ==================== UPDATE ========================= |
7a0bc06 to
f177cd1
Compare
- Add inline Create and Link functionality for Related Accessions - Create accessions controller inline mode (new, create actions) - Add accessions form partials (_new, _form_inline) - Add Create button to accessions linker dropdown - Add E2E tests and RSpec feature tests - Fix child record Accession Links - Add .tool-versions file for e2e-tests
* Fix missing title for Archival Object accession linker * Simplify and reuse shared steps * Correct shared step and tense usage * Remove two more non-shared step definitions
* prefer reusing existing steps than creating new ones * follow existing wording pattern for new steps
f177cd1 to
f2d5305
Compare
Summary
Adds inline creation functionality for Related Accessions on Resource forms. Users can now create a new accession directly from the Resource edit form via a modal, without navigating away from the page.
ANW-1763
Implementation Details
Screenshots
How to Test