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

Sprint1 #14

Merged
merged 43 commits into from
Jun 28, 2022
Merged
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
ed78cff
graph style section UI schema
rinku-kumar-psl May 18, 2022
5f8ed2b
changes for style mode and interpolation
rinku-kumar-psl Jun 24, 2022
3da4b49
lineWidth integration for line mode
rinku-kumar-psl Jun 24, 2022
4a4207c
changes for Legend and Orientation in Line
rinku-kumar-psl Jun 24, 2022
790b33b
point size and Bar Alignment changes
rinku-kumar-psl Jun 24, 2022
b5a6191
implemented fill opacity for line chart
rinku-kumar-psl Jun 23, 2022
bae6b96
changes for line width and fill opacity in bar mode and removed mode …
rinku-kumar-psl Jun 24, 2022
c91c934
updated bar mode opacity in line chart
rinku-kumar-psl May 13, 2022
30e7e88
refactored the config chart style code
rinku-kumar-psl Jun 24, 2022
6e399da
snapshot updated and code refactored
rinku-kumar-psl Jun 23, 2022
8235008
type added to new component
rinku-kumar-psl Jun 24, 2022
68fd32a
review comments addressed
rinku-kumar-psl Jun 24, 2022
f2d3d32
cypress test case added and resolve button label wraping issue
rinku-kumar-psl Jun 24, 2022
a76ac36
multi matrices changes for Line
rinku-kumar-psl Jun 17, 2022
23373a1
dimensions and metrics UI changes for time-series
rinku-kumar-psl Jun 24, 2022
988e761
made data config pannel collapsable and initial fields render
rinku-kumar-psl Jun 24, 2022
2cb28f7
code refactored
rinku-kumar-psl Jun 24, 2022
e632d77
snapshot updated and handled corner cases
rinku-kumar-psl Jun 24, 2022
dbd564e
code styling fixes and added TODO comment
rinku-kumar-psl Jun 24, 2022
af895be
Merge pull request #2 from rinku-kumar-psl/feature/line-new-data-conf…
abasatwar Jun 24, 2022
616a977
data config reviewed code added
deepaknevdepsl Jun 24, 2022
e80b9c1
Text correction
deepaknevdepsl Jun 24, 2022
051feef
Conflicts resolved
deepaknevdepsl Jun 24, 2022
cd7cbfe
table view: eui table replaced with ag-grid
ramneet-persistent Jun 16, 2022
933603f
drag-drop issue fixed
ramneet-persistent Jun 21, 2022
fbc7168
test case of data_table updated
ramneet-persistent Jun 23, 2022
fc58354
feedback comments resolved
ramneet-persistent Jun 23, 2022
457b624
grid height issue:fixed
ramneet-persistent Jun 23, 2022
2aa7e07
column height, value getter for type double
ramneet-persistent Jun 24, 2022
b3264b1
data_table elements moved to separate
ramneet-persistent Jun 24, 2022
59eb7a4
footer components
ramneet-persistent Jun 24, 2022
a559dd4
Conflicts resolved
deepaknevdepsl Jun 24, 2022
e567453
cypress test cases for table view
ramneet-persistent Jun 24, 2022
217e04e
Merge pull request #1 from ramneet-persistent/feature/enhanced_table_…
abasatwar Jun 24, 2022
ba50689
Merge pull request #5 from deepaknevdepsl/feature/new-data-config-pan…
abasatwar Jun 24, 2022
7e7a414
enhancement for heatmap with new UI
Jun 24, 2022
5017a0c
line chart test cases
Jun 24, 2022
b802383
console logs removed
Jun 24, 2022
ea86f41
Merge pull request #7 from shankha-das/enhancement/heatmap-787
abasatwar Jun 24, 2022
f717710
updated value options ui for treemap
mrunal-z Jun 24, 2022
63b6a3c
removed console
mrunal-z Jun 27, 2022
c951ece
Merge pull request #8 from mrunal-z/enhancements/new-treemap-config-o…
abasatwar Jun 28, 2022
4f9d422
Fixes of sprint1 for new ui implementation (#12)
ruchika-narang Jun 28, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
code refactored
Signed-off-by: rinku-kumar-psl <[email protected]>

# Conflicts:
#	dashboards-observability/public/components/event_analytics/explorer/visualizations/config_panel/config_panes/config_controls/data_config_panel_item.tsx
rinku-kumar-psl committed Jun 24, 2022
commit 2cb28f71946b93d0bec833a0fa2d29aec7be282b
Original file line number Diff line number Diff line change
@@ -870,6 +870,7 @@ describe('Render Pie chart for Legend and single color contrast change', () => {
beforeEach(() => {
landOnEventVisualizations();
});

it('Render Pie chart and verify legends for Position Right and Bottom', () => {
renderPieChart();

Original file line number Diff line number Diff line change
@@ -19,21 +19,22 @@ interface ToggleGroupProps {
export const ButtonGroupItem: React.FC<ToggleGroupProps> = ({
title, legend, groupOptions, idSelected, handleButtonChange
}) => (
<>
<EuiTitle size="xxs">
<h3>{title}</h3>
</EuiTitle>
<EuiSpacer size="s" />

<EuiButtonGroup
id={htmlIdGenerator('button-select')()}
name={title}
legend={legend}
options={groupOptions}
idSelected={idSelected}
onChange={handleButtonChange}
buttonSize="compressed"
isFullWidth={false}
/>
</>
<>
<EuiTitle size="xxs">
<h3>{title}</h3>
</EuiTitle>
<EuiSpacer size="s" />
<div style={{ width: "fit-content" }}>
<EuiButtonGroup
id={htmlIdGenerator('button-select')()}
name={title}
legend={legend}
options={groupOptions}
idSelected={idSelected}
onChange={handleButtonChange}
buttonSize="compressed"
isFullWidth={false}
/>
</div>
</>
);
Original file line number Diff line number Diff line change
@@ -57,35 +57,17 @@ export const DataConfigPanelItem = ({ fieldOptionList, visualizations, tabID }:
let list = { ...configList };
let listItem = { ...list[name][index] };
listItem = { ...listItem, [field]: value };
const x = {
const newList = {
...list,
[name]: [
...list[name].slice(0, index),
listItem,
...list[name].slice(index + 1, list[name].length),
],
};
setConfigList(x);
setConfigList(newList);
}

const onfieldOptionChange = (e, index: number, name: string) => {
let label = e.length > 0 ? e[0].label : '';
updateList(label, index, name, 'label');
};

const onAggregationChange = (e, index: number, name: string) => {
let label = e.length > 0 ? e[0].label : '';
updateList(label, index, name, 'aggregation');
};

const onCustomLabelChange = (e, index: number, name: string) => {
updateList(e.target.value, index, name, 'custom_label');
};

const handleSideChange = (id: string, index: number, name: string) => {
updateList(id, index, name, 'side');
};

const handleServiceRemove = (index: number, name: string) => {
const list = { ...configList };
const arr = [...list[name]];
@@ -114,97 +96,89 @@ export const DataConfigPanelItem = ({ fieldOptionList, visualizations, tabID }:
);
};

const getCommonUI = (lists, sectionName: string) =>
lists.map((singleField, index: number) => (
<>
<div key={index} className="services">
<div className="first-division">
<EuiPanel color="subdued">
<EuiFormRow
label="Aggregation"
labelAppend={
lists.length !== 1 && (
<EuiText size="xs">
<EuiIcon
type="cross"
color="danger"
onClick={() => handleServiceRemove(index, sectionName)}
/>
</EuiText>
)
}
>
<EuiComboBox
aria-label="Accessible screen reader label"
placeholder="Select a aggregation"
singleSelection={{ asPlainText: true }}
options={AGGREGATION_OPTIONS}
selectedOptions={
singleField.aggregation ? [{ label: singleField.aggregation }] : []
}
onChange={(e) => onAggregationChange(e, index, sectionName)}
/>
</EuiFormRow>
<EuiFormRow label="Field">
<EuiComboBox
aria-label="Accessible screen reader label"
placeholder="Select a field"
singleSelection={{ asPlainText: true }}
options={fieldOptionList}
selectedOptions={singleField.label ? [{ label: singleField.label }] : []}
onChange={(e) => onfieldOptionChange(e, index, sectionName)}
/>
</EuiFormRow>

<EuiFormRow label="Custom label">
<EuiFieldText
placeholder="Custom label"
value={singleField.custom_label}
onChange={(e) => onCustomLabelChange(e, index, sectionName)}
aria-label="Use aria labels when no actual label is in use"
const getCommonUI = (lists, sectionName: string) => lists.map((singleField, index: number) => (
<>
<div key={index} className="services">
<div className="first-division">
<EuiPanel color="subdued">
<EuiFormRow
label="Aggregation"
labelAppend={
lists.length !== 1 && (
<EuiText size="xs">
<EuiIcon type="cross" color="danger" onClick={() => handleServiceRemove(index, sectionName)} />
</EuiText>
)
}
>
<EuiComboBox
aria-label="Accessible screen reader label"
placeholder="Select a aggregation"
singleSelection={{ asPlainText: true }}
options={AGGREGATION_OPTIONS}
selectedOptions={singleField.aggregation ? [{ 'label': singleField.aggregation }] : []}
onChange={(e) => updateList(e.length > 0 ? e[0].label : '', index, sectionName, 'aggregation')}
/>

</EuiFormRow>
<EuiFormRow
label="Field"
>
<EuiComboBox
aria-label="Accessible screen reader label"
placeholder="Select a field"
singleSelection={{ asPlainText: true }}
options={fieldOptionList}
selectedOptions={singleField.label ? [{ 'label': singleField.label }] : []}
onChange={(e) => updateList(e.length > 0 ? e[0].label : '', index, sectionName, 'label')}
/>
</EuiFormRow>

<EuiFormRow
label="Custom label"
>
<EuiFieldText
placeholder="Custom label"
value={singleField.custom_label}
onChange={(e) => updateList(e.target.value, index, sectionName, 'custom_label')}
aria-label="Use aria labels when no actual label is in use" />
</EuiFormRow>

{sectionName === 'metrics' && visualizations.vis.name === visChartTypes.Line && (
<EuiFormRow label="Side">
<ButtonGroupItem
legend="Side"
groupOptions={[{ id: 'left', label: 'Left' }, { id: 'right', label: 'Right' }]}
idSelected={index === 0 ? 'left' : singleField.side || "right"}
handleButtonChange={(id: string) => updateList(id, index, sectionName, 'side')}
/>
</EuiFormRow>

{sectionName === 'metrics' && visualizations.vis.name === visChartTypes.Line && (
<EuiFormRow label="Side">
<ButtonGroupItem
legend="Side"
groupOptions={[
{ id: 'left', label: 'Left' },
{ id: 'right', label: 'Right' },
]}
idSelected="left"
handleButtonChange={(id: string) =>
handleSideChange(id, value, index, sectionName)
}
/>
</EuiFormRow>
)}

<EuiSpacer size="s" />
{lists.length - 1 === index && (
<EuiFlexItem grow={true}>
<EuiButton
fullWidth
iconType="plusInCircleFilled"
color="primary"
onClick={() => handleServiceAdd(sectionName)}
>
Add
</EuiButton>
</EuiFlexItem>
)}
</EuiPanel>
</div>
)}

<EuiSpacer size="s" />
{lists.length - 1 === index &&
<EuiFlexItem grow={true}>
<EuiButton
fullWidth
iconType="plusInCircleFilled"
color='primary'
onClick={() => handleServiceAdd(sectionName)}
>
Add
</EuiButton>
</EuiFlexItem>
}
</EuiPanel>
</div>
<EuiSpacer size="s" />
</>
));
</div>
<EuiSpacer size="s" />
</>
))

return (
<>
<EuiTitle size="xxs">
<h3>Data Configurations</h3>
<h3>Data Cofigurations</h3>
</EuiTitle>
<EuiSpacer size="s" />
<EuiTitle size="xxs">
@@ -230,4 +204,4 @@ export const DataConfigPanelItem = ({ fieldOptionList, visualizations, tabID }:
</EuiFlexItem>
</>
);
};
};
Original file line number Diff line number Diff line change
@@ -9,10 +9,9 @@ import { Plt } from '../../plotly/plot';
import { AvailabilityUnitType } from '../../../event_analytics/explorer/visualizations/config_panel/config_panes/config_controls/config_availability';
import { ThresholdUnitType } from '../../../event_analytics/explorer/visualizations/config_panel/config_panes/config_controls/config_thresholds';
import { DefaultChartStyles, FILLOPACITY_DIV_FACTOR, PLOTLY_COLOR } from '../../../../../common/constants/shared';
import { hexToRgba } from '../../../../components/event_analytics/utils/utils';
import { hexToRgb } from '../../../../components/event_analytics/utils/utils';

export const Line = ({ visualizations, layout, config }: any) => {
console.log("visualizations:################:", visualizations);
const { DefaultMode, Interpolation, LineWidth, FillOpacity, MarkerSize, LegendPosition, ShowLegend } = DefaultChartStyles;
const {
data = {},
@@ -34,7 +33,7 @@ export const Line = ({ visualizations, layout, config }: any) => {
const mode = dataConfig?.chartStyles?.style || DefaultMode;
const lineShape = dataConfig?.chartStyles?.interpolation || Interpolation;
const lineWidth = dataConfig?.chartStyles?.lineWidth || LineWidth;
const showLegend = dataConfig?.legend?.showLegend && dataConfig.legend.showLegend !== ShowLegend ? false : true;
const showLegend = !(dataConfig?.legend?.showLegend && dataConfig.legend.showLegend !== ShowLegend);
const legendPosition = dataConfig?.legend?.position || LegendPosition;
const markerSize = dataConfig?.chartStyles?.pointSize || MarkerSize;
const fillOpacity = dataConfig?.chartStyles?.fillOpacity !== undefined ? dataConfig?.chartStyles?.fillOpacity / FILLOPACITY_DIV_FACTOR : FillOpacity / FILLOPACITY_DIV_FACTOR;
@@ -51,7 +50,7 @@ export const Line = ({ visualizations, layout, config }: any) => {
const isBarMode = mode === 'bar';

let calculatedLineValues = valueSeries.map((field: any, index: number) => {
const fillColor = hexToRgba(PLOTLY_COLOR[index % PLOTLY_COLOR.length], fillOpacity);
const fillColor = hexToRgb(PLOTLY_COLOR[index % PLOTLY_COLOR.length], fillOpacity);
const barMarker = {
color: fillColor,
line: {