This eliminates the use of YAML configuration and instead
relies on a simple property to enable `readOnly` mode, per code review feedback.
Signed-off-by: Mike Ball <mikedball@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>
In instances where a `splunk.com/on-call-routing-key`
is provided and that routing key is associated with
multiple teams, the component now renders an individual
Splunk On-Call card for each team.
Signed-off-by: Mike Ball <mikedball@gmail.com>
Extends the Splunk On Call plugin Entity card to infer the
corresponding team names from a `splunk.com/on-call-routing-key`
annotation.
This seeks to enable the use of the Splunk On Call plugin on
entity pages for those orgs who associate a component with a
routing key rather than a team name.
Signed-off-by: Mike Ball <mikedball@gmail.com>