diff --git a/Gemfile b/Gemfile index da5faeafb27..9e6aff4039e 100644 --- a/Gemfile +++ b/Gemfile @@ -2,77 +2,49 @@ source "https://rubygems.org" ruby file: ".ruby-version" -# Use main development branch of Rails +# Rails gem "rails", github: "rails/rails", branch: "main" -# The modern asset pipeline for Rails [https://github.com/rails/propshaft] -gem "propshaft" - -# Use postgresql as the database for Active Record +# Drivers gem "pg", "~> 1.1" +gem "redis", ">= 4.0.1" -# Use the Puma web server [https://github.com/puma/puma] +# Deployment gem "puma", ">= 5.0" +gem "bootsnap", require: false -# Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails] +# Assets gem "importmap-rails" +gem "propshaft" +gem "tailwindcss-rails" -# Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev] -gem "turbo-rails", github: "hotwired/turbo-rails", branch: "main" - -# Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev] +# Hotwire gem "stimulus-rails" +gem "turbo-rails", github: "hotwired/turbo-rails", branch: "main" -# Use Tailwind CSS [https://github.com/rails/tailwindcss-rails] -gem "tailwindcss-rails" - -# Build JSON APIs with ease [https://github.com/rails/jbuilder] +# Other +gem "bcrypt", "~> 3.1.7" +gem "inline_svg" gem "jbuilder" - -# Use Redis adapter to run Action Cable in production -gem "redis", ">= 4.0.1" - - # Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis] - # gem "kredis" - - # Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword] - gem "bcrypt", "~> 3.1.7" - -# Windows does not include zoneinfo files, so bundle the tzinfo-data gem gem "tzinfo-data", platforms: %i[ windows jruby ] -# Reduces boot times through caching; required in config/boot.rb -gem "bootsnap", require: false - -# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images] -# gem "image_processing", "~> 1.2" - -# Render SVG's inline so we can add Tailwind classes -gem "inline_svg" - group :development, :test do gem "debug", platforms: %i[ mri windows ] gem "brakeman", require: false - - # Omakase Ruby styling [https://github.com/rails/rubocop-rails-omakase/] gem "rubocop-rails-omakase", require: false - gem "dotenv" - gem "letter_opener" gem "i18n-tasks" end group :development do - # Use console on exceptions pages [https://github.com/rails/web-console] gem "web-console" gem "hotwire-livereload" gem "ruby-lsp-rails" end group :test do - # Use system testing [https://guides.rubyonrails.org/testing.html#system-testing] gem "capybara" gem "selenium-webdriver" end diff --git a/app/views/password_resets/edit.html.erb b/app/views/password_resets/edit.html.erb index 4130b0d67f9..90a94474476 100644 --- a/app/views/password_resets/edit.html.erb +++ b/app/views/password_resets/edit.html.erb @@ -5,14 +5,14 @@ <%= form_with url: password_reset_path(token: params[:token]), html: {class: 'space-y-6'} do |form| %> <%= auth_messages form %> -
- <%= form.label :password, class: 'block text-sm font-medium text-gray-700' %> - <%= form.password_field :password, required: 'required', class: 'p-0 mt-1 bg-transparent border-none opacity-50 focus:outline-none focus:ring-0 focus-within:opacity-100 w-full' %> +
+ <%= form.label :password, class: 'p-4 pb-0 block text-sm font-medium text-gray-700' %> + <%= form.password_field :password, required: 'required', class: 'p-4 pt-1 bg-transparent border-none opacity-50 focus:outline-none focus:ring-0 focus-within:opacity-100 w-full' %>
-
- <%= form.label :password_confirmation, class: 'block text-sm font-medium text-gray-700' %> - <%= form.password_field :password_confirmation, required: 'required', class: 'p-0 mt-1 bg-transparent border-none opacity-50 focus:outline-none focus:ring-0 focus-within:opacity-100 w-full' %> +
+ <%= form.label :password_confirmation, class: 'p-4 pb-0 block text-sm font-medium text-gray-700' %> + <%= form.password_field :password_confirmation, required: 'required', class: 'p-4 pt-1 bg-transparent border-none opacity-50 focus:outline-none focus:ring-0 focus-within:opacity-100 w-full' %>
diff --git a/app/views/password_resets/new.html.erb b/app/views/password_resets/new.html.erb index c89894b1e9f..119f7464822 100644 --- a/app/views/password_resets/new.html.erb +++ b/app/views/password_resets/new.html.erb @@ -5,9 +5,9 @@ <%= form_with url: password_reset_path, html: {class: 'space-y-6'} do |form| %> <%= auth_messages form %> -
- <%= form.label :email, class: 'block text-sm font-medium text-gray-700' %> - <%= form.email_field :email, autofocus: false, autocomplete: "email", required: 'required', placeholder: 'you@example.com', class: 'p-0 mt-1 bg-transparent border-none opacity-50 focus:outline-none focus:ring-0 focus-within:opacity-100 w-full' %> +
+ <%= form.label :email, class: 'p-4 pb-0 block text-sm font-medium text-gray-700' %> + <%= form.email_field :email, autofocus: false, autocomplete: "email", required: 'required', placeholder: 'you@example.com', class: 'p-4 pt-1 bg-transparent border-none opacity-50 focus:outline-none focus:ring-0 focus-within:opacity-100 w-full' %>
diff --git a/app/views/registrations/new.html.erb b/app/views/registrations/new.html.erb index 10bb40b2304..0ea9c3d64a3 100644 --- a/app/views/registrations/new.html.erb +++ b/app/views/registrations/new.html.erb @@ -5,25 +5,25 @@ <%= form_with model: @user, url: registration_path, html: {class: 'space-y-6'} do |form| %> <%= auth_messages form %> -
- <%= form.label :email, class: 'block text-sm font-medium text-gray-700' %> - <%= form.email_field :email, autofocus: false, autocomplete: "email", required: 'required', placeholder: 'you@example.com', class: 'p-0 mt-1 bg-transparent border-none opacity-50 focus:outline-none focus:ring-0 focus-within:opacity-100 w-full' %> +
+ <%= form.label :email, class: 'p-4 pb-0 block text-sm font-medium text-gray-700' %> + <%= form.email_field :email, autofocus: false, autocomplete: "email", required: 'required', placeholder: 'you@example.com', class: 'p-4 pt-1 bg-transparent border-none opacity-50 focus:outline-none focus:ring-0 focus-within:opacity-100 w-full' %>
-
- <%= form.label :password, "Password", class: 'block text-sm font-medium text-gray-700' %> - <%= form.password_field :password, autocomplete: "new-password", required: 'required', class: 'p-0 mt-1 bg-transparent border-none opacity-50 focus:outline-none focus:ring-0 focus-within:opacity-100 w-full' %> +
+ <%= form.label :password, "Password", class: 'p-4 pb-0 block text-sm font-medium text-gray-700' %> + <%= form.password_field :password, autocomplete: "new-password", required: 'required', class: 'p-4 pt-1 bg-transparent border-none opacity-50 focus:outline-none focus:ring-0 focus-within:opacity-100 w-full' %>
-
- <%= form.label :password_confirmation, "Password confirmation", class: 'block text-sm font-medium text-gray-700' %> - <%= form.password_field :password_confirmation, autocomplete: "new-password", required: 'required', class: 'p-0 mt-1 bg-transparent border-none opacity-50 focus:outline-none focus:ring-0 focus-within:opacity-100 w-full' %> +
+ <%= form.label :password_confirmation, "Password confirmation", class: 'p-4 pb-0 block text-sm font-medium text-gray-700' %> + <%= form.password_field :password_confirmation, autocomplete: "new-password", required: 'required', class: 'p-4 pt-1 bg-transparent border-none opacity-50 focus:outline-none focus:ring-0 focus-within:opacity-100 w-full' %>
<% if hosted_app? %> -
- <%= form.label :invite_code, "Invite code", class: 'block text-sm font-medium text-gray-700' %> - <%= form.password_field :invite_code, required: 'required', class: 'p-0 mt-1 bg-transparent border-none opacity-50 focus:outline-none focus:ring-0 focus-within:opacity-100 w-full' %> +
+ <%= form.label :invite_code, "Invite code", class: 'p-4 pb-0 block text-sm font-medium text-gray-700' %> + <%= form.password_field :invite_code, required: 'required', class: 'p-4 pt-1 bg-transparent border-none opacity-50 focus:outline-none focus:ring-0 focus-within:opacity-100 w-full' %>
<% end %> diff --git a/app/views/sessions/new.html.erb b/app/views/sessions/new.html.erb index 904fba7883b..949cf4c3ef4 100644 --- a/app/views/sessions/new.html.erb +++ b/app/views/sessions/new.html.erb @@ -10,14 +10,14 @@ <%= form_with url: session_path, html: {class: 'space-y-6'} do |form| %> <%= auth_messages form %> -
- <%= form.label :email, "Email address", class: 'block text-sm font-medium text-gray-700' %> - <%= form.email_field :email, autofocus: false, autocomplete: "email", required: 'required', placeholder: 'you@example.com', class: 'p-0 mt-1 bg-transparent border-none opacity-50 focus:outline-none focus:ring-0 focus-within:opacity-100 w-full' %> +
+ <%= form.label :email, "Email address", class: 'p-4 pb-0 block text-sm font-medium text-gray-700' %> + <%= form.email_field :email, autofocus: false, autocomplete: "email", required: 'required', placeholder: 'you@example.com', class: 'p-4 pt-1 bg-transparent border-none opacity-50 focus:outline-none focus:ring-0 focus-within:opacity-100 w-full' %>
-
- <%= form.label :password, "Password", class: 'block text-sm font-medium text-gray-700' %> - <%= form.password_field :password, required: 'required', class: 'p-0 mt-1 bg-transparent border-none opacity-50 focus:outline-none focus:ring-0 focus-within:opacity-100 w-full' %> +
+ <%= form.label :password, "Password", class: 'p-4 pb-0 block text-sm font-medium text-gray-700' %> + <%= form.password_field :password, required: 'required', class: 'p-4 pt-1 bg-transparent border-none opacity-50 focus:outline-none focus:ring-0 focus-within:opacity-100 w-full' %>
diff --git a/db/migrate/20240203050018_add_token_index_to_invite_codes.rb b/db/migrate/20240203050018_add_token_index_to_invite_codes.rb new file mode 100644 index 00000000000..295948ec386 --- /dev/null +++ b/db/migrate/20240203050018_add_token_index_to_invite_codes.rb @@ -0,0 +1,5 @@ +class AddTokenIndexToInviteCodes < ActiveRecord::Migration[7.2] + def change + add_index :invite_codes, :token, unique: true + end +end diff --git a/db/schema.rb b/db/schema.rb index ce7d581ae95..45b6b3953ab 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.2].define(version: 2024_02_03_030754) do +ActiveRecord::Schema[7.2].define(version: 2024_02_03_050018) do # These are extensions that must be enabled in order to support this database enable_extension "pgcrypto" enable_extension "plpgsql" @@ -79,6 +79,7 @@ t.string "token", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.index ["token"], name: "index_invite_codes_on_token", unique: true end create_table "users", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|