Skip to content

Commit

Permalink
internal review comments resolved
Browse files Browse the repository at this point in the history
Signed-off-by: harshada.lingayat <harshada_lingayat@persistent.com>
  • Loading branch information
harshada8989 committed Sep 30, 2022
1 parent 9da652c commit 3fb0130
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import { EuiButtonIcon, EuiPanel, EuiSpacer, EuiText } from '@elastic/eui';
import { isEmpty } from 'lodash';
import React from 'react';
import React, { Fragment } from 'react';
import { ParentUnitType } from '../../../../../../../../common/types/explorer';

export const ConfigTreemapParentFields = ({
Expand Down Expand Up @@ -42,9 +42,9 @@ export const ConfigTreemapParentFields = ({
{!isEmpty(selectedAxis) &&
selectedAxis.map((obj: ParentUnitType, index: number) => {
return (
<>
<Fragment key={index}>
<EuiSpacer size="s" />
<EuiPanel key={index} paddingSize="s" className="panelItem_button">
<EuiPanel paddingSize="s" className="panelItem_button">
<EuiText size="s" className="field_text" onClick={() => handleEditParent(index)}>
<a role="button" tabIndex={0}>
{obj.label !== '' ? obj.label : `Parent ${index + 1}`}
Expand All @@ -58,7 +58,7 @@ export const ConfigTreemapParentFields = ({
onClick={() => handleParentDelete(index)}
/>
</EuiPanel>
</>
</Fragment>
);
})}
<EuiSpacer size="s" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
import React from 'react';
import React, { Fragment } from 'react';
import { EuiButtonIcon, EuiPanel, EuiSpacer, EuiText, EuiTitle } from '@elastic/eui';
import { ConfigListEntry } from '../../../../../../../../common/types/explorer';
import { VIS_CHART_TYPES } from '../../../../../../../../common/constants/shared';
Expand Down Expand Up @@ -37,8 +37,8 @@ export const DataConfigPanelFields = ({
<EuiSpacer size="s" />
{list !== undefined &&
list.map((obj: ConfigListEntry, index: number) => (
<>
<EuiPanel key={index} paddingSize="s" className="panelItem_button">
<Fragment key={index}>
<EuiPanel paddingSize="s" className="panelItem_button">
<EuiText
size="s"
className="field_text"
Expand All @@ -58,7 +58,7 @@ export const DataConfigPanelFields = ({
/>
</EuiPanel>
<EuiSpacer size="s" />
</>
</Fragment>
))}
{!isHeatMapAddButton(sectionName) && (
<EuiPanel className="panelItem_button" grow>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
htmlIdGenerator,
EuiToolTip,
} from '@elastic/eui';
import React, { useCallback, useContext, useEffect, useMemo, useState } from 'react';
import { batch, useDispatch } from 'react-redux';
import {
AGGREGATIONS,
Expand All @@ -30,7 +29,6 @@ import {
RAW_QUERY,
TIMESTAMP,
TIME_INTERVAL_OPTIONS,
CUSTOM_LABEL,
} from '../../../../../../../../common/constants/explorer';
import { VIS_CHART_TYPES } from '../../../../../../../../common/constants/shared';
import { composeAggregations } from '../../../../../../../../common/query_manager/utils';
Expand Down Expand Up @@ -269,7 +267,7 @@ export const DataConfigPanelItem = ({
const isDimensions = name === GROUPBY;
return (
<>
<div key={index} className="services">
<div className="services">
<div className="first-division">
<DataConfigItemClickPanel
isSecondary
Expand Down Expand Up @@ -332,7 +330,8 @@ export const DataConfigPanelItem = ({
</div>
</div>
</>
);
);
};

const getCommonDimensionsField = (selectedObj: ConfigListEntry, name: string) => (
<EuiFormRow label="Field">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import {
PARENTFIELDS,
VALUEFIELD,
} from '../../../../../../../../common/constants/explorer';
import { DataConfigPanelProps } from '../../../../../../../../common/types/explorer';
import { TabContext } from '../../../../../hooks';
import { ConfigTreemapParentFields } from './config_treemap_parents';
import { DataConfigItemClickPanel } from './data_config_item_click_panel';
Expand Down Expand Up @@ -148,7 +147,7 @@ export const TreemapConfigPanelItem = ({
placeholder="Select a field"
options={options}
selectedOptions={selectedAxis[index].label !== '' ? [selectedAxis[index]] : []}
isClearable={true}
isClearable
singleSelection={{ asPlainText: true }}
onChange={handleParentChange}
aria-label="Parent field"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {
GROUPBY,
PARENTFIELDS,
TIME_INTERVAL_OPTIONS,
CUSTOM_LABEL,
} from '../../../../../common/constants/explorer';
interface IVizContainerProps {
vizId: string;
Expand Down Expand Up @@ -183,8 +182,8 @@ const getUserConfigs = (
childField: { ...(axesData.xaxis ? axesData.xaxis[0] : initialEntryTreemap) },
parentFields:
userSelectedConfigs?.dataConfig !== undefined &&
userSelectedConfigs?.dataConfig[GROUPBY]?.length > 0
? [...userSelectedConfigs?.dataConfig[GROUPBY][0][PARENTFIELDS]]
userSelectedConfigs.dataConfig[GROUPBY]?.length > 0
? [...userSelectedConfigs.dataConfig[GROUPBY][0][PARENTFIELDS]]
: [],
},
],
Expand Down

0 comments on commit 3fb0130

Please sign in to comment.