Skip to content

Commit 5c0f2d2

Browse files
committed
Merge branch 'release/1.6.6'
2 parents 4925022 + d1ddcab commit 5c0f2d2

File tree

189 files changed

+1852
-7262
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

189 files changed

+1852
-7262
lines changed

.env.example

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,6 @@ GOOGLE_OAUTH_CLIENT_SECRET='google-oauth-client-secret'
2727
# Application Monitoring
2828
NEW_RELIC_LICENSE_KEY='replace with newrelic licence key'
2929

30-
# Redis url
31-
REDIS_URL='redis://127.0.0.1:6379/12'
32-
33-
# Sidekiq Configuration
34-
SIDEKIQ_USERNAME: <some_username>
35-
SIDEKIQ_PASSWORD: <some_password>
36-
3730
# Stripe
3831
STRIPE_PUBLISHABLE_KEY="stripe_publishable_key"
3932
STRIPE_SECRET_KEY="stripe_secret_key"
@@ -61,4 +54,8 @@ SEED_DATA_FROM_CSV=true
6154

6255
VIRTUAL_VERIFIED_ADMIN_EMAILS=[]
6356

64-
CI=true
57+
CI=true
58+
59+
# SolidQueue Configuration
60+
SOLID_QUEUE_USERNAME: <some_username>
61+
SOLID_QUEUE_PASSWORD: <some_password>

Gemfile

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,9 @@ gem "active_interaction"
114114
# For stripe payments
115115
gem "stripe"
116116

117-
# Background job processing adapter
118-
gem "sidekiq", "~> 7.2"
119-
120-
# job scheduler extension for Sidekiq
121-
gem "sidekiq-scheduler"
117+
# Background job processing adapter and dashboard
118+
gem "mission_control-jobs"
119+
gem "solid_queue", "~> 0.3"
122120

123121
# searchkick for elasticsearch
124122
gem "elasticsearch", "< 7.14" # select one
@@ -209,7 +207,6 @@ group :test, :ci do
209207
# Strategies for cleaning databases in Ruby.
210208
gem "database_cleaner", "~> 2.0"
211209
gem "hash_dot"
212-
gem "rspec-sidekiq", git: "https://github.com/wspurgin/rspec-sidekiq", branch: "main"
213210

214211
gem "rspec-buildkite"
215212
gem "rspec-retry"

Gemfile.lock

Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,6 @@ GIT
1111
rubocop
1212
smart_properties
1313

14-
GIT
15-
remote: https://github.com/wspurgin/rspec-sidekiq
16-
revision: 0e710d7698c2fcea77245c7d458bb00b0fc50dae
17-
branch: main
18-
specs:
19-
rspec-sidekiq (4.1.0)
20-
rspec-core (~> 3.0)
21-
rspec-expectations (~> 3.0)
22-
rspec-mocks (~> 3.0)
23-
sidekiq (>= 5, < 8)
24-
2514
GEM
2615
remote: https://rubygems.org/
2716
specs:
@@ -222,7 +211,7 @@ GEM
222211
faraday (~> 1)
223212
multi_json
224213
erubi (1.12.0)
225-
et-orbi (1.2.7)
214+
et-orbi (1.2.11)
226215
tzinfo
227216
execjs (2.8.1)
228217
factory_bot (6.2.1)
@@ -257,8 +246,8 @@ GEM
257246
faraday-retry (1.0.3)
258247
ffi (1.15.5)
259248
foreman (0.87.2)
260-
fugit (1.8.1)
261-
et-orbi (~> 1, >= 1.2.7)
249+
fugit (1.11.0)
250+
et-orbi (~> 1, >= 1.2.11)
262251
raabro (~> 1.4)
263252
gems (1.2.0)
264253
globalid (1.1.0)
@@ -305,6 +294,10 @@ GEM
305294
image_processing (1.12.2)
306295
mini_magick (>= 4.9.5, < 5)
307296
ruby-vips (>= 2.0.17, < 3)
297+
importmap-rails (2.0.1)
298+
actionpack (>= 6.0.0)
299+
activesupport (>= 6.0.0)
300+
railties (>= 6.0.0)
308301
io-console (0.7.2)
309302
irb (1.12.0)
310303
rdoc
@@ -354,6 +347,11 @@ GEM
354347
mini_magick (4.12.0)
355348
mini_mime (1.1.5)
356349
minitest (5.23.1)
350+
mission_control-jobs (0.2.1)
351+
importmap-rails
352+
rails (~> 7.1)
353+
stimulus-rails
354+
turbo-rails
357355
money (6.16.0)
358356
i18n (>= 0.6.4, <= 2)
359357
msgpack (1.6.0)
@@ -483,8 +481,6 @@ GEM
483481
railties (>= 3.2)
484482
tilt
485483
redis (4.8.0)
486-
redis-client (0.22.1)
487-
connection_pool
488484
regexp_parser (2.9.0)
489485
reline (0.5.3)
490486
io-console (~> 0.5)
@@ -552,8 +548,6 @@ GEM
552548
ruby_audit (2.2.0)
553549
bundler-audit (~> 0.9.0)
554550
rubyzip (2.3.2)
555-
rufus-scheduler (3.8.2)
556-
fugit (~> 1.1, >= 1.1.6)
557551
safely_block (0.4.0)
558552
sass-rails (6.0.0)
559553
sassc-rails (~> 2.1, >= 2.1.1)
@@ -589,15 +583,6 @@ GEM
589583
activesupport (>= 3)
590584
shoulda-matchers (5.3.0)
591585
activesupport (>= 5.2.0)
592-
sidekiq (7.2.4)
593-
concurrent-ruby (< 2)
594-
connection_pool (>= 2.3.0)
595-
rack (>= 2.2.4)
596-
redis-client (>= 0.19.0)
597-
sidekiq-scheduler (5.0.1)
598-
rufus-scheduler (~> 3.2)
599-
sidekiq (>= 4, < 8)
600-
tilt (>= 1.4.0)
601586
signet (0.17.0)
602587
addressable (~> 2.8)
603588
faraday (>= 0.17.5, < 3.a)
@@ -613,6 +598,12 @@ GEM
613598
snaky_hash (2.0.1)
614599
hashie
615600
version_gem (~> 1.1, >= 1.1.1)
601+
solid_queue (0.3.3)
602+
activejob (>= 7.1)
603+
activerecord (>= 7.1)
604+
concurrent-ruby (>= 1.3.1)
605+
fugit (~> 1.11.0)
606+
railties (>= 7.1)
616607
spring (4.1.1)
617608
sprockets (4.2.1)
618609
concurrent-ruby (~> 1.0)
@@ -621,6 +612,8 @@ GEM
621612
actionpack (>= 5.2)
622613
activesupport (>= 5.2)
623614
sprockets (>= 3.0.0)
615+
stimulus-rails (1.3.3)
616+
railties (>= 6.0.0)
624617
stringio (3.1.0)
625618
stripe (8.2.0)
626619
strong_migrations (1.4.2)
@@ -630,6 +623,10 @@ GEM
630623
tilt (2.0.11)
631624
timeout (0.4.1)
632625
trailblazer-option (0.1.2)
626+
turbo-rails (2.0.5)
627+
actionpack (>= 6.0.0)
628+
activejob (>= 6.0.0)
629+
railties (>= 6.0.0)
633630
tzinfo (2.0.6)
634631
concurrent-ruby (~> 1.0)
635632
uber (0.1.0)
@@ -698,6 +695,7 @@ DEPENDENCIES
698695
jbuilder (~> 2.11)
699696
letter_opener
700697
letter_opener_web
698+
mission_control-jobs
701699
money
702700
newrelic_rpm (~> 9.8.0)
703701
nokogiri (>= 1.16.2)
@@ -720,7 +718,6 @@ DEPENDENCIES
720718
rspec-buildkite
721719
rspec-rails (~> 6.1)
722720
rspec-retry
723-
rspec-sidekiq!
724721
rubocop
725722
rubocop-performance
726723
rubocop-rails
@@ -735,9 +732,8 @@ DEPENDENCIES
735732
shakapacker (= 6.0.0)
736733
shoulda-callback-matchers (~> 1.1.1)
737734
shoulda-matchers (~> 5.1)
738-
sidekiq (~> 7.2)
739-
sidekiq-scheduler
740735
simplecov
736+
solid_queue (~> 0.3)
741737
spring
742738
stripe
743739
strong_migrations

Procfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
web: bundle exec puma -t 5:5 -p ${PORT:-3000} -e ${RACK_ENV:-production}
2-
worker: bundle exec sidekiq -e production -C config/sidekiq.yml
2+
worker: bundle exec rake solid_queue:start

Procfile.dev

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
web: bin/rails s -b 0.0.0.0 -p 3000
22
webpacker: bin/webpacker-dev-server
3-
sidekiq: bundle exec sidekiq -e development -C config/sidekiq.yml
3+
solidqueue: bundle exec rake solid_queue:start

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ organizations to help them streamline their workflow.
1313
![GitHub release (latest by date)](https://img.shields.io/github/v/release/saeloun/miru-web)
1414
![GitHub commit activity](https://img.shields.io/github/commit-activity/m/saeloun/miru-web)
1515
[![GitHub license](https://img.shields.io/github/license/saeloun/miru-web)](https://github.com/saeloun/miru-web)
16-
[![Twitter Follow](https://img.shields.io/twitter/follow/GetMiru?style=social)](https://twitter.com/getmiru)
16+
[![Twitter Follow](https://img.shields.io/twitter/follow/GetMiru?style=social)](https://x.com/getmiru)
1717

1818
<img src="https://user-images.githubusercontent.com/22231095/170423540-e10ada9e-cf1b-4a05-bbb6-2342955f46b0.png" width="100%" alt="Miru Monthly Timetracking page"/>
1919

@@ -64,7 +64,7 @@ The documentation covers everything from installation and setup to advanced usag
6464
- Subscribe to our latest [blog articles](https://blog.miru.so) and tutorials.
6565
- [Discussions](https://github.com/saeloun/miru-web/discussions): Post your
6666
questions regarding Miru Web
67-
- [**Twitter**](https://twitter.com/getmiru)
67+
- [**Twitter**](https://x.com/getmiru)
6868

6969
## Contributing
7070

app/controllers/internal_api/v1/profile_controller.rb

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
11
# frozen_string_literal: true
22

33
class InternalApi::V1::ProfileController < InternalApi::V1::ApplicationController
4-
def show
5-
authorize :show, policy_class: ProfilePolicy
6-
render :show, locals: { user: current_user }, status: :ok
7-
end
8-
9-
def remove_avatar
10-
authorize :remove_avatar, policy_class: ProfilePolicy
11-
current_user.avatar.destroy
12-
render json: { notice: "Avatar deleted successfully" }, status: :ok
13-
end
14-
154
def update
165
authorize :update, policy_class: ProfilePolicy
176
service = UpdateProfileSettingsService.new(current_user, user_params).process
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# frozen_string_literal: true
2+
3+
class InternalApi::V1::TeamMembers::NotificationPreferencesController < InternalApi::V1::ApplicationController
4+
def show
5+
authorize notification_preference, policy_class: TeamMembers::NotificationPreferencePolicy
6+
render json: { notification_enabled: notification_preference.notification_enabled }, status: :ok
7+
end
8+
9+
def update
10+
authorize notification_preference, policy_class: TeamMembers::NotificationPreferencePolicy
11+
12+
notification_preference.update!(notification_preference_params)
13+
render json: {
14+
notification_enabled: notification_preference.notification_enabled,
15+
notice: "Preference updated successfully"
16+
}, status: :ok
17+
end
18+
19+
private
20+
21+
def notification_preference
22+
@notification_preference ||= NotificationPreference.find_by(
23+
user_id: params[:team_id],
24+
company_id: current_company.id)
25+
end
26+
27+
def notification_preference_params
28+
params.require(:notification_preference).permit(:notification_enabled)
29+
end
30+
end
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# frozen_string_literal: true
2+
3+
class MissionControlController < ApplicationController
4+
before_action :authenticate!, if: :restricted_env?
5+
skip_after_action :verify_authorized
6+
7+
private
8+
9+
def authenticate!
10+
authenticate_or_request_with_http_basic do |username, password|
11+
username == ENV.fetch("SOLID_QUEUE_USERNAME") && password == ENV.fetch("SOLID_QUEUE_PASSWORD")
12+
end
13+
end
14+
15+
def restricted_env?
16+
Rails.env.production?
17+
end
18+
end
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import axios from "./api";
2+
3+
const get = async userId =>
4+
axios.get(`team/${userId}/notification_preferences`);
5+
6+
const updatePreference = async (userId, payload) =>
7+
axios.patch(`team/${userId}/notification_preferences`, payload);
8+
9+
const preferencesApi = { get, updatePreference };
10+
11+
export default preferencesApi;

0 commit comments

Comments
 (0)