provide renderSortLabel for sortable tables

flag=none

test plan:
  - specs pass

qa risk: low

Change-Id: I5c75cfe073897b065bbbd9a85d7482b12695d1b4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274142
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Omar Soto-Fortuño <omar.soto@instructure.com>
QA-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
Product-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
This commit is contained in:
Davis Hyer 2021-09-22 09:41:47 -06:00
parent fd00d7a1ef
commit df27a8922f
3 changed files with 2 additions and 3 deletions

View File

@ -184,7 +184,6 @@ const ignoredWarnings = [
/Missing field moduleItem in/,
/Please update the following components: %s/,
/shared_brand_configs.* not called/,
/The `renderSortLabel` prop should be provided when Table is sortable/,
/toBeEmpty has been deprecated/,
/Translation for .* is missing/,
/value provided is not in a recognized RFC2822 or ISO format/

View File

@ -115,7 +115,7 @@ export default function ViolationTable({
return (
<Table caption={I18n.t('CSP Violations')}>
<Table.Head>
<Table.Head renderSortLabel={<ScreenReaderContent>{I18n.t('Sort by')}</ScreenReaderContent>}>
<Table.Row>
{HEADERS.map(header => {
return (

View File

@ -289,7 +289,7 @@ export default class StudentsTable extends React.Component {
<ScreenReaderContent>{I18n.t('Overview of student status')}</ScreenReaderContent>
}
>
<Head>
<Head renderSortLabel={<ScreenReaderContent>{I18n.t('Sort by')}</ScreenReaderContent>}>
<Row>{HEADERS.map(this.renderHeader)}</Row>
</Head>
<Body>{this.renderStudents()}</Body>