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

Update placement GUI. #7877

Merged
merged 8 commits into from
Dec 17, 2020
Merged

Conversation

microposmp
Copy link
Contributor

I've been thinking about learning more about the placement files to get a better understanding about how they work. When I saw the new module for working with them in the GUI by @TFleury I've spent the day experimenting. Really nice to be able to add placement settings in the GUI.

During the experiments I did some changes to the module:

  • Updated the GUI to appear like the other modules under the Design menu. I think these changes are made recently.
  • Removed the Empty check as most if not all of the values are optional. When testing I've only used the place and contentType placement values. All other values have been left blank (null). When leaving the other values blank I couldn't save. Hope I've understood the logic/rules here correctly and don't break anything by this change.

Shape Type: MarkdownBodyPart_Edit

[
  {
    "place": "Parts:0#Content;0",
    "displayType": null,
    "differentiator": null,
    "alternates": null,
    "wrappers": null,
    "shape": null,
    "contentType": [
      "Article"
    ]
  }
]

@microposmp
Copy link
Contributor Author

I noticed now that I broke some functionality. The placement links from Part definition pages.

image

I'll revert the broken change and update the PR. Only tested by creating the placements from the Design/Placements page.

@microposmp
Copy link
Contributor Author

Reverted the changes I made that broke functionality and added an item for adding/editing admin placement to the dropdowns.

@TFleury
Copy link
Contributor

TFleury commented Dec 7, 2020

Hi @microposmp, and thank you for your interest.

Updated the GUI to appear like the other modules under the Design menu.

Why not, it's more consistent with other modules, even if I don't like to have paging on those lists and prefer client side filtering as it's more efficient.

Removed the Empty check as most if not all of the values are optional

The IsEmpty check is here to keep placements clean and automatically remove void rules.
I added it because when using shortcuts in content definition, it automatically adds a new entry with relevent filters setted up. I think it's important to remove this entry if it's not used.

If a rule defines no "place", neither "shape", "wrappers" or "alternates", it has no effect. So there is no reason to keep it.

Added an item for adding/editing admin placement

Great.

@microposmp
Copy link
Contributor Author

Hi @TFleury, thanks for reviewing.

Added back the IsEmpty check and can't see the issue I was experiencing, so the error must have been with the data I saved. Sorry.

@agriffard
Copy link
Member

Please merge dev and fix the conflict.

# Conflicts:
#	src/OrchardCore.Modules/OrchardCore.Placements/Views/Admin/Index.cshtml
@microposmp
Copy link
Contributor Author

Synced with latest updates. Search box is updated.

image

@agriffard agriffard requested a review from Skrypt December 17, 2020 13:15
@Skrypt Skrypt self-requested a review December 17, 2020 15:04
@agriffard agriffard merged commit d8f5f9f into OrchardCMS:dev Dec 17, 2020
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.

5 participants