Skip to content

Commit

Permalink
Merge branch 'main' into fix/undefined-expandAllFlag
Browse files Browse the repository at this point in the history
  • Loading branch information
ravi-kumar-pilla authored May 20, 2024
2 parents db43f42 + e909630 commit 597dbbb
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 132 deletions.
1 change: 1 addition & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Please follow the established format:
- Fix Kedro-Viz waiting for valid Kedro project. (#1871)
- Include expandAllPipelines in initial state. (#1896)
- Enhance Kedro-Viz documentation by using Kedro-sphinx-theme. (#1898)
- Remove default props from functional components. (#1906)
- Fix for schema change in strawberry-graphql JSON scalar. (#1903)
- Fix messaging level when package compatibility is not satisfied. (#1904)

Expand Down
17 changes: 8 additions & 9 deletions src/components/ui/button/button.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ import './button.scss';
/**
* Generic Kedro Button
*/
const Button = ({ children, dataTest, disabled, onClick, size, mode }) => (
const Button = ({
children,
dataTest = 'TestDefaultDataValue',
disabled = false,
onClick,
size = 'regular',
mode = 'primary',
}) => (
<span className="kedro button">
<button
className={classnames(
Expand All @@ -23,14 +30,6 @@ const Button = ({ children, dataTest, disabled, onClick, size, mode }) => (
</span>
);

Button.defaultProps = {
dataTest: 'TestDefaultDataValue',
disabled: false,
mode: 'primary',
onClick: null,
size: 'regular',
};

Button.propTypes = {
dataTest: PropTypes.string,
disabled: PropTypes.bool,
Expand Down
27 changes: 5 additions & 22 deletions src/components/ui/dropdown/dropdown-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@ import Button from '../button';
*/
const DropdownRenderer = ({
children,
defaultText,
disabled,
defaultText = 'Please select...',
disabled = false,
focusedOption,
handleRef,
haveSelectedValues,
haveSelectedValues = false,
onApplyAndClose,
onCancel,
onLabelClicked,
onOptionSelected,
onSelectChanged,
open,
open = false,
selectedOption,
showCancelApplyBtns,
title,
width,
width = 160,
placeholderText,
}) => {
const wrapperClasses = classnames('kedro', 'dropdown', {
Expand Down Expand Up @@ -169,23 +169,6 @@ const DropdownRenderer = ({
);
};

DropdownRenderer.defaultProps = {
children: null,
defaultText: 'Please select...',
disabled: false,
focusedOption: null,
handleRef: null,
haveSelectedValues: false,
onLabelClicked: null,
onOptionSelected: null,
onSelectChanged: null,
open: false,
selectedOption: null,
title: null,
width: 160,
placeholderText: null,
};

DropdownRenderer.propTypes = {
/**
* Child items. The nodes which React will pass down, defined inside the DropdownRenderer tag.
Expand Down
20 changes: 4 additions & 16 deletions src/components/ui/dropdown/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ import './dropdown.scss';
const Dropdown = (props) => {
const {
children,
defaultText,
disabled,
haveSelectedValues,
defaultText = 'Please select...',
disabled = false,
haveSelectedValues = false,
onApplyAndClose,
onCancel,
onChanged,
onClosed,
onOpened,
showCancelApplyBtns,
width,
width = 160,
placeholderText,
} = props;

Expand Down Expand Up @@ -333,18 +333,6 @@ const Dropdown = (props) => {
);
};

Dropdown.defaultProps = {
children: null,
defaultText: 'Please select...',
disabled: false,
haveSelectedValues: false,
onChanged: null,
onClosed: null,
onOpened: null,
width: 160,
placeholderText: null,
};

Dropdown.propTypes = {
/**
* Child items. The nodes which React will pass down, defined inside the DropdownRenderer tag
Expand Down
22 changes: 4 additions & 18 deletions src/components/ui/icon-button/icon-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ const labelPositionTypes = ['right', 'left', 'bottom', 'top'];
* Icon button component
*/
const IconButton = ({
active,
active = false,
ariaLabel,
ariaLive,
children,
className,
container = 'li',
dataTest,
dataTest = 'TestDefaultDataValue',
dataHeapEvent,
disabled,
disabled = false,
icon,
labelText,
labelTextPosition = 'right',
onClick,
visible,
visible = true,
...rest
}) => {
const Icon = icon;
Expand Down Expand Up @@ -109,18 +109,4 @@ IconButton.propTypes = {
visible: PropTypes.bool,
};

IconButton.defaultProps = {
active: false,
ariaLabel: null,
ariaLive: null,
children: null,
dataTest: 'TestDefaultDataValue',
dataHeapEvent: null,
disabled: false,
icon: null,
labelText: null,
onClick: null,
visible: true,
};

export default IconButton;
13 changes: 2 additions & 11 deletions src/components/ui/menu-option/menu-option.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import './menu-option.scss';
*/
const MenuOption = ({
className,
focused,
focused = false,
id,
onSelected,
primaryText,
selected,
selected = false,
value,
}) => {
const wrapperClasses = classnames('kedro', 'menu-option', className, {
Expand Down Expand Up @@ -61,15 +61,6 @@ const MenuOption = ({
);
};

MenuOption.defaultProps = {
className: null,
focused: false,
id: null,
onSelected: null,
selected: false,
value: null,
};

MenuOption.propTypes = {
/**
* Container class
Expand Down
5 changes: 0 additions & 5 deletions src/components/ui/search-bar/search-bar-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,6 @@ const SearchBarRenderer = (props) => {
);
};

SearchBarRenderer.defaultProps = {
children: null,
onSubmit: null,
};

SearchBarRenderer.propTypes = {
/**
* Child component, usually search-bar-results
Expand Down
16 changes: 2 additions & 14 deletions src/components/ui/search-bar/search-bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ const SearchBar = ({
onClear,
onFocus,
onSubmit,
placeholder,
theme,
placeholder = 'Search Here...',
theme = 'dark',
value: inputValue,
}) => {
const [value, setValue] = useState(inputValue);
Expand Down Expand Up @@ -115,18 +115,6 @@ const SearchBar = ({
);
};

SearchBar.defaultProps = {
children: null,
placeholder: 'Search Here...',
onBlur: null,
onChange: null,
onClear: null,
onFocus: null,
onSubmit: null,
theme: 'dark',
value: '',
};

SearchBar.propTypes = {
/**
* Child component, usually search-bar-results
Expand Down
15 changes: 2 additions & 13 deletions src/components/ui/search-bar/search-input/search-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import 'what-input';
import './search-input.scss';

const SearchInput = ({
disabled,
disabled = false,
label,
onBlur,
onChange,
onFocus,
placeholder,
theme,
theme = 'light',
value: inputValue,
}) => {
const [focused, setFocused] = useState(false);
Expand Down Expand Up @@ -92,17 +92,6 @@ const SearchInput = ({
);
};

SearchInput.defaultProps = {
disabled: false,
label: null,
onBlur: null,
onChange: null,
onFocus: null,
placeholder: null,
theme: 'light',
value: null,
};

SearchInput.propTypes = {
/**
* Whether the input should be editable or not.
Expand Down
27 changes: 8 additions & 19 deletions src/components/ui/tooltip/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ export const insertZeroWidthSpace = (text) =>
* @param {Boolean} visible Whether to show the tooltip
*/
const Tooltip = ({
arrowSize,
centerArrow,
chartSize,
noDelay,
style,
targetRect,
text,
visible,
arrowSize = 'regular',
centerArrow = false,
chartSize = {},
noDelay = false,
style = {},
targetRect = {},
text = '',
visible = false,
}) => {
let isTop = false,
isRight = false;
Expand Down Expand Up @@ -73,15 +73,4 @@ const Tooltip = ({
);
};

Tooltip.defaultProps = {
arrowSize: 'regular',
centerArrow: false,
chartSize: {},
noDelay: false,
style: {},
targetRect: {},
text: '',
visible: false,
};

export default Tooltip;
6 changes: 1 addition & 5 deletions tools/test-lib/react-app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const Radio = ({ current, value, onChange }) => (
</label>
);

const App = ({ initialData }) => {
const App = ({ initialData = 'random' }) => {
const [dataKey, updateDataKey] = useState(initialData);
const onChange = (e) => updateDataKey(e.target.value);

Expand Down Expand Up @@ -77,8 +77,4 @@ const App = ({ initialData }) => {
);
};

App.defaultProps = {
initialData: 'random',
};

export default App;

0 comments on commit 597dbbb

Please sign in to comment.