Skip to content

Commit

Permalink
Merge pull request #7343 from stopfstedt/collapser-buttons
Browse files Browse the repository at this point in the history
replaces all elements that have the button role with actual buttons. #3489
  • Loading branch information
dartajax authored Aug 10, 2023
2 parents b720cb1 + 42c9f7e commit b60e145
Show file tree
Hide file tree
Showing 36 changed files with 349 additions and 233 deletions.
11 changes: 9 additions & 2 deletions app/components/curriculum-inventory/leadership-expanded.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,16 @@
<LoadingSpinner />
{{else}}
<div class="curriculum-inventory-leadership-expanded-header" data-test-header>
<div class="title collapsible clickable" role="button" {{on "click" @collapse}} data-test-collapse>
<button
class="title link-button"
type="button"
aria-expanded="true"
data-test-title
{{on "click" @collapse}}
>
{{t "general.curriculumInventoryReportLeadership"}}
</div>
<FaIcon @icon="caret-down" />
</button>
<div class="actions">
{{#if @isManaging}}
<button type="button" class="bigadd" {{on "click" (perform this.save)}} data-test-save>
Expand Down
114 changes: 52 additions & 62 deletions app/components/curriculum-inventory/sequence-block-overview.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -169,20 +169,18 @@
<div class="block start-date" data-test-start-date>
<label>{{t "general.start"}}:</label>
{{#if @canUpdate}}
<span class="editinplace">
<span
class="editable"
role="button"
{{on "click" (set this.isEditingDatesAndDuration true)}}
data-test-edit
>
{{#if @sequenceBlock.startDate}}
{{format-date @sequenceBlock.startDate}}
{{else}}
{{t "general.clickToEdit"}}
{{/if}}
</span>
</span>
<button
class="link-button"
type="button"
data-test-edit
{{on "click" (set this.isEditingDatesAndDuration true)}}
>
{{#if @sequenceBlock.startDate}}
{{format-date @sequenceBlock.startDate}}
{{else}}
{{t "general.clickToEdit"}}
{{/if}}
</button>
{{else}}
<span>
{{#if @sequenceBlock.startDate}}
Expand All @@ -196,20 +194,18 @@
<div class="block end-date" data-test-end-date>
<label>{{t "general.end"}}:</label>
{{#if @canUpdate}}
<span class="editinplace">
<span
class="editable"
role="button"
{{on "click" (set this.isEditingDatesAndDuration true)}}
data-test-edit
>
{{#if @sequenceBlock.endDate}}
{{format-date @sequenceBlock.endDate}}
{{else}}
{{t "general.clickToEdit"}}
{{/if}}
</span>
</span>
<button
class="link-button"
type="button"
data-test-edit
{{on "click" (set this.isEditingDatesAndDuration true)}}
>
{{#if @sequenceBlock.endDate}}
{{format-date @sequenceBlock.endDate}}
{{else}}
{{t "general.clickToEdit"}}
{{/if}}
</button>
{{else}}
<span>
{{#if @sequenceBlock.endDate}}
Expand All @@ -223,20 +219,18 @@
<div class="block duration" data-test-duration>
<label>{{t "general.durationInDays"}}:</label>
{{#if @canUpdate}}
<span class="editinplace">
<span
class="editable"
role="button"
{{on "click" (set this.isEditingDatesAndDuration true)}}
data-test-edit
>
{{#if @sequenceBlock.duration}}
{{@sequenceBlock.duration}}
{{else}}
{{t "general.clickToEdit"}}
{{/if}}
</span>
</span>
<button
class="link-button"
type="button"
data-test-edit
{{on "click" (set this.isEditingDatesAndDuration true)}}
>
{{#if @sequenceBlock.duration}}
{{@sequenceBlock.duration}}
{{else}}
{{t "general.clickToEdit"}}
{{/if}}
</button>
{{else}}
<span>
{{#if @sequenceBlock.duration}}
Expand Down Expand Up @@ -405,33 +399,29 @@
<div class="block minimum" data-test-minimum>
<label>{{t "general.minimum"}}:</label>
{{#if (and @canUpdate (not this.isElective))}}
<span class="editinplace">
<span
class="editable"
role="button"
{{on "click" this.editMinMax}}
data-test-edit
>
{{this.minimum}}
</span>
</span>
<button
class="link-button"
type="button"
data-test-edit
{{on "click" this.editMinMax}}
>
{{this.minimum}}
</button>
{{else}}
<span>{{this.minimum}}</span>
{{/if}}
</div>
<div class="block maximum" data-test-maximum>
<label>{{t "general.maximum"}}:</label>
{{#if @canUpdate}}
<span class="editinplace">
<span
class="editable"
role="button"
{{on "click" this.editMinMax}}
data-test-edit
>
{{this.maximum}}
</span>
</span>
<button
class="link-button"
type="button"
data-test-edit
{{on "click" this.editMinMax}}
>
{{this.maximum}}
</button>
{{else}}
<span>{{this.maximum}}</span>
{{/if}}
Expand Down
108 changes: 56 additions & 52 deletions app/components/curriculum-inventory/verification-preview.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -12,145 +12,149 @@
{{did-insert this.setScrollTarget "toc"}}
>
<li>
<span class="link clickable" role="button" {{on "click" (fn this.scrollTo "table1")}}>
<button class="link link-button" type="button" {{on "click" (fn this.scrollTo "table1")}}>
{{t "general.table1ProgramExpectationsMappedToPcrs"}}
</span>
</button>
</li>
<li>
<span class="link clickable" role="button" {{on "click" (fn this.scrollTo "table2")}}>
<button class="link link-button" type="button" {{on "click" (fn this.scrollTo "table2")}}>
{{t "general.table2PrimaryInstructionalMethodByNonClerkshipSequenceBlock"}}
</span>
</button>
</li>
<li>
<span class="link clickable" role="button" {{on "click" (fn this.scrollTo "table3a")}}>
<button class="link link-button" type="button" {{on "click" (fn this.scrollTo "table3a")}}>
{{t "general.table3aNonClerkshipSequenceBlockInstructionalTime"}}
</span>
</button>
</li>
<li>
<span class="link clickable" role="button" {{on "click" (fn this.scrollTo "table3b")}}>
<button class="link link-button" type="button" {{on "click" (fn this.scrollTo "table3b")}}>
{{t "general.table3bClerkshipSequenceBlockInstructionalTime"}}
</span>
</button>
</li>
<li>
<span class="link clickable" role="button" {{on "click" (fn this.scrollTo "table4")}}>
<button class="link link-button" type="button" {{on "click" (fn this.scrollTo "table4")}}>
{{t "general.table4InstructionalMethodCounts"}}
</span>
</button>
</li>
<li>
<span class="link clickable" role="button" {{on "click" (fn this.scrollTo "table5")}}>
<button class="link link-button" type="button" {{on "click" (fn this.scrollTo "table5")}}>
{{t "general.table5NonClerkshipSequenceBlockAssessmentMethods"}}
</span>
</button>
</li>
<li>
<span class="link clickable" role="button" {{on "click" (fn this.scrollTo "table6")}}>
<button class="link link-button" type="button" {{on "click" (fn this.scrollTo "table6")}}>
{{t "general.table6ClerkshipSequenceBlockAssessmentMethods"}}
</span>
</button>
</li>
<li>
<span class="link clickable" role="button" {{on "click" (fn this.scrollTo "table7")}}>
<button class="link link-button" type="button" {{on "click" (fn this.scrollTo "table7")}}>
{{t "general.table7AllEventsWithAssessmentsTaggedAsFormativeOrSummative"
}}
</span>
</button>
</li>
<li>
<span class="link clickable" role="button" {{on "click" (fn this.scrollTo "table8")}}>
<button class="link link-button" type="button" {{on "click" (fn this.scrollTo "table8")}}>
{{t "general.table8AllResourceTypes"}}
</span>
</button>
</li>
</ul>
<CurriculumInventory::VerificationPreviewTable1
@data={{this.tables.program_expectations_mapped_to_pcrs}}
{{did-insert this.setScrollTarget "table1"}}
/>
<span
class="link clickable back-to-toc"
role="button" {{on "click" (fn this.scrollTo "toc")}}
<button
class="link link-button back-to-toc"
type="button" {{on "click" (fn this.scrollTo "toc")}}
{{did-insert this.setScrollTarget "table2"}}
>
{{t "general.backToTableOfContents"}}
</span>
</button>
<CurriculumInventory::VerificationPreviewTable2
@data={{this.tables.primary_instructional_methods_by_non_clerkship_sequence_blocks}}
/>
<span
class="link clickable back-to-toc"
role="button"
<button
class="link link-button back-to-toc"
type="button"
{{on "click" (fn this.scrollTo "toc")}}
{{did-insert this.setScrollTarget "table3a"}}
>
{{t "general.backToTableOfContents"}}
</span>
</button>
<CurriculumInventory::VerificationPreviewTable3a
@data={{this.tables.non_clerkship_sequence_block_instructional_time}}
/>
<span
class="link clickable back-to-toc"
role="button"
<button
class="link link-button back-to-toc"
type="button"
{{on "click" (fn this.scrollTo "toc")}}
{{did-insert this.setScrollTarget "table3b"}}
>
{{t "general.backToTableOfContents"}}
</span>
</button>
<CurriculumInventory::VerificationPreviewTable3b
@data={{this.tables.clerkship_sequence_block_instructional_time}}
/>
<span
class="link clickable back-to-toc"
role="button" {{on "click" (fn this.scrollTo "toc")}}
<button
class="link link-button back-to-toc"
type="button" {{on "click" (fn this.scrollTo "toc")}}
{{did-insert this.setScrollTarget "table4"}}
>
{{t "general.backToTableOfContents"}}
</span>
</button>
<CurriculumInventory::VerificationPreviewTable4
@data={{this.tables.instructional_method_counts}}
/>
<span
class="link clickable back-to-toc"
role="button"
<button
class="link link-button back-to-toc"
type="button"
{{on "click" (fn this.scrollTo "toc")}}
{{did-insert this.setScrollTarget "table5"}}
>
{{t "general.backToTableOfContents"}}
</span>
</button>
<CurriculumInventory::VerificationPreviewTable5
@data={{this.tables.non_clerkship_sequence_block_assessment_methods}}
/>
<span
class="link clickable back-to-toc"
role="button"
<button
class="link link-button back-to-toc"
type="button"
{{on "click" (fn this.scrollTo "toc")}}
{{did-insert this.setScrollTarget "table6"}}
>
{{t "general.backToTableOfContents"}}
</span>
</button>
<CurriculumInventory::VerificationPreviewTable6
@data={{this.tables.clerkship_sequence_block_assessment_methods}}
/>
<span
class="link clickable back-to-toc"
role="button"
<button
class="link link-button back-to-toc"
type="button"
{{on "click" (fn this.scrollTo "toc")}}
{{did-insert this.setScrollTarget "table7"}}
>
{{t "general.backToTableOfContents"}}
</span>
</button>
<CurriculumInventory::VerificationPreviewTable7
@data={{this.tables.all_events_with_assessments_tagged_as_formative_or_summative}}
/>
<span
class="link clickable back-to-toc"
role="button"
<button
class="link link-button back-to-toc"
type="button"
{{on "click" (fn this.scrollTo "toc")}}
{{did-insert this.setScrollTarget "table8"}}
>
{{t "general.backToTableOfContents"}}
</span>
</button>
<CurriculumInventory::VerificationPreviewTable8
@data={{this.tables.all_resource_types}}
/>
<span class="link clickable back-to-toc" role="button" {{on "click" (fn this.scrollTo "toc")}}>
<button
class="link link-button back-to-toc"
type="button"
{{on "click" (fn this.scrollTo "toc")}}
>
{{t "general.backToTableOfContents"}}
</span>
</button>
{{else}}
<LoadingSpinner />
{{/if}}
Expand Down
1 change: 1 addition & 0 deletions app/components/locale-chooser.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<span id="{{this.uniqueId}}-locale-chooser-title">
{{t (concat "general.language." this.locale.id)}}
</span>
<FaIcon @icon={{if this.isOpen "caret-down" "caret-right"}} />
</button>
{{#if this.isOpen}}
<div
Expand Down
15 changes: 12 additions & 3 deletions app/components/program-year/collapsed-objectives.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,18 @@
{{did-insert (perform this.load) @programYear.programYearObjectives}}
{{did-update (perform this.load) @programYear.programYearObjectives}}
>
<div class="title" role="button" {{on "click" @expand}} data-test-title>
{{t "general.objectives"}}
({{get this.objectives "length"}})
<div>
<button
class="title link-button"
type="button"
aria-expanded="false"
data-test-title
{{on "click" @expand}}
>
{{t "general.objectives"}}
({{get this.objectives "length"}})
<FaIcon @icon="caret-right" />
</button>
</div>
{{#if this.load.lastSuccessful.value}}
<div class="content">
Expand Down
Loading

0 comments on commit b60e145

Please sign in to comment.