-
Notifications
You must be signed in to change notification settings - Fork 84
Add initial applications table #12188
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
base: main
Are you sure you want to change the base?
Conversation
| <p>Loading application...</p> | ||
| <% end %> No newline at end of file |
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.
| <p>Loading application...</p> | |
| <% end %> | |
| <p>Loading application...</p> | |
| <% end %> |
|
|
||
| <%= button_to "Start application", applications_path, method: :post, class: "btn" %> No newline at end of file |
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.
| <%= button_to "Start application", applications_path, method: :post, class: "btn" %> | |
| <%= button_to "Start application", applications_path, method: :post, class: "btn" %> |
| </div> | ||
|
|
||
| <%= form.submit "Next" %> | ||
| <% end %> | ||
| <% end %> No newline at end of file |
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.
| </div> | |
| <%= form.submit "Next" %> | |
| <% end %> | |
| <% end %> | |
| </div> | |
| <%= form.submit "Next" %> | |
| <% end %> | |
| <% end %> |
| </div> | ||
|
|
||
| <%= form.submit "Next" %> | ||
| <% end %> | ||
| <% end %> No newline at end of file |
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.
| </div> | |
| <%= form.submit "Next" %> | |
| <% end %> | |
| <% end %> | |
| </div> | |
| <%= form.submit "Next" %> | |
| <% end %> | |
| <% end %> |
| layout "apply" | ||
|
|
||
| def new |
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 "apply" | |
| def new | |
| layout "apply" | |
| def new |
|
|
||
|
|
||
| <% if current_user.card_grants.not_activated.size > 0 %> |
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.
| <% if current_user.card_grants.not_activated.size > 0 %> | |
| <% if current_user.card_grants.not_activated.size > 0 %> |
|
|
||
|
|
||
| <% if current_user.card_grants.activated.size > 0 %> |
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.
| <% if current_user.card_grants.activated.size > 0 %> | |
| <% if current_user.card_grants.activated.size > 0 %> |
| <% end %> | ||
|
No newline at end of file |
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.
| <% end %> | |
| <% end %> |
|
|
||
|
|
||
| <div class="max-w-lg card flex flex-col gap-3 card--sunken mb-7"> |
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.
| <div class="max-w-lg card flex flex-col gap-3 card--sunken mb-7"> | |
| <div class="max-w-lg card flex flex-col gap-3 card--sunken mb-7"> |
| export default class extends Controller { | ||
| static targets = ['indicator', 'form']; | ||
|
|
||
| connect () { | ||
| console.log("Connected!"); | ||
| } | ||
| } No newline at end of file |
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.
| export default class extends Controller { | |
| static targets = ['indicator', 'form']; | |
| connect () { | |
| console.log("Connected!"); | |
| } | |
| } | |
| export default class extends Controller { | |
| static targets = ['indicator', 'form'] | |
| connect() { | |
| console.log('Connected!') | |
| } | |
| } |
| @application = Event::Application.create!(user: current_user) | ||
| authorize @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.
| @application = Event::Application.create!(user: current_user) | |
| authorize @application | |
| authorize (@application = Event::Application.new(user: current_user)) | |
| @application.save! |
config/routes.rb
Outdated
| get "personal_info" | ||
| get "project_info" |
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.
| get "personal_info" | |
| get "project_info" | |
| member do | |
| get "personal", to: "applications#personal_info" | |
| get "project", to: "applications#project_info" | |
| end |
| @application.update!(application_params) | ||
|
|
||
| @return_to = url_from(params[:event_application][:return_to]) | ||
|
|
||
| return redirect_to @return_to if @return_to.present? | ||
|
|
||
| redirect_back_or_to application_path(@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.
We need to pass these errors to the frontend
| @@ -0,0 +1,9 @@ | |||
| import { Controller } from '@hotwired/stimulus' | |||
|
|
|||
| 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.
| private | ||
|
|
||
| def set_application | ||
| @application = Application.find(params[:application_id] || params[:id]) |
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.
| @application = Application.find(params[:application_id] || params[:id]) | |
| @application = Application.find(params[:id]) |
app/models/event/application.rb
Outdated
| # updated_at :datetime not null | ||
| # airtable_record_id :string | ||
| # event_id :bigint | ||
| # user_id :bigint not null |
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.
@polypixeldev and i talked about making this a one-to-many, but that's low priority and can be migrated in the future.
we'll keep it one to one for now
| <div class="p-4"> | ||
| <div class="flex flex-row items-center justify-between"> | ||
| <h3 class="heading h3 mb-2 mt-0"> | ||
| <%= application.name || "Draft 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.
| <%= application.name || "Draft application" %> | |
| <%= application.name.presence || "Draft application" %> |
| </div> | ||
| </div> | ||
| <div class="bg-smoke bg-opacity-30 h-1"> | ||
| <div class="bg-primary h-1" style="width: <%= application&.completion_percentage || 0 %>%"></div> |
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.
| <div class="bg-primary h-1" style="width: <%= application&.completion_percentage || 0 %>%"></div> | |
| <div class="bg-primary h-1" style="width: <%= application.completion_percentage || 0 %>%"></div> |
app/views/layouts/apply.html.erb
Outdated
| </div> | ||
| <% if @application.present? %> | ||
| <div class="bg-smoke dark:bg-slate h-1"> | ||
| <div class="bg-primary h-1" style="width: <%= @application&.completion_percentage || 0 %>%"></div> |
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.
| <div class="bg-primary h-1" style="width: <%= @application&.completion_percentage || 0 %>%"></div> | |
| <div class="bg-primary h-1" style="width: <%= @application.completion_percentage %>%"></div> |
| <% if current_user.applications.any? %> | ||
| <div class="my-2 ml-0 py-2 px-4 flex flex-row items-end justify-between"> | ||
| <h2 class="heading h2 line-height-4 m-0 p-0 border-none">Applications</h2> | ||
| <%= link_to applications_path, class: "flex items-center shrink-0 no-underline" do %> | ||
| View all applications | ||
| <%= inline_icon "view-forward" %> | ||
| <% end %> | ||
| </div> | ||
|
|
||
| <div class="grid grid--wide mb-12 pb-2 px-4"> | ||
| <% current_user.applications.each do |application| %> | ||
| <%= render partial: "event/applications/application_card", locals: { application: } %> | ||
| <% end %> | ||
| </div> | ||
| <% end %> |
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.
Only show applications that are not archived. Add an archived_at
| </div> | ||
|
|
||
| <div class="field"> |
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.
| </div> | |
| <div class="field"> | |
| </div> | |
| <div class="field"> |
| <hr class="col-span-2"> | ||
|
|
||
| <div class="field mb-0"> |
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.
| <hr class="col-span-2"> | |
| <div class="field mb-0"> | |
| <hr class="col-span-2"> | |
| <div class="field mb-0"> |
## Summary of the problem <!-- Why are these changes being made? What problem does it solve? Link any related issues to provide more details. --> Currently, we send all our signees and cosigners to DocuSeal's website to sign the contract. This takes them outside of HCB's flow and prevents us from adding additional information, such as FAQs, when signing the contract. This is especially an issue for the upcoming new onboarding flow, which will be entirely within HCB (#12188). We're also relying entirely on DocuSeal's webhooks and fetching the contract from DocuSeal to keep track of contracts. This could be unreliable and also couples the code tightly to DocuSeal. ## Describe your changes <!-- Explain your thought process to the solution and provide a quick summary of the changes. --> Creates `Contract::Party`, which belongs to a contract. There will be one party on HCB for each party on DocuSeal. A `show` action on the parties controller will be where both signees and cosigners can sign the HCB contract. Much of the party-specific logic in the Contract model and the DocuSeal webhook has been extracted into this new model. Using DocuSeal's support for embedding a contract form within our website using JavaScript, the contract form is side-by-side with a FAQ card with common questions that signees and parents often have when signing the contract. After signing, they will be directed to a completed page where a message will be displayed with next steps. `OneTimeJobs::BackfillContractParties` has also been added to backfill this new model. This should be run in production immediately after deployment to avoid errors when people try to sign existing contracts. Signing page: <img width="1043" height="862" alt="image" src="https://github.com/user-attachments/assets/9303f6f9-ff75-4390-b2d6-0e8831040efb" /> Completed page: <img width="881" height="311" alt="image" src="https://github.com/user-attachments/assets/033a2395-3790-4646-b2e4-211018f0a9d9" /> --------- Co-authored-by: Gary Tou <gary@garytou.com> Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
| box-shadow: none; | ||
| background-color: rgba(map-get($palette, dark), 0.75); | ||
| background-color: rgba(map-get($palette, dark), 0.50); | ||
| } |
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.
| box-shadow: none; | |
| background-color: rgba(map-get($palette, dark), 0.75); | |
| background-color: rgba(map-get($palette, dark), 0.50); | |
| } | |
| box-shadow: none; | |
| background-color: rgba(map-get($palette, dark), 0.5); | |
| } |
| box-shadow: none; | ||
| background-color: rgba(map-get($palette, smoke), 0.75); | ||
| background-color: rgba(map-get($palette, smoke), 0.50); | ||
| } |
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.
| box-shadow: none; | |
| background-color: rgba(map-get($palette, smoke), 0.75); | |
| background-color: rgba(map-get($palette, smoke), 0.50); | |
| } | |
| box-shadow: none; | |
| background-color: rgba(map-get($palette, smoke), 0.5); | |
| } |
Summary of the problem
Describe your changes