@backstage/plugin-user-settings 0.8.21 → 0.8.22-next.1

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.
Files changed (35) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/dist/alpha.d.ts +38 -0
  3. package/dist/alpha.esm.js +1 -1
  4. package/dist/alpha.esm.js.map +1 -1
  5. package/dist/components/AuthProviders/DefaultProviderSettings.esm.js +30 -9
  6. package/dist/components/AuthProviders/DefaultProviderSettings.esm.js.map +1 -1
  7. package/dist/components/AuthProviders/EmptyProviders.esm.js +35 -34
  8. package/dist/components/AuthProviders/EmptyProviders.esm.js.map +1 -1
  9. package/dist/components/AuthProviders/ProviderSettingsItem.esm.js +5 -2
  10. package/dist/components/AuthProviders/ProviderSettingsItem.esm.js.map +1 -1
  11. package/dist/components/AuthProviders/UserSettingsAuthProviders.esm.js +4 -1
  12. package/dist/components/AuthProviders/UserSettingsAuthProviders.esm.js.map +1 -1
  13. package/dist/components/DefaultSettingsPage/DefaultSettingsPage.esm.js +20 -3
  14. package/dist/components/DefaultSettingsPage/DefaultSettingsPage.esm.js.map +1 -1
  15. package/dist/components/FeatureFlags/EmptyFlags.esm.js +35 -30
  16. package/dist/components/FeatureFlags/EmptyFlags.esm.js.map +1 -1
  17. package/dist/components/FeatureFlags/FeatureFlagsItem.esm.js +21 -6
  18. package/dist/components/FeatureFlags/FeatureFlagsItem.esm.js.map +1 -1
  19. package/dist/components/FeatureFlags/UserSettingsFeatureFlags.esm.js +7 -4
  20. package/dist/components/FeatureFlags/UserSettingsFeatureFlags.esm.js.map +1 -1
  21. package/dist/components/General/UserSettingsIdentityCard.esm.js +12 -4
  22. package/dist/components/General/UserSettingsIdentityCard.esm.js.map +1 -1
  23. package/dist/components/General/UserSettingsLanguageToggle.esm.js +3 -1
  24. package/dist/components/General/UserSettingsLanguageToggle.esm.js.map +1 -1
  25. package/dist/components/General/UserSettingsMenu.esm.js +5 -2
  26. package/dist/components/General/UserSettingsMenu.esm.js.map +1 -1
  27. package/dist/components/General/UserSettingsPinToggle.esm.js +7 -4
  28. package/dist/components/General/UserSettingsPinToggle.esm.js.map +1 -1
  29. package/dist/components/Settings.esm.js +4 -1
  30. package/dist/components/Settings.esm.js.map +1 -1
  31. package/dist/components/SettingsLayout/SettingsLayout.esm.js +4 -1
  32. package/dist/components/SettingsLayout/SettingsLayout.esm.js.map +1 -1
  33. package/dist/translation.esm.js +79 -1
  34. package/dist/translation.esm.js.map +1 -1
  35. package/package.json +17 -17
package/CHANGELOG.md CHANGED
@@ -1,5 +1,44 @@
1
1
  # @backstage/plugin-user-settings
2
2
 
3
+ ## 0.8.22-next.1
4
+
5
+ ### Patch Changes
6
+
7
+ - fb58f20: Internal update to use the new `pluginId` option of `createFrontendPlugin`.
8
+ - 5b04b14: Uppercase language name in language select
9
+ - Updated dependencies
10
+ - @backstage/theme@0.6.6-next.0
11
+ - @backstage/core-components@0.17.2-next.0
12
+ - @backstage/frontend-plugin-api@0.10.2-next.0
13
+ - @backstage/core-compat-api@0.4.2-next.1
14
+ - @backstage/plugin-catalog-react@1.18.0-next.1
15
+ - @backstage/catalog-model@1.7.3
16
+ - @backstage/core-app-api@1.16.1
17
+ - @backstage/core-plugin-api@1.10.6
18
+ - @backstage/errors@1.2.7
19
+ - @backstage/types@1.2.1
20
+ - @backstage/plugin-signals-react@0.0.12
21
+ - @backstage/plugin-user-settings-common@0.0.1
22
+
23
+ ## 0.8.22-next.0
24
+
25
+ ### Patch Changes
26
+
27
+ - a7bfdb6: plugin-user-settingsgs support i18n
28
+ - Updated dependencies
29
+ - @backstage/core-compat-api@0.4.2-next.0
30
+ - @backstage/plugin-catalog-react@1.18.0-next.0
31
+ - @backstage/catalog-model@1.7.3
32
+ - @backstage/core-app-api@1.16.1
33
+ - @backstage/core-components@0.17.1
34
+ - @backstage/core-plugin-api@1.10.6
35
+ - @backstage/errors@1.2.7
36
+ - @backstage/frontend-plugin-api@0.10.1
37
+ - @backstage/theme@0.6.5
38
+ - @backstage/types@1.2.1
39
+ - @backstage/plugin-signals-react@0.0.12
40
+ - @backstage/plugin-user-settings-common@0.0.1
41
+
3
42
  ## 0.8.21
4
43
 
5
44
  ### Patch Changes
package/dist/alpha.d.ts CHANGED
@@ -5,6 +5,18 @@ import * as _backstage_core_plugin_api_alpha from '@backstage/core-plugin-api/al
5
5
 
6
6
  /** @alpha */
7
7
  declare const userSettingsTranslationRef: _backstage_core_plugin_api_alpha.TranslationRef<"user-settings", {
8
+ readonly "featureFlags.title": "Feature Flags";
9
+ readonly "featureFlags.description": "Please refresh the page when toggling feature flags";
10
+ readonly "featureFlags.filterTitle": "Filter";
11
+ readonly "featureFlags.clearFilter": "Clear filter";
12
+ readonly "featureFlags.emptyFlags.title": "No Feature Flags";
13
+ readonly "featureFlags.emptyFlags.action.title": "An example for how to add a feature flag is highlighted below:";
14
+ readonly "featureFlags.emptyFlags.action.readMoreButtonTitle": "Read More";
15
+ readonly "featureFlags.emptyFlags.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.";
16
+ readonly "featureFlags.flagItem.title.disable": "Disable";
17
+ readonly "featureFlags.flagItem.title.enable": "Enable";
18
+ readonly "featureFlags.flagItem.subtitle.registeredInApplication": "Registered in the application";
19
+ readonly "featureFlags.flagItem.subtitle.registeredInPlugin": "Registered in {{pluginId}} plugin";
8
20
  readonly "languageToggle.select": "Select language {{language}}";
9
21
  readonly "languageToggle.title": "Language";
10
22
  readonly "languageToggle.description": "Change the language";
@@ -15,6 +27,32 @@ declare const userSettingsTranslationRef: _backstage_core_plugin_api_alpha.Trans
15
27
  readonly "themeToggle.names.dark": "Dark";
16
28
  readonly "themeToggle.names.light": "Light";
17
29
  readonly "themeToggle.selectAuto": "Select Auto Theme";
30
+ readonly "signOutMenu.title": "Sign Out";
31
+ readonly "signOutMenu.moreIconTitle": "more";
32
+ readonly "pinToggle.title": "Pin Sidebar";
33
+ readonly "pinToggle.description": "Prevent the sidebar from collapsing";
34
+ readonly "pinToggle.ariaLabelTitle": "Pin Sidebar Switch";
35
+ readonly "pinToggle.switchTitles.unpin": "Unpin Sidebar";
36
+ readonly "pinToggle.switchTitles.pin": "Pin Sidebar";
37
+ readonly "identityCard.title": "Backstage Identity";
38
+ readonly "identityCard.noIdentityTitle": "No Backstage Identity";
39
+ readonly "identityCard.userEntity": "User Entity";
40
+ readonly "identityCard.ownershipEntities": "Ownership Entities";
41
+ readonly "defaultProviderSettings.description": "Provides authentication towards {{provider}} APIs and identities";
42
+ readonly "emptyProviders.title": "No Authentication Providers";
43
+ readonly "emptyProviders.action.title": "Open app-config.yaml and make the changes as highlighted below:";
44
+ readonly "emptyProviders.action.readMoreButtonTitle": "Read More";
45
+ readonly "emptyProviders.description": "You can add Authentication Providers to Backstage which allows you to use these providers to authenticate yourself.";
46
+ readonly "providerSettingsItem.title.signIn": "Sign in to {{title}}";
47
+ readonly "providerSettingsItem.title.signOut": "Sign out from {{title}}";
48
+ readonly "providerSettingsItem.buttonTitle.signIn": "Sign in";
49
+ readonly "providerSettingsItem.buttonTitle.signOut": "Sign out";
50
+ readonly "authProviders.title": "Available Providers";
51
+ readonly "defaultSettingsPage.tabsTitle.featureFlags": "Feature Flags";
52
+ readonly "defaultSettingsPage.tabsTitle.authProviders": "Authentication Providers";
53
+ readonly "defaultSettingsPage.tabsTitle.general": "General";
54
+ readonly "settingsLayout.title": "Settings";
55
+ readonly sidebarTitle: "Settings";
18
56
  }>;
19
57
 
20
58
  /** @alpha */
package/dist/alpha.esm.js CHANGED
@@ -39,7 +39,7 @@ const settingsNavItem = NavItemBlueprint.make({
39
39
  }
40
40
  });
41
41
  var alpha = createFrontendPlugin({
42
- id: "user-settings",
42
+ pluginId: "user-settings",
43
43
  extensions: [userSettingsPage, settingsNavItem],
44
44
  routes: convertLegacyRouteRefs({
45
45
  root: settingsRouteRef
@@ -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 {\n coreExtensionData,\n createExtensionInput,\n createFrontendPlugin,\n PageBlueprint,\n NavItemBlueprint,\n} from '@backstage/frontend-plugin-api';\nimport {\n convertLegacyRouteRef,\n convertLegacyRouteRefs,\n compatWrapper,\n} from '@backstage/core-compat-api';\nimport SettingsIcon from '@material-ui/icons/Settings';\nimport { settingsRouteRef } from './plugin';\n\nexport * from './translation';\n\nconst userSettingsPage = PageBlueprint.makeWithOverrides({\n inputs: {\n providerSettings: createExtensionInput([coreExtensionData.reactElement], {\n singleton: true,\n optional: true,\n }),\n },\n factory(originalFactory, { inputs }) {\n return originalFactory({\n defaultPath: '/settings',\n routeRef: convertLegacyRouteRef(settingsRouteRef),\n loader: () =>\n import('./components/SettingsPage').then(m =>\n compatWrapper(\n <m.SettingsPage\n providerSettings={inputs.providerSettings?.get(\n coreExtensionData.reactElement,\n )}\n />,\n ),\n ),\n });\n },\n});\n\n/** @alpha */\nexport const settingsNavItem = NavItemBlueprint.make({\n params: {\n routeRef: convertLegacyRouteRef(settingsRouteRef),\n title: 'Settings',\n icon: SettingsIcon,\n },\n});\n\n/**\n * @alpha\n */\nexport default createFrontendPlugin({\n id: 'user-settings',\n extensions: [userSettingsPage, settingsNavItem],\n routes: convertLegacyRouteRefs({\n root: settingsRouteRef,\n }),\n});\n"],"names":[],"mappings":";;;;;;;AAgCA,MAAM,gBAAA,GAAmB,cAAc,iBAAkB,CAAA;AAAA,EACvD,MAAQ,EAAA;AAAA,IACN,gBAAkB,EAAA,oBAAA,CAAqB,CAAC,iBAAA,CAAkB,YAAY,CAAG,EAAA;AAAA,MACvE,SAAW,EAAA,IAAA;AAAA,MACX,QAAU,EAAA;AAAA,KACX;AAAA,GACH;AAAA,EACA,OAAQ,CAAA,eAAA,EAAiB,EAAE,MAAA,EAAU,EAAA;AACnC,IAAA,OAAO,eAAgB,CAAA;AAAA,MACrB,WAAa,EAAA,WAAA;AAAA,MACb,QAAA,EAAU,sBAAsB,gBAAgB,CAAA;AAAA,MAChD,MAAQ,EAAA,MACN,OAAO,wCAA2B,CAAE,CAAA,IAAA;AAAA,QAAK,CACvC,CAAA,KAAA,aAAA;AAAA,0BACE,GAAA;AAAA,YAAC,CAAE,CAAA,YAAA;AAAA,YAAF;AAAA,cACC,gBAAA,EAAkB,OAAO,gBAAkB,EAAA,GAAA;AAAA,gBACzC,iBAAkB,CAAA;AAAA;AACpB;AAAA;AACF;AACF;AACF,KACH,CAAA;AAAA;AAEL,CAAC,CAAA;AAGY,MAAA,eAAA,GAAkB,iBAAiB,IAAK,CAAA;AAAA,EACnD,MAAQ,EAAA;AAAA,IACN,QAAA,EAAU,sBAAsB,gBAAgB,CAAA;AAAA,IAChD,KAAO,EAAA,UAAA;AAAA,IACP,IAAM,EAAA;AAAA;AAEV,CAAC;AAKD,YAAe,oBAAqB,CAAA;AAAA,EAClC,EAAI,EAAA,eAAA;AAAA,EACJ,UAAA,EAAY,CAAC,gBAAA,EAAkB,eAAe,CAAA;AAAA,EAC9C,QAAQ,sBAAuB,CAAA;AAAA,IAC7B,IAAM,EAAA;AAAA,GACP;AACH,CAAC,CAAA;;;;"}
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 createFrontendPlugin,\n PageBlueprint,\n NavItemBlueprint,\n} from '@backstage/frontend-plugin-api';\nimport {\n convertLegacyRouteRef,\n convertLegacyRouteRefs,\n compatWrapper,\n} from '@backstage/core-compat-api';\nimport SettingsIcon from '@material-ui/icons/Settings';\nimport { settingsRouteRef } from './plugin';\n\nexport * from './translation';\n\nconst userSettingsPage = PageBlueprint.makeWithOverrides({\n inputs: {\n providerSettings: createExtensionInput([coreExtensionData.reactElement], {\n singleton: true,\n optional: true,\n }),\n },\n factory(originalFactory, { inputs }) {\n return originalFactory({\n defaultPath: '/settings',\n routeRef: convertLegacyRouteRef(settingsRouteRef),\n loader: () =>\n import('./components/SettingsPage').then(m =>\n compatWrapper(\n <m.SettingsPage\n providerSettings={inputs.providerSettings?.get(\n coreExtensionData.reactElement,\n )}\n />,\n ),\n ),\n });\n },\n});\n\n/** @alpha */\nexport const settingsNavItem = NavItemBlueprint.make({\n params: {\n routeRef: convertLegacyRouteRef(settingsRouteRef),\n title: 'Settings',\n icon: SettingsIcon,\n },\n});\n\n/**\n * @alpha\n */\nexport default createFrontendPlugin({\n pluginId: 'user-settings',\n extensions: [userSettingsPage, settingsNavItem],\n routes: convertLegacyRouteRefs({\n root: settingsRouteRef,\n }),\n});\n"],"names":[],"mappings":";;;;;;;AAgCA,MAAM,gBAAA,GAAmB,cAAc,iBAAkB,CAAA;AAAA,EACvD,MAAQ,EAAA;AAAA,IACN,gBAAkB,EAAA,oBAAA,CAAqB,CAAC,iBAAA,CAAkB,YAAY,CAAG,EAAA;AAAA,MACvE,SAAW,EAAA,IAAA;AAAA,MACX,QAAU,EAAA;AAAA,KACX;AAAA,GACH;AAAA,EACA,OAAQ,CAAA,eAAA,EAAiB,EAAE,MAAA,EAAU,EAAA;AACnC,IAAA,OAAO,eAAgB,CAAA;AAAA,MACrB,WAAa,EAAA,WAAA;AAAA,MACb,QAAA,EAAU,sBAAsB,gBAAgB,CAAA;AAAA,MAChD,MAAQ,EAAA,MACN,OAAO,wCAA2B,CAAE,CAAA,IAAA;AAAA,QAAK,CACvC,CAAA,KAAA,aAAA;AAAA,0BACE,GAAA;AAAA,YAAC,CAAE,CAAA,YAAA;AAAA,YAAF;AAAA,cACC,gBAAA,EAAkB,OAAO,gBAAkB,EAAA,GAAA;AAAA,gBACzC,iBAAkB,CAAA;AAAA;AACpB;AAAA;AACF;AACF;AACF,KACH,CAAA;AAAA;AAEL,CAAC,CAAA;AAGY,MAAA,eAAA,GAAkB,iBAAiB,IAAK,CAAA;AAAA,EACnD,MAAQ,EAAA;AAAA,IACN,QAAA,EAAU,sBAAsB,gBAAgB,CAAA;AAAA,IAChD,KAAO,EAAA,UAAA;AAAA,IACP,IAAM,EAAA;AAAA;AAEV,CAAC;AAKD,YAAe,oBAAqB,CAAA;AAAA,EAClC,QAAU,EAAA,eAAA;AAAA,EACV,UAAA,EAAY,CAAC,gBAAA,EAAkB,eAAe,CAAA;AAAA,EAC9C,QAAQ,sBAAuB,CAAA;AAAA,IAC7B,IAAM,EAAA;AAAA,GACP;AACH,CAAC,CAAA;;;;"}
@@ -2,15 +2,20 @@ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
2
  import Star from '@material-ui/icons/Star';
3
3
  import { ProviderSettingsItem } from './ProviderSettingsItem.esm.js';
4
4
  import { googleAuthApiRef, microsoftAuthApiRef, githubAuthApiRef, gitlabAuthApiRef, oktaAuthApiRef, bitbucketAuthApiRef, oneloginAuthApiRef, atlassianAuthApiRef, bitbucketServerAuthApiRef } from '@backstage/core-plugin-api';
5
+ import { userSettingsTranslationRef } from '../../translation.esm.js';
6
+ import { useTranslationRef } from '@backstage/frontend-plugin-api';
5
7
 
6
8
  const DefaultProviderSettings = (props) => {
7
9
  const { configuredProviders } = props;
10
+ const { t } = useTranslationRef(userSettingsTranslationRef);
8
11
  return /* @__PURE__ */ jsxs(Fragment, { children: [
9
12
  configuredProviders.includes("google") && /* @__PURE__ */ jsx(
10
13
  ProviderSettingsItem,
11
14
  {
12
15
  title: "Google",
13
- description: "Provides authentication towards Google APIs and identities",
16
+ description: t("defaultProviderSettings.description", {
17
+ provider: "Google"
18
+ }),
14
19
  apiRef: googleAuthApiRef,
15
20
  icon: Star
16
21
  }
@@ -19,7 +24,9 @@ const DefaultProviderSettings = (props) => {
19
24
  ProviderSettingsItem,
20
25
  {
21
26
  title: "Microsoft",
22
- description: "Provides authentication towards Microsoft APIs and identities",
27
+ description: t("defaultProviderSettings.description", {
28
+ provider: "Microsoft"
29
+ }),
23
30
  apiRef: microsoftAuthApiRef,
24
31
  icon: Star
25
32
  }
@@ -28,7 +35,9 @@ const DefaultProviderSettings = (props) => {
28
35
  ProviderSettingsItem,
29
36
  {
30
37
  title: "GitHub",
31
- description: "Provides authentication towards GitHub APIs",
38
+ description: t("defaultProviderSettings.description", {
39
+ provider: "GitHub"
40
+ }),
32
41
  apiRef: githubAuthApiRef,
33
42
  icon: Star
34
43
  }
@@ -37,7 +46,9 @@ const DefaultProviderSettings = (props) => {
37
46
  ProviderSettingsItem,
38
47
  {
39
48
  title: "GitLab",
40
- description: "Provides authentication towards GitLab APIs",
49
+ description: t("defaultProviderSettings.description", {
50
+ provider: "GitLab"
51
+ }),
41
52
  apiRef: gitlabAuthApiRef,
42
53
  icon: Star
43
54
  }
@@ -46,7 +57,9 @@ const DefaultProviderSettings = (props) => {
46
57
  ProviderSettingsItem,
47
58
  {
48
59
  title: "Okta",
49
- description: "Provides authentication towards Okta APIs",
60
+ description: t("defaultProviderSettings.description", {
61
+ provider: "Okta"
62
+ }),
50
63
  apiRef: oktaAuthApiRef,
51
64
  icon: Star
52
65
  }
@@ -55,7 +68,9 @@ const DefaultProviderSettings = (props) => {
55
68
  ProviderSettingsItem,
56
69
  {
57
70
  title: "Bitbucket",
58
- description: "Provides authentication towards Bitbucket APIs",
71
+ description: t("defaultProviderSettings.description", {
72
+ provider: "Bitbucket"
73
+ }),
59
74
  apiRef: bitbucketAuthApiRef,
60
75
  icon: Star
61
76
  }
@@ -64,7 +79,9 @@ const DefaultProviderSettings = (props) => {
64
79
  ProviderSettingsItem,
65
80
  {
66
81
  title: "OneLogin",
67
- description: "Provides authentication towards OneLogin APIs",
82
+ description: t("defaultProviderSettings.description", {
83
+ provider: "OneLogin"
84
+ }),
68
85
  apiRef: oneloginAuthApiRef,
69
86
  icon: Star
70
87
  }
@@ -73,7 +90,9 @@ const DefaultProviderSettings = (props) => {
73
90
  ProviderSettingsItem,
74
91
  {
75
92
  title: "Atlassian",
76
- description: "Provides authentication towards Atlassian APIs",
93
+ description: t("defaultProviderSettings.description", {
94
+ provider: "Atlassian"
95
+ }),
77
96
  apiRef: atlassianAuthApiRef,
78
97
  icon: Star
79
98
  }
@@ -82,7 +101,9 @@ const DefaultProviderSettings = (props) => {
82
101
  ProviderSettingsItem,
83
102
  {
84
103
  title: "Bitbucket Server",
85
- description: "Provides authentication towards Bitbucket Server APIs",
104
+ description: t("defaultProviderSettings.description", {
105
+ provider: "Bitbucket Server"
106
+ }),
86
107
  apiRef: bitbucketServerAuthApiRef,
87
108
  icon: Star
88
109
  }
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultProviderSettings.esm.js","sources":["../../../src/components/AuthProviders/DefaultProviderSettings.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 Star from '@material-ui/icons/Star';\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"],"names":[],"mappings":";;;;;AA+Ba,MAAA,uBAAA,GAA0B,CAAC,KAElC,KAAA;AACJ,EAAM,MAAA,EAAE,qBAAwB,GAAA,KAAA;AAChC,EAAA,uBAEK,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,IAAoB,mBAAA,CAAA,QAAA,CAAS,QAAQ,CACpC,oBAAA,GAAA;AAAA,MAAC,oBAAA;AAAA,MAAA;AAAA,QACC,KAAM,EAAA,QAAA;AAAA,QACN,WAAY,EAAA,4DAAA;AAAA,QACZ,MAAQ,EAAA,gBAAA;AAAA,QACR,IAAM,EAAA;AAAA;AAAA,KACR;AAAA,IAED,mBAAA,CAAoB,QAAS,CAAA,WAAW,CACvC,oBAAA,GAAA;AAAA,MAAC,oBAAA;AAAA,MAAA;AAAA,QACC,KAAM,EAAA,WAAA;AAAA,QACN,WAAY,EAAA,+DAAA;AAAA,QACZ,MAAQ,EAAA,mBAAA;AAAA,QACR,IAAM,EAAA;AAAA;AAAA,KACR;AAAA,IAED,mBAAA,CAAoB,QAAS,CAAA,QAAQ,CACpC,oBAAA,GAAA;AAAA,MAAC,oBAAA;AAAA,MAAA;AAAA,QACC,KAAM,EAAA,QAAA;AAAA,QACN,WAAY,EAAA,6CAAA;AAAA,QACZ,MAAQ,EAAA,gBAAA;AAAA,QACR,IAAM,EAAA;AAAA;AAAA,KACR;AAAA,IAED,mBAAA,CAAoB,QAAS,CAAA,QAAQ,CACpC,oBAAA,GAAA;AAAA,MAAC,oBAAA;AAAA,MAAA;AAAA,QACC,KAAM,EAAA,QAAA;AAAA,QACN,WAAY,EAAA,6CAAA;AAAA,QACZ,MAAQ,EAAA,gBAAA;AAAA,QACR,IAAM,EAAA;AAAA;AAAA,KACR;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.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 Star from '@material-ui/icons/Star';\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';\nimport { userSettingsTranslationRef } from '../../translation';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\n\n/** @public */\nexport const DefaultProviderSettings = (props: {\n configuredProviders: string[];\n}) => {\n const { configuredProviders } = props;\n const { t } = useTranslationRef(userSettingsTranslationRef);\n return (\n <>\n {configuredProviders.includes('google') && (\n <ProviderSettingsItem\n title=\"Google\"\n description={t('defaultProviderSettings.description', {\n provider: 'Google',\n })}\n apiRef={googleAuthApiRef}\n icon={Star}\n />\n )}\n {configuredProviders.includes('microsoft') && (\n <ProviderSettingsItem\n title=\"Microsoft\"\n description={t('defaultProviderSettings.description', {\n provider: 'Microsoft',\n })}\n apiRef={microsoftAuthApiRef}\n icon={Star}\n />\n )}\n {configuredProviders.includes('github') && (\n <ProviderSettingsItem\n title=\"GitHub\"\n description={t('defaultProviderSettings.description', {\n provider: 'GitHub',\n })}\n apiRef={githubAuthApiRef}\n icon={Star}\n />\n )}\n {configuredProviders.includes('gitlab') && (\n <ProviderSettingsItem\n title=\"GitLab\"\n description={t('defaultProviderSettings.description', {\n provider: 'GitLab',\n })}\n apiRef={gitlabAuthApiRef}\n icon={Star}\n />\n )}\n {configuredProviders.includes('okta') && (\n <ProviderSettingsItem\n title=\"Okta\"\n description={t('defaultProviderSettings.description', {\n provider: 'Okta',\n })}\n apiRef={oktaAuthApiRef}\n icon={Star}\n />\n )}\n {configuredProviders.includes('bitbucket') && (\n <ProviderSettingsItem\n title=\"Bitbucket\"\n description={t('defaultProviderSettings.description', {\n provider: 'Bitbucket',\n })}\n apiRef={bitbucketAuthApiRef}\n icon={Star}\n />\n )}\n {configuredProviders.includes('onelogin') && (\n <ProviderSettingsItem\n title=\"OneLogin\"\n description={t('defaultProviderSettings.description', {\n provider: 'OneLogin',\n })}\n apiRef={oneloginAuthApiRef}\n icon={Star}\n />\n )}\n {configuredProviders.includes('atlassian') && (\n <ProviderSettingsItem\n title=\"Atlassian\"\n description={t('defaultProviderSettings.description', {\n provider: 'Atlassian',\n })}\n apiRef={atlassianAuthApiRef}\n icon={Star}\n />\n )}\n {configuredProviders.includes('bitbucketServer') && (\n <ProviderSettingsItem\n title=\"Bitbucket Server\"\n description={t('defaultProviderSettings.description', {\n provider: 'Bitbucket Server',\n })}\n apiRef={bitbucketServerAuthApiRef}\n icon={Star}\n />\n )}\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;AAiCa,MAAA,uBAAA,GAA0B,CAAC,KAElC,KAAA;AACJ,EAAM,MAAA,EAAE,qBAAwB,GAAA,KAAA;AAChC,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,0BAA0B,CAAA;AAC1D,EAAA,uBAEK,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,IAAoB,mBAAA,CAAA,QAAA,CAAS,QAAQ,CACpC,oBAAA,GAAA;AAAA,MAAC,oBAAA;AAAA,MAAA;AAAA,QACC,KAAM,EAAA,QAAA;AAAA,QACN,WAAA,EAAa,EAAE,qCAAuC,EAAA;AAAA,UACpD,QAAU,EAAA;AAAA,SACX,CAAA;AAAA,QACD,MAAQ,EAAA,gBAA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AAA;AAAA,MAAA;AAAA,QACC,KAAM,EAAA,WAAA;AAAA,QACN,WAAA,EAAa,EAAE,qCAAuC,EAAA;AAAA,UACpD,QAAU,EAAA;AAAA,SACX,CAAA;AAAA,QACD,MAAQ,EAAA,mBAAA;AAAA,QACR,IAAM,EAAA;AAAA;AAAA,KACR;AAAA,IAED,mBAAA,CAAoB,QAAS,CAAA,UAAU,CACtC,oBAAA,GAAA;AAAA,MAAC,oBAAA;AAAA,MAAA;AAAA,QACC,KAAM,EAAA,UAAA;AAAA,QACN,WAAA,EAAa,EAAE,qCAAuC,EAAA;AAAA,UACpD,QAAU,EAAA;AAAA,SACX,CAAA;AAAA,QACD,MAAQ,EAAA,kBAAA;AAAA,QACR,IAAM,EAAA;AAAA;AAAA,KACR;AAAA,IAED,mBAAA,CAAoB,QAAS,CAAA,WAAW,CACvC,oBAAA,GAAA;AAAA,MAAC,oBAAA;AAAA,MAAA;AAAA,QACC,KAAM,EAAA,WAAA;AAAA,QACN,WAAA,EAAa,EAAE,qCAAuC,EAAA;AAAA,UACpD,QAAU,EAAA;AAAA,SACX,CAAA;AAAA,QACD,MAAQ,EAAA,mBAAA;AAAA,QACR,IAAM,EAAA;AAAA;AAAA,KACR;AAAA,IAED,mBAAA,CAAoB,QAAS,CAAA,iBAAiB,CAC7C,oBAAA,GAAA;AAAA,MAAC,oBAAA;AAAA,MAAA;AAAA,QACC,KAAM,EAAA,kBAAA;AAAA,QACN,WAAA,EAAa,EAAE,qCAAuC,EAAA;AAAA,UACpD,QAAU,EAAA;AAAA,SACX,CAAA;AAAA,QACD,MAAQ,EAAA,yBAAA;AAAA,QACR,IAAM,EAAA;AAAA;AAAA;AACR,GAEJ,EAAA,CAAA;AAEJ;;;;"}
@@ -2,6 +2,8 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import Button from '@material-ui/core/Button';
3
3
  import Typography from '@material-ui/core/Typography';
4
4
  import { EmptyState, CodeSnippet } from '@backstage/core-components';
5
+ import { useTranslationRef } from '@backstage/frontend-plugin-api';
6
+ import { userSettingsTranslationRef } from '../../translation.esm.js';
5
7
 
6
8
  const EXAMPLE = `auth:
7
9
  providers:
@@ -10,40 +12,39 @@ const EXAMPLE = `auth:
10
12
  clientId: \${AUTH_GOOGLE_CLIENT_ID}
11
13
  clientSecret: \${AUTH_GOOGLE_CLIENT_SECRET}
12
14
  `;
13
- const EmptyProviders = () => /* @__PURE__ */ jsx(
14
- EmptyState,
15
- {
16
- missing: "content",
17
- title: "No Authentication Providers",
18
- description: "You can add Authentication Providers to Backstage which allows you to use these providers to authenticate yourself.",
19
- action: /* @__PURE__ */ jsxs(Fragment, { children: [
20
- /* @__PURE__ */ jsxs(Typography, { variant: "body1", children: [
21
- "Open ",
22
- /* @__PURE__ */ jsx("code", { children: "app-config.yaml" }),
23
- " and make the changes as highlighted below:"
24
- ] }),
25
- /* @__PURE__ */ jsx(
26
- CodeSnippet,
27
- {
28
- text: EXAMPLE,
29
- language: "yaml",
30
- showLineNumbers: true,
31
- highlightedNumbers: [3, 4, 5, 6, 7, 8],
32
- customStyle: { background: "inherit", fontSize: "115%" }
33
- }
34
- ),
35
- /* @__PURE__ */ jsx(
36
- Button,
37
- {
38
- variant: "contained",
39
- color: "primary",
40
- href: "https://backstage.io/docs/auth/add-auth-provider",
41
- children: "Read More"
42
- }
43
- )
44
- ] })
45
- }
46
- );
15
+ const EmptyProviders = () => {
16
+ const { t } = useTranslationRef(userSettingsTranslationRef);
17
+ return /* @__PURE__ */ jsx(
18
+ EmptyState,
19
+ {
20
+ missing: "content",
21
+ title: t("emptyProviders.title"),
22
+ description: t("emptyProviders.description"),
23
+ action: /* @__PURE__ */ jsxs(Fragment, { children: [
24
+ /* @__PURE__ */ jsx(Typography, { variant: "body1", children: t("emptyProviders.action.title") }),
25
+ /* @__PURE__ */ jsx(
26
+ CodeSnippet,
27
+ {
28
+ text: EXAMPLE,
29
+ language: "yaml",
30
+ showLineNumbers: true,
31
+ highlightedNumbers: [3, 4, 5, 6, 7, 8],
32
+ customStyle: { background: "inherit", fontSize: "115%" }
33
+ }
34
+ ),
35
+ /* @__PURE__ */ jsx(
36
+ Button,
37
+ {
38
+ variant: "contained",
39
+ color: "primary",
40
+ href: "https://backstage.io/docs/auth/add-auth-provider",
41
+ children: t("emptyProviders.action.readMoreButtonTitle")
42
+ }
43
+ )
44
+ ] })
45
+ }
46
+ );
47
+ };
47
48
 
48
49
  export { EmptyProviders };
49
50
  //# sourceMappingURL=EmptyProviders.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"EmptyProviders.esm.js","sources":["../../../src/components/AuthProviders/EmptyProviders.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 Button from '@material-ui/core/Button';\nimport Typography from '@material-ui/core/Typography';\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"],"names":[],"mappings":";;;;;AAoBA,MAAM,OAAU,GAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA;AAQT,MAAM,iBAAiB,sBAC5B,GAAA;AAAA,EAAC,UAAA;AAAA,EAAA;AAAA,IACC,OAAQ,EAAA,SAAA;AAAA,IACR,KAAM,EAAA,6BAAA;AAAA,IACN,WAAY,EAAA,qHAAA;AAAA,IACZ,wBAEI,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,sBAAC,IAAA,CAAA,UAAA,EAAA,EAAW,SAAQ,OAAQ,EAAA,QAAA,EAAA;AAAA,QAAA,OAAA;AAAA,wBACrB,GAAA,CAAC,UAAK,QAAe,EAAA,iBAAA,EAAA,CAAA;AAAA,QAAO;AAAA,OAEnC,EAAA,CAAA;AAAA,sBACA,GAAA;AAAA,QAAC,WAAA;AAAA,QAAA;AAAA,UACC,IAAM,EAAA,OAAA;AAAA,UACN,QAAS,EAAA,MAAA;AAAA,UACT,eAAe,EAAA,IAAA;AAAA,UACf,oBAAoB,CAAC,CAAA,EAAG,GAAG,CAAG,EAAA,CAAA,EAAG,GAAG,CAAC,CAAA;AAAA,UACrC,WAAa,EAAA,EAAE,UAAY,EAAA,SAAA,EAAW,UAAU,MAAO;AAAA;AAAA,OACzD;AAAA,sBACA,GAAA;AAAA,QAAC,MAAA;AAAA,QAAA;AAAA,UACC,OAAQ,EAAA,WAAA;AAAA,UACR,KAAM,EAAA,SAAA;AAAA,UACN,IAAK,EAAA,kDAAA;AAAA,UACN,QAAA,EAAA;AAAA;AAAA;AAED,KACF,EAAA;AAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"EmptyProviders.esm.js","sources":["../../../src/components/AuthProviders/EmptyProviders.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 Button from '@material-ui/core/Button';\nimport Typography from '@material-ui/core/Typography';\nimport { CodeSnippet, EmptyState } from '@backstage/core-components';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport { userSettingsTranslationRef } from '../../translation';\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 const { t } = useTranslationRef(userSettingsTranslationRef);\n return (\n <EmptyState\n missing=\"content\"\n title={t('emptyProviders.title')}\n description={t('emptyProviders.description')}\n action={\n <>\n <Typography variant=\"body1\">\n {t('emptyProviders.action.title')}\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 {t('emptyProviders.action.readMoreButtonTitle')}\n </Button>\n </>\n }\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;AAsBA,MAAM,OAAU,GAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA;AAQT,MAAM,iBAAiB,MAAM;AAClC,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,0BAA0B,CAAA;AAC1D,EACE,uBAAA,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,OAAQ,EAAA,SAAA;AAAA,MACR,KAAA,EAAO,EAAE,sBAAsB,CAAA;AAAA,MAC/B,WAAA,EAAa,EAAE,4BAA4B,CAAA;AAAA,MAC3C,wBAEI,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,UAAW,EAAA,EAAA,OAAA,EAAQ,OACjB,EAAA,QAAA,EAAA,CAAA,CAAE,6BAA6B,CAClC,EAAA,CAAA;AAAA,wBACA,GAAA;AAAA,UAAC,WAAA;AAAA,UAAA;AAAA,YACC,IAAM,EAAA,OAAA;AAAA,YACN,QAAS,EAAA,MAAA;AAAA,YACT,eAAe,EAAA,IAAA;AAAA,YACf,oBAAoB,CAAC,CAAA,EAAG,GAAG,CAAG,EAAA,CAAA,EAAG,GAAG,CAAC,CAAA;AAAA,YACrC,WAAa,EAAA,EAAE,UAAY,EAAA,SAAA,EAAW,UAAU,MAAO;AAAA;AAAA,SACzD;AAAA,wBACA,GAAA;AAAA,UAAC,MAAA;AAAA,UAAA;AAAA,YACC,OAAQ,EAAA,WAAA;AAAA,YACR,KAAM,EAAA,SAAA;AAAA,YACN,IAAK,EAAA,kDAAA;AAAA,YAEJ,YAAE,2CAA2C;AAAA;AAAA;AAChD,OACF,EAAA;AAAA;AAAA,GAEJ;AAEJ;;;;"}
@@ -10,6 +10,8 @@ import Tooltip from '@material-ui/core/Tooltip';
10
10
  import Typography from '@material-ui/core/Typography';
11
11
  import { useApi, errorApiRef, SessionState } from '@backstage/core-plugin-api';
12
12
  import { ProviderSettingsAvatar } from './ProviderSettingsAvatar.esm.js';
13
+ import { useTranslationRef } from '@backstage/frontend-plugin-api';
14
+ import { userSettingsTranslationRef } from '../../translation.esm.js';
13
15
 
14
16
  const emptyProfile = {};
15
17
  const ProviderSettingsItem = (props) => {
@@ -18,6 +20,7 @@ const ProviderSettingsItem = (props) => {
18
20
  const errorApi = useApi(errorApiRef);
19
21
  const [signedIn, setSignedIn] = useState(false);
20
22
  const [profile, setProfile] = useState(emptyProfile);
23
+ const { t } = useTranslationRef(userSettingsTranslationRef);
21
24
  useEffect(() => {
22
25
  let didCancel = false;
23
26
  const subscription = api.sessionState$().subscribe((sessionState) => {
@@ -73,7 +76,7 @@ const ProviderSettingsItem = (props) => {
73
76
  {
74
77
  placement: "top",
75
78
  arrow: true,
76
- title: signedIn ? `Sign out from ${title}` : `Sign in to ${title}`,
79
+ title: signedIn ? t("providerSettingsItem.title.signOut", { title }) : t("providerSettingsItem.title.signIn", { title }),
77
80
  children: /* @__PURE__ */ jsx(
78
81
  Button,
79
82
  {
@@ -83,7 +86,7 @@ const ProviderSettingsItem = (props) => {
83
86
  const action = signedIn ? api.signOut() : api.signIn();
84
87
  action.catch((error) => errorApi.post(error));
85
88
  },
86
- children: signedIn ? `Sign out` : `Sign in`
89
+ children: signedIn ? t("providerSettingsItem.buttonTitle.signOut") : t("providerSettingsItem.buttonTitle.signIn")
87
90
  }
88
91
  )
89
92
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ProviderSettingsItem.esm.js","sources":["../../../src/components/AuthProviders/ProviderSettingsItem.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 { useEffect, useState } from 'react';\nimport Button from '@material-ui/core/Button';\nimport Grid from '@material-ui/core/Grid';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\nimport ListItemSecondaryAction from '@material-ui/core/ListItemSecondaryAction';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport Typography from '@material-ui/core/Typography';\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 {profile.displayName && (\n <Typography\n variant=\"subtitle1\"\n color=\"textPrimary\"\n gutterBottom\n >\n {profile.displayName}\n </Typography>\n )}\n {profile.email && (\n <Typography variant=\"body2\" color=\"textSecondary\">\n {profile.email}\n </Typography>\n )}\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"],"names":[],"mappings":";;;;;;;;;;;;;AAqCA,MAAM,eAA4B,EAAC;AAGtB,MAAA,oBAAA,GAAuB,CAAC,KAK/B,KAAA;AACJ,EAAA,MAAM,EAAE,KAAO,EAAA,WAAA,EAAa,IAAM,EAAA,IAAA,EAAM,QAAW,GAAA,KAAA;AAEnD,EAAM,MAAA,GAAA,GAAM,OAAO,MAAM,CAAA;AACzB,EAAM,MAAA,QAAA,GAAW,OAAO,WAAW,CAAA;AACnC,EAAA,MAAM,CAAC,QAAA,EAAU,WAAW,CAAA,GAAI,SAAS,KAAK,CAAA;AAC9C,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAI,SAAsB,YAAY,CAAA;AAEhE,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,SAAY,GAAA,KAAA;AAEhB,IAAA,MAAM,eAAe,GAClB,CAAA,aAAA,EACA,CAAA,SAAA,CAAU,CAAC,YAA+B,KAAA;AACzC,MAAI,IAAA,YAAA,KAAiB,aAAa,QAAU,EAAA;AAC1C,QAAA,UAAA,CAAW,YAAY,CAAA;AACvB,QAAA,WAAA,CAAY,KAAK,CAAA;AAAA;AAEnB,MAAA,IAAI,CAAC,SAAW,EAAA;AACd,QACG,GAAA,CAAA,UAAA,CAAW,EAAE,QAAU,EAAA,IAAA,EAAM,CAC7B,CAAA,IAAA,CAAK,CAAC,eAA6C,KAAA;AAClD,UAAA,IAAI,CAAC,SAAW,EAAA;AACd,YAAI,IAAA,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AO,EAAA;AACrD,cAAA,MAAA,CAAO,KAAM,CAAA,CAAA,KAAA,KAAS,QAAS,CAAA,IAAA,CAAK,KAAK,CAAC,CAAA;AAAA,aAC5C;AAAA,YAEC,qBAAW,CAAa,QAAA,CAAA,GAAA,CAAA,OAAA;AAAA;AAAA;AAC3B;AAAA,KAEJ,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"ProviderSettingsItem.esm.js","sources":["../../../src/components/AuthProviders/ProviderSettingsItem.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 { useEffect, useState } from 'react';\nimport Button from '@material-ui/core/Button';\nimport Grid from '@material-ui/core/Grid';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\nimport ListItemSecondaryAction from '@material-ui/core/ListItemSecondaryAction';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport Typography from '@material-ui/core/Typography';\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';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport { userSettingsTranslationRef } from '../../translation';\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 const { t } = useTranslationRef(userSettingsTranslationRef);\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 {profile.displayName && (\n <Typography\n variant=\"subtitle1\"\n color=\"textPrimary\"\n gutterBottom\n >\n {profile.displayName}\n </Typography>\n )}\n {profile.email && (\n <Typography variant=\"body2\" color=\"textSecondary\">\n {profile.email}\n </Typography>\n )}\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={\n signedIn\n ? t('providerSettingsItem.title.signOut', { title })\n : t('providerSettingsItem.title.signIn', { title })\n }\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\n ? t('providerSettingsItem.buttonTitle.signOut')\n : t('providerSettingsItem.buttonTitle.signIn')}\n </Button>\n </Tooltip>\n </ListItemSecondaryAction>\n </ListItem>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAuCA,MAAM,eAA4B,EAAC;AAGtB,MAAA,oBAAA,GAAuB,CAAC,KAK/B,KAAA;AACJ,EAAA,MAAM,EAAE,KAAO,EAAA,WAAA,EAAa,IAAM,EAAA,IAAA,EAAM,QAAW,GAAA,KAAA;AAEnD,EAAM,MAAA,GAAA,GAAM,OAAO,MAAM,CAAA;AACzB,EAAM,MAAA,QAAA,GAAW,OAAO,WAAW,CAAA;AACnC,EAAA,MAAM,CAAC,QAAA,EAAU,WAAW,CAAA,GAAI,SAAS,KAAK,CAAA;AAC9C,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAI,SAAsB,YAAY,CAAA;AAChE,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,0BAA0B,CAAA;AAE1D,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,SAAY,GAAA,KAAA;AAEhB,IAAA,MAAM,eAAe,GAClB,CAAA,aAAA,EACA,CAAA,SAAA,CAAU,CAAC,YAA+B,KAAA;AACzC,MAAI,IAAA,YAAA,KAAiB,aAAa,QAAU,EAAA;AAC1C,QAAA,UAAA,CAAW,YAAY,CAAA;AACvB,QAAA,WAAA,CAAY,KAAK,CAAA;AAAA;AAEnB,MAAA,IAAI,CAAC,SAAW,EAAA;AACd,QACG,GAAA,CAAA,UAAA,CAAW,EAAE,QAAU,EAAA,IAAA,EAAM,CAC7B,CAAA,IAAA,CAAK,CAAC,eAA6C,KAAA;AAClD,UAAA,IAAI,CAAC,SAAW,EAAA;AACd,YAAI,IAAA,YAAA,KAAiB,aAAa,QAAU,EAAA;AAC1C,cAAA,WAAA,CAAY,IAAI,CAAA;AAAA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AO,KAAM,CAAA,CAAA,KAAA,KAAS,QAAS,CAAA,IAAA,CAAK,KAAK,CAAC,CAAA;AAAA,aAC5C;AAAA,YAEC,QACG,EAAA,QAAA,GAAA,CAAA,CAAE,0CAA0C,CAAA,GAC5C,EAAE,yCAAyC;AAAA;AAAA;AACjD;AAAA,KAEJ,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
@@ -4,6 +4,8 @@ import { EmptyProviders } from './EmptyProviders.esm.js';
4
4
  import { DefaultProviderSettings } from './DefaultProviderSettings.esm.js';
5
5
  import { useApi, configApiRef } from '@backstage/core-plugin-api';
6
6
  import { InfoCard } from '@backstage/core-components';
7
+ import { userSettingsTranslationRef } from '../../translation.esm.js';
8
+ import { useTranslationRef } from '@backstage/frontend-plugin-api';
7
9
 
8
10
  const UserSettingsAuthProviders = (props) => {
9
11
  const { providerSettings } = props;
@@ -11,10 +13,11 @@ const UserSettingsAuthProviders = (props) => {
11
13
  const providersConfig = configApi.getOptionalConfig("auth.providers");
12
14
  const configuredProviders = providersConfig?.keys() || [];
13
15
  const providers = providerSettings ?? /* @__PURE__ */ jsx(DefaultProviderSettings, { configuredProviders });
16
+ const { t } = useTranslationRef(userSettingsTranslationRef);
14
17
  if (!providerSettings && !configuredProviders?.length) {
15
18
  return /* @__PURE__ */ jsx(EmptyProviders, {});
16
19
  }
17
- return /* @__PURE__ */ jsx(InfoCard, { title: "Available Providers", children: /* @__PURE__ */ jsx(List, { dense: true, children: providers }) });
20
+ return /* @__PURE__ */ jsx(InfoCard, { title: t("authProviders.title"), children: /* @__PURE__ */ jsx(List, { dense: true, children: providers }) });
18
21
  };
19
22
 
20
23
  export { UserSettingsAuthProviders };
@@ -1 +1 @@
1
- {"version":3,"file":"UserSettingsAuthProviders.esm.js","sources":["../../../src/components/AuthProviders/UserSettingsAuthProviders.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 List from '@material-ui/core/List';\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"],"names":[],"mappings":";;;;;;;AAuBa,MAAA,yBAAA,GAA4B,CAAC,KAEpC,KAAA;AACJ,EAAM,MAAA,EAAE,kBAAqB,GAAA,KAAA;AAC7B,EAAM,MAAA,SAAA,GAAY,OAAO,YAAY,CAAA;AACrC,EAAM,MAAA,eAAA,GAAkB,SAAU,CAAA,iBAAA,CAAkB,gBAAgB,CAAA;AACpE,EAAA,MAAM,mBAAsB,GAAA,eAAA,EAAiB,IAAK,EAAA,IAAK,EAAC;AACxD,EAAA,MAAM,SAAY,GAAA,gBAAA,oBACf,GAAA,CAAA,uBAAA,EAAA,EAAwB,mBAA0C,EAAA,CAAA;AAGrE,EAAA,IAAI,CAAC,gBAAA,IAAoB,CAAC,mBAAA,EAAqB,MAAQ,EAAA;AACrD,IAAA,2BAAQ,cAAe,EAAA,EAAA,CAAA;AAAA;AAGzB,EACE,uBAAA,GAAA,CAAC,YAAS,KAAM,EAAA,qBAAA,EACd,8BAAC,IAAK,EAAA,EAAA,KAAA,EAAK,IAAE,EAAA,QAAA,EAAA,SAAA,EAAU,CACzB,EAAA,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"UserSettingsAuthProviders.esm.js","sources":["../../../src/components/AuthProviders/UserSettingsAuthProviders.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 List from '@material-ui/core/List';\nimport { EmptyProviders } from './EmptyProviders';\nimport { DefaultProviderSettings } from './DefaultProviderSettings';\nimport { configApiRef, useApi } from '@backstage/core-plugin-api';\nimport { InfoCard } from '@backstage/core-components';\nimport { userSettingsTranslationRef } from '../../translation';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\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 const { t } = useTranslationRef(userSettingsTranslationRef);\n\n if (!providerSettings && !configuredProviders?.length) {\n return <EmptyProviders />;\n }\n\n return (\n <InfoCard title={t('authProviders.title')}>\n <List dense>{providers}</List>\n </InfoCard>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AAyBa,MAAA,yBAAA,GAA4B,CAAC,KAEpC,KAAA;AACJ,EAAM,MAAA,EAAE,kBAAqB,GAAA,KAAA;AAC7B,EAAM,MAAA,SAAA,GAAY,OAAO,YAAY,CAAA;AACrC,EAAM,MAAA,eAAA,GAAkB,SAAU,CAAA,iBAAA,CAAkB,gBAAgB,CAAA;AACpE,EAAA,MAAM,mBAAsB,GAAA,eAAA,EAAiB,IAAK,EAAA,IAAK,EAAC;AACxD,EAAA,MAAM,SAAY,GAAA,gBAAA,oBACf,GAAA,CAAA,uBAAA,EAAA,EAAwB,mBAA0C,EAAA,CAAA;AAErE,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,0BAA0B,CAAA;AAE1D,EAAA,IAAI,CAAC,gBAAA,IAAoB,CAAC,mBAAA,EAAqB,MAAQ,EAAA;AACrD,IAAA,2BAAQ,cAAe,EAAA,EAAA,CAAA;AAAA;AAGzB,EACE,uBAAA,GAAA,CAAC,QAAS,EAAA,EAAA,KAAA,EAAO,CAAE,CAAA,qBAAqB,CACtC,EAAA,QAAA,kBAAA,GAAA,CAAC,IAAK,EAAA,EAAA,KAAA,EAAK,IAAE,EAAA,QAAA,EAAA,SAAA,EAAU,CACzB,EAAA,CAAA;AAEJ;;;;"}
@@ -12,6 +12,8 @@ import '@material-ui/core/Tooltip';
12
12
  import '@material-ui/core/Typography';
13
13
  import '@backstage/core-plugin-api';
14
14
  import '../AuthProviders/ProviderSettingsAvatar.esm.js';
15
+ import { useTranslationRef } from '@backstage/frontend-plugin-api';
16
+ import { userSettingsTranslationRef } from '../../translation.esm.js';
15
17
  import { UserSettingsFeatureFlags } from '../FeatureFlags/UserSettingsFeatureFlags.esm.js';
16
18
  import { UserSettingsGeneral } from '../General/UserSettingsGeneral.esm.js';
17
19
  import '../General/UserSettingsSignInAvatar.esm.js';
@@ -31,17 +33,32 @@ import { SettingsLayout } from '../SettingsLayout/SettingsLayout.esm.js';
31
33
 
32
34
  const DefaultSettingsPage = (props) => {
33
35
  const { providerSettings, tabs } = props;
36
+ const { t } = useTranslationRef(userSettingsTranslationRef);
34
37
  return /* @__PURE__ */ jsxs(SettingsLayout, { children: [
35
- /* @__PURE__ */ jsx(SettingsLayout.Route, { path: "general", title: "General", children: /* @__PURE__ */ jsx(UserSettingsGeneral, {}) }),
38
+ /* @__PURE__ */ jsx(
39
+ SettingsLayout.Route,
40
+ {
41
+ path: "general",
42
+ title: t("defaultSettingsPage.tabsTitle.general"),
43
+ children: /* @__PURE__ */ jsx(UserSettingsGeneral, {})
44
+ }
45
+ ),
36
46
  /* @__PURE__ */ jsx(
37
47
  SettingsLayout.Route,
38
48
  {
39
49
  path: "auth-providers",
40
- title: "Authentication Providers",
50
+ title: t("defaultSettingsPage.tabsTitle.authProviders"),
41
51
  children: /* @__PURE__ */ jsx(UserSettingsAuthProviders, { providerSettings })
42
52
  }
43
53
  ),
44
- /* @__PURE__ */ jsx(SettingsLayout.Route, { path: "feature-flags", title: "Feature Flags", children: /* @__PURE__ */ jsx(UserSettingsFeatureFlags, {}) }),
54
+ /* @__PURE__ */ jsx(
55
+ SettingsLayout.Route,
56
+ {
57
+ path: "feature-flags",
58
+ title: t("defaultSettingsPage.tabsTitle.featureFlags"),
59
+ children: /* @__PURE__ */ jsx(UserSettingsFeatureFlags, {})
60
+ }
61
+ ),
45
62
  tabs
46
63
  ] });
47
64
  };
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultSettingsPage.esm.js","sources":["../../../src/components/DefaultSettingsPage/DefaultSettingsPage.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 { ReactElement } 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?: 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"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBa,MAAA,mBAAA,GAAsB,CAAC,KAG9B,KAAA;AACJ,EAAM,MAAA,EAAE,gBAAkB,EAAA,IAAA,EAAS,GAAA,KAAA;AAEnC,EAAA,4BACG,cACC,EAAA,EAAA,QAAA,EAAA;AAAA,oBAAC,GAAA,CAAA,cAAA,CAAe,OAAf,EAAqB,IAAA,EAAK,WAAU,KAAM,EAAA,SAAA,EACzC,QAAC,kBAAA,GAAA,CAAA,mBAAA,EAAA,EAAoB,CACvB,EAAA,CAAA;AAAA,oBACA,GAAA;AAAA,MAAC,cAAe,CAAA,KAAA;AAAA,MAAf;AAAA,QACC,IAAK,EAAA,gBAAA;AAAA,QACL,KAAM,EAAA,0BAAA;AAAA,QAEN,QAAA,kBAAA,GAAA,CAAC,6BAA0B,gBAAoC,EAAA;AAAA;AAAA,KACjE;AAAA,oBACA,GAAA,CAAC,cAAe,CAAA,KAAA,EAAf,EAAqB,IAAA,EAAK,iBAAgB,KAAM,EAAA,eAAA,EAC/C,QAAC,kBAAA,GAAA,CAAA,wBAAA,EAAA,EAAyB,CAC5B,EAAA,CAAA;AAAA,IACC;AAAA,GACH,EAAA,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"DefaultSettingsPage.esm.js","sources":["../../../src/components/DefaultSettingsPage/DefaultSettingsPage.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 { ReactElement } from 'react';\nimport { UserSettingsAuthProviders } from '../AuthProviders';\nimport { UserSettingsFeatureFlags } from '../FeatureFlags';\nimport { UserSettingsGeneral } from '../General';\nimport { SettingsLayout, SettingsLayoutRouteProps } from '../SettingsLayout';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport { userSettingsTranslationRef } from '../../translation';\n\n/**\n * @public\n */\nexport const DefaultSettingsPage = (props: {\n tabs?: ReactElement<SettingsLayoutRouteProps>[];\n providerSettings?: JSX.Element;\n}) => {\n const { providerSettings, tabs } = props;\n const { t } = useTranslationRef(userSettingsTranslationRef);\n\n return (\n <SettingsLayout>\n <SettingsLayout.Route\n path=\"general\"\n title={t('defaultSettingsPage.tabsTitle.general')}\n >\n <UserSettingsGeneral />\n </SettingsLayout.Route>\n <SettingsLayout.Route\n path=\"auth-providers\"\n title={t('defaultSettingsPage.tabsTitle.authProviders')}\n >\n <UserSettingsAuthProviders providerSettings={providerSettings} />\n </SettingsLayout.Route>\n <SettingsLayout.Route\n path=\"feature-flags\"\n title={t('defaultSettingsPage.tabsTitle.featureFlags')}\n >\n <UserSettingsFeatureFlags />\n </SettingsLayout.Route>\n {tabs}\n </SettingsLayout>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2Ba,MAAA,mBAAA,GAAsB,CAAC,KAG9B,KAAA;AACJ,EAAM,MAAA,EAAE,gBAAkB,EAAA,IAAA,EAAS,GAAA,KAAA;AACnC,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,0BAA0B,CAAA;AAE1D,EAAA,4BACG,cACC,EAAA,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,cAAe,CAAA,KAAA;AAAA,MAAf;AAAA,QACC,IAAK,EAAA,SAAA;AAAA,QACL,KAAA,EAAO,EAAE,uCAAuC,CAAA;AAAA,QAEhD,8BAAC,mBAAoB,EAAA,EAAA;AAAA;AAAA,KACvB;AAAA,oBACA,GAAA;AAAA,MAAC,cAAe,CAAA,KAAA;AAAA,MAAf;AAAA,QACC,IAAK,EAAA,gBAAA;AAAA,QACL,KAAA,EAAO,EAAE,6CAA6C,CAAA;AAAA,QAEtD,QAAA,kBAAA,GAAA,CAAC,6BAA0B,gBAAoC,EAAA;AAAA;AAAA,KACjE;AAAA,oBACA,GAAA;AAAA,MAAC,cAAe,CAAA,KAAA;AAAA,MAAf;AAAA,QACC,IAAK,EAAA,eAAA;AAAA,QACL,KAAA,EAAO,EAAE,4CAA4C,CAAA;AAAA,QAErD,8BAAC,wBAAyB,EAAA,EAAA;AAAA;AAAA,KAC5B;AAAA,IACC;AAAA,GACH,EAAA,CAAA;AAEJ;;;;"}