* Add delayed behavior
* Add special behavior to billboards
* Fix order for test
* Test clicking outside element when close event is present
* Update app/javascript/packs/billboardAfterRenderActions.js
* Add a/b test for which comments to show in feed
* Adjust figure
* Started at
* Add custom_display_label to billboards and update API
* Add custom_display_label to billboards and update API
* Add new render and template modes for billboards
* Add new fields to /admin
* Adjust test
* Adjust markup in form
* Add tests for script execution
* Add two script test
* Adjust scripts
* Adjust scripts
* Add new test
* Add new explicit tests
* Move JS functionaity around
* Renamed locale keys and ui language display_ads => billboards
* Revert locale and role name for display ad roles
* Revert locales related to locales to DisplayAd
* Fixed billboards cypress test
* Renamed display_ads vars to billboards
* Rename local vars in the feed view
* Renamed display-ad in the comment
Co-authored-by: Rajat Talesra <rajattalesra4914@gmail.com>
* Renamed variables in the views
---------
Co-authored-by: Rajat Talesra <rajattalesra4914@gmail.com>
* feat: first pass at CTA Tag
* fix: strip_tags before using the link
* default hover
* feat: add the type of cta
* feat: add own ltag by copying the utility class
* feat: rename property to style
* feat: add style and width
* feat: add xit test
* feat: add spec for unordered options
* chore: some css
* feat: update the cta spec to remove style and width options
* feat: move billboard related code out of widgets
* fix: mobile display ad below the comments section
* feat: cta_tag strip tags input
* feat: update the editor docs
* feat: add help text to teh liquid guide and the editor guide
* feat: fix the css styles of the CTA
* cgore: alphabetical order
* chore: move everything on one line
---------
Co-authored-by: Mac Siri <mac@forem.com>
* changes to the divider
* chore: update the flag icon
* chore: add a consistent width and height to all the icons in the dropdown
* chore: move widtha dn height closer to definition
* feat: make the border 1pm
* feat: add a margin to thehr
* add margin all round for hr
* chore: same 8px for all around
* feat: add a route to the async_info for display ads
* feat: load the billboard asyncronously
* feat: move the methods to the display_ads controller
* feat: handle params better
* feat: cache control headers
* feat: test fastly caching headers on display ads
* fix: surrogate key test
* feat: use safe navigation operator to handle cases where there is no article id
* fix: article id present then find the article
* feat: add a response test
* Fragment caching
* feat: update the article decorator
* feat: update cache keys for fragment
* feat: remove an empty line
* feat: add article id
* feat: bust cache
* feat: setup dropdown for billboard
* chore: add chunk to same line
* feat: add to safe params for caching
* Update app/controllers/display_ads_controller.rb
Co-authored-by: Joshua Wehner <joshua@forem.com>
* feat: remove the cache deletion
* feat: update the routes to follow a new scope
* feat: update the cache params
---------
Co-authored-by: Joshua Wehner <joshua@forem.com>
* Users can only opt-out of external ads
* Move random sampling out of FilteredAdsQuery
* Refactor filtered_ads_query_spec
* Add test for new permit_adjacent setting
* Rubocop
* Use permit_adjacent_sponsors on article sidebar and post-comments
* Remove, unused
* Update copy
* type_matched -> type_of_ads
* Remove non-applicable test
* feat: update the bullet safe list and add eager loading with organizations
* feat: add an indicator round for promoted
* feat: update the css
* feat: add il8n
* fix: styling changes
---------
Co-authored-by: Joshua Wehner <joshua@forem.com>
* Users can only opt-out of external ads
* Move random sampling out of FilteredAdsQuery
* Refactor filtered_ads_query_spec
* Add test for new permit_adjacent setting
* Rubocop
* Use permit_adjacent_sponsors on article sidebar and post-comments
* Remove, unused
* Update copy
* type_matched -> type_of_ads
* Remove non-applicable test
---------
Co-authored-by: Ridhwana <ridhwana.khan16@gmail.com>
* display ad partial
* add translations
* replace views with partial
* add context types
* check if ad is community
* not fully rounded
* fix spec
* updated styling
* adjust spacing
* Initial setup work with error
* Dropdown working with error fixed
* Removed repition
* Home page billboard dropdowns added
* Created common file for dropdown
* Complete display ad dropdown usage
* Minor indentation fix
* Minor UI updates
* Minor test update
* Dropdown for billboard optimisation
* Added anchor tags
* Display ad unified code
* Design changes
* Design changes
* Changes to display ad click tracking
* Style changes
* Design change to admin display ad
* Nit fix
* Nit fix
* Updated test
* refactor: move trackEvents to a utilities folder so that it can be re-used
* feat: add a function called trackCommentClicks and use it on the articlePage
* feat: update the auth widget to take the correct properties
* feat: add create account tracking method for hamburger
* feat: add create account tracking method for sidebar left
* feat: whoops, sidebar tracking info added
* feat: add the feed card create account tracking
* feat: whoops add the id to the dom
* feat: add top nav create account tracking
* feat: create account tracking for the registration modal
* fix: callback instead of invoking + rename class
* fix: js-prepend
* feat: some showLogin event tracking
* use the tracking propert
* x - feed.jsx
* fix: oops I removed hidden
* track from the search login
* feat: add tracking for follow button
* fix: main_stories is only being called in view/articles and both are including the FollowButtons pack
* comments track
* feat: remove punc (.)
* chore: cahnge working
* chore: remove tracking-id from modal
* feat: remove ecmascript features
* refactor: rename some events
* feat: referrer page
* feat: add a secondary source for the follow buttons
* feat: remove file that is not used
* chore: rename key
* feat: use @utilities
* feat: add spec for create account clicks
* feat: add key referrer
* fix: tests
* fix: oops
* chore: add commented test
* test for tracking
* feat: update the change by 1
* feat: aggregate_failures
* feat: add data-no-instant back
* feat: try a different way of testing
* refactor: change secondary_source to referring_souce
* feat: change ahoy event test
* feat: add a version number to ahoy tracking
* feat: change the href to pathname
* feat: reply comment tracking
* fix: to be present syntax
* feat: use href instead of pathname
* chore: do not track tags and podcasts follow and remove referrer
* feat: add readinglist
* fix: remove referrer from test
* feat: fail gracefully in instances where there is no tracking data
* fix duplicate ID main nav
* fix duplicate ID other nav headings
* fix duplicate ID reading list count
* fix duplicate attribute class
* missing case readingCountList on feed
* missing dot in query selector
* Revert "fix duplicate ID other nav headings"
This reverts commit 4f495962c47e08f0f6c41e33e897b2db176432f5.
* use generic class 'other-nav' for tests
* pass a variable 'context' to the partial nav
* pass var 'context' to partial
* fix unwanted typo in partial sidebar
* Update app/views/admin/navigation_links/index.html.erb
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Update app/assets/javascripts/initializers/initializeReadingListIcons.js
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Update app/assets/javascripts/initializers/initializeReadingListIcons.js
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* js-reading-list-count renaming
* use data-testid instead of generic classes for tests
* fix typo in specs
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* transliterate when generating attribute names to avoid emptiness
If you enter a non-ascii (non `\w` matching) string as the profile
field label, the attribute name is the empty string.
This causes problems outlined in #16391
To avoid losing user provided data, transliterate (Sterile is the same
tool we're using for Article#title_to_slug) before matching against
the word regex.
If we persist an empty string, or persist a non-`\w` name, the
coordinating regex in Profile::ATTRIBUTE_NAME_REGEX will leave a nil
match and raise NoMethodError (the method missing is for
match[:attribute_name] when match was nil, not Profile - that's the
next commit.
* Guard against nil matches
If an attribute name doesn't match the regex, the match is nil, and
trying to access (nil)[:attribute_name] raises a NoMethodError.
If there was no match, assume profile does not respond to the
selector, and don't handle it in method missing.
* Ensure generated attribute name is valid before saving
This raises a validation error if the generated name (from the label)
would be empty.
It's not an optimal error message (since the user can't see the
internal attribute name) but it prevents persisting broken/empty data
* actually raise error when validating
validate/valid? only return true or false (and set errors on the
object). In order to reject the creation, we need to raise a
validation error, not only call validate. I think this is because the
execution of before_create hooks happens after validation (which is
why the validation was only checked on update, not create).
* Generate an attribute name completely independent of the field label
This prevents mistakenly labeling a field "Class" or "Association" or
one of the other hundred public methods an AR model like Profile
exposes. Since attribute_name will be passed to `profile.public_send`
we really shouldn't build selectors from user supplied inputs.
* Use the admin supplied label in the sidebar
The profile decorator is used in the Users#show page to populate the
sidebar fields. Don't use the attribute name (which we mangled during
creation, and now generate randomly) as the label, use the label.
* Make the label lookup null safe, and filter attributes more
* Update data update script to not expect predictable labels
This is low impact since it ran in july, but we no longer know what
attribute name a label will create.
* Fix moderator spec
"Test Field" label no longer predictably generates :test_field as an
attribute name. Ask the field what it's name is before asking profile
about it.
* Fix profile preview card request spec
Remove the assumption that profile responds to a method name based on
the label for Work and Education fields.
* Update old DUS and its test
This can probably be archived
* Update profile spec to use fields generated attribute names
We used to "know" how attributes were generated from labels. Now we don't.
* update e2e seeds for profile field change
* Don't expect attribute name to be based on the label
* expect created profile fields respond to their attribute name
* Update system test
The label, not the attribute name, is shown on the profile form (the
field has an id related to the attribute name, but the view shows the
mutable/human-readable label).
* Keep the field title lowercase when sending the json preview card
The userMetadata component expects "work" and "education" to be
attributes of the metadata, but the ui_attributes_for() method was
titlizing these (for display).
Ideally we wouldn't have "special purposed" these two field names, but
they're there.
* update profile field by attribute name, not based on label
* Update profile field removal assumptions
We don't know what the method selectors will be, we have to ask.
* remove old test
* Update translations for Education and Work
Since the ui_attributes_for(area:) now gives the label, not the
attribute, we need to match the label of the profile field.
Note to self: this exposes an issue in localizing the custom profile
fields (probably a bigger problem for large, international communities
like DEV than some others, but trying to match static translation
files against user-modifiable database records seems like a problem
we'll see again).
* Empty commit to retrigger buildkite
* Remove profile field migration update scripts
Cloned the specs from the other "remove unused scripts" script.
* Remove unused scripts
The data update script removes the entry from the table (recording
that these have run) - we also want to remove the files (preventing
them from running again).
* remove unneeded spec for removed file
* when translation for header area field not found, use the title
Only Work and Education already have keys in the yml translation file,
and there's not a great (or easy?) way to make multiple translations
on these fields right now.
Since an admin can create a new field, and assign it to the header
area, we can't assume the code has a configured translation key for
this field.
Fallback to the title (we do this in another context already) if
there's no translation.
* PR feedback: Avoid n+1 query for labels
the original implementation of "label_for_attribute" had an n+1 query
looping over each matched key.
Follow suggested improvement and pull labels and attributes at once
from the db and modify the returned hash.
* Downcase title before looking for translation key
This avoids putting "odd" capitalized keys into the yml translation
file
Revert addition of "Work" and "Education" to the users files.
* use a let binding for duplicated test data
* Update app/models/profile_field.rb
prefer SecureRandom.hex for a dashless uuid (instead of removing the dashes).
Co-authored-by: Jamie Gaskins <jgaskins@hey.com>
Co-authored-by: Jamie Gaskins <jgaskins@hey.com>
* Add toggle button to 'New Forem Secret' form
* Display messages using i18n
* Fix from snake case to kebab case
* Fix a bug when the specified class did not exist
* Refactoring to add helper method
Prior to this commit, we made view level calls to service modules. This
refactor provides convenience methods on the model.
Furthermore, it addresses a few Rubocop violations that "come along for
the ride."
* Ensuring cached entity squaks like User
* Fixing broken spec
* Fixing typo
* Enable Forem (Passport) Auth
* Remove feature flag DUS
* Add prompt for Forem Passport in admin
* Add spec & fix broken one
* Link to docs instead of passport site
* Added alias for app/javascript/controllers
* Added hooks for Stimulus controller.
* Fixed eslint issue with @controllers alias.
* Initial working logo preview.
* Added explicit accept values for png and svg files only for a logo.
* Fixed content layout shift issue and resize to max height 80px.
* Cleaned up logo preview resizing.
* Added focus style to Upload logo label.
* Now the logo preview image has empty alt text as it's visual only.
* Fixed position of upload logo button.
* Removed tooltip for logo.
* Fixed check to load client-side controller.
* Put back tooltip, minus the aria-describedby
* Fixed E2E tests I broke.
* Made the logo preview visible to the accessibility tree.
* feat: update the brand colors on the page when we select a new one
* feat: update the radio button_tags to use crayons-radio
* feat: remove the fill attributes in the svg
* Added support for JPG image upload.
* Fixed height adjustment when width exceeds max preview width.
* feat: add form-background class with an accent
* feat: update the briightness accent on the page
* Fixed JS error if user cancelled file selection for a logo.
* Added the @routes webpack alias for routes.js.erb.
* Fixed data tooltip for assistive technologies.
* Fixed preview logo alignment with upload logo button.
* remove required as it's not doing anything
* feat: update the code brigtness code
* Opting to not show friendly error message if route fails to load.
* Fixed validation message not appearing for logo.
* Revert "Added the @routes webpack alias for routes.js.erb."
This reverts commit 3b6621dcde541f2fa05df6ff75af38955842b88e.
* Reverted to default styling of input[type="file"].
* Moved creator_settings_controller to admin/controllers.
* Updated E2E test for logo preview on the creator settings page.
* create tests for the brand color updates
* feat: update the description
* Update cypress/integration/creatorOnboardingFlows/creatorSettings.spec.js
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
* Update app/javascript/admin/controllers/creator_settings_controller.js
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* feat: do not update branding if an invalid color is provided
* feat: move the brightness code to its own accent calculator file in js utilities
* test: brightness ratios
* chore: remove whitespace
Co-authored-by: Nick Taylor <nick@dev.to>
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Adds a help icon to the creator settings setup page
* Moves the help icon styles from the a tag to the inline_svg_tag
* Removes reused class and aligns help icon to the right
* Refactors help icon out into a partial used across necessary views
* Moves .admin-help-button class from admin.scss to scaffolds.scss
* Adds further utility classes to align help icon as expected
* views/stories and home related i18n
* PR key names fixes
* remove ja.yml
* Update en.yml
* Update fr.yml
* Update articles_search_spec.rb
* Update _meta.html.erb
* Update index.html.erb
* Update _meta.html.erb
* Update articles_search_spec.rb
text in HTML should not contain raw brackets
* Update articles_search_spec.rb
* Update _signup_modal.html.erb
* Add back missing Search text
Co-authored-by: Fernando Valverde <fernando@visualcosita.com>
* feat: add type button
* feat: open up the username field is we press keydown on the edit username element
* fix: remove the keypress
* fix: add type: button to the password field
* trigger github hooks