Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

MM-26733 - Export Textbox so plugins can use it #5894

Merged
merged 9 commits into from
Jul 22, 2020

Conversation

cpoile
Copy link
Member

@cpoile cpoile commented Jul 10, 2020

Summary

  • Tried to compile the Textbox from a plugin, and that was a mess.
  • Instead, export the connected component into the window object.
  • Now we're able to send in a custom input component to override Textbox's AutosizeTextArea.
  • In QuickInput we don't need the channelId so remove it, and if we're not using an AutosizeTextArea we don't need to pass in the onHeightChange prop (these were causing warnings went sent to a plain input, and I wanted to clean them up).
  • Open to a better organization for the exported component. Maybe window.components.Textbox? -- done

Ticket Link

@cpoile cpoile added the Do Not Merge Should not be merged until this label is removed label Jul 10, 2020
@cpoile cpoile force-pushed the MM-26733-use-autocomplete-in-plugins branch from 2e6818a to 23d9a99 Compare July 20, 2020 20:21
@cpoile cpoile added 2: Dev Review Requires review by a core commiter and removed Do Not Merge Should not be merged until this label is removed labels Jul 21, 2020
Copy link
Member

@agarciamontoro agarciamontoro left a comment

Choose a reason for hiding this comment

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

Great! 🎉

window.openInteractiveDialog = openInteractiveDialog;
window.WebappUtils = {browserHistory};
window.Components = {Textbox};
Copy link
Member

Choose a reason for hiding this comment

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

The Components namespace is nice :)

@@ -234,6 +235,7 @@ export default class Textbox extends React.PureComponent<Props> {
</div>
);
}
const inputComponent = this.props.inputComponent || AutosizeTextarea;
Copy link
Member

Choose a reason for hiding this comment

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

Should we configure this in defaultProps instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, good idea! And I took out the null as a possible value of inputComponent (defaultProps will not replace a null value).

@cpoile cpoile merged commit 0b27dbf into master Jul 22, 2020
@cpoile cpoile deleted the MM-26733-use-autocomplete-in-plugins branch July 22, 2020 22:03
@amyblais amyblais removed the 2: Dev Review Requires review by a core commiter label Jul 23, 2020
@amyblais amyblais added Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation labels Aug 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants