Skip to content

Commit

Permalink
unit test cases & removed unnecessary changes
Browse files Browse the repository at this point in the history
Signed-off-by: vvvprabhakar <[email protected]>
  • Loading branch information
vvvprabhakar committed Aug 30, 2021
1 parent 9a78bc5 commit 7328d6c
Showing 1 changed file with 7 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,15 @@ type Props = {
tableValue: ITableSpan[],
wholeTable: ITableSpan[],
valueNameSelector1: string,
valueNameSelector2: string | null,
valueNameSelector4: string | null
valueNameSelector2: string | null
) => void;
};

type State = {
valueNameSelector1: string;
valueNameSelector2: string | null;
valueNameSelector3: string;
valueNameSelector4: string | null;

checkboxStatus: boolean;
};

Expand All @@ -63,21 +62,18 @@ export default class TraceStatisticsHeader extends Component<Props, State> {
getColumnValues('Service Name', this.props.trace),
getColumnValues('Service Name', this.props.trace),
'Service Name',
null,
null
);

this.state = {
valueNameSelector1: 'Service Name',
valueNameSelector2: null,
valueNameSelector4: null,
valueNameSelector3: 'Count',
checkboxStatus: false,
};
this.setValueNameSelector1 = this.setValueNameSelector1.bind(this);
this.setValueNameSelector2 = this.setValueNameSelector2.bind(this);
this.setValueNameSelector3 = this.setValueNameSelector3.bind(this);
this.setValueNameSelector4 = this.setValueNameSelector4.bind(this);
this.checkboxButton = this.checkboxButton.bind(this);
this.clearValue = this.clearValue.bind(this);
}
Expand Down Expand Up @@ -111,7 +107,7 @@ export default class TraceStatisticsHeader extends Component<Props, State> {
this.getValue(),
this.state.checkboxStatus
);
this.props.handler(newTableValue, newWohleTable, value, null, null);
this.props.handler(newTableValue, newWohleTable, value, null);
}

/**
Expand Down Expand Up @@ -141,7 +137,7 @@ export default class TraceStatisticsHeader extends Component<Props, State> {
this.getValue(),
this.state.checkboxStatus
);
this.props.handler(newTableValue, newWohleTable, this.state.valueNameSelector1, value, null);
this.props.handler(newTableValue, newWohleTable, this.state.valueNameSelector1, value);
}

/**
Expand All @@ -162,27 +158,7 @@ export default class TraceStatisticsHeader extends Component<Props, State> {
newTableValue,
newWohleTable,
this.state.valueNameSelector1,
this.state.valueNameSelector2,
this.state.valueNameSelector4
);
}

/**
*
*/
setValueNameSelector4(value: string) {
this.setState({
valueNameSelector4: value,
});
const newTableValue = generateColor(this.props.tableValue, this.getValue(), this.state.checkboxStatus);
const newWholeTable = generateColor(this.props.wholeTable, this.getValue(), this.state.checkboxStatus);

this.props.handler(
newTableValue,
newWholeTable,
this.state.valueNameSelector1,
this.state.valueNameSelector2,
this.state.valueNameSelector4
this.state.valueNameSelector2
);
}

Expand All @@ -200,8 +176,7 @@ export default class TraceStatisticsHeader extends Component<Props, State> {
newTableValue,
newWholeTable,
this.state.valueNameSelector1,
this.state.valueNameSelector2,
this.state.valueNameSelector4
this.state.valueNameSelector2
);
}

Expand All @@ -223,7 +198,7 @@ export default class TraceStatisticsHeader extends Component<Props, State> {
this.getValue(),
this.state.checkboxStatus
);
this.props.handler(newTableValue, newWholeTable, this.state.valueNameSelector1, null, null);
this.props.handler(newTableValue, newWholeTable, this.state.valueNameSelector1, null);
}

render() {
Expand Down Expand Up @@ -253,15 +228,6 @@ export default class TraceStatisticsHeader extends Component<Props, State> {
clearValue={this.clearValue}
required={false}
/>
<NameSelector
label="Span-Group"
placeholder="No item selected"
options={['spanId']}
value={this.state.valueNameSelector4}
setValue={this.setValueNameSelector4}
clearValue={this.clearValue}
required={false}
/>
<div className="colorDropdown--TraceStatisticsHeader">
<NameSelector
label="Color by"
Expand Down

0 comments on commit 7328d6c

Please sign in to comment.