Skip to content

Commit

Permalink
Merge branch 'release/1.6.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
apoorv1316 committed Jul 10, 2024
2 parents 4925022 + d1ddcab commit 5c0f2d2
Show file tree
Hide file tree
Showing 189 changed files with 1,852 additions and 7,262 deletions.
13 changes: 5 additions & 8 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,6 @@ GOOGLE_OAUTH_CLIENT_SECRET='google-oauth-client-secret'
# Application Monitoring
NEW_RELIC_LICENSE_KEY='replace with newrelic licence key'

# Redis url
REDIS_URL='redis://127.0.0.1:6379/12'

# Sidekiq Configuration
SIDEKIQ_USERNAME: <some_username>
SIDEKIQ_PASSWORD: <some_password>

# Stripe
STRIPE_PUBLISHABLE_KEY="stripe_publishable_key"
STRIPE_SECRET_KEY="stripe_secret_key"
Expand Down Expand Up @@ -61,4 +54,8 @@ SEED_DATA_FROM_CSV=true

VIRTUAL_VERIFIED_ADMIN_EMAILS=[]

CI=true
CI=true

# SolidQueue Configuration
SOLID_QUEUE_USERNAME: <some_username>
SOLID_QUEUE_PASSWORD: <some_password>
9 changes: 3 additions & 6 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,9 @@ gem "active_interaction"
# For stripe payments
gem "stripe"

# Background job processing adapter
gem "sidekiq", "~> 7.2"

# job scheduler extension for Sidekiq
gem "sidekiq-scheduler"
# Background job processing adapter and dashboard
gem "mission_control-jobs"
gem "solid_queue", "~> 0.3"

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

gem "rspec-buildkite"
gem "rspec-retry"
Expand Down
56 changes: 26 additions & 30 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,6 @@ GIT
rubocop
smart_properties

GIT
remote: https://github.com/wspurgin/rspec-sidekiq
revision: 0e710d7698c2fcea77245c7d458bb00b0fc50dae
branch: main
specs:
rspec-sidekiq (4.1.0)
rspec-core (~> 3.0)
rspec-expectations (~> 3.0)
rspec-mocks (~> 3.0)
sidekiq (>= 5, < 8)

GEM
remote: https://rubygems.org/
specs:
Expand Down Expand Up @@ -222,7 +211,7 @@ GEM
faraday (~> 1)
multi_json
erubi (1.12.0)
et-orbi (1.2.7)
et-orbi (1.2.11)
tzinfo
execjs (2.8.1)
factory_bot (6.2.1)
Expand Down Expand Up @@ -257,8 +246,8 @@ GEM
faraday-retry (1.0.3)
ffi (1.15.5)
foreman (0.87.2)
fugit (1.8.1)
et-orbi (~> 1, >= 1.2.7)
fugit (1.11.0)
et-orbi (~> 1, >= 1.2.11)
raabro (~> 1.4)
gems (1.2.0)
globalid (1.1.0)
Expand Down Expand Up @@ -305,6 +294,10 @@ GEM
image_processing (1.12.2)
mini_magick (>= 4.9.5, < 5)
ruby-vips (>= 2.0.17, < 3)
importmap-rails (2.0.1)
actionpack (>= 6.0.0)
activesupport (>= 6.0.0)
railties (>= 6.0.0)
io-console (0.7.2)
irb (1.12.0)
rdoc
Expand Down Expand Up @@ -354,6 +347,11 @@ GEM
mini_magick (4.12.0)
mini_mime (1.1.5)
minitest (5.23.1)
mission_control-jobs (0.2.1)
importmap-rails
rails (~> 7.1)
stimulus-rails
turbo-rails
money (6.16.0)
i18n (>= 0.6.4, <= 2)
msgpack (1.6.0)
Expand Down Expand Up @@ -483,8 +481,6 @@ GEM
railties (>= 3.2)
tilt
redis (4.8.0)
redis-client (0.22.1)
connection_pool
regexp_parser (2.9.0)
reline (0.5.3)
io-console (~> 0.5)
Expand Down Expand Up @@ -552,8 +548,6 @@ GEM
ruby_audit (2.2.0)
bundler-audit (~> 0.9.0)
rubyzip (2.3.2)
rufus-scheduler (3.8.2)
fugit (~> 1.1, >= 1.1.6)
safely_block (0.4.0)
sass-rails (6.0.0)
sassc-rails (~> 2.1, >= 2.1.1)
Expand Down Expand Up @@ -589,15 +583,6 @@ GEM
activesupport (>= 3)
shoulda-matchers (5.3.0)
activesupport (>= 5.2.0)
sidekiq (7.2.4)
concurrent-ruby (< 2)
connection_pool (>= 2.3.0)
rack (>= 2.2.4)
redis-client (>= 0.19.0)
sidekiq-scheduler (5.0.1)
rufus-scheduler (~> 3.2)
sidekiq (>= 4, < 8)
tilt (>= 1.4.0)
signet (0.17.0)
addressable (~> 2.8)
faraday (>= 0.17.5, < 3.a)
Expand All @@ -613,6 +598,12 @@ GEM
snaky_hash (2.0.1)
hashie
version_gem (~> 1.1, >= 1.1.1)
solid_queue (0.3.3)
activejob (>= 7.1)
activerecord (>= 7.1)
concurrent-ruby (>= 1.3.1)
fugit (~> 1.11.0)
railties (>= 7.1)
spring (4.1.1)
sprockets (4.2.1)
concurrent-ruby (~> 1.0)
Expand All @@ -621,6 +612,8 @@ GEM
actionpack (>= 5.2)
activesupport (>= 5.2)
sprockets (>= 3.0.0)
stimulus-rails (1.3.3)
railties (>= 6.0.0)
stringio (3.1.0)
stripe (8.2.0)
strong_migrations (1.4.2)
Expand All @@ -630,6 +623,10 @@ GEM
tilt (2.0.11)
timeout (0.4.1)
trailblazer-option (0.1.2)
turbo-rails (2.0.5)
actionpack (>= 6.0.0)
activejob (>= 6.0.0)
railties (>= 6.0.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
uber (0.1.0)
Expand Down Expand Up @@ -698,6 +695,7 @@ DEPENDENCIES
jbuilder (~> 2.11)
letter_opener
letter_opener_web
mission_control-jobs
money
newrelic_rpm (~> 9.8.0)
nokogiri (>= 1.16.2)
Expand All @@ -720,7 +718,6 @@ DEPENDENCIES
rspec-buildkite
rspec-rails (~> 6.1)
rspec-retry
rspec-sidekiq!
rubocop
rubocop-performance
rubocop-rails
Expand All @@ -735,9 +732,8 @@ DEPENDENCIES
shakapacker (= 6.0.0)
shoulda-callback-matchers (~> 1.1.1)
shoulda-matchers (~> 5.1)
sidekiq (~> 7.2)
sidekiq-scheduler
simplecov
solid_queue (~> 0.3)
spring
stripe
strong_migrations
Expand Down
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
web: bundle exec puma -t 5:5 -p ${PORT:-3000} -e ${RACK_ENV:-production}
worker: bundle exec sidekiq -e production -C config/sidekiq.yml
worker: bundle exec rake solid_queue:start
2 changes: 1 addition & 1 deletion Procfile.dev
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
web: bin/rails s -b 0.0.0.0 -p 3000
webpacker: bin/webpacker-dev-server
sidekiq: bundle exec sidekiq -e development -C config/sidekiq.yml
solidqueue: bundle exec rake solid_queue:start
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ organizations to help them streamline their workflow.
![GitHub release (latest by date)](https://img.shields.io/github/v/release/saeloun/miru-web)
![GitHub commit activity](https://img.shields.io/github/commit-activity/m/saeloun/miru-web)
[![GitHub license](https://img.shields.io/github/license/saeloun/miru-web)](https://github.com/saeloun/miru-web)
[![Twitter Follow](https://img.shields.io/twitter/follow/GetMiru?style=social)](https://twitter.com/getmiru)
[![Twitter Follow](https://img.shields.io/twitter/follow/GetMiru?style=social)](https://x.com/getmiru)

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

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

## Contributing

Expand Down
11 changes: 0 additions & 11 deletions app/controllers/internal_api/v1/profile_controller.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
# frozen_string_literal: true

class InternalApi::V1::ProfileController < InternalApi::V1::ApplicationController
def show
authorize :show, policy_class: ProfilePolicy
render :show, locals: { user: current_user }, status: :ok
end

def remove_avatar
authorize :remove_avatar, policy_class: ProfilePolicy
current_user.avatar.destroy
render json: { notice: "Avatar deleted successfully" }, status: :ok
end

def update
authorize :update, policy_class: ProfilePolicy
service = UpdateProfileSettingsService.new(current_user, user_params).process
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# frozen_string_literal: true

class InternalApi::V1::TeamMembers::NotificationPreferencesController < InternalApi::V1::ApplicationController
def show
authorize notification_preference, policy_class: TeamMembers::NotificationPreferencePolicy
render json: { notification_enabled: notification_preference.notification_enabled }, status: :ok
end

def update
authorize notification_preference, policy_class: TeamMembers::NotificationPreferencePolicy

notification_preference.update!(notification_preference_params)
render json: {
notification_enabled: notification_preference.notification_enabled,
notice: "Preference updated successfully"
}, status: :ok
end

private

def notification_preference
@notification_preference ||= NotificationPreference.find_by(
user_id: params[:team_id],
company_id: current_company.id)
end

def notification_preference_params
params.require(:notification_preference).permit(:notification_enabled)
end
end
18 changes: 18 additions & 0 deletions app/controllers/mission_control_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# frozen_string_literal: true

class MissionControlController < ApplicationController
before_action :authenticate!, if: :restricted_env?
skip_after_action :verify_authorized

private

def authenticate!
authenticate_or_request_with_http_basic do |username, password|
username == ENV.fetch("SOLID_QUEUE_USERNAME") && password == ENV.fetch("SOLID_QUEUE_PASSWORD")
end
end

def restricted_env?
Rails.env.production?
end
end
11 changes: 11 additions & 0 deletions app/javascript/src/apis/preferences.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import axios from "./api";

const get = async userId =>
axios.get(`team/${userId}/notification_preferences`);

const updatePreference = async (userId, payload) =>
axios.patch(`team/${userId}/notification_preferences`, payload);

const preferencesApi = { get, updatePreference };

export default preferencesApi;
20 changes: 0 additions & 20 deletions app/javascript/src/apis/profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,10 @@ import axios from "./api";

const path = "/profile";

const index = () => axios.get(path);

const getAddress = id => axios.get(`/users/${id}/addresses`);

const update = payload => axios.put(`${path}`, payload);

const upadteAvatar = (payload, config) => axios.put(`${path}`, payload, config);

const createAddress = (userId, payload) =>
axios.post(`/users/${userId}/addresses`, payload);

const updateAddress = (userId, addressId, payload) =>
axios.put(`/users/${userId}/addresses/${addressId}`, payload);

const removeAvatar = () => axios.delete(`${path}/remove_avatar`);

const profileApi = {
index,
update,
removeAvatar,
getAddress,
updateAddress,
createAddress,
upadteAvatar,
};

export default profileApi;
4 changes: 2 additions & 2 deletions app/javascript/src/apis/team.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ const updateTeamMember = (id, payload) => axios.put(`${path}/${id}`, payload);

const destroyTeamMemberAvatar = id => axios.delete(`${path}/${id}/avatar`);

const updateTeamMemberAvatar = (id, payload) =>
axios.put(`${path}/${id}/avatar`, payload);
const updateTeamMemberAvatar = (id, payload, config) =>
axios.put(`${path}/${id}/avatar`, payload, config);

const updateTeamMembers = payload =>
axios.put(`${path}/update_team_members`, payload);
Expand Down
6 changes: 1 addition & 5 deletions app/javascript/src/components/InvoiceEmail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,7 @@ const InvoiceEmail = () => {
>
<img height="16px" src={InstagramSVG} width="16px" />
</a>
<a
href="https://twitter.com/i/flow/login?redirect_after_login=%2Fgetmiru"
rel="noreferrer"
target="_blank"
>
<a href="https://x.com/getmiru" rel="noreferrer" target="_blank">
<img height="16px" src={TwitterSVG} width="16px" />
</a>
</span>
Expand Down
Loading

0 comments on commit 5c0f2d2

Please sign in to comment.