@backstage/plugin-user-settings 0.8.21-next.0 → 0.8.21-next.2
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 +40 -0
- package/README.md +0 -1
- package/dist/alpha.d.ts +3 -3
- package/dist/alpha.esm.js +2 -2
- package/dist/alpha.esm.js.map +1 -1
- package/dist/components/AuthProviders/DefaultProviderSettings.esm.js +84 -74
- package/dist/components/AuthProviders/DefaultProviderSettings.esm.js.map +1 -1
- package/dist/components/AuthProviders/EmptyProviders.esm.js +28 -20
- package/dist/components/AuthProviders/EmptyProviders.esm.js.map +1 -1
- package/dist/components/AuthProviders/ProviderSettingsAvatar.esm.js +2 -2
- package/dist/components/AuthProviders/ProviderSettingsAvatar.esm.js.map +1 -1
- package/dist/components/AuthProviders/ProviderSettingsItem.esm.js +47 -35
- package/dist/components/AuthProviders/ProviderSettingsItem.esm.js.map +1 -1
- package/dist/components/AuthProviders/UserSettingsAuthProviders.esm.js +4 -4
- package/dist/components/AuthProviders/UserSettingsAuthProviders.esm.js.map +1 -1
- package/dist/components/DefaultSettingsPage/DefaultSettingsPage.esm.js +15 -9
- package/dist/components/DefaultSettingsPage/DefaultSettingsPage.esm.js.map +1 -1
- package/dist/components/FeatureFlags/EmptyFlags.esm.js +24 -20
- package/dist/components/FeatureFlags/EmptyFlags.esm.js.map +1 -1
- package/dist/components/FeatureFlags/FeatureFlagsItem.esm.js +5 -2
- package/dist/components/FeatureFlags/FeatureFlagsItem.esm.js.map +1 -1
- package/dist/components/FeatureFlags/UserSettingsFeatureFlags.esm.js +38 -31
- package/dist/components/FeatureFlags/UserSettingsFeatureFlags.esm.js.map +1 -1
- package/dist/components/General/UserSettingsAppearanceCard.esm.js +6 -2
- package/dist/components/General/UserSettingsAppearanceCard.esm.js.map +1 -1
- package/dist/components/General/UserSettingsGeneral.esm.js +6 -2
- package/dist/components/General/UserSettingsGeneral.esm.js.map +1 -1
- package/dist/components/General/UserSettingsIdentityCard.esm.js +15 -4
- package/dist/components/General/UserSettingsIdentityCard.esm.js.map +1 -1
- package/dist/components/General/UserSettingsLanguageToggle.esm.js +27 -24
- package/dist/components/General/UserSettingsLanguageToggle.esm.js.map +1 -1
- package/dist/components/General/UserSettingsMenu.esm.js +26 -22
- package/dist/components/General/UserSettingsMenu.esm.js.map +1 -1
- package/dist/components/General/UserSettingsPinToggle.esm.js +26 -23
- package/dist/components/General/UserSettingsPinToggle.esm.js.map +1 -1
- package/dist/components/General/UserSettingsProfileCard.esm.js +11 -2
- package/dist/components/General/UserSettingsProfileCard.esm.js.map +1 -1
- package/dist/components/General/UserSettingsSignInAvatar.esm.js +2 -2
- package/dist/components/General/UserSettingsSignInAvatar.esm.js.map +1 -1
- package/dist/components/General/UserSettingsThemeToggle.esm.js +62 -49
- package/dist/components/General/UserSettingsThemeToggle.esm.js.map +1 -1
- package/dist/components/Settings.esm.js +2 -2
- package/dist/components/Settings.esm.js.map +1 -1
- package/dist/components/SettingsLayout/SettingsLayout.esm.js +5 -2
- package/dist/components/SettingsLayout/SettingsLayout.esm.js.map +1 -1
- package/dist/components/SettingsPage/SettingsPage.esm.js +2 -2
- package/dist/components/SettingsPage/SettingsPage.esm.js.map +1 -1
- package/dist/components/UserSettingsTab/UserSettingsTab.esm.js +2 -2
- package/dist/components/UserSettingsTab/UserSettingsTab.esm.js.map +1 -1
- package/dist/index.d.ts +23 -23
- package/package.json +16 -16
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useState } from 'react';
|
|
2
3
|
import IconButton from '@material-ui/core/IconButton';
|
|
3
4
|
import ListItemIcon from '@material-ui/core/ListItemIcon';
|
|
4
5
|
import Menu from '@material-ui/core/Menu';
|
|
@@ -10,10 +11,8 @@ import { useApi, errorApiRef, identityApiRef } from '@backstage/core-plugin-api'
|
|
|
10
11
|
const UserSettingsMenu = () => {
|
|
11
12
|
const errorApi = useApi(errorApiRef);
|
|
12
13
|
const identityApi = useApi(identityApiRef);
|
|
13
|
-
const [open, setOpen] =
|
|
14
|
-
const [anchorEl, setAnchorEl] =
|
|
15
|
-
void 0
|
|
16
|
-
);
|
|
14
|
+
const [open, setOpen] = useState(false);
|
|
15
|
+
const [anchorEl, setAnchorEl] = useState(void 0);
|
|
17
16
|
const handleOpen = (event) => {
|
|
18
17
|
setAnchorEl(event.currentTarget);
|
|
19
18
|
setOpen(true);
|
|
@@ -22,23 +21,28 @@ const UserSettingsMenu = () => {
|
|
|
22
21
|
setAnchorEl(void 0);
|
|
23
22
|
setOpen(false);
|
|
24
23
|
};
|
|
25
|
-
return /* @__PURE__ */
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
{
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
24
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
25
|
+
/* @__PURE__ */ jsx(
|
|
26
|
+
IconButton,
|
|
27
|
+
{
|
|
28
|
+
"data-testid": "user-settings-menu",
|
|
29
|
+
"aria-label": "more",
|
|
30
|
+
onClick: handleOpen,
|
|
31
|
+
children: /* @__PURE__ */ jsx(MoreVertIcon, {})
|
|
32
|
+
}
|
|
33
|
+
),
|
|
34
|
+
/* @__PURE__ */ jsx(Menu, { anchorEl, open, onClose: handleClose, children: /* @__PURE__ */ jsxs(
|
|
35
|
+
MenuItem,
|
|
36
|
+
{
|
|
37
|
+
"data-testid": "sign-out",
|
|
38
|
+
onClick: () => identityApi.signOut().catch((error) => errorApi.post(error)),
|
|
39
|
+
children: [
|
|
40
|
+
/* @__PURE__ */ jsx(ListItemIcon, { children: /* @__PURE__ */ jsx(SignOutIcon, {}) }),
|
|
41
|
+
"Sign Out"
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
) })
|
|
45
|
+
] });
|
|
42
46
|
};
|
|
43
47
|
|
|
44
48
|
export { UserSettingsMenu };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserSettingsMenu.esm.js","sources":["../../../src/components/General/UserSettingsMenu.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
|
|
1
|
+
{"version":3,"file":"UserSettingsMenu.esm.js","sources":["../../../src/components/General/UserSettingsMenu.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 { MouseEvent, useState } from 'react';\nimport IconButton from '@material-ui/core/IconButton';\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\nimport Menu from '@material-ui/core/Menu';\nimport MenuItem from '@material-ui/core/MenuItem';\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] = useState(false);\n const [anchorEl, setAnchorEl] = useState<undefined | HTMLElement>(undefined);\n\n const handleOpen = (event: 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"],"names":[],"mappings":";;;;;;;;;;AA8BO,MAAM,mBAAmB,MAAM;AACpC,EAAM,MAAA,QAAA,GAAW,OAAO,WAAW,CAAA;AACnC,EAAM,MAAA,WAAA,GAAc,OAAO,cAAc,CAAA;AACzC,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAI,SAAS,KAAK,CAAA;AACtC,EAAA,MAAM,CAAC,QAAA,EAAU,WAAW,CAAA,GAAI,SAAkC,KAAS,CAAA,CAAA;AAE3E,EAAM,MAAA,UAAA,GAAa,CAAC,KAAyC,KAAA;AAC3D,IAAA,WAAA,CAAY,MAAM,aAAa,CAAA;AAC/B,IAAA,OAAA,CAAQ,IAAI,CAAA;AAAA,GACd;AAEA,EAAA,MAAM,cAAc,MAAM;AACxB,IAAA,WAAA,CAAY,KAAS,CAAA,CAAA;AACrB,IAAA,OAAA,CAAQ,KAAK,CAAA;AAAA,GACf;AAEA,EAAA,uBAEI,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,aAAY,EAAA,oBAAA;AAAA,QACZ,YAAW,EAAA,MAAA;AAAA,QACX,OAAS,EAAA,UAAA;AAAA,QAET,8BAAC,YAAa,EAAA,EAAA;AAAA;AAAA,KAChB;AAAA,oBACC,GAAA,CAAA,IAAA,EAAA,EAAK,QAAoB,EAAA,IAAA,EAAY,SAAS,WAC7C,EAAA,QAAA,kBAAA,IAAA;AAAA,MAAC,QAAA;AAAA,MAAA;AAAA,QACC,aAAY,EAAA,UAAA;AAAA,QACZ,OAAA,EAAS,MACP,WAAA,CAAY,OAAQ,EAAA,CAAE,MAAM,CAAS,KAAA,KAAA,QAAA,CAAS,IAAK,CAAA,KAAK,CAAC,CAAA;AAAA,QAG3D,QAAA,EAAA;AAAA,0BAAC,GAAA,CAAA,YAAA,EAAA,EACC,QAAC,kBAAA,GAAA,CAAA,WAAA,EAAA,EAAY,CACf,EAAA,CAAA;AAAA,UAAe;AAAA;AAAA;AAAA,KAGnB,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import ListItem from '@material-ui/core/ListItem';
|
|
3
3
|
import ListItemSecondaryAction from '@material-ui/core/ListItemSecondaryAction';
|
|
4
4
|
import ListItemText from '@material-ui/core/ListItemText';
|
|
@@ -8,30 +8,33 @@ import { useSidebarPinState } from '@backstage/core-components';
|
|
|
8
8
|
|
|
9
9
|
const UserSettingsPinToggle = () => {
|
|
10
10
|
const { isPinned, toggleSidebarPinState } = useSidebarPinState();
|
|
11
|
-
return /* @__PURE__ */
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
primary: "Pin Sidebar",
|
|
15
|
-
secondary: "Prevent the sidebar from collapsing"
|
|
16
|
-
}
|
|
17
|
-
), /* @__PURE__ */ React.createElement(ListItemSecondaryAction, null, /* @__PURE__ */ React.createElement(
|
|
18
|
-
Tooltip,
|
|
19
|
-
{
|
|
20
|
-
placement: "top",
|
|
21
|
-
arrow: true,
|
|
22
|
-
title: `${isPinned ? "Unpin" : "Pin"} Sidebar`
|
|
23
|
-
},
|
|
24
|
-
/* @__PURE__ */ React.createElement(
|
|
25
|
-
Switch,
|
|
11
|
+
return /* @__PURE__ */ jsxs(ListItem, { children: [
|
|
12
|
+
/* @__PURE__ */ jsx(
|
|
13
|
+
ListItemText,
|
|
26
14
|
{
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
onChange: () => toggleSidebarPinState(),
|
|
30
|
-
name: "pin",
|
|
31
|
-
inputProps: { "aria-label": "Pin Sidebar Switch" }
|
|
15
|
+
primary: "Pin Sidebar",
|
|
16
|
+
secondary: "Prevent the sidebar from collapsing"
|
|
32
17
|
}
|
|
33
|
-
)
|
|
34
|
-
|
|
18
|
+
),
|
|
19
|
+
/* @__PURE__ */ jsx(ListItemSecondaryAction, { children: /* @__PURE__ */ jsx(
|
|
20
|
+
Tooltip,
|
|
21
|
+
{
|
|
22
|
+
placement: "top",
|
|
23
|
+
arrow: true,
|
|
24
|
+
title: `${isPinned ? "Unpin" : "Pin"} Sidebar`,
|
|
25
|
+
children: /* @__PURE__ */ jsx(
|
|
26
|
+
Switch,
|
|
27
|
+
{
|
|
28
|
+
color: "primary",
|
|
29
|
+
checked: isPinned,
|
|
30
|
+
onChange: () => toggleSidebarPinState(),
|
|
31
|
+
name: "pin",
|
|
32
|
+
inputProps: { "aria-label": "Pin Sidebar Switch" }
|
|
33
|
+
}
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
) })
|
|
37
|
+
] });
|
|
35
38
|
};
|
|
36
39
|
|
|
37
40
|
export { UserSettingsPinToggle };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserSettingsPinToggle.esm.js","sources":["../../../src/components/General/UserSettingsPinToggle.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
|
|
1
|
+
{"version":3,"file":"UserSettingsPinToggle.esm.js","sources":["../../../src/components/General/UserSettingsPinToggle.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 ListItem from '@material-ui/core/ListItem';\nimport ListItemSecondaryAction from '@material-ui/core/ListItemSecondaryAction';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport Switch from '@material-ui/core/Switch';\nimport Tooltip from '@material-ui/core/Tooltip';\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"],"names":[],"mappings":";;;;;;;;AAwBO,MAAM,wBAAwB,MAAM;AACzC,EAAA,MAAM,EAAE,QAAA,EAAU,qBAAsB,EAAA,GAAI,kBAAmB,EAAA;AAE/D,EAAA,4BACG,QACC,EAAA,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,YAAA;AAAA,MAAA;AAAA,QACC,OAAQ,EAAA,aAAA;AAAA,QACR,SAAU,EAAA;AAAA;AAAA,KACZ;AAAA,wBACC,uBACC,EAAA,EAAA,QAAA,kBAAA,GAAA;AAAA,MAAC,OAAA;AAAA,MAAA;AAAA,QACC,SAAU,EAAA,KAAA;AAAA,QACV,KAAK,EAAA,IAAA;AAAA,QACL,KAAO,EAAA,CAAA,EAAG,QAAW,GAAA,OAAA,GAAU,KAAK,CAAA,QAAA,CAAA;AAAA,QAEpC,QAAA,kBAAA,GAAA;AAAA,UAAC,MAAA;AAAA,UAAA;AAAA,YACC,KAAM,EAAA,SAAA;AAAA,YACN,OAAS,EAAA,QAAA;AAAA,YACT,QAAA,EAAU,MAAM,qBAAsB,EAAA;AAAA,YACtC,IAAK,EAAA,KAAA;AAAA,YACL,UAAA,EAAY,EAAE,YAAA,EAAc,oBAAqB;AAAA;AAAA;AACnD;AAAA,KAEJ,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
1
2
|
import Grid from '@material-ui/core/Grid';
|
|
2
3
|
import Typography from '@material-ui/core/Typography';
|
|
3
|
-
import React from 'react';
|
|
4
4
|
import { UserSettingsSignInAvatar } from './UserSettingsSignInAvatar.esm.js';
|
|
5
5
|
import { UserSettingsMenu } from './UserSettingsMenu.esm.js';
|
|
6
6
|
import { useUserProfile } from '../useUserProfileInfo.esm.js';
|
|
@@ -8,7 +8,16 @@ import { InfoCard } from '@backstage/core-components';
|
|
|
8
8
|
|
|
9
9
|
const UserSettingsProfileCard = () => {
|
|
10
10
|
const { profile, displayName } = useUserProfile();
|
|
11
|
-
return /* @__PURE__ */
|
|
11
|
+
return /* @__PURE__ */ jsx(InfoCard, { title: "Profile", variant: "gridItem", children: /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 6, children: [
|
|
12
|
+
/* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(UserSettingsSignInAvatar, { size: 96 }) }),
|
|
13
|
+
/* @__PURE__ */ jsxs(Grid, { item: true, xs: 12, sm: true, container: true, children: [
|
|
14
|
+
/* @__PURE__ */ jsx(Grid, { item: true, xs: true, container: true, direction: "column", spacing: 2, children: /* @__PURE__ */ jsxs(Grid, { item: true, xs: true, children: [
|
|
15
|
+
/* @__PURE__ */ jsx(Typography, { variant: "subtitle1", gutterBottom: true, children: displayName }),
|
|
16
|
+
profile.email && /* @__PURE__ */ jsx(Typography, { variant: "body2", color: "textSecondary", children: profile.email })
|
|
17
|
+
] }) }),
|
|
18
|
+
/* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(UserSettingsMenu, {}) })
|
|
19
|
+
] })
|
|
20
|
+
] }) });
|
|
12
21
|
};
|
|
13
22
|
|
|
14
23
|
export { UserSettingsProfileCard };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserSettingsProfileCard.esm.js","sources":["../../../src/components/General/UserSettingsProfileCard.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 Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport
|
|
1
|
+
{"version":3,"file":"UserSettingsProfileCard.esm.js","sources":["../../../src/components/General/UserSettingsProfileCard.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 Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\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"],"names":[],"mappings":";;;;;;;;AAwBO,MAAM,0BAA0B,MAAM;AAC3C,EAAA,MAAM,EAAE,OAAA,EAAS,WAAY,EAAA,GAAI,cAAe,EAAA;AAEhD,EACE,uBAAA,GAAA,CAAC,QAAS,EAAA,EAAA,KAAA,EAAM,SAAU,EAAA,OAAA,EAAQ,UAChC,EAAA,QAAA,kBAAA,IAAA,CAAC,IAAK,EAAA,EAAA,SAAA,EAAS,IAAC,EAAA,OAAA,EAAS,CACvB,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,QAAK,IAAI,EAAA,IAAA,EACR,8BAAC,wBAAyB,EAAA,EAAA,IAAA,EAAM,IAAI,CACtC,EAAA,CAAA;AAAA,oBACA,IAAA,CAAC,QAAK,IAAI,EAAA,IAAA,EAAC,IAAI,EAAI,EAAA,EAAA,EAAE,IAAC,EAAA,SAAA,EAAS,IAC7B,EAAA,QAAA,EAAA;AAAA,sBAAA,GAAA,CAAC,QAAK,IAAI,EAAA,IAAA,EAAC,EAAE,EAAA,IAAA,EAAC,WAAS,IAAC,EAAA,SAAA,EAAU,QAAS,EAAA,OAAA,EAAS,GAClD,QAAC,kBAAA,IAAA,CAAA,IAAA,EAAA,EAAK,IAAI,EAAA,IAAA,EAAC,IAAE,IACX,EAAA,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,UAAW,EAAA,EAAA,OAAA,EAAQ,WAAY,EAAA,YAAA,EAAY,MACzC,QACH,EAAA,WAAA,EAAA,CAAA;AAAA,QACC,OAAA,CAAQ,yBACN,GAAA,CAAA,UAAA,EAAA,EAAW,SAAQ,OAAQ,EAAA,KAAA,EAAM,eAC/B,EAAA,QAAA,EAAA,OAAA,CAAQ,KACX,EAAA;AAAA,OAAA,EAEJ,CACF,EAAA,CAAA;AAAA,0BACC,IAAK,EAAA,EAAA,IAAA,EAAI,IACR,EAAA,QAAA,kBAAA,GAAA,CAAC,oBAAiB,CACpB,EAAA;AAAA,KACF,EAAA;AAAA,GAAA,EACF,CACF,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import Avatar from '@material-ui/core/Avatar';
|
|
3
3
|
import { makeStyles } from '@material-ui/core/styles';
|
|
4
4
|
import { useUserProfile } from '../useUserProfileInfo.esm.js';
|
|
@@ -17,7 +17,7 @@ const UserSettingsSignInAvatar = (props) => {
|
|
|
17
17
|
const { iconSize } = sidebarConfig;
|
|
18
18
|
const classes = useStyles(size ? { size } : { size: iconSize });
|
|
19
19
|
const { profile } = useUserProfile();
|
|
20
|
-
return /* @__PURE__ */
|
|
20
|
+
return /* @__PURE__ */ jsx(
|
|
21
21
|
Avatar,
|
|
22
22
|
{
|
|
23
23
|
src: profile.picture,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserSettingsSignInAvatar.esm.js","sources":["../../../src/components/General/UserSettingsSignInAvatar.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
|
|
1
|
+
{"version":3,"file":"UserSettingsSignInAvatar.esm.js","sources":["../../../src/components/General/UserSettingsSignInAvatar.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 Avatar from '@material-ui/core/Avatar';\nimport { makeStyles, Theme } from '@material-ui/core/styles';\nimport { useUserProfile } from '../useUserProfileInfo';\nimport { sidebarConfig } from '@backstage/core-components';\n\nconst useStyles = makeStyles<Theme, { 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"],"names":[],"mappings":";;;;;;AAqBA,MAAM,SAAA,GAAY,WAAoC,CAAU,KAAA,MAAA;AAAA,EAC9D,MAAQ,EAAA;AAAA,IACN,KAAO,EAAA,CAAC,EAAE,IAAA,EAAW,KAAA,IAAA;AAAA,IACrB,MAAQ,EAAA,CAAC,EAAE,IAAA,EAAW,KAAA,IAAA;AAAA,IACtB,QAAU,EAAA,CAAC,EAAE,IAAA,OAAW,IAAO,GAAA,GAAA;AAAA,IAC/B,MAAQ,EAAA,CAAA,UAAA,EAAa,KAAM,CAAA,OAAA,CAAQ,UAAU,CAAA;AAAA;AAEjD,CAAE,CAAA,CAAA;AAGW,MAAA,wBAAA,GAA2B,CAAC,KAA6B,KAAA;AACpE,EAAM,MAAA,EAAE,MAAS,GAAA,KAAA;AAEjB,EAAM,MAAA,EAAE,UAAa,GAAA,aAAA;AACrB,EAAM,MAAA,OAAA,GAAU,UAAU,IAAO,GAAA,EAAE,MAAS,GAAA,EAAE,IAAM,EAAA,QAAA,EAAU,CAAA;AAC9D,EAAM,MAAA,EAAE,OAAQ,EAAA,GAAI,cAAe,EAAA;AAEnC,EACE,uBAAA,GAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,KAAK,OAAQ,CAAA,OAAA;AAAA,MACb,WAAW,OAAQ,CAAA,MAAA;AAAA,MACnB,GAAI,EAAA;AAAA;AAAA,GACN;AAEJ;;;;"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { cloneElement } from 'react';
|
|
2
3
|
import useObservable from 'react-use/esm/useObservable';
|
|
3
4
|
import AutoIcon from '@material-ui/icons/BrightnessAuto';
|
|
4
5
|
import ToggleButton from '@material-ui/lab/ToggleButton';
|
|
@@ -14,7 +15,7 @@ import { userSettingsTranslationRef } from '../../translation.esm.js';
|
|
|
14
15
|
|
|
15
16
|
const ThemeIcon = ({ id, activeId, icon }) => icon ? cloneElement(icon, {
|
|
16
17
|
color: activeId === id ? "primary" : void 0
|
|
17
|
-
}) : /* @__PURE__ */
|
|
18
|
+
}) : /* @__PURE__ */ jsx(AutoIcon, { color: activeId === id ? "primary" : void 0 });
|
|
18
19
|
const useStyles = makeStyles((theme) => ({
|
|
19
20
|
container: {
|
|
20
21
|
display: "flex",
|
|
@@ -52,7 +53,7 @@ const TooltipToggleButton = ({
|
|
|
52
53
|
title,
|
|
53
54
|
value,
|
|
54
55
|
...props
|
|
55
|
-
}) => /* @__PURE__ */
|
|
56
|
+
}) => /* @__PURE__ */ jsx(Tooltip, { placement: "top", arrow: true, title, children: /* @__PURE__ */ jsx(ToggleButton, { value, ...props, children }) });
|
|
56
57
|
const UserSettingsThemeToggle = () => {
|
|
57
58
|
const classes = useStyles();
|
|
58
59
|
const appThemeApi = useApi(appThemeApiRef);
|
|
@@ -69,56 +70,68 @@ const UserSettingsThemeToggle = () => {
|
|
|
69
70
|
appThemeApi.setActiveThemeId(void 0);
|
|
70
71
|
}
|
|
71
72
|
};
|
|
72
|
-
return /* @__PURE__ */
|
|
73
|
+
return /* @__PURE__ */ jsxs(
|
|
73
74
|
ListItem,
|
|
74
75
|
{
|
|
75
76
|
className: classes.list,
|
|
76
|
-
classes: { container: classes.container }
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
{
|
|
81
|
-
className: classes.listItemText,
|
|
82
|
-
primary: t("themeToggle.title"),
|
|
83
|
-
secondary: t("themeToggle.description")
|
|
84
|
-
}
|
|
85
|
-
),
|
|
86
|
-
/* @__PURE__ */ React.createElement(ListItemSecondaryAction, { className: classes.listItemSecondaryAction }, /* @__PURE__ */ React.createElement(
|
|
87
|
-
ToggleButtonGroup,
|
|
88
|
-
{
|
|
89
|
-
exclusive: true,
|
|
90
|
-
size: "small",
|
|
91
|
-
value: activeThemeId ?? "auto",
|
|
92
|
-
onChange: handleSetTheme
|
|
93
|
-
},
|
|
94
|
-
themeIds.map((theme) => {
|
|
95
|
-
const themeId = theme.id;
|
|
96
|
-
const themeIcon = theme.icon;
|
|
97
|
-
const themeTitle = theme.title || (themeId === "light" || themeId === "dark" ? t(`themeToggle.names.${themeId}`) : themeId);
|
|
98
|
-
return /* @__PURE__ */ React.createElement(
|
|
99
|
-
TooltipToggleButton,
|
|
77
|
+
classes: { container: classes.container },
|
|
78
|
+
children: [
|
|
79
|
+
/* @__PURE__ */ jsx(
|
|
80
|
+
ListItemText,
|
|
100
81
|
{
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
82
|
+
className: classes.listItemText,
|
|
83
|
+
primary: t("themeToggle.title"),
|
|
84
|
+
secondary: t("themeToggle.description")
|
|
85
|
+
}
|
|
86
|
+
),
|
|
87
|
+
/* @__PURE__ */ jsx(ListItemSecondaryAction, { className: classes.listItemSecondaryAction, children: /* @__PURE__ */ jsxs(
|
|
88
|
+
ToggleButtonGroup,
|
|
89
|
+
{
|
|
90
|
+
exclusive: true,
|
|
91
|
+
size: "small",
|
|
92
|
+
value: activeThemeId ?? "auto",
|
|
93
|
+
onChange: handleSetTheme,
|
|
94
|
+
children: [
|
|
95
|
+
themeIds.map((theme) => {
|
|
96
|
+
const themeId = theme.id;
|
|
97
|
+
const themeIcon = theme.icon;
|
|
98
|
+
const themeTitle = theme.title || (themeId === "light" || themeId === "dark" ? t(`themeToggle.names.${themeId}`) : themeId);
|
|
99
|
+
return /* @__PURE__ */ jsx(
|
|
100
|
+
TooltipToggleButton,
|
|
101
|
+
{
|
|
102
|
+
title: t("themeToggle.select", { theme: themeTitle }),
|
|
103
|
+
value: themeId,
|
|
104
|
+
children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
105
|
+
themeTitle,
|
|
106
|
+
"\xA0",
|
|
107
|
+
/* @__PURE__ */ jsx(
|
|
108
|
+
ThemeIcon,
|
|
109
|
+
{
|
|
110
|
+
id: themeId,
|
|
111
|
+
icon: themeIcon,
|
|
112
|
+
activeId: activeThemeId
|
|
113
|
+
}
|
|
114
|
+
)
|
|
115
|
+
] })
|
|
116
|
+
},
|
|
117
|
+
themeId
|
|
118
|
+
);
|
|
119
|
+
}),
|
|
120
|
+
/* @__PURE__ */ jsx(Tooltip, { placement: "top", arrow: true, title: t("themeToggle.selectAuto"), children: /* @__PURE__ */ jsxs(ToggleButton, { value: "auto", selected: activeThemeId === void 0, children: [
|
|
121
|
+
t("themeToggle.names.auto"),
|
|
122
|
+
"\xA0",
|
|
123
|
+
/* @__PURE__ */ jsx(
|
|
124
|
+
AutoIcon,
|
|
125
|
+
{
|
|
126
|
+
color: activeThemeId === void 0 ? "primary" : void 0
|
|
127
|
+
}
|
|
128
|
+
)
|
|
129
|
+
] }) })
|
|
130
|
+
]
|
|
131
|
+
}
|
|
132
|
+
) })
|
|
133
|
+
]
|
|
134
|
+
}
|
|
122
135
|
);
|
|
123
136
|
};
|
|
124
137
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserSettingsThemeToggle.esm.js","sources":["../../../src/components/General/UserSettingsThemeToggle.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
|
|
1
|
+
{"version":3,"file":"UserSettingsThemeToggle.esm.js","sources":["../../../src/components/General/UserSettingsThemeToggle.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 { MouseEvent, cloneElement } from 'react';\nimport useObservable from 'react-use/esm/useObservable';\nimport AutoIcon from '@material-ui/icons/BrightnessAuto';\nimport ToggleButton from '@material-ui/lab/ToggleButton';\nimport ToggleButtonGroup from '@material-ui/lab/ToggleButtonGroup';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport ListItemSecondaryAction from '@material-ui/core/ListItemSecondaryAction';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport { makeStyles } from '@material-ui/core/styles';\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: 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('themeToggle.title')}\n secondary={t('themeToggle.description')}\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(`themeToggle.names.${themeId}`)\n : themeId);\n return (\n <TooltipToggleButton\n key={themeId}\n title={t('themeToggle.select', { 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('themeToggle.selectAuto')}>\n <ToggleButton value=\"auto\" selected={activeThemeId === undefined}>\n {t('themeToggle.names.auto')} \n <AutoIcon\n color={activeThemeId === undefined ? 'primary' : undefined}\n />\n </ToggleButton>\n </Tooltip>\n </ToggleButtonGroup>\n </ListItemSecondaryAction>\n </ListItem>\n );\n};\n"],"names":[],"mappings":"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"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import SettingsIcon from '@material-ui/icons/Settings';
|
|
3
3
|
import { settingsRouteRef } from '../plugin.esm.js';
|
|
4
4
|
import { SidebarItem } from '@backstage/core-components';
|
|
@@ -7,7 +7,7 @@ import { useRouteRef } from '@backstage/core-plugin-api';
|
|
|
7
7
|
const Settings = (props) => {
|
|
8
8
|
const routePath = useRouteRef(settingsRouteRef);
|
|
9
9
|
const Icon = props.icon ? props.icon : SettingsIcon;
|
|
10
|
-
return /* @__PURE__ */
|
|
10
|
+
return /* @__PURE__ */ jsx(SidebarItem, { text: "Settings", to: routePath(), icon: Icon });
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
export { Settings };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Settings.esm.js","sources":["../../src/components/Settings.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
|
|
1
|
+
{"version":3,"file":"Settings.esm.js","sources":["../../src/components/Settings.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 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"],"names":[],"mappings":";;;;;;AAsBa,MAAA,QAAA,GAAW,CAAC,KAAoC,KAAA;AAC3D,EAAM,MAAA,SAAA,GAAY,YAAY,gBAAgB,CAAA;AAC9C,EAAA,MAAM,IAAO,GAAA,KAAA,CAAM,IAAO,GAAA,KAAA,CAAM,IAAO,GAAA,YAAA;AACvC,EAAO,uBAAA,GAAA,CAAC,eAAY,IAAK,EAAA,UAAA,EAAW,IAAI,SAAU,EAAA,EAAG,MAAM,IAAM,EAAA,CAAA;AACnE;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { useSidebarPinState, Page, Header, RoutedTabs } from '@backstage/core-components';
|
|
3
3
|
import { attachComponentData, useElementFilter } from '@backstage/core-plugin-api';
|
|
4
4
|
|
|
@@ -17,7 +17,10 @@ const SettingsLayout = (props) => {
|
|
|
17
17
|
withStrictError: "Child of SettingsLayout must be an SettingsLayout.Route"
|
|
18
18
|
}).getElements().map((child) => child.props)
|
|
19
19
|
);
|
|
20
|
-
return /* @__PURE__ */
|
|
20
|
+
return /* @__PURE__ */ jsxs(Page, { themeId: "home", children: [
|
|
21
|
+
!isMobile && /* @__PURE__ */ jsx(Header, { title: title ?? "Settings" }),
|
|
22
|
+
/* @__PURE__ */ jsx(RoutedTabs, { routes })
|
|
23
|
+
] });
|
|
21
24
|
};
|
|
22
25
|
attachComponentData(SettingsLayout, LAYOUT_DATA_KEY, true);
|
|
23
26
|
SettingsLayout.Route = Route;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsLayout.esm.js","sources":["../../../src/components/SettingsLayout/SettingsLayout.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
|
|
1
|
+
{"version":3,"file":"SettingsLayout.esm.js","sources":["../../../src/components/SettingsLayout/SettingsLayout.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 { ElementType, ReactNode } from 'react';\nimport { TabProps } from '@material-ui/core/Tab';\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<ElementType, { component?: 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?: 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"],"names":[],"mappings":";;;;AAqCO,MAAM,eAAkB,GAAA;AACxB,MAAM,qBAAwB,GAAA;AAErC,MAAM,QAAmD,MAAM,IAAA;AAC/D,mBAAoB,CAAA,KAAA,EAAO,uBAAuB,IAAI,CAAA;AAGtD,mBAAoB,CAAA,KAAA,EAAO,0BAA0B,IAAI,CAAA;AAY5C,MAAA,cAAA,GAAiB,CAAC,KAA+B,KAAA;AAC5D,EAAM,MAAA,EAAE,KAAO,EAAA,QAAA,EAAa,GAAA,KAAA;AAC5B,EAAM,MAAA,EAAE,QAAS,EAAA,GAAI,kBAAmB,EAAA;AAExC,EAAA,MAAM,MAAS,GAAA,gBAAA;AAAA,IAAiB,QAAA;AAAA,IAAU,CAAA,QAAA,KACxC,SACG,qBAAsB,CAAA;AAAA,MACrB,GAAK,EAAA,qBAAA;AAAA,MACL,eACE,EAAA;AAAA,KACH,CACA,CAAA,WAAA,GACA,GAAI,CAAA,CAAA,KAAA,KAAS,MAAM,KAAK;AAAA,GAC7B;AAEA,EACE,uBAAA,IAAA,CAAC,IAAK,EAAA,EAAA,OAAA,EAAQ,MACX,EAAA,QAAA,EAAA;AAAA,IAAA,CAAC,QAAY,oBAAA,GAAA,CAAC,MAAO,EAAA,EAAA,KAAA,EAAO,SAAS,UAAY,EAAA,CAAA;AAAA,oBAClD,GAAA,CAAC,cAAW,MAAgB,EAAA;AAAA,GAC9B,EAAA,CAAA;AAEJ;AAEA,mBAAoB,CAAA,cAAA,EAAgB,iBAAiB,IAAI,CAAA;AAEzD,cAAA,CAAe,KAAQ,GAAA,KAAA;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
1
2
|
import { useOutlet } from 'react-router-dom';
|
|
2
|
-
import React from 'react';
|
|
3
3
|
import { DefaultSettingsPage } from '../DefaultSettingsPage/DefaultSettingsPage.esm.js';
|
|
4
4
|
import { useElementFilter } from '@backstage/core-plugin-api';
|
|
5
5
|
import { LAYOUT_DATA_KEY, LAYOUT_ROUTE_DATA_KEY } from '../SettingsLayout/SettingsLayout.esm.js';
|
|
@@ -19,7 +19,7 @@ const SettingsPage = (props) => {
|
|
|
19
19
|
key: LAYOUT_ROUTE_DATA_KEY
|
|
20
20
|
}).getElements()
|
|
21
21
|
);
|
|
22
|
-
return /* @__PURE__ */
|
|
22
|
+
return /* @__PURE__ */ jsx(Fragment, { children: layout.length !== 0 && layout || /* @__PURE__ */ jsx(DefaultSettingsPage, { tabs, providerSettings }) });
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
export { SettingsPage };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsPage.esm.js","sources":["../../../src/components/SettingsPage/SettingsPage.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 */\nimport { useOutlet } from 'react-router-dom';\nimport
|
|
1
|
+
{"version":3,"file":"SettingsPage.esm.js","sources":["../../../src/components/SettingsPage/SettingsPage.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 */\nimport { useOutlet } from 'react-router-dom';\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":[],"mappings":";;;;;;AA4Ba,MAAA,YAAA,GAAe,CAAC,KAA8C,KAAA;AACzE,EAAM,MAAA,EAAE,kBAAqB,GAAA,KAAA;AAC7B,EAAA,MAAM,SAAS,SAAU,EAAA;AACzB,EAAA,MAAM,MAAS,GAAA,gBAAA;AAAA,IAAiB,MAAA;AAAA,IAAQ,CAAA,QAAA,KACtC,SACG,qBAAsB,CAAA;AAAA,MACrB,GAAK,EAAA;AAAA,KACN,EACA,WAAiC;AAAA,GACtC;AACA,EAAA,MAAM,IAAO,GAAA,gBAAA;AAAA,IAAiB,MAAA;AAAA,IAAQ,CAAA,QAAA,KACpC,SACG,qBAAsB,CAAA;AAAA,MACrB,GAAK,EAAA;AAAA,KACN,EACA,WAAsC;AAAA,GAC3C;AAEA,EACE,uBAAA,GAAA,CAAA,QAAA,EAAA,EACI,iBAAO,MAAW,KAAA,CAAA,IAAK,0BACtB,GAAA,CAAA,mBAAA,EAAA,EAAoB,IAAY,EAAA,gBAAA,EAAoC,CAEzE,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { attachComponentData } from '@backstage/core-plugin-api';
|
|
3
3
|
import { LAYOUT_ROUTE_DATA_KEY, SettingsLayout } from '../SettingsLayout/SettingsLayout.esm.js';
|
|
4
4
|
|
|
5
5
|
const USER_SETTINGS_TAB_KEY = LAYOUT_ROUTE_DATA_KEY;
|
|
6
|
-
const UserSettingsTab = (props) => /* @__PURE__ */
|
|
6
|
+
const UserSettingsTab = (props) => /* @__PURE__ */ jsx(SettingsLayout.Route, { path: props.path, title: props.title, children: /* @__PURE__ */ jsx(Fragment, { children: "props.children" }) });
|
|
7
7
|
attachComponentData(UserSettingsTab, USER_SETTINGS_TAB_KEY, "UserSettingsTab");
|
|
8
8
|
|
|
9
9
|
export { USER_SETTINGS_TAB_KEY, UserSettingsTab };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserSettingsTab.esm.js","sources":["../../../src/components/UserSettingsTab/UserSettingsTab.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 */\nimport
|
|
1
|
+
{"version":3,"file":"UserSettingsTab.esm.js","sources":["../../../src/components/UserSettingsTab/UserSettingsTab.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 */\nimport { 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":";;;;AAuBO,MAAM,qBAAwB,GAAA;AAmB9B,MAAM,eAAkB,GAAA,CAAC,KAC9B,qBAAA,GAAA,CAAC,eAAe,KAAf,EAAA,EAAqB,IAAM,EAAA,KAAA,CAAM,MAAM,KAAO,EAAA,KAAA,CAAM,KACnD,EAAA,QAAA,kBAAA,GAAA,CAAA,QAAA,EAAA,EAAE,4BAAc,CAClB,EAAA;AAGF,mBAAoB,CAAA,eAAA,EAAiB,uBAAuB,iBAAiB,CAAA;;;;"}
|