-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### Description This PR introduces a new UI to the PagerDutyCard that is used on each Entity Page. This new UI introduces: - official PagerDuty logo - clear visibility on incident status and urgency - service status - service standards - visibility on service metrics (total incidents, high urgency incidents, total number of interruptions) - escalation policy information on the on-call section This PR also updates the behaviour of some components from the PagerDutyCard. - the button to contact the on-call user by email is now removed - the "create incident" button is now completely hidden in case of `read-only` mode, instead of just disabling the button. <img width="1285" alt="image" src="https://github.com/PagerDuty/backstage-plugin/assets/2689939/a137b3e6-ac06-4e8d-9b2f-cdc49ca58781"> ## Acknowledgement By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice. **Disclaimer:** We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.
- Loading branch information
Showing
27 changed files
with
1,624 additions
and
454 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,12 +27,13 @@ export const mockPagerDutyApi: PagerDutyApi = { | |
service: { | ||
name: pagerDutyEntity.name, | ||
id: "SERV1CE1D", | ||
html_url: "www.example.com", | ||
html_url: "https://www.example.com", | ||
escalation_policy: { | ||
id: "ESCALAT1ONP01ICY1D", | ||
name: "ep-one", | ||
html_url: "http://www.example.com/escalation-policy/ESCALAT1ONP01ICY1D", | ||
}, | ||
status: "critical", | ||
}, | ||
}; | ||
}, | ||
|
@@ -42,12 +43,29 @@ export const mockPagerDutyApi: PagerDutyApi = { | |
service: { | ||
name: entity.metadata.name, | ||
id: "SERV1CE1D", | ||
html_url: "www.example.com", | ||
html_url: "https://www.example.com", | ||
escalation_policy: { | ||
id: "ESCALAT1ONP01ICY1D", | ||
name: "ep-one", | ||
html_url: "http://www.example.com/escalation-policy/ESCALAT1ONP01ICY1D", | ||
}, | ||
status: "warning", | ||
}, | ||
}; | ||
}, | ||
|
||
async getServiceById(serviceId: string) { | ||
return { | ||
service: { | ||
name: "SERV1CENAME", | ||
id: serviceId, | ||
html_url: "https://www.example.com", | ||
escalation_policy: { | ||
id: "ESCALAT1ONP01ICY1D", | ||
name: "ep-one", | ||
html_url: "http://www.example.com/escalation-policy/ESCALAT1ONP01ICY1D", | ||
}, | ||
status: "warning", | ||
}, | ||
}; | ||
}, | ||
|
@@ -57,7 +75,8 @@ export const mockPagerDutyApi: PagerDutyApi = { | |
return { | ||
id: '123', | ||
title: title, | ||
status: 'acknowledged', | ||
urgency: 'low', | ||
status: 'triggered', | ||
html_url: 'http://incident', | ||
assignments: [ | ||
{ | ||
|
@@ -72,6 +91,7 @@ export const mockPagerDutyApi: PagerDutyApi = { | |
id: serviceId, | ||
summary: 'service summary', | ||
html_url: 'http://service', | ||
status: 'warning', | ||
}, | ||
created_at: '2015-10-06T21:30:42Z', | ||
} as PagerDutyIncident; | ||
|
@@ -111,15 +131,55 @@ export const mockPagerDutyApi: PagerDutyApi = { | |
}; | ||
}, | ||
|
||
async getServiceStandardsByServiceId(serviceId: string) { | ||
const standards = () => { | ||
return { | ||
resource_id: serviceId, | ||
resource_type: 'technical_service', | ||
score: { | ||
total: 1, | ||
passing: 1, | ||
}, | ||
standards: [ | ||
{ | ||
active: true, | ||
id: '123', | ||
name: 'Service has a description', | ||
description: 'A description provides critical context about what a service represents or is used for to inform team members and responders. The description should be kept concise and understandable by those without deep knowledge of the service.', | ||
pass: true, | ||
type: 'has_technical_service_description' | ||
}, | ||
], | ||
} | ||
}; | ||
|
||
return { | ||
standards: standards(), | ||
} | ||
}, | ||
|
||
async getServiceMetricsByServiceId(serviceId: string) { | ||
return { | ||
metrics: [ | ||
{ | ||
service_id: serviceId, | ||
total_incident_count: 6, | ||
total_high_urgency_incidents: 3, | ||
total_interruptions: 2, | ||
}, | ||
] | ||
} | ||
}, | ||
|
||
async getOnCallByPolicyId() { | ||
const oncall = (id: string, name: string) => { | ||
return { | ||
id: id, | ||
name: name, | ||
html_url: 'http://assignee', | ||
summary: 'summary', | ||
email: '[email protected]', | ||
avatar_url: 'http://avatar', | ||
id: id, | ||
name: name, | ||
html_url: 'http://assignee', | ||
summary: 'summary', | ||
email: '[email protected]', | ||
avatar_url: 'http://avatar', | ||
}; | ||
}; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,8 @@ | |
"name": "@pagerduty/backstage-plugin", | ||
"description": "A Backstage plugin that integrates towards PagerDuty", | ||
"version": "NPM_PACKAGE_VERSION", | ||
"main": "src/index.ts", | ||
"types": "src/index.ts", | ||
"main": "dist/index.esm.js", | ||
"types": "dist/index.d.ts", | ||
"license": "Apache-2.0", | ||
"publishConfig": { | ||
"access": "public", | ||
|
@@ -45,10 +45,11 @@ | |
"@material-ui/lab": "4.0.0-alpha.61", | ||
"classnames": "^2.2.6", | ||
"luxon": "^3.4.1", | ||
"react-use": "^17.2.4" | ||
"react-use": "^17.2.4", | ||
"validate-color": "^2.2.4" | ||
}, | ||
"peerDependencies": { | ||
"@pagerduty/backstage-plugin-common": "^0.1.0", | ||
"@pagerduty/backstage-plugin-common": "^0.1.2", | ||
"react": "^16.13.1 || ^17.0.0 || ^18.0.0", | ||
"react-dom": "^16.13.1 || ^17.0.0 || ^18.0.0", | ||
"react-router-dom": "6.0.0-beta.0 || ^6.3.0" | ||
|
@@ -57,10 +58,10 @@ | |
"@backstage/cli": "^0.24.0", | ||
"@backstage/core-app-api": "^1.11.1", | ||
"@backstage/dev-utils": "^1.0.24", | ||
"@backstage/test-utils": "^1.4.5", | ||
"@backstage/test-utils": "^1.5.1", | ||
"@commitlint/cli": "^17.7.1", | ||
"@commitlint/config-conventional": "^17.7.0", | ||
"@pagerduty/backstage-plugin-common": "^0.1.0", | ||
"@pagerduty/backstage-plugin-common": "^0.1.2", | ||
"@testing-library/dom": "^8.0.0", | ||
"@testing-library/jest-dom": "^5.10.1", | ||
"@testing-library/react": "^12.1.3", | ||
|
@@ -81,5 +82,6 @@ | |
"assets/**/*" | ||
], | ||
"configSchema": "config.d.ts", | ||
"packageManager": "[email protected]" | ||
"packageManager": "[email protected]", | ||
"module": "./dist/index.esm.js" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.