Skip to content

Commit

Permalink
Merge branch 'release/0.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
akhilgkrishnan committed Aug 22, 2022
2 parents 4701cf2 + d9962e8 commit b40eb15
Show file tree
Hide file tree
Showing 387 changed files with 16,238 additions and 2,942 deletions.
4 changes: 3 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@
{ "pattern": "react-*", "group": "external", "position": "before"},
{ "pattern": "react", "group": "external", "position": "before"},
{ "pattern": "components", "group": "internal" },
{ "pattern": "assets/**", "group": "internal", "position": "after" }
{ "pattern": "assets/**", "group": "internal", "position": "after" },
{ "pattern": "apis", "group": "internal", "position": "after" },
{ "pattern": "common", "group": "internal", "position": "after" }
],
"pathGroupsExcludedImportTypes": ["builtin"],
"alphabetize": { "order": "asc", "caseInsensitive": true }
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ yarn-debug.log*
# Ignore cypress screenshots and videos
cypress/artifacts/screenshots
cypress/artifacts/videos
cypress/screenshots
cypress/videos

.DS_Store

Expand Down
3 changes: 0 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ gem "jbuilder", "~> 2.11"
# Use devise for authentication
gem "devise", git: "https://github.com/heartcombo/devise", branch: "main"

# Use devise_invitable for inviting users
gem "devise_invitable", "~> 2.0", ">= 2.0.6"

# Use Redis adapter to run Action Cable in production
gem "redis", "~> 4.0"

Expand Down
118 changes: 57 additions & 61 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13,72 +13,72 @@ GIT
GEM
remote: https://rubygems.org/
specs:
actioncable (7.0.3)
actionpack (= 7.0.3)
activesupport (= 7.0.3)
actioncable (7.0.3.1)
actionpack (= 7.0.3.1)
activesupport (= 7.0.3.1)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (7.0.3)
actionpack (= 7.0.3)
activejob (= 7.0.3)
activerecord (= 7.0.3)
activestorage (= 7.0.3)
activesupport (= 7.0.3)
actionmailbox (7.0.3.1)
actionpack (= 7.0.3.1)
activejob (= 7.0.3.1)
activerecord (= 7.0.3.1)
activestorage (= 7.0.3.1)
activesupport (= 7.0.3.1)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
actionmailer (7.0.3)
actionpack (= 7.0.3)
actionview (= 7.0.3)
activejob (= 7.0.3)
activesupport (= 7.0.3)
actionmailer (7.0.3.1)
actionpack (= 7.0.3.1)
actionview (= 7.0.3.1)
activejob (= 7.0.3.1)
activesupport (= 7.0.3.1)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.0)
actionpack (7.0.3)
actionview (= 7.0.3)
activesupport (= 7.0.3)
actionpack (7.0.3.1)
actionview (= 7.0.3.1)
activesupport (= 7.0.3.1)
rack (~> 2.0, >= 2.2.0)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (7.0.3)
actionpack (= 7.0.3)
activerecord (= 7.0.3)
activestorage (= 7.0.3)
activesupport (= 7.0.3)
actiontext (7.0.3.1)
actionpack (= 7.0.3.1)
activerecord (= 7.0.3.1)
activestorage (= 7.0.3.1)
activesupport (= 7.0.3.1)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.0.3)
activesupport (= 7.0.3)
actionview (7.0.3.1)
activesupport (= 7.0.3.1)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
active_interaction (4.1.0)
activemodel (>= 5, < 8)
activesupport (>= 5, < 8)
activejob (7.0.3)
activesupport (= 7.0.3)
activejob (7.0.3.1)
activesupport (= 7.0.3.1)
globalid (>= 0.3.6)
activemodel (7.0.3)
activesupport (= 7.0.3)
activerecord (7.0.3)
activemodel (= 7.0.3)
activesupport (= 7.0.3)
activemodel (7.0.3.1)
activesupport (= 7.0.3.1)
activerecord (7.0.3.1)
activemodel (= 7.0.3.1)
activesupport (= 7.0.3.1)
activerecord-import (1.4.0)
activerecord (>= 4.2)
activestorage (7.0.3)
actionpack (= 7.0.3)
activejob (= 7.0.3)
activerecord (= 7.0.3)
activesupport (= 7.0.3)
activestorage (7.0.3.1)
actionpack (= 7.0.3.1)
activejob (= 7.0.3.1)
activerecord (= 7.0.3.1)
activesupport (= 7.0.3.1)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (7.0.3)
activesupport (7.0.3.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
Expand Down Expand Up @@ -153,9 +153,6 @@ GEM
debug (1.5.0)
irb (>= 1.3.6)
reline (>= 0.2.7)
devise_invitable (2.0.6)
actionmailer (>= 5.0)
devise (>= 4.6)
diff-lcs (1.5.0)
digest (3.1.0)
discard (1.2.1)
Expand Down Expand Up @@ -277,11 +274,11 @@ GEM
timeout
newrelic_rpm (8.7.0)
nio4r (2.5.8)
nokogiri (1.13.6-arm64-darwin)
nokogiri (1.13.7-arm64-darwin)
racc (~> 1.4)
nokogiri (1.13.6-x86_64-darwin)
nokogiri (1.13.7-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.13.6-x86_64-linux)
nokogiri (1.13.7-x86_64-linux)
racc (~> 1.4)
oauth2 (1.4.9)
faraday (>= 0.17.3, < 3.0)
Expand Down Expand Up @@ -318,7 +315,7 @@ GEM
activesupport (>= 3.0.0)
raabro (1.4.0)
racc (1.6.0)
rack (2.2.3.1)
rack (2.2.4)
rack-mini-profiler (3.0.0)
rack (>= 1.2.0)
rack-protection (2.2.0)
Expand All @@ -327,20 +324,20 @@ GEM
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (7.0.3)
actioncable (= 7.0.3)
actionmailbox (= 7.0.3)
actionmailer (= 7.0.3)
actionpack (= 7.0.3)
actiontext (= 7.0.3)
actionview (= 7.0.3)
activejob (= 7.0.3)
activemodel (= 7.0.3)
activerecord (= 7.0.3)
activestorage (= 7.0.3)
activesupport (= 7.0.3)
rails (7.0.3.1)
actioncable (= 7.0.3.1)
actionmailbox (= 7.0.3.1)
actionmailer (= 7.0.3.1)
actionpack (= 7.0.3.1)
actiontext (= 7.0.3.1)
actionview (= 7.0.3.1)
activejob (= 7.0.3.1)
activemodel (= 7.0.3.1)
activerecord (= 7.0.3.1)
activestorage (= 7.0.3.1)
activesupport (= 7.0.3.1)
bundler (>= 1.15.0)
railties (= 7.0.3)
railties (= 7.0.3.1)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
actionview (>= 5.0.1.rc1)
Expand All @@ -350,9 +347,9 @@ GEM
nokogiri (>= 1.6)
rails-html-sanitizer (1.4.3)
loofah (~> 2.3)
railties (7.0.3)
actionpack (= 7.0.3)
activesupport (= 7.0.3)
railties (7.0.3.1)
actionpack (= 7.0.3.1)
activesupport (= 7.0.3.1)
method_source
rake (>= 12.2)
thor (~> 1.0)
Expand Down Expand Up @@ -533,7 +530,6 @@ DEPENDENCIES
database_cleaner (~> 2.0)
debug (>= 1.0.0)
devise!
devise_invitable (~> 2.0, >= 2.0.6)
discard (~> 1.2)
dotenv-rails
elasticsearch (< 7.14)
Expand Down
5 changes: 5 additions & 0 deletions app/assets/images/NavAvatar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions app/assets/images/PurpleMiruLogoWithText.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions app/assets/images/user_avatar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

class ApplicationController < ActionController::Base
include DeviseWhitelist
include PunditHelper
include PunditConcern
include ErrorHandler
include CurrentCompanyConcern
include Pagy::Backend
Expand Down
20 changes: 0 additions & 20 deletions app/controllers/clients_controller.rb

This file was deleted.

1 change: 0 additions & 1 deletion app/controllers/companies_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ def create
else
flash.now[:error] = t(".failure")
render :new, status: :unprocessable_entity
Rails.logger.error "DEBUG::COMPANY_CONTROLLER::CREATE"
end
end

Expand Down
1 change: 0 additions & 1 deletion app/controllers/concerns/devise_whitelist.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ module DeviseWhitelist
end

def configured_permitted_parameters
devise_parameter_sanitizer.permit(:invite, keys: [:first_name, :last_name, :current_workspace_id])
devise_parameter_sanitizer.permit(
:sign_up,
keys: [:first_name, :last_name, :email, :password, :password_confirmation, :avatar])
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

module PunditHelper
module PunditConcern
extend ActiveSupport::Concern
include Pundit::Authorization

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/dashboard_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
class DashboardController < ApplicationController
def index
authorize :dashboard
render
redirect_to root_path
end
end
7 changes: 7 additions & 0 deletions app/controllers/home_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# frozen_string_literal: true

class HomeController < ApplicationController
def index
render
end
end
48 changes: 48 additions & 0 deletions app/controllers/internal_api/v1/addresses_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# frozen_string_literal: true

class InternalApi::V1::AddressesController < InternalApi::V1::ApplicationController
before_action :set_addressable

def index
authorize @addressable, policy_class: AddressPolicy
addresses = @addressable.addresses
render :index, locals: { addresses: }, status: :ok
end

def create
authorize @addressable, policy_class: AddressPolicy
address = @addressable.addresses.create!(address_params)
render :create, locals: { address: }, status: :ok
end

def show
authorize address
render :show, locals: { address: }, status: :ok
end

def update
authorize address
address.update!(address_params)
render :update, locals: { address: }, status: :ok
end

private

def set_addressable
if params[:user_id]
@addressable = User.find(params[:user_id])
elsif params[:company_id]
@addressable = Company.find(params[:company_id])
end
end

def address
@address ||= Address.find(params[:id])
end

def address_params
params.require(:address).permit(
:address_type, :address_line_1, :address_line_2, :city, :state, :country, :pin
)
end
end
2 changes: 1 addition & 1 deletion app/controllers/internal_api/v1/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

class InternalApi::V1::ApplicationController < ActionController::API
include PunditHelper
include PunditConcern
include ActionController::MimeResponds
include ErrorHandler
include CurrentCompanyConcern
Expand Down
Loading

0 comments on commit b40eb15

Please sign in to comment.