Skip to content

Commit

Permalink
Cleanup "handle" functions
Browse files Browse the repository at this point in the history
  • Loading branch information
dlabrecq committed Aug 17, 2023
1 parent 6eab4e5 commit 8ad140e
Show file tree
Hide file tree
Showing 32 changed files with 415 additions and 415 deletions.
8 changes: 4 additions & 4 deletions src/routes/components/costType/costType.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ class CostTypeBase extends React.Component<CostTypeProps, CostTypeState> {
id="costTypeSelect"
isDisabled={isDisabled}
isOpen={isSelectOpen}
onSelect={this.handleSelect}
onToggle={this.handleToggle}
onSelect={this.handleOnSelect}
onToggle={this.handleOnToggle}
selections={selection}
variant={SelectVariant.single}
>
Expand All @@ -104,7 +104,7 @@ class CostTypeBase extends React.Component<CostTypeProps, CostTypeState> {
return options;
};

private handleSelect = (event, selection: CostTypeOption) => {
private handleOnSelect = (event, selection: CostTypeOption) => {
const { isLocalStorage = true, onSelect } = this.props;

// Set cost type in local storage
Expand All @@ -123,7 +123,7 @@ class CostTypeBase extends React.Component<CostTypeProps, CostTypeState> {
);
};

private handleToggle = isSelectOpen => {
private handleOnToggle = isSelectOpen => {
this.setState({ isSelectOpen });
};

Expand Down
8 changes: 4 additions & 4 deletions src/routes/components/currency/currency.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ class CurrencyBase extends React.Component<CurrencyProps, CurrencyState> {
id="currencySelect"
isDisabled={isDisabled}
isOpen={isSelectOpen}
onSelect={this.handleSelect}
onToggle={this.handleToggle}
onSelect={this.handleOnSelect}
onToggle={this.handleOnToggle}
selections={selection}
variant={SelectVariant.single}
>
Expand All @@ -106,7 +106,7 @@ class CurrencyBase extends React.Component<CurrencyProps, CurrencyState> {
return options;
};

private handleSelect = (event, selection: CurrencyOption) => {
private handleOnSelect = (event, selection: CurrencyOption) => {
const { isLocalStorage = true, onSelect } = this.props;

// Set currency units via local storage
Expand All @@ -125,7 +125,7 @@ class CurrencyBase extends React.Component<CurrencyProps, CurrencyState> {
);
};

private handleToggle = isSelectOpen => {
private handleOnToggle = isSelectOpen => {
this.setState({ isSelectOpen });
};

Expand Down
24 changes: 12 additions & 12 deletions src/routes/components/dataToolbar/basicToolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,16 +142,16 @@ export class BasicToolbarBase extends React.Component<BasicToolbarProps, BasicTo
const { isBulkSelectOpen } = this.state;

return getBulkSelect({
handleOnBulkSelect: this.handleOnBulkSelect,
handleOnBulkSelectClicked: this.handleOnBulkSelectClicked,
handleOnBulkSelectToggle: this.handleOnBulkSelectToggle,
isAllSelected,
isBulkSelectDisabled,
isBulkSelectOpen,
isDisabled,
isReadOnly,
itemsPerPage,
itemsTotal,
onBulkSelect: this.handleOnBulkSelect,
onBulkSelectClicked: this.handleOnBulkSelectClicked,
onBulkSelectToggle: this.handleOnBulkSelectToggle,
selectedItems,
showSelectAll: showBulkSelectAll,
});
Expand Down Expand Up @@ -186,11 +186,11 @@ export class BasicToolbarBase extends React.Component<BasicToolbarProps, BasicTo
return getCategorySelect({
categoryOptions,
currentCategory,
isDisabled,
filters,
handleOnCategorySelect: this.handleOnCategorySelect,
handleOnCategoryToggle: this.handleOnCategoryToggle,
isDisabled,
isCategorySelectOpen,
onCategorySelect: this.handleOnCategorySelect,
onCategoryToggle: this.handleOnCategoryToggle,
});
}

Expand Down Expand Up @@ -222,11 +222,11 @@ export class BasicToolbarBase extends React.Component<BasicToolbarProps, BasicTo
categoryOption,
currentCategory,
filters,
handleOnCategoryInput: this.handleOnCategoryInput,
handleOnCategoryInputChange: this.handleOnCategoryInputChange,
handleOnCategoryInputSelect: this.handleOnCategoryInputSelect,
handleOnDelete: this.handleOnDelete,
isDisabled,
onCategoryInput: this.handleOnCategoryInput,
onCategoryInputChange: this.handleOnCategoryInputChange,
onCategoryInputSelect: this.handleOnCategoryInputSelect,
onDelete: this.handleOnDelete,
resourcePathsType,
});
};
Expand Down Expand Up @@ -297,9 +297,9 @@ export class BasicToolbarBase extends React.Component<BasicToolbarProps, BasicTo
categoryOption,
currentCategory,
filters,
handleOnDelete: this.handleOnDelete,
handleOnSelect: this.handleOnCustomSelect,
isDisabled,
onDelete: this.handleOnDelete,
onSelect: this.handleOnCustomSelect,
selectClassName: categoryOption.selectClassName,
selectOptions: categoryOption.selectOptions,
});
Expand Down
76 changes: 38 additions & 38 deletions src/routes/components/dataToolbar/dataToolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,15 +184,15 @@ export class DataToolbarBase extends React.Component<DataToolbarProps, DataToolb
const { isBulkSelectOpen } = this.state;

return getBulkSelect({
handleOnBulkSelect: this.handleOnBulkSelect,
handleOnBulkSelectClicked: this.handleOnBulkSelectClicked,
handleOnBulkSelectToggle: this.handleOnBulkSelectToggle,
isAllSelected,
isBulkSelectDisabled,
isBulkSelectOpen,
isDisabled,
itemsPerPage,
itemsTotal,
onBulkSelect: this.handleOnBulkSelect,
onBulkSelectClicked: this.handleOnBulkSelectClicked,
onBulkSelectToggle: this.handleOnBulkSelectToggle,
selectedItems,
});
};
Expand Down Expand Up @@ -228,9 +228,9 @@ export class DataToolbarBase extends React.Component<DataToolbarProps, DataToolb
currentCategory,
isDisabled,
filters,
handleOnCategorySelect: this.handleOnCategorySelect,
handleOnCategoryToggle: this.handleOnCategoryToggle,
isCategorySelectOpen,
onCategorySelect: this.handleOnCategorySelect,
onCategoryToggle: this.handleOnCategoryToggle,
});
}

Expand Down Expand Up @@ -264,11 +264,11 @@ export class DataToolbarBase extends React.Component<DataToolbarProps, DataToolb
categoryOption,
currentCategory,
filters,
handleOnCategoryInput: this.handleOnCategoryInput,
handleOnCategoryInputChange: this.handleOnCategoryInputChange,
handleOnCategoryInputSelect: this.handleOnCategoryInputSelect,
handleOnDelete: this.handleOnDelete,
isDisabled,
onCategoryInput: this.handleOnCategoryInput,
onCategoryInputChange: this.handleOnCategoryInputChange,
onCategoryInputSelect: this.handleOnCategoryInputSelect,
onDelete: this.handleOnDelete,
resourcePathsType,
});
};
Expand Down Expand Up @@ -338,11 +338,11 @@ export class DataToolbarBase extends React.Component<DataToolbarProps, DataToolb
currentCategory,
currentCostCategoryKey,
filters,
handleOnCostCategoryKeyClear: this.handleOnCostCategoryKeyClear,
handleOnCostCategoryKeySelect: this.handleOnCostCategoryKeySelect,
handleOnCostCategoryKeyToggle: this.handleOnCostCategoryKeyToggle,
isCostCategoryKeySelectExpanded,
isDisabled,
onCostCategoryKeyClear: this.handleOnCostCategoryKeyClear,
onCostCategoryKeySelect: this.handleOnCostCategoryKeySelect,
onCostCategoryKeyToggle: this.handleOnCostCategoryKeyToggle,
resourceReport,
});
};
Expand Down Expand Up @@ -379,11 +379,11 @@ export class DataToolbarBase extends React.Component<DataToolbarProps, DataToolb
costCategoryKeyOption,
costCategoryKeyValueInput,
filters,
handleOnDelete: this.handleOnDelete,
handleOnCostCategoryValueSelect: this.handleOnCostCategoryValueSelect,
handleOnCostCategoryValueInput: this.handleOnCostCategoryValueInput,
handleOnCostCategoryValueInputChange: this.handleOnCostCategoryValueInputChange,
isDisabled,
onDelete: this.handleOnDelete,
onCostCategoryValueSelect: this.handleOnCostCategoryValueSelect,
onCostCategoryValueInput: this.handleOnCostCategoryValueInput,
onCostCategoryValueInputChange: this.handleOnCostCategoryValueInputChange,
resourcePathsType,
});
};
Expand Down Expand Up @@ -460,9 +460,9 @@ export class DataToolbarBase extends React.Component<DataToolbarProps, DataToolb
categoryOption,
currentCategory,
filters,
handleOnDelete: this.handleOnDelete,
handleOnSelect: this.handleOnCustomSelect,
isDisabled,
onDelete: this.handleOnDelete,
onSelect: this.handleOnCustomSelect,
selectClassName: categoryOption.selectClassName,
selectOptions: categoryOption.selectOptions,
});
Expand Down Expand Up @@ -507,9 +507,9 @@ export class DataToolbarBase extends React.Component<DataToolbarProps, DataToolb
return getExcludeSelect({
currentExclude,
filters,
handleOnExcludeSelect: this.handleOnExcludeSelect,
handleOnExcludeToggle: this.handleOnExcludeToggle,
isDisabled,
onExcludeSelect: this.handleOnExcludeSelect,
onExcludeToggle: this.handleOnExcludeToggle,
isExcludeSelectOpen,
});
}
Expand All @@ -535,11 +535,11 @@ export class DataToolbarBase extends React.Component<DataToolbarProps, DataToolb
return getOrgUnitSelect({
currentCategory,
filters,
handleOnDelete: this.handleOnDelete,
handleOnOrgUnitSelect: this.handleOnOrgUnitSelect,
handleOnOrgUnitToggle: this.handleOnOrgUnitToggle,
isDisabled,
isOrgUnitSelectExpanded,
onDelete: this.handleOnDelete,
onOrgUnitSelect: this.handleOnOrgUnitSelect,
onOrgUnitToggle: this.handleOnOrgUnitToggle,
orgReport,
});
};
Expand Down Expand Up @@ -589,11 +589,11 @@ export class DataToolbarBase extends React.Component<DataToolbarProps, DataToolb
currentCategory,
currentTagKey,
filters,
handleOnTagKeyClear: this.handleOnTagKeyClear,
handleOnTagKeySelect: this.handleOnTagKeySelect,
handleOnTagKeyToggle: this.handleOnTagKeyToggle,
isDisabled,
isTagKeySelectExpanded,
onTagKeyClear: this.handleOnTagKeyClear,
onTagKeySelect: this.handleOnTagKeySelect,
onTagKeyToggle: this.handleOnTagKeyToggle,
tagReport,
});
};
Expand Down Expand Up @@ -628,11 +628,11 @@ export class DataToolbarBase extends React.Component<DataToolbarProps, DataToolb
currentCategory,
currentTagKey,
filters,
handleOnDelete: this.handleOnDelete,
handleOnTagValueSelect: this.handleOnTagValueSelect,
handleOnTagValueInput: this.handleOnTagValueInput,
handleOnTagValueInputChange: this.handleOnTagValueInputChange,
isDisabled,
onDelete: this.handleOnDelete,
onTagValueSelect: this.handleOnTagValueSelect,
onTagValueInput: this.handleOnTagValueInput,
onTagValueInputChange: this.handleOnTagValueInputChange,
tagKeyOption,
tagPathsType,
tagKeyValueInput,
Expand Down Expand Up @@ -704,12 +704,12 @@ export class DataToolbarBase extends React.Component<DataToolbarProps, DataToolb
const { isDisabled } = this.props;

return getColumnManagement({
handleColumnManagementClicked: this.handleColumnManagementClicked,
isDisabled,
onColumnManagementClicked: this.handleOnColumnManagementClicked,
});
};

private handleColumnManagementClicked = () => {
private handleOnColumnManagementClicked = () => {
const { onColumnManagementClicked } = this.props;
if (onColumnManagementClicked) {
onColumnManagementClicked();
Expand All @@ -722,13 +722,13 @@ export class DataToolbarBase extends React.Component<DataToolbarProps, DataToolb
const { isDisabled, isExportDisabled } = this.props;

return getExportButton({
handleExportClicked: this.handleExportClicked,
isDisabled,
isExportDisabled,
onExportClicked: this.handleOnExportClicked,
});
};

private handleExportClicked = () => {
private handleOnExportClicked = () => {
const { onExportClicked } = this.props;
if (onExportClicked) {
onExportClicked();
Expand All @@ -742,13 +742,13 @@ export class DataToolbarBase extends React.Component<DataToolbarProps, DataToolb
const { isPlatformCostsChecked } = this.state;

return getPlatformCosts({
handlePlatformCostsChanged: this.handlePlatformCostsChanged,
isDisabled,
isPlatformCostsChecked,
onPlatformCostsChanged: this.handleOnPlatformCostsChanged,
});
};

private handlePlatformCostsChanged = (checked: boolean) => {
private handleOnPlatformCostsChanged = (checked: boolean) => {
const { onPlatformCostsChanged } = this.props;
const { isPlatformCostsChecked } = this.state;
this.setState({ isPlatformCostsChecked: !isPlatformCostsChecked }, () => {
Expand All @@ -765,9 +765,9 @@ export class DataToolbarBase extends React.Component<DataToolbarProps, DataToolb
const { isPlatformCostsChecked } = this.state;

return getKebab({
handleColumnManagementClicked: this.handleColumnManagementClicked,
handlePlatformCostsChanged: this.handlePlatformCostsChanged,
isPlatformCostsChecked,
onColumnManagementClicked: this.handleOnColumnManagementClicked,
onPlatformCostsChanged: this.handleOnPlatformCostsChanged,
showColumnManagement,
showPlatformCosts,
});
Expand Down
Loading

0 comments on commit 8ad140e

Please sign in to comment.