* Move save over and add button labels
* comment notification design and functionality
* controller error handling
* add ternery operator for background class
* minor cleanup
* add proper styling toggles
* tests and mobile spec
* add for all buttons
* add article as a param
* comment is not required on article preview
* update policy spec
* add test for coverage
* add proper button titles
* use the last user comment as comment id
* add better error handling and remove multiple fetch calls in js
* copy change to threads
* update copy, fix multiple fetch calls, add observer for loading more notifications
* update spec
* add rspecs
* more test specs
* fix test specs
* subscribe button text tests
* add export
* optimistically update ui function tests
* button initialize test
* check for comment ancestry
* add feature flag block
* some cleanup
* update logic and specs
* oops
* rubocop issues
* change config names
* change config names
* fix spec
* add one more conditional
* check for comments
* service-object the toggler
* separate routes
* continual refactoring
* refine spec tests
* clean up policy
* Adjust js and view files to match be params
* some service object refactoring
* separate endpoints on client-side
* broken spec
* service specs
* policy spec fixes
* remove action param
* remove action param from spec
* minor updates
* trigger build
* update to post
* Services don't need permitted params
* Notifications continue to be a mess, decorator specs to follow
* Not toggling now
* This doesn't really belong here
* Fix tests after moving
* Streamline front-end
* There could be errors?
* polymorphic_name is a class thing
* ☠️ json_data in notification views
* Use feature_flag helper to get current_user
* Cannot derive current subscription status from notification, only from subscription
* Default is subscribe to all article comments
* Sync up matching unsubscribe, make subscribe idempotent-ish
* Temporarily comment-out button jest tests to see if I can unstick CI
* Stop trying to detect potential subscribe-to-comment
* Stop trying to detect potential subscribe-to-comment
* Minor spec refactoring
* Add specs for article notification decoration
* NotificationDecorator specs are rather long
* Rubocop likes it?
* Minor spec refactoring
* Doesn't need to stay pending
* Add spec for subscription finder
* Expand Subscribe service specs
* YAGNI, but I don't like hard-coded config
* Refactor Unsubscribe service specs
* nobody expects the infinite scroll
* This *might* work, except for feature flag
* Ancestry can be quite deep actually
* Rubocop
* Update subscribe button for subscribe-to-thread
* Jest tests are just tests
* hasAttribute != getAttribute
* Test knows **nothing** about window size
* Tests have been lying about mobileLabel this whole time
* Make payload/endpoint testable
* Is Jest actually happy???
* Still cleaning up jest/eslint
* Temporarily comment-out cypress tests pending feature flag
* Thanks, Rubocop, what would we do without you
* Preserve round-trip for 'top-level' and 'only-author' subscriptions
* Update specs
* Move save button icon
* Update test with better config param
* Try feature flag specific to cypress env
* Tell cypress to wait for (un)subscribing to work
---------
Co-authored-by: Lawrence S <lawrence@forem.com>
Co-authored-by: Joshua Wehner <joshua@forem.com>
* 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
* 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>
* 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
* Remove extra character from meta_keywords in /listings/index.html.erb
* Remove meta_keywords from MANDATORY_CONFIGS
* Add and use meta_keywords_tag helper
* Use modern tag syntax instead of deprecated syntax
* Add and use meta_keywords_default helper
* Add and use meta_keywords_article helper
* Remove * from meta_keywords_field.label
* Update meta_keyword specs to account for no keywords being set
* Notify Honeybadger when no id can be found for a welcome notification
Also add the event's target's text to the tracking data for a welcome notification's click event.
* Destructure text and title from event.target
* Set up ahoy gem, add ahoy-js
* Import ahoy.js into base.js.erb
* Add trackNotification function to notifications/index.html.erb
* Add sanitized_broadcast_id helper
* Use sanitized_broadcast_id in broadcast partial
* Add specs around tracking welcome notifications
* Remove optional fields from Ahoy::Visit migration + table
* Fiddle with trait to see if it helps with CI failures
* Disable geocode tracking in ahoy
* Stub out SiteConfig in notifications page spec
* Added configurable meta keywords
* Replaced hardcoded meta-keywords with the configurable ones
* Added tests for configurable meta_keywords
* Improve info for configuring meta-keywords
* feat: define the different social media handles
* feat: dynamically render all the social media fields
* feat: ensure that the social media handles are permitter and dealt in a separate path from the rest
* test: update social_networks_handle to social_media_handles
* feat: update the sidebar to use different social media
* feat: update the twitter:site meta handle to be SiteConfig.social_media_handles["twitter"]
* feat: update the a links to tweets
* feat: make the links dynamic and only show those that there is a value for
* refactor: make @ThePracticalDev dynamic
* refactor: make @ThePracticalDev dynamic
* feat: add dynamic social media handles
* chore: rename values
* chore: remove extra social handles
* chore: some spacing
* chore: remove lines
* rafector: user rails-settings-cached type: :hash to set the type and the defaults
* feat: use nil and blank instead of "" and empty
* chore: move the social media handles into the right box
* refactor: rearrange model placement based on the UI
* chore: code climate
* refactor: comments from PR
* chore: rename the ff
* chore: amended twitter username
* chore: add a temporary rake task
* feat: update names
* chore: why am i using the old syntax :(
* chore: revert dynamic erb variable in offline.html
* chore: remove the description
* feat: change the meta og:site_name property from The Practical DEV to The <COMMUNITY_NAME> Community consistently
* refactor: change the canonical link to be more dynamic using the <%= ApplicationConfig["APP_PROTOCOL"] %><%= ApplicationConfig["APP_DOMAIN"] %>
* refactor: update the path to be dynamic
* refactor: change some other meta properties to be dynamic
* refactor: update the index
* refactor: update the sitename to just read <%= ApplicationConfig["COMMUNITY_NAME"] %> Community
* feat: copyright year should be dynamic
* feat: change the meta og:url content to be dynamic by using <%= ApplicationConfig["APP_PROTOCOL"] %><%= ApplicationConfig["APP_DOMAIN"] %> for the former part of the url
* feat: space
* refactor: move the copyright notice to a helper
* refactor: use the community_qualified_name helper!
* refactor: start year is already a string
* refactor: use app url helper instead of <%= ApplicationConfig["APP_PROTOCOL"] %><%= ApplicationConfig["APP_DOMAIN"] %> everywhere
* chore:oops
* refactor: Change <meta name="twitter:image:src" content="http://i.imgur.com/B4JNl1w.png"> to `<meta name="twitter:image:src" content="<%= SiteConfig.main_social_image %>">` consistently.
* refactor: Replace `<meta property="og:image" content="http://i.imgur.com/B4JNl1w.png" />` with ` <meta property="og:image" content="<%= SiteConfig.main_social_image %>" />`
* chore: update some other meta's
* feat: replace 'The Practical DEV' with 'DEV Community' and
* test: remove The :)
* test: copyright_notice
* fix: syntax error
* feat: name of community
* refactor: use app url
* fix: template strings
* fix: tag
* feat: update the app url parameters
* feat: add a community_name helper so we don't have to refer to an environment variable in the templates
* feat: take into account the case when the start year is a blank string
* feat: single quotes to double quotes
* test: add a test for the #community_name
* chore: update or codeclimate
* chore: amend the community helper
* refactor: use the community_name helper in here
* feat: update ApplicationConfig["COMMUNITY_NAME"] with community_name
* fix: Time.current.year needs to be a string :(
* chore: extra space
* chore: change to use community_qualified_name
* move kbd where it should be
* initial cleanup
* do we even need that?
* sponsorships
* cleanups on articles.scss mostly
* initial cleanups to scaffolds
* moving cheese around
* color variables, variables cleanups
* adding spacing units
* variables cleanup
* adding topbar height variable
* a bit of top-bar refactor
* a bit of top-bar refactor
* a bit of top-bar refactor
* simpler animation
* top bar search and responsivness
* loggged out version
* remove unnecessary comment
* fixing svg icons
* search cleanup
* top bar cleanups
* .
* dropdown in header
* removing fill from svgs to make them work in other themes
* remove test element
* topbar icons recreated
* Whoops
* variables naming
* .
* whoops
* Move from env variables to SiteConfig
Related to #5384
This PR only deals with the first remaining part outlined in the issue, starting to use existing SiteConfig keys instead of the env variables.
* Restore Envfile to original version for now
* Increase efficiency and fix pagination offset issue
Right now we filter recently aggregated notifications at runtime, which worked before when there was no pagination, but now filtering is not a good idea combined with offset pagination because it throws off the calculations.
The filtering should be done in the SQL query before paginating, which is what we've switched to. I added a bunch of scopes to make the code clearer as well.
To avoid nesting tags I've also updated the HTML and the JS logic to insert it in the right place.
* Add explanation for hiding the load more button for new users
* Use offset instead of page and explain things
* Make load more button work
* Add tests for admin view
* Restore the previous logged out behavior
* Modernize initNotifications.js
* Revert "Modernize initNotifications.js"
This reverts commit 4a112b797d7911c4ab63ad0c0a07111b4e7abe25.
* Fix elements presence errors
* Change load-more-button to only appear if 7 or more posts (and some notification copy adjustments)
* Allow user to have many orgs
* Allow users to handle multi orgs in settings
* Make rounded buttons inline
* Add multi org function to dashboards
* Fix merge conflicts
* Fix mistake in merge conflict fix oops
* Display the correct membership level
* Fix accessibility issues
* Display organizations for article editors
* Handle submitting org id with preact editors
* Make listings work with multiple organizations
* Allow listings to have multiple orgs on create
* Display the correct number of credits for each org
* Move script tag to Webpack
* Allow multi orgs for purchasing and viewing credits
* Use OrganizationMembership as authorization check
* Display multiple organizations for notifications
* Allow dashboard to be viewable under multi-orgs
* Remove unused method
* Add multi-org functionality for article editors
* Show pro dashboard buttons for member+ org levels
* Leave the correct organization
* Allow article API to change org id
* Add left-out authorization method oops
* Make nav buttons a bit more clear
* Fix merge conflict
* Fix adding org id for /api/articles and tests
* Fix tests for org policy
* Use proper logic for displaying org members
* Update org actions with new authorization
* Use correct org when creating a listing
* Remove additional payment charge oops
* Mark org notifications as read with authorization
* Remove deprecated post_as_organization attribute
* Use new org_admin syntax
* Remove deprecated org logic for article create and update
* Default all RSS posts to not belong to any org
* Render org_member page for guest users
* Update org policy spec to work with multi orgs
* Use org_membership for org traits and move identity code
* Use org_member trait
* Update to work with multi-orgs
* Validate article's org_id if param org_id is blank
* Make a let variable
* Remove unnecessary eager load for credits
* Fix HTML structure and org logic for non-org users
* Update credits spec for multi-org
* Add test for failed payment when purchased by org
* Lint listings_spec
* Test that the listing was created under the user
* Add tests for POST /listings multi-org
* Use double quotes for classes
* Fix /manage and a few other multi-org bugs
* Fix test for multi org
* Use correct method SQL exists? not Rails exist?
* Fix reads spec for multi-org
* Fix org_controller actions to work with multi org
* Test only multi org and not old usage and fix leave_org
* Fix org showing user profile img test for multi-org
* Fix org logic for users with no orgs
* Remove switch org functionality
* Update tests and add hidden param for org id
* Redirect to the specific organization
* Test other org button actions
* Use settings_notice instead of legacy notice and refactor
* Fix weird extra end issue prob from merge conflicts
* Test for with new flash key
* Fix user_views_org tests for multi-org
* Test for new flash message
* Update snapshot with new a11y html
* Move styling to stylesheet
* Add site admins functionality
* Move org_member? method in user model and refactor
* Use unspent_credits_count for organizations
* Add tests for /listings/new and minor bug fixes
* Use .present? in case of empty array
* Fix a lingering deprecated method
* Use greater than 1 for random numbers
* Add tests for counting spent and unspent credits
* Fixed HTML errors in /app/views/additional_content_boxes
* Fixed indentation
* Fixed linting error in /app/views/comments
* Fixed indentation in /app/views/html_variants
* Fixed HTML errors + Fixed indentation in /app/views/internal
* Fixed HTML errors + Fixed indentation in /app/views/layouts
* Fixed indentation in /app/views/mailers
* Fixed indentation in /app/views/moderations
* Fixed HTML errors + Fixed indentation in /app/views/notifications
* Fixed HTML errors in /app/views/pages
* Fixed HTML errors + Fixed indentation in /app/views/social_previews
* Fixed indentation in /app/views/stories
* Fixed indentation in /app/views/stripe_subscriptions
* Fixed indentation in /app/views/tags
* Fixed indentation in /app/views/users
* Add spec for org reaction notification
* Add organization_id to notifications
* Add validations for user and org IDs
* Move comment json_data out of loop
* Use actual column names instead
* Add organization filters
* Remove extra text-align
* Add organization filtering
* Refactor to reduce complexity
* Add receiver argument to handle orgs
* Add has_many notifications for orgs
* Add follow notifications for orgs
* Add comment notifications for orgs
* Rename some tests for specificity
* Add mark org notifications as read functionality
* Add radix to parseInt
* Define json_data outside of loop
* Notify org followers of a new post as well
* Move test to proper location
* Add test for aggregated method
* Make send org reaction notification more readable
* Test the rest of the notification model
* Refactor tag adjustment spec
* Fix extra html
* updating all headers to have h* tags, or changing elements
* Remove commented out binding.pry
* Remove unused page
* Use article instead of div for consistency
* Update snapshot with new section tag
* Use h4 tags again for new views
* Move follow and reaction aggregation into Notification model to avoid re-compute
* Ugh. Fixing schema
* Update tests
* Skip some tests in notifications_spec
* Remove stream and add new notification views
* Actually remove Stream
* Move followers query to async method
* Remove unused tests and fix query
* Try using without delay instead
* Add without delay and escape HTML
* Make all tests pending for now
* Fix sidebar issue for XL displays
* Remove grouping param for follows
* Add aggregated follow notification MVP
* Lint reaction model a bit
* Fix a few small css issues
* Remove puts statement and indent HTML
* Use activity id instead of time for cache key