@backstage/plugin-scaffolder 1.35.1-next.1 → 1.35.1-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
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RepoUrlPickerRepoName.esm.js","sources":["../../../../src/components/fields/RepoUrlPicker/RepoUrlPickerRepoName.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 { Select, SelectItem } from '@backstage/core-components';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport FormControl from '@material-ui/core/FormControl';\nimport FormHelperText from '@material-ui/core/FormHelperText';\nimport TextField from '@material-ui/core/TextField';\nimport Autocomplete from '@material-ui/lab/Autocomplete';\nimport { useEffect } from 'react';\nimport { scaffolderTranslationRef } from '../../../translation';\nimport { AvailableRepositories } from './types';\n\nexport const RepoUrlPickerRepoName = (props: {\n repoName?: string;\n allowedRepos?: string[];\n onChange: (chosenRepo: AvailableRepositories) => void;\n rawErrors: string[];\n availableRepos?: AvailableRepositories[];\n isDisabled?: boolean;\n}) => {\n const {\n repoName,\n allowedRepos,\n onChange,\n rawErrors,\n availableRepos,\n isDisabled,\n } = props;\n const { t } = useTranslationRef(scaffolderTranslationRef);\n\n useEffect(() => {\n // If there is no repoName chosen currently\n if (!repoName) {\n // Set the first of the allowedRepos option if that available\n if (allowedRepos?.length) {\n onChange({ name: allowedRepos[0] });\n }\n }\n }, [allowedRepos, repoName, onChange]);\n\n const repoItems: SelectItem[] = allowedRepos\n ? allowedRepos.map(i => ({ label: i, value: i }))\n : [{ label: 'Loading...', value: 'loading' }];\n\n return (\n <>\n <FormControl\n margin=\"normal\"\n required\n error={rawErrors?.length > 0 && !repoName}\n >\n {allowedRepos?.length ? (\n <Select\n native\n label={t('fields.repoUrlPicker.repository.title')}\n onChange={selected =>\n onChange({\n name: String(Array.isArray(selected) ? selected[0] : selected),\n })\n }\n disabled={isDisabled || allowedRepos.length === 1}\n selected={repoName}\n items={repoItems}\n />\n ) : (\n <Autocomplete\n value={repoName}\n
|
|
1
|
+
{"version":3,"file":"RepoUrlPickerRepoName.esm.js","sources":["../../../../src/components/fields/RepoUrlPicker/RepoUrlPickerRepoName.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 { Select, SelectItem } from '@backstage/core-components';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport FormControl from '@material-ui/core/FormControl';\nimport FormHelperText from '@material-ui/core/FormHelperText';\nimport TextField from '@material-ui/core/TextField';\nimport Autocomplete from '@material-ui/lab/Autocomplete';\nimport { useEffect } from 'react';\nimport { scaffolderTranslationRef } from '../../../translation';\nimport { AvailableRepositories } from './types';\n\nexport const RepoUrlPickerRepoName = (props: {\n repoName?: string;\n allowedRepos?: string[];\n onChange: (chosenRepo: AvailableRepositories) => void;\n rawErrors: string[];\n availableRepos?: AvailableRepositories[];\n isDisabled?: boolean;\n}) => {\n const {\n repoName,\n allowedRepos,\n onChange,\n rawErrors,\n availableRepos,\n isDisabled,\n } = props;\n const { t } = useTranslationRef(scaffolderTranslationRef);\n\n useEffect(() => {\n // If there is no repoName chosen currently\n if (!repoName) {\n // Set the first of the allowedRepos option if that available\n if (allowedRepos?.length) {\n onChange({ name: allowedRepos[0] });\n }\n }\n }, [allowedRepos, repoName, onChange]);\n\n const repoItems: SelectItem[] = allowedRepos\n ? allowedRepos.map(i => ({ label: i, value: i }))\n : [{ label: 'Loading...', value: 'loading' }];\n\n return (\n <>\n <FormControl\n margin=\"normal\"\n required\n error={rawErrors?.length > 0 && !repoName}\n >\n {allowedRepos?.length ? (\n <Select\n native\n label={t('fields.repoUrlPicker.repository.title')}\n onChange={selected =>\n onChange({\n name: String(Array.isArray(selected) ? selected[0] : selected),\n })\n }\n disabled={isDisabled || allowedRepos.length === 1}\n selected={repoName}\n items={repoItems}\n />\n ) : (\n <Autocomplete\n value={repoName}\n onChange={(_, newValue) => {\n const selectedRepo = availableRepos?.find(\n r => r.name === newValue,\n );\n onChange(selectedRepo || { name: newValue || '' });\n }}\n options={(availableRepos || []).map(r => r.name)}\n renderInput={params => (\n <TextField\n {...params}\n label={t('fields.repoUrlPicker.repository.inputTitle')}\n required\n />\n )}\n freeSolo\n autoSelect\n disabled={isDisabled}\n />\n )}\n <FormHelperText>\n {t('fields.repoUrlPicker.repository.description')}\n </FormHelperText>\n </FormControl>\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;AAyBO,MAAM,qBAAA,GAAwB,CAAC,KAAA,KAOhC;AACJ,EAAA,MAAM;AAAA,IACJ,QAAA;AAAA,IACA,YAAA;AAAA,IACA,QAAA;AAAA,IACA,SAAA;AAAA,IACA,cAAA;AAAA,IACA;AAAA,GACF,GAAI,KAAA;AACJ,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,wBAAwB,CAAA;AAExD,EAAA,SAAA,CAAU,MAAM;AAEd,IAAA,IAAI,CAAC,QAAA,EAAU;AAEb,MAAA,IAAI,cAAc,MAAA,EAAQ;AACxB,QAAA,QAAA,CAAS,EAAE,IAAA,EAAM,YAAA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AAAA,eAClB;AACA,cAAA,QAAA,CAAS,YAAA,IAAgB,EAAE,IAAA,EAAM,QAAA,IAAY,IAAI,CAAA;AAAA,YACnD,CAAA;AAAA,YACA,UAAU,cAAA,IAAkB,IAAI,GAAA,CAAI,CAAA,CAAA,KAAK,EAAE,IAAI,CAAA;AAAA,YAC/C,aAAa,CAAA,MAAA,qBACX,GAAA;AAAA,cAAC,SAAA;AAAA,cAAA;AAAA,gBACE,GAAG,MAAA;AAAA,gBACJ,KAAA,EAAO,EAAE,4CAA4C,CAAA;AAAA,gBACrD,QAAA,EAAQ;AAAA;AAAA,aACV;AAAA,YAEF,QAAA,EAAQ,IAAA;AAAA,YACR,UAAA,EAAU,IAAA;AAAA,YACV,QAAA,EAAU;AAAA;AAAA,SACZ;AAAA,wBAEF,GAAA,CAAC,cAAA,EAAA,EACE,QAAA,EAAA,CAAA,CAAE,6CAA6C,CAAA,EAClD;AAAA;AAAA;AAAA,GACF,EACF,CAAA;AAEJ;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-scaffolder",
|
|
3
|
-
"version": "1.35.1-next.
|
|
3
|
+
"version": "1.35.1-next.2",
|
|
4
4
|
"description": "The Backstage plugin that helps you create new things",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "frontend-plugin",
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
"@backstage/cli": "0.35.2-next.1",
|
|
121
121
|
"@backstage/core-app-api": "1.19.3",
|
|
122
122
|
"@backstage/dev-utils": "1.1.19-next.2",
|
|
123
|
-
"@backstage/plugin-catalog": "1.32.2-next.
|
|
123
|
+
"@backstage/plugin-catalog": "1.32.2-next.2",
|
|
124
124
|
"@backstage/plugin-permission-common": "0.9.3",
|
|
125
125
|
"@backstage/plugin-techdocs": "1.16.2-next.1",
|
|
126
126
|
"@backstage/test-utils": "1.7.14",
|