From b4eb1f7c6d1e26ba65251e64b4ffa0b3040c48bf Mon Sep 17 00:00:00 2001 From: Ben Scott Date: Thu, 29 Aug 2019 10:01:31 -0700 Subject: [PATCH] A few more renames --- src/components/Navigation/index.ts | 4 ++-- src/components/ResourceItem/ResourceItem.tsx | 4 ++-- src/components/ResourceList/ResourceList.tsx | 6 +++--- src/components/index.ts | 8 +++----- src/utilities/resource-list/context.ts | 4 ++-- src/utilities/resource-list/index.ts | 2 +- src/utilities/resource-list/types.ts | 2 +- 7 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/components/Navigation/index.ts b/src/components/Navigation/index.ts index 082ef310c08..0abd94f9757 100644 --- a/src/components/Navigation/index.ts +++ b/src/components/Navigation/index.ts @@ -1,8 +1,8 @@ export {Navigation, NavigationProps} from './Navigation'; export { - ItemProps, + ItemProps as NavigationItemProps, SubNavigationItem, isNavigationItemActive, - MessageProps, + MessageProps as NavigationMessageProps, } from './components'; diff --git a/src/components/ResourceItem/ResourceItem.tsx b/src/components/ResourceItem/ResourceItem.tsx index 755a0d3cdc1..a57af0be6fc 100644 --- a/src/components/ResourceItem/ResourceItem.tsx +++ b/src/components/ResourceItem/ResourceItem.tsx @@ -20,7 +20,7 @@ import { import { ResourceListContext, SELECT_ALL_ITEMS, - SelectedItems, + ResourceListSelectedItems, } from '../../utilities/resource-list'; import styles from './ResourceItem.scss'; @@ -428,7 +428,7 @@ function stopPropagation(event: React.MouseEvent) { event.stopPropagation(); } -function isSelected(id: string, selectedItems?: SelectedItems) { +function isSelected(id: string, selectedItems?: ResourceListSelectedItems) { return Boolean( selectedItems && ((Array.isArray(selectedItems) && selectedItems.includes(id)) || diff --git a/src/components/ResourceList/ResourceList.tsx b/src/components/ResourceList/ResourceList.tsx index 7ee93da4e72..bd75d7ac3f2 100644 --- a/src/components/ResourceList/ResourceList.tsx +++ b/src/components/ResourceList/ResourceList.tsx @@ -14,7 +14,7 @@ import { } from '../../utilities/with-app-provider'; import { ResourceListContext, - SelectedItems, + ResourceListSelectedItems, SELECT_ALL_ITEMS, } from '../../utilities/resource-list'; import {Select, SelectOption} from '../Select'; @@ -58,7 +58,7 @@ export interface ResourceListProps { /** Actions available on the currently selected items */ bulkActions?: BulkActionsProps['actions']; /** Collection of IDs for the currently selected items */ - selectedItems?: SelectedItems; + selectedItems?: ResourceListSelectedItems; /** Renders a Select All button at the top of the list and checkboxes in front of each list item. For use when bulkActions aren't provided. **/ selectable?: boolean; /** If there are more items than currently in the list */ @@ -76,7 +76,7 @@ export interface ResourceListProps { /** Callback when sort option is changed */ onSortChange?(selected: string, id: string): void; /** Callback when selection is changed */ - onSelectionChange?(selectedItems: SelectedItems): void; + onSelectionChange?(selectedItems: ResourceListSelectedItems): void; /** Function to render each list item */ renderItem(item: any, id: string, index: number): React.ReactNode; /** Function to customize the unique ID for each item */ diff --git a/src/components/index.ts b/src/components/index.ts index a1ccb9dc57e..a56168ccd9b 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -135,8 +135,8 @@ export {Modal, ModalProps} from './Modal'; export { Navigation, NavigationProps, - ItemProps as NavigationItemProps, - MessageProps as NavigationMessageProps, + NavigationItemProps, + NavigationMessageProps, SubNavigationItem, isNavigationItemActive, } from './Navigation'; @@ -177,9 +177,7 @@ export { FilterTextField, } from './ResourceList'; -export { - SelectedItems as ResourceListSelectedItems, -} from '../utilities/resource-list'; +export {ResourceListSelectedItems} from '../utilities/resource-list'; export {ResourcePicker, ResourcePickerProps} from './ResourcePicker'; diff --git a/src/utilities/resource-list/context.ts b/src/utilities/resource-list/context.ts index 26b1d3857a7..95e711f961e 100644 --- a/src/utilities/resource-list/context.ts +++ b/src/utilities/resource-list/context.ts @@ -1,10 +1,10 @@ import React from 'react'; -import {SelectedItems} from './types'; +import {ResourceListSelectedItems} from './types'; export interface ResourceListContextType { selectMode?: boolean; selectable?: boolean; - selectedItems?: SelectedItems; + selectedItems?: ResourceListSelectedItems; resourceName?: { singular: string; plural: string; diff --git a/src/utilities/resource-list/index.ts b/src/utilities/resource-list/index.ts index d33f836dc41..16decd90935 100644 --- a/src/utilities/resource-list/index.ts +++ b/src/utilities/resource-list/index.ts @@ -1,3 +1,3 @@ export {ResourceListContext} from './context'; -export {SelectedItems, SELECT_ALL_ITEMS} from './types'; +export {ResourceListSelectedItems, SELECT_ALL_ITEMS} from './types'; diff --git a/src/utilities/resource-list/types.ts b/src/utilities/resource-list/types.ts index 35319884bf0..96dd31ab659 100644 --- a/src/utilities/resource-list/types.ts +++ b/src/utilities/resource-list/types.ts @@ -1,3 +1,3 @@ -export type SelectedItems = string[] | 'All'; +export type ResourceListSelectedItems = string[] | 'All'; export const SELECT_ALL_ITEMS = 'All';