Skip to content

Commit

Permalink
Sprint2 code refactoring and warning minimization (opensearch-project…
Browse files Browse the repository at this point in the history
…#904)

* changes to remove for unique key warning on Dom and code refactoring sprint2

Signed-off-by: rinku-kumar-psl <[email protected]>

* snapshot updated

Signed-off-by: rinku-kumar-psl <[email protected]>

* no_results.test.tsx snapshot updated

Signed-off-by: rinku-kumar-psl <[email protected]>

* added empty line at the end of the file

Signed-off-by: rinku-kumar-psl <[email protected]>
# Conflicts:
#	dashboards-observability/public/components/custom_panels/helpers/__tests__/__snapshots__/utils.test.tsx.snap
#	dashboards-observability/public/components/event_analytics/explorer/visualizations/config_panel/__tests__/__snapshots__/config_panel.test.tsx.snap
#	dashboards-observability/public/components/event_analytics/explorer/visualizations/config_panel/config_panes/config_controls/config_thresholds.tsx
#	dashboards-observability/public/components/visualizations/charts/__tests__/__snapshots__/bar.test.tsx.snap
#	dashboards-observability/public/components/visualizations/charts/__tests__/__snapshots__/heatmap.test.tsx.snap
#	dashboards-observability/public/components/visualizations/charts/__tests__/__snapshots__/histogram.test.tsx.snap
#	dashboards-observability/public/components/visualizations/charts/__tests__/__snapshots__/line.test.tsx.snap
#	dashboards-observability/public/components/visualizations/charts/__tests__/__snapshots__/pie.test.tsx.snap
#	dashboards-observability/public/components/visualizations/charts/__tests__/__snapshots__/text.test.tsx.snap
#	dashboards-observability/public/components/visualizations/charts/__tests__/__snapshots__/treemap.test.tsx.snap
#	dashboards-observability/public/components/visualizations/charts/bar/bar_type.ts
#	dashboards-observability/public/components/visualizations/charts/lines/line_type.ts
#	dashboards-observability/public/components/visualizations/charts/maps/treemap_type.ts
#	dashboards-observability/public/components/visualizations/charts/text/text_type.ts
  • Loading branch information
shankha-das committed Aug 10, 2022
2 parents 89d80f5 + 5a18297 commit f8825eb
Show file tree
Hide file tree
Showing 14 changed files with 356 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on: [pull_request, push]
env:
PLUGIN_NAME: dashboards-observability
OPENSEARCH_VERSION: 'main'
OPENSEARCH_PLUGIN_VERSION: 2.1.0.0
OPENSEARCH_PLUGIN_VERSION: 2.2.0.0

jobs:

Expand Down
70 changes: 40 additions & 30 deletions dashboards-observability/common/constants/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ export const pageStyles: CSS.Properties = {
maxWidth: '1130px',
};


export enum visChartTypes {
Bar = 'bar',
HorizontalBar = 'horizontal_bar',
Expand All @@ -88,9 +87,9 @@ export enum visChartTypes {
}

export interface ValueOptionsAxes {
xaxis ?: IField[];
yaxis ?: IField[];
zaxis ?: IField[];
xaxis?: IField[];
yaxis?: IField[];
zaxis?: IField[];
childField?: IField[];
valueField?: IField[];
series?: IField[];
Expand All @@ -99,70 +98,82 @@ export interface ValueOptionsAxes {

export const NUMERICAL_FIELDS = ['short', 'integer', 'long', 'float', 'double'];

export const ENABLED_VIS_TYPES = [visChartTypes.Bar, visChartTypes.HorizontalBar, visChartTypes.Line, visChartTypes.Pie, visChartTypes.HeatMap, visChartTypes.Text, visChartTypes.TreeMap, visChartTypes.Gauge, visChartTypes.Histogram, visChartTypes.Scatter, visChartTypes.LogsView];
export const ENABLED_VIS_TYPES = [
visChartTypes.Bar,
visChartTypes.HorizontalBar,
visChartTypes.Line,
visChartTypes.Pie,
visChartTypes.HeatMap,
visChartTypes.Text,
visChartTypes.TreeMap,
visChartTypes.Gauge,
visChartTypes.Histogram,
visChartTypes.Scatter,
visChartTypes.LogsView,
];

//Live tail constants
export const LIVE_OPTIONS = [
{
label:'5s',
label: '5s',
startTime: 'now-5s',
delayTime: 5000,
},
{
label:'10s',
label: '10s',
startTime: 'now-10s',
delayTime: 10000,
},
{
label:'30s',
label: '30s',
startTime: 'now-30s',
delayTime: 30000,
},
{
label:'1m',
label: '1m',
startTime: 'now-1m',
delayTime: 60000,
},
{
label:'5m',
label: '5m',
startTime: 'now-5m',
delayTime: 60000 * 5,
},
{
label:'15m',
label: '15m',
startTime: 'now-15m',
delayTime: 60000 * 15,
},
{
label:'30m',
label: '30m',
startTime: 'now-30m',
delayTime: 60000 * 30,
},
{
label:'1h',
label: '1h',
startTime: 'now-1h',
delayTime: 60000 * 60,
},
{
label:'2h',
label: '2h',
startTime: 'now-2h',
delayTime: 60000 * 120,
},
];

export const LIVE_END_TIME ='now';
export const LIVE_END_TIME = 'now';
export interface DefaultChartStylesProps {
DefaultModeLine: string,
Interpolation: string,
LineWidth: number,
FillOpacity: number,
MarkerSize: number,
ShowLegend: string,
LegendPosition: string,
LabelAngle: number,
DefaultSortSectors: string,
DefaultModeScatter: string,
};
DefaultModeLine: string;
Interpolation: string;
LineWidth: number;
FillOpacity: number;
MarkerSize: number;
ShowLegend: string;
LegendPosition: string;
LabelAngle: number;
DefaultSortSectors: string;
DefaultModeScatter: string;
}

export const DefaultChartStyles: DefaultChartStylesProps = {
DefaultModeLine: 'lines',
Expand All @@ -174,8 +185,7 @@ export const DefaultChartStyles: DefaultChartStylesProps = {
LegendPosition: 'v',
LabelAngle: 0,
DefaultSortSectors: 'largest_to_smallest',
DefaultModeScatter: 'markers'
}

export const FILLOPACITY_DIV_FACTOR = 200;
DefaultModeScatter: 'markers',
};

export const FILLOPACITY_DIV_FACTOR = 200;
4 changes: 2 additions & 2 deletions dashboards-observability/opensearch_dashboards.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "observabilityDashboards",
"version": "2.1.0.0",
"opensearchDashboardsVersion": "2.1.0",
"version": "2.2.0.0",
"opensearchDashboardsVersion": "2.2.0",
"server": true,
"ui": true,
"requiredPlugins": [
Expand Down
2 changes: 1 addition & 1 deletion dashboards-observability/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "observability-dashboards",
"version": "2.1.0.0",
"version": "2.2.0.0",
"main": "index.ts",
"license": "Apache-2.0",
"scripts": {
Expand Down
Loading

0 comments on commit f8825eb

Please sign in to comment.