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
FEATURE: bulk relist #4860
Conversation
Thanks for contributing this pull request! Could you please sign our CLA so we can review it? http://www.discourse.org/cla |
Do I need to fill the form every time I submit a PR? |
Your cla email must match your github email for it to "know" you
…On Tue, May 9, 2017 at 11:04 PM OsamaSayegh ***@***.***> wrote:
Do I need to fill the form every time I submit a PR?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#4860 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABc7Ve0IEvrsYz0Zw0NW5f3ibm-_t9Fuks5r4VN2gaJpZM4NWMsj>
.
|
} | ||
if (showRelistButton && !_buttons[9]) { | ||
addBulkButton('relistTopics', 'relist_topics'); | ||
} else if (!showRelistButton && _buttons[9]) { |
There was a problem hiding this comment.
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++) { |
There was a problem hiding this comment.
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)
@eviltrout Thanks for your feedback! would you mind taking another look? I've just made some changes :) |
Seems good now, thanks :) |
https://meta.discourse.org/t/make-listed-again-in-the-bulk-actions/58286/5
I hope I did it right :)