Commit Graph

84 Commits

Author SHA1 Message Date
Fredrik Adelöw 3ec16d2c41 splunk-on-call
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2022-08-19 12:25:57 +02:00
Mike Ball 43c779a38b improve EntitySplunkOnCallCard props
* export the props
* rename the props to match component,
* unpack the props inside the function
* mark both with `/** public */`

...per code review feedback here:
https://github.com/backstage/backstage/pull/9635#discussion_r813155577

Signed-off-by: Mike Ball <mikedball@gmail.com>
2022-02-23 15:46:29 -05:00
Mike Ball 2a7b83c8aa simplify component rendering logic
Per feedback here:
https://github.com/backstage/backstage/pull/9635#discussion_r813156878

Signed-off-by: Mike Ball <mikedball@gmail.com>
2022-02-23 15:27:59 -05:00
Mike Ball 7b45dd6f92 restore accidentally-committed change
This restores `eventsRestEndpoint` to its proper state.

Signed-off-by: Mike Ball <mikedball@gmail.com>
2022-02-23 15:23:09 -05:00
Mike Ball 262a2a2d51 configure readOnly via simple component prop
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>
2022-02-22 12:05:10 -05:00
Mike Ball 9a33293425 address lint errors
Signed-off-by: Mike Ball <mikedball@gmail.com>
2022-02-17 17:07:44 -05:00
Mike Ball 15884c25f6 enable 'read only' mode Splunk OnCall option
This exposes a `splunkOnCall.readOnly` configuration
option to address issue #9634

Signed-off-by: Mike Ball <mikedball@gmail.com>
2022-02-17 16:31:47 -05:00
Mike Ball 9552df7653 test reflects occurrence of single 'Missing Annotation'
Signed-off-by: Mike Ball <mikedball@gmail.com>
2022-02-07 15:59:32 -05:00
Mike Ball 04365cd213 display only 1 <MissingAnnotationEmptyState />
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>
2022-02-07 15:59:32 -05:00
Mike Ball 1514d8a313 Update plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx
Co-authored-by: Johan Haals <johan.haals@gmail.com>
Signed-off-by: Mike Ball <mikedball@gmail.com>
2022-02-07 15:59:27 -05:00
Mike Ball da9d1723f6 invalid annotation logic better reflects component logic
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>
2022-02-07 15:56:09 -05:00
Mike Ball 12182960f4 address TypeScript compilation failure
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>
2022-02-07 15:56:09 -05:00
Mike Ball 5669e32ac1 test component rendering w/ new annotation
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>
2022-02-07 15:56:09 -05:00
Mike Ball 07ffc7ca9d test when no Splunk On Call annotations are provided
Signed-off-by: Mike Ball <mikedball@gmail.com>
2022-02-07 15:56:09 -05:00
Mike Ball 4bda7d3045 test warning for incorrect routing key annotation
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>
2022-02-07 15:56:08 -05:00
Mike Ball 7fa7857d48 correct incorrect team annotation test
Signed-off-by: Mike Ball <mikedball@gmail.com>
2022-02-07 15:56:08 -05:00
Mike Ball f408cabe8f handle invalid Splunk On-Call annotations
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>
2022-02-07 15:56:08 -05:00
Mike Ball 52bb1807db properly render <Missing* /> components
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>
2022-02-07 15:56:08 -05:00
Mike Ball 0dfbb30a5d add 1em spacing between each Splunk On-Call card
Signed-off-by: Mike Ball <mikedball@gmail.com>
2022-02-07 15:56:08 -05:00
Mike Ball 4c61bc0cfa render Splunk On-Call card per team
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>
2022-02-07 15:56:08 -05:00
Mike Ball 70903de879 [wip] support 'splunk.com/on-call-routing-key' annotation
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>
2022-02-07 15:56:08 -05:00
Mike Ball 63e0e3a70d correct spelling of 'Acknowledge' in tooltip
Correct the spelling of 'Acknowledge' in the
Splunk On Call plugin tooltip title.

Signed-off-by: Mike Ball <mikedball@gmail.com>
2022-02-03 08:36:26 -05:00
Fredrik Adelöw 013301e07b remove node-fetch from frontend packages
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2022-01-18 09:41:01 +01:00
Patrik Oldsberg 51fbedc445 plugins: migrate usage of deprecated IdentityApi methods
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2022-01-13 19:51:30 +01:00
Lorenzo Orsatti 7612e2856b clean up emptystate.svg
Signed-off-by: Lorenzo Orsatti <49567430+lorsatti@users.noreply.github.com>
2022-01-05 03:28:11 +01:00
Patrik Oldsberg 4ce51ab0f1 use precise imports of react-use
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2021-12-30 12:53:16 +01:00
Colton Padden 345dcea560 release-2021-06-01 packages/core-plugin-api/src/apis/system/ApiRef.ts:27
Signed-off-by: Colton Padden <colton.padden@fastmail.com>
2021-12-17 15:04:34 -05:00
Patrik Oldsberg 8a96019a39 Merge branch 'master' into rugvip/test-port 2021-11-22 17:33:10 +01:00
Patrik Oldsberg 29ef695410 packages,plugins: migrate to using TestApiProvider and Registry
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2021-11-18 11:28:46 +01:00
blam 1332a98a01 chore: fixing deprecation warnings for all the things that are in the monorepo
Signed-off-by: blam <ben@blam.sh>
2021-11-17 20:24:20 +01:00
Eric Peterson 81a41ec249 Apply extension-names codemod to monorepo.
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
2021-10-04 19:29:43 +02:00
Patrik Oldsberg d0d78ebc7c Merge pull request #7181 from backstage/rugvip/descriptions
Add package descriptions + separate table for plugins in API reference
2021-09-15 17:25:27 +02:00
Patrik Oldsberg 8142a8ecb2 packages,plugins: add package documentation
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2021-09-14 18:47:53 +02:00
Patrik Oldsberg 18826333a7 removed usages of EntityContext in tests and stories
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2021-09-11 15:04:22 +02:00
Fredrik Adelöw 923491eece run prettier formatting
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2021-08-09 11:54:38 +02:00
blam 80f8fc294e chore: some more prettier stuff
Signed-off-by: blam <ben@blam.sh>
2021-08-03 19:03:07 +02:00
Pankaj Patil d56c390e8f Fix All Material UI Warnings
Signed-off-by: Pankaj Patil <pankaj.patil2099@hotmail.com>
2021-08-03 21:49:08 +05:30
Patrik Oldsberg 9258c54f87 Merge branch 'master' into rugvip/mod 2021-06-22 10:07:18 +02:00
Patrik Oldsberg d453c05dc3 apply core-imports codemod to all packages and plugins
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2021-06-19 15:33:08 +02:00
Fredrik Adelöw a88073c29a Update copyright headers
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2021-06-18 20:26:42 +02:00
Heather Lee bfa0908de0 Fix tests
Signed-off-by: Heather Lee <heatherl@splunk.com>
2021-05-25 16:58:09 -07:00
Heather Lee 8eb2c2951c Update the tests to consider on call annotation for team as 'test' to match mock value
Signed-off-by: Heather Lee <heatherl@splunk.com>
2021-05-25 15:49:18 -07:00
Heather Lee 80b5f67e33 Merge branch 'master' of github.com:splunk/backstage into feature/update-splunk-on-call-invalid-team 2021-05-25 15:39:41 -07:00
Heather Lee 0c35f79ed5 Add card to display incorrect team annotation where team does not exist per the API
Signed-off-by: Heather Lee <heatherl@splunk.com>
2021-05-25 15:17:26 -07:00
Tim Hansen 515ce68463 Entity prefix
Signed-off-by: Tim Hansen <timbonicus@gmail.com>
2021-05-18 08:28:03 -06:00
Tim Hansen 8aa0b60257 Composability updates for Splunk On-Call plugin
Signed-off-by: Tim Hansen <timbonicus@gmail.com>
2021-05-18 08:25:39 -06:00
Ben Lambert 10f5ded753 Merge pull request #4719 from ayshiff/feature/splunk-on-call-plugin-rest-endpoint
Splunk On-Call plugin: REST endpoint
2021-03-04 18:46:42 +01:00
Remi 82f0fbddf4 feat(splunk-on-call-plugin): update changeset + theme style
Signed-off-by: Remi <remi.d45@gmail.com>
2021-03-03 21:27:44 +01:00
Remi cc11f4ab8e fix(splunk-on-call-plugin): tsc
Signed-off-by: Remi <remi.d45@gmail.com>
2021-03-03 21:27:44 +01:00
Remi c9a2e78664 fix(splunk-on-call-plugin): fix tests
Signed-off-by: Remi <remi.d45@gmail.com>
2021-03-03 21:27:44 +01:00