-
Notifications
You must be signed in to change notification settings - Fork 71
[Team] Invite flow redesign #11970
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
Draft
manuthecoder
wants to merge
14
commits into
main
Choose a base branch
from
mxg-invite-links
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+112
−111
Draft
[Team] Invite flow redesign #11970
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
437d4a8
Refactor invite links section in team overview to streamline UI and i…
manuthecoder 3ea5e98
Improve invite link list appearance
manuthecoder 4389882
fix invite links list style
manuthecoder 6611e9f
Rearrange items
manuthecoder b4e2ec8
add comments
manuthecoder cf959ed
remove ui3 comments
manuthecoder 57669ce
Merge branch 'main' into mxg-invite-links
manuthecoder 852bbc3
Merge branch 'main' into mxg-invite-links
manuthecoder 1a3ba24
[Team] Adjust heading margin and update link list display for better …
manuthecoder ca28a43
Merge branch 'main' into mxg-invite-links
manuthecoder b126003
Add dropdown
manuthecoder 39c775f
`bin/lint`
manuthecoder d3a6b6a
Improve layout
manuthecoder fc198b1
fix email form
manuthecoder File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,20 @@ | ||
| <%# locals: (event:) %> | ||
|
|
||
| <%= form_with(url: event_invite_links_path(event_id: event.id)) do |form| %> | ||
| <div class="field"> | ||
| <%= form.label :expires_at, "Expires on" %> | ||
| <%= form.date_field :expires_on, value: OrganizerPositionInvite::Link::DEFAULT_EXPIRATION.from_now.strftime("%Y-%m-%d") %> | ||
| <div data-controller="menu" data-menu-placement-value="bottom-end"> | ||
| <button | ||
| type="button" | ||
| class="btn btn-small menu__toggle menu__toggle--arrowless overflow-visible" | ||
| data-menu-target="toggle" data-action="menu#toggle click@document->menu#close keydown@document->menu#keydown"> | ||
| <%= inline_icon "add", size: 28 %> | ||
| Create | ||
| </button> | ||
| <div class="menu__content menu__content--2 menu__content--compact h5 p-3" data-menu-target="content"> | ||
| <%= form_with(url: event_invite_links_path(event_id: event.id)) do |form| %> | ||
| <div class="field"> | ||
| <%= form.label :expires_at, "Expires on" %> | ||
| <%= form.date_field :expires_on, class: "!max-w-full w-full", value: OrganizerPositionInvite::Link::DEFAULT_EXPIRATION.from_now.strftime("%Y-%m-%d") %> | ||
| </div> | ||
| <%= form.submit "Continue", class: "btn -mt-1 w-full" %> | ||
| <% end %> | ||
| </div> | ||
|
|
||
| <%= form.submit "Create", class: "btn" %> | ||
| <% end %> | ||
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,20 @@ | ||
| <%= form_with(model: invite, local: true, url: event_organizer_position_invites_path(event_id: @event.slug), html: { "x-data": "{ role: 'member', spendingControls: 'true' }" }) do |form| %> | ||
| <%= form_errors invite, "user" %> | ||
|
|
||
| <div class="field" x-data="{ email: '' }"> | ||
| <%= form.label :email, class: "mb1" %> | ||
|
|
||
| <div class="flex items-center"> | ||
| <%= form.email_field :email, class: "mr1", "x-model": "email", placeholder: "[email protected]" %> | ||
| </div> | ||
| <template x-if="/(team|webmaster|marketing|admin|info|about|support|sales|hello)/.test(email)"> | ||
| <div class="warning mt1">⚠️ For security, we discourage team emails on | ||
| HCB. We recommend individual emails such as <em>[email protected]</em>! | ||
| <div class="border rounded-xl overflow-hidden"> | ||
| <div class="field" x-data="{ email: '' }"> | ||
| <div class="flex items-center"> | ||
| <%= form.email_field :email, class: "!max-w-full w-full !border-0 !px-4 !max-h-10", "x-model": "email", placeholder: "Email address" %> | ||
| </div> | ||
| </template> | ||
| </div> | ||
| <template x-if="/(team|webmaster|marketing|admin|info|about|support|sales|hello)/.test(email)"> | ||
| <div class="warning mt1">⚠️ For security, we discourage team emails on | ||
| HCB. We recommend individual emails such as <em>[email protected]</em>! | ||
| </div> | ||
| </template> | ||
| </div> | ||
|
|
||
| <%= render "organizer_position_invites/role_and_control_form", form: form %> | ||
| <%= render "organizer_position_invites/role_and_control_form", form: form %> | ||
| </div> | ||
|
|
||
| <% admin_tool("mt2 mb2 flex g1") do %> | ||
| <%= render "organizer_position_invites/admin_signee_check", form: form, default_selected: false %> | ||
|
|
||
83 changes: 42 additions & 41 deletions
83
app/views/organizer_position_invites/_role_and_control_form.html.erb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,50 +1,51 @@ | ||||||||||||||
| <%# locals: (form:) %> | ||||||||||||||
|
|
||||||||||||||
| <%= form.label :role, class: "mb1" %> | ||||||||||||||
| <div class="field field--options flex"> | ||||||||||||||
| <% OrganizerPositionInvite.roles.keys.map do |role| %> | ||||||||||||||
| <%= form.radio_button :role, role, "x-model": "role" %> | ||||||||||||||
| <%= form.label :role, value: role do %> | ||||||||||||||
| <strong><%= role.titleize %></strong> | ||||||||||||||
| <% end %> | ||||||||||||||
| <% end %> | ||||||||||||||
| </div> | ||||||||||||||
|
|
||||||||||||||
| <p class="muted mb1"><span class="bold info">Managers</span> can do everything | ||||||||||||||
| in the organization.</p> | ||||||||||||||
|
|
||||||||||||||
| <div class="muted mb1"> | ||||||||||||||
| <p class="m0"><span class="bold info">Members</span> can:</p> | ||||||||||||||
| <ul class="m0"> | ||||||||||||||
| <li>Create & use cards (with a limit if spending controls are enabled) | ||||||||||||||
| </li> | ||||||||||||||
| <li>Not transfer money</li> | ||||||||||||||
| <li>Not change the organization's settings</li> | ||||||||||||||
| </ul> | ||||||||||||||
| <div class="field px-4 gap-2 flex items-center"> | ||||||||||||||
| <%= form.label :role, "Role" %> | ||||||||||||||
| <%= form.select :role, | ||||||||||||||
| OrganizerPositionInvite.roles.keys.map { |role| [role.titleize, role] }, | ||||||||||||||
| {}, | ||||||||||||||
| "x-model": "role" %> | ||||||||||||||
| <div data-controller="menu" data-menu-placement-value="bottom-start"> | ||||||||||||||
| <button | ||||||||||||||
| type="button" | ||||||||||||||
| class="pop menu__toggle menu__toggle--arrowless overflow-visible" | ||||||||||||||
| data-menu-target="toggle" data-action="menu#toggle click@document->menu#close keydown@document->menu#keydown"> | ||||||||||||||
| <%= inline_icon "question-mark", size: 14 %> | ||||||||||||||
| </button> | ||||||||||||||
| <div class="menu__content menu__content--2 menu__content--compact h5 p-0" data-menu-target="content"> | ||||||||||||||
| <p class="muted mb1"><span class="bold info">Managers</span> can do everything | ||||||||||||||
| in the organization.</p> | ||||||||||||||
| <div class="muted mb1"> | ||||||||||||||
| <p class="m0"><span class="bold info">Members</span> can:</p> | ||||||||||||||
| <ul class="m0"> | ||||||||||||||
| <li>Create & use cards (with a limit if spending controls are enabled) | ||||||||||||||
| </li> | ||||||||||||||
| <li>Not transfer money</li> | ||||||||||||||
| <li>Not change the organization's settings</li> | ||||||||||||||
| </ul> | ||||||||||||||
| </div> | ||||||||||||||
| <p class="muted mb1"><span class="bold info">Readers</span> have read-only access to the organization.</p> | ||||||||||||||
| </div> | ||||||||||||||
| </div> | ||||||||||||||
| </div> | ||||||||||||||
|
|
||||||||||||||
| <p class="muted mb1"><span class="bold info">Readers</span> have read-only access to the organization.</p> | ||||||||||||||
|
|
||||||||||||||
| <div x-show="role === 'member'" x-cloak x-transition.duration.500ms class="my-4"> | ||||||||||||||
| <%= form.label :enable_controls, class: "mb1 inline-flex flex-col" do %> | ||||||||||||||
| Enable spending controls? | ||||||||||||||
| <span class="muted h6">You can always enable & configure spending controls after, too.</span> | ||||||||||||||
| <% end %> | ||||||||||||||
|
|
||||||||||||||
| <div class="field field--options"> | ||||||||||||||
| <%= form.radio_button :enable_controls, false, "x-model": "spendingControls" %> | ||||||||||||||
| <%= form.label :enable_controls, value: false do %> | ||||||||||||||
| <strong>No</strong> | ||||||||||||||
| <% end %> | ||||||||||||||
|
|
||||||||||||||
| <%= form.radio_button :enable_controls, true, "x-model": "spendingControls" %> | ||||||||||||||
| <%= form.label :enable_controls, value: true do %> | ||||||||||||||
| <strong>Yes</strong> | ||||||||||||||
| <% end %> | ||||||||||||||
| <div data-controller="accordion" class="border-t px-4 pb-2"> | ||||||||||||||
| <div class="flex items-center gap-4 field field--checkbox"> | ||||||||||||||
| <label class="flex flex-col"> | ||||||||||||||
| <span>Spending controls</span> | ||||||||||||||
| <span class="muted h6">Changes can be made later</span> | ||||||||||||||
| </label> | ||||||||||||||
| <div class="field--checkbox--switch ml-auto" style="flex-shrink:0"> | ||||||||||||||
| <%= form.label :enable_controls do %> | ||||||||||||||
| <%= form.check_box :enable_controls, { data: { action: "change->accordion#toggle", accordion_target: "checkbox" } }, true, false %> | ||||||||||||||
| <span class="slider"></span> | ||||||||||||||
|
Comment on lines
+40
to
+42
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
| <% end %> | ||||||||||||||
| </div> | ||||||||||||||
| </div> | ||||||||||||||
|
|
||||||||||||||
| <div x-show="spendingControls === 'true'" x-cloak x-transition.duration.500ms class="mb1"> | ||||||||||||||
| <div data-accordion-target="content" class="flex items-center gap-4 justify-between"> | ||||||||||||||
| <%= form.label :initial_control_allowance_amount, value: "Initial allowance amount" %> | ||||||||||||||
| <%= form.number_field :initial_control_allowance_amount, placeholder: "500.00", step: 0.01, min: 0.00, data: { controller: "truncate-decimal", action: "truncate-decimal#truncate blur->truncate-decimal#pad" } %> | ||||||||||||||
| <%= form.number_field :initial_control_allowance_amount, placeholder: "500.00", step: 0.01, min: 0.00, style: "max-width:100px!important;text-align:right", data: { controller: "truncate-decimal", action: "truncate-decimal#truncate blur->truncate-decimal#pad" } %> | ||||||||||||||
| </div> | ||||||||||||||
| </div> | ||||||||||||||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.