@backstage/plugin-org-react 0.1.41-next.0 → 0.1.41
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
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @backstage/plugin-org-react
|
|
2
2
|
|
|
3
|
+
## 0.1.41
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
- @backstage/core-components@0.17.5
|
|
9
|
+
- @backstage/plugin-catalog-react@1.20.0
|
|
10
|
+
- @backstage/catalog-client@1.11.0
|
|
11
|
+
|
|
12
|
+
## 0.1.41-next.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
- @backstage/plugin-catalog-react@1.20.0-next.1
|
|
18
|
+
- @backstage/catalog-client@1.11.0-next.0
|
|
19
|
+
- @backstage/core-components@0.17.5-next.0
|
|
20
|
+
- @backstage/catalog-model@1.7.5
|
|
21
|
+
- @backstage/core-plugin-api@1.10.9
|
|
22
|
+
|
|
3
23
|
## 0.1.41-next.0
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupListPicker.esm.js","sources":["../../../src/components/GroupListPicker/GroupListPicker.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 { MouseEvent, useState, useCallback } from 'react';\nimport {\n catalogApiRef,\n humanizeEntityRef,\n} from '@backstage/plugin-catalog-react';\nimport TextField from '@material-ui/core/TextField';\nimport Autocomplete from '@material-ui/lab/Autocomplete';\nimport useAsync from 'react-use/esm/useAsync';\nimport Popover from '@material-ui/core/Popover';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { ResponseErrorPanel } from '@backstage/core-components';\nimport { Entity, GroupEntity } from '@backstage/catalog-model';\nimport { GroupListPickerButton } from './GroupListPickerButton';\n\n/**\n * Props for {@link GroupListPicker}.\n *\n * @public\n */\nexport type GroupListPickerProps = {\n defaultValue?: string;\n placeholder?: string;\n groupTypes?: Array<string>;\n onChange: (value: GroupEntity | undefined) => void;\n};\n\n/** @public */\nexport const GroupListPicker = (props: GroupListPickerProps) => {\n const catalogApi = useApi(catalogApiRef);\n\n const { onChange, groupTypes, placeholder = '', defaultValue = '' } = props;\n const [anchorEl, setAnchorEl] = useState<HTMLElement | null>(null);\n const [inputValue, setInputValue] = useState(defaultValue);\n\n const handleClick = (event: MouseEvent<HTMLElement>) => {\n setAnchorEl(event.currentTarget);\n };\n\n const handleClose = () => {\n setAnchorEl(null);\n };\n\n const open = Boolean(anchorEl);\n\n const {\n loading,\n error,\n value: groups,\n } = useAsync(async () => {\n const groupsList = await catalogApi.getEntities({\n filter: {\n kind: 'Group',\n 'spec.type': groupTypes || [],\n },\n });\n\n return groupsList.items as GroupEntity[];\n }, [catalogApi, groupTypes]);\n\n const handleChange = useCallback(\n (_: unknown, v: GroupEntity | null) => {\n onChange(v ?? undefined);\n setAnchorEl(null);\n },\n [onChange],\n );\n\n if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n\n const getHumanEntityRef = (entity: Entity) => humanizeEntityRef(entity);\n\n return (\n <>\n <Popover\n anchorEl={anchorEl}\n open={open}\n onClose={handleClose}\n anchorOrigin={{ horizontal: 'left', vertical: 'bottom' }}\n >\n <Autocomplete\n data-testid=\"group-list-picker-input\"\n loading={loading}\n options={groups ?? []}\n groupBy={option => option.spec.type}\n getOptionLabel={option =>\n option.spec.profile?.displayName ?? getHumanEntityRef(option)\n }\n inputValue={inputValue}\n onInputChange={(_, value) => setInputValue(value)}\n onChange={handleChange}\n style={{ width: '300px' }}\n renderInput={params => (\n <TextField\n {...params}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus\n placeholder={placeholder}\n variant=\"outlined\"\n />\n )}\n />\n </Popover>\n <GroupListPickerButton handleClick={handleClick} group={inputValue} />\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"GroupListPicker.esm.js","sources":["../../../src/components/GroupListPicker/GroupListPicker.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 { MouseEvent, useState, useCallback } from 'react';\nimport {\n catalogApiRef,\n humanizeEntityRef,\n} from '@backstage/plugin-catalog-react';\nimport TextField from '@material-ui/core/TextField';\nimport Autocomplete from '@material-ui/lab/Autocomplete';\nimport useAsync from 'react-use/esm/useAsync';\nimport Popover from '@material-ui/core/Popover';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { ResponseErrorPanel } from '@backstage/core-components';\nimport { Entity, GroupEntity } from '@backstage/catalog-model';\nimport { GroupListPickerButton } from './GroupListPickerButton';\n\n/**\n * Props for {@link GroupListPicker}.\n *\n * @public\n */\nexport type GroupListPickerProps = {\n defaultValue?: string;\n placeholder?: string;\n groupTypes?: Array<string>;\n onChange: (value: GroupEntity | undefined) => void;\n};\n\n/** @public */\nexport const GroupListPicker = (props: GroupListPickerProps) => {\n const catalogApi = useApi(catalogApiRef);\n\n const { onChange, groupTypes, placeholder = '', defaultValue = '' } = props;\n const [anchorEl, setAnchorEl] = useState<HTMLElement | null>(null);\n const [inputValue, setInputValue] = useState(defaultValue);\n\n const handleClick = (event: MouseEvent<HTMLElement>) => {\n setAnchorEl(event.currentTarget);\n };\n\n const handleClose = () => {\n setAnchorEl(null);\n };\n\n const open = Boolean(anchorEl);\n\n const {\n loading,\n error,\n value: groups,\n } = useAsync(async () => {\n const groupsList = await catalogApi.getEntities({\n filter: {\n kind: 'Group',\n 'spec.type': groupTypes || [],\n },\n });\n\n return groupsList.items as GroupEntity[];\n }, [catalogApi, groupTypes]);\n\n const handleChange = useCallback(\n (_: unknown, v: GroupEntity | null) => {\n onChange(v ?? undefined);\n setAnchorEl(null);\n },\n [onChange],\n );\n\n if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n\n const getHumanEntityRef = (entity: Entity) => humanizeEntityRef(entity);\n\n return (\n <>\n <Popover\n anchorEl={anchorEl}\n open={open}\n onClose={handleClose}\n anchorOrigin={{ horizontal: 'left', vertical: 'bottom' }}\n >\n <Autocomplete\n data-testid=\"group-list-picker-input\"\n loading={loading}\n options={groups ?? []}\n groupBy={option => option.spec.type}\n getOptionLabel={option =>\n option.spec.profile?.displayName ?? getHumanEntityRef(option)\n }\n inputValue={inputValue}\n onInputChange={(_, value) => setInputValue(value)}\n onChange={handleChange}\n style={{ width: '300px' }}\n renderInput={params => (\n <TextField\n {...params}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus\n placeholder={placeholder}\n variant=\"outlined\"\n />\n )}\n />\n </Popover>\n <GroupListPickerButton handleClick={handleClick} group={inputValue} />\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;AA2CO,MAAM,eAAA,GAAkB,CAAC,KAAA,KAAgC;AAC9D,EAAA,MAAM,UAAA,GAAa,OAAO,aAAa,CAAA;AAEvC,EAAA,MAAM,EAAE,QAAA,EAAU,UAAA,EAAY,cAAc,EAAA,EAAI,YAAA,GAAe,IAAG,GAAI,KAAA;AACtE,EA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;AAAA,MAAA;AAAA,QACC,QAAA;AAAA,QACA,IAAA;AAAA,QACA,OAAA,EAAS,WAAA;AAAA,QACT,YAAA,EAAc,EAAE,UAAA,EAAY,MAAA,EAAQ,UAAU,QAAA,EAAS;AAAA,QAEvD,QAAA,kBAAA,GAAA;AAAA,UAAC,YAAA;AAAA,UAAA;AAAA,YACC,aAAA,EAAY,yBAAA;AAAA,YACZ,OAAA;AAAA,YACA,OAAA,EAAS,UAAU,EAAC;AAAA,YACpB,OAAA,EAAS,CAAA,MAAA,KAAU,MAAA,CAAO,IAAA,CAAK,IAAA;AAAA,YAC/B,gBAAgB,CAAA,MAAA,KACd,MAAA,CAAO,KAAK,OAAA,EAAS,WAAA,IAAe,kBAAkB,MAAM,CAAA;AAAA,YAE9D,UAAA;AAAA,YACA,aAAA,EAAe,CAAC,CAAA,EAAG,KAAA,KAAU,cAAc,KAAK,CAAA;AAAA,YAChD,QAAA,EAAU,YAAA;AAAA,YACV,KAAA,EAAO,EAAE,KAAA,EAAO,OAAA,EAAQ;AAAA,YACxB,aAAa,CAAA,MAAA,qBACX,GAAA;AAAA,cAAC,SAAA;AAAA,cAAA;AAAA,gBACE,GAAG,MAAA;AAAA,gBAEJ,SAAA,EAAS,IAAA;AAAA,gBACT,WAAA;AAAA,gBACA,OAAA,EAAQ;AAAA;AAAA;AACV;AAAA;AAEJ;AAAA,KACF;AAAA,oBACA,GAAA,CAAC,qBAAA,EAAA,EAAsB,WAAA,EAA0B,KAAA,EAAO,UAAA,EAAY;AAAA,GAAA,EACtE,CAAA;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupListPickerButton.esm.js","sources":["../../../src/components/GroupListPicker/GroupListPickerButton.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 { MouseEvent } from 'react';\nimport Typography from '@material-ui/core/Typography';\nimport Button from '@material-ui/core/Button';\nimport { makeStyles } from '@material-ui/core/styles';\nimport KeyboardArrowDownIcon from '@material-ui/icons/KeyboardArrowDown';\nimport PeopleIcon from '@material-ui/icons/People';\n\nconst useStyles = makeStyles(theme => ({\n btn: {\n padding: '10px',\n width: '100%',\n cursor: 'pointer',\n justifyContent: 'space-between',\n },\n title: {\n fontSize: '1.5rem',\n fontStyle: 'normal',\n fontWeight: theme.typography.fontWeightBold,\n height: '32px',\n letterSpacing: '-0.25px',\n marginBottom: 0,\n marginLeft: '4px',\n textAlign: 'left',\n textTransform: 'none',\n width: '100%',\n },\n icon: {\n transform: 'scale(1.5)',\n },\n}));\n\ntype GroupListPickerButtonProps = {\n handleClick: (event: MouseEvent<HTMLElement>) => void;\n group: string | undefined;\n};\n\n/** @public */\nexport const GroupListPickerButton = (props: GroupListPickerButtonProps) => {\n const { handleClick, group } = props;\n const classes = useStyles();\n\n return (\n <Button\n onClick={handleClick}\n data-testid=\"group-list-picker-button\"\n aria-describedby=\"group-list-popover\"\n startIcon={<PeopleIcon className={classes.icon} />}\n className={classes.btn}\n size=\"large\"\n endIcon={<KeyboardArrowDownIcon className={classes.icon} />}\n >\n <Typography className={classes.title}>{group}</Typography>\n </Button>\n );\n};\n"],"names":[],"mappings":";;;;;;;AAuBA,MAAM,SAAA,GAAY,WAAW,
|
|
1
|
+
{"version":3,"file":"GroupListPickerButton.esm.js","sources":["../../../src/components/GroupListPicker/GroupListPickerButton.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 { MouseEvent } from 'react';\nimport Typography from '@material-ui/core/Typography';\nimport Button from '@material-ui/core/Button';\nimport { makeStyles } from '@material-ui/core/styles';\nimport KeyboardArrowDownIcon from '@material-ui/icons/KeyboardArrowDown';\nimport PeopleIcon from '@material-ui/icons/People';\n\nconst useStyles = makeStyles(theme => ({\n btn: {\n padding: '10px',\n width: '100%',\n cursor: 'pointer',\n justifyContent: 'space-between',\n },\n title: {\n fontSize: '1.5rem',\n fontStyle: 'normal',\n fontWeight: theme.typography.fontWeightBold,\n height: '32px',\n letterSpacing: '-0.25px',\n marginBottom: 0,\n marginLeft: '4px',\n textAlign: 'left',\n textTransform: 'none',\n width: '100%',\n },\n icon: {\n transform: 'scale(1.5)',\n },\n}));\n\ntype GroupListPickerButtonProps = {\n handleClick: (event: MouseEvent<HTMLElement>) => void;\n group: string | undefined;\n};\n\n/** @public */\nexport const GroupListPickerButton = (props: GroupListPickerButtonProps) => {\n const { handleClick, group } = props;\n const classes = useStyles();\n\n return (\n <Button\n onClick={handleClick}\n data-testid=\"group-list-picker-button\"\n aria-describedby=\"group-list-popover\"\n startIcon={<PeopleIcon className={classes.icon} />}\n className={classes.btn}\n size=\"large\"\n endIcon={<KeyboardArrowDownIcon className={classes.icon} />}\n >\n <Typography className={classes.title}>{group}</Typography>\n </Button>\n );\n};\n"],"names":[],"mappings":";;;;;;;AAuBA,MAAM,SAAA,GAAY,WAAW,CAAA,KAAA,MAAU;AAAA,EACrC,GAAA,EAAK;AAAA,IACH,OAAA,EAAS,MAAA;AAAA,IACT,KAAA,EAAO,MAAA;AAAA,IACP,MAAA,EAAQ,SAAA;AAAA,IACR,cAAA,EAAgB;AAAA,GAClB;AAAA,EACA,KAAA,EAAO;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4
|
"backstage": {
|
|
5
5
|
"role": "web-library",
|
|
6
6
|
"pluginId": "org",
|
|
@@ -40,20 +40,20 @@
|
|
|
40
40
|
"test": "backstage-cli package test"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@backstage/catalog-client": "1.
|
|
44
|
-
"@backstage/catalog-model": "1.7.5",
|
|
45
|
-
"@backstage/core-components": "0.17.
|
|
46
|
-
"@backstage/core-plugin-api": "1.10.9",
|
|
47
|
-
"@backstage/plugin-catalog-react": "1.
|
|
43
|
+
"@backstage/catalog-client": "^1.11.0",
|
|
44
|
+
"@backstage/catalog-model": "^1.7.5",
|
|
45
|
+
"@backstage/core-components": "^0.17.5",
|
|
46
|
+
"@backstage/core-plugin-api": "^1.10.9",
|
|
47
|
+
"@backstage/plugin-catalog-react": "^1.20.0",
|
|
48
48
|
"@material-ui/core": "^4.12.2",
|
|
49
49
|
"@material-ui/icons": "^4.9.1",
|
|
50
50
|
"@material-ui/lab": "4.0.0-alpha.61",
|
|
51
51
|
"react-use": "^17.2.4"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@backstage/cli": "0.
|
|
55
|
-
"@backstage/core-app-api": "1.18.0",
|
|
56
|
-
"@backstage/test-utils": "1.7.
|
|
54
|
+
"@backstage/cli": "^0.34.0",
|
|
55
|
+
"@backstage/core-app-api": "^1.18.0",
|
|
56
|
+
"@backstage/test-utils": "^1.7.11",
|
|
57
57
|
"@testing-library/dom": "^10.0.0",
|
|
58
58
|
"@testing-library/jest-dom": "^6.0.0",
|
|
59
59
|
"@testing-library/react": "^16.0.0",
|