Skip to content

Commit

Permalink
More Ranger application interface changes. (#2133)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeburg authored Nov 13, 2024
1 parent 592e49e commit 64cd13b
Show file tree
Hide file tree
Showing 9 changed files with 398 additions and 310 deletions.
2 changes: 1 addition & 1 deletion app/components/ui-grid-table-column.hbs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div>
<div ...attributes>
{{yield}}
</div>
131 changes: 69 additions & 62 deletions app/components/vc/application-details.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -18,66 +18,69 @@
Unreviewed paragraph
</UiSectionSubtitle>
{{/if}}
<div class="row">
<div class="col-auto">
<b>Experience</b><br>
{{@application.experienceLabel}}
{{#if @application.isBRCExperienceOkay}}
<div class="text-success">BRC exp. appears to be okay</div>
{{#if @application.isBRC1R1}}
Regional exp. may need verification.
{{/if}}
{{/if}}
{{#if @application.experienceIssue}}
<div class="text-danger">{{@application.experienceIssue}}</div>
{{/if}}
</div>
<div class="col-auto">
<b>BRC Events</b><br>
<UiGridTable as |t|>
<t.label>
BRC Events
</t.label>
<t.column>
{{#if @application.eventsList}}
{{pluralize @application.eventsList.length
(if @application.hasPandemicEvents "total event" "event")}}
[{{year-range @application.eventsList}}]
{{#if @application.isBRCExperienceOkay}}
<UiBadge @type="success">{{fa-icon "check" right=1}} Experience is okay</UiBadge>
{{else}}
<UiBadge @type="danger">{{fa-icon "hand" right=1}} Experience issue</UiBadge>
{{/if}}
<div>
{{pluralize @application.eventsList.length
(if @application.hasPandemicEvents "total event" "event")}}
[{{year-range @application.eventsList}}]
</div>
{{#if @application.hasPandemicEvents}}
<div class="text-danger">
Pandemic year(s) present.<br>
{{fa-icon "hand" right=1}} Pandemic year(s) selected.
</div>
{{/if}}
{{else}}
<span class="text-danger">No events listed.</span>
<UiBadge @type="danger">{{fa-icon "hand" right=1}} No events selected</UiBadge>
{{/if}}
</div>
<div class="col-auto">
<b>Is 18 Or Older?</b><br>
</t.column>
<t.label>Age</t.label>
<t.column>
{{#if @application.is_over_18}}
<span class="text-success">{{fa-icon "check" right=1}} Yes</span>
<UiBadge @type="success">{{fa-icon "check" right=1}} Is 18 or older</UiBadge>
{{else}}
<span class="text-danger">{{fa-icon "times" right=1}} NO - Individual is under 18.</span>
<UiBadge @type="danger">{{fa-icon "times" right=1}} Under 18</UiBadge>
{{/if}}
</div>
</div>
<div class="row mt-2">
<div class="col-4">
<b>Known Rangers</b><br>
</t.column>

<t.label>
Known Rangers
</t.label>
<t.column>
<PresentOrNot @value={{@application.known_rangers}} @empty="none stated"/>
</div>
<div class="col-4">
<b>Known Applicants</b><br>
</t.column>
<t.label>
Known Applicants
</t.label>
<t.column>
<PresentOrNot @value={{@application.known_applicants}} @empty="none stated"/>
</div>
</div>

<div class="grid-table mt-1">
<div class="grid-table-label">
</t.column>
<t.label>
Why Ranger?
</div>
<div>
</t.label>
<t.column>
{{#if (eq @application.why_volunteer_review 'okay')}}
<span class="text-success">{{fa-icon "check" right=1}} Paragraph is okay</span>
<UiBadge @type="success">
{{fa-icon "check" right=1}} paragraph okay
</UiBadge>
<span class="text-success"></span>
{{else if (eq @application.why_volunteer_review 'problem')}}
<span class="text-danger">{{fa-icon "ban" right=1}} Problem paragraph</span>
<UiBadge @type="danger">
{{fa-icon "ban" right=1}} problem paragraph
</UiBadge>
{{else}}
<span>{{fa-icon "question" right=1}} Unreviewed paragraph</span>
<UiBadge @type="warning">
{{fa-icon "question" right=1}} unreviewed paragraph
</UiBadge>
{{/if}}
{{#if @application.reviewed_at}}
<span class="ms-2 text-muted">
Expand All @@ -102,33 +105,38 @@
Mark As Problem
</UiButton>
{{/if}}
</div>
<div class="grid-table-label">Regional Experience</div>
<div>
</t.column>
<t.label>Regional Experience</t.label>
<t.column>
{{#if @application.regional_experience}}
{{nl2br @application.regional_experience}}
{{else}}
<i>none stated</i>
{{/if}}
</div>
<div class="grid-table-label">Comments</div>
<div>
</t.column>
<t.label>Comments</t.label>
<t.column>
<Vc::ApplicationNotes @application={{@application}} @isComment={{true}} />
</div>
</t.column>

<div class="grid-table-label">Unified Flagging Notes</div>
<div>
<t.label>Unified Flagging Notes</t.label>
<t.column>
<Vc::ApplicationNotes @application={{@application}} @isComment={{false}} />
</div>
<div class="grid-table-label">Actions</div>
<div class="ui-button-row">
</t.column>
<t.label>Actions</t.label>
<t.column class="ui-button-row">
<UiButton @type="secondary" @size="sm" @onClick={{this.approveForCallsignProcessing}}>
Approve for Callsign Processing
</UiButton>
<UiDropdownButton @label="Reject Application" as |dd|>
<dd.item @onSelect={{this.rejectQualification}}>
Lacking Event Experience
</dd.item>
{{!--
<dd.item @onSelect={{this.rejectRegional}}>
Failed Regional Verification
</dd.item>
--}}
<dd.item @onSelect={{this.rejectTooYoung}}>
Too Young (&lt; 18 years old)
</dd.item>
Expand All @@ -142,20 +150,19 @@
Returning Ranger
</dd.item>
</UiDropdownButton>
{{!--
<UiButton @type="secondary" @size="sm" @onClick={{this.requestRRNCheck}}>Request RRN Check</UiButton>
--}}
<UiDropdownButton @label="Hold Application" as |dd|>
<dd.item @onSelect={{this.whyRangerIssue}}>
Why Ranger Answer Issue
</dd.item>
<dd.item @onSelect={{this.qualificationIssue}}>
Ask for Qualification Confirmation
Ask for Experience Confirmation
</dd.item>
</UiDropdownButton>
<UiButton @type="secondary" @size="sm" @onClick={{this.approveForCallsignProcessing}}>
Approve for Callsign Processing
</UiButton>
</div>
</div>
</t.column>
</UiGridTable>
</:view>
<:edit as |f|>
<FormRow>
Expand Down
153 changes: 110 additions & 43 deletions app/components/vc/application-handles.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<UiSection>
<UiSection id="handles">
<:title>
<span class="me-4">Handle Information</span>
</:title>
Expand All @@ -19,7 +19,7 @@
<UiSectionSubtitle @type="success" @icon="check">
Callsign approved - awaiting account creation.
</UiSectionSubtitle>
{{else if @application.isStatusApprovedPiiIssue}}
{{else if @application.hasPersonalInfoIssue}}
<UiSectionSubtitle @type="warning" @icon="hand">
Handle has been approved, however, the Personal Info has issues. Application is on hold until the applicant
responds.
Expand All @@ -38,12 +38,15 @@
<i>none assigned yet</i>
{{/if}}
<div class="mt-2">
<UiButton @type="secondary" @size="sm" @onClick={{this.openEditAndApproveCallsign}}>
Edit &amp; Approve Callsign
</UiButton>
<UiButton @type="secondary" @size="sm" class="ms-2" @onClick={{this.openEditApprovedHandleDialog}}>
Edit Callsign
</UiButton>
{{#if @application.approved_handle}}
<UiButton @type="secondary" @size="sm" class="ms-2" @onClick={{this.openEditApprovedHandleDialog}}>
Edit Callsign
</UiButton>
{{else}}
<UiButton @type="secondary" @size="sm" @onClick={{this.openEditAndApproveCallsign}}>
Assign Callsign
</UiButton>
{{/if}}
</div>
</t.column>

Expand All @@ -68,48 +71,66 @@
<td class="p-1">
{{handle.handle}}
</td>
<td class="p-1">
<a href {{on-click this.assignCallsign handle.handle}}>
assign callsign
</a>
</td>
<td class="p-1">
<LinkTo @route="vc.handle-checker" @query={{hash handle=handle.handle}} target="_blank" class="ms-1">
check handle
</LinkTo>
</td>
<td class="p-1">
{{#if handle.existing_person}}
Conflict with existing account:
<PersonLink @person={{handle.existing_person}} @showStatus={{true}} />
<br>
{{/if}}
{{#if handle.reserved_handles}}
Conflict with reserved:

{{#each handle.reserved_handles as |reserved idx|}}
{{if idx ", "}}
{{reserved.handle}}
<UiBadge @type="secondary"
@text={{this.reservedHandleType reserved.reservation_type}}
class="ms-1"/>
{{/each}}
{{/if}}
</td>
{{#if (or handle.reserved_handles handle.existing_person)}}
<td colspan="2" class="p-1">
{{#if handle.existing_person}}
{{#if handle.is_applicant1}}
<UiBadge @type="warning">
already assigned to this applicant
</UiBadge>
{{else}}
<UiBadge @type="warning">
taken by existing account
</UiBadge>
{{/if}}
<PersonLink @person={{handle.existing_person}} @showStatus={{true}} />
{{else if handle.reserved_handles}}
Conflicts with reserved handles / terms:
{{#each handle.reserved_handles as |reserved idx|}}
{{if idx ", "}}
{{reserved.handle}}
<UiBadge @type="secondary"
@text={{this.reservedHandleType reserved.reservation_type}}
class="ms-1"/>
{{/each}}
{{/if}}
</td>
{{else}}
<td class="p-1">
<a href {{on-click this.assignCallsign handle.handle}}>
assign callsign
</a>
</td>
<td class="p-1">
<LinkTo @route="vc.handle-checker"
@query={{hash handle=handle.handle}}
target="_blank"
class="ms-1">
check handle
</LinkTo>
</td>
{{/if}}
</tr>
{{/each}}
</tbody>
</table>
{{else}}
<b class="text-danger">{{fa-icon "alert"}} none submitted</b>
<b class="text-danger">{{fa-icon "alert" right=1}} none submitted</b>
{{/if}}
<div class="mt-2">
<UiButton @type="secondary" @size="sm" @onClick={{this.openMoreHandlesDialog}}>
Reject Handle Submissions
</UiButton>
<UiButton @type="secondary" @size="sm" class="ms-2" @onClick={{this.openEditHandlesListDialog}}>
Edit Handles
</UiButton>
<UiButtonRow>
<UiButton @type="secondary" @size="sm" @onClick={{this.openMoreHandlesDialog}}>
Reject Handle Submissions
</UiButton>
<UiButton @type="secondary" @size="sm" @onClick={{this.openEditHandlesListDialog}}>
Edit Handles List
</UiButton>
{{#if @application.handles}}
<UiButton @type="secondary" @size="sm" @onClick={{this.extractHandles}}>
Extract Handles
</UiButton>
{{/if}}
</UiButtonRow>
</div>
</t.column>
<t.label>Rejected Handles</t.label>
Expand Down Expand Up @@ -283,3 +304,49 @@
</ModalDialog>
{{/if}}

{{#if this.extractedHandlesForm}}
<ModalDialog @onEscape={{this.cancelExtractedHandles}} as |Modal|>
<ChForm @formId="handles"
@formFor={{this.extractedHandlesForm}}
@validator={{this.handlesValidation}}
@onSubmit={{this.saveExtractedHandles}} as |f|>
<Modal.title>Edit Handles List</Modal.title>
<Modal.body>
{{#if @application.isStatusCreated}}
<UiAlert @type="danger">
{{fa-icon "hand-point-right" right=1}} Account has been created. No more handles should be recorded.
</UiAlert>
{{/if}}
<div class="row flex-row">
<f.textarea @name="handles"
@label="Extracted Handles:"
@rows={{10}}
@cols={{30}}
@autofocus={{true}}
@wrapClass="col-6"
/>
<div class="col-auto align-self-center">
{{fa-icon "arrow-left" size="2x"}}
</div>
<div class="col-5 align-self-stretch overflow-auto">
Original Handles:
<div class="border p-2 mt-1 h-100">
{{nl2br @application.handles}}
</div>
</div>
</div>
</Modal.body>
<Modal.footer @align="start">
<f.submit @label="Save"/>
<UiCancelButton @onClick={{this.cancelExtractedHandles}} />
</Modal.footer>
</ChForm>
</ModalDialog>
{{/if}}

{{#if this.isSubmitting}}
<LoadingDialog>
Submitting the request
</LoadingDialog>
{{/if}}

Loading

0 comments on commit 64cd13b

Please sign in to comment.