@backstage/plugin-home 0.8.7-next.1 → 0.8.7-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 +21 -0
- package/README.md +0 -4
- package/dist/alpha.d.ts +3 -3
- package/dist/alpha.esm.js +2 -2
- package/dist/alpha.esm.js.map +1 -1
- package/dist/assets/TemplateBackstageLogo.esm.js +11 -11
- package/dist/assets/TemplateBackstageLogo.esm.js.map +1 -1
- package/dist/assets/TemplateBackstageLogoIcon.esm.js +11 -11
- package/dist/assets/TemplateBackstageLogoIcon.esm.js.map +1 -1
- package/dist/componentRenderers/ComponentAccordion.esm.js +39 -27
- package/dist/componentRenderers/ComponentAccordion.esm.js.map +1 -1
- package/dist/componentRenderers/ComponentTabs/ComponentTab.esm.js +2 -2
- package/dist/componentRenderers/ComponentTabs/ComponentTab.esm.js.map +1 -1
- package/dist/componentRenderers/ComponentTabs/ComponentTabs.esm.js +14 -10
- package/dist/componentRenderers/ComponentTabs/ComponentTabs.esm.js.map +1 -1
- package/dist/components/CustomHomepage/AddWidgetDialog.esm.js +31 -26
- package/dist/components/CustomHomepage/AddWidgetDialog.esm.js.map +1 -1
- package/dist/components/CustomHomepage/CustomHomepageButtons.esm.js +53 -48
- package/dist/components/CustomHomepage/CustomHomepageButtons.esm.js.map +1 -1
- package/dist/components/CustomHomepage/CustomHomepageGrid.esm.js +78 -70
- package/dist/components/CustomHomepage/CustomHomepageGrid.esm.js.map +1 -1
- package/dist/components/CustomHomepage/WidgetSettingsOverlay.esm.js +55 -46
- package/dist/components/CustomHomepage/WidgetSettingsOverlay.esm.js.map +1 -1
- package/dist/components/CustomHomepage/types.esm.js.map +1 -1
- package/dist/components/HomepageCompositionRoot.esm.js +2 -2
- package/dist/components/HomepageCompositionRoot.esm.js.map +1 -1
- package/dist/components/StarredEntityListItem/StarredEntityListItem.esm.js +30 -28
- package/dist/components/StarredEntityListItem/StarredEntityListItem.esm.js.map +1 -1
- package/dist/components/VisitList/ItemCategory.esm.js +2 -2
- package/dist/components/VisitList/ItemCategory.esm.js.map +1 -1
- package/dist/components/VisitList/ItemDetail.esm.js +11 -7
- package/dist/components/VisitList/ItemDetail.esm.js.map +1 -1
- package/dist/components/VisitList/ItemName.esm.js +5 -5
- package/dist/components/VisitList/ItemName.esm.js.map +1 -1
- package/dist/components/VisitList/VisitList.esm.js +23 -14
- package/dist/components/VisitList/VisitList.esm.js.map +1 -1
- package/dist/components/VisitList/VisitListEmpty.esm.js +5 -2
- package/dist/components/VisitList/VisitListEmpty.esm.js.map +1 -1
- package/dist/components/VisitList/VisitListFew.esm.js +2 -2
- package/dist/components/VisitList/VisitListFew.esm.js.map +1 -1
- package/dist/components/VisitList/VisitListItem.esm.js +12 -9
- package/dist/components/VisitList/VisitListItem.esm.js.map +1 -1
- package/dist/components/VisitList/VisitListSkeleton.esm.js +23 -17
- package/dist/components/VisitList/VisitListSkeleton.esm.js.map +1 -1
- package/dist/components/VisitListener.esm.js +3 -2
- package/dist/components/VisitListener.esm.js.map +1 -1
- package/dist/homePageComponents/CompanyLogo/CompanyLogo.esm.js +2 -2
- package/dist/homePageComponents/CompanyLogo/CompanyLogo.esm.js.map +1 -1
- package/dist/homePageComponents/FeaturedDocsCard/Content.esm.js +32 -30
- package/dist/homePageComponents/FeaturedDocsCard/Content.esm.js.map +1 -1
- package/dist/homePageComponents/HeaderWorldClock/HeaderWorldClock.esm.js +9 -8
- package/dist/homePageComponents/HeaderWorldClock/HeaderWorldClock.esm.js.map +1 -1
- package/dist/homePageComponents/QuickStart/Content.esm.js +34 -26
- package/dist/homePageComponents/QuickStart/Content.esm.js.map +1 -1
- package/dist/homePageComponents/QuickStart/ContentModal.esm.js +25 -21
- package/dist/homePageComponents/QuickStart/ContentModal.esm.js.map +1 -1
- package/dist/homePageComponents/RandomJoke/Actions.esm.js +2 -2
- package/dist/homePageComponents/RandomJoke/Actions.esm.js.map +1 -1
- package/dist/homePageComponents/RandomJoke/Content.esm.js +6 -3
- package/dist/homePageComponents/RandomJoke/Content.esm.js.map +1 -1
- package/dist/homePageComponents/RandomJoke/Context.esm.js +10 -9
- package/dist/homePageComponents/RandomJoke/Context.esm.js.map +1 -1
- package/dist/homePageComponents/RandomJoke/Settings.esm.js +19 -16
- package/dist/homePageComponents/RandomJoke/Settings.esm.js.map +1 -1
- package/dist/homePageComponents/StarredEntities/Content.esm.js +45 -40
- package/dist/homePageComponents/StarredEntities/Content.esm.js.map +1 -1
- package/dist/homePageComponents/Toolkit/Content.esm.js +11 -8
- package/dist/homePageComponents/Toolkit/Content.esm.js.map +1 -1
- package/dist/homePageComponents/Toolkit/Context.esm.js +5 -4
- package/dist/homePageComponents/Toolkit/Context.esm.js.map +1 -1
- package/dist/homePageComponents/VisitedByType/Actions.esm.js +4 -3
- package/dist/homePageComponents/VisitedByType/Actions.esm.js.map +1 -1
- package/dist/homePageComponents/VisitedByType/Content.esm.js +3 -2
- package/dist/homePageComponents/VisitedByType/Content.esm.js.map +1 -1
- package/dist/homePageComponents/VisitedByType/Context.esm.js +5 -4
- package/dist/homePageComponents/VisitedByType/Context.esm.js.map +1 -1
- package/dist/homePageComponents/VisitedByType/RecentlyVisited.esm.js +2 -2
- package/dist/homePageComponents/VisitedByType/RecentlyVisited.esm.js.map +1 -1
- package/dist/homePageComponents/VisitedByType/TopVisited.esm.js +2 -2
- package/dist/homePageComponents/VisitedByType/TopVisited.esm.js.map +1 -1
- package/dist/homePageComponents/VisitedByType/VisitedByType.esm.js +2 -2
- package/dist/homePageComponents/VisitedByType/VisitedByType.esm.js.map +1 -1
- package/dist/homePageComponents/WelcomeTitle/WelcomeTitle.esm.js +3 -2
- package/dist/homePageComponents/WelcomeTitle/WelcomeTitle.esm.js.map +1 -1
- package/dist/index.d.ts +33 -34
- package/dist/index.esm.js +1 -1
- package/package.json +15 -15
|
@@ -1,32 +1,35 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
1
2
|
import FormControl from '@material-ui/core/FormControl';
|
|
2
3
|
import FormLabel from '@material-ui/core/FormLabel';
|
|
3
4
|
import RadioGroup from '@material-ui/core/RadioGroup';
|
|
4
5
|
import FormControlLabel from '@material-ui/core/FormControlLabel';
|
|
5
6
|
import Radio from '@material-ui/core/Radio';
|
|
6
|
-
import React from 'react';
|
|
7
7
|
import { useRandomJoke } from './Context.esm.js';
|
|
8
8
|
import upperFirst from 'lodash/upperFirst';
|
|
9
9
|
|
|
10
10
|
const Settings = () => {
|
|
11
11
|
const { type, handleChangeType } = useRandomJoke();
|
|
12
12
|
const JOKE_TYPES = ["any", "programming"];
|
|
13
|
-
return /* @__PURE__ */
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
value: type,
|
|
18
|
-
onChange: (e) => handleChangeType(e.target.value)
|
|
19
|
-
},
|
|
20
|
-
JOKE_TYPES.map((t) => /* @__PURE__ */ React.createElement(
|
|
21
|
-
FormControlLabel,
|
|
13
|
+
return /* @__PURE__ */ jsxs(FormControl, { component: "fieldset", children: [
|
|
14
|
+
/* @__PURE__ */ jsx(FormLabel, { component: "legend", children: "Joke Type" }),
|
|
15
|
+
/* @__PURE__ */ jsx(
|
|
16
|
+
RadioGroup,
|
|
22
17
|
{
|
|
23
|
-
|
|
24
|
-
value:
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
"aria-label": "joke type",
|
|
19
|
+
value: type,
|
|
20
|
+
onChange: (e) => handleChangeType(e.target.value),
|
|
21
|
+
children: JOKE_TYPES.map((t) => /* @__PURE__ */ jsx(
|
|
22
|
+
FormControlLabel,
|
|
23
|
+
{
|
|
24
|
+
value: t,
|
|
25
|
+
control: /* @__PURE__ */ jsx(Radio, {}),
|
|
26
|
+
label: upperFirst(t)
|
|
27
|
+
},
|
|
28
|
+
t
|
|
29
|
+
))
|
|
27
30
|
}
|
|
28
|
-
)
|
|
29
|
-
)
|
|
31
|
+
)
|
|
32
|
+
] });
|
|
30
33
|
};
|
|
31
34
|
|
|
32
35
|
export { Settings };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Settings.esm.js","sources":["../../../src/homePageComponents/RandomJoke/Settings.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport FormControl from '@material-ui/core/FormControl';\nimport FormLabel from '@material-ui/core/FormLabel';\nimport RadioGroup from '@material-ui/core/RadioGroup';\nimport FormControlLabel from '@material-ui/core/FormControlLabel';\nimport Radio from '@material-ui/core/Radio';\nimport
|
|
1
|
+
{"version":3,"file":"Settings.esm.js","sources":["../../../src/homePageComponents/RandomJoke/Settings.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport FormControl from '@material-ui/core/FormControl';\nimport FormLabel from '@material-ui/core/FormLabel';\nimport RadioGroup from '@material-ui/core/RadioGroup';\nimport FormControlLabel from '@material-ui/core/FormControlLabel';\nimport Radio from '@material-ui/core/Radio';\nimport { useRandomJoke, JokeType } from './Context';\nimport upperFirst from 'lodash/upperFirst';\n\nexport const Settings = () => {\n const { type, handleChangeType } = useRandomJoke();\n const JOKE_TYPES: JokeType[] = ['any' as JokeType, 'programming' as JokeType];\n return (\n <FormControl component=\"fieldset\">\n <FormLabel component=\"legend\">Joke Type</FormLabel>\n <RadioGroup\n aria-label=\"joke type\"\n value={type}\n onChange={e => handleChangeType(e.target.value)}\n >\n {JOKE_TYPES.map(t => (\n <FormControlLabel\n key={t}\n value={t}\n control={<Radio />}\n label={upperFirst(t)}\n />\n ))}\n </RadioGroup>\n </FormControl>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AAuBO,MAAM,WAAW,MAAM;AAC5B,EAAA,MAAM,EAAE,IAAA,EAAM,gBAAiB,EAAA,GAAI,aAAc,EAAA;AACjD,EAAM,MAAA,UAAA,GAAyB,CAAC,KAAA,EAAmB,aAAyB,CAAA;AAC5E,EACE,uBAAA,IAAA,CAAC,WAAY,EAAA,EAAA,SAAA,EAAU,UACrB,EAAA,QAAA,EAAA;AAAA,oBAAC,GAAA,CAAA,SAAA,EAAA,EAAU,SAAU,EAAA,QAAA,EAAS,QAAS,EAAA,WAAA,EAAA,CAAA;AAAA,oBACvC,GAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,YAAW,EAAA,WAAA;AAAA,QACX,KAAO,EAAA,IAAA;AAAA,QACP,QAAU,EAAA,CAAA,CAAA,KAAK,gBAAiB,CAAA,CAAA,CAAE,OAAO,KAAK,CAAA;AAAA,QAE7C,QAAA,EAAA,UAAA,CAAW,IAAI,CACd,CAAA,qBAAA,GAAA;AAAA,UAAC,gBAAA;AAAA,UAAA;AAAA,YAEC,KAAO,EAAA,CAAA;AAAA,YACP,OAAA,sBAAU,KAAM,EAAA,EAAA,CAAA;AAAA,YAChB,KAAA,EAAO,WAAW,CAAC;AAAA,WAAA;AAAA,UAHd;AAAA,SAKR;AAAA;AAAA;AACH,GACF,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
1
2
|
import { catalogApiRef, useStarredEntities } from '@backstage/plugin-catalog-react';
|
|
2
3
|
import { stringifyEntityRef } from '@backstage/catalog-model';
|
|
3
4
|
import { useApi } from '@backstage/core-plugin-api';
|
|
@@ -6,7 +7,7 @@ import List from '@material-ui/core/List';
|
|
|
6
7
|
import Typography from '@material-ui/core/Typography';
|
|
7
8
|
import Tabs from '@material-ui/core/Tabs';
|
|
8
9
|
import Tab from '@material-ui/core/Tab';
|
|
9
|
-
import
|
|
10
|
+
import { useState } from 'react';
|
|
10
11
|
import useAsync from 'react-use/esm/useAsync';
|
|
11
12
|
import { StarredEntityListItem } from '../../components/StarredEntityListItem/StarredEntityListItem.esm.js';
|
|
12
13
|
import { makeStyles } from '@material-ui/core/styles';
|
|
@@ -27,7 +28,7 @@ const Content = ({
|
|
|
27
28
|
const classes = useStyles();
|
|
28
29
|
const catalogApi = useApi(catalogApiRef);
|
|
29
30
|
const { starredEntities, toggleStarredEntity } = useStarredEntities();
|
|
30
|
-
const [activeTab, setActiveTab] =
|
|
31
|
+
const [activeTab, setActiveTab] = useState(0);
|
|
31
32
|
const entities = useAsync(async () => {
|
|
32
33
|
if (!starredEntities.size) {
|
|
33
34
|
return [];
|
|
@@ -45,9 +46,9 @@ const Content = ({
|
|
|
45
46
|
})).items.filter((e) => !!e);
|
|
46
47
|
}, [catalogApi, starredEntities]);
|
|
47
48
|
if (starredEntities.size === 0)
|
|
48
|
-
return /* @__PURE__ */
|
|
49
|
+
return /* @__PURE__ */ jsx(Typography, { variant: "body1", children: noStarredEntitiesMessage || "Click the star beside an entity name to add it to this list!" });
|
|
49
50
|
if (entities.loading) {
|
|
50
|
-
return /* @__PURE__ */
|
|
51
|
+
return /* @__PURE__ */ jsx(Progress, {});
|
|
51
52
|
}
|
|
52
53
|
const groupedEntities = {};
|
|
53
54
|
entities.value?.forEach((entity) => {
|
|
@@ -58,42 +59,46 @@ const Content = ({
|
|
|
58
59
|
groupedEntities[kind].push(entity);
|
|
59
60
|
});
|
|
60
61
|
const groupByKindEntries = Object.entries(groupedEntities);
|
|
61
|
-
return entities.error ? /* @__PURE__ */
|
|
62
|
-
(
|
|
63
|
-
b.metadata.title ??
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
)
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
62
|
+
return entities.error ? /* @__PURE__ */ jsx(ResponseErrorPanel, { error: entities.error }) : /* @__PURE__ */ jsxs("div", { children: [
|
|
63
|
+
!groupByKind && /* @__PURE__ */ jsx(List, { className: classes.list, children: entities.value?.sort(
|
|
64
|
+
(a, b) => (a.metadata.title ?? a.metadata.name).localeCompare(
|
|
65
|
+
b.metadata.title ?? b.metadata.name
|
|
66
|
+
)
|
|
67
|
+
).map((entity) => /* @__PURE__ */ jsx(
|
|
68
|
+
StarredEntityListItem,
|
|
69
|
+
{
|
|
70
|
+
entity,
|
|
71
|
+
onToggleStarredEntity: toggleStarredEntity,
|
|
72
|
+
showKind: true
|
|
73
|
+
},
|
|
74
|
+
stringifyEntityRef(entity)
|
|
75
|
+
)) }),
|
|
76
|
+
groupByKind && /* @__PURE__ */ jsx(
|
|
77
|
+
Tabs,
|
|
78
|
+
{
|
|
79
|
+
className: classes.tabs,
|
|
80
|
+
value: activeTab,
|
|
81
|
+
onChange: (_, newValue) => setActiveTab(newValue),
|
|
82
|
+
variant: "scrollable",
|
|
83
|
+
scrollButtons: "auto",
|
|
84
|
+
"aria-label": "entity-tabs",
|
|
85
|
+
children: groupByKindEntries.map(([kind]) => /* @__PURE__ */ jsx(Tab, { label: kind }, kind))
|
|
86
|
+
}
|
|
87
|
+
),
|
|
88
|
+
groupByKind && groupByKindEntries.map(([kind, entitiesByKind], index) => /* @__PURE__ */ jsx("div", { hidden: groupByKind && activeTab !== index, children: /* @__PURE__ */ jsx(List, { className: classes.list, children: entitiesByKind?.sort(
|
|
89
|
+
(a, b) => (a.metadata.title ?? a.metadata.name).localeCompare(
|
|
90
|
+
b.metadata.title ?? b.metadata.name
|
|
91
|
+
)
|
|
92
|
+
).map((entity) => /* @__PURE__ */ jsx(
|
|
93
|
+
StarredEntityListItem,
|
|
94
|
+
{
|
|
95
|
+
entity,
|
|
96
|
+
onToggleStarredEntity: toggleStarredEntity,
|
|
97
|
+
showKind: false
|
|
98
|
+
},
|
|
99
|
+
stringifyEntityRef(entity)
|
|
100
|
+
)) }) }, kind))
|
|
101
|
+
] });
|
|
97
102
|
};
|
|
98
103
|
|
|
99
104
|
export { Content };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Content.esm.js","sources":["../../../src/homePageComponents/StarredEntities/Content.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 {\n catalogApiRef,\n useStarredEntities,\n} from '@backstage/plugin-catalog-react';\nimport { Entity, stringifyEntityRef } from '@backstage/catalog-model';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { Progress, ResponseErrorPanel } from '@backstage/core-components';\nimport List from '@material-ui/core/List';\nimport Typography from '@material-ui/core/Typography';\nimport Tabs from '@material-ui/core/Tabs';\nimport Tab from '@material-ui/core/Tab';\nimport
|
|
1
|
+
{"version":3,"file":"Content.esm.js","sources":["../../../src/homePageComponents/StarredEntities/Content.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 {\n catalogApiRef,\n useStarredEntities,\n} from '@backstage/plugin-catalog-react';\nimport { Entity, stringifyEntityRef } from '@backstage/catalog-model';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { Progress, ResponseErrorPanel } from '@backstage/core-components';\nimport List from '@material-ui/core/List';\nimport Typography from '@material-ui/core/Typography';\nimport Tabs from '@material-ui/core/Tabs';\nimport Tab from '@material-ui/core/Tab';\nimport { ReactNode, useState } from 'react';\nimport useAsync from 'react-use/esm/useAsync';\nimport { StarredEntityListItem } from '../../components/StarredEntityListItem/StarredEntityListItem';\nimport { makeStyles } from '@material-ui/core/styles';\n\nconst useStyles = makeStyles(theme => ({\n tabs: {\n marginBottom: theme.spacing(1),\n },\n list: {\n paddingTop: 0,\n paddingBottom: 0,\n },\n}));\n\n/**\n * Props for the StarredEntities component\n *\n * @public\n */\nexport type StarredEntitiesProps = {\n noStarredEntitiesMessage?: ReactNode | undefined;\n groupByKind?: boolean;\n};\n\n/**\n * A component to display a list of starred entities for the user.\n *\n * @public\n */\nexport const Content = ({\n noStarredEntitiesMessage,\n groupByKind,\n}: StarredEntitiesProps) => {\n const classes = useStyles();\n const catalogApi = useApi(catalogApiRef);\n const { starredEntities, toggleStarredEntity } = useStarredEntities();\n const [activeTab, setActiveTab] = useState(0);\n\n // Grab starred entities from catalog to ensure they still exist and also retrieve display titles\n const entities = useAsync(async () => {\n if (!starredEntities.size) {\n return [];\n }\n\n return (\n await catalogApi.getEntitiesByRefs({\n entityRefs: [...starredEntities],\n fields: [\n 'kind',\n 'metadata.namespace',\n 'metadata.name',\n 'spec.type',\n 'metadata.title',\n 'spec.profile.displayName',\n ],\n })\n ).items.filter((e): e is Entity => !!e);\n }, [catalogApi, starredEntities]);\n\n if (starredEntities.size === 0)\n return (\n <Typography variant=\"body1\">\n {noStarredEntitiesMessage ||\n 'Click the star beside an entity name to add it to this list!'}\n </Typography>\n );\n\n if (entities.loading) {\n return <Progress />;\n }\n\n const groupedEntities: { [kind: string]: Entity[] } = {};\n entities.value?.forEach(entity => {\n const kind = entity.kind;\n if (!groupedEntities[kind]) {\n groupedEntities[kind] = [];\n }\n groupedEntities[kind].push(entity);\n });\n\n const groupByKindEntries = Object.entries(groupedEntities);\n\n return entities.error ? (\n <ResponseErrorPanel error={entities.error} />\n ) : (\n <div>\n {!groupByKind && (\n <List className={classes.list}>\n {entities.value\n ?.sort((a, b) =>\n (a.metadata.title ?? a.metadata.name).localeCompare(\n b.metadata.title ?? b.metadata.name,\n ),\n )\n .map(entity => (\n <StarredEntityListItem\n key={stringifyEntityRef(entity)}\n entity={entity}\n onToggleStarredEntity={toggleStarredEntity}\n showKind\n />\n ))}\n </List>\n )}\n\n {groupByKind && (\n <Tabs\n className={classes.tabs}\n value={activeTab}\n onChange={(_, newValue) => setActiveTab(newValue)}\n variant=\"scrollable\"\n scrollButtons=\"auto\"\n aria-label=\"entity-tabs\"\n >\n {groupByKindEntries.map(([kind]) => (\n <Tab key={kind} label={kind} />\n ))}\n </Tabs>\n )}\n\n {groupByKind &&\n groupByKindEntries.map(([kind, entitiesByKind], index) => (\n <div key={kind} hidden={groupByKind && activeTab !== index}>\n <List className={classes.list}>\n {entitiesByKind\n ?.sort((a, b) =>\n (a.metadata.title ?? a.metadata.name).localeCompare(\n b.metadata.title ?? b.metadata.name,\n ),\n )\n .map(entity => (\n <StarredEntityListItem\n key={stringifyEntityRef(entity)}\n entity={entity}\n onToggleStarredEntity={toggleStarredE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stage/core-components';
|
|
2
3
|
import List from '@material-ui/core/List';
|
|
3
4
|
import ListItemIcon from '@material-ui/core/ListItemIcon';
|
|
4
5
|
import ListItemText from '@material-ui/core/ListItemText';
|
|
5
6
|
import { makeStyles } from '@material-ui/core/styles';
|
|
6
|
-
import React from 'react';
|
|
7
7
|
import { useToolkit } from './Context.esm.js';
|
|
8
8
|
|
|
9
9
|
const useStyles = makeStyles((theme) => ({
|
|
@@ -37,13 +37,16 @@ const Content = (props) => {
|
|
|
37
37
|
const classes = useStyles();
|
|
38
38
|
const toolkit = useToolkit();
|
|
39
39
|
const tools = toolkit?.tools ?? props.tools;
|
|
40
|
-
return /* @__PURE__ */
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
40
|
+
return /* @__PURE__ */ jsx(List, { className: classes.toolkit, children: tools.map((tool) => /* @__PURE__ */ jsxs(Link, { to: tool.url, className: classes.tool, children: [
|
|
41
|
+
/* @__PURE__ */ jsx(ListItemIcon, { className: classes.icon, children: tool.icon }),
|
|
42
|
+
/* @__PURE__ */ jsx(
|
|
43
|
+
ListItemText,
|
|
44
|
+
{
|
|
45
|
+
secondaryTypographyProps: { className: classes.label },
|
|
46
|
+
secondary: tool.label
|
|
47
|
+
}
|
|
48
|
+
)
|
|
49
|
+
] }, tool.url)) });
|
|
47
50
|
};
|
|
48
51
|
|
|
49
52
|
export { Content };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Content.esm.js","sources":["../../../src/homePageComponents/Toolkit/Content.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Link } from '@backstage/core-components';\nimport List from '@material-ui/core/List';\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport { makeStyles } from '@material-ui/core/styles';\nimport
|
|
1
|
+
{"version":3,"file":"Content.esm.js","sources":["../../../src/homePageComponents/Toolkit/Content.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Link } from '@backstage/core-components';\nimport List from '@material-ui/core/List';\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { useToolkit, Tool } from './Context';\n\nconst useStyles = makeStyles(theme => ({\n toolkit: {\n display: 'flex',\n flexWrap: 'wrap',\n textAlign: 'center',\n },\n tool: {\n margin: theme.spacing(0.5, 1),\n },\n label: {\n marginTop: theme.spacing(1),\n width: '72px',\n fontSize: '0.9em',\n lineHeight: '1.25',\n overflowWrap: 'break-word',\n color: theme.palette.text.secondary,\n },\n icon: {\n width: '64px',\n height: '64px',\n borderRadius: '50px',\n justifyContent: 'center',\n alignItems: 'center',\n boxShadow: theme.shadows[1],\n backgroundColor: theme.palette.background.default,\n },\n}));\n\n/**\n * A component to display a list of tools for the user.\n *\n * @public\n */\nexport const Content = (props: ToolkitContentProps) => {\n const classes = useStyles();\n const toolkit = useToolkit();\n const tools = toolkit?.tools ?? props.tools;\n\n return (\n <List className={classes.toolkit}>\n {tools.map((tool: Tool) => (\n <Link key={tool.url} to={tool.url} className={classes.tool}>\n <ListItemIcon className={classes.icon}>{tool.icon}</ListItemIcon>\n <ListItemText\n secondaryTypographyProps={{ className: classes.label }}\n secondary={tool.label}\n />\n </Link>\n ))}\n </List>\n );\n};\n\n/**\n * Props for Toolkit Content component.\n *\n * @public\n */\nexport type ToolkitContentProps = {\n tools: Tool[];\n};\n"],"names":[],"mappings":";;;;;;;;AAuBA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,OAAS,EAAA;AAAA,IACP,OAAS,EAAA,MAAA;AAAA,IACT,QAAU,EAAA,MAAA;AAAA,IACV,SAAW,EAAA;AAAA,GACb;AAAA,EACA,IAAM,EAAA;AAAA,IACJ,MAAQ,EAAA,KAAA,CAAM,OAAQ,CAAA,GAAA,EAAK,CAAC;AAAA,GAC9B;AAAA,EACA,KAAO,EAAA;AAAA,IACL,SAAA,EAAW,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,IAC1B,KAAO,EAAA,MAAA;AAAA,IACP,QAAU,EAAA,OAAA;AAAA,IACV,UAAY,EAAA,MAAA;AAAA,IACZ,YAAc,EAAA,YAAA;AAAA,IACd,KAAA,EAAO,KAAM,CAAA,OAAA,CAAQ,IAAK,CAAA;AAAA,GAC5B;AAAA,EACA,IAAM,EAAA;AAAA,IACJ,KAAO,EAAA,MAAA;AAAA,IACP,MAAQ,EAAA,MAAA;AAAA,IACR,YAAc,EAAA,MAAA;AAAA,IACd,cAAgB,EAAA,QAAA;AAAA,IAChB,UAAY,EAAA,QAAA;AAAA,IACZ,SAAA,EAAW,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,IAC1B,eAAA,EAAiB,KAAM,CAAA,OAAA,CAAQ,UAAW,CAAA;AAAA;AAE9C,CAAE,CAAA,CAAA;AAOW,MAAA,OAAA,GAAU,CAAC,KAA+B,KAAA;AACrD,EAAA,MAAM,UAAU,SAAU,EAAA;AAC1B,EAAA,MAAM,UAAU,UAAW,EAAA;AAC3B,EAAM,MAAA,KAAA,GAAQ,OAAS,EAAA,KAAA,IAAS,KAAM,CAAA,KAAA;AAEtC,EAAA,2BACG,IAAK,EAAA,EAAA,SAAA,EAAW,OAAQ,CAAA,OAAA,EACtB,gBAAM,GAAI,CAAA,CAAC,IACV,qBAAA,IAAA,CAAC,QAAoB,EAAI,EAAA,IAAA,CAAK,GAAK,EAAA,SAAA,EAAW,QAAQ,IACpD,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,YAAa,EAAA,EAAA,SAAA,EAAW,OAAQ,CAAA,IAAA,EAAO,eAAK,IAAK,EAAA,CAAA;AAAA,oBAClD,GAAA;AAAA,MAAC,YAAA;AAAA,MAAA;AAAA,QACC,wBAA0B,EAAA,EAAE,SAAW,EAAA,OAAA,CAAQ,KAAM,EAAA;AAAA,QACrD,WAAW,IAAK,CAAA;AAAA;AAAA;AAClB,GALS,EAAA,EAAA,IAAA,CAAK,GAMhB,CACD,CACH,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { createContext, useState, useContext } from 'react';
|
|
2
3
|
|
|
3
4
|
const Context = createContext(void 0);
|
|
4
5
|
const ContextProvider = (props) => {
|
|
5
6
|
const { children, tools } = props;
|
|
6
|
-
const [toolsValue, _setTools] =
|
|
7
|
+
const [toolsValue, _setTools] = useState(tools);
|
|
7
8
|
const value = {
|
|
8
9
|
tools: toolsValue
|
|
9
10
|
};
|
|
10
|
-
return /* @__PURE__ */
|
|
11
|
+
return /* @__PURE__ */ jsx(Context.Provider, { value, children });
|
|
11
12
|
};
|
|
12
13
|
const useToolkit = () => {
|
|
13
|
-
const value =
|
|
14
|
+
const value = useContext(Context);
|
|
14
15
|
return value;
|
|
15
16
|
};
|
|
16
17
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Context.esm.js","sources":["../../../src/homePageComponents/Toolkit/Context.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":"Context.esm.js","sources":["../../../src/homePageComponents/Toolkit/Context.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 { ReactNode, useState, useContext, createContext } from 'react';\n\n/** @public */\nexport type Tool = {\n label: string;\n url: string;\n icon: ReactNode;\n};\n\ntype ToolkitContextValue = {\n tools: Tool[];\n};\n\nconst Context = createContext<ToolkitContextValue | undefined>(undefined);\n\nexport const ContextProvider = (props: {\n children: JSX.Element;\n tools: Tool[];\n}) => {\n const { children, tools } = props;\n\n const [toolsValue, _setTools] = useState(tools);\n\n const value: ToolkitContextValue = {\n tools: toolsValue,\n };\n\n return <Context.Provider value={value}>{children}</Context.Provider>;\n};\n\nexport const useToolkit = () => {\n const value = useContext(Context);\n return value;\n};\n\nexport default Context;\n"],"names":[],"mappings":";;;AA6BM,MAAA,OAAA,GAAU,cAA+C,KAAS,CAAA;AAE3D,MAAA,eAAA,GAAkB,CAAC,KAG1B,KAAA;AACJ,EAAM,MAAA,EAAE,QAAU,EAAA,KAAA,EAAU,GAAA,KAAA;AAE5B,EAAA,MAAM,CAAC,UAAA,EAAY,SAAS,CAAA,GAAI,SAAS,KAAK,CAAA;AAE9C,EAAA,MAAM,KAA6B,GAAA;AAAA,IACjC,KAAO,EAAA;AAAA,GACT;AAEA,EAAA,uBAAQ,GAAA,CAAA,OAAA,CAAQ,QAAR,EAAA,EAAiB,OAAe,QAAS,EAAA,CAAA;AACnD;AAEO,MAAM,aAAa,MAAM;AAC9B,EAAM,MAAA,KAAA,GAAQ,WAAW,OAAO,CAAA;AAChC,EAAO,OAAA,KAAA;AACT;;;;"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { useCallback } from 'react';
|
|
2
3
|
import Button from '@material-ui/core/Button';
|
|
3
4
|
import { useContext } from './Context.esm.js';
|
|
4
5
|
|
|
@@ -9,8 +10,8 @@ const Actions = () => {
|
|
|
9
10
|
[setCollapsed]
|
|
10
11
|
);
|
|
11
12
|
const label = collapsed ? "View More" : "View Less";
|
|
12
|
-
if (!loading && visits.length <= numVisitsOpen) return /* @__PURE__ */
|
|
13
|
-
return /* @__PURE__ */
|
|
13
|
+
if (!loading && visits.length <= numVisitsOpen) return /* @__PURE__ */ jsx(Fragment, {});
|
|
14
|
+
return /* @__PURE__ */ jsx(Button, { variant: "text", onClick, children: label });
|
|
14
15
|
};
|
|
15
16
|
|
|
16
17
|
export { Actions };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Actions.esm.js","sources":["../../../src/homePageComponents/VisitedByType/Actions.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 */\n\nimport
|
|
1
|
+
{"version":3,"file":"Actions.esm.js","sources":["../../../src/homePageComponents/VisitedByType/Actions.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 */\n\nimport { useCallback } from 'react';\nimport Button from '@material-ui/core/Button';\nimport { useContext } from './Context';\n\nexport const Actions = () => {\n const { collapsed, setCollapsed, visits, numVisitsOpen, loading } =\n useContext();\n const onClick = useCallback(\n () => setCollapsed(prevCollapsed => !prevCollapsed),\n [setCollapsed],\n );\n const label = collapsed ? 'View More' : 'View Less';\n\n if (!loading && visits.length <= numVisitsOpen) return <></>;\n\n return (\n <Button variant=\"text\" onClick={onClick}>\n {label}\n </Button>\n );\n};\n"],"names":[],"mappings":";;;;;AAoBO,MAAM,UAAU,MAAM;AAC3B,EAAA,MAAM,EAAE,SAAW,EAAA,YAAA,EAAc,QAAQ,aAAe,EAAA,OAAA,KACtD,UAAW,EAAA;AACb,EAAA,MAAM,OAAU,GAAA,WAAA;AAAA,IACd,MAAM,YAAA,CAAa,CAAiB,aAAA,KAAA,CAAC,aAAa,CAAA;AAAA,IAClD,CAAC,YAAY;AAAA,GACf;AACA,EAAM,MAAA,KAAA,GAAQ,YAAY,WAAc,GAAA,WAAA;AAExC,EAAA,IAAI,CAAC,OAAW,IAAA,MAAA,CAAO,MAAU,IAAA,aAAA,yBAAwB,GAAA,CAAA,QAAA,EAAA,EAAA,CAAA;AAEzD,EAAA,uBACG,GAAA,CAAA,MAAA,EAAA,EAAO,OAAQ,EAAA,MAAA,EAAO,SACpB,QACH,EAAA,KAAA,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useEffect } from 'react';
|
|
2
3
|
import { createFilterByQueryParamFromConfig } from '../../api/config.esm.js';
|
|
3
4
|
import { VisitedByType } from './VisitedByType.esm.js';
|
|
4
5
|
import '@backstage/core-app-api';
|
|
@@ -58,7 +59,7 @@ const Content = ({
|
|
|
58
59
|
setLoading(reqLoading);
|
|
59
60
|
}
|
|
60
61
|
}, [loading, setLoading, reqLoading]);
|
|
61
|
-
return /* @__PURE__ */
|
|
62
|
+
return /* @__PURE__ */ jsx(VisitedByType, {});
|
|
62
63
|
};
|
|
63
64
|
|
|
64
65
|
export { Content };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Content.esm.js","sources":["../../../src/homePageComponents/VisitedByType/Content.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 */\n\nimport
|
|
1
|
+
{"version":3,"file":"Content.esm.js","sources":["../../../src/homePageComponents/VisitedByType/Content.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 */\n\nimport { useEffect } from 'react';\nimport { createFilterByQueryParamFromConfig } from '../../api/config';\nimport { VisitedByType } from './VisitedByType';\nimport { Visit, visitsApiRef } from '../../api';\nimport { ContextValueOnly, useContext } from './Context';\nimport { configApiRef, useApi } from '@backstage/core-plugin-api';\nimport useAsync from 'react-use/esm/useAsync';\n\n/** @public */\nexport type VisitedByTypeKind = 'recent' | 'top';\n\n/** @public */\nexport type VisitedByTypeProps = {\n visits?: Array<Visit>;\n numVisitsOpen?: number;\n numVisitsTotal?: number;\n loading?: boolean;\n kind: VisitedByTypeKind;\n};\n\n/**\n * Display recently visited pages for the homepage\n * @public\n */\nexport const Content = ({\n visits,\n numVisitsOpen,\n numVisitsTotal,\n loading,\n kind,\n}: VisitedByTypeProps) => {\n const { setContext, setVisits, setLoading } = useContext();\n // Allows behavior override from properties\n useEffect(() => {\n const context: Partial<ContextValueOnly> = {};\n context.kind = kind;\n if (visits) {\n context.visits = visits;\n context.loading = false;\n } else if (loading) {\n context.loading = loading;\n }\n if (numVisitsOpen) context.numVisitsOpen = numVisitsOpen;\n if (numVisitsTotal) context.numVisitsTotal = numVisitsTotal;\n setContext(state => ({ ...state, ...context }));\n }, [setContext, kind, visits, loading, numVisitsOpen, numVisitsTotal]);\n\n const config = useApi(configApiRef);\n // Fetches data from visitsApi in case visits and loading are not provided\n const visitsApi = useApi(visitsApiRef);\n const { loading: reqLoading } = useAsync(async () => {\n if (!visits && !loading && kind === 'recent') {\n const filterBy = createFilterByQueryParamFromConfig(\n config.getOptionalConfigArray('home.recentVisits.filterBy') ?? [],\n );\n return await visitsApi\n .list({\n limit: numVisitsTotal ?? 8,\n orderBy: [{ field: 'timestamp', direction: 'desc' }],\n ...(filterBy && { filterBy }),\n })\n .then(setVisits);\n }\n if (!visits && !loading && kind === 'top') {\n const filterBy = createFilterByQueryParamFromConfig(\n config.getOptionalConfigArray('home.topVisits.filterBy') ?? [],\n );\n return await visitsApi\n .list({\n limit: numVisitsTotal ?? 8,\n orderBy: [{ field: 'hits', direction: 'desc' }],\n ...(filterBy && { filterBy }),\n })\n .then(setVisits);\n }\n return undefined;\n }, [visitsApi, visits, loading, setVisits]);\n useEffect(() => {\n if (!loading) {\n setLoading(reqLoading);\n }\n }, [loading, setLoading, reqLoading]);\n\n return <VisitedByType />;\n};\n"],"names":[],"mappings":";;;;;;;;;;AAwCO,MAAM,UAAU,CAAC;AAAA,EACtB,MAAA;AAAA,EACA,aAAA;AAAA,EACA,cAAA;AAAA,EACA,OAAA;AAAA,EACA;AACF,CAA0B,KAAA;AACxB,EAAA,MAAM,EAAE,UAAA,EAAY,SAAW,EAAA,UAAA,KAAe,UAAW,EAAA;AAEzD,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,MAAM,UAAqC,EAAC;AAC5C,IAAA,OAAA,CAAQ,IAAO,GAAA,IAAA;AACf,IAAA,IAAI,MAAQ,EAAA;AACV,MAAA,OAAA,CAAQ,MAAS,GAAA,MAAA;AACjB,MAAA,OAAA,CAAQ,OAAU,GAAA,KAAA;AAAA,eACT,OAAS,EAAA;AAClB,MAAA,OAAA,CAAQ,OAAU,GAAA,OAAA;AAAA;AAEpB,IAAI,IAAA,aAAA,UAAuB,aAAgB,GAAA,aAAA;AAC3C,IAAI,IAAA,cAAA,UAAwB,cAAiB,GAAA,cAAA;AAC7C,IAAA,UAAA,CAAW,YAAU,EAAE,GAAG,KAAO,EAAA,GAAG,SAAU,CAAA,CAAA;AAAA,GAChD,EAAG,CAAC,UAAY,EAAA,IAAA,EAAM,QAAQ,OAAS,EAAA,aAAA,EAAe,cAAc,CAAC,CAAA;AAErE,EAAM,MAAA,MAAA,GAAS,OAAO,YAAY,CAAA;AAElC,EAAM,MAAA,SAAA,GAAY,OAAO,YAAY,CAAA;AACrC,EAAA,MAAM,EAAE,OAAA,EAAS,UAAW,EAAA,GAAI,SAAS,YAAY;AACnD,IAAA,IAAI,CA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} from 'react/jsx-runtime';
|
|
2
|
+
import { createContext, useState, useMemo, useContext as useContext$1 } from 'react';
|
|
2
3
|
|
|
3
4
|
const defaultContextValueOnly = {
|
|
4
5
|
collapsed: true,
|
|
@@ -31,7 +32,7 @@ const getFilteredSet = (setContext, contextKey) => (e) => setContext((state) =>
|
|
|
31
32
|
[contextKey]: typeof e === "function" ? e(state[contextKey]) : e
|
|
32
33
|
}));
|
|
33
34
|
const ContextProvider = ({ children }) => {
|
|
34
|
-
const [context, setContext] =
|
|
35
|
+
const [context, setContext] = useState(
|
|
35
36
|
defaultContextValueOnly
|
|
36
37
|
);
|
|
37
38
|
const {
|
|
@@ -62,10 +63,10 @@ const ContextProvider = ({ children }) => {
|
|
|
62
63
|
setLoading,
|
|
63
64
|
setKind
|
|
64
65
|
};
|
|
65
|
-
return /* @__PURE__ */
|
|
66
|
+
return /* @__PURE__ */ jsx(Context.Provider, { value, children });
|
|
66
67
|
};
|
|
67
68
|
const useContext = () => {
|
|
68
|
-
const value =
|
|
69
|
+
const value = useContext$1(Context);
|
|
69
70
|
if (value === void 0)
|
|
70
71
|
throw new Error(
|
|
71
72
|
"VisitedByType useContext found undefined ContextValue, <ContextProvider/> could be missing"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Context.esm.js","sources":["../../../src/homePageComponents/VisitedByType/Context.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 */\n\nimport
|
|
1
|
+
{"version":3,"file":"Context.esm.js","sources":["../../../src/homePageComponents/VisitedByType/Context.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 */\n\nimport {\n Dispatch,\n SetStateAction,\n createContext,\n useMemo,\n useState,\n useContext as useReactContext,\n} from 'react';\nimport { Visit } from '../../api/VisitsApi';\nimport { VisitedByTypeKind } from './Content';\n\nexport type ContextValueOnly = {\n collapsed: boolean;\n numVisitsOpen: number;\n numVisitsTotal: number;\n visits: Array<Visit>;\n loading: boolean;\n kind: VisitedByTypeKind;\n};\n\nexport type ContextValue = ContextValueOnly & {\n setCollapsed: Dispatch<SetStateAction<boolean>>;\n setNumVisitsOpen: Dispatch<SetStateAction<number>>;\n setNumVisitsTotal: Dispatch<SetStateAction<number>>;\n setVisits: Dispatch<SetStateAction<Array<Visit>>>;\n setLoading: Dispatch<SetStateAction<boolean>>;\n setKind: Dispatch<SetStateAction<VisitedByTypeKind>>;\n setContext: Dispatch<SetStateAction<ContextValueOnly>>;\n};\n\nconst defaultContextValueOnly: ContextValueOnly = {\n collapsed: true,\n numVisitsOpen: 3,\n numVisitsTotal: 8,\n visits: [],\n loading: true,\n kind: 'recent',\n};\n\nexport const defaultContextValue: ContextValue = {\n ...defaultContextValueOnly,\n setCollapsed: () => {},\n setNumVisitsOpen: () => {},\n setNumVisitsTotal: () => {},\n setVisits: () => {},\n setLoading: () => {},\n setKind: () => {},\n setContext: () => {},\n};\n\nexport const Context = createContext<ContextValue>(defaultContextValue);\n\nconst getFilteredSet =\n <T,>(\n setContext: Dispatch<SetStateAction<ContextValueOnly>>,\n contextKey: keyof ContextValueOnly,\n ) =>\n (e: SetStateAction<T>) =>\n setContext(state => ({\n ...state,\n [contextKey]:\n typeof e === 'function' ? (e as Function)(state[contextKey]) : e,\n }));\n\nexport const ContextProvider = ({ children }: { children: JSX.Element }) => {\n const [context, setContext] = useState<ContextValueOnly>(\n defaultContextValueOnly,\n );\n const {\n setCollapsed,\n setNumVisitsOpen,\n setNumVisitsTotal,\n setVisits,\n setLoading,\n setKind,\n } = useMemo(\n () => ({\n setCollapsed: getFilteredSet(setContext, 'collapsed'),\n setNumVisitsOpen: getFilteredSet(setContext, 'numVisitsOpen'),\n setNumVisitsTotal: getFilteredSet(setContext, 'numVisitsTotal'),\n setVisits: getFilteredSet(setContext, 'visits'),\n setLoading: getFilteredSet(setContext, 'loading'),\n setKind: getFilteredSet(setContext, 'kind'),\n }),\n [setContext],\n );\n\n const value: ContextValue = {\n ...context,\n setContext,\n setCollapsed,\n setNumVisitsOpen,\n setNumVisitsTotal,\n setVisits,\n setLoading,\n setKind,\n };\n\n return <Context.Provider value={value}>{children}</Context.Provider>;\n};\n\nexport const useContext = () => {\n const value = useReactContext(Context);\n\n if (value === undefined)\n throw new Error(\n 'VisitedByType useContext found undefined ContextValue, <ContextProvider/> could be missing',\n );\n\n return value;\n};\n\nexport default Context;\n"],"names":["useReactContext"],"mappings":";;;AA8CA,MAAM,uBAA4C,GAAA;AAAA,EAChD,SAAW,EAAA,IAAA;AAAA,EACX,aAAe,EAAA,CAAA;AAAA,EACf,cAAgB,EAAA,CAAA;AAAA,EAChB,QAAQ,EAAC;AAAA,EACT,OAAS,EAAA,IAAA;AAAA,EACT,IAAM,EAAA;AACR,CAAA;AAEO,MAAM,mBAAoC,GAAA;AAAA,EAC/C,GAAG,uBAAA;AAAA,EACH,cAAc,MAAM;AAAA,GAAC;AAAA,EACrB,kBAAkB,MAAM;AAAA,GAAC;AAAA,EACzB,mBAAmB,MAAM;AAAA,GAAC;AAAA,EAC1B,WAAW,MAAM;AAAA,GAAC;AAAA,EAClB,YAAY,MAAM;AAAA,GAAC;AAAA,EACnB,SAAS,MAAM;AAAA,GAAC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CAAA,OAAA,CAAQ,QAAR,EAAA,EAAiB,OAAe,QAAS,EAAA,CAAA;AACnD;AAEO,MAAM,aAAa,MAAM;AAC9B,EAAM,MAAA,KAAA,GAAQA,aAAgB,OAAO,CAAA;AAErC,EAAA,IAAI,KAAU,KAAA,KAAA,CAAA;AACZ,IAAA,MAAM,IAAI,KAAA;AAAA,MACR;AAAA,KACF;AAEF,EAAO,OAAA,KAAA;AACT;;;;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
1
2
|
export { Actions } from './Actions.esm.js';
|
|
2
3
|
export { ContextProvider } from './Context.esm.js';
|
|
3
|
-
import React from 'react';
|
|
4
4
|
import { Content } from './Content.esm.js';
|
|
5
5
|
|
|
6
|
-
const RecentlyVisitedContent = (props) => /* @__PURE__ */
|
|
6
|
+
const RecentlyVisitedContent = (props) => /* @__PURE__ */ jsx(Content, { ...props, kind: "recent" });
|
|
7
7
|
|
|
8
8
|
export { RecentlyVisitedContent as Content };
|
|
9
9
|
//# sourceMappingURL=RecentlyVisited.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RecentlyVisited.esm.js","sources":["../../../src/homePageComponents/VisitedByType/RecentlyVisited.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 */\n\nexport { Actions } from './Actions';\nexport { ContextProvider } from './Context';\nexport type { VisitedByTypeProps, VisitedByTypeKind } from './Content';\nimport
|
|
1
|
+
{"version":3,"file":"RecentlyVisited.esm.js","sources":["../../../src/homePageComponents/VisitedByType/RecentlyVisited.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 */\n\nexport { Actions } from './Actions';\nexport { ContextProvider } from './Context';\nexport type { VisitedByTypeProps, VisitedByTypeKind } from './Content';\nimport { Content, VisitedByTypeProps } from './Content';\n\nconst RecentlyVisitedContent = (props: Partial<VisitedByTypeProps>) => (\n <Content {...props} kind=\"recent\" />\n);\n\nexport { RecentlyVisitedContent as Content };\n"],"names":[],"mappings":";;;;;AAqBM,MAAA,sBAAA,GAAyB,CAAC,KAC9B,qBAAA,GAAA,CAAC,WAAS,GAAG,KAAA,EAAO,MAAK,QAAS,EAAA;;;;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
1
2
|
export { Actions } from './Actions.esm.js';
|
|
2
3
|
export { ContextProvider } from './Context.esm.js';
|
|
3
|
-
import React from 'react';
|
|
4
4
|
import { Content } from './Content.esm.js';
|
|
5
5
|
|
|
6
|
-
const TopVisitedContent = (props) => /* @__PURE__ */
|
|
6
|
+
const TopVisitedContent = (props) => /* @__PURE__ */ jsx(Content, { ...props, kind: "top" });
|
|
7
7
|
|
|
8
8
|
export { TopVisitedContent as Content };
|
|
9
9
|
//# sourceMappingURL=TopVisited.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TopVisited.esm.js","sources":["../../../src/homePageComponents/VisitedByType/TopVisited.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 */\n\nexport { Actions } from './Actions';\nexport { ContextProvider } from './Context';\nexport type { VisitedByTypeProps, VisitedByTypeKind } from './Content';\nimport
|
|
1
|
+
{"version":3,"file":"TopVisited.esm.js","sources":["../../../src/homePageComponents/VisitedByType/TopVisited.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 */\n\nexport { Actions } from './Actions';\nexport { ContextProvider } from './Context';\nexport type { VisitedByTypeProps, VisitedByTypeKind } from './Content';\nimport { Content, VisitedByTypeProps } from './Content';\n\nconst TopVisitedContent = (props: Partial<VisitedByTypeProps>) => (\n <Content {...props} kind=\"top\" />\n);\n\nexport { TopVisitedContent as Content };\n"],"names":[],"mappings":";;;;;AAqBM,MAAA,iBAAA,GAAoB,CAAC,KACzB,qBAAA,GAAA,CAAC,WAAS,GAAG,KAAA,EAAO,MAAK,KAAM,EAAA;;;;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { VisitList } from '../../components/VisitList/VisitList.esm.js';
|
|
3
3
|
import { useContext } from './Context.esm.js';
|
|
4
4
|
|
|
5
5
|
const VisitedByType = () => {
|
|
6
6
|
const { collapsed, numVisitsOpen, numVisitsTotal, visits, loading, kind } = useContext();
|
|
7
|
-
return /* @__PURE__ */
|
|
7
|
+
return /* @__PURE__ */ jsx(
|
|
8
8
|
VisitList,
|
|
9
9
|
{
|
|
10
10
|
visits,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VisitedByType.esm.js","sources":["../../../src/homePageComponents/VisitedByType/VisitedByType.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 */\n\nimport
|
|
1
|
+
{"version":3,"file":"VisitedByType.esm.js","sources":["../../../src/homePageComponents/VisitedByType/VisitedByType.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 */\n\nimport { VisitList } from '../../components/VisitList';\nimport { useContext } from './Context';\n\nexport const VisitedByType = () => {\n const { collapsed, numVisitsOpen, numVisitsTotal, visits, loading, kind } =\n useContext();\n\n return (\n <VisitList\n visits={visits}\n detailType={kind === 'top' ? 'hits' : 'time-ago'}\n collapsed={collapsed}\n numVisitsOpen={numVisitsOpen}\n numVisitsTotal={numVisitsTotal}\n loading={loading}\n />\n );\n};\n"],"names":[],"mappings":";;;;AAmBO,MAAM,gBAAgB,MAAM;AACjC,EAAM,MAAA,EAAE,WAAW,aAAe,EAAA,cAAA,EAAgB,QAAQ,OAAS,EAAA,IAAA,KACjE,UAAW,EAAA;AAEb,EACE,uBAAA,GAAA;AAAA,IAAC,SAAA;AAAA,IAAA;AAAA,MACC,MAAA;AAAA,MACA,UAAA,EAAY,IAAS,KAAA,KAAA,GAAQ,MAAS,GAAA,UAAA;AAAA,MACtC,SAAA;AAAA,MACA,aAAA;AAAA,MACA,cAAA;AAAA,MACA;AAAA;AAAA,GACF;AAEJ;;;;"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
1
2
|
import { useApi, identityApiRef, alertApiRef } from '@backstage/core-plugin-api';
|
|
2
3
|
import Tooltip from '@material-ui/core/Tooltip';
|
|
3
4
|
import Typography from '@material-ui/core/Typography';
|
|
4
|
-
import
|
|
5
|
+
import { useMemo, useEffect } from 'react';
|
|
5
6
|
import useAsync from 'react-use/esm/useAsync';
|
|
6
7
|
import { getTimeBasedGreeting } from './timeUtil.esm.js';
|
|
7
8
|
|
|
@@ -20,7 +21,7 @@ const WelcomeTitle = ({ language }) => {
|
|
|
20
21
|
});
|
|
21
22
|
}
|
|
22
23
|
}, [error, alertApi]);
|
|
23
|
-
return /* @__PURE__ */
|
|
24
|
+
return /* @__PURE__ */ jsx(Tooltip, { title: greeting.language, children: /* @__PURE__ */ jsx(Typography, { component: "span", variant: "inherit", children: `${greeting.greeting}${profile?.displayName ? `, ${profile?.displayName}` : ""}!` }) });
|
|
24
25
|
};
|
|
25
26
|
|
|
26
27
|
export { WelcomeTitle };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WelcomeTitle.esm.js","sources":["../../../src/homePageComponents/WelcomeTitle/WelcomeTitle.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n alertApiRef,\n identityApiRef,\n useApi,\n} from '@backstage/core-plugin-api';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport Typography from '@material-ui/core/Typography';\nimport
|
|
1
|
+
{"version":3,"file":"WelcomeTitle.esm.js","sources":["../../../src/homePageComponents/WelcomeTitle/WelcomeTitle.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n alertApiRef,\n identityApiRef,\n useApi,\n} from '@backstage/core-plugin-api';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport Typography from '@material-ui/core/Typography';\nimport { useEffect, useMemo } from 'react';\nimport useAsync from 'react-use/esm/useAsync';\nimport { getTimeBasedGreeting } from './timeUtil';\n\n/** @public */\nexport type WelcomeTitleLanguageProps = {\n language?: string[];\n};\n\nexport const WelcomeTitle = ({ language }: WelcomeTitleLanguageProps) => {\n const identityApi = useApi(identityApiRef);\n const alertApi = useApi(alertApiRef);\n const greeting = useMemo(() => getTimeBasedGreeting(language), [language]);\n\n const { value: profile, error } = useAsync(() =>\n identityApi.getProfileInfo(),\n );\n\n useEffect(() => {\n if (error) {\n alertApi.post({\n message: `Failed to load user identity: ${error}`,\n severity: 'error',\n });\n }\n }, [error, alertApi]);\n\n return (\n <Tooltip title={greeting.language}>\n <Typography component=\"span\" variant=\"inherit\">{`${greeting.greeting}${\n profile?.displayName ? `, ${profile?.displayName}` : ''\n }!`}</Typography>\n </Tooltip>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AA+BO,MAAM,YAAe,GAAA,CAAC,EAAE,QAAA,EAA0C,KAAA;AACvE,EAAM,MAAA,WAAA,GAAc,OAAO,cAAc,CAAA;AACzC,EAAM,MAAA,QAAA,GAAW,OAAO,WAAW,CAAA;AACnC,EAAM,MAAA,QAAA,GAAW,QAAQ,MAAM,oBAAA,CAAqB,QAAQ,CAAG,EAAA,CAAC,QAAQ,CAAC,CAAA;AAEzE,EAAA,MAAM,EAAE,KAAA,EAAO,OAAS,EAAA,KAAA,EAAU,GAAA,QAAA;AAAA,IAAS,MACzC,YAAY,cAAe;AAAA,GAC7B;AAEA,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,KAAO,EAAA;AACT,MAAA,QAAA,CAAS,IAAK,CAAA;AAAA,QACZ,OAAA,EAAS,iCAAiC,KAAK,CAAA,CAAA;AAAA,QAC/C,QAAU,EAAA;AAAA,OACX,CAAA;AAAA;AACH,GACC,EAAA,CAAC,KAAO,EAAA,QAAQ,CAAC,CAAA;AAEpB,EACE,uBAAA,GAAA,CAAC,WAAQ,KAAO,EAAA,QAAA,CAAS,UACvB,QAAC,kBAAA,GAAA,CAAA,UAAA,EAAA,EAAW,SAAU,EAAA,MAAA,EAAO,OAAQ,EAAA,SAAA,EAAW,aAAG,QAAS,CAAA,QAAQ,CAClE,EAAA,OAAA,EAAS,WAAc,GAAA,CAAA,EAAA,EAAK,SAAS,WAAW,CAAA,CAAA,GAAK,EACvD,CAAA,CAAA,CAAA,EAAI,CACN,EAAA,CAAA;AAEJ;;;;"}
|