Loading can take a pretty long time, and often in several steps, such as "loading builds" followed by "loading pipelines per build".
Signed-off-by: Gustaf Räntilä <g.rantila@gmail.com>
Since loading of build information can take a long time, being able to zoom "client-side", using the fetched data, is very useful.
This is built using a provider (ZoomProvider) which keeps zoom state, simplifies rendering a gray area while zooming and has a filter-function which can filter only values within the zoomed time range.
Signed-off-by: Gustaf Räntilä <g.rantila@gmail.com>
Some refactoring and tweaks. The trigger reason is an overlay to the build counts, and is a percentage of manually triggered builds vs all builds. When this is high, it indicates likelyhood of flaky tests.
Signed-off-by: Gustaf Räntilä <g.rantila@gmail.com>
Per code review feedback, it's arguably unnecessary
to display duplicate `<MissingAnnotationEmptyState />`,
especially given the preceding contextual sentence
noting the supported annotations.
Signed-off-by: Mike Ball <mikedball@gmail.com>
The EntitySplunkOnCallCard gives precedence to a `splunk.com/on-call-team`
annotation. Therefore, the InvalidAnnotation component messaging
should reflect that precedence, even in instances where _both_ supported
annotations are provided and both are deemed invalid.
Signed-off-by: Mike Ball <mikedball@gmail.com>
This fixes...
```
Run yarn tsc
yarn run v1.22.1
$ tsc
plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.test.tsx:158:26 - error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'Matcher'.
Type 'undefined' is not assignable to type 'Matcher'.
158 expect(getByText(MOCK_INCIDENT.entityDisplayName)).toBeInTheDocument(),
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
Signed-off-by: Mike Ball <mikedball@gmail.com>
Test that the Splunk On Call component properly
renders when a `splunk.com/on-call-routing-key`
annotation is used.
Signed-off-by: Mike Ball <mikedball@gmail.com>
This adds a test asserting that the correct component
is rendered when the entity `splunk.com/on-call-routing-key`
does not properly map to any associated teams.
Signed-off-by: Mike Ball <mikedball@gmail.com>
If a `splunk.com/on-call-team` annotation is provided and
the API returns no associated team, render...
```
Splunk On-Call API returned no record of teams associated with the "foo" team name
Escalation Policy and incident information unavailable. Splunk On-Call requires a valid team name or routing key.
```
If a `splunk.com/on-call-routing-key` annotation is provided and
the API returns no associated team, render...
```
Splunk On-Call API returned no record of teams associated with the "foo" routing key
Escalation Policy and incident information unavailable. Splunk On-Call requires a valid team name or routing key.
```
Signed-off-by: Mike Ball <mikedball@gmail.com>
Corrects logic ensuring `<MissingAnnotation />` and `<MissingEventsRestEndpoint />`
render correctly. Previously, neither component would render from
within the `<Content />` component.
Signed-off-by: Mike Ball <mikedball@gmail.com>