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

Add element groups functionality for cleaning up editors #2124

Merged
merged 4 commits into from
May 29, 2022

Conversation

dbwinger
Copy link
Contributor

@dbwinger dbwinger commented Jun 9, 2021

What is this pull request for?

Adds ability to group contents/ingredients in element editors to clean up/organize elements with large numbers of contents.

Notable changes (remove if none)

Adds a group option to contents or ingredients entries in elements.yml.

Screenshots

When elements.yml contains:

- name: example_element
  contents:
  - name: ungrouped_content
    type: EssenceText
  - name: group_1_content_1
    type: EssenceText
    group: group 1
  - name: group_1_content_2
    type: EssenceText
    group: group 1
  - name: group_2_content_1
    type: EssenceText
    group: group 2
  - name: group_2_content_2
    type: EssenceText
    group: group 2
  - name: another_ungrouped_content
    type: EssenceText

Element editor will look like this (after clicking on "Group 1" to expand):

image

Checklist

  • I have followed Pull Request guidelines
  • I have added a detailed description into each commit message
  • I have added tests to cover this change

@dbwinger
Copy link
Contributor Author

dbwinger commented Jun 9, 2021

NOTE, I haven't yet added tests, and I'm guessing the UI should be cleaned up a bit. I wanted to get feedback on whether this is a feature that might be accepted before I polish everything up.

@gr8bit
Copy link
Contributor

gr8bit commented Jun 23, 2021

Do the groups support translations for their names?

Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the feature. But think we can improve it a bit more. Translated group names are mandatory. Also try to make use of the collection rendering and the Element and Content editor presenter classes.

Thanks for the contribution. It's really appreciated

app/views/alchemy/admin/elements/_element.html.erb Outdated Show resolved Hide resolved
app/views/alchemy/admin/elements/_element.html.erb Outdated Show resolved Hide resolved
@dbwinger
Copy link
Contributor Author

Good call on translations and collection rendering. Updates coming soon.

@github-actions
Copy link

This pull request has not seen any activiy in a long time.
Probably because of missing tests or a necessary rebase.
This PR will be closed in 7 days if no further activity happens.

@github-actions github-actions bot added the Stale label Mar 18, 2022
@tvdeyen
Copy link
Member

tvdeyen commented Mar 18, 2022

@dbwinger any change for an update?

@dbwinger
Copy link
Contributor Author

@dbwinger any change for an update?

No change or update. It's still on my TODO list. Looking back over it now, I think I'll be able to get it updated and ready for another review next week.

@dbwinger
Copy link
Contributor Author

@tvdeyen Can you help me know what should be tested for this change? I see that IngredientEditor#translated_role is not tested, probably because it's just a call to Alchemy.t which is tested elsewhere, so I assume there's no need to add tests for my added ElementEditor#translated_group. I plan to some specs related to the ingredient/content groups' UI in edit_elements_feature_spec.rb. Let me know if anything else ought to have tests.

@dbwinger dbwinger force-pushed the element-groups branch 2 times, most recently from 93cf40f to e7e79e6 Compare March 24, 2022 18:39
Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice. Thank you 🙏🏻

I have a little nit pick because of blank/present. They are costly and unnecessary.

I will try to have a look at the UI today

Really like that feature. Thanks for collaborating

app/views/alchemy/admin/elements/_element.html.erb Outdated Show resolved Hide resolved
app/views/alchemy/admin/elements/_element.html.erb Outdated Show resolved Hide resolved
@tvdeyen
Copy link
Member

tvdeyen commented Apr 19, 2022

I still need to look into the UI. On my list

@tvdeyen
Copy link
Member

tvdeyen commented Apr 21, 2022

@dbwinger I adjusted some styles. It now looks like this

Alchemy CMS - All the things 2022-04-21 10-03-27

Working with this a bit more today, I found it irritating that groups are always collapsed. Expanded groups collapse after reload. I don't want to add persistence, but maybe we can safe the state in the session at least.

@dbwinger
Copy link
Contributor Author

Working with this a bit more today, I found it irritating that groups are always collapsed. Expanded groups collapse after reload. I don't want to add persistence, but maybe we can safe the state in the session at least.

Good idea. I just took a crack at that.

@dbwinger
Copy link
Contributor Author

@tvdeyen I don't mean to nag, but just thought I'd check in on this and make sure you're not waiting on me for anything.

@tvdeyen
Copy link
Member

tvdeyen commented May 28, 2022

@tvdeyen I don't mean to nag, but just thought I'd check in on this and make sure you're not waiting on me for anything.

No, I am not waiting. The feature is done if it's done. Take your time.

@dbwinger
Copy link
Contributor Author

@tvdeyen I don't mean to nag, but just thought I'd check in on this and make sure you're not waiting on me for anything.

I'm not sure if I communicated effectively. I meant by this that as far as I can tell, it's "done" and ready for your review.

Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't saw the latest commit. This looks great. Thanks

@tvdeyen tvdeyen merged commit fe35f29 into AlchemyCMS:main May 29, 2022
tvdeyen added a commit that referenced this pull request May 30, 2022
Add element groups functionality for cleaning up editors
@dbwinger dbwinger deleted the element-groups branch June 1, 2022 15:06
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.

3 participants