From d332ab114f86e2e22cd173ec9fc26cbda0ee319a Mon Sep 17 00:00:00 2001 From: Sebastien LE MOUILLOUR <32456736+smouillour@users.noreply.github.com> Date: Thu, 11 Apr 2024 15:20:53 +0200 Subject: [PATCH] fix: Import and typing in react-bootstrap, cmf and forms (#5267) --- .changeset/real-toes-try.md | 7 + fork/react-bootstrap/src/index.js | 140 +++++++++--------- fork/react-bootstrap/src/utils/index.js | 4 +- packages/cmf/src/bootstrap.js | 17 ++- .../stories/CustomArrayTemplate.component.tsx | 2 +- 5 files changed, 89 insertions(+), 81 deletions(-) create mode 100644 .changeset/real-toes-try.md diff --git a/.changeset/real-toes-try.md b/.changeset/real-toes-try.md new file mode 100644 index 00000000000..ebb6bc09caf --- /dev/null +++ b/.changeset/real-toes-try.md @@ -0,0 +1,7 @@ +--- +"@talend/react-bootstrap": patch +"@talend/react-forms": patch +"@talend/react-cmf": patch +--- + +Fix imports and typing diff --git a/fork/react-bootstrap/src/index.js b/fork/react-bootstrap/src/index.js index 5709ee30b0c..90a7961b7d1 100644 --- a/fork/react-bootstrap/src/index.js +++ b/fork/react-bootstrap/src/index.js @@ -1,72 +1,72 @@ -export Accordion from './Accordion'; -export Alert from './Alert'; -export Badge from './Badge'; -export Breadcrumb from './Breadcrumb'; -export BreadcrumbItem from './BreadcrumbItem'; -export Button from './Button'; -export ButtonGroup from './ButtonGroup'; -export ButtonToolbar from './ButtonToolbar'; -export Carousel from './Carousel'; -export CarouselItem from './CarouselItem'; -export Checkbox from './Checkbox'; -export Clearfix from './Clearfix'; -export CloseButton from './CloseButton'; -export ControlLabel from './ControlLabel'; -export Col from './Col'; -export Collapse from './Collapse'; -export Dropdown from './Dropdown'; -export DropdownButton from './DropdownButton'; -export Fade from './Fade'; -export Form from './Form'; -export FormControl from './FormControl'; -export FormGroup from './FormGroup'; -export Glyphicon from './Glyphicon'; -export Grid from './Grid'; -export HelpBlock from './HelpBlock'; -export Image from './Image'; -export InputGroup from './InputGroup'; -export Jumbotron from './Jumbotron'; -export Label from './Label'; -export ListGroup from './ListGroup'; -export ListGroupItem from './ListGroupItem'; -export Media from './Media'; -export MenuItem from './MenuItem'; -export Modal from './Modal'; -export ModalBody from './ModalBody'; -export ModalDialog from './ModalDialog'; -export ModalFooter from './ModalFooter'; -export ModalHeader from './ModalHeader'; -export ModalTitle from './ModalTitle'; -export Nav from './Nav'; -export Navbar from './Navbar'; -export NavbarBrand from './NavbarBrand'; -export NavDropdown from './NavDropdown'; -export NavItem from './NavItem'; -export Overlay from './Overlay'; -export OverlayTrigger from './OverlayTrigger'; -export PageHeader from './PageHeader'; -export PageItem from './PageItem'; -export Pager from './Pager'; -export Pagination from './Pagination'; -export Panel from './Panel'; -export PanelGroup from './PanelGroup'; -export Popover from './Popover'; -export ProgressBar from './ProgressBar'; -export Radio from './Radio'; -export ResponsiveEmbed from './ResponsiveEmbed'; -export Row from './Row'; -export SafeAnchor from './SafeAnchor'; -export SplitButton from './SplitButton'; -export Tab from './Tab'; -export TabContainer from './TabContainer'; -export TabContent from './TabContent'; -export Table from './Table'; -export TabPane from './TabPane'; -export Tabs from './Tabs'; -export Thumbnail from './Thumbnail'; -export ToggleButton from './ToggleButton'; -export ToggleButtonGroup from './ToggleButtonGroup'; -export Tooltip from './Tooltip'; -export Well from './Well'; +export { default as Accordion } from './Accordion'; +export { default as Alert } from './Alert'; +export { default as Badge } from './Badge'; +export { default as Breadcrumb } from './Breadcrumb'; +export { default as BreadcrumbItem } from './BreadcrumbItem'; +export { default as Button } from './Button'; +export { default as ButtonGroup } from './ButtonGroup'; +export { default as ButtonToolbar } from './ButtonToolbar'; +export { default as Carousel } from './Carousel'; +export { default as CarouselItem } from './CarouselItem'; +export { default as Checkbox } from './Checkbox'; +export { default as Clearfix } from './Clearfix'; +export { default as CloseButton } from './CloseButton'; +export { default as ControlLabel } from './ControlLabel'; +export { default as Col } from './Col'; +export { default as Collapse } from './Collapse'; +export { default as Dropdown } from './Dropdown'; +export { default as DropdownButton } from './DropdownButton'; +export { default as Fade } from './Fade'; +export { default as Form } from './Form'; +export { default as FormControl } from './FormControl'; +export { default as FormGroup } from './FormGroup'; +export { default as Glyphicon } from './Glyphicon'; +export { default as Grid } from './Grid'; +export { default as HelpBlock } from './HelpBlock'; +export { default as Image } from './Image'; +export { default as InputGroup } from './InputGroup'; +export { default as Jumbotron } from './Jumbotron'; +export { default as Label } from './Label'; +export { default as ListGroup } from './ListGroup'; +export { default as ListGroupItem } from './ListGroupItem'; +export { default as Media } from './Media'; +export { default as MenuItem } from './MenuItem'; +export { default as Modal } from './Modal'; +export { default as ModalBody } from './ModalBody'; +export { default as ModalDialog } from './ModalDialog'; +export { default as ModalFooter } from './ModalFooter'; +export { default as ModalHeader } from './ModalHeader'; +export { default as ModalTitle } from './ModalTitle'; +export { default as Nav } from './Nav'; +export { default as Navbar } from './Navbar'; +export { default as NavbarBrand } from './NavbarBrand'; +export { default as NavDropdown } from './NavDropdown'; +export { default as NavItem } from './NavItem'; +export { default as Overlay } from './Overlay'; +export { default as OverlayTrigger } from './OverlayTrigger'; +export { default as PageHeader } from './PageHeader'; +export { default as PageItem } from './PageItem'; +export { default as Pager } from './Pager'; +export { default as Pagination } from './Pagination'; +export { default as Panel } from './Panel'; +export { default as PanelGroup } from './PanelGroup'; +export { default as Popover } from './Popover'; +export { default as ProgressBar } from './ProgressBar'; +export { default as Radio } from './Radio'; +export { default as ResponsiveEmbed } from './ResponsiveEmbed'; +export { default as Row } from './Row'; +export { default as SafeAnchor } from './SafeAnchor'; +export { default as SplitButton } from './SplitButton'; +export { default as Tab } from './Tab'; +export { default as TabContainer } from './TabContainer'; +export { default as TabContent } from './TabContent'; +export { default as Table } from './Table'; +export { default as TabPane } from './TabPane'; +export { default as Tabs } from './Tabs'; +export { default as Thumbnail } from './Thumbnail'; +export { default as ToggleButton } from './ToggleButton'; +export { default as ToggleButtonGroup } from './ToggleButtonGroup'; +export { default as Tooltip } from './Tooltip'; +export { default as Well } from './Well'; export * as utils from './utils'; diff --git a/fork/react-bootstrap/src/utils/index.js b/fork/react-bootstrap/src/utils/index.js index 0fb3a1ae023..1605c60316e 100644 --- a/fork/react-bootstrap/src/utils/index.js +++ b/fork/react-bootstrap/src/utils/index.js @@ -1,3 +1,3 @@ export * as bootstrapUtils from './bootstrapUtils'; -export createChainedFunction from './createChainedFunction'; -export ValidComponentChildren from './ValidComponentChildren'; +export { default as createChainedFunction } from './createChainedFunction'; +export { default as ValidComponentChildren } from './ValidComponentChildren'; diff --git a/packages/cmf/src/bootstrap.js b/packages/cmf/src/bootstrap.js index 4b32a171b8c..d652a584bb7 100644 --- a/packages/cmf/src/bootstrap.js +++ b/packages/cmf/src/bootstrap.js @@ -1,23 +1,24 @@ import ReactDOM from 'react-dom/client'; -import createSagaMiddleware from 'redux-saga'; + +import { compose } from 'redux'; import { batchedSubscribe } from 'redux-batched-subscribe'; +import createSagaMiddleware from 'redux-saga'; import { spawn } from 'redux-saga/effects'; -import compose from 'redux'; -import App from './App'; import actionCreator from './actionCreator'; import actions from './actions'; +import App from './App'; import { assertTypeOf } from './assert'; +import cmfModule from './cmfModule'; import component from './component'; +import { handleSagaComponent } from './components/Saga'; import expression from './expression'; +import interceptors from './httpInterceptors'; import onError from './onError'; -import storeAPI from './store'; +import { registerInternals } from './register'; import registry from './registry'; import sagas from './sagas'; -import { registerInternals } from './register'; -import cmfModule from './cmfModule'; -import interceptors from './httpInterceptors'; -import { handleSagaComponent } from './components/Saga'; +import storeAPI from './store'; export const bactchedSubscribe = batchedSubscribe(notify => { requestAnimationFrame(notify); diff --git a/packages/forms/stories/CustomArrayTemplate.component.tsx b/packages/forms/stories/CustomArrayTemplate.component.tsx index e11df62024d..7af1c4d469e 100644 --- a/packages/forms/stories/CustomArrayTemplate.component.tsx +++ b/packages/forms/stories/CustomArrayTemplate.component.tsx @@ -6,7 +6,7 @@ interface CustomArrayTemplateProps { onAdd: () => void; onRemove: (event: MouseEvent, index: number) => void; onReorder: (event: MouseEvent, payload: object) => void; - renderItem: (index: number) => void; + renderItem: (index: number) => React.ReactNode; value: object[]; }