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

[fix]: Remove redux-form dependency from Monitor page #2562

Merged
merged 5 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,11 @@ exports[`<MonitorATMServicesView> ATM snapshot test 1`] = `
>
Service
</h2>
<Field
component={[Function]}
name="service"
<SearchableSelect
className="select-a-service-input"
onChange={[Function]}
placeholder="Select A Service"
props={
Object {
"className": "select-a-service-input",
"disabled": null,
"loading": null,
"value": "s1",
}
}
value="s1"
>
<Option
key="s1"
Expand All @@ -40,7 +32,7 @@ exports[`<MonitorATMServicesView> ATM snapshot test 1`] = `
>
s2
</Option>
</Field>
</SearchableSelect>
</Col>
<Col
span={6}
Expand All @@ -50,20 +42,11 @@ exports[`<MonitorATMServicesView> ATM snapshot test 1`] = `
>
Span Kind
</h2>
<Field
component={[Function]}
name="spanKind"
<SearchableSelect
className="span-kind-selector"
onChange={[Function]}
placeholder="Select A Span Kind"
props={
Object {
"className": "span-kind-selector",
"defaultValue": "server",
"disabled": null,
"loading": null,
"value": "server",
}
}
value="server"
>
<Option
key="client"
Expand Down Expand Up @@ -95,7 +78,7 @@ exports[`<MonitorATMServicesView> ATM snapshot test 1`] = `
>
Consumer
</Option>
</Field>
</SearchableSelect>
</Col>
</Row>
<Row
Expand Down Expand Up @@ -124,23 +107,11 @@ exports[`<MonitorATMServicesView> ATM snapshot test 1`] = `
className="timeframe-selector"
span={8}
>
<Field
component={[Function]}
name="timeframe"
<SearchableSelect
className="select-a-timeframe-input"
onChange={[Function]}
placeholder="Select A Timeframe"
props={
Object {
"className": "select-a-timeframe-input",
"defaultValue": Object {
"label": "Last Hour",
"value": 3600000,
},
"disabled": null,
"loading": null,
"value": 3600000,
}
}
value={3600000}
>
<Option
key="300000"
Expand Down Expand Up @@ -196,7 +167,7 @@ exports[`<MonitorATMServicesView> ATM snapshot test 1`] = `
>
Last 2 days
</Option>
</Field>
</SearchableSelect>
</Col>
</Row>
<Row>
Expand Down Expand Up @@ -443,7 +414,6 @@ exports[`<MonitorATMServicesView> ATM snapshot test 1`] = `
"opsLatencies": null,
}
}
loading={null}
lookback={3600000}
serviceName="s1"
/>
Expand Down Expand Up @@ -486,19 +456,11 @@ exports[`<MonitorATMServicesView> ATM snapshot test with no metrics 1`] = `
>
Service
</h2>
<Field
component={[Function]}
name="service"
<SearchableSelect
className="select-a-service-input"
onChange={[Function]}
placeholder="Select A Service"
props={
Object {
"className": "select-a-service-input",
"disabled": null,
"loading": null,
"value": "s1",
}
}
value="s1"
/>
</Col>
<Col
Expand All @@ -509,20 +471,11 @@ exports[`<MonitorATMServicesView> ATM snapshot test with no metrics 1`] = `
>
Span Kind
</h2>
<Field
component={[Function]}
name="spanKind"
<SearchableSelect
className="span-kind-selector"
onChange={[Function]}
placeholder="Select A Span Kind"
props={
Object {
"className": "span-kind-selector",
"defaultValue": "server",
"disabled": null,
"loading": null,
"value": "server",
}
}
value="server"
>
<Option
key="client"
Expand Down Expand Up @@ -554,7 +507,7 @@ exports[`<MonitorATMServicesView> ATM snapshot test with no metrics 1`] = `
>
Consumer
</Option>
</Field>
</SearchableSelect>
</Col>
</Row>
<Row
Expand Down Expand Up @@ -583,23 +536,11 @@ exports[`<MonitorATMServicesView> ATM snapshot test with no metrics 1`] = `
className="timeframe-selector"
span={8}
>
<Field
component={[Function]}
name="timeframe"
<SearchableSelect
className="select-a-timeframe-input"
onChange={[Function]}
placeholder="Select A Timeframe"
props={
Object {
"className": "select-a-timeframe-input",
"defaultValue": Object {
"label": "Last Hour",
"value": 3600000,
},
"disabled": null,
"loading": null,
"value": 3600000,
}
}
value={3600000}
>
<Option
key="300000"
Expand Down Expand Up @@ -655,7 +596,7 @@ exports[`<MonitorATMServicesView> ATM snapshot test with no metrics 1`] = `
>
Last 2 days
</Option>
</Field>
</SearchableSelect>
</Col>
</Row>
<Row>
Expand Down Expand Up @@ -821,7 +762,6 @@ exports[`<MonitorATMServicesView> ATM snapshot test with no metrics 1`] = `
"opsLatencies": null,
}
}
loading={null}
lookback={3600000}
serviceName="s1"
/>
Expand Down Expand Up @@ -864,19 +804,11 @@ exports[`<MonitorATMServicesView> render one service latency 1`] = `
>
Service
</h2>
<Field
component={[Function]}
name="service"
<SearchableSelect
className="select-a-service-input"
onChange={[Function]}
placeholder="Select A Service"
props={
Object {
"className": "select-a-service-input",
"disabled": null,
"loading": null,
"value": "s1",
}
}
value="s1"
/>
</Col>
<Col
Expand All @@ -887,20 +819,11 @@ exports[`<MonitorATMServicesView> render one service latency 1`] = `
>
Span Kind
</h2>
<Field
component={[Function]}
name="spanKind"
<SearchableSelect
className="span-kind-selector"
onChange={[Function]}
placeholder="Select A Span Kind"
props={
Object {
"className": "span-kind-selector",
"defaultValue": "server",
"disabled": null,
"loading": null,
"value": "server",
}
}
value="server"
>
<Option
key="client"
Expand Down Expand Up @@ -932,7 +855,7 @@ exports[`<MonitorATMServicesView> render one service latency 1`] = `
>
Consumer
</Option>
</Field>
</SearchableSelect>
</Col>
</Row>
<Row
Expand Down Expand Up @@ -961,23 +884,11 @@ exports[`<MonitorATMServicesView> render one service latency 1`] = `
className="timeframe-selector"
span={8}
>
<Field
component={[Function]}
name="timeframe"
<SearchableSelect
className="select-a-timeframe-input"
onChange={[Function]}
placeholder="Select A Timeframe"
props={
Object {
"className": "select-a-timeframe-input",
"defaultValue": Object {
"label": "Last Hour",
"value": 3600000,
},
"disabled": null,
"loading": null,
"value": 3600000,
}
}
value={3600000}
>
<Option
key="300000"
Expand Down Expand Up @@ -1033,7 +944,7 @@ exports[`<MonitorATMServicesView> render one service latency 1`] = `
>
Last 2 days
</Option>
</Field>
</SearchableSelect>
</Col>
</Row>
<Row>
Expand Down Expand Up @@ -1200,7 +1111,6 @@ exports[`<MonitorATMServicesView> render one service latency 1`] = `
"opsLatencies": null,
}
}
loading={null}
lookback={3600000}
serviceName="s1"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,7 @@ describe('<MonitorATMServicesView>', () => {

it('should update state after choosing a new timeframe', () => {
const firstGraphXDomain = wrapper.state().graphXDomain;
wrapper.setProps({
selectedTimeFrame: 3600000 * 2,
});
wrapper.instance().handleTimeFrameChange(3600000 * 2);

expect(wrapper.state().graphXDomain).not.toBe(firstGraphXDomain);
});
Expand Down Expand Up @@ -308,13 +306,13 @@ describe('<MonitorATMServicesView>', () => {
wrapper.find('Search').simulate('change', { target: { value: newValue } });
expect(trackSearchOperationSpy).toHaveBeenCalledWith(newValue);

wrapper.find('Field').first().simulate('change', null, newValue);
wrapper.find('SearchableSelect').first().prop('onChange')(newValue);
expect(trackSelectServiceSpy).toHaveBeenCalledWith(newValue);

wrapper.find({ name: 'spanKind' }).simulate('change', null, spanKindOption.value);
wrapper.find('.span-kind-selector').prop('onChange')(spanKindOption.value);
expect(trackSelectSpanKindSpy).toHaveBeenCalledWith(spanKindOption.label);

wrapper.find('Field').last().simulate('change', null, timeFrameOption.value);
wrapper.find('SearchableSelect').last().prop('onChange')(timeFrameOption.value);
expect(trackSelectTimeframeSpy).toHaveBeenCalledWith(timeFrameOption.label);

wrapper.find({ children: 'View all traces' }).simulate('click');
Expand Down Expand Up @@ -367,9 +365,6 @@ describe('mapStateToProps()', () => {
expect(mapStateToProps(state)).toEqual({
metrics: originInitialState,
services: [],
selectedService: 's1',
selectedSpanKind: 'server',
selectedTimeFrame: 3600000,
});
});
});
Expand Down
Loading
Loading