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

replaces deprecated "contains" helper with "includes" substitute. #5566

Merged
merged 1 commit into from
Sep 10, 2020
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
4 changes: 2 additions & 2 deletions app/components/assign-students.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@
</thead>
<tbody>
{{#each this.filteredStudents as |user|}}
<tr class={{if (contains user.id this.selectedUserIds) "highlighted"}}>
<tr class={{if (includes user.id this.selectedUserIds) "highlighted"}}>
<td class="text-left" colspan="1">
<input type="checkbox"
checked={{if (contains user.id this.selectedUserIds) "checked"}}
checked={{if (includes user.id this.selectedUserIds) "checked"}}
{{on "click" (action "toggleUserSelection" user.id)}}
>
</td>
Expand Down
2 changes: 1 addition & 1 deletion app/components/bulk-new-users.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
type="checkbox"
checked={{and
(v-get obj "isValid")
(contains obj selectedUsers)
(includes obj selectedUsers)
}}
onclick={{action "toggleUserSelection" obj}}
disabled={{v-get obj "isInvalid"}}
Expand Down
2 changes: 1 addition & 1 deletion app/components/curriculum-inventory-report-header.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
{{#if
(and
(v-get this "reportName" "isInvalid")
(contains "reportName" showErrorsFor)
(includes "reportName" showErrorsFor)
)
}}
<span class="validation-error-message">
Expand Down
6 changes: 3 additions & 3 deletions app/components/curriculum-inventory-report-overview.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
{{#if
(and
(v-get this "startDate" "isInvalid")
(contains "startDate" showErrorsFor)
(includes "startDate" showErrorsFor)
)
}}
<span class="validation-error-message">
Expand Down Expand Up @@ -83,7 +83,7 @@
{{#if
(and
(v-get this "endDate" "isInvalid")
(contains "endDate" showErrorsFor)
(includes "endDate" showErrorsFor)
)
}}
<span class="validation-error-message">
Expand Down Expand Up @@ -152,7 +152,7 @@
{{#if
(and
(v-get this "description" "isInvalid")
(contains "description" showErrorsFor)
(includes "description" showErrorsFor)
)
}}
<span class="validation-error-message">
Expand Down
2 changes: 1 addition & 1 deletion app/components/curriculum-inventory-report-rollover.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
onkeyup={{action "addErrorDisplayFor" "name"}}
placeholder={{t "general.reportNamePlaceholder"}}
>
{{#if (and (v-get this "name" "isInvalid") (contains "name" showErrorsFor))}}
{{#if (and (v-get this "name" "isInvalid") (includes "name" showErrorsFor))}}
<span class="validation-error-message">
{{v-get this "name" "message"}}
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
disabled={{or isSaving isElective}}
onkeyup={{action "addErrorDisplayFor" "minimum"}}
>
{{#if (and (v-get this "minimum" "isInvalid") (contains "minimum" showErrorsFor))
{{#if (and (v-get this "minimum" "isInvalid") (includes "minimum" showErrorsFor))
}}
<span class="validation-error-message">
{{v-get this "minimum" "message"}}
Expand All @@ -27,7 +27,7 @@
disabled={{isSaving}}
onkeyup={{action "addErrorDisplayFor" "maximum"}}
>
{{#if (and (v-get this "maximum" "isInvalid") (contains "maximum" showErrorsFor))
{{#if (and (v-get this "maximum" "isInvalid") (includes "maximum" showErrorsFor))
}}
<span class="validation-error-message">
{{v-get this "maximum" "message"}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@
<tr>
<td class="text-center" colspan="2">
{{if
(contains session linkedSessions)
(includes session linkedSessions)
(t "general.yes")
(t "general.no")
}}
</td>
<td class="text-center" colspan="2">
{{if
(contains session excludedSessions)
(includes session excludedSessions)
(t "general.yes")
(t "general.no")
}}
Expand All @@ -75,7 +75,7 @@
{{get (await session.sessionType) "title"}}
</td>
<td class="text-center" colspan="1">
{{#if (contains session linkedSessions)}}
{{#if (includes session linkedSessions)}}
{{#if (is-pending session.maxDuration)}}
<LoadingSpinner />
{{else}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,14 @@
<td class="text-center" colspan="2">
<Input
@type="checkbox"
@checked={{contains session linkedSessionsBuffer}}
@checked={{includes session linkedSessionsBuffer}}
@change={{action "changeSession" session}}
/>
</td>
<td class="text-center" colspan="2">
<Input
@type="checkbox"
@checked={{contains session excludedSessionsBuffer}}
@checked={{includes session excludedSessionsBuffer}}
@change={{action "excludeSession" session}}
/>
</td>
Expand All @@ -98,7 +98,7 @@
{{get (await session.sessionType) "title"}}
</td>
<td class="text-center" colspan="1">
{{#if (contains session linkedSessionsBuffer)}}
{{#if (includes session linkedSessionsBuffer)}}
{{#if (is-pending session.maxDuration)}}
<LoadingSpinner />
{{else}}
Expand Down
2 changes: 1 addition & 1 deletion app/components/global-search.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
type="checkbox"
checked={{or
(eq obj.results 0)
(not (contains obj.id ignoredSchoolIds))
(not (includes obj.id ignoredSchoolIds))
}}
onclick={{action "toggleSchoolSelection" obj.id}}
disabled={{eq obj.results 0}}
Expand Down
6 changes: 3 additions & 3 deletions app/components/ilios-course-list.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<tbody data-test-courses>
{{#each (sort-by (if this.sortingByStatus (fn this.sortCoursesByStatus) @sortBy) @courses) as |course|}}
<tr
class={{if (contains course.id this.coursesForRemovalConfirmation) "confirm-removal"}}
class={{if (includes course.id this.coursesForRemovalConfirmation) "confirm-removal"}}
data-test-active-row
>
<td class="text-left" colspan="3">
Expand All @@ -89,7 +89,7 @@
{{moment-format course.endDate "L"}}
</td>
<td class="text-left" colspan="3">
{{#if (contains course.id this.savingCourseIds)}}
{{#if (includes course.id this.savingCourseIds)}}
<LoadingSpinner />
{{else}}
<PublicationStatus @item={{course}} @showText={{true}} @showIcon={{false}} />
Expand Down Expand Up @@ -122,7 +122,7 @@
{{/if}}
</td>
</tr>
{{#if (contains course.id this.coursesForRemovalConfirmation)}}
{{#if (includes course.id this.coursesForRemovalConfirmation)}}
<tr class="confirm-removal">
<td colspan="15">
<div class="confirm-message">
Expand Down
2 changes: 1 addition & 1 deletion app/components/instructorgroup-header.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
disabled={{isSaving}}
onkeyup={{action "addErrorDisplayFor" "title"}}
>
{{#if (and (v-get this "title" "isInvalid") (contains "title" showErrorsFor))
{{#if (and (v-get this "title" "isInvalid") (includes "title" showErrorsFor))
}}
<span class="validation-error-message">
{{v-get this "title" "message"}}
Expand Down
4 changes: 2 additions & 2 deletions app/components/learnergroup-cohort-user-manager.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
{{#if @canUpdate}}
<input
type="checkbox"
checked={{contains user selectedUsers}}
checked={{includes user selectedUsers}}
{{on "click" (fn this.toggleUserSelection user)}}
>
{{/if}}
Expand All @@ -78,7 +78,7 @@
</td>
<td class="text-left" colspan="1">
{{#if user.enabled}}
{{#if (contains user this.usersBeingMoved)}}
{{#if (includes user this.usersBeingMoved)}}
<LoadingSpinner />
{{else if (and @canUpdate (eq this.selectedUsers.length 0))}}
<FaIcon
Expand Down
2 changes: 1 addition & 1 deletion app/components/learnergroup-header.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
onkeyup={{action "addErrorDisplayFor" "title"}}
>
{{#if
(and (v-get this "title" "isInvalid") (contains "title" showErrorsFor))
(and (v-get this "title" "isInvalid") (includes "title" showErrorsFor))
}}
<span class="validation-error-message">
{{v-get this "title" "message"}}
Expand Down
8 changes: 4 additions & 4 deletions app/components/learnergroup-list.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
{{#each (sort-by this.sortBy @learnerGroups) as |learnerGroup|}}
<tr
class={{if
(contains learnerGroup.id (map-by "id" this.toRemove))
(includes learnerGroup.id (map-by "id" this.toRemove))
"confirm-removal"
}}
data-test-active-row
Expand Down Expand Up @@ -68,7 +68,7 @@
data-test-remove
{{on "click" (perform this.confirmRemove learnerGroup)}}
>
{{#if (contains learnerGroup this.preparingToRemove)}}
{{#if (includes learnerGroup this.preparingToRemove)}}
<FaIcon @icon="spinner" @spin={{true}} />
{{else}}
<FaIcon @icon="trash" class="enabled" />
Expand All @@ -93,7 +93,7 @@
{{/if}}
</td>
</tr>
{{#if (contains learnerGroup.id (map-by "id" this.toRemove))}}
{{#if (includes learnerGroup.id (map-by "id" this.toRemove))}}
{{#let (find-by "id" learnerGroup.id this.toRemove) as |removableGroup|}}
<tr class="confirm-removal" data-test-confirm-removal>
<td colspan={{if (media "isLaptopAndUp") "5" "3"}}>
Expand Down Expand Up @@ -143,7 +143,7 @@
</tr>
{{/let}}
{{/if}}
{{#if (contains learnerGroup this.toCopy)}}
{{#if (includes learnerGroup this.toCopy)}}
<tr class="confirm-copy" data-test-confirm-copy>
<td colspan={{if (media "isLaptopAndUp") "6" "3"}}>
<div class="confirm-buttons">
Expand Down
2 changes: 1 addition & 1 deletion app/components/learnergroup-summary.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
{{#if
(and
(v-get this "location" "isInvalid")
(contains "location" showErrorsFor)
(includes "location" showErrorsFor)
)
}}
<span class="validation-error-message">
Expand Down
8 changes: 4 additions & 4 deletions app/components/learnergroup-user-manager.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
{{#if @isEditing}}
<input
type="checkbox"
checked={{contains user.content this.selectedUsers}}
checked={{includes user.content this.selectedUsers}}
onclick={{fn this.toggleUserSelection user.content}}
>
{{/if}}
Expand Down Expand Up @@ -108,7 +108,7 @@
</LinkTo>
</td>
<td>
{{#if (contains user.content this.usersBeingMoved)}}
{{#if (includes user.content this.usersBeingMoved)}}
<LoadingSpinner />
{{else if user.enabled}}
{{#if (eq this.selectedUsers.length 0)}}
Expand Down Expand Up @@ -144,7 +144,7 @@
{{#if @isEditing}}
<input
type="checkbox"
checked={{contains user.content this.selectedUsers}}
checked={{includes user.content this.selectedUsers}}
{{on "click" (fn this.toggleUserSelection user.content)}}
>
{{/if}}
Expand Down Expand Up @@ -177,7 +177,7 @@
</LinkTo>
</td>
<td>
{{#if (contains user.content this.usersBeingMoved)}}
{{#if (includes user.content this.usersBeingMoved)}}
<LoadingSpinner />
{{else if user.enabled}}
{{#if (eq this.selectedUsers.length 0)}}
Expand Down
2 changes: 1 addition & 1 deletion app/components/new-competency.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{{t "general.add"}}
{{/if}}
</button>
{{#if (and (v-get this "title" "isInvalid") (contains "title" showErrorsFor))}}
{{#if (and (v-get this "title" "isInvalid") (includes "title" showErrorsFor))}}
<span class="validation-error-message">
{{v-get this "title" "message"}}
</span>
Expand Down
2 changes: 1 addition & 1 deletion app/components/new-course.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
onkeyup={{action "addErrorDisplayFor" "title"}}
>
{{#if
(and (v-get this "title" "isInvalid") (contains "title" this.showErrorsFor))
(and (v-get this "title" "isInvalid") (includes "title" this.showErrorsFor))
}}
<span class="validation-error-message">
{{v-get this "title" "message"}}
Expand Down
2 changes: 1 addition & 1 deletion app/components/new-curriculum-inventory-report.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
onkeyup={{action "addErrorDisplayFor" "name"}}
placeholder={{t "general.reportNamePlaceholder"}}
>
{{#if (and (v-get this "name" "isInvalid") (contains "name" showErrorsFor))}}
{{#if (and (v-get this "name" "isInvalid") (includes "name" showErrorsFor))}}
<span class="validation-error-message">
{{v-get this "name" "message"}}
</span>
Expand Down
12 changes: 6 additions & 6 deletions app/components/new-curriculum-inventory-sequence-block.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
onkeyup={{action "addErrorDisplayFor" "title"}}
placeholder={{t "general.sequenceBlockTitlePlaceholder"}}
>
{{#if (and (v-get this "title" "isInvalid") (contains "title" showErrorsFor))
{{#if (and (v-get this "title" "isInvalid") (includes "title" showErrorsFor))
}}
<span class="validation-error-message">
{{v-get this "title" "message"}}
Expand Down Expand Up @@ -87,7 +87,7 @@
/>
{{#if
(and
(v-get this "startDate" "isInvalid") (contains "startDate" showErrorsFor)
(v-get this "startDate" "isInvalid") (includes "startDate" showErrorsFor)
)
}}
<span class="validation-error-message">
Expand All @@ -105,7 +105,7 @@
data-test-end-date-picker
/>
{{#if
(and (v-get this "endDate" "isInvalid") (contains "endDate" showErrorsFor))
(and (v-get this "endDate" "isInvalid") (includes "endDate" showErrorsFor))
}}
<span class="validation-error-message">
{{v-get this "endDate" "message"}}
Expand All @@ -125,7 +125,7 @@
>
{{#if
(and
(v-get this "duration" "isInvalid") (contains "duration" showErrorsFor)
(v-get this "duration" "isInvalid") (includes "duration" showErrorsFor)
)
}}
<span class="validation-error-message">
Expand Down Expand Up @@ -156,7 +156,7 @@
onkeyup={{action "addErrorDisplayFor" "minimum"}}
>
{{#if
(and (v-get this "minimum" "isInvalid") (contains "minimum" showErrorsFor))
(and (v-get this "minimum" "isInvalid") (includes "minimum" showErrorsFor))
}}
<span class="validation-error-message">
{{v-get this "minimum" "message"}}
Expand All @@ -175,7 +175,7 @@
onkeyup={{action "addErrorDisplayFor" "maximum"}}
>
{{#if
(and (v-get this "maximum" "isInvalid") (contains "maximum" showErrorsFor))
(and (v-get this "maximum" "isInvalid") (includes "maximum" showErrorsFor))
}}
<span class="validation-error-message">
{{v-get this "maximum" "message"}}
Expand Down
6 changes: 3 additions & 3 deletions app/components/new-directory-user.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
onkeyup={{action "addErrorDisplayFor" "otherId"}}
>
{{#if
(and (v-get this "otherId" "isInvalid") (contains "otherId" showErrorsFor))
(and (v-get this "otherId" "isInvalid") (includes "otherId" showErrorsFor))
}}
<span class="validation-error-message">
{{v-get this "otherId" "message"}}
Expand All @@ -88,7 +88,7 @@
>
{{#if
(and
(v-get this "username" "isInvalid") (contains "username" showErrorsFor)
(v-get this "username" "isInvalid") (includes "username" showErrorsFor)
)
}}
<span class="validation-error-message">
Expand All @@ -114,7 +114,7 @@
>
{{#if
(and
(v-get this "password" "isInvalid") (contains "password" showErrorsFor)
(v-get this "password" "isInvalid") (includes "password" showErrorsFor)
)
}}
<span class="validation-error-message">
Expand Down
Loading