Skip to content

Commit 2094991

Browse files
Merge branch 'main' into lro-improve-edit-user-ui
2 parents 9327ec5 + 082f298 commit 2094991

File tree

14 files changed

+339
-203
lines changed

14 files changed

+339
-203
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Claude Code Review
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize]
6+
# Optional: Only run on specific file changes
7+
# paths:
8+
# - "src/**/*.ts"
9+
# - "src/**/*.tsx"
10+
# - "src/**/*.js"
11+
# - "src/**/*.jsx"
12+
13+
jobs:
14+
claude-review:
15+
# Optional: Filter by PR author
16+
# if: |
17+
# github.event.pull_request.user.login == 'external-contributor' ||
18+
# github.event.pull_request.user.login == 'new-developer' ||
19+
# github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
20+
21+
runs-on: ubuntu-latest
22+
permissions:
23+
contents: read
24+
pull-requests: read
25+
issues: read
26+
id-token: write
27+
28+
steps:
29+
- name: Checkout repository
30+
uses: actions/checkout@v4
31+
with:
32+
fetch-depth: 1
33+
34+
- name: Run Claude Code Review
35+
id: claude-review
36+
uses: anthropics/claude-code-action@v1
37+
with:
38+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
39+
prompt: |
40+
REPO: ${{ github.repository }}
41+
PR NUMBER: ${{ github.event.pull_request.number }}
42+
43+
Please review this pull request and provide feedback on:
44+
- Code quality and best practices
45+
- Potential bugs or issues
46+
- Performance considerations
47+
- Security concerns
48+
- Test coverage
49+
50+
Use the repository's CLAUDE.md for guidance on style and conventions. Be constructive and helpful in your feedback.
51+
52+
Use `gh pr comment` with your Bash tool to leave your review as a comment on the PR.
53+
54+
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
55+
# or https://docs.claude.com/en/docs/claude-code/cli-reference for available options
56+
claude_args: '--allowed-tools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"'
57+

.github/workflows/claude.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Claude Code
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
pull_request_review_comment:
7+
types: [created]
8+
issues:
9+
types: [opened, assigned]
10+
pull_request_review:
11+
types: [submitted]
12+
13+
jobs:
14+
claude:
15+
if: |
16+
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
17+
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
18+
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
19+
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
20+
runs-on: ubuntu-latest
21+
permissions:
22+
contents: read
23+
pull-requests: read
24+
issues: read
25+
id-token: write
26+
actions: read # Required for Claude to read CI results on PRs
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v4
30+
with:
31+
fetch-depth: 1
32+
33+
- name: Run Claude Code
34+
id: claude
35+
uses: anthropics/claude-code-action@v1
36+
with:
37+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
38+
39+
# This is an optional setting that allows Claude to read CI results on PRs
40+
additional_permissions: |
41+
actions: read
42+
43+
# Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
44+
# prompt: 'Update the pull request description to include a summary of changes.'
45+
46+
# Optional: Add claude_args to customize behavior and configuration
47+
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
48+
# or https://docs.claude.com/en/docs/claude-code/cli-reference for available options
49+
# claude_args: '--allowed-tools Bash(gh pr:*)'
50+

app/controllers/admin_controller.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,15 +717,18 @@ def wise_transfers
717717
@per = params[:per] || 20
718718
@q = params[:q].presence
719719
@event_id = params[:event_id].presence
720+
@status = WiseTransfer.aasm.states.collect(&:name).include?(params[:status]&.to_sym) ? params[:status] : nil
720721

721722
@wise_transfers = WiseTransfer.all
722723

723724
@wise_transfers = @wise_transfers.search_recipient(@q) if @q
724725

725-
@wise_transfers.where(event_id: @event_id) if @event_id
726+
@wise_transfers = @wise_transfers.where(event_id: @event_id) if @event_id
727+
@wise_transfers = @wise_transfers.where(aasm_state: @status) if @status
726728

727729
@wise_transfers = @wise_transfers.page(@page).per(@per).order(
728730
Arel.sql("aasm_state = 'pending' DESC"),
731+
Arel.sql("aasm_state = 'approved' DESC"),
729732
"created_at desc"
730733
)
731734
end

app/services/twilio_verification_service.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ def send_verification_request(phone_number)
1616
.services(VERIFY_SERVICE_ID)
1717
.verifications
1818
.create(to: phone_number, channel: "sms")
19+
rescue => e
20+
Rails.error.report(e)
21+
raise
1922
end
2023

2124
def check_verification_token(phone_number, code)
@@ -24,6 +27,9 @@ def check_verification_token(phone_number, code)
2427
.verification_checks
2528
.create(to: phone_number, code:)
2629
verification.status == "approved"
30+
rescue => e
31+
Rails.error.report(e)
32+
raise
2733
end
2834

2935
end

app/views/admin/wise_transfers.html.erb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<%= form_with local: true, url: wise_transfers_admin_index_path, method: :get do |form| %>
44
<%= form.text_field :q, value: params[:q], placeholder: "Search" %>
55
<%= form.collection_select(:event_id, Event.reorder(Event::CUSTOM_SORT), :id, :admin_dropdown_description, { include_blank: "Select An Event", selected: @event_id }, { width: 250, style: "max-width: 250px" }) %>
6+
<%= form.collection_select(:status, WiseTransfer.aasm.states, :name, :human_name, { include_blank: "Filter by status", selected: @status }, { width: 250, style: "max-width: 250px" }) %>
67
<%= form.submit "Search" %>
78
<% end %>
89

@@ -27,7 +28,7 @@
2728
</thead>
2829
<tbody>
2930
<% @wise_transfers.each do |wise_transfer| %>
30-
<tr class="<%= "admin-bg-pending" if wise_transfer.pending? %>">
31+
<tr class="<%= "admin-bg-pending" if wise_transfer.pending? %> <%= "admin-bg-transit" if wise_transfer.approved? %>">
3132
<td><%= wise_transfer.id %></td>
3233
<td><%= wise_transfer.created_at.strftime("%Y-%m-%d") %></td>
3334
<td><%= wise_transfer.event.name %></td>
Lines changed: 35 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,46 @@
11
<%# locals: (form:, field_name:, disabled:, events:, default_event:, lazy_load_balances: false, sending: false, receiving: false, allow_custom_events: false) %>
22

33
<div class="field" data-controller="organization-select">
4-
<%= form.label field_name, sending ? "From" : "To" %>
5-
<select name="disbursement[<%= field_name %>]" id="disbursement_<%= field_name %>" <%= "disabled" if disabled %> class="bg-[transparent] dark:bg-darkless input input--select flex items-center select-none cursor-pointer disabled:cursor-default" data-organization-select-target="dropdown">
6-
<option value>Select one...</option>
7-
<option <%= "default" if default_event.present? %> value="<%= default_event.public_id if default_event.present? %>"><%= default_event.name if default_event.present? %></option>
8-
</select>
4+
<%= form.label field_name, sending ? "From" : "To" %>
5+
<select name="disbursement[<%= field_name %>]" id="disbursement_<%= field_name %>" <%= "disabled" if disabled %> class="bg-[transparent] dark:bg-darkless input input--select flex items-center select-none cursor-pointer disabled:cursor-default" data-organization-select-target="dropdown">
6+
<option value>Select one...</option>
7+
<option <%= "default" if default_event.present? %> value="<%= default_event.public_id if default_event.present? %>"><%= default_event.name if default_event.present? %></option>
8+
</select>
99

10-
<div data-organization-select-target="wrapper" style="max-width: 384px;">
11-
<input data-organization-select-target="search" style="display: none; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px;" type="text" placeholder="Search">
10+
<div data-organization-select-target="wrapper" style="max-width: 384px;">
11+
<input data-organization-select-target="search" style="display: none; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px;" type="text" placeholder="Search">
1212

13-
<div data-organization-select-target="menu" style="display: none; border-width: 1px; border-style: solid; border-top: none; max-width: 384px; border-top-left-radius: 0px; border-top-right-radius: 0px;" class="border-smoke rounded-md dark:border-black overflow-hidden h-40">
14-
<div class="w-full h-full rounded-md overflow-y-scroll" style="border-top-left-radius: 0px; border-top-right-radius: 0px; content-visibility: auto;">
15-
<div>
16-
<% events.each_with_index.map do |event, i| %>
17-
<% disabled_message = nil %>
18-
<% disabled_message = "Insufficient balance" if sending && !admin_signed_in? && event.balance_available <= 0 %>
19-
<% disabled_message = "HCB transfers disabled" if sending && !policy(event).create_transfer? %>
20-
<div data-id="<%= event.public_id %>" data-slug="<%= event.slug %>" data-name="<%= event.name %>" data-organization-select-target="organization" style="<%= i > 50 ? "display: none" : "" %>" data-index="<%= i %>">
21-
<button <%= "disabled" if disabled_message %> aria-label="<%= disabled_message %>" class="<%= "tooltipped tooltipped--i" if disabled_message %> text-[length:inherit] border-none bg-[transparent] w-full flex justify-between p-2 cursor-pointer disabled:cursor-default hover:bg-smoke hover:dark:bg-darkless transition-colors duration-150" type="button">
22-
<div class="text-left <%= "tooltipped tooltipped--e" if admin_signed_in? %>" aria-label="<%= "ID: #{event.id}" if admin_signed_in? %>"><%= event.name %></div>
13+
<div data-organization-select-target="menu" style="display: none; border-width: 1px; border-style: solid; border-top: none; max-width: 384px; border-top-left-radius: 0px; border-top-right-radius: 0px;" class="border-smoke rounded-md dark:border-black overflow-hidden h-40">
14+
<div class="w-full h-full rounded-md overflow-y-scroll" style="border-top-left-radius: 0px; border-top-right-radius: 0px; content-visibility: auto;">
15+
<div>
16+
<% events.each_with_index.map do |event, i| %>
17+
<% disabled_message = nil %>
18+
<% disabled_message = "Insufficient balance" if sending && !admin_signed_in? && event.balance_available <= 0 %>
19+
<% disabled_message = "HCB transfers disabled" if sending && !policy(event).create_transfer? %>
20+
<div data-id="<%= event.public_id %>" data-slug="<%= event.slug %>" data-name="<%= event.name %>" data-organization-select-target="organization" style="<%= i > 50 ? "display: none" : "" %>" data-index="<%= i %>">
21+
<button <%= "disabled" if disabled_message %> aria-label="<%= disabled_message %>" class="<%= "tooltipped tooltipped--i" if disabled_message %> text-[length:inherit] border-none bg-[transparent] w-full flex justify-between p-2 cursor-pointer disabled:cursor-default hover:bg-smoke hover:dark:bg-darkless transition-colors duration-150" type="button">
22+
<div class="text-left <%= "tooltipped tooltipped--e" if admin_signed_in? %>" aria-label="<%= "ID: #{event.id}" if admin_signed_in? %>"><%= event.name %></div>
2323

24-
<div class="text-muted pl-2">
25-
<%= turbo_frame_tag "event_balance_#{event.public_id}", src: event_async_balance_path(event, symbol: true), data: { turbo_permanent: true, controller: "cached-frame", action: "turbo:frame-render->cached-frame#cache" }, loading: :lazy do %>
26-
<strong>-</strong>
27-
<% end %>
28-
</div>
29-
</button>
30-
<hr class="my-0">
31-
</div>
32-
<% end %>
33-
<% if receiving && allow_custom_events %>
34-
<div data-id="other" data-organization-select-target="other">
35-
<button class="text-[length:inherit] border-none bg-[transparent] w-full flex justify-between p-2 cursor-pointer disabled:cursor-default hover:bg-smoke hover:dark:bg-darkless transition-colors duration-150">
36-
<div class="text-left other-name"></div>
37-
<div></div>
38-
</button>
39-
<hr class="my-0">
40-
</div>
41-
<% end %>
24+
<div class="text-muted pl-2">
25+
<%= turbo_frame_tag "event_balance_#{event.public_id}", src: event_async_balance_path(event, symbol: true), data: { turbo_permanent: true, controller: "cached-frame", action: "turbo:frame-render->cached-frame#cache" }, loading: :lazy do %>
26+
<strong>-</strong>
27+
<% end %>
4228
</div>
29+
</button>
30+
<hr class="my-0">
4331
</div>
32+
<% end %>
33+
<% if receiving && allow_custom_events %>
34+
<div data-id="other" data-organization-select-target="other">
35+
<button class="text-[length:inherit] border-none bg-[transparent] w-full flex justify-between p-2 cursor-pointer disabled:cursor-default hover:bg-smoke hover:dark:bg-darkless transition-colors duration-150">
36+
<div class="text-left other-name"></div>
37+
<div></div>
38+
</button>
39+
<hr class="my-0">
40+
</div>
41+
<% end %>
4442
</div>
43+
</div>
4544
</div>
46-
45+
</div>
4746
</div>

app/views/events/perks/_premium_pins.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
<p>
3030
Ever wish you were just a little more dripped out in HCB swag?
31-
We'll ship you some super cool custom HCB pins and keychains for free if you have 5 or more active teenagers!
31+
We'll ship you some super cool custom HCB pins and keychains for free if you have 5 or more active teenagers! At the moment, only US-based teams are eligible for this.
3232
</p>
3333
<section class="card__banner card__darker secondary border-top italic">
3434
You currently have <%= active_teenagers_count %>/5 active teenagers in your organization!

app/views/organizer_position/spending/controls/allowances/_form.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@
2626
<p x-show="amount && amount >= 0 && operation"><%= @active_control.organizer_position.user.name %>'s spending balance will be <span x-html="formatter.format(balance + (operation == 'add' ? Number(amount) : -Number(amount)))"></span></p>
2727

2828
<div class="actions">
29-
<%= form.submit %>
29+
<%= form.submit "Create allowance" %>
3030
</div>
3131
<% end %>

app/views/organizer_position/spending/controls/index.html.erb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
<% title "Spending allowances for #{@organizer_position.user.name}" %>
1+
<% title "Allowances for #{@organizer_position.user.name}" %>
22
<% page_md %>
33
<%= render "events/nav" %>
44

55
<h1 class="heading justify-between">
66
<span class="inline-flex items-center justify-center">
7-
<%= @organizer_position.user.name %>'s Spending
7+
<%= @organizer_position.user.possessive_name %> allowances
88
<% if @active_control %>
99
<% admin_tool("w-fit h5 ml1 muted", "span") do %>
1010
Control ID: <%= @active_control&.id %>
@@ -30,7 +30,7 @@
3030

3131
<% if @active_control %>
3232
<div class="modal modal--scroll bg-snow" data-behavior="modal" role="dialog" id="new">
33-
<%= modal_header "New spending allowance" %>
33+
<%= modal_header "New allowance" %>
3434
<%= render "organizer_position/spending/controls/allowances/form" %>
3535
</div>
3636
<% end %>
@@ -68,7 +68,7 @@
6868
<% end %>
6969
<% else %>
7070
<% control_enable_button = form_with url: event_organizer_position_spending_controls_path(@event, @organizer_position), method: :post, local: true do |form| %>
71-
<%= form.submit "Enable controls for #{@organizer_position.user.first_name}", class: "btn btn-small bg-info tooltipped tooltipped--e #{"disabled" unless policy(@provisional_control).new?}" %>
71+
<%= form.submit "Enable spending controls for #{@organizer_position.user.first_name}", class: "btn btn-small bg-info tooltipped tooltipped--e #{"disabled" unless policy(@provisional_control).new?}" %>
7272
<% end %>
7373

7474
<% if policy(@provisional_control).new? %>
@@ -119,7 +119,7 @@
119119
<div class="mixed-grid grid--spacious mt-20">
120120
<%= link_to "#", data: { behavior: "modal_trigger", modal: "past-controls" }, class: "card flex justify-between #{"opacity-50 pointer-events-none" if @inactive_control_count.zero?}" do %>
121121
<div class="flex flex-col">
122-
<p class="bold black">Past controls</p>
122+
<p class="bold black">Past spending controls</p>
123123
<p class="muted">
124124
<% if @inactive_control_count.zero? %>
125125
There are no previous spending controls

app/views/users/_user_session.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<%= inline_icon "door-leave", size: home_action_size %>
1818
<% end %>
1919
<% elsif !session.expired? %>
20-
<%= link_to logout_session_users_path(user: @user, id: session.id), data: { turbo_method: :delete, turbo_frame: "_top" }, class: "muted tooltipped tooltipped--w z5", 'aria-label': "Sign out of this session" do %>
20+
<%= link_to logout_session_users_path(user: @user, id: session.id), data: { turbo_method: :delete, turbo_frame: "_top" }, class: "muted tooltipped tooltipped--w z5", 'aria-label': "Sign out of this session", disabled: !policy(@user).logout_session? do %>
2121
<%= inline_icon "door-leave", size: home_action_size %>
2222
<% end %>
2323
<% end %>

0 commit comments

Comments
 (0)