@pagerduty/backstage-plugin 0.15.0-next.16 → 0.15.0-next.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -49,13 +49,13 @@ const PagerDutyPage = () => {
|
|
|
49
49
|
return "disabled";
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
return /* @__PURE__ */ React.createElement(Page, { themeId: "home" }, /* @__PURE__ */ React.createElement(Header, { title: "PagerDuty", subtitle: "Advanced configurations" }), /* @__PURE__ */ React.createElement(Content, null, /* @__PURE__ */ React.createElement(TabbedLayout, null, /* @__PURE__ */ React.createElement(TabbedLayout.Route, { path: "/service-mapping", title: "Service Mapping" }, /* @__PURE__ */ React.createElement(Grid, { container: true, spacing: 3, direction: "column" }, /* @__PURE__ */ React.createElement(Grid, { item: true }, /* @__PURE__ */ React.createElement(Typography, { variant: "body1" }, "Easily map your existing PagerDuty services to entities in Backstage without the need to add anotations to all your projects."), /* @__PURE__ */ React.createElement(Typography, { variant: "body1" }, /* @__PURE__ */ React.createElement("b", null, "Warning: "), "Only 1:1 mapping is allowed at this time.")), /* @__PURE__ */ React.createElement(Grid, { item: true }, /* @__PURE__ */ React.createElement(ServiceMappingComponent, null)))), /* @__PURE__ */ React.createElement(TabbedLayout.Route, { path: "/settings", title: "
|
|
52
|
+
return /* @__PURE__ */ React.createElement(Page, { themeId: "home" }, /* @__PURE__ */ React.createElement(Header, { title: "PagerDuty", subtitle: "Advanced configurations" }), /* @__PURE__ */ React.createElement(Content, null, /* @__PURE__ */ React.createElement(TabbedLayout, null, /* @__PURE__ */ React.createElement(TabbedLayout.Route, { path: "/service-mapping", title: "Service Mapping" }, /* @__PURE__ */ React.createElement(Grid, { container: true, spacing: 3, direction: "column" }, /* @__PURE__ */ React.createElement(Grid, { item: true }, /* @__PURE__ */ React.createElement(Typography, { variant: "body1" }, "Easily map your existing PagerDuty services to entities in Backstage without the need to add anotations to all your projects."), /* @__PURE__ */ React.createElement(Typography, { variant: "body1" }, /* @__PURE__ */ React.createElement("b", null, "Warning: "), "Only 1:1 mapping is allowed at this time.")), /* @__PURE__ */ React.createElement(Grid, { item: true }, /* @__PURE__ */ React.createElement(ServiceMappingComponent, null)))), /* @__PURE__ */ React.createElement(TabbedLayout.Route, { path: "/settings", title: "Configuration" }, /* @__PURE__ */ React.createElement(Grid, { container: true, spacing: 3, direction: "column" }, /* @__PURE__ */ React.createElement(Grid, { item: true }, /* @__PURE__ */ React.createElement(Typography, { variant: "h4" }, "Plugin configuration"), /* @__PURE__ */ React.createElement(Typography, { variant: "body1" }, "Configure your PagerDuty plugin configuration here.")), /* @__PURE__ */ React.createElement(
|
|
53
53
|
Card,
|
|
54
54
|
{
|
|
55
55
|
title: "Service dependency synchronization preferences",
|
|
56
|
-
style: { padding: "10px", width: "50%" }
|
|
56
|
+
style: { padding: "10px", paddingLeft: "15px", width: "50%" }
|
|
57
57
|
},
|
|
58
|
-
/* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Typography, { variant: "h6" }, "Service dependency synchronization strategy"), /* @__PURE__ */ React.createElement(Typography, { variant: "body1" }, "
|
|
58
|
+
/* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Typography, { variant: "h6" }, "Service dependency synchronization strategy"), /* @__PURE__ */ React.createElement(Typography, { variant: "body1" }, "Select the main source of truth for your service dependencies"), /* @__PURE__ */ React.createElement(
|
|
59
59
|
RadioGroup,
|
|
60
60
|
{
|
|
61
61
|
value: selectedServiceDependencyStrategy,
|
|
@@ -96,7 +96,7 @@ const PagerDutyPage = () => {
|
|
|
96
96
|
)),
|
|
97
97
|
/* @__PURE__ */ React.createElement("br", null),
|
|
98
98
|
/* @__PURE__ */ React.createElement("br", null),
|
|
99
|
-
/* @__PURE__ */ React.createElement(Typography, { variant: "body1" }, /* @__PURE__ */ React.createElement("b", null, "Warning: "), "Changing this setting will affect how your service dependencies are synchronized and may cause data loss.")
|
|
99
|
+
/* @__PURE__ */ React.createElement(Typography, { variant: "body1" }, /* @__PURE__ */ React.createElement("b", null, "Warning: "), "Changing this setting will affect how your service dependencies are synchronized and may cause data loss. Check the", /* @__PURE__ */ React.createElement("a", { href: "https://pagerduty.github.io/backstage-plugin-docs/index.html" }, "documentation"), "for more information.")
|
|
100
100
|
))))));
|
|
101
101
|
};
|
|
102
102
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../../../src/components/PagerDutyPage/index.tsx"],"sourcesContent":["import React, { useEffect, useState } from \"react\";\nimport {\n Card,\n FormControlLabel,\n Grid,\n Radio,\n RadioGroup,\n Typography,\n} from \"@material-ui/core\";\nimport {\n Header,\n Page,\n Content,\n TabbedLayout,\n} from \"@backstage/core-components\";\nimport { ServiceMappingComponent } from \"./ServiceMappingComponent\";\nimport { useApi } from \"@backstage/core-plugin-api\";\nimport { pagerDutyApiRef } from \"../../api\";\nimport { NotFoundError } from \"@backstage/errors\";\n\nconst SERVICE_DEPENDENCY_SYNC_STRATEGY =\n \"settings::service-dependency-sync-strategy\";\n\n/** @public */\nexport const PagerDutyPage = () => {\n const pagerDutyApi = useApi(pagerDutyApiRef);\n const [\n selectedServiceDependencyStrategy,\n setSelectedServiceDependencyStrategy,\n ] = useState(\"disabled\");\n\n useEffect(() => {\n function fetchSetting() {\n pagerDutyApi\n .getSetting(SERVICE_DEPENDENCY_SYNC_STRATEGY)\n .then((result) => {\n if (result !== undefined) {\n setSelectedServiceDependencyStrategy(result.value);\n }\n })\n .catch((error) => {\n if (error instanceof NotFoundError) {\n // If the setting is not found, set the default value to \"disabled\"\n setSelectedServiceDependencyStrategy(\"disabled\");\n }\n });\n }\n\n fetchSetting();\n }, [pagerDutyApi]);\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n const value = getSelectedValue((event.target as HTMLInputElement).value);\n\n setSelectedServiceDependencyStrategy(value);\n\n pagerDutyApi.storeSettings([\n {\n id: SERVICE_DEPENDENCY_SYNC_STRATEGY,\n value,\n },\n ]);\n };\n\n function getSelectedValue(\n value: string\n ): \"backstage\" | \"pagerduty\" | \"both\" | \"disabled\" {\n switch (value) {\n case \"backstage\":\n return \"backstage\";\n case \"pagerduty\":\n return \"pagerduty\";\n case \"both\":\n return \"both\";\n default:\n return \"disabled\";\n }\n }\n\n return (\n <Page themeId=\"home\">\n <Header title=\"PagerDuty\" subtitle=\"Advanced configurations\" />\n <Content>\n <TabbedLayout>\n <TabbedLayout.Route path=\"/service-mapping\" title=\"Service Mapping\">\n <Grid container spacing={3} direction=\"column\">\n <Grid item>\n {/* <Typography variant=\"h4\">Service to Entity mapping</Typography> */}\n <Typography variant=\"body1\">\n Easily map your existing PagerDuty services to entities in\n Backstage without the need to add anotations to all your\n projects.\n </Typography>\n <Typography variant=\"body1\">\n <b>Warning: </b>Only 1:1 mapping is allowed at this time.\n </Typography>\n </Grid>\n <Grid item>\n <ServiceMappingComponent />\n </Grid>\n </Grid>\n </TabbedLayout.Route>\n <TabbedLayout.Route path=\"/settings\" title=\"
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../../../src/components/PagerDutyPage/index.tsx"],"sourcesContent":["import React, { useEffect, useState } from \"react\";\nimport {\n Card,\n FormControlLabel,\n Grid,\n Radio,\n RadioGroup,\n Typography,\n} from \"@material-ui/core\";\nimport {\n Header,\n Page,\n Content,\n TabbedLayout,\n} from \"@backstage/core-components\";\nimport { ServiceMappingComponent } from \"./ServiceMappingComponent\";\nimport { useApi } from \"@backstage/core-plugin-api\";\nimport { pagerDutyApiRef } from \"../../api\";\nimport { NotFoundError } from \"@backstage/errors\";\n\nconst SERVICE_DEPENDENCY_SYNC_STRATEGY =\n \"settings::service-dependency-sync-strategy\";\n\n/** @public */\nexport const PagerDutyPage = () => {\n const pagerDutyApi = useApi(pagerDutyApiRef);\n const [\n selectedServiceDependencyStrategy,\n setSelectedServiceDependencyStrategy,\n ] = useState(\"disabled\");\n\n useEffect(() => {\n function fetchSetting() {\n pagerDutyApi\n .getSetting(SERVICE_DEPENDENCY_SYNC_STRATEGY)\n .then((result) => {\n if (result !== undefined) {\n setSelectedServiceDependencyStrategy(result.value);\n }\n })\n .catch((error) => {\n if (error instanceof NotFoundError) {\n // If the setting is not found, set the default value to \"disabled\"\n setSelectedServiceDependencyStrategy(\"disabled\");\n }\n });\n }\n\n fetchSetting();\n }, [pagerDutyApi]);\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n const value = getSelectedValue((event.target as HTMLInputElement).value);\n\n setSelectedServiceDependencyStrategy(value);\n\n pagerDutyApi.storeSettings([\n {\n id: SERVICE_DEPENDENCY_SYNC_STRATEGY,\n value,\n },\n ]);\n };\n\n function getSelectedValue(\n value: string\n ): \"backstage\" | \"pagerduty\" | \"both\" | \"disabled\" {\n switch (value) {\n case \"backstage\":\n return \"backstage\";\n case \"pagerduty\":\n return \"pagerduty\";\n case \"both\":\n return \"both\";\n default:\n return \"disabled\";\n }\n }\n\n return (\n <Page themeId=\"home\">\n <Header title=\"PagerDuty\" subtitle=\"Advanced configurations\" />\n <Content>\n <TabbedLayout>\n <TabbedLayout.Route path=\"/service-mapping\" title=\"Service Mapping\">\n <Grid container spacing={3} direction=\"column\">\n <Grid item>\n {/* <Typography variant=\"h4\">Service to Entity mapping</Typography> */}\n <Typography variant=\"body1\">\n Easily map your existing PagerDuty services to entities in\n Backstage without the need to add anotations to all your\n projects.\n </Typography>\n <Typography variant=\"body1\">\n <b>Warning: </b>Only 1:1 mapping is allowed at this time.\n </Typography>\n </Grid>\n <Grid item>\n <ServiceMappingComponent />\n </Grid>\n </Grid>\n </TabbedLayout.Route>\n <TabbedLayout.Route path=\"/settings\" title=\"Configuration\">\n <Grid container spacing={3} direction=\"column\">\n <Grid item>\n <Typography variant=\"h4\">Plugin configuration</Typography>\n <Typography variant=\"body1\">\n Configure your PagerDuty plugin configuration here.\n </Typography>\n </Grid>\n <Card\n title=\"Service dependency synchronization preferences\"\n style={{ padding: \"10px\", paddingLeft: \"15px\", width: \"50%\" }}\n >\n <>\n <Typography variant=\"h6\">\n Service dependency synchronization strategy\n </Typography>\n <Typography variant=\"body1\">\n Select the main source of truth for your service dependencies\n </Typography>\n <RadioGroup\n value={selectedServiceDependencyStrategy}\n onChange={handleChange}\n >\n <FormControlLabel\n value=\"backstage\"\n control={<Radio />}\n label=\"Backstage\"\n />\n <FormControlLabel\n value=\"pagerduty\"\n control={<Radio />}\n label=\"PagerDuty\"\n />\n <FormControlLabel\n value=\"both\"\n control={<Radio />}\n label=\"Both\"\n />\n <FormControlLabel\n value=\"disabled\"\n control={<Radio />}\n label=\"Disabled\"\n />\n </RadioGroup>\n </>\n\n <br />\n <br />\n <Typography variant=\"body1\">\n <b>Warning: </b>Changing this setting will affect how your\n service dependencies are synchronized and may cause data loss.\n Check the\n <a href=\"https://pagerduty.github.io/backstage-plugin-docs/index.html\">\n documentation\n </a>\n for more information.\n </Typography>\n </Card>\n </Grid>\n </TabbedLayout.Route>\n </TabbedLayout>\n </Content>\n </Page>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AAoBA,MAAM,gCACJ,GAAA,4CAAA,CAAA;AAGK,MAAM,gBAAgB,MAAM;AACjC,EAAM,MAAA,YAAA,GAAe,OAAO,eAAe,CAAA,CAAA;AAC3C,EAAM,MAAA;AAAA,IACJ,iCAAA;AAAA,IACA,oCAAA;AAAA,GACF,GAAI,SAAS,UAAU,CAAA,CAAA;AAEvB,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,SAAS,YAAe,GAAA;AACtB,MAAA,YAAA,CACG,UAAW,CAAA,gCAAgC,CAC3C,CAAA,IAAA,CAAK,CAAC,MAAW,KAAA;AAChB,QAAA,IAAI,WAAW,KAAW,CAAA,EAAA;AACxB,UAAA,oCAAA,CAAqC,OAAO,KAAK,CAAA,CAAA;AAAA,SACnD;AAAA,OACD,CAAA,CACA,KAAM,CAAA,CAAC,KAAU,KAAA;AAChB,QAAA,IAAI,iBAAiB,aAAe,EAAA;AA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