Problem/Motivation

At the moment we provide only one selection display plugin, which ends selection process after first step. We need to implement at least another selection plugin that will display current selection of entities and allow selection in multiple steps.

Proposed resolution

Implement selection display plugin that will display current selection and one submit button. Selection will be completed when user clicks on this button.

The idea is displayed on the lower part of the wireframe:

Wireframe

CommentFileSizeAuthor
#20 interdiff.txt4.09 KBslashrsm
#20 2605578_19.patch5.95 KBslashrsm

Comments

slashrsm created an issue. See original summary.

CTaPByK’s picture

Assigned: Unassigned » CTaPByK

I'm already on EB UI so i will try to make this plugin.

CTaPByK’s picture

Status: Active » Needs review

Ok i make new pull request for this. It is not done yet, it's just a start.
https://github.com/drupal-media/entity_browser/pull/138

slashrsm’s picture

Status: Needs review » Needs work

Still in progress.

CTaPByK’s picture

I make another commit where i try to make some progress with that, it is not over yet.

CTaPByK’s picture

Status: Needs work » Needs review

Here is another commit for this plugin, we have now list of selection, button for remove is not done.
https://github.com/drupal-media/entity_browser/pull/138 (list of selected)

slashrsm’s picture

Status: Needs review » Needs work

Still work to do.

CTaPByK’s picture

I make new commit for plugin, i hope here is drag & drop reordering of selected is fixed.
https://github.com/drupal-media/entity_browser/pull/138/commits

CTaPByK’s picture

Status: Needs work » Needs review

Here is another commit and i fixed reordering and removing entities.
https://github.com/drupal-media/entity_browser/pull/138/commits

slashrsm’s picture

Status: Needs review » Needs work

Few comments on pull.

CTaPByK’s picture

I make some commit for quick review after that i will continue.

CTaPByK’s picture

Status: Needs work » Needs review

Ok here is new commit, this one is fixing some form structure and sorting.
https://github.com/drupal-media/entity_browser/pull/138/commits

slashrsm’s picture

Status: Needs review » Needs work

Reordering is definitely not working correctly.

To reproduce 1:
- enable entity_browser_example
- navigate to /node/add/entity_browser_test
- Open first "Files" fieldset
- Click on Select entities
- Select few files to upload
- Click "Select"
- Files appear listed below
- Reorder listing
- Click "Use selected"
- Expected behaviour: Files appear reordered outside of entity browser
- Actual behaviour: Files appear in original order (how they were uploaded)

To reproduce 2:
- enable entity_browser_example
- navigate to /node/add/entity_browser_test
- Open first "Files" fieldset
- Click on Select entities
- Select few files to upload
- Click "Select"
- Files appear listed below
- Reorder listing
- Upload few more files
- Click "Select"
- Expected behaviour: Selection displays initially uploaded files reordered following by files uploaded in 2nd step
- Actual behaviour: Original files appear in original order (how they were uploaded) following by files uploaded in 2nd step

CTaPByK’s picture

slashrsm’s picture

Now I experience a different problem:

To reproduce:
- enable entity_browser_example
- navigate to /node/add/entity_browser_test
- Open first "Files" fieldset
- Click on Select entities
- Select few files to upload
- Click "Select"
- Files appear listed below
- Upload few more files
- Click "Select"
- Expected behaviour: Files from both steps appear in the listing
- Actual behaviour: Only files from first step appear in the listing

CTaPByK’s picture

Problems with continuous selection is fixed, i mention one problem more and i comment on pull.
https://github.com/drupal-media/entity_browser/pull/138/commits

slashrsm’s picture

Looks very good now. Just few suggestions for clean-ups on pull.

When we merge this we'll create two follow-ups:
1. Add sane default styling to Multi step selection display
2. Allow for entities in Multi step selection display to be rendered other than with labels. Possibly re-using entity browser field widget displays.

CTaPByK’s picture

Status: Needs work » Needs review

  • slashrsm committed 73743d2 on 8.x-1.x authored by CTaPByK
    Issue #2605578 by CTaPByK, slashrsm: Create selection display plugin...
slashrsm’s picture

Status: Needs review » Fixed
StatusFileSize
new5.95 KB
new4.09 KB

I committed slightly updated patch. Refactored reordering logic a bit to make it more readable and with less redundant code.

Attaching interdiff with last state of the pull request and patch that ended up going in.

Thank you!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.