run instUI codemods for v7 deprecations

Closes: COREFE-340

this is the result of running:
npx @instructure/instui-cli upgrade --version 7

test plan:
* you should see less deprecation warnings from instUI components

Change-Id: I551678eaa4c9533513f188f464a8be2019f3f4ee
Reviewed-on: https://gerrit.instructure.com/207727
Tested-by: Jenkins
Reviewed-by: Mysti Lilla <mysti@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
This commit is contained in:
Ryan Shaw 2019-08-30 14:00:18 -06:00
parent d492a2f3a2
commit fa187825e3
6 changed files with 12 additions and 10 deletions

View File

@ -116,18 +116,18 @@ export default class NewCourseModal extends React.Component {
<Modal.Body>
<FormFieldGroup layout="stacked" rowSpacing="small" description="">
<TextInput
label={I18n.t('Course Name')}
renderLabel={I18n.t('Course Name')}
value={data.name}
onChange={onChange('name')}
required
isRequired
messages={errors.name && [{type: 'error', text: errors.name}]}
/>
<TextInput
label={I18n.t('Reference Code')}
renderLabel={I18n.t('Reference Code')}
value={data.course_code}
onChange={onChange('course_code')}
required
isRequired
messages={errors.course_code && [{type: 'error', text: errors.course_code}]}
/>

View File

@ -91,7 +91,7 @@ export default class GraderCountNumberInput extends React.Component {
<NumberInput
id="grader_count"
value={this.state.graderCount.toString()}
label={label}
renderLabel={label}
locale={this.props.locale}
max={this.props.availableGradersCount.toString()}
messages={this.state.messages}

View File

@ -183,12 +183,12 @@ export default class EditableNumber extends React.Component {
onChange={this.handleInputChange}
onKeyDown={this.handleKey}
onKeyUp={this.handleKey}
label={<ScreenReaderContent>this.props.label</ScreenReaderContent>}
renderLabel={<ScreenReaderContent>this.props.label</ScreenReaderContent>}
onBlur={onBlur}
inputRef={createChainedFunction(this.getInputRef, editorRef)}
inline={this.props.inline}
display={this.props.inline ? 'inline-block' : 'block'}
size={this.props.size}
required={this.props.required}
isRequired={this.props.required}
/>
)
}

View File

@ -96,7 +96,7 @@ export default class BlueprintAssociations extends React.Component {
const { hasUnsyncedChanges, existingAssociations, addedAssociations } = this.props
if (hasUnsyncedChanges && existingAssociations.length > 0 && addedAssociations.length > 0) {
return (
<Alert variant="warning" closeButtonLabel={I18n.t('Close')} margin="0 0 large">
<Alert variant="warning" renderCloseButtonLabel={I18n.t('Close')} margin="0 0 large">
<p style={{margin: '0 -10px'}}>
<Text weight="bold">{I18n.t('Warning:')}</Text>&nbsp;
<Text>{I18n.t('You have unsynced changes that will sync to all associated courses when a new association is saved.')}</Text>

View File

@ -197,7 +197,7 @@ export default class TimeBlockSelector extends React.Component {
messages={this.state.slotMessage}
>
<NumberInput
label={I18n.t('Divide into equal slots (value is in minutes)')}
renderLabel={I18n.t('Divide into equal slots (value is in minutes)')}
value={this.state.slotValue}
onChange={this.handleSlotValueChange}
onIncrement={this.handleSlotValueIncrement}

View File

@ -32,6 +32,8 @@ const consoleMessagesToIgnore = {
/is experimental and its API could change significantly in a future release/,
'Warning: [Focusable] Exactly one focusable child is required (0 found).',
/in Select \(created by CanvasSelect\)/,
// React 16.9+ generates these deprecation warnings but it doesn't do any good to hear about the ones for instUI. We can't do anything about them in this repo
// Put any others we can't control here.
/Please update the following components:[ (BaseTransition|Billboard|Button|Checkbox|CloseButton|Dialog|Expandable|FileDrop|Flex|FlexItem|FormFieldGroup|FormFieldLabel|FormFieldLayout|FormFieldMessage|FormFieldMessages|Grid|GridCol|GridRow|Heading|InlineSVG|Mask|ModalBody|ModalFooter|ModalHeader|NumberInput|Portal|Query|Responsive|SVGIcon|ScreenReaderContent|SelectOptionsList|SelectField|SelectMultiple|SelectOptionsList|SelectSingle|Spinner|Tab|TabList|TabPanel|Text|TextArea|TextInput|TinyMCE|ToggleDetails|ToggleFacade|Transition|TruncateText|View),?]+$/