@backstage/plugin-user-settings 0.7.11 → 0.7.12-next.0
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.
- package/CHANGELOG.md +16 -0
- package/alpha/package.json +1 -1
- package/dist/alpha.d.ts +4 -7
- package/dist/alpha.esm.js +11 -10
- package/dist/alpha.esm.js.map +1 -1
- package/dist/esm/{SettingsPage-f863b932.esm.js → SettingsPage-70c1c7c8.esm.js} +3 -15
- package/dist/esm/{SettingsPage-f863b932.esm.js.map → SettingsPage-70c1c7c8.esm.js.map} +1 -1
- package/dist/esm/{index-ca302ff8.esm.js → index-088c7808.esm.js} +3 -3
- package/dist/esm/index-088c7808.esm.js.map +1 -0
- package/dist/esm/translation-ecd113d9.esm.js +38 -0
- package/dist/esm/translation-ecd113d9.esm.js.map +1 -0
- package/dist/index.esm.js +7 -23
- package/dist/index.esm.js.map +1 -1
- package/package.json +14 -14
- package/dist/esm/index-ca302ff8.esm.js.map +0 -1
- package/dist/esm/translation-d20c444b.esm.js +0 -20
- package/dist/esm/translation-d20c444b.esm.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @backstage/plugin-user-settings
|
|
2
2
|
|
|
3
|
+
## 0.7.12-next.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 68fc9dc60e: Updated alpha exports according to routing changes in `@backstage/frontend-plugin-api`.
|
|
8
|
+
- 6c2b872153: Add official support for React 18.
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
- @backstage/core-components@0.13.7-next.0
|
|
11
|
+
- @backstage/frontend-plugin-api@0.3.0-next.0
|
|
12
|
+
- @backstage/plugin-catalog-react@1.9.0-next.0
|
|
13
|
+
- @backstage/core-plugin-api@1.8.0-next.0
|
|
14
|
+
- @backstage/core-app-api@1.11.1-next.0
|
|
15
|
+
- @backstage/theme@0.4.4-next.0
|
|
16
|
+
- @backstage/errors@1.2.3
|
|
17
|
+
- @backstage/types@1.1.1
|
|
18
|
+
|
|
3
19
|
## 0.7.11
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/alpha/package.json
CHANGED
package/dist/alpha.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
|
|
2
|
-
import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
|
|
3
2
|
import * as _backstage_core_plugin_api_alpha from '@backstage/core-plugin-api/alpha';
|
|
4
3
|
|
|
5
4
|
/** @alpha */
|
|
@@ -19,10 +18,8 @@ declare const userSettingsTranslationRef: _backstage_core_plugin_api_alpha.Trans
|
|
|
19
18
|
/**
|
|
20
19
|
* @alpha
|
|
21
20
|
*/
|
|
22
|
-
declare const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
*/
|
|
26
|
-
declare const _default: _backstage_frontend_plugin_api.BackstagePlugin<_backstage_core_plugin_api.AnyRoutes, _backstage_core_plugin_api.AnyExternalRoutes>;
|
|
21
|
+
declare const _default: _backstage_frontend_plugin_api.BackstagePlugin<{
|
|
22
|
+
root: _backstage_frontend_plugin_api.RouteRef<undefined>;
|
|
23
|
+
}, {}>;
|
|
27
24
|
|
|
28
|
-
export { _default as default,
|
|
25
|
+
export { _default as default, userSettingsTranslationRef };
|
package/dist/alpha.esm.js
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import { createRouteRef } from '@backstage/core-plugin-api';
|
|
2
1
|
import { createPageExtension, createExtensionInput, coreExtensionData, createPlugin } from '@backstage/frontend-plugin-api';
|
|
2
|
+
import { convertLegacyRouteRef } from '@backstage/core-plugin-api/alpha';
|
|
3
|
+
import { s as settingsRouteRef } from './esm/translation-ecd113d9.esm.js';
|
|
4
|
+
export { a as userSettingsTranslationRef } from './esm/translation-ecd113d9.esm.js';
|
|
3
5
|
import React from 'react';
|
|
4
|
-
|
|
5
|
-
import '@backstage/core-plugin-api/alpha';
|
|
6
|
+
import '@backstage/core-plugin-api';
|
|
6
7
|
|
|
7
|
-
const userSettingsRouteRef = createRouteRef({
|
|
8
|
-
id: "plugin.user-settings.page"
|
|
9
|
-
});
|
|
10
8
|
const UserSettingsPage = createPageExtension({
|
|
11
9
|
id: "plugin.user-settings.page",
|
|
12
10
|
defaultPath: "/settings",
|
|
13
|
-
routeRef:
|
|
11
|
+
routeRef: convertLegacyRouteRef(settingsRouteRef),
|
|
14
12
|
inputs: {
|
|
15
13
|
providerSettings: createExtensionInput(
|
|
16
14
|
{
|
|
@@ -19,15 +17,18 @@ const UserSettingsPage = createPageExtension({
|
|
|
19
17
|
{ singleton: true, optional: true }
|
|
20
18
|
)
|
|
21
19
|
},
|
|
22
|
-
loader: ({ inputs }) => import('./esm/index-
|
|
20
|
+
loader: ({ inputs }) => import('./esm/index-088c7808.esm.js').then((m) => {
|
|
23
21
|
var _a;
|
|
24
22
|
return /* @__PURE__ */ React.createElement(m.SettingsPage, { providerSettings: (_a = inputs.providerSettings) == null ? void 0 : _a.element });
|
|
25
23
|
})
|
|
26
24
|
});
|
|
27
25
|
var alpha = createPlugin({
|
|
28
26
|
id: "user-settings",
|
|
29
|
-
extensions: [UserSettingsPage]
|
|
27
|
+
extensions: [UserSettingsPage],
|
|
28
|
+
routes: {
|
|
29
|
+
root: convertLegacyRouteRef(settingsRouteRef)
|
|
30
|
+
}
|
|
30
31
|
});
|
|
31
32
|
|
|
32
|
-
export { alpha as default
|
|
33
|
+
export { alpha as default };
|
|
33
34
|
//# sourceMappingURL=alpha.esm.js.map
|
package/dist/alpha.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alpha.esm.js","sources":["../src/alpha.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {
|
|
1
|
+
{"version":3,"file":"alpha.esm.js","sources":["../src/alpha.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n coreExtensionData,\n createExtensionInput,\n createPageExtension,\n createPlugin,\n} from '@backstage/frontend-plugin-api';\nimport { convertLegacyRouteRef } from '@backstage/core-plugin-api/alpha';\nimport { settingsRouteRef } from './plugin';\n\nimport React from 'react';\n\nexport * from './translation';\n\nconst UserSettingsPage = createPageExtension({\n id: 'plugin.user-settings.page',\n defaultPath: '/settings',\n routeRef: convertLegacyRouteRef(settingsRouteRef),\n inputs: {\n providerSettings: createExtensionInput(\n {\n element: coreExtensionData.reactElement,\n },\n { singleton: true, optional: true },\n ),\n },\n loader: ({ inputs }) =>\n import('./components/SettingsPage').then(m => (\n <m.SettingsPage providerSettings={inputs.providerSettings?.element} />\n )),\n});\n\n/**\n * @alpha\n */\nexport default createPlugin({\n id: 'user-settings',\n extensions: [UserSettingsPage],\n routes: {\n root: convertLegacyRouteRef(settingsRouteRef),\n },\n});\n"],"names":[],"mappings":";;;;;;;AA4BA,MAAM,mBAAmB,mBAAoB,CAAA;AAAA,EAC3C,EAAI,EAAA,2BAAA;AAAA,EACJ,WAAa,EAAA,WAAA;AAAA,EACb,QAAA,EAAU,sBAAsB,gBAAgB,CAAA;AAAA,EAChD,MAAQ,EAAA;AAAA,IACN,gBAAkB,EAAA,oBAAA;AAAA,MAChB;AAAA,QACE,SAAS,iBAAkB,CAAA,YAAA;AAAA,OAC7B;AAAA,MACA,EAAE,SAAA,EAAW,IAAM,EAAA,QAAA,EAAU,IAAK,EAAA;AAAA,KACpC;AAAA,GACF;AAAA,EACA,MAAA,EAAQ,CAAC,EAAE,MAAA,OACT,OAAO,6BAA2B,CAAE,CAAA,IAAA,CAAK,CAAE,CAAA,KAAA;AAzC/C,IAAA,IAAA,EAAA,CAAA;AA0CM,IAAA,uBAAA,KAAA,CAAA,aAAA,CAAC,EAAE,YAAF,EAAA,EAAe,mBAAkB,EAAO,GAAA,MAAA,CAAA,gBAAA,KAAP,mBAAyB,OAAS,EAAA,CAAA,CAAA;AAAA,GACrE,CAAA;AACL,CAAC,CAAA,CAAA;AAKD,YAAe,YAAa,CAAA;AAAA,EAC1B,EAAI,EAAA,eAAA;AAAA,EACJ,UAAA,EAAY,CAAC,gBAAgB,CAAA;AAAA,EAC7B,MAAQ,EAAA;AAAA,IACN,IAAA,EAAM,sBAAsB,gBAAgB,CAAA;AAAA,GAC9C;AACF,CAAC,CAAA;;;;"}
|
|
@@ -13,7 +13,7 @@ import AutoIcon from '@material-ui/icons/BrightnessAuto';
|
|
|
13
13
|
import ToggleButton from '@material-ui/lab/ToggleButton';
|
|
14
14
|
import ToggleButtonGroup from '@material-ui/lab/ToggleButtonGroup';
|
|
15
15
|
import { useTranslationRef, appLanguageApiRef } from '@backstage/core-plugin-api/alpha';
|
|
16
|
-
import {
|
|
16
|
+
import { a as userSettingsTranslationRef } from './translation-ecd113d9.esm.js';
|
|
17
17
|
import { EntityRefLinks } from '@backstage/plugin-catalog-react';
|
|
18
18
|
import Grid$1 from '@material-ui/core/Grid';
|
|
19
19
|
import Typography$1 from '@material-ui/core/Typography';
|
|
@@ -682,19 +682,7 @@ const Contents = () => {
|
|
|
682
682
|
if (!backstageIdentity) {
|
|
683
683
|
return /* @__PURE__ */ React.createElement(Typography$1, null, "No Backstage Identity");
|
|
684
684
|
}
|
|
685
|
-
return /* @__PURE__ */ React.createElement(Grid$1, { container: true, spacing: 1 }, /* @__PURE__ */ React.createElement(Grid$1, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(Typography$1, { variant: "subtitle1", gutterBottom: true }, "User Entity:", " ", /* @__PURE__ */ React.createElement(
|
|
686
|
-
EntityRefLinks,
|
|
687
|
-
{
|
|
688
|
-
entityRefs: [backstageIdentity.userEntityRef],
|
|
689
|
-
getTitle: (ref) => ref
|
|
690
|
-
}
|
|
691
|
-
))), /* @__PURE__ */ React.createElement(Grid$1, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(Typography$1, { variant: "subtitle1" }, "Ownership Entities:", " ", /* @__PURE__ */ React.createElement(
|
|
692
|
-
EntityRefLinks,
|
|
693
|
-
{
|
|
694
|
-
entityRefs: backstageIdentity.ownershipEntityRefs,
|
|
695
|
-
getTitle: (ref) => ref
|
|
696
|
-
}
|
|
697
|
-
))));
|
|
685
|
+
return /* @__PURE__ */ React.createElement(Grid$1, { container: true, spacing: 1 }, /* @__PURE__ */ React.createElement(Grid$1, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(Typography$1, { variant: "subtitle1", gutterBottom: true }, "User Entity:", " ", /* @__PURE__ */ React.createElement(EntityRefLinks, { entityRefs: [backstageIdentity.userEntityRef] }))), /* @__PURE__ */ React.createElement(Grid$1, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(Typography$1, { variant: "subtitle1" }, "Ownership Entities:", " ", /* @__PURE__ */ React.createElement(EntityRefLinks, { entityRefs: backstageIdentity.ownershipEntityRefs }))));
|
|
698
686
|
};
|
|
699
687
|
const UserSettingsIdentityCard = () => /* @__PURE__ */ React.createElement(InfoCard, { title: "Backstage Identity" }, /* @__PURE__ */ React.createElement(Contents, null));
|
|
700
688
|
|
|
@@ -753,4 +741,4 @@ const SettingsPage = (props) => {
|
|
|
753
741
|
};
|
|
754
742
|
|
|
755
743
|
export { DefaultProviderSettings as D, LAYOUT_ROUTE_DATA_KEY as L, ProviderSettingsItem as P, SettingsLayout as S, UserSettingsAuthProviders as U, SettingsPage as a, UserSettingsGeneral as b, UserSettingsProfileCard as c, UserSettingsMenu as d, UserSettingsSignInAvatar as e, UserSettingsAppearanceCard as f, UserSettingsThemeToggle as g, UserSettingsPinToggle as h, UserSettingsIdentityCard as i, UserSettingsLanguageToggle as j, UserSettingsFeatureFlags as k, useUserProfile as u };
|
|
756
|
-
//# sourceMappingURL=SettingsPage-
|
|
744
|
+
//# sourceMappingURL=SettingsPage-70c1c7c8.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsPage-f863b932.esm.js","sources":["../../src/components/AuthProviders/EmptyProviders.tsx","../../src/components/AuthProviders/ProviderSettingsAvatar.tsx","../../src/components/AuthProviders/ProviderSettingsItem.tsx","../../src/components/AuthProviders/DefaultProviderSettings.tsx","../../src/components/AuthProviders/UserSettingsAuthProviders.tsx","../../src/components/FeatureFlags/EmptyFlags.tsx","../../src/components/FeatureFlags/FeatureFlagsItem.tsx","../../src/components/FeatureFlags/UserSettingsFeatureFlags.tsx","../../src/components/useUserProfileInfo.ts","../../src/components/General/UserSettingsSignInAvatar.tsx","../../src/components/General/UserSettingsMenu.tsx","../../src/components/General/UserSettingsProfileCard.tsx","../../src/components/General/UserSettingsPinToggle.tsx","../../src/components/General/UserSettingsThemeToggle.tsx","../../src/components/General/UserSettingsLanguageToggle.tsx","../../src/components/General/UserSettingsAppearanceCard.tsx","../../src/components/General/UserSettingsIdentityCard.tsx","../../src/components/General/UserSettingsGeneral.tsx","../../src/components/SettingsLayout/SettingsLayout.tsx","../../src/components/DefaultSettingsPage/DefaultSettingsPage.tsx","../../src/components/SettingsPage/SettingsPage.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport { Button, Typography } from '@material-ui/core';\nimport { CodeSnippet, EmptyState } from '@backstage/core-components';\n\nconst EXAMPLE = `auth:\n providers:\n google:\n development:\n clientId: \\${AUTH_GOOGLE_CLIENT_ID}\n clientSecret: \\${AUTH_GOOGLE_CLIENT_SECRET}\n`;\n\nexport const EmptyProviders = () => (\n <EmptyState\n missing=\"content\"\n title=\"No Authentication Providers\"\n description=\"You can add Authentication Providers to Backstage which allows you to use these providers to authenticate yourself.\"\n action={\n <>\n <Typography variant=\"body1\">\n Open <code>app-config.yaml</code> and make the changes as highlighted\n below:\n </Typography>\n <CodeSnippet\n text={EXAMPLE}\n language=\"yaml\"\n showLineNumbers\n highlightedNumbers={[3, 4, 5, 6, 7, 8]}\n customStyle={{ background: 'inherit', fontSize: '115%' }}\n />\n <Button\n variant=\"contained\"\n color=\"primary\"\n href=\"https://backstage.io/docs/auth/add-auth-provider\"\n >\n Read More\n </Button>\n </>\n }\n />\n);\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport { BackstageTheme } from '@backstage/theme';\nimport { makeStyles, Avatar } from '@material-ui/core';\nimport { sidebarConfig } from '@backstage/core-components';\n\nconst useStyles = makeStyles<BackstageTheme, { size: number }>(theme => ({\n avatar: {\n width: ({ size }) => size,\n height: ({ size }) => size,\n fontSize: ({ size }) => size * 0.7,\n border: `1px solid ${theme.palette.textSubtle}`,\n },\n}));\n\ntype Props = { size?: number; picture: string | undefined };\n\nexport const ProviderSettingsAvatar = ({ size, picture }: Props) => {\n const { iconSize } = sidebarConfig;\n const classes = useStyles(size ? { size } : { size: iconSize });\n\n return <Avatar src={picture} className={classes.avatar} />;\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { useEffect, useState } from 'react';\nimport {\n Button,\n Grid,\n ListItem,\n ListItemIcon,\n ListItemSecondaryAction,\n ListItemText,\n Tooltip,\n Typography,\n} from '@material-ui/core';\nimport {\n ApiRef,\n SessionApi,\n SessionState,\n ProfileInfoApi,\n ProfileInfo,\n useApi,\n errorApiRef,\n IconComponent,\n} from '@backstage/core-plugin-api';\nimport { ProviderSettingsAvatar } from './ProviderSettingsAvatar';\n\nconst emptyProfile: ProfileInfo = {};\n\n/** @public */\nexport const ProviderSettingsItem = (props: {\n title: string;\n description: string;\n icon: IconComponent;\n apiRef: ApiRef<ProfileInfoApi & SessionApi>;\n}) => {\n const { title, description, icon: Icon, apiRef } = props;\n\n const api = useApi(apiRef);\n const errorApi = useApi(errorApiRef);\n const [signedIn, setSignedIn] = useState(false);\n const [profile, setProfile] = useState<ProfileInfo>(emptyProfile);\n\n useEffect(() => {\n let didCancel = false;\n\n const subscription = api\n .sessionState$()\n .subscribe((sessionState: SessionState) => {\n if (sessionState !== SessionState.SignedIn) {\n setProfile(emptyProfile);\n setSignedIn(false);\n }\n if (!didCancel) {\n api\n .getProfile({ optional: true })\n .then((profileResponse: ProfileInfo | undefined) => {\n if (!didCancel) {\n if (sessionState === SessionState.SignedIn) {\n setSignedIn(true);\n }\n if (profileResponse) {\n setProfile(profileResponse);\n }\n }\n });\n }\n });\n\n return () => {\n didCancel = true;\n subscription.unsubscribe();\n };\n }, [api]);\n\n return (\n <ListItem>\n <ListItemIcon>\n <Icon />\n </ListItemIcon>\n <ListItemText\n primary={title}\n secondary={\n <Tooltip placement=\"top\" arrow title={description}>\n <Grid container spacing={6}>\n <Grid item>\n <ProviderSettingsAvatar size={48} picture={profile.picture} />\n </Grid>\n <Grid item xs={12} sm container>\n <Grid item xs container direction=\"column\" spacing={2}>\n <Grid item xs>\n <Typography\n variant=\"subtitle1\"\n color=\"textPrimary\"\n gutterBottom\n >\n {profile.displayName}\n </Typography>\n <Typography variant=\"body2\" color=\"textSecondary\">\n {profile.email}\n </Typography>\n <Typography variant=\"body2\" color=\"textSecondary\">\n {description}\n </Typography>\n </Grid>\n </Grid>\n </Grid>\n </Grid>\n </Tooltip>\n }\n secondaryTypographyProps={{ noWrap: true, style: { width: '80%' } }}\n />\n <ListItemSecondaryAction>\n <Tooltip\n placement=\"top\"\n arrow\n title={signedIn ? `Sign out from ${title}` : `Sign in to ${title}`}\n >\n <Button\n variant=\"outlined\"\n color=\"primary\"\n onClick={() => {\n const action = signedIn ? api.signOut() : api.signIn();\n action.catch(error => errorApi.post(error));\n }}\n >\n {signedIn ? `Sign out` : `Sign in`}\n </Button>\n </Tooltip>\n </ListItemSecondaryAction>\n </ListItem>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Star from '@material-ui/icons/Star';\nimport React from 'react';\nimport { ProviderSettingsItem } from './ProviderSettingsItem';\nimport {\n githubAuthApiRef,\n gitlabAuthApiRef,\n googleAuthApiRef,\n oktaAuthApiRef,\n microsoftAuthApiRef,\n bitbucketAuthApiRef,\n bitbucketServerAuthApiRef,\n atlassianAuthApiRef,\n oneloginAuthApiRef,\n} from '@backstage/core-plugin-api';\n\n/** @public */\nexport const DefaultProviderSettings = (props: {\n configuredProviders: string[];\n}) => {\n const { configuredProviders } = props;\n return (\n <>\n {configuredProviders.includes('google') && (\n <ProviderSettingsItem\n title=\"Google\"\n description=\"Provides authentication towards Google APIs and identities\"\n apiRef={googleAuthApiRef}\n icon={Star}\n />\n )}\n {configuredProviders.includes('microsoft') && (\n <ProviderSettingsItem\n title=\"Microsoft\"\n description=\"Provides authentication towards Microsoft APIs and identities\"\n apiRef={microsoftAuthApiRef}\n icon={Star}\n />\n )}\n {configuredProviders.includes('github') && (\n <ProviderSettingsItem\n title=\"GitHub\"\n description=\"Provides authentication towards GitHub APIs\"\n apiRef={githubAuthApiRef}\n icon={Star}\n />\n )}\n {configuredProviders.includes('gitlab') && (\n <ProviderSettingsItem\n title=\"GitLab\"\n description=\"Provides authentication towards GitLab APIs\"\n apiRef={gitlabAuthApiRef}\n icon={Star}\n />\n )}\n {configuredProviders.includes('okta') && (\n <ProviderSettingsItem\n title=\"Okta\"\n description=\"Provides authentication towards Okta APIs\"\n apiRef={oktaAuthApiRef}\n icon={Star}\n />\n )}\n {configuredProviders.includes('bitbucket') && (\n <ProviderSettingsItem\n title=\"Bitbucket\"\n description=\"Provides authentication towards Bitbucket APIs\"\n apiRef={bitbucketAuthApiRef}\n icon={Star}\n />\n )}\n {configuredProviders.includes('onelogin') && (\n <ProviderSettingsItem\n title=\"OneLogin\"\n description=\"Provides authentication towards OneLogin APIs\"\n apiRef={oneloginAuthApiRef}\n icon={Star}\n />\n )}\n {configuredProviders.includes('atlassian') && (\n <ProviderSettingsItem\n title=\"Atlassian\"\n description=\"Provides authentication towards Atlassian APIs\"\n apiRef={atlassianAuthApiRef}\n icon={Star}\n />\n )}\n {configuredProviders.includes('bitbucketServer') && (\n <ProviderSettingsItem\n title=\"Bitbucket Server\"\n description=\"Provides authentication towards Bitbucket Server APIs\"\n apiRef={bitbucketServerAuthApiRef}\n icon={Star}\n />\n )}\n </>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport { List } from '@material-ui/core';\nimport { EmptyProviders } from './EmptyProviders';\nimport { DefaultProviderSettings } from './DefaultProviderSettings';\nimport { configApiRef, useApi } from '@backstage/core-plugin-api';\nimport { InfoCard } from '@backstage/core-components';\n\n/** @public */\nexport const UserSettingsAuthProviders = (props: {\n providerSettings?: JSX.Element;\n}) => {\n const { providerSettings } = props;\n const configApi = useApi(configApiRef);\n const providersConfig = configApi.getOptionalConfig('auth.providers');\n const configuredProviders = providersConfig?.keys() || [];\n const providers = providerSettings ?? (\n <DefaultProviderSettings configuredProviders={configuredProviders} />\n );\n\n if (!providerSettings && !configuredProviders?.length) {\n return <EmptyProviders />;\n }\n\n return (\n <InfoCard title=\"Available Providers\">\n <List dense>{providers}</List>\n </InfoCard>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport { Button, Typography } from '@material-ui/core';\nimport { CodeSnippet, EmptyState } from '@backstage/core-components';\n\nconst EXAMPLE = `import { createPlugin } from '@backstage/core-plugin-api';\n\nexport default createPlugin({\n id: 'plugin-name',\n featureFlags: [{ name: 'enable-example-feature' }],\n});\n`;\n\nexport const EmptyFlags = () => (\n <EmptyState\n missing=\"content\"\n title=\"No Feature Flags\"\n description=\"Feature Flags make it possible for plugins to register features in Backstage for users to opt into. You can use this to split out logic in your code for manual A/B testing, etc.\"\n action={\n <>\n <Typography variant=\"body1\">\n An example for how to add a feature flag is highlighted below:\n </Typography>\n <CodeSnippet\n text={EXAMPLE}\n language=\"typescript\"\n showLineNumbers\n highlightedNumbers={[6]}\n customStyle={{ background: 'inherit', fontSize: '115%' }}\n />\n <Button\n variant=\"contained\"\n color=\"primary\"\n href=\"https://backstage.io/docs/api/utility-apis\"\n >\n Read More\n </Button>\n </>\n }\n />\n);\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport {\n ListItem,\n ListItemText,\n ListItemIcon,\n Switch,\n Tooltip,\n} from '@material-ui/core';\nimport { FeatureFlag } from '@backstage/core-plugin-api';\n\ntype Props = {\n flag: FeatureFlag;\n enabled: boolean;\n toggleHandler: Function;\n};\n\nconst getSecondaryText = (flag: FeatureFlag) => {\n if (flag.description) {\n return flag.description;\n }\n return flag.pluginId\n ? `Registered in ${flag.pluginId} plugin`\n : 'Registered in the application';\n};\n\nexport const FlagItem = ({ flag, enabled, toggleHandler }: Props) => (\n <ListItem divider button onClick={() => toggleHandler(flag.name)}>\n <ListItemIcon>\n <Tooltip placement=\"top\" arrow title={enabled ? 'Disable' : 'Enable'}>\n <Switch color=\"primary\" checked={enabled} name={flag.name} />\n </Tooltip>\n </ListItemIcon>\n <ListItemText primary={flag.name} secondary={getSecondaryText(flag)} />\n </ListItem>\n);\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { useCallback, useState } from 'react';\nimport {\n List,\n TextField,\n IconButton,\n Grid,\n Typography,\n} from '@material-ui/core';\nimport { EmptyFlags } from './EmptyFlags';\nimport { FlagItem } from './FeatureFlagsItem';\nimport {\n FeatureFlag,\n FeatureFlagsApi,\n featureFlagsApiRef,\n FeatureFlagState,\n useApi,\n} from '@backstage/core-plugin-api';\nimport { InfoCard } from '@backstage/core-components';\nimport ClearIcon from '@material-ui/icons/Clear';\n\nexport const sortFlags = (\n flags: FeatureFlag[],\n featureFlagsApi: FeatureFlagsApi,\n): FeatureFlag[] => {\n const activeFlags = flags.filter(flag => featureFlagsApi.isActive(flag.name));\n const idleFlags = flags.filter(flag => !featureFlagsApi.isActive(flag.name));\n return [...activeFlags, ...idleFlags];\n};\n\n/** @public */\nexport const UserSettingsFeatureFlags = () => {\n const featureFlagsApi = useApi(featureFlagsApiRef);\n const inputRef = React.useRef<HTMLElement>();\n\n const initialFeatureFlags = featureFlagsApi.getRegisteredFlags();\n const initialFeatureFlagsSorted = sortFlags(\n initialFeatureFlags,\n featureFlagsApi,\n );\n const [featureFlags] = useState(initialFeatureFlagsSorted);\n\n const initialFlagState = Object.fromEntries(\n featureFlags.map(({ name }) => [name, featureFlagsApi.isActive(name)]),\n );\n\n const [state, setState] = useState<Record<string, boolean>>(initialFlagState);\n const [filterInput, setFilterInput] = useState<string>('');\n\n const toggleFlag = useCallback(\n (flagName: string) => {\n const newState = featureFlagsApi.isActive(flagName)\n ? FeatureFlagState.None\n : FeatureFlagState.Active;\n\n featureFlagsApi.save({\n states: { [flagName]: newState },\n merge: true,\n });\n\n setState(prevState => ({\n ...prevState,\n [flagName]: newState === FeatureFlagState.Active,\n }));\n },\n [featureFlagsApi],\n );\n\n if (!featureFlags.length) {\n return <EmptyFlags />;\n }\n\n const clearFilterInput = () => {\n setFilterInput('');\n inputRef?.current?.focus();\n };\n\n const filteredFeatureFlags = featureFlags.filter(featureFlag => {\n const featureFlagName = featureFlag.name.toLocaleLowerCase('en-US');\n return featureFlagName.includes(filterInput.toLocaleLowerCase('en-US'));\n });\n\n const Header = () => (\n <Grid container style={{ justifyContent: 'space-between' }}>\n <Grid item xs={6} md={8}>\n <Typography variant=\"h5\">Feature Flags</Typography>\n <Typography variant=\"subtitle1\">\n Please refresh the page when toggling feature flags\n </Typography>\n </Grid>\n {featureFlags.length >= 10 && (\n <Grid item xs={6} md={4}>\n <TextField\n label=\"Filter\"\n style={{ display: 'flex', justifyContent: 'flex-end' }}\n inputRef={ref => ref && ref.focus()}\n InputProps={{\n ...(filterInput.length && {\n endAdornment: (\n <IconButton\n aria-label=\"Clear filter\"\n onClick={clearFilterInput}\n edge=\"end\"\n >\n <ClearIcon />\n </IconButton>\n ),\n }),\n }}\n onChange={e => setFilterInput(e.target.value)}\n value={filterInput}\n />\n </Grid>\n )}\n </Grid>\n );\n\n return (\n <InfoCard title={<Header />}>\n <List dense>\n {filteredFeatureFlags.map(featureFlag => {\n const enabled = Boolean(state[featureFlag.name]);\n\n return (\n <FlagItem\n key={featureFlag.name}\n flag={featureFlag}\n enabled={enabled}\n toggleHandler={toggleFlag}\n />\n );\n })}\n </List>\n </InfoCard>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n alertApiRef,\n identityApiRef,\n ProfileInfo,\n useApi,\n} from '@backstage/core-plugin-api';\nimport { useEffect } from 'react';\nimport useAsync from 'react-use/lib/useAsync';\n\n/** @public */\nexport const useUserProfile = () => {\n const identityApi = useApi(identityApiRef);\n const alertApi = useApi(alertApiRef);\n\n const { value, loading, error } = useAsync(async () => {\n return {\n profile: await identityApi.getProfileInfo(),\n identity: await identityApi.getBackstageIdentity(),\n };\n }, []);\n\n useEffect(() => {\n if (error) {\n alertApi.post({\n message: `Failed to load user identity: ${error}`,\n severity: 'error',\n });\n }\n }, [error, alertApi]);\n\n if (loading || error) {\n return {\n profile: {} as ProfileInfo,\n displayName: '',\n loading,\n };\n }\n\n return {\n profile: value!.profile,\n backstageIdentity: value!.identity,\n displayName: value!.profile.displayName ?? value!.identity.userEntityRef,\n loading,\n };\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport { BackstageTheme } from '@backstage/theme';\nimport { makeStyles, Avatar } from '@material-ui/core';\nimport { useUserProfile } from '../useUserProfileInfo';\nimport { sidebarConfig } from '@backstage/core-components';\n\nconst useStyles = makeStyles<BackstageTheme, { size: number }>(theme => ({\n avatar: {\n width: ({ size }) => size,\n height: ({ size }) => size,\n fontSize: ({ size }) => size * 0.7,\n border: `1px solid ${theme.palette.textSubtle}`,\n },\n}));\n\n/** @public */\nexport const UserSettingsSignInAvatar = (props: { size?: number }) => {\n const { size } = props;\n\n const { iconSize } = sidebarConfig;\n const classes = useStyles(size ? { size } : { size: iconSize });\n const { profile } = useUserProfile();\n\n return (\n <Avatar\n src={profile.picture}\n className={classes.avatar}\n alt=\"Profile picture\"\n />\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport { IconButton, ListItemIcon, Menu, MenuItem } from '@material-ui/core';\nimport SignOutIcon from '@material-ui/icons/MeetingRoom';\nimport MoreVertIcon from '@material-ui/icons/MoreVert';\nimport {\n identityApiRef,\n errorApiRef,\n useApi,\n} from '@backstage/core-plugin-api';\n\n/** @public */\nexport const UserSettingsMenu = () => {\n const errorApi = useApi(errorApiRef);\n const identityApi = useApi(identityApiRef);\n const [open, setOpen] = React.useState(false);\n const [anchorEl, setAnchorEl] = React.useState<undefined | HTMLElement>(\n undefined,\n );\n\n const handleOpen = (event: React.MouseEvent<HTMLButtonElement>) => {\n setAnchorEl(event.currentTarget);\n setOpen(true);\n };\n\n const handleClose = () => {\n setAnchorEl(undefined);\n setOpen(false);\n };\n\n return (\n <>\n <IconButton\n data-testid=\"user-settings-menu\"\n aria-label=\"more\"\n onClick={handleOpen}\n >\n <MoreVertIcon />\n </IconButton>\n <Menu anchorEl={anchorEl} open={open} onClose={handleClose}>\n <MenuItem\n data-testid=\"sign-out\"\n onClick={() =>\n identityApi.signOut().catch(error => errorApi.post(error))\n }\n >\n <ListItemIcon>\n <SignOutIcon />\n </ListItemIcon>\n Sign Out\n </MenuItem>\n </Menu>\n </>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Grid, Typography } from '@material-ui/core';\nimport React from 'react';\nimport { UserSettingsSignInAvatar } from './UserSettingsSignInAvatar';\nimport { UserSettingsMenu } from './UserSettingsMenu';\nimport { useUserProfile } from '../useUserProfileInfo';\nimport { InfoCard } from '@backstage/core-components';\n\n/** @public */\nexport const UserSettingsProfileCard = () => {\n const { profile, displayName } = useUserProfile();\n\n return (\n <InfoCard title=\"Profile\" variant=\"gridItem\">\n <Grid container spacing={6}>\n <Grid item>\n <UserSettingsSignInAvatar size={96} />\n </Grid>\n <Grid item xs={12} sm container>\n <Grid item xs container direction=\"column\" spacing={2}>\n <Grid item xs>\n <Typography variant=\"subtitle1\" gutterBottom>\n {displayName}\n </Typography>\n {profile.email && (\n <Typography variant=\"body2\" color=\"textSecondary\">\n {profile.email}\n </Typography>\n )}\n </Grid>\n </Grid>\n <Grid item>\n <UserSettingsMenu />\n </Grid>\n </Grid>\n </Grid>\n </InfoCard>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport {\n ListItem,\n ListItemSecondaryAction,\n ListItemText,\n Switch,\n Tooltip,\n} from '@material-ui/core';\nimport { useSidebarPinState } from '@backstage/core-components';\n\n/** @public */\nexport const UserSettingsPinToggle = () => {\n const { isPinned, toggleSidebarPinState } = useSidebarPinState();\n\n return (\n <ListItem>\n <ListItemText\n primary=\"Pin Sidebar\"\n secondary=\"Prevent the sidebar from collapsing\"\n />\n <ListItemSecondaryAction>\n <Tooltip\n placement=\"top\"\n arrow\n title={`${isPinned ? 'Unpin' : 'Pin'} Sidebar`}\n >\n <Switch\n color=\"primary\"\n checked={isPinned}\n onChange={() => toggleSidebarPinState()}\n name=\"pin\"\n inputProps={{ 'aria-label': 'Pin Sidebar Switch' }}\n />\n </Tooltip>\n </ListItemSecondaryAction>\n </ListItem>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { cloneElement } from 'react';\nimport useObservable from 'react-use/lib/useObservable';\nimport AutoIcon from '@material-ui/icons/BrightnessAuto';\nimport ToggleButton from '@material-ui/lab/ToggleButton';\nimport ToggleButtonGroup from '@material-ui/lab/ToggleButtonGroup';\nimport {\n ListItem,\n ListItemText,\n ListItemSecondaryAction,\n Tooltip,\n makeStyles,\n} from '@material-ui/core';\nimport { appThemeApiRef, useApi } from '@backstage/core-plugin-api';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { userSettingsTranslationRef } from '../../translation';\n\ntype ThemeIconProps = {\n id: string;\n activeId: string | undefined;\n icon: JSX.Element | undefined;\n};\n\nconst ThemeIcon = ({ id, activeId, icon }: ThemeIconProps) =>\n icon ? (\n cloneElement(icon, {\n color: activeId === id ? 'primary' : undefined,\n })\n ) : (\n <AutoIcon color={activeId === id ? 'primary' : undefined} />\n );\n\ntype TooltipToggleButtonProps = {\n children: JSX.Element;\n title: string;\n value: string;\n};\n\nconst useStyles = makeStyles(theme => ({\n container: {\n display: 'flex',\n flexWrap: 'wrap',\n width: '100%',\n justifyContent: 'space-between',\n alignItems: 'center',\n paddingBottom: 8,\n paddingRight: 16,\n },\n list: {\n width: 'initial',\n [theme.breakpoints.down('xs')]: {\n width: '100%',\n padding: `0 0 12px`,\n },\n },\n listItemText: {\n paddingRight: 0,\n paddingLeft: 0,\n },\n listItemSecondaryAction: {\n position: 'relative',\n transform: 'unset',\n top: 'auto',\n right: 'auto',\n paddingLeft: 16,\n [theme.breakpoints.down('xs')]: {\n paddingLeft: 0,\n },\n },\n}));\n\n// ToggleButtonGroup uses React.children.map instead of context\n// so wrapping with Tooltip breaks ToggleButton functionality.\nconst TooltipToggleButton = ({\n children,\n title,\n value,\n ...props\n}: TooltipToggleButtonProps) => (\n <Tooltip placement=\"top\" arrow title={title}>\n <ToggleButton value={value} {...props}>\n {children}\n </ToggleButton>\n </Tooltip>\n);\n\n/** @public */\nexport const UserSettingsThemeToggle = () => {\n const classes = useStyles();\n const appThemeApi = useApi(appThemeApiRef);\n const activeThemeId = useObservable(\n appThemeApi.activeThemeId$(),\n appThemeApi.getActiveThemeId(),\n );\n\n const themeIds = appThemeApi.getInstalledThemes();\n\n const { t } = useTranslationRef(userSettingsTranslationRef);\n\n const handleSetTheme = (\n _event: React.MouseEvent<HTMLElement>,\n newThemeId: string | undefined,\n ) => {\n if (themeIds.some(it => it.id === newThemeId)) {\n appThemeApi.setActiveThemeId(newThemeId);\n } else {\n appThemeApi.setActiveThemeId(undefined);\n }\n };\n\n return (\n <ListItem\n className={classes.list}\n classes={{ container: classes.container }}\n >\n <ListItemText\n className={classes.listItemText}\n primary={t('theme')}\n secondary={t('change_the_theme_mode')}\n />\n <ListItemSecondaryAction className={classes.listItemSecondaryAction}>\n <ToggleButtonGroup\n exclusive\n size=\"small\"\n value={activeThemeId ?? 'auto'}\n onChange={handleSetTheme}\n >\n {themeIds.map(theme => {\n const themeId = theme.id;\n const themeIcon = theme.icon;\n const themeTitle =\n theme.title ||\n (themeId === 'light' || themeId === 'dark'\n ? t(`theme_${themeId}`)\n : themeId);\n return (\n <TooltipToggleButton\n key={themeId}\n title={t('select_theme', { theme: themeTitle })}\n value={themeId}\n >\n <>\n {themeTitle} \n <ThemeIcon\n id={themeId}\n icon={themeIcon}\n activeId={activeThemeId}\n />\n </>\n </TooltipToggleButton>\n );\n })}\n <Tooltip placement=\"top\" arrow title={t('select_theme_auto')}>\n <ToggleButton value=\"auto\" selected={activeThemeId === undefined}>\n {t('theme_auto')} \n <AutoIcon\n color={activeThemeId === undefined ? 'primary' : undefined}\n />\n </ToggleButton>\n </Tooltip>\n </ToggleButtonGroup>\n </ListItemSecondaryAction>\n </ListItem>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { useState } from 'react';\nimport {\n useTranslationRef,\n appLanguageApiRef,\n} from '@backstage/core-plugin-api/alpha';\nimport ToggleButton from '@material-ui/lab/ToggleButton';\nimport ToggleButtonGroup from '@material-ui/lab/ToggleButtonGroup';\nimport {\n ListItem,\n ListItemText,\n ListItemSecondaryAction,\n Tooltip,\n makeStyles,\n} from '@material-ui/core';\nimport { userSettingsTranslationRef } from '../../translation';\nimport { useApi } from '@backstage/core-plugin-api';\nimport useObservable from 'react-use/lib/useObservable';\n\ntype TooltipToggleButtonProps = {\n children: JSX.Element;\n title: string;\n value: string;\n};\n\nconst useStyles = makeStyles(theme => ({\n container: {\n display: 'flex',\n flexWrap: 'wrap',\n width: '100%',\n justifyContent: 'space-between',\n alignItems: 'center',\n paddingBottom: 8,\n paddingRight: 16,\n },\n list: {\n width: 'initial',\n [theme.breakpoints.down('xs')]: {\n width: '100%',\n padding: `0 0 12px`,\n },\n },\n listItemText: {\n paddingRight: 0,\n paddingLeft: 0,\n },\n listItemSecondaryAction: {\n position: 'relative',\n transform: 'unset',\n top: 'auto',\n right: 'auto',\n paddingLeft: 16,\n [theme.breakpoints.down('xs')]: {\n paddingLeft: 0,\n },\n },\n}));\n\n// ToggleButtonGroup uses React.children.map instead of context\n// so wrapping with Tooltip breaks ToggleButton functionality.\nconst TooltipToggleButton = ({\n children,\n title,\n value,\n ...props\n}: TooltipToggleButtonProps) => (\n <Tooltip placement=\"top\" arrow title={title}>\n <ToggleButton value={value} {...props}>\n {children}\n </ToggleButton>\n </Tooltip>\n);\n\n/** @public */\nexport const UserSettingsLanguageToggle = () => {\n const classes = useStyles();\n const languageApi = useApi(appLanguageApiRef);\n const { t } = useTranslationRef(userSettingsTranslationRef);\n\n const [languageObservable] = useState(() => languageApi.language$());\n const { language: currentLanguage } = useObservable(\n languageObservable,\n languageApi.getLanguage(),\n );\n\n const { languages } = languageApi.getAvailableLanguages();\n\n if (languages.length <= 1) {\n return null;\n }\n\n const handleSetLanguage = (\n _event: React.MouseEvent<HTMLElement>,\n newLanguage: string | undefined,\n ) => {\n languageApi.setLanguage(newLanguage);\n };\n\n return (\n <ListItem\n className={classes.list}\n classes={{ container: classes.container }}\n >\n <ListItemText\n className={classes.listItemText}\n primary={t('language')}\n secondary={t('change_the_language')}\n />\n <ListItemSecondaryAction className={classes.listItemSecondaryAction}>\n <ToggleButtonGroup\n exclusive\n size=\"small\"\n value={currentLanguage}\n onChange={handleSetLanguage}\n >\n {languages.map(language => {\n return (\n <TooltipToggleButton\n key={language}\n title={t('select_lng', { language })}\n value={language}\n >\n <>{language}</>\n </TooltipToggleButton>\n );\n })}\n </ToggleButtonGroup>\n </ListItemSecondaryAction>\n </ListItem>\n );\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { InfoCard, useSidebarPinState } from '@backstage/core-components';\nimport { List } from '@material-ui/core';\nimport React from 'react';\nimport { UserSettingsPinToggle } from './UserSettingsPinToggle';\nimport { UserSettingsThemeToggle } from './UserSettingsThemeToggle';\nimport { UserSettingsLanguageToggle } from './UserSettingsLanguageToggle';\n\n/** @public */\nexport const UserSettingsAppearanceCard = () => {\n const { isMobile } = useSidebarPinState();\n\n return (\n <InfoCard title=\"Appearance\" variant=\"gridItem\">\n <List dense>\n <UserSettingsThemeToggle />\n <UserSettingsLanguageToggle />\n {!isMobile && <UserSettingsPinToggle />}\n </List>\n </InfoCard>\n );\n};\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { InfoCard } from '@backstage/core-components';\nimport { EntityRefLinks } from '@backstage/plugin-catalog-react';\nimport Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport React from 'react';\nimport { useUserProfile } from '../useUserProfileInfo';\n\nconst Contents = () => {\n const { backstageIdentity } = useUserProfile();\n\n if (!backstageIdentity) {\n return <Typography>No Backstage Identity</Typography>;\n }\n\n return (\n <Grid container spacing={1}>\n <Grid item xs={12}>\n <Typography variant=\"subtitle1\" gutterBottom>\n User Entity:{' '}\n <EntityRefLinks\n entityRefs={[backstageIdentity.userEntityRef]}\n getTitle={ref => ref}\n />\n </Typography>\n </Grid>\n <Grid item xs={12}>\n <Typography variant=\"subtitle1\">\n Ownership Entities:{' '}\n <EntityRefLinks\n entityRefs={backstageIdentity.ownershipEntityRefs}\n getTitle={ref => ref}\n />\n </Typography>\n </Grid>\n </Grid>\n );\n};\n\n/** @public */\nexport const UserSettingsIdentityCard = () => (\n <InfoCard title=\"Backstage Identity\">\n <Contents />\n </InfoCard>\n);\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Grid } from '@material-ui/core';\nimport React from 'react';\nimport { UserSettingsProfileCard } from './UserSettingsProfileCard';\nimport { UserSettingsAppearanceCard } from './UserSettingsAppearanceCard';\nimport { UserSettingsIdentityCard } from './UserSettingsIdentityCard';\n\n/** @public */\nexport const UserSettingsGeneral = () => {\n return (\n <Grid container direction=\"row\" spacing={3}>\n <Grid item xs={12} md={6}>\n <UserSettingsProfileCard />\n </Grid>\n <Grid item xs={12} md={6}>\n <UserSettingsAppearanceCard />\n </Grid>\n <Grid item xs={12} md={6}>\n <UserSettingsIdentityCard />\n </Grid>\n </Grid>\n );\n};\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport { TabProps } from '@material-ui/core';\nimport {\n Header,\n Page,\n RoutedTabs,\n useSidebarPinState,\n} from '@backstage/core-components';\nimport {\n attachComponentData,\n useElementFilter,\n} from '@backstage/core-plugin-api';\n\n/** @public */\nexport type SettingsLayoutRouteProps = {\n path: string;\n title: string;\n children: JSX.Element;\n tabProps?: TabProps<React.ElementType, { component?: React.ElementType }>;\n};\n\nexport const LAYOUT_DATA_KEY = 'plugin.user-settings.settingsLayout';\nexport const LAYOUT_ROUTE_DATA_KEY = 'plugin.user-settings.settingsLayoutRoute';\n\nconst Route: (props: SettingsLayoutRouteProps) => null = () => null;\nattachComponentData(Route, LAYOUT_ROUTE_DATA_KEY, true);\n\n// This causes all mount points that are discovered within this route to use the path of the route itself\nattachComponentData(Route, 'core.gatherMountPoints', true);\n\n/** @public */\nexport type SettingsLayoutProps = {\n title?: string;\n subtitle?: string;\n children?: React.ReactNode;\n};\n\n/**\n * @public\n */\nexport const SettingsLayout = (props: SettingsLayoutProps) => {\n const { title, children } = props;\n const { isMobile } = useSidebarPinState();\n\n const routes = useElementFilter(children, elements =>\n elements\n .selectByComponentData({\n key: LAYOUT_ROUTE_DATA_KEY,\n withStrictError:\n 'Child of SettingsLayout must be an SettingsLayout.Route',\n })\n .getElements<SettingsLayoutRouteProps>()\n .map(child => child.props),\n );\n\n return (\n <Page themeId=\"home\">\n {!isMobile && <Header title={title ?? 'Settings'} />}\n <RoutedTabs routes={routes} />\n </Page>\n );\n};\n\nattachComponentData(SettingsLayout, LAYOUT_DATA_KEY, true);\n\nSettingsLayout.Route = Route;\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport { UserSettingsAuthProviders } from '../AuthProviders';\nimport { UserSettingsFeatureFlags } from '../FeatureFlags';\nimport { UserSettingsGeneral } from '../General';\nimport { SettingsLayout, SettingsLayoutRouteProps } from '../SettingsLayout';\n\n/**\n * @public\n */\nexport const DefaultSettingsPage = (props: {\n tabs?: React.ReactElement<SettingsLayoutRouteProps>[];\n providerSettings?: JSX.Element;\n}) => {\n const { providerSettings, tabs } = props;\n\n return (\n <SettingsLayout>\n <SettingsLayout.Route path=\"general\" title=\"General\">\n <UserSettingsGeneral />\n </SettingsLayout.Route>\n <SettingsLayout.Route\n path=\"auth-providers\"\n title=\"Authentication Providers\"\n >\n <UserSettingsAuthProviders providerSettings={providerSettings} />\n </SettingsLayout.Route>\n <SettingsLayout.Route path=\"feature-flags\" title=\"Feature Flags\">\n <UserSettingsFeatureFlags />\n </SettingsLayout.Route>\n {tabs}\n </SettingsLayout>\n );\n};\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useOutlet } from 'react-router-dom';\nimport React from 'react';\nimport { DefaultSettingsPage } from '../DefaultSettingsPage';\nimport { useElementFilter } from '@backstage/core-plugin-api';\nimport {\n SettingsLayoutProps,\n SettingsLayoutRouteProps,\n} from '../SettingsLayout';\nimport {\n LAYOUT_DATA_KEY,\n LAYOUT_ROUTE_DATA_KEY,\n} from '../SettingsLayout/SettingsLayout';\n\n/** @public */\nexport const SettingsPage = (props: { providerSettings?: JSX.Element }) => {\n const { providerSettings } = props;\n const outlet = useOutlet();\n const layout = useElementFilter(outlet, elements =>\n elements\n .selectByComponentData({\n key: LAYOUT_DATA_KEY,\n })\n .getElements<SettingsLayoutProps>(),\n );\n const tabs = useElementFilter(outlet, elements =>\n elements\n .selectByComponentData({\n key: LAYOUT_ROUTE_DATA_KEY,\n })\n .getElements<SettingsLayoutRouteProps>(),\n );\n\n return (\n <>\n {(layout.length !== 0 && layout) || (\n <DefaultSettingsPage tabs={tabs} providerSettings={providerSettings} />\n )}\n </>\n );\n};\n"],"names":["EXAMPLE","useStyles","TooltipToggleButton","Typography","Grid"],"mappings":";;;;;;;;;;;;;;;;;;;;AAoBA,MAAMA,SAAU,GAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA,CAAA;AAQT,MAAM,iBAAiB,sBAC5B,KAAA,CAAA,aAAA;AAAA,EAAC,UAAA;AAAA,EAAA;AAAA,IACC,OAAQ,EAAA,SAAA;AAAA,IACR,KAAM,EAAA,6BAAA;AAAA,IACN,WAAY,EAAA,qHAAA;AAAA,IACZ,MACE,kBAAA,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,kBACG,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA,EAAW,OAAQ,EAAA,OAAA,EAAA,EAAQ,OACrB,kBAAA,KAAA,CAAA,aAAA,CAAC,MAAK,EAAA,IAAA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AA,YAAA,GAAe,CAAC,KAA8C,KAAA;AACzE,EAAM,MAAA,EAAE,kBAAqB,GAAA,KAAA,CAAA;AAC7B,EAAA,MAAM,SAAS,SAAU,EAAA,CAAA;AACzB,EAAA,MAAM,MAAS,GAAA,gBAAA;AAAA,IAAiB,MAAA;AAAA,IAAQ,CAAA,QAAA,KACtC,SACG,qBAAsB,CAAA;AAAA,MACrB,GAAK,EAAA,eAAA;AAAA,KACN,EACA,WAAiC,EAAA;AAAA,GACtC,CAAA;AACA,EAAA,MAAM,IAAO,GAAA,gBAAA;AAAA,IAAiB,MAAA;AAAA,IAAQ,CAAA,QAAA,KACpC,SACG,qBAAsB,CAAA;AAAA,MACrB,GAAK,EAAA,qBAAA;AAAA,KACN,EACA,WAAsC,EAAA;AAAA,GAC3C,CAAA;AAEA,EACE,uBAAA,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,EACI,OAAO,MAAW,KAAA,CAAA,IAAK,0BACtB,KAAA,CAAA,aAAA,CAAA,mBAAA,EAAA,EAAoB,IAAY,EAAA,gBAAA,EAAoC,CAEzE,CAAA,CAAA;AAEJ;;;;"}
|
|
1
|
+
{"version":3,"file":"SettingsPage-70c1c7c8.esm.js","sources":["../../src/components/AuthProviders/EmptyProviders.tsx","../../src/components/AuthProviders/ProviderSettingsAvatar.tsx","../../src/components/AuthProviders/ProviderSettingsItem.tsx","../../src/components/AuthProviders/DefaultProviderSettings.tsx","../../src/components/AuthProviders/UserSettingsAuthProviders.tsx","../../src/components/FeatureFlags/EmptyFlags.tsx","../../src/components/FeatureFlags/FeatureFlagsItem.tsx","../../src/components/FeatureFlags/UserSettingsFeatureFlags.tsx","../../src/components/useUserProfileInfo.ts","../../src/components/General/UserSettingsSignInAvatar.tsx","../../src/components/General/UserSettingsMenu.tsx","../../src/components/General/UserSettingsProfileCard.tsx","../../src/components/General/UserSettingsPinToggle.tsx","../../src/components/General/UserSettingsThemeToggle.tsx","../../src/components/General/UserSettingsLanguageToggle.tsx","../../src/components/General/UserSettingsAppearanceCard.tsx","../../src/components/General/UserSettingsIdentityCard.tsx","../../src/components/General/UserSettingsGeneral.tsx","../../src/components/SettingsLayout/SettingsLayout.tsx","../../src/components/DefaultSettingsPage/DefaultSettingsPage.tsx","../../src/components/SettingsPage/SettingsPage.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport { Button, Typography } from '@material-ui/core';\nimport { CodeSnippet, EmptyState } from '@backstage/core-components';\n\nconst EXAMPLE = `auth:\n providers:\n google:\n development:\n clientId: \\${AUTH_GOOGLE_CLIENT_ID}\n clientSecret: \\${AUTH_GOOGLE_CLIENT_SECRET}\n`;\n\nexport const EmptyProviders = () => (\n <EmptyState\n missing=\"content\"\n title=\"No Authentication Providers\"\n description=\"You can add Authentication Providers to Backstage which allows you to use these providers to authenticate yourself.\"\n action={\n <>\n <Typography variant=\"body1\">\n Open <code>app-config.yaml</code> and make the changes as highlighted\n below:\n </Typography>\n <CodeSnippet\n text={EXAMPLE}\n language=\"yaml\"\n showLineNumbers\n highlightedNumbers={[3, 4, 5, 6, 7, 8]}\n customStyle={{ background: 'inherit', fontSize: '115%' }}\n />\n <Button\n variant=\"contained\"\n color=\"primary\"\n href=\"https://backstage.io/docs/auth/add-auth-provider\"\n >\n Read More\n </Button>\n </>\n }\n />\n);\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport { BackstageTheme } from '@backstage/theme';\nimport { makeStyles, Avatar } from '@material-ui/core';\nimport { sidebarConfig } from '@backstage/core-components';\n\nconst useStyles = makeStyles<BackstageTheme, { size: number }>(theme => ({\n avatar: {\n width: ({ size }) => size,\n height: ({ size }) => size,\n fontSize: ({ size }) => size * 0.7,\n border: `1px solid ${theme.palette.textSubtle}`,\n },\n}));\n\ntype Props = { size?: number; picture: string | undefined };\n\nexport const ProviderSettingsAvatar = ({ size, picture }: Props) => {\n const { iconSize } = sidebarConfig;\n const classes = useStyles(size ? { size } : { size: iconSize });\n\n return <Avatar src={picture} className={classes.avatar} />;\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { useEffect, useState } from 'react';\nimport {\n Button,\n Grid,\n ListItem,\n ListItemIcon,\n ListItemSecondaryAction,\n ListItemText,\n Tooltip,\n Typography,\n} from '@material-ui/core';\nimport {\n ApiRef,\n SessionApi,\n SessionState,\n ProfileInfoApi,\n ProfileInfo,\n useApi,\n errorApiRef,\n IconComponent,\n} from '@backstage/core-plugin-api';\nimport { ProviderSettingsAvatar } from './ProviderSettingsAvatar';\n\nconst emptyProfile: ProfileInfo = {};\n\n/** @public */\nexport const ProviderSettingsItem = (props: {\n title: string;\n description: string;\n icon: IconComponent;\n apiRef: ApiRef<ProfileInfoApi & SessionApi>;\n}) => {\n const { title, description, icon: Icon, apiRef } = props;\n\n const api = useApi(apiRef);\n const errorApi = useApi(errorApiRef);\n const [signedIn, setSignedIn] = useState(false);\n const [profile, setProfile] = useState<ProfileInfo>(emptyProfile);\n\n useEffect(() => {\n let didCancel = false;\n\n const subscription = api\n .sessionState$()\n .subscribe((sessionState: SessionState) => {\n if (sessionState !== SessionState.SignedIn) {\n setProfile(emptyProfile);\n setSignedIn(false);\n }\n if (!didCancel) {\n api\n .getProfile({ optional: true })\n .then((profileResponse: ProfileInfo | undefined) => {\n if (!didCancel) {\n if (sessionState === SessionState.SignedIn) {\n setSignedIn(true);\n }\n if (profileResponse) {\n setProfile(profileResponse);\n }\n }\n });\n }\n });\n\n return () => {\n didCancel = true;\n subscription.unsubscribe();\n };\n }, [api]);\n\n return (\n <ListItem>\n <ListItemIcon>\n <Icon />\n </ListItemIcon>\n <ListItemText\n primary={title}\n secondary={\n <Tooltip placement=\"top\" arrow title={description}>\n <Grid container spacing={6}>\n <Grid item>\n <ProviderSettingsAvatar size={48} picture={profile.picture} />\n </Grid>\n <Grid item xs={12} sm container>\n <Grid item xs container direction=\"column\" spacing={2}>\n <Grid item xs>\n <Typography\n variant=\"subtitle1\"\n color=\"textPrimary\"\n gutterBottom\n >\n {profile.displayName}\n </Typography>\n <Typography variant=\"body2\" color=\"textSecondary\">\n {profile.email}\n </Typography>\n <Typography variant=\"body2\" color=\"textSecondary\">\n {description}\n </Typography>\n </Grid>\n </Grid>\n </Grid>\n </Grid>\n </Tooltip>\n }\n secondaryTypographyProps={{ noWrap: true, style: { width: '80%' } }}\n />\n <ListItemSecondaryAction>\n <Tooltip\n placement=\"top\"\n arrow\n title={signedIn ? `Sign out from ${title}` : `Sign in to ${title}`}\n >\n <Button\n variant=\"outlined\"\n color=\"primary\"\n onClick={() => {\n const action = signedIn ? api.signOut() : api.signIn();\n action.catch(error => errorApi.post(error));\n }}\n >\n {signedIn ? `Sign out` : `Sign in`}\n </Button>\n </Tooltip>\n </ListItemSecondaryAction>\n </ListItem>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Star from '@material-ui/icons/Star';\nimport React from 'react';\nimport { ProviderSettingsItem } from './ProviderSettingsItem';\nimport {\n githubAuthApiRef,\n gitlabAuthApiRef,\n googleAuthApiRef,\n oktaAuthApiRef,\n microsoftAuthApiRef,\n bitbucketAuthApiRef,\n bitbucketServerAuthApiRef,\n atlassianAuthApiRef,\n oneloginAuthApiRef,\n} from '@backstage/core-plugin-api';\n\n/** @public */\nexport const DefaultProviderSettings = (props: {\n configuredProviders: string[];\n}) => {\n const { configuredProviders } = props;\n return (\n <>\n {configuredProviders.includes('google') && (\n <ProviderSettingsItem\n title=\"Google\"\n description=\"Provides authentication towards Google APIs and identities\"\n apiRef={googleAuthApiRef}\n icon={Star}\n />\n )}\n {configuredProviders.includes('microsoft') && (\n <ProviderSettingsItem\n title=\"Microsoft\"\n description=\"Provides authentication towards Microsoft APIs and identities\"\n apiRef={microsoftAuthApiRef}\n icon={Star}\n />\n )}\n {configuredProviders.includes('github') && (\n <ProviderSettingsItem\n title=\"GitHub\"\n description=\"Provides authentication towards GitHub APIs\"\n apiRef={githubAuthApiRef}\n icon={Star}\n />\n )}\n {configuredProviders.includes('gitlab') && (\n <ProviderSettingsItem\n title=\"GitLab\"\n description=\"Provides authentication towards GitLab APIs\"\n apiRef={gitlabAuthApiRef}\n icon={Star}\n />\n )}\n {configuredProviders.includes('okta') && (\n <ProviderSettingsItem\n title=\"Okta\"\n description=\"Provides authentication towards Okta APIs\"\n apiRef={oktaAuthApiRef}\n icon={Star}\n />\n )}\n {configuredProviders.includes('bitbucket') && (\n <ProviderSettingsItem\n title=\"Bitbucket\"\n description=\"Provides authentication towards Bitbucket APIs\"\n apiRef={bitbucketAuthApiRef}\n icon={Star}\n />\n )}\n {configuredProviders.includes('onelogin') && (\n <ProviderSettingsItem\n title=\"OneLogin\"\n description=\"Provides authentication towards OneLogin APIs\"\n apiRef={oneloginAuthApiRef}\n icon={Star}\n />\n )}\n {configuredProviders.includes('atlassian') && (\n <ProviderSettingsItem\n title=\"Atlassian\"\n description=\"Provides authentication towards Atlassian APIs\"\n apiRef={atlassianAuthApiRef}\n icon={Star}\n />\n )}\n {configuredProviders.includes('bitbucketServer') && (\n <ProviderSettingsItem\n title=\"Bitbucket Server\"\n description=\"Provides authentication towards Bitbucket Server APIs\"\n apiRef={bitbucketServerAuthApiRef}\n icon={Star}\n />\n )}\n </>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport { List } from '@material-ui/core';\nimport { EmptyProviders } from './EmptyProviders';\nimport { DefaultProviderSettings } from './DefaultProviderSettings';\nimport { configApiRef, useApi } from '@backstage/core-plugin-api';\nimport { InfoCard } from '@backstage/core-components';\n\n/** @public */\nexport const UserSettingsAuthProviders = (props: {\n providerSettings?: JSX.Element;\n}) => {\n const { providerSettings } = props;\n const configApi = useApi(configApiRef);\n const providersConfig = configApi.getOptionalConfig('auth.providers');\n const configuredProviders = providersConfig?.keys() || [];\n const providers = providerSettings ?? (\n <DefaultProviderSettings configuredProviders={configuredProviders} />\n );\n\n if (!providerSettings && !configuredProviders?.length) {\n return <EmptyProviders />;\n }\n\n return (\n <InfoCard title=\"Available Providers\">\n <List dense>{providers}</List>\n </InfoCard>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport { Button, Typography } from '@material-ui/core';\nimport { CodeSnippet, EmptyState } from '@backstage/core-components';\n\nconst EXAMPLE = `import { createPlugin } from '@backstage/core-plugin-api';\n\nexport default createPlugin({\n id: 'plugin-name',\n featureFlags: [{ name: 'enable-example-feature' }],\n});\n`;\n\nexport const EmptyFlags = () => (\n <EmptyState\n missing=\"content\"\n title=\"No Feature Flags\"\n description=\"Feature Flags make it possible for plugins to register features in Backstage for users to opt into. You can use this to split out logic in your code for manual A/B testing, etc.\"\n action={\n <>\n <Typography variant=\"body1\">\n An example for how to add a feature flag is highlighted below:\n </Typography>\n <CodeSnippet\n text={EXAMPLE}\n language=\"typescript\"\n showLineNumbers\n highlightedNumbers={[6]}\n customStyle={{ background: 'inherit', fontSize: '115%' }}\n />\n <Button\n variant=\"contained\"\n color=\"primary\"\n href=\"https://backstage.io/docs/api/utility-apis\"\n >\n Read More\n </Button>\n </>\n }\n />\n);\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport {\n ListItem,\n ListItemText,\n ListItemIcon,\n Switch,\n Tooltip,\n} from '@material-ui/core';\nimport { FeatureFlag } from '@backstage/core-plugin-api';\n\ntype Props = {\n flag: FeatureFlag;\n enabled: boolean;\n toggleHandler: Function;\n};\n\nconst getSecondaryText = (flag: FeatureFlag) => {\n if (flag.description) {\n return flag.description;\n }\n return flag.pluginId\n ? `Registered in ${flag.pluginId} plugin`\n : 'Registered in the application';\n};\n\nexport const FlagItem = ({ flag, enabled, toggleHandler }: Props) => (\n <ListItem divider button onClick={() => toggleHandler(flag.name)}>\n <ListItemIcon>\n <Tooltip placement=\"top\" arrow title={enabled ? 'Disable' : 'Enable'}>\n <Switch color=\"primary\" checked={enabled} name={flag.name} />\n </Tooltip>\n </ListItemIcon>\n <ListItemText primary={flag.name} secondary={getSecondaryText(flag)} />\n </ListItem>\n);\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { useCallback, useState } from 'react';\nimport {\n List,\n TextField,\n IconButton,\n Grid,\n Typography,\n} from '@material-ui/core';\nimport { EmptyFlags } from './EmptyFlags';\nimport { FlagItem } from './FeatureFlagsItem';\nimport {\n FeatureFlag,\n FeatureFlagsApi,\n featureFlagsApiRef,\n FeatureFlagState,\n useApi,\n} from '@backstage/core-plugin-api';\nimport { InfoCard } from '@backstage/core-components';\nimport ClearIcon from '@material-ui/icons/Clear';\n\nexport const sortFlags = (\n flags: FeatureFlag[],\n featureFlagsApi: FeatureFlagsApi,\n): FeatureFlag[] => {\n const activeFlags = flags.filter(flag => featureFlagsApi.isActive(flag.name));\n const idleFlags = flags.filter(flag => !featureFlagsApi.isActive(flag.name));\n return [...activeFlags, ...idleFlags];\n};\n\n/** @public */\nexport const UserSettingsFeatureFlags = () => {\n const featureFlagsApi = useApi(featureFlagsApiRef);\n const inputRef = React.useRef<HTMLElement>();\n\n const initialFeatureFlags = featureFlagsApi.getRegisteredFlags();\n const initialFeatureFlagsSorted = sortFlags(\n initialFeatureFlags,\n featureFlagsApi,\n );\n const [featureFlags] = useState(initialFeatureFlagsSorted);\n\n const initialFlagState = Object.fromEntries(\n featureFlags.map(({ name }) => [name, featureFlagsApi.isActive(name)]),\n );\n\n const [state, setState] = useState<Record<string, boolean>>(initialFlagState);\n const [filterInput, setFilterInput] = useState<string>('');\n\n const toggleFlag = useCallback(\n (flagName: string) => {\n const newState = featureFlagsApi.isActive(flagName)\n ? FeatureFlagState.None\n : FeatureFlagState.Active;\n\n featureFlagsApi.save({\n states: { [flagName]: newState },\n merge: true,\n });\n\n setState(prevState => ({\n ...prevState,\n [flagName]: newState === FeatureFlagState.Active,\n }));\n },\n [featureFlagsApi],\n );\n\n if (!featureFlags.length) {\n return <EmptyFlags />;\n }\n\n const clearFilterInput = () => {\n setFilterInput('');\n inputRef?.current?.focus();\n };\n\n const filteredFeatureFlags = featureFlags.filter(featureFlag => {\n const featureFlagName = featureFlag.name.toLocaleLowerCase('en-US');\n return featureFlagName.includes(filterInput.toLocaleLowerCase('en-US'));\n });\n\n const Header = () => (\n <Grid container style={{ justifyContent: 'space-between' }}>\n <Grid item xs={6} md={8}>\n <Typography variant=\"h5\">Feature Flags</Typography>\n <Typography variant=\"subtitle1\">\n Please refresh the page when toggling feature flags\n </Typography>\n </Grid>\n {featureFlags.length >= 10 && (\n <Grid item xs={6} md={4}>\n <TextField\n label=\"Filter\"\n style={{ display: 'flex', justifyContent: 'flex-end' }}\n inputRef={ref => ref && ref.focus()}\n InputProps={{\n ...(filterInput.length && {\n endAdornment: (\n <IconButton\n aria-label=\"Clear filter\"\n onClick={clearFilterInput}\n edge=\"end\"\n >\n <ClearIcon />\n </IconButton>\n ),\n }),\n }}\n onChange={e => setFilterInput(e.target.value)}\n value={filterInput}\n />\n </Grid>\n )}\n </Grid>\n );\n\n return (\n <InfoCard title={<Header />}>\n <List dense>\n {filteredFeatureFlags.map(featureFlag => {\n const enabled = Boolean(state[featureFlag.name]);\n\n return (\n <FlagItem\n key={featureFlag.name}\n flag={featureFlag}\n enabled={enabled}\n toggleHandler={toggleFlag}\n />\n );\n })}\n </List>\n </InfoCard>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n alertApiRef,\n identityApiRef,\n ProfileInfo,\n useApi,\n} from '@backstage/core-plugin-api';\nimport { useEffect } from 'react';\nimport useAsync from 'react-use/lib/useAsync';\n\n/** @public */\nexport const useUserProfile = () => {\n const identityApi = useApi(identityApiRef);\n const alertApi = useApi(alertApiRef);\n\n const { value, loading, error } = useAsync(async () => {\n return {\n profile: await identityApi.getProfileInfo(),\n identity: await identityApi.getBackstageIdentity(),\n };\n }, []);\n\n useEffect(() => {\n if (error) {\n alertApi.post({\n message: `Failed to load user identity: ${error}`,\n severity: 'error',\n });\n }\n }, [error, alertApi]);\n\n if (loading || error) {\n return {\n profile: {} as ProfileInfo,\n displayName: '',\n loading,\n };\n }\n\n return {\n profile: value!.profile,\n backstageIdentity: value!.identity,\n displayName: value!.profile.displayName ?? value!.identity.userEntityRef,\n loading,\n };\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport { BackstageTheme } from '@backstage/theme';\nimport { makeStyles, Avatar } from '@material-ui/core';\nimport { useUserProfile } from '../useUserProfileInfo';\nimport { sidebarConfig } from '@backstage/core-components';\n\nconst useStyles = makeStyles<BackstageTheme, { size: number }>(theme => ({\n avatar: {\n width: ({ size }) => size,\n height: ({ size }) => size,\n fontSize: ({ size }) => size * 0.7,\n border: `1px solid ${theme.palette.textSubtle}`,\n },\n}));\n\n/** @public */\nexport const UserSettingsSignInAvatar = (props: { size?: number }) => {\n const { size } = props;\n\n const { iconSize } = sidebarConfig;\n const classes = useStyles(size ? { size } : { size: iconSize });\n const { profile } = useUserProfile();\n\n return (\n <Avatar\n src={profile.picture}\n className={classes.avatar}\n alt=\"Profile picture\"\n />\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport { IconButton, ListItemIcon, Menu, MenuItem } from '@material-ui/core';\nimport SignOutIcon from '@material-ui/icons/MeetingRoom';\nimport MoreVertIcon from '@material-ui/icons/MoreVert';\nimport {\n identityApiRef,\n errorApiRef,\n useApi,\n} from '@backstage/core-plugin-api';\n\n/** @public */\nexport const UserSettingsMenu = () => {\n const errorApi = useApi(errorApiRef);\n const identityApi = useApi(identityApiRef);\n const [open, setOpen] = React.useState(false);\n const [anchorEl, setAnchorEl] = React.useState<undefined | HTMLElement>(\n undefined,\n );\n\n const handleOpen = (event: React.MouseEvent<HTMLButtonElement>) => {\n setAnchorEl(event.currentTarget);\n setOpen(true);\n };\n\n const handleClose = () => {\n setAnchorEl(undefined);\n setOpen(false);\n };\n\n return (\n <>\n <IconButton\n data-testid=\"user-settings-menu\"\n aria-label=\"more\"\n onClick={handleOpen}\n >\n <MoreVertIcon />\n </IconButton>\n <Menu anchorEl={anchorEl} open={open} onClose={handleClose}>\n <MenuItem\n data-testid=\"sign-out\"\n onClick={() =>\n identityApi.signOut().catch(error => errorApi.post(error))\n }\n >\n <ListItemIcon>\n <SignOutIcon />\n </ListItemIcon>\n Sign Out\n </MenuItem>\n </Menu>\n </>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Grid, Typography } from '@material-ui/core';\nimport React from 'react';\nimport { UserSettingsSignInAvatar } from './UserSettingsSignInAvatar';\nimport { UserSettingsMenu } from './UserSettingsMenu';\nimport { useUserProfile } from '../useUserProfileInfo';\nimport { InfoCard } from '@backstage/core-components';\n\n/** @public */\nexport const UserSettingsProfileCard = () => {\n const { profile, displayName } = useUserProfile();\n\n return (\n <InfoCard title=\"Profile\" variant=\"gridItem\">\n <Grid container spacing={6}>\n <Grid item>\n <UserSettingsSignInAvatar size={96} />\n </Grid>\n <Grid item xs={12} sm container>\n <Grid item xs container direction=\"column\" spacing={2}>\n <Grid item xs>\n <Typography variant=\"subtitle1\" gutterBottom>\n {displayName}\n </Typography>\n {profile.email && (\n <Typography variant=\"body2\" color=\"textSecondary\">\n {profile.email}\n </Typography>\n )}\n </Grid>\n </Grid>\n <Grid item>\n <UserSettingsMenu />\n </Grid>\n </Grid>\n </Grid>\n </InfoCard>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport {\n ListItem,\n ListItemSecondaryAction,\n ListItemText,\n Switch,\n Tooltip,\n} from '@material-ui/core';\nimport { useSidebarPinState } from '@backstage/core-components';\n\n/** @public */\nexport const UserSettingsPinToggle = () => {\n const { isPinned, toggleSidebarPinState } = useSidebarPinState();\n\n return (\n <ListItem>\n <ListItemText\n primary=\"Pin Sidebar\"\n secondary=\"Prevent the sidebar from collapsing\"\n />\n <ListItemSecondaryAction>\n <Tooltip\n placement=\"top\"\n arrow\n title={`${isPinned ? 'Unpin' : 'Pin'} Sidebar`}\n >\n <Switch\n color=\"primary\"\n checked={isPinned}\n onChange={() => toggleSidebarPinState()}\n name=\"pin\"\n inputProps={{ 'aria-label': 'Pin Sidebar Switch' }}\n />\n </Tooltip>\n </ListItemSecondaryAction>\n </ListItem>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { cloneElement } from 'react';\nimport useObservable from 'react-use/lib/useObservable';\nimport AutoIcon from '@material-ui/icons/BrightnessAuto';\nimport ToggleButton from '@material-ui/lab/ToggleButton';\nimport ToggleButtonGroup from '@material-ui/lab/ToggleButtonGroup';\nimport {\n ListItem,\n ListItemText,\n ListItemSecondaryAction,\n Tooltip,\n makeStyles,\n} from '@material-ui/core';\nimport { appThemeApiRef, useApi } from '@backstage/core-plugin-api';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { userSettingsTranslationRef } from '../../translation';\n\ntype ThemeIconProps = {\n id: string;\n activeId: string | undefined;\n icon: JSX.Element | undefined;\n};\n\nconst ThemeIcon = ({ id, activeId, icon }: ThemeIconProps) =>\n icon ? (\n cloneElement(icon, {\n color: activeId === id ? 'primary' : undefined,\n })\n ) : (\n <AutoIcon color={activeId === id ? 'primary' : undefined} />\n );\n\ntype TooltipToggleButtonProps = {\n children: JSX.Element;\n title: string;\n value: string;\n};\n\nconst useStyles = makeStyles(theme => ({\n container: {\n display: 'flex',\n flexWrap: 'wrap',\n width: '100%',\n justifyContent: 'space-between',\n alignItems: 'center',\n paddingBottom: 8,\n paddingRight: 16,\n },\n list: {\n width: 'initial',\n [theme.breakpoints.down('xs')]: {\n width: '100%',\n padding: `0 0 12px`,\n },\n },\n listItemText: {\n paddingRight: 0,\n paddingLeft: 0,\n },\n listItemSecondaryAction: {\n position: 'relative',\n transform: 'unset',\n top: 'auto',\n right: 'auto',\n paddingLeft: 16,\n [theme.breakpoints.down('xs')]: {\n paddingLeft: 0,\n },\n },\n}));\n\n// ToggleButtonGroup uses React.children.map instead of context\n// so wrapping with Tooltip breaks ToggleButton functionality.\nconst TooltipToggleButton = ({\n children,\n title,\n value,\n ...props\n}: TooltipToggleButtonProps) => (\n <Tooltip placement=\"top\" arrow title={title}>\n <ToggleButton value={value} {...props}>\n {children}\n </ToggleButton>\n </Tooltip>\n);\n\n/** @public */\nexport const UserSettingsThemeToggle = () => {\n const classes = useStyles();\n const appThemeApi = useApi(appThemeApiRef);\n const activeThemeId = useObservable(\n appThemeApi.activeThemeId$(),\n appThemeApi.getActiveThemeId(),\n );\n\n const themeIds = appThemeApi.getInstalledThemes();\n\n const { t } = useTranslationRef(userSettingsTranslationRef);\n\n const handleSetTheme = (\n _event: React.MouseEvent<HTMLElement>,\n newThemeId: string | undefined,\n ) => {\n if (themeIds.some(it => it.id === newThemeId)) {\n appThemeApi.setActiveThemeId(newThemeId);\n } else {\n appThemeApi.setActiveThemeId(undefined);\n }\n };\n\n return (\n <ListItem\n className={classes.list}\n classes={{ container: classes.container }}\n >\n <ListItemText\n className={classes.listItemText}\n primary={t('theme')}\n secondary={t('change_the_theme_mode')}\n />\n <ListItemSecondaryAction className={classes.listItemSecondaryAction}>\n <ToggleButtonGroup\n exclusive\n size=\"small\"\n value={activeThemeId ?? 'auto'}\n onChange={handleSetTheme}\n >\n {themeIds.map(theme => {\n const themeId = theme.id;\n const themeIcon = theme.icon;\n const themeTitle =\n theme.title ||\n (themeId === 'light' || themeId === 'dark'\n ? t(`theme_${themeId}`)\n : themeId);\n return (\n <TooltipToggleButton\n key={themeId}\n title={t('select_theme', { theme: themeTitle })}\n value={themeId}\n >\n <>\n {themeTitle} \n <ThemeIcon\n id={themeId}\n icon={themeIcon}\n activeId={activeThemeId}\n />\n </>\n </TooltipToggleButton>\n );\n })}\n <Tooltip placement=\"top\" arrow title={t('select_theme_auto')}>\n <ToggleButton value=\"auto\" selected={activeThemeId === undefined}>\n {t('theme_auto')} \n <AutoIcon\n color={activeThemeId === undefined ? 'primary' : undefined}\n />\n </ToggleButton>\n </Tooltip>\n </ToggleButtonGroup>\n </ListItemSecondaryAction>\n </ListItem>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { useState } from 'react';\nimport {\n useTranslationRef,\n appLanguageApiRef,\n} from '@backstage/core-plugin-api/alpha';\nimport ToggleButton from '@material-ui/lab/ToggleButton';\nimport ToggleButtonGroup from '@material-ui/lab/ToggleButtonGroup';\nimport {\n ListItem,\n ListItemText,\n ListItemSecondaryAction,\n Tooltip,\n makeStyles,\n} from '@material-ui/core';\nimport { userSettingsTranslationRef } from '../../translation';\nimport { useApi } from '@backstage/core-plugin-api';\nimport useObservable from 'react-use/lib/useObservable';\n\ntype TooltipToggleButtonProps = {\n children: JSX.Element;\n title: string;\n value: string;\n};\n\nconst useStyles = makeStyles(theme => ({\n container: {\n display: 'flex',\n flexWrap: 'wrap',\n width: '100%',\n justifyContent: 'space-between',\n alignItems: 'center',\n paddingBottom: 8,\n paddingRight: 16,\n },\n list: {\n width: 'initial',\n [theme.breakpoints.down('xs')]: {\n width: '100%',\n padding: `0 0 12px`,\n },\n },\n listItemText: {\n paddingRight: 0,\n paddingLeft: 0,\n },\n listItemSecondaryAction: {\n position: 'relative',\n transform: 'unset',\n top: 'auto',\n right: 'auto',\n paddingLeft: 16,\n [theme.breakpoints.down('xs')]: {\n paddingLeft: 0,\n },\n },\n}));\n\n// ToggleButtonGroup uses React.children.map instead of context\n// so wrapping with Tooltip breaks ToggleButton functionality.\nconst TooltipToggleButton = ({\n children,\n title,\n value,\n ...props\n}: TooltipToggleButtonProps) => (\n <Tooltip placement=\"top\" arrow title={title}>\n <ToggleButton value={value} {...props}>\n {children}\n </ToggleButton>\n </Tooltip>\n);\n\n/** @public */\nexport const UserSettingsLanguageToggle = () => {\n const classes = useStyles();\n const languageApi = useApi(appLanguageApiRef);\n const { t } = useTranslationRef(userSettingsTranslationRef);\n\n const [languageObservable] = useState(() => languageApi.language$());\n const { language: currentLanguage } = useObservable(\n languageObservable,\n languageApi.getLanguage(),\n );\n\n const { languages } = languageApi.getAvailableLanguages();\n\n if (languages.length <= 1) {\n return null;\n }\n\n const handleSetLanguage = (\n _event: React.MouseEvent<HTMLElement>,\n newLanguage: string | undefined,\n ) => {\n languageApi.setLanguage(newLanguage);\n };\n\n return (\n <ListItem\n className={classes.list}\n classes={{ container: classes.container }}\n >\n <ListItemText\n className={classes.listItemText}\n primary={t('language')}\n secondary={t('change_the_language')}\n />\n <ListItemSecondaryAction className={classes.listItemSecondaryAction}>\n <ToggleButtonGroup\n exclusive\n size=\"small\"\n value={currentLanguage}\n onChange={handleSetLanguage}\n >\n {languages.map(language => {\n return (\n <TooltipToggleButton\n key={language}\n title={t('select_lng', { language })}\n value={language}\n >\n <>{language}</>\n </TooltipToggleButton>\n );\n })}\n </ToggleButtonGroup>\n </ListItemSecondaryAction>\n </ListItem>\n );\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { InfoCard, useSidebarPinState } from '@backstage/core-components';\nimport { List } from '@material-ui/core';\nimport React from 'react';\nimport { UserSettingsPinToggle } from './UserSettingsPinToggle';\nimport { UserSettingsThemeToggle } from './UserSettingsThemeToggle';\nimport { UserSettingsLanguageToggle } from './UserSettingsLanguageToggle';\n\n/** @public */\nexport const UserSettingsAppearanceCard = () => {\n const { isMobile } = useSidebarPinState();\n\n return (\n <InfoCard title=\"Appearance\" variant=\"gridItem\">\n <List dense>\n <UserSettingsThemeToggle />\n <UserSettingsLanguageToggle />\n {!isMobile && <UserSettingsPinToggle />}\n </List>\n </InfoCard>\n );\n};\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { InfoCard } from '@backstage/core-components';\nimport { EntityRefLinks } from '@backstage/plugin-catalog-react';\nimport Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport React from 'react';\nimport { useUserProfile } from '../useUserProfileInfo';\n\nconst Contents = () => {\n const { backstageIdentity } = useUserProfile();\n\n if (!backstageIdentity) {\n return <Typography>No Backstage Identity</Typography>;\n }\n\n return (\n <Grid container spacing={1}>\n <Grid item xs={12}>\n <Typography variant=\"subtitle1\" gutterBottom>\n User Entity:{' '}\n <EntityRefLinks entityRefs={[backstageIdentity.userEntityRef]} />\n </Typography>\n </Grid>\n <Grid item xs={12}>\n <Typography variant=\"subtitle1\">\n Ownership Entities:{' '}\n <EntityRefLinks entityRefs={backstageIdentity.ownershipEntityRefs} />\n </Typography>\n </Grid>\n </Grid>\n );\n};\n\n/** @public */\nexport const UserSettingsIdentityCard = () => (\n <InfoCard title=\"Backstage Identity\">\n <Contents />\n </InfoCard>\n);\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Grid } from '@material-ui/core';\nimport React from 'react';\nimport { UserSettingsProfileCard } from './UserSettingsProfileCard';\nimport { UserSettingsAppearanceCard } from './UserSettingsAppearanceCard';\nimport { UserSettingsIdentityCard } from './UserSettingsIdentityCard';\n\n/** @public */\nexport const UserSettingsGeneral = () => {\n return (\n <Grid container direction=\"row\" spacing={3}>\n <Grid item xs={12} md={6}>\n <UserSettingsProfileCard />\n </Grid>\n <Grid item xs={12} md={6}>\n <UserSettingsAppearanceCard />\n </Grid>\n <Grid item xs={12} md={6}>\n <UserSettingsIdentityCard />\n </Grid>\n </Grid>\n );\n};\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport { TabProps } from '@material-ui/core';\nimport {\n Header,\n Page,\n RoutedTabs,\n useSidebarPinState,\n} from '@backstage/core-components';\nimport {\n attachComponentData,\n useElementFilter,\n} from '@backstage/core-plugin-api';\n\n/** @public */\nexport type SettingsLayoutRouteProps = {\n path: string;\n title: string;\n children: JSX.Element;\n tabProps?: TabProps<React.ElementType, { component?: React.ElementType }>;\n};\n\nexport const LAYOUT_DATA_KEY = 'plugin.user-settings.settingsLayout';\nexport const LAYOUT_ROUTE_DATA_KEY = 'plugin.user-settings.settingsLayoutRoute';\n\nconst Route: (props: SettingsLayoutRouteProps) => null = () => null;\nattachComponentData(Route, LAYOUT_ROUTE_DATA_KEY, true);\n\n// This causes all mount points that are discovered within this route to use the path of the route itself\nattachComponentData(Route, 'core.gatherMountPoints', true);\n\n/** @public */\nexport type SettingsLayoutProps = {\n title?: string;\n subtitle?: string;\n children?: React.ReactNode;\n};\n\n/**\n * @public\n */\nexport const SettingsLayout = (props: SettingsLayoutProps) => {\n const { title, children } = props;\n const { isMobile } = useSidebarPinState();\n\n const routes = useElementFilter(children, elements =>\n elements\n .selectByComponentData({\n key: LAYOUT_ROUTE_DATA_KEY,\n withStrictError:\n 'Child of SettingsLayout must be an SettingsLayout.Route',\n })\n .getElements<SettingsLayoutRouteProps>()\n .map(child => child.props),\n );\n\n return (\n <Page themeId=\"home\">\n {!isMobile && <Header title={title ?? 'Settings'} />}\n <RoutedTabs routes={routes} />\n </Page>\n );\n};\n\nattachComponentData(SettingsLayout, LAYOUT_DATA_KEY, true);\n\nSettingsLayout.Route = Route;\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport { UserSettingsAuthProviders } from '../AuthProviders';\nimport { UserSettingsFeatureFlags } from '../FeatureFlags';\nimport { UserSettingsGeneral } from '../General';\nimport { SettingsLayout, SettingsLayoutRouteProps } from '../SettingsLayout';\n\n/**\n * @public\n */\nexport const DefaultSettingsPage = (props: {\n tabs?: React.ReactElement<SettingsLayoutRouteProps>[];\n providerSettings?: JSX.Element;\n}) => {\n const { providerSettings, tabs } = props;\n\n return (\n <SettingsLayout>\n <SettingsLayout.Route path=\"general\" title=\"General\">\n <UserSettingsGeneral />\n </SettingsLayout.Route>\n <SettingsLayout.Route\n path=\"auth-providers\"\n title=\"Authentication Providers\"\n >\n <UserSettingsAuthProviders providerSettings={providerSettings} />\n </SettingsLayout.Route>\n <SettingsLayout.Route path=\"feature-flags\" title=\"Feature Flags\">\n <UserSettingsFeatureFlags />\n </SettingsLayout.Route>\n {tabs}\n </SettingsLayout>\n );\n};\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useOutlet } from 'react-router-dom';\nimport React from 'react';\nimport { DefaultSettingsPage } from '../DefaultSettingsPage';\nimport { useElementFilter } from '@backstage/core-plugin-api';\nimport {\n SettingsLayoutProps,\n SettingsLayoutRouteProps,\n} from '../SettingsLayout';\nimport {\n LAYOUT_DATA_KEY,\n LAYOUT_ROUTE_DATA_KEY,\n} from '../SettingsLayout/SettingsLayout';\n\n/** @public */\nexport const SettingsPage = (props: { providerSettings?: JSX.Element }) => {\n const { providerSettings } = props;\n const outlet = useOutlet();\n const layout = useElementFilter(outlet, elements =>\n elements\n .selectByComponentData({\n key: LAYOUT_DATA_KEY,\n })\n .getElements<SettingsLayoutProps>(),\n );\n const tabs = useElementFilter(outlet, elements =>\n elements\n .selectByComponentData({\n key: LAYOUT_ROUTE_DATA_KEY,\n })\n .getElements<SettingsLayoutRouteProps>(),\n );\n\n return (\n <>\n {(layout.length !== 0 && layout) || (\n <DefaultSettingsPage tabs={tabs} providerSettings={providerSettings} />\n )}\n </>\n );\n};\n"],"names":["EXAMPLE","useStyles","TooltipToggleButton","Typography","Grid"],"mappings":";;;;;;;;;;;;;;;;;;;;AAoBA,MAAMA,SAAU,GAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA,CAAA;AAQT,MAAM,iBAAiB,sBAC5B,KAAA,CAAA,aAAA;AAAA,EAAC,UAAA;AAAA,EAAA;AAAA,IACC,OAAQ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Af,EAAqB,IAAA,EAAK,eAAgB,EAAA,KAAA,EAAM,eAC/C,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,wBAAyB,EAAA,IAAA,CAC5B,GACC,IACH,CAAA,CAAA;AAEJ,CAAA;;ACnBa,MAAA,YAAA,GAAe,CAAC,KAA8C,KAAA;AACzE,EAAM,MAAA,EAAE,kBAAqB,GAAA,KAAA,CAAA;AAC7B,EAAA,MAAM,SAAS,SAAU,EAAA,CAAA;AACzB,EAAA,MAAM,MAAS,GAAA,gBAAA;AAAA,IAAiB,MAAA;AAAA,IAAQ,CAAA,QAAA,KACtC,SACG,qBAAsB,CAAA;AAAA,MACrB,GAAK,EAAA,eAAA;AAAA,KACN,EACA,WAAiC,EAAA;AAAA,GACtC,CAAA;AACA,EAAA,MAAM,IAAO,GAAA,gBAAA;AAAA,IAAiB,MAAA;AAAA,IAAQ,CAAA,QAAA,KACpC,SACG,qBAAsB,CAAA;AAAA,MACrB,GAAK,EAAA,qBAAA;AAAA,KACN,EACA,WAAsC,EAAA;AAAA,GAC3C,CAAA;AAEA,EACE,uBAAA,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,EACI,OAAO,MAAW,KAAA,CAAA,IAAK,0BACtB,KAAA,CAAA,aAAA,CAAA,mBAAA,EAAA,EAAoB,IAAY,EAAA,gBAAA,EAAoC,CAEzE,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { a as SettingsPage } from './SettingsPage-
|
|
1
|
+
export { a as SettingsPage } from './SettingsPage-70c1c7c8.esm.js';
|
|
2
2
|
import 'react-router-dom';
|
|
3
3
|
import 'react';
|
|
4
4
|
import '@material-ui/core';
|
|
@@ -14,8 +14,8 @@ import '@material-ui/icons/BrightnessAuto';
|
|
|
14
14
|
import '@material-ui/lab/ToggleButton';
|
|
15
15
|
import '@material-ui/lab/ToggleButtonGroup';
|
|
16
16
|
import '@backstage/core-plugin-api/alpha';
|
|
17
|
-
import './translation-
|
|
17
|
+
import './translation-ecd113d9.esm.js';
|
|
18
18
|
import '@backstage/plugin-catalog-react';
|
|
19
19
|
import '@material-ui/core/Grid';
|
|
20
20
|
import '@material-ui/core/Typography';
|
|
21
|
-
//# sourceMappingURL=index-
|
|
21
|
+
//# sourceMappingURL=index-088c7808.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-088c7808.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { createRouteRef, createPlugin, createRoutableExtension } from '@backstage/core-plugin-api';
|
|
2
|
+
import { createTranslationRef } from '@backstage/core-plugin-api/alpha';
|
|
3
|
+
|
|
4
|
+
const settingsRouteRef = createRouteRef({
|
|
5
|
+
id: "user-settings"
|
|
6
|
+
});
|
|
7
|
+
const userSettingsPlugin = createPlugin({
|
|
8
|
+
id: "user-settings",
|
|
9
|
+
routes: {
|
|
10
|
+
settingsPage: settingsRouteRef
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
const UserSettingsPage = userSettingsPlugin.provide(
|
|
14
|
+
createRoutableExtension({
|
|
15
|
+
name: "UserSettingsPage",
|
|
16
|
+
component: () => import('./index-088c7808.esm.js').then((m) => m.SettingsPage),
|
|
17
|
+
mountPoint: settingsRouteRef
|
|
18
|
+
})
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
const userSettingsTranslationRef = createTranslationRef({
|
|
22
|
+
id: "user-settings",
|
|
23
|
+
messages: {
|
|
24
|
+
language: "Language",
|
|
25
|
+
change_the_language: "Change the language",
|
|
26
|
+
theme: "Theme",
|
|
27
|
+
theme_light: "Light",
|
|
28
|
+
theme_dark: "Dark",
|
|
29
|
+
theme_auto: "Auto",
|
|
30
|
+
change_the_theme_mode: "Change the theme mode",
|
|
31
|
+
select_theme: "Select {{theme}}",
|
|
32
|
+
select_theme_auto: "Select Auto Theme",
|
|
33
|
+
select_lng: "Select language {{language}}"
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
export { UserSettingsPage as U, userSettingsTranslationRef as a, settingsRouteRef as s, userSettingsPlugin as u };
|
|
38
|
+
//# sourceMappingURL=translation-ecd113d9.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translation-ecd113d9.esm.js","sources":["../../src/plugin.ts","../../src/translation.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n createPlugin,\n createRoutableExtension,\n createRouteRef,\n} from '@backstage/core-plugin-api';\n\nexport const settingsRouteRef = createRouteRef({\n id: 'user-settings',\n});\n\n/** @public */\nexport const userSettingsPlugin = createPlugin({\n id: 'user-settings',\n routes: {\n settingsPage: settingsRouteRef,\n },\n});\n\n/** @public */\nexport const UserSettingsPage = userSettingsPlugin.provide(\n createRoutableExtension({\n name: 'UserSettingsPage',\n component: () =>\n import('./components/SettingsPage').then(m => m.SettingsPage),\n mountPoint: settingsRouteRef,\n }),\n);\n","/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/** @alpha */\nexport const userSettingsTranslationRef = createTranslationRef({\n id: 'user-settings',\n messages: {\n language: 'Language',\n change_the_language: 'Change the language',\n theme: 'Theme',\n theme_light: 'Light',\n theme_dark: 'Dark',\n theme_auto: 'Auto',\n change_the_theme_mode: 'Change the theme mode',\n select_theme: 'Select {{theme}}',\n select_theme_auto: 'Select Auto Theme',\n select_lng: 'Select language {{language}}',\n },\n});\n"],"names":[],"mappings":";;;AAsBO,MAAM,mBAAmB,cAAe,CAAA;AAAA,EAC7C,EAAI,EAAA,eAAA;AACN,CAAC,EAAA;AAGM,MAAM,qBAAqB,YAAa,CAAA;AAAA,EAC7C,EAAI,EAAA,eAAA;AAAA,EACJ,MAAQ,EAAA;AAAA,IACN,YAAc,EAAA,gBAAA;AAAA,GAChB;AACF,CAAC,EAAA;AAGM,MAAM,mBAAmB,kBAAmB,CAAA,OAAA;AAAA,EACjD,uBAAwB,CAAA;AAAA,IACtB,IAAM,EAAA,kBAAA;AAAA,IACN,SAAA,EAAW,MACT,OAAO,yBAA2B,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,YAAY,CAAA;AAAA,IAC9D,UAAY,EAAA,gBAAA;AAAA,GACb,CAAA;AACH;;ACvBO,MAAM,6BAA6B,oBAAqB,CAAA;AAAA,EAC7D,EAAI,EAAA,eAAA;AAAA,EACJ,QAAU,EAAA;AAAA,IACR,QAAU,EAAA,UAAA;AAAA,IACV,mBAAqB,EAAA,qBAAA;AAAA,IACrB,KAAO,EAAA,OAAA;AAAA,IACP,WAAa,EAAA,OAAA;AAAA,IACb,UAAY,EAAA,MAAA;AAAA,IACZ,UAAY,EAAA,MAAA;AAAA,IACZ,qBAAuB,EAAA,uBAAA;AAAA,IACvB,YAAc,EAAA,kBAAA;AAAA,IACd,iBAAmB,EAAA,mBAAA;AAAA,IACnB,UAAY,EAAA,8BAAA;AAAA,GACd;AACF,CAAC;;;;"}
|
package/dist/index.esm.js
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { WebStorage } from '@backstage/core-app-api';
|
|
2
2
|
import { ResponseError } from '@backstage/errors';
|
|
3
3
|
import ObservableImpl from 'zen-observable';
|
|
4
|
-
import {
|
|
4
|
+
import { s as settingsRouteRef } from './esm/translation-ecd113d9.esm.js';
|
|
5
|
+
export { U as UserSettingsPage, u as plugin, u as userSettingsPlugin } from './esm/translation-ecd113d9.esm.js';
|
|
5
6
|
import React from 'react';
|
|
6
7
|
import SettingsIcon from '@material-ui/icons/Settings';
|
|
7
8
|
import { SidebarItem } from '@backstage/core-components';
|
|
8
|
-
import {
|
|
9
|
-
|
|
9
|
+
import { useRouteRef, attachComponentData } from '@backstage/core-plugin-api';
|
|
10
|
+
import { L as LAYOUT_ROUTE_DATA_KEY, S as SettingsLayout } from './esm/SettingsPage-70c1c7c8.esm.js';
|
|
11
|
+
export { D as DefaultProviderSettings, P as ProviderSettingsItem, a as Router, S as SettingsLayout, f as UserSettingsAppearanceCard, U as UserSettingsAuthProviders, k as UserSettingsFeatureFlags, b as UserSettingsGeneral, i as UserSettingsIdentityCard, j as UserSettingsLanguageToggle, d as UserSettingsMenu, h as UserSettingsPinToggle, c as UserSettingsProfileCard, e as UserSettingsSignInAvatar, g as UserSettingsThemeToggle, u as useUserProfile } from './esm/SettingsPage-70c1c7c8.esm.js';
|
|
12
|
+
import '@backstage/core-plugin-api/alpha';
|
|
10
13
|
import 'react-router-dom';
|
|
11
14
|
import '@material-ui/core';
|
|
12
15
|
import '@material-ui/icons/Star';
|
|
@@ -18,8 +21,6 @@ import 'react-use/lib/useObservable';
|
|
|
18
21
|
import '@material-ui/icons/BrightnessAuto';
|
|
19
22
|
import '@material-ui/lab/ToggleButton';
|
|
20
23
|
import '@material-ui/lab/ToggleButtonGroup';
|
|
21
|
-
import '@backstage/core-plugin-api/alpha';
|
|
22
|
-
import './esm/translation-d20c444b.esm.js';
|
|
23
24
|
import '@backstage/plugin-catalog-react';
|
|
24
25
|
import '@material-ui/core/Grid';
|
|
25
26
|
import '@material-ui/core/Typography';
|
|
@@ -172,23 +173,6 @@ class UserSettingsStorage {
|
|
|
172
173
|
}
|
|
173
174
|
}
|
|
174
175
|
|
|
175
|
-
const settingsRouteRef = createRouteRef({
|
|
176
|
-
id: "user-settings"
|
|
177
|
-
});
|
|
178
|
-
const userSettingsPlugin = createPlugin({
|
|
179
|
-
id: "user-settings",
|
|
180
|
-
routes: {
|
|
181
|
-
settingsPage: settingsRouteRef
|
|
182
|
-
}
|
|
183
|
-
});
|
|
184
|
-
const UserSettingsPage = userSettingsPlugin.provide(
|
|
185
|
-
createRoutableExtension({
|
|
186
|
-
name: "UserSettingsPage",
|
|
187
|
-
component: () => import('./esm/index-ca302ff8.esm.js').then((m) => m.SettingsPage),
|
|
188
|
-
mountPoint: settingsRouteRef
|
|
189
|
-
})
|
|
190
|
-
);
|
|
191
|
-
|
|
192
176
|
const Settings = (props) => {
|
|
193
177
|
const routePath = useRouteRef(settingsRouteRef);
|
|
194
178
|
const Icon = props.icon ? props.icon : SettingsIcon;
|
|
@@ -199,5 +183,5 @@ const USER_SETTINGS_TAB_KEY = LAYOUT_ROUTE_DATA_KEY;
|
|
|
199
183
|
const UserSettingsTab = (props) => /* @__PURE__ */ React.createElement(SettingsLayout.Route, { path: props.path, title: props.title }, /* @__PURE__ */ React.createElement(React.Fragment, null, "props.children"));
|
|
200
184
|
attachComponentData(UserSettingsTab, USER_SETTINGS_TAB_KEY, "UserSettingsTab");
|
|
201
185
|
|
|
202
|
-
export { Settings, USER_SETTINGS_TAB_KEY,
|
|
186
|
+
export { Settings, USER_SETTINGS_TAB_KEY, UserSettingsStorage, UserSettingsTab };
|
|
203
187
|
//# sourceMappingURL=index.esm.js.map
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../src/apis/StorageApi/UserSettingsStorage.ts","../src/plugin.ts","../src/components/Settings.tsx","../src/components/UserSettingsTab/UserSettingsTab.tsx"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { WebStorage } from '@backstage/core-app-api';\nimport {\n DiscoveryApi,\n ErrorApi,\n FetchApi,\n IdentityApi,\n StorageApi,\n StorageValueSnapshot,\n} from '@backstage/core-plugin-api';\nimport { ResponseError } from '@backstage/errors';\nimport { JsonValue, Observable } from '@backstage/types';\nimport ObservableImpl from 'zen-observable';\n\nconst JSON_HEADERS = {\n 'Content-Type': 'application/json; charset=utf-8',\n Accept: 'application/json',\n};\n\nconst buckets = new Map<string, UserSettingsStorage>();\n\n/**\n * An implementation of the storage API, that uses the user-settings backend to\n * persist the data in the DB.\n *\n * @public\n */\nexport class UserSettingsStorage implements StorageApi {\n private subscribers = new Set<\n ZenObservable.SubscriptionObserver<StorageValueSnapshot<JsonValue>>\n >();\n\n private readonly observables = new Map<\n string,\n Observable<StorageValueSnapshot<JsonValue>>\n >();\n\n private constructor(\n private readonly namespace: string,\n private readonly fetchApi: FetchApi,\n private readonly discoveryApi: DiscoveryApi,\n private readonly errorApi: ErrorApi,\n private readonly identityApi: IdentityApi,\n private readonly fallback: WebStorage,\n ) {}\n\n static create(options: {\n fetchApi: FetchApi;\n discoveryApi: DiscoveryApi;\n errorApi: ErrorApi;\n identityApi: IdentityApi;\n namespace?: string;\n }): UserSettingsStorage {\n return new UserSettingsStorage(\n options.namespace ?? 'default',\n options.fetchApi,\n options.discoveryApi,\n options.errorApi,\n options.identityApi,\n WebStorage.create({\n namespace: options.namespace,\n errorApi: options.errorApi,\n }),\n );\n }\n\n forBucket(name: string): StorageApi {\n // use dot instead of slash separator to have nicer URLs\n const bucketPath = `${this.namespace}.${name}`;\n\n if (!buckets.has(bucketPath)) {\n buckets.set(\n bucketPath,\n new UserSettingsStorage(\n bucketPath,\n this.fetchApi,\n this.discoveryApi,\n this.errorApi,\n this.identityApi,\n this.fallback,\n ),\n );\n }\n\n return buckets.get(bucketPath)!;\n }\n\n async remove(key: string): Promise<void> {\n const fetchUrl = await this.getFetchUrl(key);\n\n const response = await this.fetchApi.fetch(fetchUrl, {\n method: 'DELETE',\n });\n\n if (!response.ok && response.status !== 404) {\n throw await ResponseError.fromResponse(response);\n }\n\n this.notifyChanges({ key, presence: 'absent' });\n }\n\n async set<T extends JsonValue>(key: string, data: T): Promise<void> {\n if (!(await this.isSignedIn())) {\n await this.fallback.set(key, data);\n this.notifyChanges({ key, presence: 'present', value: data });\n return;\n }\n\n const fetchUrl = await this.getFetchUrl(key);\n\n const response = await this.fetchApi.fetch(fetchUrl, {\n method: 'PUT',\n headers: JSON_HEADERS,\n body: JSON.stringify({ value: data }),\n });\n\n if (!response.ok) {\n throw await ResponseError.fromResponse(response);\n }\n\n const { value } = await response.json();\n\n this.notifyChanges({ key, value, presence: 'present' });\n }\n\n observe$<T extends JsonValue>(\n key: string,\n ): Observable<StorageValueSnapshot<T>> {\n if (!this.observables.has(key)) {\n this.observables.set(\n key,\n new ObservableImpl<StorageValueSnapshot<JsonValue>>(subscriber => {\n this.subscribers.add(subscriber);\n\n // TODO(freben): Introduce server polling or similar, to ensure that different devices update when values change\n Promise.resolve()\n .then(() => this.get(key))\n .then(snapshot => subscriber.next(snapshot))\n .catch(error => this.errorApi.post(error));\n\n return () => {\n this.subscribers.delete(subscriber);\n };\n }).filter(({ key: messageKey }) => messageKey === key),\n );\n }\n\n return this.observables.get(key) as Observable<StorageValueSnapshot<T>>;\n }\n\n snapshot<T extends JsonValue>(key: string): StorageValueSnapshot<T> {\n return { key, presence: 'unknown' };\n }\n\n private async get<T extends JsonValue>(\n key: string,\n ): Promise<StorageValueSnapshot<T>> {\n if (!(await this.isSignedIn())) {\n // This explicitly uses WebStorage, which we know is synchronous and doesn't return presence: unknown\n return this.fallback.snapshot(key);\n }\n\n const fetchUrl = await this.getFetchUrl(key);\n const response = await this.fetchApi.fetch(fetchUrl);\n\n if (response.status === 404) {\n return { key, presence: 'absent' };\n }\n\n if (!response.ok) {\n throw await ResponseError.fromResponse(response);\n }\n\n try {\n const { value: rawValue } = await response.json();\n const value = JSON.parse(JSON.stringify(rawValue), (_key, val) => {\n if (typeof val === 'object' && val !== null) {\n Object.freeze(val);\n }\n return val;\n });\n\n return { key, presence: 'present', value };\n } catch {\n // If the value is not valid JSON, we return an unknown presence. This should never happen\n return { key, presence: 'absent' };\n }\n }\n\n private async getFetchUrl(key: string) {\n const baseUrl = await this.discoveryApi.getBaseUrl('user-settings');\n const encodedNamespace = encodeURIComponent(this.namespace);\n const encodedKey = encodeURIComponent(key);\n return `${baseUrl}/buckets/${encodedNamespace}/keys/${encodedKey}`;\n }\n\n private async notifyChanges<T extends JsonValue>(\n snapshot: StorageValueSnapshot<T>,\n ) {\n for (const subscription of this.subscribers) {\n try {\n subscription.next(snapshot);\n } catch {\n // ignore\n }\n }\n }\n\n private async isSignedIn(): Promise<boolean> {\n try {\n const credentials = await this.identityApi.getCredentials();\n return credentials?.token ? true : false;\n } catch {\n return false;\n }\n }\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n createPlugin,\n createRoutableExtension,\n createRouteRef,\n} from '@backstage/core-plugin-api';\n\nexport const settingsRouteRef = createRouteRef({\n id: 'user-settings',\n});\n\n/** @public */\nexport const userSettingsPlugin = createPlugin({\n id: 'user-settings',\n routes: {\n settingsPage: settingsRouteRef,\n },\n});\n\n/** @public */\nexport const UserSettingsPage = userSettingsPlugin.provide(\n createRoutableExtension({\n name: 'UserSettingsPage',\n component: () =>\n import('./components/SettingsPage').then(m => m.SettingsPage),\n mountPoint: settingsRouteRef,\n }),\n);\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport SettingsIcon from '@material-ui/icons/Settings';\nimport { settingsRouteRef } from '../plugin';\nimport { SidebarItem } from '@backstage/core-components';\nimport { useRouteRef, IconComponent } from '@backstage/core-plugin-api';\n\n/** @public */\nexport const Settings = (props: { icon?: IconComponent }) => {\n const routePath = useRouteRef(settingsRouteRef);\n const Icon = props.icon ? props.icon : SettingsIcon;\n return <SidebarItem text=\"Settings\" to={routePath()} icon={Icon} />;\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport React, { PropsWithChildren } from 'react';\nimport { attachComponentData } from '@backstage/core-plugin-api';\nimport {\n LAYOUT_ROUTE_DATA_KEY,\n SettingsLayout,\n} from '../SettingsLayout/SettingsLayout';\n\n/** @public @deprecated Use SettingsLayout.Route approach instead */\nexport const USER_SETTINGS_TAB_KEY = LAYOUT_ROUTE_DATA_KEY;\n\n/** @public @deprecated Use SettingsLayoutRouteProps instead */\nexport type UserSettingsTabProps = PropsWithChildren<{\n /**\n * The path to the tab in the settings route\n * @example `/settings/advanced`\n */\n path: string;\n /** The title of the tab. It will also reflect in the document title when the tab is active */\n title: string;\n}>;\n\n/**\n * Renders a tab inside the settings page\n * @param props - Component props\n * @public\n * @deprecated Use SettingsLayout.Route instead\n */\nexport const UserSettingsTab = (props: UserSettingsTabProps) => (\n <SettingsLayout.Route path={props.path} title={props.title}>\n <>props.children</>\n </SettingsLayout.Route>\n);\n\nattachComponentData(UserSettingsTab, USER_SETTINGS_TAB_KEY, 'UserSettingsTab');\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,MAAM,YAAe,GAAA;AAAA,EACnB,cAAgB,EAAA,iCAAA;AAAA,EAChB,MAAQ,EAAA,kBAAA;AACV,CAAA,CAAA;AAEA,MAAM,OAAA,uBAAc,GAAiC,EAAA,CAAA;AAQ9C,MAAM,mBAA0C,CAAA;AAAA,EAU7C,YACW,SACA,EAAA,QAAA,EACA,YACA,EAAA,QAAA,EACA,aACA,QACjB,EAAA;AANiB,IAAA,IAAA,CAAA,SAAA,GAAA,SAAA,CAAA;AACA,IAAA,IAAA,CAAA,QAAA,GAAA,QAAA,CAAA;AACA,IAAA,IAAA,CAAA,YAAA,GAAA,YAAA,CAAA;AACA,IAAA,IAAA,CAAA,QAAA,GAAA,QAAA,CAAA;AACA,IAAA,IAAA,CAAA,WAAA,GAAA,WAAA,CAAA;AACA,IAAA,IAAA,CAAA,QAAA,GAAA,QAAA,CAAA;AAfnB,IAAQ,aAAA,CAAA,IAAA,EAAA,aAAA,sBAAkB,GAExB,EAAA,CAAA,CAAA;AAEF,IAAiB,aAAA,CAAA,IAAA,EAAA,aAAA,sBAAkB,GAGjC,EAAA,CAAA,CA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AAA,KAAA,CAAA,aAAA,CAAC,eAAY,IAAK,EAAA,UAAA,EAAW,IAAI,SAAU,EAAA,EAAG,MAAM,IAAM,EAAA,CAAA,CAAA;AACnE;;ACJO,MAAM,qBAAwB,GAAA,sBAAA;AAmB9B,MAAM,eAAkB,GAAA,CAAC,KAC9B,qBAAA,KAAA,CAAA,aAAA,CAAC,eAAe,KAAf,EAAA,EAAqB,IAAM,EAAA,KAAA,CAAM,MAAM,KAAO,EAAA,KAAA,CAAM,KACnD,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,EAAE,gBAAc,CAClB,EAAA;AAGF,mBAAoB,CAAA,eAAA,EAAiB,uBAAuB,iBAAiB,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../src/apis/StorageApi/UserSettingsStorage.ts","../src/components/Settings.tsx","../src/components/UserSettingsTab/UserSettingsTab.tsx"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { WebStorage } from '@backstage/core-app-api';\nimport {\n DiscoveryApi,\n ErrorApi,\n FetchApi,\n IdentityApi,\n StorageApi,\n StorageValueSnapshot,\n} from '@backstage/core-plugin-api';\nimport { ResponseError } from '@backstage/errors';\nimport { JsonValue, Observable } from '@backstage/types';\nimport ObservableImpl from 'zen-observable';\n\nconst JSON_HEADERS = {\n 'Content-Type': 'application/json; charset=utf-8',\n Accept: 'application/json',\n};\n\nconst buckets = new Map<string, UserSettingsStorage>();\n\n/**\n * An implementation of the storage API, that uses the user-settings backend to\n * persist the data in the DB.\n *\n * @public\n */\nexport class UserSettingsStorage implements StorageApi {\n private subscribers = new Set<\n ZenObservable.SubscriptionObserver<StorageValueSnapshot<JsonValue>>\n >();\n\n private readonly observables = new Map<\n string,\n Observable<StorageValueSnapshot<JsonValue>>\n >();\n\n private constructor(\n private readonly namespace: string,\n private readonly fetchApi: FetchApi,\n private readonly discoveryApi: DiscoveryApi,\n private readonly errorApi: ErrorApi,\n private readonly identityApi: IdentityApi,\n private readonly fallback: WebStorage,\n ) {}\n\n static create(options: {\n fetchApi: FetchApi;\n discoveryApi: DiscoveryApi;\n errorApi: ErrorApi;\n identityApi: IdentityApi;\n namespace?: string;\n }): UserSettingsStorage {\n return new UserSettingsStorage(\n options.namespace ?? 'default',\n options.fetchApi,\n options.discoveryApi,\n options.errorApi,\n options.identityApi,\n WebStorage.create({\n namespace: options.namespace,\n errorApi: options.errorApi,\n }),\n );\n }\n\n forBucket(name: string): StorageApi {\n // use dot instead of slash separator to have nicer URLs\n const bucketPath = `${this.namespace}.${name}`;\n\n if (!buckets.has(bucketPath)) {\n buckets.set(\n bucketPath,\n new UserSettingsStorage(\n bucketPath,\n this.fetchApi,\n this.discoveryApi,\n this.errorApi,\n this.identityApi,\n this.fallback,\n ),\n );\n }\n\n return buckets.get(bucketPath)!;\n }\n\n async remove(key: string): Promise<void> {\n const fetchUrl = await this.getFetchUrl(key);\n\n const response = await this.fetchApi.fetch(fetchUrl, {\n method: 'DELETE',\n });\n\n if (!response.ok && response.status !== 404) {\n throw await ResponseError.fromResponse(response);\n }\n\n this.notifyChanges({ key, presence: 'absent' });\n }\n\n async set<T extends JsonValue>(key: string, data: T): Promise<void> {\n if (!(await this.isSignedIn())) {\n await this.fallback.set(key, data);\n this.notifyChanges({ key, presence: 'present', value: data });\n return;\n }\n\n const fetchUrl = await this.getFetchUrl(key);\n\n const response = await this.fetchApi.fetch(fetchUrl, {\n method: 'PUT',\n headers: JSON_HEADERS,\n body: JSON.stringify({ value: data }),\n });\n\n if (!response.ok) {\n throw await ResponseError.fromResponse(response);\n }\n\n const { value } = await response.json();\n\n this.notifyChanges({ key, value, presence: 'present' });\n }\n\n observe$<T extends JsonValue>(\n key: string,\n ): Observable<StorageValueSnapshot<T>> {\n if (!this.observables.has(key)) {\n this.observables.set(\n key,\n new ObservableImpl<StorageValueSnapshot<JsonValue>>(subscriber => {\n this.subscribers.add(subscriber);\n\n // TODO(freben): Introduce server polling or similar, to ensure that different devices update when values change\n Promise.resolve()\n .then(() => this.get(key))\n .then(snapshot => subscriber.next(snapshot))\n .catch(error => this.errorApi.post(error));\n\n return () => {\n this.subscribers.delete(subscriber);\n };\n }).filter(({ key: messageKey }) => messageKey === key),\n );\n }\n\n return this.observables.get(key) as Observable<StorageValueSnapshot<T>>;\n }\n\n snapshot<T extends JsonValue>(key: string): StorageValueSnapshot<T> {\n return { key, presence: 'unknown' };\n }\n\n private async get<T extends JsonValue>(\n key: string,\n ): Promise<StorageValueSnapshot<T>> {\n if (!(await this.isSignedIn())) {\n // This explicitly uses WebStorage, which we know is synchronous and doesn't return presence: unknown\n return this.fallback.snapshot(key);\n }\n\n const fetchUrl = await this.getFetchUrl(key);\n const response = await this.fetchApi.fetch(fetchUrl);\n\n if (response.status === 404) {\n return { key, presence: 'absent' };\n }\n\n if (!response.ok) {\n throw await ResponseError.fromResponse(response);\n }\n\n try {\n const { value: rawValue } = await response.json();\n const value = JSON.parse(JSON.stringify(rawValue), (_key, val) => {\n if (typeof val === 'object' && val !== null) {\n Object.freeze(val);\n }\n return val;\n });\n\n return { key, presence: 'present', value };\n } catch {\n // If the value is not valid JSON, we return an unknown presence. This should never happen\n return { key, presence: 'absent' };\n }\n }\n\n private async getFetchUrl(key: string) {\n const baseUrl = await this.discoveryApi.getBaseUrl('user-settings');\n const encodedNamespace = encodeURIComponent(this.namespace);\n const encodedKey = encodeURIComponent(key);\n return `${baseUrl}/buckets/${encodedNamespace}/keys/${encodedKey}`;\n }\n\n private async notifyChanges<T extends JsonValue>(\n snapshot: StorageValueSnapshot<T>,\n ) {\n for (const subscription of this.subscribers) {\n try {\n subscription.next(snapshot);\n } catch {\n // ignore\n }\n }\n }\n\n private async isSignedIn(): Promise<boolean> {\n try {\n const credentials = await this.identityApi.getCredentials();\n return credentials?.token ? true : false;\n } catch {\n return false;\n }\n }\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport SettingsIcon from '@material-ui/icons/Settings';\nimport { settingsRouteRef } from '../plugin';\nimport { SidebarItem } from '@backstage/core-components';\nimport { useRouteRef, IconComponent } from '@backstage/core-plugin-api';\n\n/** @public */\nexport const Settings = (props: { icon?: IconComponent }) => {\n const routePath = useRouteRef(settingsRouteRef);\n const Icon = props.icon ? props.icon : SettingsIcon;\n return <SidebarItem text=\"Settings\" to={routePath()} icon={Icon} />;\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport React, { PropsWithChildren } from 'react';\nimport { attachComponentData } from '@backstage/core-plugin-api';\nimport {\n LAYOUT_ROUTE_DATA_KEY,\n SettingsLayout,\n} from '../SettingsLayout/SettingsLayout';\n\n/** @public @deprecated Use SettingsLayout.Route approach instead */\nexport const USER_SETTINGS_TAB_KEY = LAYOUT_ROUTE_DATA_KEY;\n\n/** @public @deprecated Use SettingsLayoutRouteProps instead */\nexport type UserSettingsTabProps = PropsWithChildren<{\n /**\n * The path to the tab in the settings route\n * @example `/settings/advanced`\n */\n path: string;\n /** The title of the tab. It will also reflect in the document title when the tab is active */\n title: string;\n}>;\n\n/**\n * Renders a tab inside the settings page\n * @param props - Component props\n * @public\n * @deprecated Use SettingsLayout.Route instead\n */\nexport const UserSettingsTab = (props: UserSettingsTabProps) => (\n <SettingsLayout.Route path={props.path} title={props.title}>\n <>props.children</>\n </SettingsLayout.Route>\n);\n\nattachComponentData(UserSettingsTab, USER_SETTINGS_TAB_KEY, 'UserSettingsTab');\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,MAAM,YAAe,GAAA;AAAA,EACnB,cAAgB,EAAA,iCAAA;AAAA,EAChB,MAAQ,EAAA,kBAAA;AACV,CAAA,CAAA;AAEA,MAAM,OAAA,uBAAc,GAAiC,EAAA,CAAA;AAQ9C,MAAM,mBAA0C,CAAA;AAAA,EAU7C,YACW,SACA,EAAA,QAAA,EACA,YACA,EAAA,QAAA,EACA,aACA,QACjB,EAAA;AANiB,IAAA,IAAA,CAAA,SAAA,GAAA,SAAA,CAAA;AACA,IAAA,IAAA,CAAA,QAAA,GAAA,QAAA,CAAA;AACA,IAAA,IAAA,CAAA,YAAA,GAAA,YAAA,CAAA;AACA,IAAA,IAAA,CAAA,QAAA,GAAA,QAAA,CAAA;AACA,IAAA,IAAA,CAAA,WAAA,GAAA,WAAA,CAAA;AACA,IAAA,IAAA,CAAA,QAAA,GAAA,QAAA,CAAA;AAfnB,IAAQ,aAAA,CAAA,IAAA,EAAA,aAAA,sBAAkB,GAExB,EAAA,CAAA,CAAA;AAEF,IAAiB,aAAA,CAAA,IAAA,EAAA,aAAA,sBAAkB,GAGjC,EAAA,CAAA,CAAA;AAAA,GASC;AAAA,EAEH,OAAO,OAAO,OAMU,EAAA;AAnE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stage/plugin-user-settings",
|
|
3
3
|
"description": "A Backstage plugin that provides a settings page",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.12-next.0",
|
|
5
5
|
"main": "./dist/index.esm.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -44,13 +44,13 @@
|
|
|
44
44
|
"clean": "backstage-cli package clean"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@backstage/core-app-api": "^1.11.0",
|
|
48
|
-
"@backstage/core-components": "^0.13.
|
|
49
|
-
"@backstage/core-plugin-api": "^1.
|
|
47
|
+
"@backstage/core-app-api": "^1.11.1-next.0",
|
|
48
|
+
"@backstage/core-components": "^0.13.7-next.0",
|
|
49
|
+
"@backstage/core-plugin-api": "^1.8.0-next.0",
|
|
50
50
|
"@backstage/errors": "^1.2.3",
|
|
51
|
-
"@backstage/frontend-plugin-api": "^0.
|
|
52
|
-
"@backstage/plugin-catalog-react": "^1.
|
|
53
|
-
"@backstage/theme": "^0.4.
|
|
51
|
+
"@backstage/frontend-plugin-api": "^0.3.0-next.0",
|
|
52
|
+
"@backstage/plugin-catalog-react": "^1.9.0-next.0",
|
|
53
|
+
"@backstage/theme": "^0.4.4-next.0",
|
|
54
54
|
"@backstage/types": "^1.1.1",
|
|
55
55
|
"@material-ui/core": "^4.12.2",
|
|
56
56
|
"@material-ui/icons": "^4.9.1",
|
|
@@ -60,18 +60,18 @@
|
|
|
60
60
|
"zen-observable": "^0.10.0"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
|
-
"react": "^16.13.1 || ^17.0.0",
|
|
64
|
-
"react-dom": "^16.13.1 || ^17.0.0",
|
|
63
|
+
"react": "^16.13.1 || ^17.0.0 || ^18.0.0",
|
|
64
|
+
"react-dom": "^16.13.1 || ^17.0.0 || ^18.0.0",
|
|
65
65
|
"react-router-dom": "6.0.0-beta.0 || ^6.3.0"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@backstage/cli": "^0.
|
|
69
|
-
"@backstage/dev-utils": "^1.0.
|
|
70
|
-
"@backstage/plugin-catalog": "^1.
|
|
71
|
-
"@backstage/test-utils": "^1.4.
|
|
68
|
+
"@backstage/cli": "^0.24.0-next.0",
|
|
69
|
+
"@backstage/dev-utils": "^1.0.23-next.0",
|
|
70
|
+
"@backstage/plugin-catalog": "^1.15.0-next.0",
|
|
71
|
+
"@backstage/test-utils": "^1.4.5-next.0",
|
|
72
72
|
"@testing-library/dom": "^9.0.0",
|
|
73
73
|
"@testing-library/jest-dom": "^6.0.0",
|
|
74
|
-
"@testing-library/react": "^
|
|
74
|
+
"@testing-library/react": "^14.0.0",
|
|
75
75
|
"@testing-library/user-event": "^14.0.0",
|
|
76
76
|
"cross-fetch": "^3.1.5",
|
|
77
77
|
"msw": "^1.0.0"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-ca302ff8.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { createTranslationRef } from '@backstage/core-plugin-api/alpha';
|
|
2
|
-
|
|
3
|
-
const userSettingsTranslationRef = createTranslationRef({
|
|
4
|
-
id: "user-settings",
|
|
5
|
-
messages: {
|
|
6
|
-
language: "Language",
|
|
7
|
-
change_the_language: "Change the language",
|
|
8
|
-
theme: "Theme",
|
|
9
|
-
theme_light: "Light",
|
|
10
|
-
theme_dark: "Dark",
|
|
11
|
-
theme_auto: "Auto",
|
|
12
|
-
change_the_theme_mode: "Change the theme mode",
|
|
13
|
-
select_theme: "Select {{theme}}",
|
|
14
|
-
select_theme_auto: "Select Auto Theme",
|
|
15
|
-
select_lng: "Select language {{language}}"
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
export { userSettingsTranslationRef as u };
|
|
20
|
-
//# sourceMappingURL=translation-d20c444b.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"translation-d20c444b.esm.js","sources":["../../src/translation.ts"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/** @alpha */\nexport const userSettingsTranslationRef = createTranslationRef({\n id: 'user-settings',\n messages: {\n language: 'Language',\n change_the_language: 'Change the language',\n theme: 'Theme',\n theme_light: 'Light',\n theme_dark: 'Dark',\n theme_auto: 'Auto',\n change_the_theme_mode: 'Change the theme mode',\n select_theme: 'Select {{theme}}',\n select_theme_auto: 'Select Auto Theme',\n select_lng: 'Select language {{language}}',\n },\n});\n"],"names":[],"mappings":";;AAmBO,MAAM,6BAA6B,oBAAqB,CAAA;AAAA,EAC7D,EAAI,EAAA,eAAA;AAAA,EACJ,QAAU,EAAA;AAAA,IACR,QAAU,EAAA,UAAA;AAAA,IACV,mBAAqB,EAAA,qBAAA;AAAA,IACrB,KAAO,EAAA,OAAA;AAAA,IACP,WAAa,EAAA,OAAA;AAAA,IACb,UAAY,EAAA,MAAA;AAAA,IACZ,UAAY,EAAA,MAAA;AAAA,IACZ,qBAAuB,EAAA,uBAAA;AAAA,IACvB,YAAc,EAAA,kBAAA;AAAA,IACd,iBAAmB,EAAA,mBAAA;AAAA,IACnB,UAAY,EAAA,8BAAA;AAAA,GACd;AACF,CAAC;;;;"}
|