Граф коммитов

173 Коммитов

Автор SHA1 Сообщение Дата
Andrew Nesbitt 8983842965 Tweak uglifier config for rails 7 2022-01-11 13:55:02 +00:00
dependabot[bot] 858c82ab70
Bump rails from 6.1.4.4 to 7.0.1 (#2902)
* Bump rails from 6.1.4.4 to 7.0.1

Bumps [rails](https://github.com/rails/rails) from 6.1.4.4 to 7.0.1.
- [Release notes](https://github.com/rails/rails/releases)
- [Commits](https://github.com/rails/rails/compare/v6.1.4.4...v7.0.1)

---
updated-dependencies:
- dependency-name: rails
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Switch to fork of attr_encrypted

* Fix deprecation warning

* Update rails config defaults to 6.1

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Andrew Nesbitt <andrewnez@gmail.com>
2022-01-11 13:05:09 +00:00
Andrew Nesbitt 45a4d27baf
Remove bullet (#2887)
* Delete bullet.rb

* Update Gemfile

* Update Gemfile.lock
2021-12-20 10:11:04 +00:00
Andrew Nesbitt fe2a6c2f0e
Login page for browser extension (#2862)
* WIP login page for browser extension

* Fleshed out extension page
2021-11-26 11:22:28 +00:00
Andrew Nesbitt 9246cddaf7
Seperate API namespace and notifications controller (#2852)
* Seperate api namespace and notifications controller

Closes #2849

* test clean up

* Avoid loading counts in api/notifications#index

* force per_page to ignore cookies in api/notifications

* Update documentation

* there shouldn't be a zeroth page

* move docs to api controllers

* users api controller

* reduce duplicate api templates

* use assert_nil

* pinned searches api controller and docs
2021-11-23 20:04:47 +00:00
Andrew Nesbitt bdc8dc1977
Add lookup endpoint to find notifications by html url (#2808)
* Extract notification json builder into partial

* Add to_api_url method to Octobox::SubjectUrlParser

* Add lookup endpoint to find notifications by html url
2021-10-20 12:10:16 +01:00
dependabot[bot] 5a137c982a
Bump sidekiq from 6.2.1 to 6.2.2 (#2769)
* Bump sidekiq from 6.2.1 to 6.2.2

Bumps [sidekiq](https://github.com/mperham/sidekiq) from 6.2.1 to 6.2.2.
- [Release notes](https://github.com/mperham/sidekiq/releases)
- [Changelog](https://github.com/mperham/sidekiq/blob/master/Changes.md)
- [Commits](https://github.com/mperham/sidekiq/compare/v6.2.1...v6.2.2)

---
updated-dependencies:
- dependency-name: sidekiq
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update sidekiq-unique-jobs

* Update dependencies

* Update sidekiq options

* reorder sidekiq config

* skip two weird tests that only pass if OCTOBOX_BACKGROUND_JOBS_ENABLED=true

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Andrew Nesbitt <andrewnez@gmail.com>
2021-10-18 13:23:33 +01:00
dependabot[bot] d81c0267ca
Bump pagy from 4.11.0 to 5.0.0 (#2804)
* Bump pagy from 4.11.0 to 5.0.0

Bumps [pagy](https://github.com/ddnexus/pagy) from 4.11.0 to 5.0.0.
- [Release notes](https://github.com/ddnexus/pagy/releases)
- [Changelog](https://github.com/ddnexus/pagy/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ddnexus/pagy/compare/4.11.0...5.0.0)

---
updated-dependencies:
- dependency-name: pagy
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fixed tests

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Andrew Nesbitt <andrewnez@gmail.com>
2021-10-18 10:40:15 +01:00
Andrew Nesbitt b2d8944f2f Update dependencies 2021-08-06 09:09:29 +01:00
Andrew Nesbitt 06f8c8d4ca
Allow users to disable confirmation of mute/delete actions (#2616) 2021-03-14 17:55:26 +00:00
Andrew Nesbitt 78ac5cf440
Import and export notifications between instances (#2259) 2020-03-01 15:58:12 +00:00
Andrew Nesbitt 5c4eaa246a
Remove hirefire gem and config (#2196)
No longer using it in production
2020-01-14 10:51:44 +00:00
Andrew Nesbitt 72d1253398
Add config option for database timeout (#2126) 2019-12-03 21:53:11 +00:00
bestest-mensch 52657ce9e0 Add i18n to the users edit view (#2050)
* move users edit titles to i18n

* second pass

* alphabetize

* complete pinned searchs

* wrap up themes section

* finish api token

* update manage oauth buttons

* finish moving strings to local from statistics section

* moving another couple of sections

* add i18n for final section
2019-10-25 11:08:31 +01:00
Roland Huß d20dcd977e fix: Add ALLOW_HOSTNAME and ALLOW_ALL_HOSTNAMES environment variables (#2013)
This is to allow an octobox setup in an reverse proxy setup and to pass
the hostname check as described in https://www.fngtps.com/2019/rails6-blocked-host/

Also, adapted the OpenShift templates to use ALLOW_ALL_HOSTNAMES as
octobox is shielded by the OpenShift router anyway and does not require
this hostname check.

Fixes #2011.
2019-10-24 10:05:41 +01:00
Andrew Nesbitt 3326af9394
Update sidekiq to 6.0 (#2007)
Closes #1998
Closes #2006
2019-09-03 12:09:23 +01:00
Andrew Nesbitt e593cd64dd
Upgrade rails to 6.0.0 (#1803)
* Update to rails 6.0.0

* Fixed rails 6 deprecation warnings

* Update config with rails app:upgrade

* Fix migration

* Remove unneeded action-cable-testing gem

* Fix tests perhaps?

* Update dependencies
2019-08-20 10:50:48 +01:00
Lee f18e03c2cf Allow custom port to be set for postgres OCTOBOX_DATABASE_PASSWORD (#1934)
* Allow custom port to be set for postgres OCTOBOX_DATABASE_PASSWORD. Fixes #1891

* fixed typo from copy / paste

* fixed typo from copy / paste

* fixed env int / string
2019-07-15 10:01:31 +01:00
Andrew Nesbitt 278522c33b
Enable rails 5.2 default settings (#1813) 2019-05-08 14:52:01 +01:00
Edward Muller 478befe2af Determine Dyno RAM (#1789)
If $DYNO_RAM is set, us that, otherwise use the cgroup memory
controller's limit info to calculate the RAM limit. Failing either of
those return the default of 512.

This works in Heroku's Dyno containers and may/probably works in other
containers that mount in the containers cgroup controler.
2019-04-30 08:04:33 +01:00
Andrew Nesbitt 785c07bed0
Remove simple_form gem (#1744)
Was only using it for one tiny form
2019-04-11 20:58:13 +01:00
Andrew Nesbitt 5f03663f58
Swap kaminari paginator for pagy (#1741)
* Swap kaminari paginator for pagy

* Swap kaminari paginator for pagy
2019-04-11 20:38:38 +01:00
Andrew Nesbitt a6c3683305
Remove unused feed parser from octokit config (#1739) 2019-04-10 21:33:47 +01:00
Andrew Nesbitt 9b39caaf17
Only require sidekiq-scheduler gem if if sidekiq_schedule_enabled? (#1737) 2019-04-10 20:40:56 +01:00
Andrew Nesbitt d58304a5d2
Add comment queue to sidekiq config (#1636) 2019-02-25 18:41:40 +00:00
Benjamin Nickolls 52dd3cee0d Post comments directly to a subject from Octobox (#1523)
* Add comment counts to notifications

* Move breakpoint for xxxl to match 15in macbook pro

* Add a a bit of spacing to bottm of the thread

* move comments to partial

* add expand comments button, js, route and controller

* Remove negative comments to load button

* render whole page or partial depending on request type

* remove commented code

* clean up

* * add button styles again
* link button on thread to original issue
+ make avatars smaller
* add timeline thread
* add issue number to threads
* add comment count to threads

* speed up bootsrtrap collapse transitions
remove extra border on collapsed cards

* Add notification reason back in

* middle dot

* Dont hide comment counts on reposive layout

* Alternative (preferred) header layout

* fix header for last comment

* rubcop fix

* fix rubcop bugs

* Fix alignment of comments and labels

* fix pluralize

* bit more space for text after status

* add some (broken) tests

* put the factory in the right place :)

* Add basic comment form, route and controller

* Add comment worker to handle initial comment post

* save comment to db
post comment to gh
sync the comment in the db

* fix comments worker > comment_on_github

/gif it's WORKING

* add simple test

* rescue CommentWorker from recoverable GH errors
add CommentWork tests
add (broken) NotificationsController test

* Redirect user to notification_path if posting a comment
Add test for new comment created on reicieving a comment

* escape keypresses for the comment box

* Render a comment template if we recieve the request from js

* Fix spec

* Do not render comments if we already have it on the thread

* add view on GH button

* Review changes

* Save a sql qry

* DRY up adding a comment

* DRY enough yet?

* Final review check

* * checkpoint to sense check with dat teabass

* Hopefully committing a new conditional... Comment all the things!

* * test whether our can_comment? method is working (TDD FTW)

* fix typos in user.can_comment?
fix personal access token test

* Update app/controllers/notifications_controller.rb

whitebait

Co-Authored-By: BenJam <BenJam@users.noreply.github.com>

* bracket safely!

* review fixes

* fix commentable :|

* actually check whether we have an app_token

* refactor huge logic conditional

* Add requested tests

* Fixed up can_comment? tests

* Fixed rubocop warnings

* Fixed more tests

* use appropriate app token to post comment to github

* More test fixes

* ensure that read issues incldues write permission too

* modify error message

* remove race condition on thread-view clicks in JS

* Add tests for correct key used when posting a comment

* aaand now the test is broken again.

* fix test

* Fix posting to pull requests

* remove dem puts!

* submit comment form on CMD+enter
space buttons in form

* Update docs
2019-02-23 17:06:15 +00:00
Andrew Nesbitt d6207b0b87
Add hirefire configuration (#1619) 2019-02-23 12:32:42 +00:00
Andrew Nesbitt 0c5a42c6fd
Allow POST requests to /notifications/syncing.json (#1612) 2019-02-21 16:33:46 +00:00
Andrew Nesbitt d497c5ec4e
Synchronous open collective donation journey (#1563)
* Synchronous open collective donation journey

* Fix api key parameter name in OC api call

* Add some tests

* Only upgrade user's who've donated at least $10

* Fix tests on travis
2019-02-08 15:15:46 +00:00
Andrew Nesbitt 320c3cfa3c
Disable actioncable logs in production (#1493)
Actioncable logging is very noisy, even at info level and is filling up 
our papertrail account on a daily basis for https://octobox.io at the 
moment, so going to disable it for now.
2019-01-17 13:00:37 +00:00
Andrew Nesbitt d3dc604920
Change queues of some sidekiq jobs (#1483)
Avoids some quick/important jobs getting stuck in the sync_subjects or 
sync_notification queues.

cc https://github.com/octobox/octobox/issues/1277
2019-01-16 14:55:54 +00:00
Benjamin Nickolls da1f0c943a Clean up thread views (#1450)
* Add comment counts to notifications

* Move breakpoint for xxxl to match 15in macbook pro

* Add a a bit of spacing to bottm of the thread

* move comments to partial

* add expand comments button, js, route and controller

* Remove negative comments to load button

* render whole page or partial depending on request type

* remove commented code

* clean up

* * add button styles again
* link button on thread to original issue
+ make avatars smaller
* add timeline thread
* add issue number to threads
* add comment count to threads

* speed up bootsrtrap collapse transitions
remove extra border on collapsed cards

* Add notification reason back in

* middle dot

* Dont hide comment counts on reposive layout

* Alternative (preferred) header layout

* fix header for last comment

* rubcop fix

* fix rubcop bugs

* Fix alignment of comments and labels

* fix pluralize

* bit more space for text after status

* add some (broken) tests

* put the factory in the right place :)
2019-01-15 11:24:25 +00:00
Albin Kerouanton f4be876a32 Break at startup when SECRET_KEY_BASE is too small (#1300)
* Break at startup when SECRET_KEY_BASE is too small

* fix review comment
2019-01-15 09:52:48 +00:00
Andrew Nesbitt 3538ae46a3
Mark as read should always update unread state on GitHub (#1461)
Fixes #1277
2019-01-14 20:42:06 +00:00
Andrew Nesbitt 74de6a90f7
Shorten the check to see if we're running on octobox.io to `Octobox.io?` (#1440) 2019-01-09 19:58:37 +00:00
Albin Kerouanton 30b9d7c45b Specify the allowed origins for actioncable via an env var (#1369) 2018-12-17 13:08:11 +00:00
Andrew Nesbitt 64ec4e34c8
Add initial action_cable setup (#1080) 2018-11-21 09:56:29 +00:00
Andrew Nesbitt cedb55284f
Fix sidekiq initializer (#1236)
Fixes what I broke in https://github.com/octobox/octobox/pull/1234
2018-11-16 12:59:14 +00:00
Andrew Nesbitt 35c31bac1a
Cleanup unique jobs digest after death (#1234)
Should stop users being unable to resync after a previous sync job has 
died
2018-11-16 12:00:04 +00:00
Andrew Nesbitt 8c4aec086e
Show sidekiq-unique-jobs tab in sidekiq ui (#1226) 2018-11-15 10:25:30 +00:00
Andrew Nesbitt 1673a99d52
Perform initial sync of subjects using an installation token (#1135)
* Perform initial sync of subjects using an installation token

Fixes #1125

There was an interesting race condition where the GitHub App was 
installed on a repository and the background job fired before any users 
had authorized the GitHub App oauth.

This meant there wasn't an app_token to download the subjects for 
existing notifications. 

Instead we kick off a sync of all possible subjects for a repository 
using an installation token which doesn't require any users to have 
authorized the GitHub App

* Fix tests
2018-11-12 12:31:41 +00:00
Benjamin Nickolls 6791f0c74c View notification threads in Octobox (#1169)
* Sync comments for issues and pull requests 

Extracted as part of #709

Currently opt-in behind a ENV var

* Mostly working thread-view revisited

* * set three col layout
* remove dodgey comment previews
* simplify layout

* * add new bnreakpoints for larger screens only

* * add notification-type buttons
* add tooltips to next/previous buttons

* * remplement star ticking

* * reimplement archive/unarchive sleected
* add archive/unarchiveThread

* * add mute button

* * add PR status
* move issue status
* fix comment last_read_at check

* * fix typo on empty thread
* fix position of empty thread notie

* * move responsive design up a breakpoint

* * fix up breakpoints
* refactor layout SCSS to reuse responsive elements

* * add :display_comments to user records

* * make only links that are subjectable? click through in Octobox

* * add filtered params to links

* * do not display main notifications window on smaller devices when a thread is open

* * add delete and mute buttons to threads

* * add review tweaks

* Move viewThread click logic to octobox.js

* For notifications with no subject, avoid opening in threadview

Also makes threadview partial resilant to missing subjects, just incase

* * add external link octicon if opening notifications in a new window

* * add error flash message for viewThread

* * add notice about comment threads views

* * remove flash notice
* add card ribbon classes
* add beta notice to setting
2018-11-01 14:52:46 +00:00
Andrew Nesbitt 1f6247c93d
Rubocop fixes (#1075)
* rubocop --auto-correct

* More rubocop fixes
2018-10-10 14:16:19 +01:00
Andrew Nesbitt d12334ee48
Prompt to install the GitHub app for notifications from repos where it's not installed (#1062)
* Promote the GitHub app on Octobox.io

* Add popover prompt for notifications without the app installation

* * make navbar dropdown more consistent with defautl btns
* tone down the 'install GH app button'

* Private repo support coming soon

* Only show prompt on subjectable notifications

* Swap app_install_url for app_url

* add fill state for appm install button

//todo add fill states or all svg fills on twbs...

* oops, forgot to add the svg text class

* Add (incomplete) pricing page

* add pricing page
* amend non-homepage header logoc
* add nicer logo for /privacy and /terms

* Explainer on /pricing page

* add details to /pricing page re open collective and octobox ltd.
* add .readable class for anyhting that is long-form text
* randomise appearance of pricing boxes to reduce risk of anchoring
* make terms and privacy .readable

* * add rake tasks to sync opencollective supporters

* Change coming soon wording

* Use time.current not time.now in logs

* remove extraneous comments

* Swap marketplace_url for octobox_io in billing checks

* Update links on pricing page

* Remove $light variable

* Remove invalid css

* Update pricing prompt text

* Copy updates
2018-10-09 12:22:40 +01:00
Benjamin Nickolls 41b404770c * add basic error pages with bootstrap styling (#1053) 2018-10-05 05:34:56 +01:00
Andrew Nesbitt 6651dcf1b0
Pin searches to the sidebar (#955) 2018-10-04 11:22:01 +01:00
Andrew Nesbitt 37db60b7d1
Allow deleting of notifications from the archive page (#987)
Fixes #882
2018-09-24 13:23:28 +01:00
Andrew Nesbitt af28c75776
Use Oj for generating and parsing JSON (#1001) 2018-09-23 18:06:55 +01:00
Prashu Chaudhary 9938bfabc3 added Bullet gem to detect N+1 queries and unused eager loading (#962)
* added Bullet gem to detect N+1 queries and unused eager loading

* added some more gems for DEV environment

* Moved better_error gems to DEV Group to prevent them Catching the errors
2018-09-19 16:01:16 +01:00
Andrew Nesbitt 59311af84b
Marketplace support (#964) 2018-09-18 22:40:00 +01:00