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

Sub-collection addition failed on collection/manage page #455

Merged
merged 1 commit into from
Dec 24, 2024

Conversation

damisul
Copy link
Collaborator

@damisul damisul commented Dec 19, 2024

It was impossible to add a new existing sub-collection (using autocomplete) on collection/manage page as we missed 'Collection' item_type value in drop-down.

It was impossible to add a new sub-collection on collection/manage page as we missed 'Collection' item_type value in drop-down
@abartov abartov merged commit 329dfce into master Dec 24, 2024
7 checks passed
@abartov abartov deleted the fix_add_subcollection branch December 24, 2024 23:17
@abartov
Copy link
Owner

abartov commented Dec 25, 2024

Just FYI: I merged this by mistake. The behavior had in fact been correct: it is impossible to just add a Collection -- the method already includes all Collection types (volume, series, etc.) plus the leaf types. The user should pick a specific Collection type (e.g. 'volume') to add. I have now removed the line you added.

@damisul
Copy link
Collaborator Author

damisul commented Dec 26, 2024

Just FYI: I merged this by mistake. The behavior had in fact been correct: it is impossible to just add a Collection -- the method already includes all Collection types (volume, series, etc.) plus the leaf types. The user should pick a specific Collection type (e.g. 'volume') to add. I have now removed the line you added.

Hi @abartov
Maybe I've fixed it wrongly, but I still believe there is something to be fixed.

The problem I've tried to fix was not creation of new Collection as sub-collection, but adding some already existing Collection as a sub-collection. There is an autocomplete field to select collection, it allows to select existing works, but if we try to add it, an error occurs (it does not displays, but is visible in logs):

And if we'll check this line:

var item_id = (item_type == 'Manifestation') ? $(this).parent().parent().find('#insert_mid').val() : (item_type == 'Collection') ? $(this).parent().parent().find('#insert_cid').val() : '';

We see that item_type == 'Collection' is also expected.

So I've asssumed that intended logic was:

  • if we want to create new sub-collection and add it then we should select some collection_item type from drop-down (e.g. volume or periodical)
  • but if we want to find and add existing collection, then item_type should be set to 'Collection' and we miss this value in a drop-down. So I've added it.

Without this entry we cannot add existing collection as sub-collection.

Sidethinking: I believe this UI for adding new Collection_item using single form is a bit contr-intuitive.
The problem with UI is that we need to select specific values in a drop-down for each possible case. I'd suggested to use several smaller forms instead:

  • to add existing manifestation (using autocomplete)
  • to add existing collection (using autocomplete)
  • to create new placeholder
  • to create new collection (should only allows to select valid collection_type values from a drop-down without 'Collection' and 'Manifestation' entries)

So we need to at least fix this error then.

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.

2 participants