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

Improve post mgmt #372

Merged
merged 3 commits into from
Nov 29, 2021
Merged

Improve post mgmt #372

merged 3 commits into from
Nov 29, 2021

Conversation

SepsiLaszlo
Copy link
Contributor

@SepsiLaszlo SepsiLaszlo commented Nov 26, 2021

What's new?

We implemented a new post management system to enable group leaders and evaluation helpers to update multiple posts at one page.

Click on the new Posztok kezelése button on your group's page.

Screenshot from 2021-11-28 22-49-38

This will open the post management page, where all meberships and posts are listed in a table view.
Just click on the post in the row of the selected user to perform the action indicated between the parentheses.

Screenshot from 2021-11-28 22-50-07

We hope this makes administrating posts faster!

Todos:

Co-Authored-By: Sámuel Fekete <[email protected]>
Co-Authored-By: DannySS123 <[email protected]>
Co-Authored-By: Beni <[email protected]>
Co-Authored-By: Bálint Berente <[email protected]>
@SepsiLaszlo SepsiLaszlo marked this pull request as ready for review November 28, 2021 11:11
Comment on lines 14 to 15
@group_post_types = {}
@group.post_types.each { |post_type| @group_post_types[post_type.id] = post_type }
Copy link
Member

Choose a reason for hiding this comment

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

I think this could be a reduce

Comment on lines 12 to 13
@post_type_ids = @group.post_types.map(&:id)
@post_type_ids.delete(PostType::LEADER_POST_ID)
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we can express this as a select after the map to avoid mutations.

Comment on lines 16 to 17
@memberships = @group.memberships.active.includes(:posts, :user)
@memberships = @memberships.sort { |a, b| hu_compare(a.user.full_name, b.user.full_name) }
Copy link
Member

Choose a reason for hiding this comment

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

can the sort be chained after the previous call?

Signed-off-by: SepsiLaszlo <[email protected]>

fix

Signed-off-by: SepsiLaszlo <[email protected]>
Signed-off-by: SepsiLaszlo <[email protected]>
@SepsiLaszlo
Copy link
Contributor Author

@OmTheTurtle Thank you for the multiple greate comments on this PR! 🎆
I made refactorings according to them! 🖊️

@SepsiLaszlo SepsiLaszlo merged commit 34d831a into master Nov 29, 2021
@SepsiLaszlo SepsiLaszlo deleted the improve-post-mgmt branch November 29, 2021 18:20
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