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

Imporvement: checkbox in the class editor to hide unpublished object #21

Open
Yivan opened this issue Nov 23, 2016 · 7 comments
Open

Imporvement: checkbox in the class editor to hide unpublished object #21

Yivan opened this issue Nov 23, 2016 · 7 comments
Assignees

Comments

@Yivan
Copy link

Yivan commented Nov 23, 2016

Actually all object in the folder, published or not, are show as options.
In some case, some object are not published (being in edition process and not finished to be correctly filled for instance) and they should not be available as choice.

Maybe a checkbox labeled "Hide unpublished" could be added to the 4 dropdown elements type. So this way user creating the class could decide on per case if object should be available or not depending published status.

@ThomasKeil ThomasKeil self-assigned this Nov 23, 2016
@Yivan
Copy link
Author

Yivan commented Nov 23, 2016

There is tricky case... what if the element is unpublished later and as been selected in some dropdown before.
Maybe to go simplier, unpublished will not be hidden but just adding the text (not published) behind the text for this choice in the dropdown (so user know it is not published actually...).

Better would be they are showed, but cannot be assigned/selected. And if they are already assigned as choice thay stay assigned (and can be unasigned/unselected). But I am not sure the ExtJs component could handle this.

@ThomasKeil
Copy link
Owner

ThomasKeil commented Nov 27, 2016

This will most probably be possible.
Extjs' combobox can't disable items, but with a little help of templates and listeners it's possible.
See https://github.com/ThomasKeil/pimcore-plugin-DynamicDropdown/tree/disabled_items
It's not yet 100% nice since the cursor doesn't change and it get's hover-lighted, and I'm not yet sure if it's possible to change that, but it's usable.
I now need to add the configuration, I'll probably use a combobox like:

Handle unpublished objects: Show / Unselectable / Hidden

@Yivan
Copy link
Author

Yivan commented Nov 28, 2016

@ThomasKeil I thinked a little more about this.
I ended finally to think maybe it should be leave as it was (no difference between published/not published) because:

  • Pimcore native href/multihref don't do this difference and Pimcore work like this
  • And the more important (that is why i opened the issue): finally unpublish object will not be available by the getter method in the frontend/public site (as unpublished). So selecting an unpublished (and uncomplete) object won't break the web site.

So it is more easy to keep it simple as it was, and it would permit to prepare association (even if not published).
Do you think we need enhancement finaly ? For me finaly it is ok as it was, keep it simple and Pimcore way. If you think too, you can revert and close the task. Sorry about having opened the issue without having thinking all of this before.

@ThomasKeil
Copy link
Owner

I think in any case I'll keep the visual feedback if an object is unpublished, so the user can decide what to do.

@Yivan
Copy link
Author

Yivan commented Nov 28, 2016

Yes it is a nice addition as visuel indicator. Thanks.

@ThomasKeil
Copy link
Owner

I just committed a new release, the unpublished items are now grey, and can be configured to be unselectable.

@Yivan
Copy link
Author

Yivan commented Jan 17, 2017

Thanks @ThomasKeil. I just tested it on last stable Pimcore.

I noticed the following problems:

  • It work only for Dynamic Dropdown (the select). The 3 others (multiselect, itemselector and superbox) don't put item in gray and they are always selectable.

  • For Dynamic Dropdown (the select), checking "Unpublished selectable" don't work because item are always non-selectable even if checked.

I try re-save the class and flushing all the caches and problems are always here.
Maybe the issue must be reopened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants