* 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
* Handling hiding/collapsing hidden comments client side
* Updated comment quality text
* Added placeholder for comments against podcast episodes
* Added logic for encompassing co-author-ids in articles
* Removed rspecs validating non-presence of hidden comments in dom
* Fixed hiding flow on comments page for a commentable
* Fixed e2e specs
* Addressed feedback on e2e tests
* rough starting point, roving tabindex in toolbar, bold and italic buttons
* refactor, add link
* add ul
* add ordered list
* core formatters in place, wip
* overflow options
* add keyboard shortcuts
* tidy up some dodgy classes
* add mocks for runtime in test and storybook, use correct modifier key for tooltip
* style tweaks
* refactor tooltips
* add markdown formatters tests
* add tests for toolbar component, fix mistake in overflow menu tooltips
* undo change no longer needed to button
* fix issue accessing runtime in formatters file
* only show darkened buttons and tooltips when focus-visible is true
* mobile view
* fix for responsive buttons & roving tabindex
* tweaks from PR review
* update cursor position on link insertion
* add a new line after block selection formatting
* align icons in center
* tidy up overflow menu listeners
* small refactors
* test for new text area util
* tidy up new lines after syntaxes
* fix logic in cursor offsets for links
* prevent scroll jumps after inserting syntax
* some style tweaks
* insert level 2 heading with new lines above and below
* update icons
* use margin instead of gap
* Eager-load comment user data
Profiles and user settings are loaded for on each comment author. On
posts with many comments, this invokes a *lot* of DB queries. This
commit replaces 2 queries per comment with 2 queries for all comments.
* Fix where I misunderstood limit's purpose
This implementation is too clever. It looks like it should just be
getting all but the last, but it uses the fact that the default is 0 to
default to getting all of them. This isn't readily understandable to
someone reading the code.
I don't have a suggestion to fix it yet so I'm just going to leave it
as-is for now.
* Admin-configurable display locale
* Add i18n-js and namespacing
* Basic tests and clean up
* A few test adjustments
* Update vendor cache
* Fix a few tests
* Fix a few tests
* Update app/views/articles/_actions.html.erb
Co-authored-by: Michael Kohl <citizen428@dev.to>
* Update app/views/articles/_comments_actions.html.erb
Co-authored-by: Michael Kohl <citizen428@dev.to>
* Update app/views/articles/_single_story.html.erb
Co-authored-by: Michael Kohl <citizen428@dev.to>
* Update app/views/articles/_single_story.html.erb
Co-authored-by: Michael Kohl <citizen428@dev.to>
* Update app/views/comments/_comment_header.html.erb
Co-authored-by: Michael Kohl <citizen428@dev.to>
* Update app/views/layouts/_sidebar_tags.html.erb
Co-authored-by: Michael Kohl <citizen428@dev.to>
* Update app/views/listings/index.html.erb
Co-authored-by: Michael Kohl <citizen428@dev.to>
* Update spec/system/homepage/user_visits_homepage_articles_spec.rb
Co-authored-by: Michael Kohl <citizen428@dev.to>
* Update spec/system/user/view_user_index_spec.rb
Co-authored-by: Michael Kohl <citizen428@dev.to>
* Alphabetical locale page
* Add activerecord custom validation error translations
* Add i18n to webpacker
* Fix a few tests
* Adjust error messages
* Add i18n-tasks
* Adjust JS to get working with jest
* Adjust the way translations are pulled in
* Adjust jest tests
* Remove time localization
* Remove superfluous public js
* Add basic tests for i18n application controller
* Remove unnecessary content
Co-authored-by: Michael Kohl <citizen428@dev.to>
* Edit buttons styles for Templates responses (Mod)
* Update comments.scss
* Edit classic CSS buttons to SCSS
* added m-1 to submit buttons
* Deleted CSS class for .response-templates-container and added mb-3 to header
* Add crayons-btn to personal and moderator buttons
* Update app/assets/stylesheets/views/comments.scss
Co-authored-by: rhymes <github@rhymes.dev>
* added aria-pressed to comment buttons
* Added accessibility title
* updated set attribute and text content of aria-title
* removed 'x likes' from svg titles
* Added e2e tests to test behaviour of like toggle button
* changed reaction button's description to save instead of Saved
* Fixed cypress test
* 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
* replace inline attribute defer with external js - show.html.erb
* fix typo in filename
* disable no-undef and bail if not defined
* put js on subfolder utilities
* refactor jsx instead of loading chunk with defer
* fix typo in desc
* better name for global gist helper
* use InstantClick
* working script on preview AND single view, not dynamic import, though
* embed only if gists
* combine all approaches to make dynamic import work
* make gist embeds work on submit comment form
* make gist embeds work on preview comment
* refactor - preview comments and submit
* add pack editComment + helper embedGistsInComments
* comment gist helper
* delete useless file utility
* use new syntax for events
* put code in method embedGistsInComments
* delete older pack gist
* handle edge case 'view full discussion'
* resolve conflict with package ibm-openapi-validator
* resolve conflict with package husky
* empty commit to test random error travis
* better name for class dismiss
* handle future events submit
* delete test code on click toggle form
* delete unused file
* rename pack as js file, not jsx
* Added POC using MutationObserver.
* missing case: notification page
* use custom pack notification page
* add e2e test for comment with embed gist
* add e2e test for preview post with embed gist
* add an extra step in tests to check gist is present
Co-authored-by: Nick Taylor <nick@dev.to>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Create DiscussionLocks
* Fix specs
* Update nullify_blank_notes_and_reason
* Update before_validation call
* Updated DiscussionLockPolicy for clarity
* Move permitted_attributes to a constant
* Update route
* Apply suggestions from code review for frontend
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Add title tags
* Wrap unlock confirm in main element
* Wrap flash messages up in div
* Actually fix title tags
* Hide comment reply button when discussion is locked
* Add E2E tests
* Try to fix E2E tests
* Cypress...you work locally but not in CI...why!?
* PR feedback
* Update E2E tests
* More E2E updates 😭
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* 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
* Rename SiteConfig
* More renaming
* Update spec
* Update mandatory settings mapping
* More renaming
* e2e test fixes
* You have a rename, and you have a rename
* Spec fix
* More changes
* Temporarily disable specs
* After-merge update
* Undo rename for migration
* undo rename of DUS
* Fix DUS
* Fix merge problem
* Remove redundant DUS
* Fix specs
* Remove unused code
* Change wrong class name
* More cleanup
* Re-add missing values to constant
* Fix constant
* Fix spec
* Remove obsolete fields
* Add accidentally removed field
* Update spec
* Move methods from Settings::General to ForemInstance
* Remove unneeded model
* Change mentions of 'site config'
* Removes collective_noun and collective_noun_disabled from app
* Config Generalization: replaces community_qualified_name with community_name
- Generalizes SiteConfig after the removal of collective_noun field
- Updates copy where necessary to be readable with community_name
- Makes the community_name SiteConfig description more explicit
- Adds flexibility for Admins by removing appended "community"
* Adds a data_update script to remove collective_noun and collective_noun_disabled
* Removes appended community from stories_controller.rb
* Removes unnecessary quotation marks around SiteConfig.community_name.to_s
* Makes SiteConfig community_name description more explicit
* Removes topic from #email_from and replaces arg with _
* Removes argument from #email_from (facepalm)
* Reverts changes to application_mailer and notify_mailer_spec
* Removes default "Community" topic from application_mailer and makes topic optional
* Refactors #prepopulate_new_form to resolve Code Climate failures
* Refactors #email_from even further by use of a ternary operator per review suggestion
* Simplifies the data_update script used to remove collective_noun per review request
* Adds a data_update script to append community to community_name
* Updates data_update script to correctly append Community to community_name
* Removes RemoveCollectiveNounFromConfig and updates other script
* Removes superfluous false from data_update script
* Updates data_update script to be more idiomatic
* tooltips 1.0.1
* tooltips 1.0.1
* init
* .
* drop not needed files
* .
* init
* init
* .
* comments
* border
* missing bits
* build comment JS
* .
* .
* specs
* sloan avatar fix
* bunch of fixes
* specs and fixes
* specs
* .
* swap order of links
* contrast
* js for dropdown
* icons
* op-author
* three dots icon
* reverts
* test: capybara- make sure that we click the dropdown before clicking on edit
* permalink --> link
* tiny fixes
* aria-label on form
* proper alt on user's avatar
* aria has popup
* use UL > LI instead of DIV
* add aria-labels to dropdown items
* another aria-label
* better links: nav
* contrast
Co-authored-by: Ridhwana <ridhwana.khan16@gmail.com>
* Added Copy Permalink Functionality to Comment Dropdown
Copy functionality is similar to the way 'copy article link' is implemented. It checks for the android bridge first, then the navigator, then fallsback to the default document copy command
Since the codes were really similar, I moved the copy functionality to a function of its own with callbacks and fallbacks as lambdas, and triggered it with the copyArticleLink and the copyPermalink
* Replaced Copy Permalink Callbacks with Promises
* Keep anchor tags instead of buttons (#1)
* copy permalink using anchor tag
* Missing closing button tag
* Adds 'Copied to Clipboard' Snackbar Message
* Patches bug introduced in #10323
Patch suggested in following comment: https://github.com/forem/forem/pull/8311\#pullrequestreview-492011202
* Removes import statement for addSnackbarItem and Suppresses ESLint Error
Initializer runs in global scope
* Unhandles exception when copying permalink so Honeybadger can handle it
* Replaces ButtonListener suffix for copyPermalink method with Listener
Co-authored-by: Fernando Valverde <fernando@visualcosita.com>