-
Notifications
You must be signed in to change notification settings - Fork 24
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
Upgrades HackathonManager to Rails 7 #964
Conversation
.col | ||
= pagy_bootstrap_nav(@applicants_pagy).html_safe | ||
- else | ||
%div{ style: "display:flex; align-items: center; flex-direction: column;" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not use inline style attributes
const application = Application.start() | ||
|
||
// Configure Stimulus development experience | ||
application.debug = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
@@ -0,0 +1,9 @@ | |||
import { Application } from "@hotwired/stimulus" | |||
|
|||
const application = Application.start() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
Missing semicolon.
@@ -0,0 +1,9 @@ | |||
import { Application } from "@hotwired/stimulus" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'import' is only available in ES6 (use 'esversion: 6').
Missing semicolon.
} | ||
|
||
submit() { | ||
this.element.requestSubmit() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
|
||
export default class extends Controller { | ||
initialize() { | ||
this.submit = debounce(this.submit.bind(this), 300) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
import { Controller } from "@hotwired/stimulus"; | ||
import debounce from "debounce"; | ||
|
||
export default class extends Controller { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'class' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
'export' is only available in ES6 (use 'esversion: 6').
@@ -0,0 +1,12 @@ | |||
import { Controller } from "@hotwired/stimulus"; | |||
import debounce from "debounce"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'import' is only available in ES6 (use 'esversion: 6').
@@ -0,0 +1,12 @@ | |||
import { Controller } from "@hotwired/stimulus"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'import' is only available in ES6 (use 'esversion: 6').
app/views/manage/application/_questionnaires_datatable.html.haml
Outdated
Show resolved
Hide resolved
|
||
// Eager load all controllers defined in the import map under controllers/**/*_controller | ||
import { eagerLoadControllersFrom } from "@hotwired/stimulus-loading" | ||
eagerLoadControllersFrom("controllers", application) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
import { application } from "controllers/application" | ||
|
||
// Eager load all controllers defined in the import map under controllers/**/*_controller | ||
import { eagerLoadControllersFrom } from "@hotwired/stimulus-loading" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'import' is only available in ES6 (use 'esversion: 6').
Missing semicolon.
@@ -0,0 +1,11 @@ | |||
// Import and register all your controllers from the importmap under controllers/* | |||
|
|||
import { application } from "controllers/application" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'import' is only available in ES6 (use 'esversion: 6').
Missing semicolon.
= pagy_bootstrap_nav(@bulk_messages_pagy).html_safe | ||
|
||
- else | ||
%div{ style: "display:flex; align-items: center; flex-direction: column;" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not use inline style attributes
config.options[config.orm][:primary_key_type] || :primary_key | ||
end | ||
|
||
def blobs_primary_key_type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/IndentationConsistency: Inconsistent indentation detected.
end | ||
|
||
private | ||
def primary_key_type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/IndentationConsistency: Inconsistent indentation detected.
end | ||
end | ||
|
||
private |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/EmptyLinesAroundAccessModifier: Keep a blank line before and after private.
.col | ||
= pagy_bootstrap_nav(@alt_travel_applicants_pagy).html_safe | ||
- else | ||
%div{ style: "display:flex; align-items: center; flex-direction: column;" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not use inline style attributes
.col | ||
= pagy_bootstrap_nav(@applied_pagy).html_safe | ||
- else | ||
%div{ style: "display:flex; align-items: center; flex-direction: column;" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not use inline style attributes
.col | ||
= pagy_bootstrap_nav(@sponsor_info_attendees_pagy).html_safe | ||
- else | ||
%div{ style: "display:flex; align-items: center; flex-direction: column;" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not use inline style attributes
.col | ||
= pagy_bootstrap_nav(@checked_in_applicants_pagy).html_safe | ||
- else | ||
%div{ style: "display:flex; align-items: center; flex-direction: column;" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not use inline style attributes
.col | ||
= pagy_bootstrap_nav(@dietary_restrictions_special_needs_pagy).html_safe | ||
- else | ||
%div{ style: "display:flex; align-items: center; flex-direction: column;" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not use inline style attributes
.col | ||
= pagy_bootstrap_nav(@trackable_tags_pagy).html_safe | ||
- else | ||
%div{ style: "display:flex; align-items: center; flex-direction: column;" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not use inline style attributes
unless column_exists?(:active_storage_blobs, :service_name) | ||
add_column :active_storage_blobs, :service_name, :string | ||
|
||
if configured_service = ActiveStorage::Blob.service.name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lint/AssignmentInCondition: Use == if you meant to do a comparison or wrap the expression in parentheses to indicate you meant to assign in a condition.
@@ -7,6 +9,10 @@ class Agreement < ApplicationRecord | |||
|
|||
has_and_belongs_to_many :questionnaires | |||
|
|||
def self.ransackable_attributes(_) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naming/UncommunicativeMethodParamName: Method parameter must be at least 3 characters long.
|
||
has_many :questionnaires | ||
|
||
strip_attributes | ||
|
||
def self.ransackable_attributes(_) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naming/UncommunicativeMethodParamName: Method parameter must be at least 3 characters long.
@@ -49,6 +51,10 @@ class Message < ApplicationRecord | |||
validates_inclusion_of :template, in: POSSIBLE_TEMPLATES | |||
validates_inclusion_of :type, in: POSSIBLE_TYPES | |||
|
|||
def self.ransackable_attributes(_) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naming/UncommunicativeMethodParamName: Method parameter must be at least 3 characters long.
@@ -323,6 +325,10 @@ class Questionnaire < ApplicationRecord | |||
validates_inclusion_of :shirt_size, in: POSSIBLE_SHIRT_SIZES | |||
validates_inclusion_of :acc_status, in: POSSIBLE_ACC_STATUS | |||
|
|||
def self.ransackable_attributes(_) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naming/UncommunicativeMethodParamName: Method parameter must be at least 3 characters long.
|
||
strip_attributes | ||
|
||
has_many :questionnaires | ||
|
||
def self.ransackable_attributes(_) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naming/UncommunicativeMethodParamName: Method parameter must be at least 3 characters long.
["created_at", "current_sign_in_at", "current_sign_in_ip", "email", "first_name", "id", "is_active", "last_name", "last_sign_in_at", "last_sign_in_ip", "provider", "receive_weekly_report", "role", "uid"] | ||
end | ||
|
||
def self.ransackable_associations(_) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naming/UncommunicativeMethodParamName: Method parameter must be at least 3 characters long.
validates_presence_of :first_name, :last_name | ||
|
||
after_create :queue_reminder_email | ||
after_initialize :set_default_role, if: :new_record? | ||
|
||
enum role: { user: 0, volunteer: 1, organizer: 2, director: 3 } | ||
scope :staff, -> { where(role: [:volunteer, :organizer, :director]) } | ||
|
||
def self.ransackable_attributes(_) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naming/UncommunicativeMethodParamName: Method parameter must be at least 3 characters long.
Nice! This is awesome |
It's been a while, huh? After many years and many failed attempts, HackathonManager is now on Rails 7!
There's still plenty of work to go before a release can happen, but this is by far the biggest step.
Unfortunately, this pull request is massive. When I first started this attempt I had little hope and didn't bother with creating bitesized PRs. Fortunately, most of the core application hasn't changed, rather, updated to removed deprecations and other outdates pieces. I made each commit as small as possible, and ran tests for each commit.
I'll try to highlight below where you should look for the biggest changes and which are mostly likely to break.
What's new
What to review
views->manage->questionnaires->_questionnaires_datatable.html.haml
. The flow of data starts from the controller then goes to the page hosting the table. From there, the data is fed into the partial.Closes #965, #966