* create new pack, handle user follow buttons, use pack on article page, remove initializeUserFollowButts
* init all follow button types, add pack to tag index and podcast episode pages
* add pack to all relevant pages, listen for newly inserted follow buttons
* change to searchParams to remove follow button initializer calls
* fix bug with tag page, add pack to notifications page
* fix issue with follow back inner text
* update cypress specs
* run the followbuttons code on sponsors page
* remove extra foreach
* add test for follow from article sidebar
* add test for follow and unfollow tag
* add test for the tag index page
* add spec for organisation profile follow
* add tests for follow buttons in search results
* add tests for notification follows
* commit missed file - woops
* show login modal if user is logged out when they click
* add cypress tests for logged out state
* change tag button initialization
* remove data-button-initialized
* init follow buttons from base pack
* handle the case where multiple follow buttons exist on a page for the same user
* account for instantclick and userdata not being defined, lower coverage for jest
* use getInstantClick
* fix issue with set initialisation
* only listen for mutations in areas we know follow buttons may be added dynamically
* small refactors
* add catch to response.json promise to handle 503 service unavailable error
* fix typo in error message
* make error message more generic
* add test for comment when server response with 503
* Banner v2 - first working version
* Move pack_with_chunks_tag up + removing comments
* Trying to fix unlrelated tests
* Revert experiment
* Defer initialization until page is ready
* Test refactor + trying out UDL Server refactor
* Revert experiment - to be handled in separate PR
* refactor to use function component
* Cleanup unused lines in cypress test
* Update app/javascript/runtimeBanner/RuntimeBanner.jsx
Co-authored-by: Nick Taylor <nick@forem.com>
* Apply review feedback
* Update app/javascript/runtimeBanner/RuntimeBanner.jsx
Co-authored-by: Nick Taylor <nick@forem.com>
* Add import clause + extract functions outside of component
Co-authored-by: Nick Taylor <nick@forem.com>
* fetch preview card follow buttons in one network call
* when new comment is submitted, only fetch new comment status
* make sure individual button follow requests continue to init
* Add follow-user class to all follow user buttons via the application helper
Co-authored-by: mstruve <mollylbs@gmail.com>
* show dropdowns on pre-existing comments
* show preview on comments, v rough version of showing preview on recently added comments
* tidy up error, add some comments
* show the ama icon when appropriate
* add to comment on article cypress spec
* add test for preview card on article comment
* tidy up
* small refactors
* wait for button init in cypress test
* add test for article author byline on organization post
* Trigger CI builds
* Trigger CI builds
* use initializedropdown in profileDropdown
* improve aria in html
* add cypress tests, stop buttons and dropdown initializing twice or more
* make sure dropdown shows when logged out
* use dropdownutils in dashboard and manage pages
* add tests for the toggle menu on dashboard
* add test for archiving from manage post view
* small tweak to avoid unhandled errors
* small tweaks to form methods
* Add SiteConfig.feed_pinned_article and validation
* Display pinned article at the top of feed
* Add (basic) functionality to pin/unpin post
* Admins can pin other users posts as well
* Hide the button if looking at the non pinned post
* Add pinned/unpinned snackbar message
* Rename SiteConfig usage to Settings::General
* Add pinned article to the Admin articles index
* Show the pin post button when there's no pinned article
* Move pinning to a separate controller
* Fix SiteConfig reference
* Hide PinController actions to unauthorized users
* PinnedArticlesController#show action and refactor some of the code
* Add Modal interaction
* Fix modal-pinned checkbox interaction
* Fixed pin/unpin post
* Add ArticleDecorator#pinned? specs
* Add PinnedArticlePolicy and PinnedArticlesController specs
* Add ability to actually pin an article from the admin after submit
* Add partial Cypress pin/unpin spec
* Fix pinned article and add basic Cypress interaction tests
* Add Crayons styling to modal
* Only render the pinned article on the default Feed page
* Use persisted?
* Add some comments
* Update app/javascript/articles/Article.jsx
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Update app/javascript/packs/homePageFeed.jsx
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Fix Cypress tests
* Update app/javascript/admin/controllers/article_controller.js
Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
* Fix pinning in article show page
* Used PinnedArticle domain model
* Fix spec
* Update cypress/integration/adminFlows/articles/pinArticle.spec.js
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Update cypress/integration/adminFlows/articles/pinArticle.spec.js
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Update cypress/integration/adminFlows/articles/pinArticle.spec.js
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Update cypress/integration/adminFlows/articles/pinArticle.spec.js
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Update cypress/integration/adminFlows/articles/pinArticle.spec.js
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Update cypress/integration/articleFlows/pinArticle.spec.js
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Update cypress/integration/articleFlows/pinArticle.spec.js
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Update app/views/admin/articles/index.html.erb
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Fix merge woes
* Add missing article pin post flows
* Add missing admin article flows
* Add Unpin to Admin as well
* Add Audit::Log entries for pin/unpin actions
* Update app/controllers/stories/feeds_controller.rb
Co-authored-by: Michael Kohl <citizen428@dev.to>
* Do not rate limit in E2E tests
* Use .find instead of .filter
* Rename ArticleIdValidator to ExistingArticleIdValidator
* Treat draft and deleted articles the same
* Make sure posts can be pinned after the pinned article is unpublished or deleted
* Use .get directly
* Fix spec and fix PinnedArticlesController#show
* Strengthen pinArticle Cypress tests
* Add Cypress test heading guard
* Add another Cypress test heading guard
* Remove duplicate validator
* Try using the Tools: header instead of the article title
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
Co-authored-by: Michael Kohl <citizen428@dev.to>
* initial rough version
* link to relevant rules, extract image text, only show if more than 0 errors
* jsdoc and tweaks
* refactors
* add tests
* open info links in new tab
* add new window link icon
* WIP - basic init of comment dropdowns with open and close on click
* WIP - initialize the share dropdown
* initialize all post dropdowns within packs, init copy to clipboard announcer
* refactor and add JSDocs to helper
* undo changes to base jsx
* update accessible name of post actions button in cypress test
* make sure dropdowns pack loaded on comment index page
* undo prettier changes in base jsx
* undo prettier changes in base jsx
* initialize comment dropdowns in podcasts
* add test for the post actions
* add article comment tests
* add cypress tests for comment dropdowns
* Removes :runtime_banner feature flag + repositioning
* Switch to https://udl.forem.com + fix spec
* Fix URL specs
* Adds data_update_script to remove feature flag
* Fix banner overlay on reactions for small screens + iPad max width
* Append -only to Runtime Filter CSS
* Add import to fix assets:precompile
* Implement design update
* Apply suggestions from code review
Co-authored-by: Lisa Sy <lisasyis@gmail.com>
* Add ;
* Trigger Travis
Co-authored-by: Lisa Sy <lisasyis@gmail.com>
* autofocus Skip Link on keyboard navigation
* focus Skip Link on route change if Skip Link exists
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Adds error handling to clipboard promise - post editor
* Adds a reload when rendering the Editor to get missing navigator.clipboard
* Remove reload logic from Post Editor
* Adds Honeybadger notify on error handling
* add modal code to Forem namespace, use showModal in the rate limit modal generator
* add cypress tests for both modals
* styling tweaks
* tidy up
* make sure modal trap selector is unique to page, update Modal JSDoc
* add additional jest test for focusTrapSelector
* fix following tags input a11y errors
* give hidden inputs unique ids
* update html element code in initScrolling, update test with new ids
* refactor
* trigger travis
* target the textfield inside the div in the test
* delete alt attribute on span
* delete role checkbox on button - add type button
* delete wrong aria label
* sidebar-nav as class not ID
* delete duplicate attr class on single story
* delete duplicate attr class sidebar nav
* Revert "delete role checkbox on button - add type button"
This reverts commit 456fa676ff4457ffa724e9a07a3f123149dc5f39.
* delete role checkbox and modidy spec login modal js
* no need for name in cypress test showloginmodal anymore
* add attr data-test-id
* replace attr defer with DOMContentLoaded event
* delete useless class
* better a11y approach for button and cypress tests
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* better a11y approach for button and cypress tests
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* discussion_r612278777 : change initialize article reactions js
* revert replacing `const` with `let`
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* revert replacing `const` with `let`
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* apply `aria-hidden` on all reaction svg
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* keep original text `Saved` for bookmark button
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* fix missing aria-label on load - reaction button
* Revert "replace attr defer with DOMContentLoaded event"
This reverts commit db6a7eec051c443c18c17e23cf331132b222011f.
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Remove early call to setup local storage for user
The first thing the callInitializers function does is re-invoke
initializeLocalStorageRender, calling the same function twice (for a
different outcome?) seems like it's not effective.
I tried to trace down how long it had been that way, and came to the
very first commit in the repo -
301c6080e3, where the pattern already
existed, so it's unclear at what point (prior to 2018) this was added,
and what problem it was trying to solve.
If we inlined callInitializers (by renaming it initializePage and
deleting the bottom function), the duplication would be especially
evident. This is the only call site for callInitializers, which would
be the other reason we _might_ want to have redundancy.
* Inline function call
Since initializePage only acted as a new name for
callInitializers (immediately transferring control to the
callInitializer function), remove the wrapper function and rename
the *actual* code with the public name initializePage.
No logic/behavior should change, unless we were unit testing callInitializers.
* Shorten method by moving long list of logicless calls to a helper
"We don't want to make a habit of pandering to Code Climate and its
metrics blindly".
Appease the robot by moving about 20 lines of uninteresting sequential
code out of the initializePage function and into a "callInitializers"
function, which is also the name of the function I just inlined.
* Remove pro role on user, expose pro dashboard to all users as analytics
* Remove pro from Elasticsearch mappings
* Update user role docs to use :trusted over :pro
* Remove pro from Role model spec
* Remove more references to pro, as noted by @rhymes
* Fixed bug with templates not being inserted for comments.
* Removed some trailing white space from a heading.
* Added custom Cypress command to create an article.
* Added E2E tests for creating comments on an article.
* Fixed adding a comment issue caused by mention auto-complete.
* Fixed a selector for the E2E tests.
* Removed some unnecessary white space and also making code climate happy.
* Updated E2E test.
* Added a bit more to the E2E tests.
* Now validation for comment doesn't need to loop through textareas.
* Merge remote-tracking branch 'origin/master' into nickytonline/fix-comment-template-insertion-bug
* Removed a similar spec file and added tests to the other file.
* wip
* Fixed bug where a response template could not be submitted.
* Added/updated E2E tests.
* Reverted a small change to condition for showing the combobox popover.
* Undoing some white space changes as not related to PR.
* Trigger Build
* Put back article seed data as it's used in tests outside of comment tests.
* Revert "Revert "Add (updated) mention autocomplete to post comments (#13061)" (#13116)"
This reverts commit e28bde043c.
* Fix issues with editing comments and arrow key navigation, update tests
* Update app/javascript/crayons/MentionAutocompleteTextArea/MentionAutocompleteTextArea.jsx
Co-authored-by: Nick Taylor <nick@forem.com>
* refactor adding of attributes
* destructure
Co-authored-by: Nick Taylor <nick@forem.com>
* Working version of Runtime Filter with banner behind Feature Flag
* First attempt to add a cypress test
* Adds simplified test
* Cleanup global references
* Add multi-platform e2e test
* Use --runtime-display var with fallback to block
* Update app/assets/javascripts/initializers/runtime.js
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Add FeatureFlag stub to fix unrelated specs
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Ensure loggd out user data is not in the document
* Use delete operator to remove user property
Another function relies on this value not existing. If this property
exists, but is set to undefined, it will not behave as expected.
* Add tests to verify user data does not persist in the DOM after logout
* Update cypress/integration/loginFlows/userLogout.spec.js
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
* Fixup: Test localStorage for user data
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
* add mention autocomplete functionality to article and notification comments
* add cypress tests
* make sure entry transitions dont replay
* undo change to async useeffect covered in other pr
* move search into dynamic import
* exit search if enter pressed in middle of search term
* refactor button activation code
* add a space after a mention is selected
* tweak cypress test for reply to ensure it awaits combobox
* small refactor