-
Notifications
You must be signed in to change notification settings - Fork 65
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: Add group and category restriction to house ads #205
Conversation
5ceeef1
to
c8d7716
Compare
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.
A couple tiny things -- only question I had on specs were, is there coverage for making sure that anon-allowed ads do show for logged in users? Approving :)
}); | ||
}); | ||
); | ||
this.savingStatus = I18n.t("saved"); |
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 believe you could change this to a fn get savingText
that tracks saving
to make it a bit easier to follow
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.
We have three different states for savingStatus
- ""
- "saving"
- "saved"
I think we will need to keep it as is, so that we can set the saving
status during the ajax call. OR we drop the saving
status and just have two states, "" or saved
then move it to a getter.
admin/assets/javascripts/discourse/routes/admin-plugins-house-ads-show.js
Outdated
Show resolved
Hide resolved
visible_to_logged_in_users: false, | ||
visible_to_anons: true, |
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.
When a ad is set to visible_to_logged_in_users: false
and visible_to_anons: true
we don't display the ad to authenticated users.
visible_to_logged_in_users: true, | ||
visible_to_anons: true, |
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.
When a ad has visible_to_logged_in_users: true
and visible_to_anons: true
we do display the ad for authenticated users
Description
This PR adds the ability to apply group and category restrictions to a house ad.
What is included
admin/assets/javascripts/discourse/controllers/admin-plugins-house-ads-show.js
I needed to modernize the file.bufferedProperty
implementation in favor of a vanilla ember approachcategory_ids
andgroup_ids
to our house ads model/site.json
would return a object calledhouse_creatives
and a list of key value pairs that matched the ad name with the html, like so:I need access to the category ids on the client to conditionally render the house ads so the new format will be:
Screenshots
Preview Video
preview.mov