diff --git a/.env.example b/.env.example index f93bebf78..295539aca 100644 --- a/.env.example +++ b/.env.example @@ -21,7 +21,7 @@ PORT=3000 # Used to build URLs in mailers -APP_ROOT_URL=http://localhost:3000 +APP_ROOT_URL=http://127.0.0.1:3000 EMAIL_DEFAULT_FROM='Neighborhood Support ' # Ensures the data in our database is fully encrypted diff --git a/.github/workflows/test-convene-web.yml b/.github/workflows/test-convene-web.yml index f8d825072..2238092db 100644 --- a/.github/workflows/test-convene-web.yml +++ b/.github/workflows/test-convene-web.yml @@ -48,7 +48,7 @@ jobs: - name: Setup Node with cache uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 cache: 'yarn' - name: Install Node dependencies @@ -109,7 +109,7 @@ jobs: - name: Setup Node with cache uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 cache: 'yarn' - name: Allow Ruby process to access port 80 @@ -177,7 +177,7 @@ jobs: - name: Setup Node with cache uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 cache: 'yarn' - name: Install Firefox @@ -212,7 +212,7 @@ jobs: run: | # To wait for asset built # TODO: Start server in production mode - curl --connect-timeout 5 --retry 5 --retry-delay 5 --retry-max-time 40 --retry-connrefused localhost:3000 1> /dev/null + curl --connect-timeout 5 --retry 5 --retry-delay 5 --retry-max-time 60 --retry-connrefused localhost:3000 1> /dev/null yarn run test - name: Upload Test Results uses: actions/upload-artifact@v2 @@ -238,7 +238,7 @@ jobs: - name: Setup Node with cache uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 cache: 'yarn' - name: Install Node dependencies diff --git a/.nvmrc b/.nvmrc index 47979412e..02c8b485e 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -16.20.1 +18.18.0 diff --git a/.rubocop.yml b/.rubocop.yml index 38ce4995f..3d05101d7 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -37,6 +37,3 @@ Style/TrailingCommaInArrayLiteral: Rails/CreateTableWithTimestamps: Exclude: - db/schema.rb - -Capybara/ClickLinkOrButtonStyle: - EnforcedStyle: link_or_button diff --git a/Gemfile b/Gemfile index 557778f7c..c99b5ba61 100644 --- a/Gemfile +++ b/Gemfile @@ -39,7 +39,7 @@ gem "rswag-ui" # Allows us to render .markdown.erb files gem "redcarpet", "~> 3.6" # Breadcrumbs! -gem "gretel", "~> 4.5" +gem "gretel", "~> 4.6" # Better UI components gem "lookbook", ">= 2.0.0.beta.4" gem "view_component", "~> 3.6" diff --git a/Gemfile.lock b/Gemfile.lock index b38506b8a..cc662d518 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -9,76 +9,84 @@ GIT GEM remote: https://rubygems.org/ specs: - actioncable (7.0.4.3) - actionpack (= 7.0.4.3) - activesupport (= 7.0.4.3) + actioncable (7.1.1) + actionpack (= 7.1.1) + activesupport (= 7.1.1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (7.0.4.3) - actionpack (= 7.0.4.3) - activejob (= 7.0.4.3) - activerecord (= 7.0.4.3) - activestorage (= 7.0.4.3) - activesupport (= 7.0.4.3) + zeitwerk (~> 2.6) + actionmailbox (7.1.1) + actionpack (= 7.1.1) + activejob (= 7.1.1) + activerecord (= 7.1.1) + activestorage (= 7.1.1) + activesupport (= 7.1.1) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.0.4.3) - actionpack (= 7.0.4.3) - actionview (= 7.0.4.3) - activejob (= 7.0.4.3) - activesupport (= 7.0.4.3) + actionmailer (7.1.1) + actionpack (= 7.1.1) + actionview (= 7.1.1) + activejob (= 7.1.1) + activesupport (= 7.1.1) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp - rails-dom-testing (~> 2.0) - actionpack (7.0.4.3) - actionview (= 7.0.4.3) - activesupport (= 7.0.4.3) - rack (~> 2.0, >= 2.2.0) + rails-dom-testing (~> 2.2) + actionpack (7.1.1) + actionview (= 7.1.1) + activesupport (= 7.1.1) + nokogiri (>= 1.8.5) + rack (>= 2.2.4) + rack-session (>= 1.0.1) rack-test (>= 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (7.0.4.3) - actionpack (= 7.0.4.3) - activerecord (= 7.0.4.3) - activestorage (= 7.0.4.3) - activesupport (= 7.0.4.3) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + actiontext (7.1.1) + actionpack (= 7.1.1) + activerecord (= 7.1.1) + activestorage (= 7.1.1) + activesupport (= 7.1.1) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.0.4.3) - activesupport (= 7.0.4.3) + actionview (7.1.1) + activesupport (= 7.1.1) builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.1, >= 1.2.0) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) active_record_extended (3.2.1) activerecord (>= 5.2, < 7.2.0) pg (< 3.0) - activejob (7.0.4.3) - activesupport (= 7.0.4.3) + activejob (7.1.1) + activesupport (= 7.1.1) globalid (>= 0.3.6) - activemodel (7.0.4.3) - activesupport (= 7.0.4.3) - activerecord (7.0.4.3) - activemodel (= 7.0.4.3) - activesupport (= 7.0.4.3) + activemodel (7.1.1) + activesupport (= 7.1.1) + activerecord (7.1.1) + activemodel (= 7.1.1) + activesupport (= 7.1.1) + timeout (>= 0.4.0) activerecord-postgres_enum (2.0.1) activerecord (>= 5.2) pg - activestorage (7.0.4.3) - actionpack (= 7.0.4.3) - activejob (= 7.0.4.3) - activerecord (= 7.0.4.3) - activesupport (= 7.0.4.3) + activestorage (7.1.1) + actionpack (= 7.1.1) + activejob (= 7.1.1) + activerecord (= 7.1.1) + activesupport (= 7.1.1) marcel (~> 1.0) - mini_mime (>= 1.1.0) - activesupport (7.0.4.3) + activesupport (7.1.1) + base64 + bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) + connection_pool (>= 2.2.5) + drb i18n (>= 1.6, < 2) minitest (>= 5.1) + mutex_m tzinfo (~> 2.0) addressable (2.8.5) public_suffix (>= 2.0.2, < 6.0) @@ -122,6 +130,7 @@ GEM erubi (>= 1.0.0) rack (>= 0.9.0) rouge (>= 1.0.0) + bigdecimal (3.1.4) bindex (0.8.1) binding_of_caller (1.0.0) debug_inspector (>= 0.0.1) @@ -160,6 +169,8 @@ GEM dotenv-rails (2.8.1) dotenv (= 2.8.1) railties (>= 3.2) + drb (2.1.1) + ruby2_keywords erubi (1.12.0) factory_bot (6.2.0) activesupport (>= 5.0.0) @@ -187,14 +198,14 @@ GEM net-http-persistent (~> 4.0) faraday-retry (2.2.0) faraday (~> 2.0) - ffi (1.15.5) + ffi (1.16.3) friendly_id (5.5.0) activerecord (>= 4.0.0) - globalid (1.1.0) - activesupport (>= 5.0) - gretel (4.5.0) - actionview (>= 5.1, < 7.1) - railties (>= 5.1, < 7.1) + globalid (1.2.1) + activesupport (>= 6.1) + gretel (4.6.0) + actionview (>= 5.1, < 7.2) + railties (>= 5.1, < 7.2) hashdiff (1.0.1) htmlbeautifier (1.4.2) htmlentities (4.3.4) @@ -203,6 +214,10 @@ GEM image_processing (1.12.2) mini_magick (>= 4.9.5, < 5) ruby-vips (>= 2.0.17, < 3) + io-console (0.6.0) + irb (1.8.3) + rdoc + reline (>= 0.3.8) jbuilder (2.11.5) actionview (>= 5.0.0) activesupport (>= 5.0.0) @@ -219,7 +234,7 @@ GEM rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) lockbox (1.3.0) - loofah (2.21.3) + loofah (2.21.4) crass (~> 1.0.2) nokogiri (>= 1.12.0) lookbook (2.1.1) @@ -243,7 +258,7 @@ GEM matrix (0.4.2) method_source (1.0.0) mini_magick (4.12.0) - mini_mime (1.1.2) + mini_mime (1.1.5) mini_portile2 (2.8.4) minitest (5.20.0) monetize (1.12.0) @@ -257,16 +272,17 @@ GEM railties (>= 3.0) msgpack (1.6.0) multipart-post (2.3.0) + mutex_m (0.1.2) net-http-persistent (4.0.2) connection_pool (~> 2.2) - net-imap (0.3.4) + net-imap (0.4.1) date net-protocol net-pop (0.1.2) net-protocol net-protocol (0.2.1) timeout - net-smtp (0.3.3) + net-smtp (0.4.0) net-protocol nio4r (2.5.9) nokogiri (1.15.4) @@ -274,7 +290,7 @@ GEM racc (~> 1.4) pagy (6.1.0) parallel (1.23.0) - parser (3.2.2.3) + parser (3.2.2.4) ast (~> 2.4.1) racc pg (1.5.4) @@ -284,6 +300,8 @@ GEM pry-byebug (3.10.1) byebug (~> 11.0) pry (>= 0.13, < 0.15) + psych (5.1.1.1) + stringio public_suffix (5.0.3) puma (6.4.0) nio4r (~> 2.0) @@ -291,22 +309,27 @@ GEM activesupport (>= 3.0.0) racc (1.7.1) rack (2.2.8) + rack-session (1.0.1) + rack (< 3) rack-test (2.1.0) rack (>= 1.3) - rails (7.0.4.3) - actioncable (= 7.0.4.3) - actionmailbox (= 7.0.4.3) - actionmailer (= 7.0.4.3) - actionpack (= 7.0.4.3) - actiontext (= 7.0.4.3) - actionview (= 7.0.4.3) - activejob (= 7.0.4.3) - activemodel (= 7.0.4.3) - activerecord (= 7.0.4.3) - activestorage (= 7.0.4.3) - activesupport (= 7.0.4.3) + rackup (1.0.0) + rack (< 3) + webrick + rails (7.1.1) + actioncable (= 7.1.1) + actionmailbox (= 7.1.1) + actionmailer (= 7.1.1) + actionpack (= 7.1.1) + actiontext (= 7.1.1) + actionview (= 7.1.1) + activejob (= 7.1.1) + activemodel (= 7.1.1) + activerecord (= 7.1.1) + activestorage (= 7.1.1) + activesupport (= 7.1.1) bundler (>= 1.15.0) - railties (= 7.0.4.3) + railties (= 7.1.1) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -323,13 +346,14 @@ GEM rails-html-sanitizer (1.6.0) loofah (~> 2.21) nokogiri (~> 1.14) - railties (7.0.4.3) - actionpack (= 7.0.4.3) - activesupport (= 7.0.4.3) - method_source + railties (7.1.1) + actionpack (= 7.1.1) + activesupport (= 7.1.1) + irb + rackup (>= 1.0.0) rake (>= 12.2) - thor (~> 1.0) - zeitwerk (~> 2.5) + thor (~> 1.0, >= 1.2.2) + zeitwerk (~> 2.6) rainbow (3.1.1) rake (13.0.6) ranked-model (0.4.9) @@ -337,10 +361,14 @@ GEM rb-fsevent (0.11.2) rb-inotify (0.10.1) ffi (~> 1.0) + rdoc (6.5.0) + psych (>= 4.0.0) redcarpet (3.6.0) redis-client (0.17.0) connection_pool - regexp_parser (2.8.1) + regexp_parser (2.8.2) + reline (0.3.9) + io-console (~> 0.5) rexml (3.2.6) rotp (6.3.0) rouge (4.1.3) @@ -361,17 +389,17 @@ GEM rspec-mocks (~> 3.12) rspec-support (~> 3.12) rspec-support (3.12.1) - rswag-api (2.10.1) - railties (>= 3.1, < 7.1) - rswag-specs (2.10.1) - activesupport (>= 3.1, < 7.1) + rswag-api (2.11.0) + railties (>= 3.1, < 7.2) + rswag-specs (2.11.0) + activesupport (>= 3.1, < 7.2) json-schema (>= 2.2, < 4.0) - railties (>= 3.1, < 7.1) + railties (>= 3.1, < 7.2) rspec-core (>= 2.14) - rswag-ui (2.10.1) - actionpack (>= 3.1, < 7.1) - railties (>= 3.1, < 7.1) - rubocop (1.56.3) + rswag-ui (2.11.0) + actionpack (>= 3.1, < 7.2) + railties (>= 3.1, < 7.2) + rubocop (1.56.4) base64 (~> 0.1.1) json (~> 2.3) language_server-protocol (>= 3.17.0) @@ -389,10 +417,10 @@ GEM rubocop (~> 1.41) rubocop-factory_bot (2.24.0) rubocop (~> 1.33) - rubocop-performance (1.19.0) + rubocop-performance (1.19.1) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) - rubocop-rails (2.21.1) + rubocop-rails (2.21.2) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.33.0, < 2.0) @@ -407,18 +435,18 @@ GEM ffi (~> 1.12) ruby2_keywords (0.0.5) rubyzip (2.3.2) - selenium-webdriver (4.13.1) + selenium-webdriver (4.14.0) rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) websocket (~> 1.0) - sentry-rails (5.11.0) + sentry-rails (5.12.0) railties (>= 5.0) - sentry-ruby (~> 5.11.0) - sentry-ruby (5.11.0) + sentry-ruby (~> 5.12.0) + sentry-ruby (5.12.0) concurrent-ruby (~> 1.0, >= 1.0.2) shoulda-matchers (5.3.0) activesupport (>= 5.2.0) - sidekiq (7.1.4) + sidekiq (7.1.6) concurrent-ruby (< 2) connection_pool (>= 2.3.0) rack (>= 2.2.4) @@ -437,38 +465,39 @@ GEM actionpack (>= 5.2) activesupport (>= 5.2) sprockets (>= 3.0.0) - square.rb (32.0.0.20230925) + square.rb (33.0.0.20231018) apimatic_core (~> 0.3.0) apimatic_core_interfaces (~> 0.2.0) apimatic_faraday_client_adapter (~> 0.1.0) - standard (1.31.1) + standard (1.31.2) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.0) - rubocop (~> 1.56.2) + rubocop (~> 1.56.4) standard-custom (~> 1.0.0) standard-performance (~> 1.2) standard-custom (1.0.2) lint_roller (~> 1.0) rubocop (~> 1.50) - standard-performance (1.2.0) + standard-performance (1.2.1) lint_roller (~> 1.1) - rubocop-performance (~> 1.19.0) - stimulus-rails (1.2.2) + rubocop-performance (~> 1.19.1) + stimulus-rails (1.3.0) railties (>= 6.0.0) + stringio (3.0.8) strip_attributes (1.13.0) activemodel (>= 3.0, < 8.0) - stripe (9.3.0) - strong_migrations (1.6.3) + stripe (10.0.0) + strong_migrations (1.6.4) activerecord (>= 5.2) - thor (1.2.2) - timeout (0.3.2) - turbo-rails (1.4.0) + thor (1.3.0) + timeout (0.4.0) + turbo-rails (1.5.0) actionpack (>= 6.0.0) activejob (>= 6.0.0) railties (>= 6.0.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (2.4.2) + unicode-display_width (2.5.0) view_component (3.6.0) activesupport (>= 5.2.0, < 8.0) concurrent-ruby (~> 1.0) @@ -482,8 +511,9 @@ GEM addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) + webrick (1.8.1) websocket (1.2.10) - websocket-driver (0.7.5) + websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) xpath (3.2.0) @@ -510,7 +540,7 @@ DEPENDENCIES factory_bot_rails faker friendly_id (~> 5.5.0) - gretel (~> 4.5) + gretel (~> 4.6) image_processing jbuilder (~> 2.11) jsbundling-rails diff --git a/app/assets/stylesheets/components/button.scss b/app/assets/stylesheets/components/button.scss index e5d4520fd..23e2cadc9 100644 --- a/app/assets/stylesheets/components/button.scss +++ b/app/assets/stylesheets/components/button.scss @@ -5,36 +5,36 @@ [type="submit"], button, .button { - @apply font-bold py-2 px-4 rounded bg-primary-500 text-white text-center transition ease-in-out duration-150; + @apply font-bold py-2 px-4 rounded bg-orange-500 text-white text-center transition ease-in-out duration-150; &:hover { - @apply bg-primary-700; + @apply bg-orange-400; } &:active { - @apply bg-primary-200; + @apply bg-orange-200; } &:focus { - @apply outline-none border-neutral-300 ring-gray-500; + @apply outline-none border-gray-300 ring-gray-500; } &.--danger { - @apply bg-danger-500; + @apply bg-red-500; &:hover { - @apply bg-danger-700; + @apply bg-red-700; } &:active { - @apply bg-danger-200; + @apply bg-red-200; } } &.--neutral { - @apply bg-neutral-500; + @apply bg-gray-500; &:hover { - @apply bg-neutral-700; + @apply bg-gray-700; } &:active { - @apply bg-neutral-200; + @apply bg-gray-200; } } } diff --git a/app/assets/stylesheets/components/footer.scss b/app/assets/stylesheets/components/footer.scss index 438ae4362..5e86d30ed 100644 --- a/app/assets/stylesheets/components/footer.scss +++ b/app/assets/stylesheets/components/footer.scss @@ -1,5 +1,5 @@ @layer components { body > footer { - @apply flex items-center justify-between px-2 py-2 bg-primary-900 text-white; + @apply flex items-center justify-between px-2 py-2 bg-orange-500 text-white; } } diff --git a/app/assets/stylesheets/components/form.scss b/app/assets/stylesheets/components/form.scss index 45df9d269..e46083c9d 100644 --- a/app/assets/stylesheets/components/form.scss +++ b/app/assets/stylesheets/components/form.scss @@ -3,7 +3,7 @@ @apply bg-white shadow rounded-lg p-2 mt-2; legend { - @apply text-lg leading-6 font-medium text-neutral-900; + @apply text-lg leading-6 font-medium text-gray-900; } } @@ -19,7 +19,7 @@ @apply block w-full; } label { - @apply font-medium text-sm leading-6 text-neutral-700 mb-1; + @apply font-medium text-sm leading-6 text-gray-700 mb-1; } input[type="email"], @@ -35,7 +35,7 @@ @apply py-2 px-4 rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset - focus:ring-primary-300; + focus:ring-orange-300; @screen sm { @apply leading-6 text-sm; @@ -71,7 +71,7 @@ select:disabled, textarea:disabled, input:disabled { - @apply bg-neutral-200; + @apply bg-gray-200; } .field_with_errors { @apply text-red-500; diff --git a/app/assets/stylesheets/components/header.scss b/app/assets/stylesheets/components/header.scss index 46992a693..8c70d2992 100644 --- a/app/assets/stylesheets/components/header.scss +++ b/app/assets/stylesheets/components/header.scss @@ -1,27 +1,13 @@ @layer components { - body > header { - @apply flex justify-between px-2 py-2 bg-primary-900 text-white place-items-end; - - .profile-menu { - @apply flex flex-row relative; - :first-child { - @apply pr-0; - } - > * { - @apply px-2; - } - } - } - .flash-message { @apply px-4 py-4; &.--notice { - @apply bg-primary-100 text-primary-900; + @apply bg-orange-100 text-orange-500; } &.--alert { - @apply bg-danger-100 text-danger-900; + @apply bg-red-100 text-red-900; } } } diff --git a/app/components/alert_component.rb b/app/components/alert_component.rb index b8eeb3ce8..ee72c45ba 100644 --- a/app/components/alert_component.rb +++ b/app/components/alert_component.rb @@ -25,7 +25,7 @@ def bg_class when :success "bg-green-50" else - "bg-violet-50" + "bg-orange-50" end end @@ -38,7 +38,7 @@ def icon_class when :success "text-green-400" else - "text-violet-400" + "text-orange-400" end end @@ -51,7 +51,7 @@ def title_text_class when :success "text-green-800" else - "text-violet-800" + "text-orange-800" end end @@ -64,7 +64,7 @@ def content_text_class when :success "text-green-700" else - "text-violet-700" + "text-orange-700" end end end diff --git a/app/components/button_component.rb b/app/components/button_component.rb index a51f8b1d8..c5771c8bc 100644 --- a/app/components/button_component.rb +++ b/app/components/button_component.rb @@ -69,34 +69,34 @@ def base_classes "focus-visible:outline", "focus-visible:outline-2", "focus-visible:outline-offset-2", - "focus-visible:outline-purple-600" + "focus-visible:outline-orange-400" ] end def secondary_classes [ "bg-white", - "text-purple-950", + "text-orange-950", "ring-gray-300", - "hover:bg-purple-100", - "hover:text-purple-700" + "hover:bg-orange-100", + "hover:text-orange-700" ] end def danger_classes [ - "bg-danger-500", - "hover:bg-danger-700", - "active:bg-danger-200", + "bg-red-500", + "hover:bg-red-700", + "active:bg-red-200", "text-white" ] end def primary_classes [ - "bg-purple-600", + "bg-orange-500", "text-white", - "hover:bg-purple-700", + "hover:bg-orange-400", "hover:text-white" ] end diff --git a/app/components/card_component.rb b/app/components/card_component.rb index 7b7b43c28..d49965636 100644 --- a/app/components/card_component.rb +++ b/app/components/card_component.rb @@ -20,7 +20,7 @@ def card_classes_wrapper def card_classes_footer [ - "bg-purple-50", + "bg-orange-50", "p-4", "sm:p-6", # content? is not always working as described, and is returning a proc in some cases rather than a boolean diff --git a/app/components/marketplace/stripe_overview_component/stripe_overview_component.html.erb b/app/components/marketplace/stripe_overview_component/stripe_overview_component.html.erb index f67c97130..d66281c94 100644 --- a/app/components/marketplace/stripe_overview_component/stripe_overview_component.html.erb +++ b/app/components/marketplace/stripe_overview_component/stripe_overview_component.html.erb @@ -1,14 +1,30 @@ -<%= render CardComponent.new(classes: "flex flex-col h-full +<%= render CardComponent.new(dom_id: "stripe_overview", classes: "flex flex-col h-full ") do %> -
- <%= marketplace_stripe_utility&.name %> -
- + <%- else %> +
To start accepting payments, add your Stripe Account.
+ + <%- end %> <%- end %> diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 6f45284fc..edb083e15 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -29,7 +29,7 @@ class ApplicationController < ActionController::Base # @return [String] helper_method def page_title if current_space.present? - "Convene - #{current_space.name}" + current_space.name else "Convene" end @@ -64,10 +64,10 @@ class ApplicationController < ActionController::Base # Removes the root branded domain from the path builder # @see http://api.rubyonrails.org/classes/ActionDispatch/Routing/PolymorphicRoutes.html#method-i-polymorphic_path - helper_method def polymorphic_path(options, **attributes) - if options[0].try(:branded_domain).present? && options.length > 1 - options.delete_at(0) - elsif [:edit, :new].include?(options[0]) && options.try(:branded_domain).present? + helper_method def polymorphic_path(record_or_hash_or_array, options = {}) + if record_or_hash_or_array[0].try(:branded_domain).present? && record_or_hash_or_array.length > 1 + record_or_hash_or_array.delete_at(0) + elsif [:edit, :new].include?(record_or_hash_or_array[0]) && record_or_hash_or_array.try(:branded_domain).present? options.delete_at(1) end @@ -159,7 +159,6 @@ def space_repository end def handle_unauthorized(exception) - Sentry.capture_exception(exception, level: :warn) render_not_found end diff --git a/app/controllers/rooms_controller.rb b/app/controllers/rooms_controller.rb index 4279a53e9..adf5a983e 100644 --- a/app/controllers/rooms_controller.rb +++ b/app/controllers/rooms_controller.rb @@ -53,7 +53,7 @@ def room_params end helper_method def page_title - ["[Convene]", current_room&.name, current_space&.name].compact.join(" - ") + [current_room&.name, current_space&.name].compact.join(" - ") end helper_method def room diff --git a/app/furniture/journal/entry_component.html.erb b/app/furniture/journal/entry_component.html.erb index 02dc3f235..0f5d38fc4 100644 --- a/app/furniture/journal/entry_component.html.erb +++ b/app/furniture/journal/entry_component.html.erb @@ -1,6 +1,6 @@
-
-

<%= entry.headline %>

+
+

<%= entry.headline %>

<%- if entry.published?%> Published on <%= link_to published_at, entry.location %> <%- else %> diff --git a/app/furniture/marketplace/cart/deliveries/_delivery.html.erb b/app/furniture/marketplace/cart/deliveries/_delivery.html.erb index 97fa775dc..c957fe8cc 100644 --- a/app/furniture/marketplace/cart/deliveries/_delivery.html.erb +++ b/app/furniture/marketplace/cart/deliveries/_delivery.html.erb @@ -7,7 +7,7 @@ <%= turbo_frame_tag(delivery) do %> <% if delivery.details_filled_in? %>

Delivering to:

-
+

<%= delivery.contact_email %>
<%= number_to_phone(delivery.contact_phone_number) %>
diff --git a/app/furniture/marketplace/carts/_total.html.erb b/app/furniture/marketplace/carts/_total.html.erb index 646c676c2..123d6bc21 100644 --- a/app/furniture/marketplace/carts/_total.html.erb +++ b/app/furniture/marketplace/carts/_total.html.erb @@ -4,7 +4,7 @@ Taxes: <%= humanized_money_with_symbol(cart.tax_total) %> - <%- if cart.delivery_address.present? %> + <%- if cart.delivery_area.present? %> Delivery Fee: <%= humanized_money_with_symbol(cart.delivery_fee) %> <%- end %> diff --git a/app/furniture/marketplace/marketplace_component.html.erb b/app/furniture/marketplace/marketplace_component.html.erb index 600c582f6..a16bd615b 100644 --- a/app/furniture/marketplace/marketplace_component.html.erb +++ b/app/furniture/marketplace/marketplace_component.html.erb @@ -1,3 +1,7 @@ +

+ <%= t('.header', space: marketplace.space.name, room: marketplace.room.name) %> +

+ <%= render onboarding_component %> diff --git a/app/furniture/marketplace/marketplace_component.yml b/app/furniture/marketplace/marketplace_component.yml new file mode 100644 index 000000000..820516be5 --- /dev/null +++ b/app/furniture/marketplace/marketplace_component.yml @@ -0,0 +1,2 @@ +en: + header: Shop %{room} on %{space} diff --git a/app/models/authenticated_session.rb b/app/models/authenticated_session.rb index e5b4b59d3..a0f7d3be7 100644 --- a/app/models/authenticated_session.rb +++ b/app/models/authenticated_session.rb @@ -35,16 +35,10 @@ def destroy def save return false if !valid? || !actionable? - if one_time_password.nil? - authentication_method.send_one_time_password!(space) - return false - elsif authentication_method.verify?(one_time_password) - session[:person_id] = authentication_method.person.id - authentication_method.confirm! - return true - end - - false + verify_or_resend_otp + rescue ActiveRecord::RecordInvalid + self.authentication_method = nil + verify_or_resend_otp end # If we don't have a OTP _or_ a way of issuing one, there's nothin' we can do. @@ -56,4 +50,15 @@ def save return if one_time_password.nil? || authentication_method.verify?(one_time_password) errors.add(:one_time_password, :invalid_one_time_password) end + + private def verify_or_resend_otp + if one_time_password.nil? + authentication_method.send_one_time_password!(space) + false + elsif authentication_method.verify?(one_time_password) + session[:person_id] = authentication_method.person.id + authentication_method.confirm! + true + end + end end diff --git a/app/models/authentication_method.rb b/app/models/authentication_method.rb index c4429ea1f..d9cd377a6 100644 --- a/app/models/authentication_method.rb +++ b/app/models/authentication_method.rb @@ -37,6 +37,7 @@ def contact_location=(contact_location) end def verify?(one_time_password) + return false if one_time_password.blank? || one_time_password_secret.blank? totp.verify(one_time_password).present? end diff --git a/app/models/blueprint.rb b/app/models/blueprint.rb index 7d54c19e8..6398495e4 100644 --- a/app/models/blueprint.rb +++ b/app/models/blueprint.rb @@ -99,34 +99,24 @@ def space_attributes {email: "space-member@example.com"}], rooms: [ { - name: "Listed Room 1", - publicity_level: :listed, + name: "Room 1", access_level: :public, furnitures: { markdown_text_block: {content: "# Welcome!"} } }, { - name: "Listed Room 2", - publicity_level: :listed, + name: "Room 2", access_level: :public, furnitures: {} }, { - name: "Unlisted Room 1", - publicity_level: :unlisted, - access_level: :public, - furnitures: {} - }, - { - name: "Unlisted Room 2", - publicity_level: :unlisted, - access_level: :public, + name: "Internal Room 1", + access_level: :internal, furnitures: {} }, { name: "Entrance Hall", - publicity_level: :unlisted, furnitures: { markdown_text_block: {content: "# Wooo!"} } diff --git a/app/models/room.rb b/app/models/room.rb index 990932302..973523fe3 100644 --- a/app/models/room.rb +++ b/app/models/room.rb @@ -25,15 +25,6 @@ class Room < ApplicationRecord alias_method :internal?, :internal_access? alias_method :public?, :public_access? - # A Room's Publicity Level indicates how visible the room is. - # `listed` - The room is discoverable by anyone in the space lobby. - # `unlisted` - The room is not listed. - enum publicity_level: { - listed: "listed", - unlisted: "unlisted" - } - validates :publicity_level, presence: true - has_many :gizmos, dependent: :destroy, inverse_of: :room, class_name: :Furniture accepts_nested_attributes_for :gizmos diff --git a/app/policies/room_policy.rb b/app/policies/room_policy.rb index 88a6b8cf3..f962ab14b 100644 --- a/app/policies/room_policy.rb +++ b/app/policies/room_policy.rb @@ -19,8 +19,7 @@ def create? alias_method :new?, :create? def permitted_attributes(params) - [:access_level, :name, :slug, :publicity_level, - gizmos_attributes: + [:access_level, :name, :slug, gizmos_attributes: policy(Furniture).permitted_attributes(params)] end diff --git a/app/views/application/_radio_group.html.erb b/app/views/application/_radio_group.html.erb index bd24b3f71..1b0adba86 100644 --- a/app/views/application/_radio_group.html.erb +++ b/app/views/application/_radio_group.html.erb @@ -3,7 +3,7 @@ <%- options.each do |option| %>
<%= form.radio_button attribute, option, - class: "h-4 w-4 border-gray-300 text-purple-900 focus:ring-purple-600" %> + class: "h-4 w-4 border-gray-300 text-orange-500 focus:ring-orange-600" %> <%= form.label attribute, option, value: option, class: "ml-3 block text-sm leading-6 text-gray-900" %>
diff --git a/app/views/buttons/_minus.html.erb b/app/views/buttons/_minus.html.erb index a876ebe01..fa8cbac3e 100644 --- a/app/views/buttons/_minus.html.erb +++ b/app/views/buttons/_minus.html.erb @@ -9,7 +9,7 @@ <%- if !disabled %> <%= link_to label, href, title: title, method: method, data: data, - class: 'no-underline bg-transparent hover:bg-primary-100 button' %> + class: 'no-underline bg-transparent hover:bg-orange-100 button' %> <%- else %> - <%=label%> + <%=label%> <%- end %> diff --git a/app/views/buttons/_plus.html.erb b/app/views/buttons/_plus.html.erb index 23b93b8b9..8384d4f17 100644 --- a/app/views/buttons/_plus.html.erb +++ b/app/views/buttons/_plus.html.erb @@ -7,4 +7,4 @@ <%= link_to label, href, title: title, data: data, - class: 'no-underline bg-transparent hover:bg-primary-100 button' %> + class: 'no-underline bg-transparent hover:bg-orange-100 button' %> diff --git a/app/views/furnitures/_furniture.html.erb b/app/views/furnitures/_furniture.html.erb index 419172b98..56966b686 100644 --- a/app/views/furnitures/_furniture.html.erb +++ b/app/views/furnitures/_furniture.html.erb @@ -4,7 +4,7 @@
<%- if local_assigns[:editing] %> -
+

<%= furniture.title %>

<%- if edit_href.present? %> diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb index 4e17aa874..69b9af7eb 100644 --- a/app/views/layouts/_header.html.erb +++ b/app/views/layouts/_header.html.erb @@ -1,16 +1 @@ -
- <%= render partial: "breadcrumbs" %> - - -
- <%= render "flash_messages" , flash: flash %> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 845679ce1..22b791257 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -31,23 +31,32 @@ <%- if current_room && policy(current_room).edit? %> <%= link_to t('icons.edit'), [:edit, current_space, current_room], class: 'no-underline', aria: { label: "Configure Section"} %> <%- end %> - <%= render Neighborhood::LinkComponent.new %> -
-
- 💾  - <%= link_to "Contribute", "https://github.com/zinc-collective/convene" %> - 💚  - <%= link_to "Sponsor", "https://opencollective.com/zinc-community" %> +
- <%- if current_space&.agreements&.present? %> -
- <%- current_space.agreements.each do |agreement| %> - <%- next unless agreement.persisted? %> - <%= link_to(agreement.name, agreement.location, class: "px-4 py-2") %> +
- <%- end %> + <%= link_to "Sign out", [current_space, :authenticated_session].compact, data: { turbo: true, turbo_method: :delete }, class: "sign-out px-4 py-1" %> + <%- else %> + <%= link_to "Sign in", [:new, current_space, :authenticated_session].compact, class: "px-4 py-1" %> + <%- end %> + + +
+ <%= link_to "💾 Contribute", "https://github.com/zinc-collective/convene", class: "px-2 py-1" %> + <%= link_to "💚 Sponsor", "https://opencollective.com/zinccommunity", class: "px-2 py-1" %> + + <%- current_space&.agreements&.each do |agreement| %> + <%- next unless agreement.persisted? %> + <%= link_to(agreement.name, agreement.location, class: "px-2 py-1") %> + <%- end %> +
+
+ <%= render Neighborhood::LinkComponent.new %> +
diff --git a/app/views/rooms/_form.html.erb b/app/views/rooms/_form.html.erb index 0c5e97596..aa7138862 100644 --- a/app/views/rooms/_form.html.erb +++ b/app/views/rooms/_form.html.erb @@ -5,15 +5,9 @@

Privacy and Security

- <%= render "radio_group", attribute: :publicity_level, options: Room::publicity_levels.values, form: room_form %> <%= render "radio_group", attribute: :access_level, options: Room::access_levels.values, form: room_form %>
- <%- if policy(room).destroy? && room.persisted? %> - <%= room_form.button name: "_method", value: "delete", class: "--danger" do %> - <%=t('.destroy')%> - <%- end %> - <%- end %> <%= room_form.submit %>
diff --git a/app/views/rooms/_room.html.erb b/app/views/rooms/_room.html.erb index 1177182b0..eb97b554d 100644 --- a/app/views/rooms/_room.html.erb +++ b/app/views/rooms/_room.html.erb @@ -6,7 +6,7 @@
- <% policy_scope(room.space.rooms.listed).each do |room| %> + <% policy_scope(room.space.rooms).each do |room| %> <%= render partial: 'spaces/room_card', locals: { room: room } %> <% end %>
diff --git a/app/views/rooms/edit.html.erb b/app/views/rooms/edit.html.erb index d9d80fe79..8eef83d26 100644 --- a/app/views/rooms/edit.html.erb +++ b/app/views/rooms/edit.html.erb @@ -20,3 +20,17 @@ <%= render "furnitures/new", furniture: new_furniture %> <%- end %> <% end %> + + +<%- if policy(room).destroy? && room.persisted? && !room.entrance? %> +
+

Remove this Section?

+ <%- data = {} %> + <%- if !room.gizmos.reload.empty? %> +

Warning! Deleting this Section will also delete all Gizmos and their related data. Please be very sure you want to do this! We recommend making the Section "internal" instead.

+ <%- data[:turbo_confirm] = I18n.t("rooms.destroy.confirm", room_name: room.name) %> + <%- end %> + + <%= button_to(t('rooms.destroy.link_to'), room.location, data: data, method: :delete, class: "--danger w-full") %> +
+<%- end %> diff --git a/app/views/spaces/_room_card.html.erb b/app/views/spaces/_room_card.html.erb index 3fadb8f06..1eb57f5db 100644 --- a/app/views/spaces/_room_card.html.erb +++ b/app/views/spaces/_room_card.html.erb @@ -1,14 +1,14 @@ <%= link_to [room.space, room], class: "no-underline" do %> <%= render CardComponent.new( data: { access_level: room.access_level, slug: room.slug, model: "room", id: room.id }, - classes: "group self-stretch hover:bg-purple-100" + classes: "group self-stretch hover:bg-orange-50" ) do %>
-

+

<%= room.name %>

-