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

FEATURE: bulk relist #4860

Merged
merged 2 commits into from May 10, 2017
Merged

FEATURE: bulk relist #4860

merged 2 commits into from May 10, 2017

Conversation

OsamaSayegh
Copy link
Member

@discoursebot
Copy link

Thanks for contributing this pull request! Could you please sign our CLA so we can review it? http://www.discourse.org/cla

@OsamaSayegh
Copy link
Member Author

Do I need to fill the form every time I submit a PR?

@coding-horror
Copy link
Contributor

coding-horror commented May 10, 2017 via email

}
if (showRelistButton && !_buttons[9]) {
addBulkButton('relistTopics', 'relist_topics');
} else if (!showRelistButton && _buttons[9]) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Hard coding an index here seems dangerous. What is the condition actually checking? Is it if the button already exists? In that case it should be checking by some kind of indentifier.

@@ -26,6 +26,19 @@ export default Ember.Controller.extend(ModalFunctionality, {
categoryId: Ember.computed.alias('model.category.id'),

onShow() {
let showRelistButton = false;
const topics = this.get('model.topics');
for (let t = 0; t < topics.length; t++) {
Copy link
Contributor

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 replaced by something like

const showRelistButton = this.get('model.topics').some(t => !t.visible)

@OsamaSayegh
Copy link
Member Author

@eviltrout Thanks for your feedback! would you mind taking another look? I've just made some changes :)

@eviltrout eviltrout merged commit 2620935 into discourse:master May 10, 2017
@eviltrout
Copy link
Contributor

Seems good now, thanks :)

@OsamaSayegh OsamaSayegh deleted the relist branch May 11, 2017 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants