Skip to content
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

Remove sessions grid render modifiers #8273

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions packages/ilios-common/.lint-todo
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,10 @@ add|ember-template-lint|no-at-ember-render-modifiers|3|2|3|2|23cd787c79c34a628da
add|ember-template-lint|no-at-ember-render-modifiers|4|2|4|2|60333f2ba463ca3d2ba17a04d799c8d66d8b99e2|1731542400000|1762646400000|1793750400000|addon/components/session-offerings-list.hbs
add|ember-template-lint|no-at-ember-render-modifiers|3|2|3|2|7ed3e86f759809c1d3f9de3aec39e22bf5f11d30|1731542400000|1762646400000|1793750400000|addon/components/session-overview.hbs
add|ember-template-lint|no-at-ember-render-modifiers|4|2|4|2|60333f2ba463ca3d2ba17a04d799c8d66d8b99e2|1731542400000|1762646400000|1793750400000|addon/components/session-overview.hbs
add|ember-template-lint|no-at-ember-render-modifiers|4|2|4|2|d0be752b9919c749f04a2eb96469552df0f4bcf2|1731542400000|1762646400000|1793750400000|addon/components/sessions-grid-offering.hbs
add|ember-template-lint|no-at-ember-render-modifiers|5|2|5|2|6c3d49b1de5e39076551e876b3765c5beaaa50f5|1731542400000|1762646400000|1793750400000|addon/components/sessions-grid-offering.hbs
add|ember-template-lint|no-at-ember-render-modifiers|6|2|6|2|9a885b1dbe0bab0f39ee91139933a48473e39f09|1731542400000|1762646400000|1793750400000|addon/components/sessions-grid-offering.hbs
add|ember-template-lint|no-at-ember-render-modifiers|4|2|4|2|d4688dbdc2532b9de099a680503f5bdff6b55af6|1731542400000|1762646400000|1793750400000|addon/components/sessions-grid.hbs
add|ember-template-lint|no-at-ember-render-modifiers|3|2|3|2|7491f1d2f4e83f2c87fbb4c84f36a84ba901e218|1731542400000|1762646400000|1793750400000|addon/components/taxonomy-manager.hbs
add|ember-template-lint|no-at-ember-render-modifiers|13|6|13|6|1a2522cd1202904fb09a6e811dec6b46d8189ab3|1731542400000|1762646400000|1793750400000|addon/components/user-name-info.hbs
add|ember-template-lint|no-at-ember-render-modifiers|8|57|8|57|49de9e74a62c8d39ef6a37eaecf07bd389aa57c7|1731542400000|1762646400000|1793750400000|addon/components/wait-saving.hbs
add|ember-template-lint|no-at-ember-render-modifiers|7|2|7|2|1a2522cd1202904fb09a6e811dec6b46d8189ab3|1731542400000|1762646400000|1793750400000|addon/components/weekly-calendar-event.hbs
add|ember-template-lint|no-at-ember-render-modifiers|6|2|6|2|4f45b7b5de154ec564345a9fa5b7cc54fe746a9b|1731542400000|1762646400000|1793750400000|addon/components/course/details.hbs
add|ember-template-lint|no-at-ember-render-modifiers|4|2|4|2|23cd787c79c34a628dadb6e96dd4004d42eebb79|1731542400000|1762646400000|1793750400000|addon/components/course/header.hbs
add|ember-template-lint|no-at-ember-render-modifiers|5|2|5|2|32658810aa13672f5981281c562729112a89788f|1731542400000|1762646400000|1793750400000|addon/components/course/header.hbs
add|ember-template-lint|no-at-ember-render-modifiers|4|2|4|2|23cd787c79c34a628dadb6e96dd4004d42eebb79|1731542400000|1762646400000|1793750400000|addon/components/course/objective-list.hbs
Expand Down
10 changes: 3 additions & 7 deletions packages/ilios-common/addon/components/course/details.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

<section
class="course-details"
id="course-top-section"
data-test-ilios-course-details
{{did-insert (set this "topSection")}}
{{animate-loading "course" loadingTime=500}}
...attributes
>
Expand All @@ -25,11 +25,7 @@
@setCourseManageLeadership={{@setCourseManageLeadership}}
/>
<div class="detail-collapsed-control">
<button
type="button"
data-test-expand-course-details
{{on "click" this.collapse}}
>
<button type="button" data-test-expand-course-details {{on "click" this.collapse}}>
{{t "general.collapseDetail"}}
<FaIcon @icon="square-minus" class="expand-collapse-icon" />
</button>
Expand All @@ -46,4 +42,4 @@
</button>
</div>
{{/if}}
</section>
</section>
4 changes: 3 additions & 1 deletion packages/ilios-common/addon/components/course/details.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ export default class CourseDetailsComponent extends Component {
@action
collapse() {
//when the button is clicked to collapse, animate the focus to the top of the page
scrollIntoView(this.topSection);
scrollIntoView(document.getElementById('course-top-section'), {
behavior: 'smooth',
});
this.args.setShowDetails(false);
}

Expand Down
50 changes: 14 additions & 36 deletions packages/ilios-common/addon/components/sessions-grid-offering.hbs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<tr
class="sessions-grid-offering {{if @even "even"}} {{if @firstRow "firstRow"}} {{if this.wasUpdated "wasUpdated"}}"
class="sessions-grid-offering{{if @even ' even'}}{{if @firstRow ' firstRow'}}{{if
this.wasUpdated
' wasUpdated'
}}"
data-test-sessions-grid-offering
{{did-insert this.revertRoomChanges}}
{{did-update this.revertRoomChanges}}
{{did-insert (set this "row")}}
>
{{#if this.cohortsLoaded}}
{{#if (and this.isEditing)}}
Expand All @@ -20,7 +20,6 @@
@offering={{@offering}}
@session={{this.session}}
@scrollToBottom={{false}}

/>
</td>
{{else}}
Expand All @@ -46,7 +45,8 @@
@save={{perform this.changeRoom}}
@close={{this.revertRoomChanges}}
@saveOnEnter={{true}}
@closeOnEscape={{true}} as |isSaving|
@closeOnEscape={{true}}
as |isSaving|
>
<input
aria-label={{t "general.room"}}
Expand All @@ -64,41 +64,23 @@
{{/if}}
</td>
<td
colspan="2"
title={{join
", "
(map-by "fullName" (sort-by "fullName" @offering.allLearners))
}}
colspan="2"
title={{join ", " (map-by "fullName" (sort-by "fullName" @offering.allLearners))}}
>
{{#if @offering.allLearners.length}}
<strong>({{@offering.allLearners.length}})</strong>
{{/if}}
{{truncate
(join ", " (map-by "fullName" (sort-by "fullName" @offering.allLearners)))
25
}}
{{truncate (join ", " (map-by "fullName" (sort-by "fullName" @offering.allLearners))) 25}}
</td>
<td
colspan="2"
title={{join
", "
(map-by "title" (sort-by "title" this.learnerGroups))
}}
>
<td colspan="2" title={{join ", " (map-by "title" (sort-by "title" this.learnerGroups))}}>
{{#if this.learnerGroups.length}}
<strong>({{this.learnerGroups.length}})</strong>
{{/if}}
{{truncate
(join ", " (map-by "title" (sort-by "title" this.learnerGroups)))
25
}}
{{truncate (join ", " (map-by "title" (sort-by "title" this.learnerGroups))) 25}}
</td>
<td
colspan="2"
title={{join
", "
(map-by "fullName" (sort-by "fullName" @offering.allInstructors))
}}
title={{join ", " (map-by "fullName" (sort-by "fullName" @offering.allInstructors))}}
>
{{#if @offering.allInstructors.length}}
<strong>({{@offering.allInstructors.length}})</strong>
Expand All @@ -116,14 +98,10 @@
type="button"
{{on "click" this.toggleEditing}}
>
<FaIcon
@icon="pencil"
@title={{t "general.edit"}}
@ariaHidden={{false}}
/>
<FaIcon @icon="pencil" @title={{t "general.edit"}} @ariaHidden={{false}} />
</button>
</td>
{{/if}}
{{/if}}
{{/if}}
</tr>
</tr>
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ export default class SessionsGridOffering extends Component {
@tracked isEditing = false;
@tracked wasUpdated = false;

constructor() {
super(...arguments);
this.room = this.args.offering.room;
}

@cached
get sessionData() {
return new TrackedAsyncData(this.args.offering.session);
Expand Down Expand Up @@ -53,15 +58,13 @@ export default class SessionsGridOffering extends Component {
}

@action
revertRoomChanges() {
this.room = this.args.offering.room;
}

@action
close() {
close({ target }) {
this.isEditing = false;
this.args.setHeaderLockedStatus(this.isEditing);
scrollIntoView(this.row);
const row = target.parentElement.parentElement.parentElement.parentElement.parentElement;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It felt bad putting that in there, but that's how many levels up the row is from the button /shrug

scrollIntoView(row, {
behavior: 'smooth',
});
}

changeRoom = dropTask(async () => {
Expand Down
21 changes: 4 additions & 17 deletions packages/ilios-common/addon/components/sessions-grid.hbs
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
<div
class="sessions-grid"
data-test-sessions-grid
{{did-insert this.scrollDown}}
>
<div class="sessions-grid" data-test-sessions-grid>
{{#each this.sortedSessions as |session|}}
<div
class="{{if
(includes session.id @expandedSessionIds)
"is-expanded"
"not-expanded"
}}
session"
class="{{if (includes session.id @expandedSessionIds) 'is-expanded' 'not-expanded'}} session"
data-test-expanded-session={{includes session.id @expandedSessionIds}}
data-test-session
>
Expand Down Expand Up @@ -38,11 +29,7 @@
{{t "general.yes"}}
{{/if}}
</button>
<button
class="done"
type="button"
{{on "click" (fn this.cancelDelete session.id)}}
>
<button class="done" type="button" {{on "click" (fn this.cancelDelete session.id)}}>
{{t "general.cancel"}}
</button>
</div>
Expand All @@ -60,4 +47,4 @@
{{else}}
<div class="no-results" data-test-no-results>{{t "general.noResultsFound"}}</div>
{{/each}}
</div>
</div>
5 changes: 5 additions & 0 deletions packages/ilios-common/addon/components/sessions-grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ export default class SessionsGrid extends Component {
@service intl;
@tracked confirmDeleteSessionIds = [];

constructor() {
super(...arguments);
this.scrollDown();
}

@cached
get sortedSessionsData() {
return new TrackedAsyncData(
Expand Down
Loading