Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Chore]: Technical: add types for side panel root components #1822

Merged
merged 9 commits into from Jun 1, 2022

Conversation

jagerts
Copy link
Collaborator

@jagerts jagerts commented May 12, 2022

Signed-off-by: Evgeny Zhgulev evgeny.zhgulev@actionengine.com

Signed-off-by: Evgeny Zhgulev <evgeny.zhgulev@actionengine.com>
Signed-off-by: Evgeny Zhgulev <evgeny.zhgulev@actionengine.com>
@jagerts jagerts force-pushed the ez/add-types-side-panel-root branch from d39075c to c22a144 Compare May 12, 2022 16:38
Signed-off-by: Evgeny Zhgulev <evgeny.zhgulev@actionengine.com>
Signed-off-by: Evgeny Zhgulev <evgeny.zhgulev@actionengine.com>
type PanelToggleProps = {
panels: PanelItem[];
activePanel: string;
togglePanel: typeof toggleSidePanel;
Copy link
Contributor

Choose a reason for hiding this comment

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

use ActionHandler<>
#1801 (comment)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

const PanelToggle = ({activePanel, panels, togglePanel}) => {

function PanelToggleFactory(PanelTab: ReturnType<typeof PanelTabFactory>) {
const PanelToggle = ({activePanel, panels, togglePanel}: PanelToggleProps) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

to be consistent...
const PanelToggle = React.FC<PanelToggleProps>

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

@@ -45,7 +62,7 @@ export const StyledPanelTab = styled.div.attrs({
`;

export function PanelTabFactory() {
const PanelTab = ({isActive, onClick, panel}) => (
const PanelTab = ({isActive, onClick, panel}: PanelTabProps) => (
Copy link
Contributor

Choose a reason for hiding this comment

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

const PanelTab: React.FC<PanelTabProps> = ({isActive, onClick, panel}) => ()

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

const dropdownItemsSelector = getDropdownItemsSelector();

const SaveExportDropdown = props => (
const SaveExportDropdown = (props: DropdownComponentProps) => (
Copy link
Contributor

Choose a reason for hiding this comment

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

use SaveExportDropdown: React.FC<DropdownComponentProps>

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

const dropdownItemsSelector = getDropdownItemsSelector();

const CloudStorageDropdown = props => (
const CloudStorageDropdown = (props: DropdownComponentProps) => (
Copy link
Contributor

Choose a reason for hiding this comment

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

use CloudStorageDropdown: React.FC<DropdownComponentProps>

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

@@ -86,7 +154,7 @@ const StyledToolbar = styled(Toolbar)`
position: absolute;
`;

export const PanelAction = ({item, onClick}) => (
export const PanelAction = ({item, onClick}: PanelActionProps) => (
Copy link
Contributor

Choose a reason for hiding this comment

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

PanelAction: React.FC<PanelActionProps>

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

@@ -101,7 +169,7 @@ export const PanelAction = ({item, onClick}) => (
);

export const PanelHeaderDropdownFactory = () => {
const PanelHeaderDropdown = ({items, show, onClose, id}) => {
const PanelHeaderDropdown = ({items, show, onClose, id}: PanelHeaderDropdownProps) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

PanelHeaderDropdown: React.FC<PanelHeaderDropdownProps>

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

@@ -66,7 +96,7 @@ const LayerBlendingSelector = ({layerBlending, updateLayerBlending, intl}) => {
<FormattedMessage id="layerBlending.title" />
</PanelLabel>
<ItemSelector
selectedItems={intl.formatMessage({id: LAYER_BLENDINGS[layerBlending].label})}
selectedItems={[intl.formatMessage({id: LAYER_BLENDINGS[layerBlending].label})]}
Copy link
Contributor

Choose a reason for hiding this comment

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

selectedItems don't need to be an array

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

filters: Filter[];
datasets: Datasets;
layers: Layer[];
showDatasetTable: typeof VisStateActions.showDatasetTable;
Copy link
Contributor

Choose a reason for hiding this comment

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

use ActionHandler<>

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

Signed-off-by: Evgeny Zhgulev <evgeny.zhgulev@actionengine.com>
Signed-off-by: Evgeny Zhgulev <evgeny.zhgulev@actionengine.com>
@jagerts jagerts requested a review from heshan0131 May 24, 2022 14:06
Signed-off-by: Evgeny Zhgulev <evgeny.zhgulev@actionengine.com>
Signed-off-by: Evgeny Zhgulev <evgeny.zhgulev@actionengine.com>
@jagerts jagerts merged commit 5ee0cd4 into master Jun 1, 2022
@delete-merged-branch delete-merged-branch bot deleted the ez/add-types-side-panel-root branch June 1, 2022 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants