Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotwire integration #991

Open
wants to merge 65 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
ed4ffb0
audio recorder
michelson Jan 18, 2023
e40802f
audioRecorder
michelson Jan 18, 2023
82348af
Merge branch 'master' into audio
michelson Jan 18, 2023
db5ca04
audio link
michelson Jan 19, 2023
c99dcba
use audio/mp4
michelson Jan 19, 2023
b6d385e
update rails
michelson Oct 10, 2023
a2e11a3
update rails
michelson Oct 10, 2023
a2ccbd3
merge main
michelson Oct 10, 2023
e037a97
load defaults for rails 7
michelson Oct 11, 2023
8620da8
load defaults for rails 7
michelson Oct 11, 2023
f569677
fix specs
michelson Oct 11, 2023
ffe652c
download latest plugins
michelson Oct 11, 2023
96ea5a2
database cloner fix
michelson Oct 11, 2023
65e0218
pg updated
michelson Oct 11, 2023
4ae141b
app packages graphql fix test
michelson Oct 11, 2023
07197c2
updated taggable
michelson Oct 11, 2023
8a2c95e
merge with rails7.1
michelson Oct 11, 2023
bb0e9d7
docker file gen secret
michelson Oct 11, 2023
26740f1
pg 12 on ruby yml
michelson Oct 11, 2023
e1a5acd
rails 7.1.1
michelson Oct 12, 2023
3057e67
new graphql tests
michelson Oct 12, 2023
3a24bf9
ransack whitelist
michelson Oct 12, 2023
ea7b998
echos
michelson Oct 12, 2023
add671b
database_cleaner update
michelson Oct 13, 2023
6188bfb
update rsepc
michelson Oct 13, 2023
1ea0d97
update rsepc
michelson Oct 13, 2023
915b52b
stage tests, use database cleaner
michelson Oct 13, 2023
1b0af8f
Stage tests (#979)
michelson Oct 13, 2023
10364d4
Merge branch 'stage-tests' into stage
michelson Oct 13, 2023
1cb3051
Merge branch 'stage' of https://github.com/chaskiq/chaskiq into stage
michelson Oct 13, 2023
8cdb8f2
Hotwire integration (#969)
michelson Nov 14, 2023
0b6166c
rubocop & lints
michelson Nov 14, 2023
0e86cfb
merge main
michelson Nov 14, 2023
93cb69f
update open search ruby
michelson Nov 14, 2023
1c90020
lock with index
michelson Nov 14, 2023
a14926b
fix apps creation test
michelson Nov 14, 2023
54f4708
invite
michelson Nov 14, 2023
ec25c35
remove node modules from assets, enhance assets:precompile with tailw…
michelson Nov 14, 2023
8aab199
do image task
michelson Nov 14, 2023
35e93c7
assets compilation js & tw before precompile
michelson Nov 15, 2023
262a748
turbo handling, navigational formats on devise
michelson Nov 15, 2023
f79ea06
lazy load segment predicates
michelson Nov 15, 2023
62f99af
loader added
michelson Nov 15, 2023
194ec7f
mark reads
michelson Nov 15, 2023
f154763
typing indicators
michelson Nov 15, 2023
08b8c72
conversation observer for chat editor toggling
michelson Nov 15, 2023
bf98945
iframeize app package
michelson Nov 15, 2023
034d4a1
silence some console.log
michelson Nov 16, 2023
f986944
fix new messenger specs
michelson Nov 16, 2023
b53796f
fix app packages
michelson Nov 16, 2023
6473e54
turbo history frame
michelson Nov 16, 2023
a23c264
turbo history frame
michelson Nov 16, 2023
a710c49
general navigation as turbo frame, detach fixed packages from it
michelson Nov 17, 2023
3a0c70b
layout handing on turbo content
michelson Nov 17, 2023
a46bcce
resolutions emotion
michelson Feb 18, 2024
3909802
resolutions emotion
michelson Feb 18, 2024
1901b85
flagged account & disable email env
michelson Feb 22, 2024
b50b50e
fiber async falcon
michelson Feb 24, 2024
6fa63b4
update deps
michelson Feb 24, 2024
ed08c9e
registrations & emotion
michelson Feb 25, 2024
f935025
falcon config
michelson Feb 25, 2024
3203653
specs
michelson Feb 25, 2024
e422588
chrome stable
michelson Mar 4, 2024
079ae09
chrome stable
michelson Mar 4, 2024
e35fcc0
chrome stable
michelson Mar 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
23 changes: 23 additions & 0 deletions .erb-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
glob: "**/*.{html,text,js}{+*,}.erb"
exclude:
- '**/vendor/**/*'
- '**/node_modules/**/*'
EnableDefaultLinters: true
Layout/InitialIndentation:
Enabled: false # This rule removes the "<%" e "<%=" from the code, if enabled.
Layout/TrailingEmptyLines:
Enabled: false
Layout/TrailingWhitespace:
Enabled: false # This rule removes the "<%" e "<%=" from the code, if enabled.
Layout/LeadingEmptyLines:
Enabled: false
linters:
ErbSafety:
enabled: true
better_html_config: .better-html.yml
Rubocop:
enabled: true
rubocop_config:
inherit_from:
- .rubocop.yml
52 changes: 52 additions & 0 deletions .github/workflows/do-image.yml--disabled
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# This workfow shows how to build a Docker image, tag and push it to DigitalOcean Container Registry, and
# deploy the application on a DIgitalOcean Kubernetes cluster. For description to the entire worklow,
# see www.digitalocean.com/docs/kubernetes/how-to/deploy-using-github-actions.

name: Build, push

# Controls when the action will run.
on:
# Triggers the workflow on push request on the main branch for changes in the specified paths.
push:
branches:
- main
- stage

# A workflow run is made up of one or more jobs that can run sequentially or in parallel.
jobs:
# This workflow contains a single job called "build".
build:
# The type of runner that the job will run on.
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it.
- name: Checkout master
uses: actions/checkout@main

# Install doctl.
- name: Install doctl
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}

# Build a Docker image of your application in your registry and tag the image with the $GITHUB_SHA.
- name: Build container image
run: docker build --build-arg APP_ENV=production \
--build-arg RUBY_VERSION=3.2.0 \
--build-arg PG_MAJOR=11 \
--build-arg NODE_MAJOR=16 \
--build-arg YARN_VERSION=1.13.0 \
--build-arg BUNDLER_VERSION=2.3.26 \
-t ${{ secrets.DO_REGISTRY_NAME }}/chaskiq:$(echo $GITHUB_REF_NAME) \
.

# run: docker build --platform=linux/amd64 -t ${{ secrets.DO_REGISTRY_NAME }}/chaskiq:$(echo $GITHUB_REF_NAME) .

- name: Log in to DigitalOcean Container Registry with short-lived credentials
run: doctl registry login --expiry-seconds 1200

- name: Push image to DigitalOcean Container Registry
run: docker push ${{ secrets.DO_REGISTRY_NAME }}/chaskiq:$(echo $GITHUB_REF_NAME)
8 changes: 5 additions & 3 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ jobs:
ports: ['6379:6379']
options: --entrypoint redis-server


env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/test
REDIS_URL: redis://localhost:6379/0
Expand All @@ -50,6 +49,8 @@ jobs:
gem install bundler
bundle install --jobs 4 --retry 3
bundle exec rails db:prepare
bin/rails tailwindcss:build
bin/rails javascript:build
bundle exec rake assets:precompile
- name: Build and run tests
env:
Expand All @@ -61,6 +62,8 @@ jobs:
echo "INSTALL NODE"
npm install -g ts-node
echo "RUN SPECS"
wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt-get install -y ./google-chrome-stable_current_amd64.deb
bundle exec rspec -fd ./spec

- name: Build and run E2E tests
Expand All @@ -74,9 +77,8 @@ jobs:
bundle exec rails packages:download_and_install["2.0.0-rc"]
bundle exec rails server -e test -p 5002 -d
./node_modules/.bin/cypress install
curl -i http://localhost:5002
yarn cypress:ga-ci


#- name: Deploy to Heroku
# env:
# HEROKU_API_TOKEN: ${{ secrets.HEROKU_API_TOKEN }}
Expand Down
27 changes: 14 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,22 @@ dist
!/log/.keep
!/tmp/.keep

app/services/message_apis/**/*
# ContentShowcase ArticleSearch Qualifier InboxSections ContactFields
!app/services/message_apis/block_manager.rb
!app/services/message_apis/block_manager.rb
!app/services/message_apis/aticle_search
!app/services/message_apis/audit_reports
!app/services/message_apis/contact_fields
!app/services/message_apis/content_showcase
!app/services/message_apis/inbox_sections
!app/services/message_apis/qualifier
!app/services/message_apis/csat



!app/services/message_apis/base_package.rb
!app/services/message_apis/helpers.rb
!app/services/message_apis/oauth_utils.rb
!app/services/message_apis/presenter_helper.rb

!app/services/message_apis/article_search/*
!app/services/message_apis/audits_reports/*
!app/services/message_apis/contact_fields/*
!app/services/message_apis/content_showcase/*
!app/services/message_apis/csat/*
!app/services/message_apis/inbox_sections/*
!app/services/message_apis/ui_catalog/*

app/services/message_apis/**/*

app/services/message_apis/.git

Expand Down Expand Up @@ -90,4 +91,4 @@ config/credentials/*.yml.enc
/app/assets/builds/*
!/app/assets/builds/.keep

lib/tasks/wassap.rake
lib/tasks/wassap.rake
11 changes: 9 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
.esm
app/javascript/packages/components/dist/**/*
dist
esm
app/javascript/src/styles/styles.css
config/locales
public/packs
config
spec
.esm
translations.json
messenger-translations.json
messenger-translations.json
public/assets/**/*
21 changes: 14 additions & 7 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@ Style/StringLiterals:
Enabled: true
EnforcedStyle: double_quotes
SupportedStyles:
- single_quotes
- double_quotes
- single_quotes
- double_quotes

Style/HashSyntax:
EnforcedShorthandSyntax: never


Rails/EnvironmentVariableAccess:
AllowReads: true

Expand All @@ -24,7 +23,7 @@ Lint/EmptyBlock:
- 'spec/**/*'
Metrics/BlockLength:
Exclude:
- 'spec/**/*'
- 'spec/**/*'

Style/OpenStructUse:
Enabled: false
Expand All @@ -34,11 +33,20 @@ Lint/MissingSuper:
Enabled: false
Rails/SkipsModelValidations:
Enabled: false
Rails/OutputSafety:
Exclude:
- app/helpers/tailwind_form_builder.rb
Metrics/ModuleLength:
Exclude:
- app/helpers/application_helper.rb
- app/services/message_apis/helpers.rb
- spec/**/*
Rails/InverseOf:
Enabled: false

Rails/Pluck:
Exclude:
- app/services/payment_services/**/*
AllCops:
NewCops: enable
Exclude:
Expand All @@ -49,6 +57,5 @@ AllCops:
- 'bin/{rails,rake}'
- 'spec/cypress/**/*'
- 'tmp/**/*'



- 'spec/e2e/**/*'
- public/assets/**/*
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"workbench.editorAssociations": {},
"files.associations": {
"*.erb": "erb"
}
}
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ COPY --chown=docker:docker . /usr/src/app/
RUN NODE_OPTIONS="--max-old-space-size=2048" \
RAILS_ENV=${APP_ENV} \
SECRET_KEY_BASE=`bin/rails secret` \
bundle exec rails assets:precompile --trace \
bundle exec rails tailwindcss:build \
&& bundle exec rails javascript:build \
&& bundle exec rails assets:precompile --trace \
&& rm -rf /usr/src/app/node_modules /usr/src/app/tmp/cache/* /tmp/* \
&& yarn cache clean
22 changes: 18 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,16 @@ gem "haml"
gem "jsbundling-rails"
gem "kredis", "~> 1.3"
gem "propshaft"
gem "puma", "~> 6.0"
# gem "puma", "~> 6.0"
gem "falcon"
gem "rails_heroicon"
gem "sassc"
gem "tailwindcss-rails"

gem "devise" # , "4.7.1" # github: "plataformatec/devise"
# Use CoffeeScript for .coffee assets and views
# gem 'coffee-rails', '~> 4.2'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
# gem "turbolinks", "~> 5"
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem "jbuilder"
# gem 'haml'
Expand Down Expand Up @@ -76,6 +77,9 @@ gem "geocoder", "~> 1.6"
gem "geoip"
gem "truemail"

gem "turbo-rails"
gem "view_component"

gem "google-cloud-dialogflow"
gem "twilio-ruby", "~> 5.58.1"

Expand All @@ -87,7 +91,9 @@ gem "jwt"
gem "devise_invitable", "~> 2.0"
gem "doorkeeper", "~> 5.5.0"
gem "oauth", "~> 0.5.5"
gem "omniauth-auth0"
gem "omniauth-oauth2"
gem "omniauth-rails_csrf_protection"

gem "image_processing", "~> 1.12"
gem "sidekiq" # , "~> 6.5"
Expand Down Expand Up @@ -132,16 +138,17 @@ gem "globalize", github: "globalize/globalize", branch: "main"
# To use Stripe, also include:
gem "stripe", "~> 6.0"
# Reduces boot times through caching; required in config/boot.rb
gem "bootsnap", ">= 1.1.0", require: false
gem "bootsnap", require: false

gem "dotenv-rails", groups: %i[development test]

group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
# gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
gem "cypress-on-rails", "~> 1.0"
gem "cypress-on-rails", "~> 1.6"
gem "execjs"
gem "pry"
gem "pry-remote"
# gem "debug", platforms: %i[mri mingw x64_mingw]
end

Expand All @@ -151,6 +158,7 @@ group :development do
gem "listen" # , ">= 3.0.5", "< 3.2"
gem "web-console", ">= 3.3.0"
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem "erb_lint", require: false
gem "spring"
end

Expand All @@ -161,14 +169,17 @@ group :test do
gem lib # , :git => "https://github.com/rspec/#{lib}.git", :branch => 'master'
end
gem "brakeman"
gem "capybara"
gem "code-scanning-rubocop", require: false
gem "database_cleaner-active_record"
gem "database_cleaner-redis"
gem "factory_bot_rails"
gem "falcon-capybara"
gem "rubocop", require: false
gem "rubocop-performance", require: false
gem "rubocop-rails", require: false
gem "rubocop-rspec", require: false
gem "selenium-webdriver"
gem "shoulda"
gem "shoulda-matchers"
gem "webmock"
Expand All @@ -178,3 +189,6 @@ end
gem "php_serialize", "~> 1.2"
gem "scout_apm"
gem "tzinfo-data", platforms: %i[mingw mswin x64_mingw jruby]

gem "dry-initializer", "~> 3.0"
gem "view_component-contrib", "~> 0.1.0"