From 2b41e9397486c1fb1bcc2b137c605e1282d9487a Mon Sep 17 00:00:00 2001 From: Chris James Date: Mon, 31 Jul 2023 16:43:53 -0700 Subject: [PATCH 1/6] Adding the ability to not render the change events tab for the PD card when viewing an entity Signed-off-by: Chris James --- .../components/EntityPagerDutyCard/index.tsx | 11 +++++++++-- .../src/components/PagerDutyCard/index.tsx | 19 ++++++++++++------- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/plugins/pagerduty/src/components/EntityPagerDutyCard/index.tsx b/plugins/pagerduty/src/components/EntityPagerDutyCard/index.tsx index 50e6f3a096..b252069b90 100644 --- a/plugins/pagerduty/src/components/EntityPagerDutyCard/index.tsx +++ b/plugins/pagerduty/src/components/EntityPagerDutyCard/index.tsx @@ -30,12 +30,19 @@ export const isPluginApplicableToEntity = (entity: Entity) => /** @public */ export type EntityPagerDutyCardProps = { readOnly?: boolean; + disableChangeEvents?: boolean; }; /** @public */ export const EntityPagerDutyCard = (props: EntityPagerDutyCardProps) => { - const { readOnly } = props; + const { readOnly, disableChangeEvents } = props; const { entity } = useEntity(); const pagerDutyEntity = getPagerDutyEntity(entity); - return ; + return ( + + ); }; diff --git a/plugins/pagerduty/src/components/PagerDutyCard/index.tsx b/plugins/pagerduty/src/components/PagerDutyCard/index.tsx index bb89865c5f..a10dc1984b 100644 --- a/plugins/pagerduty/src/components/PagerDutyCard/index.tsx +++ b/plugins/pagerduty/src/components/PagerDutyCard/index.tsx @@ -46,11 +46,12 @@ const BasicCard = ({ children }: { children: ReactNode }) => ( /** @public */ export type PagerDutyCardProps = PagerDutyEntity & { readOnly?: boolean; + disableChangeEvents?: boolean; }; /** @public */ export const PagerDutyCard = (props: PagerDutyCardProps) => { - const { readOnly, integrationKey, name } = props; + const { readOnly, disableChangeEvents, integrationKey, name } = props; const api = useApi(pagerDutyApiRef); const [refreshIncidents, setRefreshIncidents] = useState(false); const [refreshChangeEvents, setRefreshChangeEvents] = @@ -169,12 +170,16 @@ export const PagerDutyCard = (props: PagerDutyCardProps) => { refreshIncidents={refreshIncidents} /> - - - + <> + {disableChangeEvents === true && ( + + + + )} + From e33e07547ec592c5e03970b7dd844b5e53faaa20 Mon Sep 17 00:00:00 2001 From: Chris James Date: Mon, 31 Jul 2023 16:46:06 -0700 Subject: [PATCH 2/6] Fix conditional Signed-off-by: Chris James --- plugins/pagerduty/src/components/PagerDutyCard/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/pagerduty/src/components/PagerDutyCard/index.tsx b/plugins/pagerduty/src/components/PagerDutyCard/index.tsx index a10dc1984b..332d823f1f 100644 --- a/plugins/pagerduty/src/components/PagerDutyCard/index.tsx +++ b/plugins/pagerduty/src/components/PagerDutyCard/index.tsx @@ -171,7 +171,7 @@ export const PagerDutyCard = (props: PagerDutyCardProps) => { /> <> - {disableChangeEvents === true && ( + {disableChangeEvents !== true && ( Date: Mon, 31 Jul 2023 17:00:30 -0700 Subject: [PATCH 3/6] Adding api report Signed-off-by: Chris James --- plugins/pagerduty/api-report.md | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/pagerduty/api-report.md b/plugins/pagerduty/api-report.md index dd24aa9bec..f398a6bee7 100644 --- a/plugins/pagerduty/api-report.md +++ b/plugins/pagerduty/api-report.md @@ -22,6 +22,7 @@ export const EntityPagerDutyCard: ( // @public (undocumented) export type EntityPagerDutyCardProps = { readOnly?: boolean; + disableChangeEvents?: boolean; }; // @public (undocumented) From 5003fc9667415e744ea28ef16b1959170aa1cf46 Mon Sep 17 00:00:00 2001 From: Chris James Date: Tue, 1 Aug 2023 10:35:07 -0700 Subject: [PATCH 4/6] Add changeset for changes Signed-off-by: Chris James --- .changeset/clever-adults-add.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/clever-adults-add.md diff --git a/.changeset/clever-adults-add.md b/.changeset/clever-adults-add.md new file mode 100644 index 0000000000..940b82474e --- /dev/null +++ b/.changeset/clever-adults-add.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-pagerduty': minor +--- + +Add new 'disableChangeEvents' attribute to PagerDuty Card to hide the Change Events tab and disable fetching of chang events for a the service. From 365b0125c05156fff4beb8f6cc5322fb97f89325 Mon Sep 17 00:00:00 2001 From: Chris James Date: Tue, 1 Aug 2023 10:36:24 -0700 Subject: [PATCH 5/6] Update clever-adults-add.md Signed-off-by: Chris James --- .changeset/clever-adults-add.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/clever-adults-add.md b/.changeset/clever-adults-add.md index 940b82474e..c5ca2de902 100644 --- a/.changeset/clever-adults-add.md +++ b/.changeset/clever-adults-add.md @@ -2,4 +2,4 @@ '@backstage/plugin-pagerduty': minor --- -Add new 'disableChangeEvents' attribute to PagerDuty Card to hide the Change Events tab and disable fetching of chang events for a the service. +Add new 'disableChangeEvents' attribute to PagerDuty Card to hide the Change Events tab and disable fetching of change events for the PagerDuty service. From 64afdacfd4e23d455b7330c2089f2a8665178b08 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Sat, 12 Aug 2023 14:56:53 +0200 Subject: [PATCH 6/6] Update .changeset/clever-adults-add.md Signed-off-by: Patrik Oldsberg --- .changeset/clever-adults-add.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.changeset/clever-adults-add.md b/.changeset/clever-adults-add.md index c5ca2de902..7da5dda4d0 100644 --- a/.changeset/clever-adults-add.md +++ b/.changeset/clever-adults-add.md @@ -1,5 +1,5 @@ --- -'@backstage/plugin-pagerduty': minor +'@backstage/plugin-pagerduty': patch --- -Add new 'disableChangeEvents' attribute to PagerDuty Card to hide the Change Events tab and disable fetching of change events for the PagerDuty service. +Add new `disableChangeEvents` prop to `EntityPagerDutyCard` to hide the Change Events tab and disable fetching of change events for the PagerDuty service.