@backstage/plugin-scaffolder 1.19.3 → 1.19.4-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/alpha/package.json +1 -1
  3. package/dist/alpha.esm.js +3 -8
  4. package/dist/alpha.esm.js.map +1 -1
  5. package/dist/{esm/routes-BvToNy4N.esm.js → api.esm.js} +2 -46
  6. package/dist/api.esm.js.map +1 -0
  7. package/dist/components/ActionsPage/ActionsPage.esm.js +186 -0
  8. package/dist/components/ActionsPage/ActionsPage.esm.js.map +1 -0
  9. package/dist/components/FileBrowser/FileBrowser.esm.js +90 -0
  10. package/dist/components/FileBrowser/FileBrowser.esm.js.map +1 -0
  11. package/dist/components/ListTasksPage/ListTasksPage.esm.js +120 -0
  12. package/dist/components/ListTasksPage/ListTasksPage.esm.js.map +1 -0
  13. package/dist/components/ListTasksPage/OwnerListPicker.esm.js +88 -0
  14. package/dist/components/ListTasksPage/OwnerListPicker.esm.js.map +1 -0
  15. package/dist/components/ListTasksPage/columns/CreatedAtColumn.esm.js +13 -0
  16. package/dist/components/ListTasksPage/columns/CreatedAtColumn.esm.js.map +1 -0
  17. package/dist/components/ListTasksPage/columns/OwnerEntityColumn.esm.js +31 -0
  18. package/dist/components/ListTasksPage/columns/OwnerEntityColumn.esm.js.map +1 -0
  19. package/dist/components/ListTasksPage/columns/TaskStatusColumn.esm.js +17 -0
  20. package/dist/components/ListTasksPage/columns/TaskStatusColumn.esm.js.map +1 -0
  21. package/dist/components/ListTasksPage/columns/TemplateTitleColumn.esm.js +21 -0
  22. package/dist/components/ListTasksPage/columns/TemplateTitleColumn.esm.js.map +1 -0
  23. package/dist/components/OngoingTask/ContextMenu.esm.js +86 -0
  24. package/dist/components/OngoingTask/ContextMenu.esm.js.map +1 -0
  25. package/dist/components/OngoingTask/OngoingTask.esm.js +173 -0
  26. package/dist/components/OngoingTask/OngoingTask.esm.js.map +1 -0
  27. package/dist/components/Router/Router.esm.js +105 -0
  28. package/dist/components/Router/Router.esm.js.map +1 -0
  29. package/dist/components/Router/index.esm.js +2 -0
  30. package/dist/components/Router/index.esm.js.map +1 -0
  31. package/dist/components/TemplateTypePicker/TemplateTypePicker.esm.js +70 -0
  32. package/dist/components/TemplateTypePicker/TemplateTypePicker.esm.js.map +1 -0
  33. package/dist/components/fields/EntityNamePicker/EntityNamePicker.esm.js +34 -0
  34. package/dist/components/fields/EntityNamePicker/EntityNamePicker.esm.js.map +1 -0
  35. package/dist/components/fields/EntityNamePicker/schema.esm.js +8 -0
  36. package/dist/components/fields/EntityNamePicker/schema.esm.js.map +1 -0
  37. package/dist/components/fields/EntityNamePicker/validation.esm.js +12 -0
  38. package/dist/components/fields/EntityNamePicker/validation.esm.js.map +1 -0
  39. package/dist/components/fields/EntityPicker/EntityPicker.esm.js +151 -0
  40. package/dist/components/fields/EntityPicker/EntityPicker.esm.js.map +1 -0
  41. package/dist/components/fields/EntityPicker/schema.esm.js +29 -0
  42. package/dist/components/fields/EntityPicker/schema.esm.js.map +1 -0
  43. package/dist/components/fields/EntityTagsPicker/EntityTagsPicker.esm.js +84 -0
  44. package/dist/components/fields/EntityTagsPicker/EntityTagsPicker.esm.js.map +1 -0
  45. package/dist/components/fields/EntityTagsPicker/schema.esm.js +15 -0
  46. package/dist/components/fields/EntityTagsPicker/schema.esm.js.map +1 -0
  47. package/dist/components/fields/MultiEntityPicker/MultiEntityPicker.esm.js +168 -0
  48. package/dist/components/fields/MultiEntityPicker/MultiEntityPicker.esm.js.map +1 -0
  49. package/dist/components/fields/MultiEntityPicker/schema.esm.js +23 -0
  50. package/dist/components/fields/MultiEntityPicker/schema.esm.js.map +1 -0
  51. package/dist/components/fields/MyGroupsPicker/MyGroupsPicker.esm.js +83 -0
  52. package/dist/components/fields/MyGroupsPicker/MyGroupsPicker.esm.js.map +1 -0
  53. package/dist/components/fields/MyGroupsPicker/schema.esm.js +14 -0
  54. package/dist/components/fields/MyGroupsPicker/schema.esm.js.map +1 -0
  55. package/dist/components/fields/OwnedEntityPicker/OwnedEntityPicker.esm.js +68 -0
  56. package/dist/components/fields/OwnedEntityPicker/OwnedEntityPicker.esm.js.map +1 -0
  57. package/dist/components/fields/OwnedEntityPicker/schema.esm.js +24 -0
  58. package/dist/components/fields/OwnedEntityPicker/schema.esm.js.map +1 -0
  59. package/dist/components/fields/OwnerPicker/OwnerPicker.esm.js +37 -0
  60. package/dist/components/fields/OwnerPicker/OwnerPicker.esm.js.map +1 -0
  61. package/dist/components/fields/OwnerPicker/schema.esm.js +24 -0
  62. package/dist/components/fields/OwnerPicker/schema.esm.js.map +1 -0
  63. package/dist/components/fields/RepoUrlPicker/AzureRepoPicker.esm.js +75 -0
  64. package/dist/components/fields/RepoUrlPicker/AzureRepoPicker.esm.js.map +1 -0
  65. package/dist/components/fields/RepoUrlPicker/BitbucketRepoPicker.esm.js +80 -0
  66. package/dist/components/fields/RepoUrlPicker/BitbucketRepoPicker.esm.js.map +1 -0
  67. package/dist/components/fields/RepoUrlPicker/GerritRepoPicker.esm.js +38 -0
  68. package/dist/components/fields/RepoUrlPicker/GerritRepoPicker.esm.js.map +1 -0
  69. package/dist/components/fields/RepoUrlPicker/GiteaRepoPicker.esm.js +44 -0
  70. package/dist/components/fields/RepoUrlPicker/GiteaRepoPicker.esm.js.map +1 -0
  71. package/dist/components/fields/RepoUrlPicker/GithubRepoPicker.esm.js +42 -0
  72. package/dist/components/fields/RepoUrlPicker/GithubRepoPicker.esm.js.map +1 -0
  73. package/dist/components/fields/RepoUrlPicker/GitlabRepoPicker.esm.js +44 -0
  74. package/dist/components/fields/RepoUrlPicker/GitlabRepoPicker.esm.js.map +1 -0
  75. package/dist/components/fields/RepoUrlPicker/RepoUrlPicker.esm.js +200 -0
  76. package/dist/components/fields/RepoUrlPicker/RepoUrlPicker.esm.js.map +1 -0
  77. package/dist/components/fields/RepoUrlPicker/RepoUrlPickerHost.esm.js +56 -0
  78. package/dist/components/fields/RepoUrlPicker/RepoUrlPickerHost.esm.js.map +1 -0
  79. package/dist/components/fields/RepoUrlPicker/RepoUrlPickerRepoName.esm.js +48 -0
  80. package/dist/components/fields/RepoUrlPicker/RepoUrlPickerRepoName.esm.js.map +1 -0
  81. package/dist/components/fields/RepoUrlPicker/schema.esm.js +32 -0
  82. package/dist/components/fields/RepoUrlPicker/schema.esm.js.map +1 -0
  83. package/dist/components/fields/RepoUrlPicker/utils.esm.js +46 -0
  84. package/dist/components/fields/RepoUrlPicker/utils.esm.js.map +1 -0
  85. package/dist/components/fields/RepoUrlPicker/validation.esm.js +43 -0
  86. package/dist/components/fields/RepoUrlPicker/validation.esm.js.map +1 -0
  87. package/dist/components/fields/SecretInput/SecretInput.esm.js +48 -0
  88. package/dist/components/fields/SecretInput/SecretInput.esm.js.map +1 -0
  89. package/dist/components/fields/utils.esm.js +15 -0
  90. package/dist/components/fields/utils.esm.js.map +1 -0
  91. package/dist/deprecated.esm.js +13 -0
  92. package/dist/deprecated.esm.js.map +1 -0
  93. package/dist/extensions/default.esm.js +72 -0
  94. package/dist/extensions/default.esm.js.map +1 -0
  95. package/dist/index.esm.js +13 -214
  96. package/dist/index.esm.js.map +1 -1
  97. package/dist/lib/download/helpers.esm.js +11 -0
  98. package/dist/lib/download/helpers.esm.js.map +1 -0
  99. package/dist/lib/filesystem/WebFileSystemAccess.esm.js +56 -0
  100. package/dist/lib/filesystem/WebFileSystemAccess.esm.js.map +1 -0
  101. package/dist/next/TemplateEditorPage/CustomFieldExplorer.esm.js +151 -0
  102. package/dist/next/TemplateEditorPage/CustomFieldExplorer.esm.js.map +1 -0
  103. package/dist/next/TemplateEditorPage/DirectoryEditorContext.esm.js +186 -0
  104. package/dist/next/TemplateEditorPage/DirectoryEditorContext.esm.js.map +1 -0
  105. package/dist/next/TemplateEditorPage/DryRunContext.esm.js +110 -0
  106. package/dist/next/TemplateEditorPage/DryRunContext.esm.js.map +1 -0
  107. package/dist/next/TemplateEditorPage/DryRunResults/DryRunResults.esm.js +70 -0
  108. package/dist/next/TemplateEditorPage/DryRunResults/DryRunResults.esm.js.map +1 -0
  109. package/dist/next/TemplateEditorPage/DryRunResults/DryRunResultsList.esm.js +98 -0
  110. package/dist/next/TemplateEditorPage/DryRunResults/DryRunResultsList.esm.js.map +1 -0
  111. package/dist/next/TemplateEditorPage/DryRunResults/DryRunResultsSplitView.esm.js +31 -0
  112. package/dist/next/TemplateEditorPage/DryRunResults/DryRunResultsSplitView.esm.js.map +1 -0
  113. package/dist/next/TemplateEditorPage/DryRunResults/DryRunResultsView.esm.js +145 -0
  114. package/dist/next/TemplateEditorPage/DryRunResults/DryRunResultsView.esm.js.map +1 -0
  115. package/dist/next/TemplateEditorPage/DryRunResults/IconLink.esm.js +25 -0
  116. package/dist/next/TemplateEditorPage/DryRunResults/IconLink.esm.js.map +1 -0
  117. package/dist/next/TemplateEditorPage/DryRunResults/TaskPageLinks.esm.js +40 -0
  118. package/dist/next/TemplateEditorPage/DryRunResults/TaskPageLinks.esm.js.map +1 -0
  119. package/dist/next/TemplateEditorPage/DryRunResults/TaskStatusStepper.esm.js +135 -0
  120. package/dist/next/TemplateEditorPage/DryRunResults/TaskStatusStepper.esm.js.map +1 -0
  121. package/dist/next/TemplateEditorPage/TemplateEditor.esm.js +52 -0
  122. package/dist/next/TemplateEditorPage/TemplateEditor.esm.js.map +1 -0
  123. package/dist/next/TemplateEditorPage/TemplateEditorBrowser.esm.js +74 -0
  124. package/dist/next/TemplateEditorPage/TemplateEditorBrowser.esm.js.map +1 -0
  125. package/dist/next/TemplateEditorPage/TemplateEditorForm.esm.js +174 -0
  126. package/dist/next/TemplateEditorPage/TemplateEditorForm.esm.js.map +1 -0
  127. package/dist/next/TemplateEditorPage/TemplateEditorIntro.esm.js +93 -0
  128. package/dist/next/TemplateEditorPage/TemplateEditorIntro.esm.js.map +1 -0
  129. package/dist/next/TemplateEditorPage/TemplateEditorPage.esm.js +82 -0
  130. package/dist/next/TemplateEditorPage/TemplateEditorPage.esm.js.map +1 -0
  131. package/dist/next/TemplateEditorPage/TemplateEditorTextArea.esm.js +120 -0
  132. package/dist/next/TemplateEditorPage/TemplateEditorTextArea.esm.js.map +1 -0
  133. package/dist/next/TemplateEditorPage/TemplateFormPreviewer.esm.js +160 -0
  134. package/dist/next/TemplateEditorPage/TemplateFormPreviewer.esm.js.map +1 -0
  135. package/dist/next/TemplateListPage/RegisterExistingButton.esm.js +35 -0
  136. package/dist/next/TemplateListPage/RegisterExistingButton.esm.js.map +1 -0
  137. package/dist/next/TemplateListPage/TemplateListPage.esm.js +101 -0
  138. package/dist/next/TemplateListPage/TemplateListPage.esm.js.map +1 -0
  139. package/dist/next/TemplateWizardPage/TemplateWizardPage.esm.js +67 -0
  140. package/dist/next/TemplateWizardPage/TemplateWizardPage.esm.js.map +1 -0
  141. package/dist/next/TemplateWizardPage/TemplateWizardPageContextMenu.esm.js +60 -0
  142. package/dist/next/TemplateWizardPage/TemplateWizardPageContextMenu.esm.js.map +1 -0
  143. package/dist/plugin.esm.js +125 -0
  144. package/dist/plugin.esm.js.map +1 -0
  145. package/dist/routes.esm.js +47 -0
  146. package/dist/routes.esm.js.map +1 -0
  147. package/package.json +18 -18
  148. package/dist/esm/OngoingTask-ClfJCJcE.esm.js +0 -1575
  149. package/dist/esm/OngoingTask-ClfJCJcE.esm.js.map +0 -1
  150. package/dist/esm/index-UcPid-q1.esm.js +0 -2553
  151. package/dist/esm/index-UcPid-q1.esm.js.map +0 -1
  152. package/dist/esm/routes-BvToNy4N.esm.js.map +0 -1
@@ -0,0 +1,75 @@
1
+ import React from 'react';
2
+ import FormControl from '@material-ui/core/FormControl';
3
+ import FormHelperText from '@material-ui/core/FormHelperText';
4
+ import Input from '@material-ui/core/Input';
5
+ import InputLabel from '@material-ui/core/InputLabel';
6
+ import { Select } from '@backstage/core-components';
7
+
8
+ const AzureRepoPicker = (props) => {
9
+ const {
10
+ allowedOrganizations = [],
11
+ allowedOwners = [],
12
+ rawErrors,
13
+ state,
14
+ onChange
15
+ } = props;
16
+ const organizationItems = allowedOrganizations ? allowedOrganizations.map((i) => ({ label: i, value: i })) : [{ label: "Loading...", value: "loading" }];
17
+ const ownerItems = allowedOwners ? allowedOwners.map((i) => ({ label: i, value: i })) : [{ label: "Loading...", value: "loading" }];
18
+ const { organization, owner } = state;
19
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
20
+ FormControl,
21
+ {
22
+ margin: "normal",
23
+ required: true,
24
+ error: (rawErrors == null ? void 0 : rawErrors.length) > 0 && !organization
25
+ },
26
+ (allowedOrganizations == null ? void 0 : allowedOrganizations.length) ? /* @__PURE__ */ React.createElement(
27
+ Select,
28
+ {
29
+ native: true,
30
+ label: "Organization",
31
+ onChange: (s) => onChange({ organization: String(Array.isArray(s) ? s[0] : s) }),
32
+ disabled: allowedOrganizations.length === 1,
33
+ selected: organization,
34
+ items: organizationItems
35
+ }
36
+ ) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(InputLabel, { htmlFor: "orgInput" }, "Organization"), /* @__PURE__ */ React.createElement(
37
+ Input,
38
+ {
39
+ id: "orgInput",
40
+ onChange: (e) => onChange({ organization: e.target.value }),
41
+ value: organization
42
+ }
43
+ )),
44
+ /* @__PURE__ */ React.createElement(FormHelperText, null, "The Organization that this repo will belong to")
45
+ ), /* @__PURE__ */ React.createElement(
46
+ FormControl,
47
+ {
48
+ margin: "normal",
49
+ required: true,
50
+ error: (rawErrors == null ? void 0 : rawErrors.length) > 0 && !owner
51
+ },
52
+ (allowedOwners == null ? void 0 : allowedOwners.length) ? /* @__PURE__ */ React.createElement(
53
+ Select,
54
+ {
55
+ native: true,
56
+ label: "Owner",
57
+ onChange: (s) => onChange({ owner: String(Array.isArray(s) ? s[0] : s) }),
58
+ disabled: allowedOwners.length === 1,
59
+ selected: owner,
60
+ items: ownerItems
61
+ }
62
+ ) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(InputLabel, { htmlFor: "ownerInput" }, "Project"), /* @__PURE__ */ React.createElement(
63
+ Input,
64
+ {
65
+ id: "ownerInput",
66
+ onChange: (e) => onChange({ owner: e.target.value }),
67
+ value: owner
68
+ }
69
+ )),
70
+ /* @__PURE__ */ React.createElement(FormHelperText, null, "The Project that this repo will belong to")
71
+ ));
72
+ };
73
+
74
+ export { AzureRepoPicker };
75
+ //# sourceMappingURL=AzureRepoPicker.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AzureRepoPicker.esm.js","sources":["../../../../src/components/fields/RepoUrlPicker/AzureRepoPicker.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 React from 'react';\nimport FormControl from '@material-ui/core/FormControl';\nimport FormHelperText from '@material-ui/core/FormHelperText';\nimport Input from '@material-ui/core/Input';\nimport InputLabel from '@material-ui/core/InputLabel';\nimport { RepoUrlPickerState } from './types';\nimport { Select, SelectItem } from '@backstage/core-components';\n\nexport const AzureRepoPicker = (props: {\n allowedOrganizations?: string[];\n allowedOwners?: string[];\n rawErrors: string[];\n state: RepoUrlPickerState;\n onChange: (state: RepoUrlPickerState) => void;\n}) => {\n const {\n allowedOrganizations = [],\n allowedOwners = [],\n rawErrors,\n state,\n onChange,\n } = props;\n\n const organizationItems: SelectItem[] = allowedOrganizations\n ? allowedOrganizations.map(i => ({ label: i, value: i }))\n : [{ label: 'Loading...', value: 'loading' }];\n\n const ownerItems: SelectItem[] = allowedOwners\n ? allowedOwners.map(i => ({ label: i, value: i }))\n : [{ label: 'Loading...', value: 'loading' }];\n\n const { organization, owner } = state;\n\n return (\n <>\n <FormControl\n margin=\"normal\"\n required\n error={rawErrors?.length > 0 && !organization}\n >\n {allowedOrganizations?.length ? (\n <Select\n native\n label=\"Organization\"\n onChange={s =>\n onChange({ organization: String(Array.isArray(s) ? s[0] : s) })\n }\n disabled={allowedOrganizations.length === 1}\n selected={organization}\n items={organizationItems}\n />\n ) : (\n <>\n <InputLabel htmlFor=\"orgInput\">Organization</InputLabel>\n <Input\n id=\"orgInput\"\n onChange={e => onChange({ organization: e.target.value })}\n value={organization}\n />\n </>\n )}\n <FormHelperText>\n The Organization that this repo will belong to\n </FormHelperText>\n </FormControl>\n <FormControl\n margin=\"normal\"\n required\n error={rawErrors?.length > 0 && !owner}\n >\n {allowedOwners?.length ? (\n <Select\n native\n label=\"Owner\"\n onChange={s =>\n onChange({ owner: String(Array.isArray(s) ? s[0] : s) })\n }\n disabled={allowedOwners.length === 1}\n selected={owner}\n items={ownerItems}\n />\n ) : (\n <>\n <InputLabel htmlFor=\"ownerInput\">Project</InputLabel>\n <Input\n id=\"ownerInput\"\n onChange={e => onChange({ owner: e.target.value })}\n value={owner}\n />\n </>\n )}\n <FormHelperText>\n The Project that this repo will belong to\n </FormHelperText>\n </FormControl>\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;AAwBa,MAAA,eAAA,GAAkB,CAAC,KAM1B,KAAA;AACJ,EAAM,MAAA;AAAA,IACJ,uBAAuB,EAAC;AAAA,IACxB,gBAAgB,EAAC;AAAA,IACjB,SAAA;AAAA,IACA,KAAA;AAAA,IACA,QAAA;AAAA,GACE,GAAA,KAAA,CAAA;AAEJ,EAAA,MAAM,oBAAkC,oBACpC,GAAA,oBAAA,CAAqB,IAAI,CAAM,CAAA,MAAA,EAAE,OAAO,CAAG,EAAA,KAAA,EAAO,CAAE,EAAA,CAAE,IACtD,CAAC,EAAE,OAAO,YAAc,EAAA,KAAA,EAAO,WAAW,CAAA,CAAA;AAE9C,EAAA,MAAM,aAA2B,aA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;AAAA,OAAA;AAAA,KAEX,CAAA;AAAA,oBAEF,KAAA,CAAA,aAAA,CAAC,sBAAe,2CAEhB,CAAA;AAAA,GAEJ,CAAA,CAAA;AAEJ;;;;"}
@@ -0,0 +1,80 @@
1
+ import React, { useEffect } from 'react';
2
+ import FormControl from '@material-ui/core/FormControl';
3
+ import FormHelperText from '@material-ui/core/FormHelperText';
4
+ import Input from '@material-ui/core/Input';
5
+ import InputLabel from '@material-ui/core/InputLabel';
6
+ import { Select } from '@backstage/core-components';
7
+
8
+ const BitbucketRepoPicker = (props) => {
9
+ const {
10
+ allowedOwners = [],
11
+ allowedProjects = [],
12
+ onChange,
13
+ rawErrors,
14
+ state
15
+ } = props;
16
+ const { host, workspace, project } = state;
17
+ const ownerItems = allowedOwners ? allowedOwners == null ? void 0 : allowedOwners.map((i) => ({ label: i, value: i })) : [];
18
+ const projectItems = allowedProjects ? allowedProjects == null ? void 0 : allowedProjects.map((i) => ({ label: i, value: i })) : [];
19
+ useEffect(() => {
20
+ if (host === "bitbucket.org" && allowedOwners.length) {
21
+ onChange({ workspace: allowedOwners[0] });
22
+ }
23
+ }, [allowedOwners, host, onChange]);
24
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, host === "bitbucket.org" && /* @__PURE__ */ React.createElement(
25
+ FormControl,
26
+ {
27
+ margin: "normal",
28
+ required: true,
29
+ error: (rawErrors == null ? void 0 : rawErrors.length) > 0 && !workspace
30
+ },
31
+ (allowedOwners == null ? void 0 : allowedOwners.length) ? /* @__PURE__ */ React.createElement(
32
+ Select,
33
+ {
34
+ native: true,
35
+ label: "Allowed Workspaces",
36
+ onChange: (s) => onChange({ workspace: String(Array.isArray(s) ? s[0] : s) }),
37
+ disabled: allowedOwners.length === 1,
38
+ selected: workspace,
39
+ items: ownerItems
40
+ }
41
+ ) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(InputLabel, { htmlFor: "workspaceInput" }, "Workspace"), /* @__PURE__ */ React.createElement(
42
+ Input,
43
+ {
44
+ id: "workspaceInput",
45
+ onChange: (e) => onChange({ workspace: e.target.value }),
46
+ value: workspace
47
+ }
48
+ )),
49
+ /* @__PURE__ */ React.createElement(FormHelperText, null, "The Workspace that this repo will belong to")
50
+ ), /* @__PURE__ */ React.createElement(
51
+ FormControl,
52
+ {
53
+ margin: "normal",
54
+ required: true,
55
+ error: (rawErrors == null ? void 0 : rawErrors.length) > 0 && !project
56
+ },
57
+ (allowedProjects == null ? void 0 : allowedProjects.length) ? /* @__PURE__ */ React.createElement(
58
+ Select,
59
+ {
60
+ native: true,
61
+ label: "Allowed Projects",
62
+ onChange: (s) => onChange({ project: String(Array.isArray(s) ? s[0] : s) }),
63
+ disabled: allowedProjects.length === 1,
64
+ selected: project,
65
+ items: projectItems
66
+ }
67
+ ) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(InputLabel, { htmlFor: "projectInput" }, "Project"), /* @__PURE__ */ React.createElement(
68
+ Input,
69
+ {
70
+ id: "projectInput",
71
+ onChange: (e) => onChange({ project: e.target.value }),
72
+ value: project
73
+ }
74
+ )),
75
+ /* @__PURE__ */ React.createElement(FormHelperText, null, "The Project that this repo will belong to")
76
+ ));
77
+ };
78
+
79
+ export { BitbucketRepoPicker };
80
+ //# sourceMappingURL=BitbucketRepoPicker.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BitbucketRepoPicker.esm.js","sources":["../../../../src/components/fields/RepoUrlPicker/BitbucketRepoPicker.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 React, { useEffect } from 'react';\nimport FormControl from '@material-ui/core/FormControl';\nimport FormHelperText from '@material-ui/core/FormHelperText';\nimport Input from '@material-ui/core/Input';\nimport InputLabel from '@material-ui/core/InputLabel';\nimport { Select, SelectItem } from '@backstage/core-components';\nimport { RepoUrlPickerState } from './types';\n\n/**\n * The underlying component that is rendered in the form for the `BitbucketRepoPicker`\n * field extension.\n *\n * @public\n * @param allowedOwners - Allowed workspaces for the Bitbucket cloud repository\n * @param allowedProjects - Allowed projects for the Bitbucket cloud repository\n *\n */\nexport const BitbucketRepoPicker = (props: {\n allowedOwners?: string[];\n allowedProjects?: string[];\n onChange: (state: RepoUrlPickerState) => void;\n state: RepoUrlPickerState;\n rawErrors: string[];\n}) => {\n const {\n allowedOwners = [],\n allowedProjects = [],\n onChange,\n rawErrors,\n state,\n } = props;\n const { host, workspace, project } = state;\n const ownerItems: SelectItem[] = allowedOwners\n ? allowedOwners?.map(i => ({ label: i, value: i }))\n : [];\n const projectItems: SelectItem[] = allowedProjects\n ? allowedProjects?.map(i => ({ label: i, value: i }))\n : [];\n\n useEffect(() => {\n if (host === 'bitbucket.org' && allowedOwners.length) {\n onChange({ workspace: allowedOwners[0] });\n }\n }, [allowedOwners, host, onChange]);\n\n return (\n <>\n {host === 'bitbucket.org' && (\n <FormControl\n margin=\"normal\"\n required\n error={rawErrors?.length > 0 && !workspace}\n >\n {allowedOwners?.length ? (\n <Select\n native\n label=\"Allowed Workspaces\"\n onChange={s =>\n onChange({ workspace: String(Array.isArray(s) ? s[0] : s) })\n }\n disabled={allowedOwners.length === 1}\n selected={workspace}\n items={ownerItems}\n />\n ) : (\n <>\n <InputLabel htmlFor=\"workspaceInput\">Workspace</InputLabel>\n <Input\n id=\"workspaceInput\"\n onChange={e => onChange({ workspace: e.target.value })}\n value={workspace}\n />\n </>\n )}\n <FormHelperText>\n The Workspace that this repo will belong to\n </FormHelperText>\n </FormControl>\n )}\n <FormControl\n margin=\"normal\"\n required\n error={rawErrors?.length > 0 && !project}\n >\n {allowedProjects?.length ? (\n <Select\n native\n label=\"Allowed Projects\"\n onChange={s =>\n onChange({ project: String(Array.isArray(s) ? s[0] : s) })\n }\n disabled={allowedProjects.length === 1}\n selected={project}\n items={projectItems}\n />\n ) : (\n <>\n <InputLabel htmlFor=\"projectInput\">Project</InputLabel>\n <Input\n id=\"projectInput\"\n onChange={e => onChange({ project: e.target.value })}\n value={project}\n />\n </>\n )}\n <FormHelperText>\n The Project that this repo will belong to\n </FormHelperText>\n </FormControl>\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;AAgCa,MAAA,mBAAA,GAAsB,CAAC,KAM9B,KAAA;AACJ,EAAM,MAAA;AAAA,IACJ,gBAAgB,EAAC;AAAA,IACjB,kBAAkB,EAAC;AAAA,IACnB,QAAA;AAAA,IACA,SAAA;AAAA,IACA,KAAA;AAAA,GACE,GAAA,KAAA,CAAA;AACJ,EAAA,MAAM,EAAE,IAAA,EAAM,SAAW,EAAA,OAAA,EAAY,GAAA,KAAA,CAAA;AACrC,EAAM,MAAA,UAAA,GAA2B,aAC7B,GAAA,aAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,aAAA,CAAe,GAAI,CAAA,CAAA,CAAA,MAAM,EAAE,KAAA,EAAO,CAAG,EAAA,KAAA,EAAO,CAAE,EAAA,CAAA,CAAA,GAC9C,EAAC,CAAA;AACL,EAAM,MAAA,YAAA,GAA6B,eAC/B,GAAA,eAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,eAAA,CAAiB,GAAI,CAAA,CAAA,CAAA,MAAM,EAAE,KAAA,EAAO,CAAG,EAAA,KAAA,EAAO,CAAE,EAAA,CAAA,CAAA,GAChD,EAAC,CAAA;AAEL,EAAA,SAAA,CAAU,MAAM;AACd,IAAI,IAAA,IAAA,KAAS,eAAmB,IAAA,aAAA,CAAc,MAAQ,EAAA;AACpD,MAAA,QAAA,CAAS,EAAE,SAAA,EAAW,aAAc,CAAA,CAAC,GAAG,CAAA,CAA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
@@ -0,0 +1,38 @@
1
+ import React from 'react';
2
+ import FormControl from '@material-ui/core/FormControl';
3
+ import FormHelperText from '@material-ui/core/FormHelperText';
4
+ import Input from '@material-ui/core/Input';
5
+ import InputLabel from '@material-ui/core/InputLabel';
6
+
7
+ const GerritRepoPicker = (props) => {
8
+ const { onChange, rawErrors, state } = props;
9
+ const { workspace, owner } = state;
10
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(FormControl, { margin: "normal", error: (rawErrors == null ? void 0 : rawErrors.length) > 0 && !workspace }, /* @__PURE__ */ React.createElement(InputLabel, { htmlFor: "ownerInput" }, "Owner"), /* @__PURE__ */ React.createElement(
11
+ Input,
12
+ {
13
+ id: "ownerInput",
14
+ onChange: (e) => onChange({ owner: e.target.value }),
15
+ value: owner
16
+ }
17
+ ), /* @__PURE__ */ React.createElement(FormHelperText, null, "The owner of the project (optional)")), /* @__PURE__ */ React.createElement(
18
+ FormControl,
19
+ {
20
+ margin: "normal",
21
+ required: true,
22
+ error: (rawErrors == null ? void 0 : rawErrors.length) > 0 && !workspace
23
+ },
24
+ /* @__PURE__ */ React.createElement(InputLabel, { htmlFor: "parentInput" }, "Parent"),
25
+ /* @__PURE__ */ React.createElement(
26
+ Input,
27
+ {
28
+ id: "parentInput",
29
+ onChange: (e) => onChange({ workspace: e.target.value }),
30
+ value: workspace
31
+ }
32
+ ),
33
+ /* @__PURE__ */ React.createElement(FormHelperText, null, "The project parent that the repo will belong to")
34
+ ));
35
+ };
36
+
37
+ export { GerritRepoPicker };
38
+ //# sourceMappingURL=GerritRepoPicker.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GerritRepoPicker.esm.js","sources":["../../../../src/components/fields/RepoUrlPicker/GerritRepoPicker.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 React from 'react';\nimport FormControl from '@material-ui/core/FormControl';\nimport FormHelperText from '@material-ui/core/FormHelperText';\nimport Input from '@material-ui/core/Input';\nimport InputLabel from '@material-ui/core/InputLabel';\nimport { RepoUrlPickerState } from './types';\n\nexport const GerritRepoPicker = (props: {\n onChange: (state: RepoUrlPickerState) => void;\n state: RepoUrlPickerState;\n rawErrors: string[];\n}) => {\n const { onChange, rawErrors, state } = props;\n const { workspace, owner } = state;\n return (\n <>\n <FormControl margin=\"normal\" error={rawErrors?.length > 0 && !workspace}>\n <InputLabel htmlFor=\"ownerInput\">Owner</InputLabel>\n <Input\n id=\"ownerInput\"\n onChange={e => onChange({ owner: e.target.value })}\n value={owner}\n />\n <FormHelperText>The owner of the project (optional)</FormHelperText>\n </FormControl>\n <FormControl\n margin=\"normal\"\n required\n error={rawErrors?.length > 0 && !workspace}\n >\n <InputLabel htmlFor=\"parentInput\">Parent</InputLabel>\n <Input\n id=\"parentInput\"\n onChange={e => onChange({ workspace: e.target.value })}\n value={workspace}\n />\n <FormHelperText>\n The project parent that the repo will belong to\n </FormHelperText>\n </FormControl>\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;AAsBa,MAAA,gBAAA,GAAmB,CAAC,KAI3B,KAAA;AACJ,EAAA,MAAM,EAAE,QAAA,EAAU,SAAW,EAAA,KAAA,EAAU,GAAA,KAAA,CAAA;AACvC,EAAM,MAAA,EAAE,SAAW,EAAA,KAAA,EAAU,GAAA,KAAA,CAAA;AAC7B,EAAA,iFAEK,KAAA,CAAA,aAAA,CAAA,WAAA,EAAA,EAAY,MAAO,EAAA,QAAA,EAAS,QAAO,SAAW,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,SAAA,CAAA,MAAA,IAAS,CAAK,IAAA,CAAC,6BAC3D,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA,EAAW,OAAQ,EAAA,YAAA,EAAA,EAAa,OAAK,CACtC,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,EAAG,EAAA,YAAA;AAAA,MACH,QAAA,EAAU,OAAK,QAAS,CAAA,EAAE,OAAO,CAAE,CAAA,MAAA,CAAO,OAAO,CAAA;AAAA,MACjD,KAAO,EAAA,KAAA;AAAA,KAAA;AAAA,GAET,kBAAA,KAAA,CAAA,aAAA,CAAC,cAAe,EAAA,IAAA,EAAA,qCAAmC,CACrD,CACA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,WAAA;AAAA,IAAA;AAAA,MACC,MAAO,EAAA,QAAA;AAAA,MACP,QAAQ,EAAA,IAAA;AAAA,MACR,KAAO,EAAA,CAAA,SAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,SAAA,CAAW,MAAS,IAAA,CAAA,IAAK,CAAC,SAAA;AAAA,KAAA;AAAA,oBAEhC,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA,EAAW,OAAQ,EAAA,aAAA,EAAA,EAAc,QAAM,CAAA;AAAA,oBACxC,KAAA,CAAA,aAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,EAAG,EAAA,aAAA;AAAA,QACH,QAAA,EAAU,OAAK,QAAS,CAAA,EAAE,WAAW,CAAE,CAAA,MAAA,CAAO,OAAO,CAAA;AAAA,QACrD,KAAO,EAAA,SAAA;AAAA,OAAA;AAAA,KACT;AAAA,oBACA,KAAA,CAAA,aAAA,CAAC,sBAAe,iDAEhB,CAAA;AAAA,GAEJ,CAAA,CAAA;AAEJ;;;;"}
@@ -0,0 +1,44 @@
1
+ import React from 'react';
2
+ import FormControl from '@material-ui/core/FormControl';
3
+ import FormHelperText from '@material-ui/core/FormHelperText';
4
+ import Input from '@material-ui/core/Input';
5
+ import InputLabel from '@material-ui/core/InputLabel';
6
+ import { Select } from '@backstage/core-components';
7
+
8
+ const GiteaRepoPicker = (props) => {
9
+ const { allowedOwners = [], state, onChange, rawErrors } = props;
10
+ const ownerItems = allowedOwners ? allowedOwners.map((i) => ({ label: i, value: i })) : [{ label: "Loading...", value: "loading" }];
11
+ const { owner } = state;
12
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
13
+ FormControl,
14
+ {
15
+ margin: "normal",
16
+ required: true,
17
+ error: (rawErrors == null ? void 0 : rawErrors.length) > 0 && !owner
18
+ },
19
+ (allowedOwners == null ? void 0 : allowedOwners.length) ? /* @__PURE__ */ React.createElement(
20
+ Select,
21
+ {
22
+ native: true,
23
+ label: "Owner Available",
24
+ onChange: (selected) => onChange({
25
+ owner: String(Array.isArray(selected) ? selected[0] : selected)
26
+ }),
27
+ disabled: allowedOwners.length === 1,
28
+ selected: owner,
29
+ items: ownerItems
30
+ }
31
+ ) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(InputLabel, { htmlFor: "ownerInput" }, "Owner"), /* @__PURE__ */ React.createElement(
32
+ Input,
33
+ {
34
+ id: "ownerInput",
35
+ onChange: (e) => onChange({ owner: e.target.value }),
36
+ value: owner
37
+ }
38
+ )),
39
+ /* @__PURE__ */ React.createElement(FormHelperText, null, "Gitea namespace where this repository will belong to. It can be the name of organization, group, subgroup, user, or the project.")
40
+ ));
41
+ };
42
+
43
+ export { GiteaRepoPicker };
44
+ //# sourceMappingURL=GiteaRepoPicker.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GiteaRepoPicker.esm.js","sources":["../../../../src/components/fields/RepoUrlPicker/GiteaRepoPicker.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 React from 'react';\nimport FormControl from '@material-ui/core/FormControl';\nimport FormHelperText from '@material-ui/core/FormHelperText';\nimport Input from '@material-ui/core/Input';\nimport InputLabel from '@material-ui/core/InputLabel';\nimport { Select, SelectItem } from '@backstage/core-components';\nimport { RepoUrlPickerState } from './types';\n\nexport const GiteaRepoPicker = (props: {\n allowedOwners?: string[];\n allowedRepos?: string[];\n state: RepoUrlPickerState;\n onChange: (state: RepoUrlPickerState) => void;\n rawErrors: string[];\n}) => {\n const { allowedOwners = [], state, onChange, rawErrors } = props;\n const ownerItems: SelectItem[] = allowedOwners\n ? allowedOwners.map(i => ({ label: i, value: i }))\n : [{ label: 'Loading...', value: 'loading' }];\n\n const { owner } = state;\n\n return (\n <>\n <FormControl\n margin=\"normal\"\n required\n error={rawErrors?.length > 0 && !owner}\n >\n {allowedOwners?.length ? (\n <Select\n native\n label=\"Owner Available\"\n onChange={selected =>\n onChange({\n owner: String(Array.isArray(selected) ? selected[0] : selected),\n })\n }\n disabled={allowedOwners.length === 1}\n selected={owner}\n items={ownerItems}\n />\n ) : (\n <>\n <InputLabel htmlFor=\"ownerInput\">Owner</InputLabel>\n <Input\n id=\"ownerInput\"\n onChange={e => onChange({ owner: e.target.value })}\n value={owner}\n />\n </>\n )}\n <FormHelperText>\n Gitea namespace where this repository will belong to. It can be the\n name of organization, group, subgroup, user, or the project.\n </FormHelperText>\n </FormControl>\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;AAuBa,MAAA,eAAA,GAAkB,CAAC,KAM1B,KAAA;AACJ,EAAA,MAAM,EAAE,aAAgB,GAAA,IAAI,KAAO,EAAA,QAAA,EAAU,WAAc,GAAA,KAAA,CAAA;AAC3D,EAAA,MAAM,aAA2B,aAC7B,GAAA,aAAA,CAAc,IAAI,CAAM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E,CAAA,MAAA,CAAO,OAAO,CAAA;AAAA,QACjD,KAAO,EAAA,KAAA;AAAA,OAAA;AAAA,KAEX,CAAA;AAAA,oBAEF,KAAA,CAAA,aAAA,CAAC,sBAAe,kIAGhB,CAAA;AAAA,GAEJ,CAAA,CAAA;AAEJ;;;;"}
@@ -0,0 +1,42 @@
1
+ import React from 'react';
2
+ import FormControl from '@material-ui/core/FormControl';
3
+ import FormHelperText from '@material-ui/core/FormHelperText';
4
+ import Input from '@material-ui/core/Input';
5
+ import InputLabel from '@material-ui/core/InputLabel';
6
+ import { Select } from '@backstage/core-components';
7
+
8
+ const GithubRepoPicker = (props) => {
9
+ const { allowedOwners = [], rawErrors, state, onChange } = props;
10
+ const ownerItems = allowedOwners ? allowedOwners.map((i) => ({ label: i, value: i })) : [{ label: "Loading...", value: "loading" }];
11
+ const { owner } = state;
12
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
13
+ FormControl,
14
+ {
15
+ margin: "normal",
16
+ required: true,
17
+ error: (rawErrors == null ? void 0 : rawErrors.length) > 0 && !owner
18
+ },
19
+ (allowedOwners == null ? void 0 : allowedOwners.length) ? /* @__PURE__ */ React.createElement(
20
+ Select,
21
+ {
22
+ native: true,
23
+ label: "Owner Available",
24
+ onChange: (s) => onChange({ owner: String(Array.isArray(s) ? s[0] : s) }),
25
+ disabled: allowedOwners.length === 1,
26
+ selected: owner,
27
+ items: ownerItems
28
+ }
29
+ ) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(InputLabel, { htmlFor: "ownerInput" }, "Owner"), /* @__PURE__ */ React.createElement(
30
+ Input,
31
+ {
32
+ id: "ownerInput",
33
+ onChange: (e) => onChange({ owner: e.target.value }),
34
+ value: owner
35
+ }
36
+ )),
37
+ /* @__PURE__ */ React.createElement(FormHelperText, null, "The organization, user or project that this repo will belong to")
38
+ ));
39
+ };
40
+
41
+ export { GithubRepoPicker };
42
+ //# sourceMappingURL=GithubRepoPicker.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GithubRepoPicker.esm.js","sources":["../../../../src/components/fields/RepoUrlPicker/GithubRepoPicker.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 React from 'react';\nimport FormControl from '@material-ui/core/FormControl';\nimport FormHelperText from '@material-ui/core/FormHelperText';\nimport Input from '@material-ui/core/Input';\nimport InputLabel from '@material-ui/core/InputLabel';\nimport { Select, SelectItem } from '@backstage/core-components';\nimport { RepoUrlPickerState } from './types';\n\nexport const GithubRepoPicker = (props: {\n allowedOwners?: string[];\n rawErrors: string[];\n state: RepoUrlPickerState;\n onChange: (state: RepoUrlPickerState) => void;\n}) => {\n const { allowedOwners = [], rawErrors, state, onChange } = props;\n const ownerItems: SelectItem[] = allowedOwners\n ? allowedOwners.map(i => ({ label: i, value: i }))\n : [{ label: 'Loading...', value: 'loading' }];\n\n const { owner } = state;\n\n return (\n <>\n <FormControl\n margin=\"normal\"\n required\n error={rawErrors?.length > 0 && !owner}\n >\n {allowedOwners?.length ? (\n <Select\n native\n label=\"Owner Available\"\n onChange={s =>\n onChange({ owner: String(Array.isArray(s) ? s[0] : s) })\n }\n disabled={allowedOwners.length === 1}\n selected={owner}\n items={ownerItems}\n />\n ) : (\n <>\n <InputLabel htmlFor=\"ownerInput\">Owner</InputLabel>\n <Input\n id=\"ownerInput\"\n onChange={e => onChange({ owner: e.target.value })}\n value={owner}\n />\n </>\n )}\n <FormHelperText>\n The organization, user or project that this repo will belong to\n </FormHelperText>\n </FormControl>\n </>\n );\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,KAAA,CAAA,aAAA,CAAC,cAAW,OAAQ,EAAA,YAAA,EAAA,EAAa,OAAK,CACtC,kBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,EAAG,EAAA,YAAA;AAAA,QACH,QAAA,EAAU,OAAK,QAAS,CAAA,EAAE,OAAO,CAAE,CAAA,MAAA,CAAO,OAAO,CAAA;AAAA,QACjD,KAAO,EAAA,KAAA;AAAA,OAAA;AAAA,KAEX,CAAA;AAAA,oBAEF,KAAA,CAAA,aAAA,CAAC,sBAAe,iEAEhB,CAAA;AAAA,GAEJ,CAAA,CAAA;AAEJ;;;;"}
@@ -0,0 +1,44 @@
1
+ import React from 'react';
2
+ import FormControl from '@material-ui/core/FormControl';
3
+ import FormHelperText from '@material-ui/core/FormHelperText';
4
+ import Input from '@material-ui/core/Input';
5
+ import InputLabel from '@material-ui/core/InputLabel';
6
+ import { Select } from '@backstage/core-components';
7
+
8
+ const GitlabRepoPicker = (props) => {
9
+ const { allowedOwners = [], state, onChange, rawErrors } = props;
10
+ const ownerItems = allowedOwners ? allowedOwners.map((i) => ({ label: i, value: i })) : [{ label: "Loading...", value: "loading" }];
11
+ const { owner } = state;
12
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
13
+ FormControl,
14
+ {
15
+ margin: "normal",
16
+ required: true,
17
+ error: (rawErrors == null ? void 0 : rawErrors.length) > 0 && !owner
18
+ },
19
+ (allowedOwners == null ? void 0 : allowedOwners.length) ? /* @__PURE__ */ React.createElement(
20
+ Select,
21
+ {
22
+ native: true,
23
+ label: "Owner Available",
24
+ onChange: (selected) => onChange({
25
+ owner: String(Array.isArray(selected) ? selected[0] : selected)
26
+ }),
27
+ disabled: allowedOwners.length === 1,
28
+ selected: owner,
29
+ items: ownerItems
30
+ }
31
+ ) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(InputLabel, { htmlFor: "ownerInput" }, "Owner"), /* @__PURE__ */ React.createElement(
32
+ Input,
33
+ {
34
+ id: "ownerInput",
35
+ onChange: (e) => onChange({ owner: e.target.value }),
36
+ value: owner
37
+ }
38
+ )),
39
+ /* @__PURE__ */ React.createElement(FormHelperText, null, "GitLab namespace where this repository will belong to. It can be the name of organization, group, subgroup, user, or the project.")
40
+ ));
41
+ };
42
+
43
+ export { GitlabRepoPicker };
44
+ //# sourceMappingURL=GitlabRepoPicker.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GitlabRepoPicker.esm.js","sources":["../../../../src/components/fields/RepoUrlPicker/GitlabRepoPicker.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 React from 'react';\nimport FormControl from '@material-ui/core/FormControl';\nimport FormHelperText from '@material-ui/core/FormHelperText';\nimport Input from '@material-ui/core/Input';\nimport InputLabel from '@material-ui/core/InputLabel';\nimport { Select, SelectItem } from '@backstage/core-components';\nimport { RepoUrlPickerState } from './types';\n\nexport const GitlabRepoPicker = (props: {\n allowedOwners?: string[];\n allowedRepos?: string[];\n state: RepoUrlPickerState;\n onChange: (state: RepoUrlPickerState) => void;\n rawErrors: string[];\n}) => {\n const { allowedOwners = [], state, onChange, rawErrors } = props;\n const ownerItems: SelectItem[] = allowedOwners\n ? allowedOwners.map(i => ({ label: i, value: i }))\n : [{ label: 'Loading...', value: 'loading' }];\n\n const { owner } = state;\n\n return (\n <>\n <FormControl\n margin=\"normal\"\n required\n error={rawErrors?.length > 0 && !owner}\n >\n {allowedOwners?.length ? (\n <Select\n native\n label=\"Owner Available\"\n onChange={selected =>\n onChange({\n owner: String(Array.isArray(selected) ? selected[0] : selected),\n })\n }\n disabled={allowedOwners.length === 1}\n selected={owner}\n items={ownerItems}\n />\n ) : (\n <>\n <InputLabel htmlFor=\"ownerInput\">Owner</InputLabel>\n <Input\n id=\"ownerInput\"\n onChange={e => onChange({ owner: e.target.value })}\n value={owner}\n />\n </>\n )}\n <FormHelperText>\n GitLab namespace where this repository will belong to. It can be the\n name of organization, group, subgroup, user, or the project.\n </FormHelperText>\n </FormControl>\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;AAuBa,MAAA,gBAAA,GAAmB,CAAC,KAM3B,KAAA;AACJ,EAAA,MAAM,EAAE,aAAgB,GAAA,IAAI,KAAO,EAAA,QAAA,EAAU,WAAc,GAAA,KAAA,CAAA;AAC3D,EAAA,MAAM,aAA2B,aAC7B,GAAA,aAAA,CAAc,IAAI,CAAM,CAAA,MAAA,EAAE,OAAO,CAAG,EAAA,KAAA,EAAO,CAAE,EAAA,CAAE,IAC/C,CAAC,EAAE,OAAO,YAAc,EAAA,KAAA,EAAO,WAAW,CAAA,CAAA;AAE9C,EAAM,MAAA,EAAE,OAAU,GAAA,KAAA,CAAA;AAElB,EAAA,uBAEI,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,WAAA;AAAA,IAAA;AAAA,MACC,MAAO,EAAA,QAAA;AAAA,MACP,QAAQ,EAAA,IAAA;AAAA,MACR,KAAO,EAAA,CAAA,SAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,SAAA,CAAW,MAAS,IAAA,CAAA,IAAK,CAAC,KAAA;AAAA,KAAA;AAAA,IAAA,CAEhC,+CAAe,MACd,oBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,MAAA;AAAA,MAAA;AAAA,QACC,MAAM,EAAA,IAAA;AAAA,QACN,KAAM,EAAA,iBAAA;AAAA,QACN,QAAA,EAAU,cACR,QAAS,CAAA;AAAA,UACP,KAAA,EAAO,OAAO,KAAM,CAAA,OAAA,CAAQ,QAAQ,CAAI,GAAA,QAAA,CAAS,CAAC,CAAA,GAAI,QAAQ,CAAA;AAAA,SAC/D,CAAA;AAAA,QAEH,QAAA,EAAU,cAAc,MAAW,KAAA,CAAA;AAAA,QACnC,QAAU,EAAA,KAAA;AAAA,QACV,KAAO,EAAA,UAAA;AAAA,OAAA;AAAA,wBAIP,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,cAAW,OAAQ,EAAA,YAAA,EAAA,EAAa,OAAK,CACtC,kBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,EAAG,EAAA,YAAA;AAAA,QACH,QAAA,EAAU,OAAK,QAAS,CAAA,EAAE,OAAO,CAAE,CAAA,MAAA,CAAO,OAAO,CAAA;AAAA,QACjD,KAAO,EAAA,KAAA;AAAA,OAAA;AAAA,KAEX,CAAA;AAAA,oBAEF,KAAA,CAAA,aAAA,CAAC,sBAAe,mIAGhB,CAAA;AAAA,GAEJ,CAAA,CAAA;AAEJ;;;;"}
@@ -0,0 +1,200 @@
1
+ import { useApi } from '@backstage/core-plugin-api';
2
+ import { scmIntegrationsApiRef, scmAuthApiRef } from '@backstage/integration-react';
3
+ import React, { useState, useMemo, useEffect, useCallback } from 'react';
4
+ import { GithubRepoPicker } from './GithubRepoPicker.esm.js';
5
+ import { GiteaRepoPicker } from './GiteaRepoPicker.esm.js';
6
+ import { GitlabRepoPicker } from './GitlabRepoPicker.esm.js';
7
+ import { AzureRepoPicker } from './AzureRepoPicker.esm.js';
8
+ import { BitbucketRepoPicker } from './BitbucketRepoPicker.esm.js';
9
+ import { GerritRepoPicker } from './GerritRepoPicker.esm.js';
10
+ import { RepoUrlPickerHost } from './RepoUrlPickerHost.esm.js';
11
+ import { RepoUrlPickerRepoName } from './RepoUrlPickerRepoName.esm.js';
12
+ import { parseRepoPickerUrl, serializeRepoPickerUrl } from './utils.esm.js';
13
+ import useDebounce from 'react-use/esm/useDebounce';
14
+ import { useTemplateSecrets } from '@backstage/plugin-scaffolder-react';
15
+ import Box from '@material-ui/core/Box';
16
+ import Divider from '@material-ui/core/Divider';
17
+ import Typography from '@material-ui/core/Typography';
18
+ export { RepoUrlPickerSchema } from './schema.esm.js';
19
+
20
+ const RepoUrlPicker = (props) => {
21
+ var _a, _b;
22
+ const { uiSchema, onChange, rawErrors, formData, schema } = props;
23
+ const [state, setState] = useState(
24
+ parseRepoPickerUrl(formData)
25
+ );
26
+ const integrationApi = useApi(scmIntegrationsApiRef);
27
+ const scmAuthApi = useApi(scmAuthApiRef);
28
+ const { secrets, setSecrets } = useTemplateSecrets();
29
+ const allowedHosts = useMemo(
30
+ () => {
31
+ var _a2, _b2;
32
+ return (_b2 = (_a2 = uiSchema == null ? void 0 : uiSchema["ui:options"]) == null ? void 0 : _a2.allowedHosts) != null ? _b2 : [];
33
+ },
34
+ [uiSchema]
35
+ );
36
+ const allowedOrganizations = useMemo(
37
+ () => {
38
+ var _a2, _b2;
39
+ return (_b2 = (_a2 = uiSchema == null ? void 0 : uiSchema["ui:options"]) == null ? void 0 : _a2.allowedOrganizations) != null ? _b2 : [];
40
+ },
41
+ [uiSchema]
42
+ );
43
+ const allowedOwners = useMemo(
44
+ () => {
45
+ var _a2, _b2;
46
+ return (_b2 = (_a2 = uiSchema == null ? void 0 : uiSchema["ui:options"]) == null ? void 0 : _a2.allowedOwners) != null ? _b2 : [];
47
+ },
48
+ [uiSchema]
49
+ );
50
+ const allowedProjects = useMemo(
51
+ () => {
52
+ var _a2, _b2;
53
+ return (_b2 = (_a2 = uiSchema == null ? void 0 : uiSchema["ui:options"]) == null ? void 0 : _a2.allowedProjects) != null ? _b2 : [];
54
+ },
55
+ [uiSchema]
56
+ );
57
+ const allowedRepos = useMemo(
58
+ () => {
59
+ var _a2, _b2;
60
+ return (_b2 = (_a2 = uiSchema == null ? void 0 : uiSchema["ui:options"]) == null ? void 0 : _a2.allowedRepos) != null ? _b2 : [];
61
+ },
62
+ [uiSchema]
63
+ );
64
+ const { owner, organization, project, repoName } = state;
65
+ useEffect(() => {
66
+ onChange(serializeRepoPickerUrl(state));
67
+ }, [state, onChange]);
68
+ useEffect(() => {
69
+ if (allowedOrganizations.length > 0 && !organization) {
70
+ setState((prevState) => ({
71
+ ...prevState,
72
+ organization: allowedOrganizations[0]
73
+ }));
74
+ }
75
+ }, [setState, allowedOrganizations, organization]);
76
+ useEffect(() => {
77
+ if (allowedOwners.length > 0 && !owner) {
78
+ setState((prevState) => ({
79
+ ...prevState,
80
+ owner: allowedOwners[0]
81
+ }));
82
+ }
83
+ }, [setState, allowedOwners, owner]);
84
+ useEffect(() => {
85
+ if (allowedProjects.length > 0 && !project) {
86
+ setState((prevState) => ({
87
+ ...prevState,
88
+ project: allowedProjects[0]
89
+ }));
90
+ }
91
+ }, [setState, allowedProjects, project]);
92
+ useEffect(() => {
93
+ if (allowedRepos.length > 0 && !repoName) {
94
+ setState((prevState) => ({ ...prevState, repoName: allowedRepos[0] }));
95
+ }
96
+ }, [setState, allowedRepos, repoName]);
97
+ const updateLocalState = useCallback(
98
+ (newState) => {
99
+ setState((prevState) => ({ ...prevState, ...newState }));
100
+ },
101
+ [setState]
102
+ );
103
+ useDebounce(
104
+ async () => {
105
+ var _a2;
106
+ const { requestUserCredentials } = (_a2 = uiSchema == null ? void 0 : uiSchema["ui:options"]) != null ? _a2 : {};
107
+ const workspace = state.owner ? state.owner : state.project;
108
+ if (!requestUserCredentials || !(state.host && workspace && state.repoName)) {
109
+ return;
110
+ }
111
+ if (secrets[requestUserCredentials.secretsKey]) {
112
+ return;
113
+ }
114
+ const [encodedHost, encodedRepoName] = [state.host, state.repoName].map(
115
+ encodeURIComponent
116
+ );
117
+ const { token } = await scmAuthApi.getCredentials({
118
+ url: `https://${encodedHost}/${workspace}/${encodedRepoName}`,
119
+ additionalScope: {
120
+ repoWrite: true,
121
+ customScopes: requestUserCredentials.additionalScopes
122
+ }
123
+ });
124
+ setSecrets({ [requestUserCredentials.secretsKey]: token });
125
+ },
126
+ 500,
127
+ [state, uiSchema]
128
+ );
129
+ const hostType = (_b = state.host && ((_a = integrationApi.byHost(state.host)) == null ? void 0 : _a.type)) != null ? _b : null;
130
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, schema.title && /* @__PURE__ */ React.createElement(Box, { my: 1 }, /* @__PURE__ */ React.createElement(Typography, { variant: "h5" }, schema.title), /* @__PURE__ */ React.createElement(Divider, null)), schema.description && /* @__PURE__ */ React.createElement(Typography, { variant: "body1" }, schema.description), /* @__PURE__ */ React.createElement(
131
+ RepoUrlPickerHost,
132
+ {
133
+ host: state.host,
134
+ hosts: allowedHosts,
135
+ onChange: (host) => setState((prevState) => ({ ...prevState, host })),
136
+ rawErrors
137
+ }
138
+ ), hostType === "github" && /* @__PURE__ */ React.createElement(
139
+ GithubRepoPicker,
140
+ {
141
+ allowedOwners,
142
+ onChange: updateLocalState,
143
+ rawErrors,
144
+ state
145
+ }
146
+ ), hostType === "gitea" && /* @__PURE__ */ React.createElement(
147
+ GiteaRepoPicker,
148
+ {
149
+ allowedOwners,
150
+ allowedRepos,
151
+ rawErrors,
152
+ state,
153
+ onChange: updateLocalState
154
+ }
155
+ ), hostType === "gitlab" && /* @__PURE__ */ React.createElement(
156
+ GitlabRepoPicker,
157
+ {
158
+ allowedOwners,
159
+ rawErrors,
160
+ state,
161
+ onChange: updateLocalState
162
+ }
163
+ ), hostType === "bitbucket" && /* @__PURE__ */ React.createElement(
164
+ BitbucketRepoPicker,
165
+ {
166
+ allowedOwners,
167
+ allowedProjects,
168
+ rawErrors,
169
+ state,
170
+ onChange: updateLocalState
171
+ }
172
+ ), hostType === "azure" && /* @__PURE__ */ React.createElement(
173
+ AzureRepoPicker,
174
+ {
175
+ allowedOrganizations,
176
+ allowedOwners,
177
+ rawErrors,
178
+ state,
179
+ onChange: updateLocalState
180
+ }
181
+ ), hostType === "gerrit" && /* @__PURE__ */ React.createElement(
182
+ GerritRepoPicker,
183
+ {
184
+ rawErrors,
185
+ state,
186
+ onChange: updateLocalState
187
+ }
188
+ ), /* @__PURE__ */ React.createElement(
189
+ RepoUrlPickerRepoName,
190
+ {
191
+ repoName: state.repoName,
192
+ allowedRepos,
193
+ onChange: (repo) => setState((prevState) => ({ ...prevState, repoName: repo })),
194
+ rawErrors
195
+ }
196
+ ));
197
+ };
198
+
199
+ export { RepoUrlPicker };
200
+ //# sourceMappingURL=RepoUrlPicker.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RepoUrlPicker.esm.js","sources":["../../../../src/components/fields/RepoUrlPicker/RepoUrlPicker.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 { useApi } from '@backstage/core-plugin-api';\nimport {\n scmIntegrationsApiRef,\n scmAuthApiRef,\n} from '@backstage/integration-react';\nimport React, { useEffect, useState, useMemo, useCallback } from 'react';\nimport { GithubRepoPicker } from './GithubRepoPicker';\nimport { GiteaRepoPicker } from './GiteaRepoPicker';\nimport { GitlabRepoPicker } from './GitlabRepoPicker';\nimport { AzureRepoPicker } from './AzureRepoPicker';\nimport { BitbucketRepoPicker } from './BitbucketRepoPicker';\nimport { GerritRepoPicker } from './GerritRepoPicker';\nimport { RepoUrlPickerHost } from './RepoUrlPickerHost';\nimport { RepoUrlPickerRepoName } from './RepoUrlPickerRepoName';\nimport { parseRepoPickerUrl, serializeRepoPickerUrl } from './utils';\nimport { RepoUrlPickerProps } from './schema';\nimport { RepoUrlPickerState } from './types';\nimport useDebounce from 'react-use/esm/useDebounce';\nimport { useTemplateSecrets } from '@backstage/plugin-scaffolder-react';\nimport Box from '@material-ui/core/Box';\nimport Divider from '@material-ui/core/Divider';\nimport Typography from '@material-ui/core/Typography';\n\nexport { RepoUrlPickerSchema } from './schema';\n\n/**\n * The underlying component that is rendered in the form for the `RepoUrlPicker`\n * field extension.\n *\n * @public\n */\nexport const RepoUrlPicker = (props: RepoUrlPickerProps) => {\n const { uiSchema, onChange, rawErrors, formData, schema } = props;\n const [state, setState] = useState<RepoUrlPickerState>(\n parseRepoPickerUrl(formData),\n );\n const integrationApi = useApi(scmIntegrationsApiRef);\n const scmAuthApi = useApi(scmAuthApiRef);\n const { secrets, setSecrets } = useTemplateSecrets();\n const allowedHosts = useMemo(\n () => uiSchema?.['ui:options']?.allowedHosts ?? [],\n [uiSchema],\n );\n const allowedOrganizations = useMemo(\n () => uiSchema?.['ui:options']?.allowedOrganizations ?? [],\n [uiSchema],\n );\n const allowedOwners = useMemo(\n () => uiSchema?.['ui:options']?.allowedOwners ?? [],\n [uiSchema],\n );\n const allowedProjects = useMemo(\n () => uiSchema?.['ui:options']?.allowedProjects ?? [],\n [uiSchema],\n );\n const allowedRepos = useMemo(\n () => uiSchema?.['ui:options']?.allowedRepos ?? [],\n [uiSchema],\n );\n\n const { owner, organization, project, repoName } = state;\n\n useEffect(() => {\n onChange(serializeRepoPickerUrl(state));\n }, [state, onChange]);\n\n /* we deal with calling the repo setting here instead of in each components for ease */\n useEffect(() => {\n if (allowedOrganizations.length > 0 && !organization) {\n setState(prevState => ({\n ...prevState,\n organization: allowedOrganizations[0],\n }));\n }\n }, [setState, allowedOrganizations, organization]);\n\n useEffect(() => {\n if (allowedOwners.length > 0 && !owner) {\n setState(prevState => ({\n ...prevState,\n owner: allowedOwners[0],\n }));\n }\n }, [setState, allowedOwners, owner]);\n\n useEffect(() => {\n if (allowedProjects.length > 0 && !project) {\n setState(prevState => ({\n ...prevState,\n project: allowedProjects[0],\n }));\n }\n }, [setState, allowedProjects, project]);\n\n useEffect(() => {\n if (allowedRepos.length > 0 && !repoName) {\n setState(prevState => ({ ...prevState, repoName: allowedRepos[0] }));\n }\n }, [setState, allowedRepos, repoName]);\n\n const updateLocalState = useCallback(\n (newState: RepoUrlPickerState) => {\n setState(prevState => ({ ...prevState, ...newState }));\n },\n [setState],\n );\n\n useDebounce(\n async () => {\n const { requestUserCredentials } = uiSchema?.['ui:options'] ?? {};\n\n const workspace = state.owner ? state.owner : state.project;\n if (\n !requestUserCredentials ||\n !(state.host && workspace && state.repoName)\n ) {\n return;\n }\n\n // don't show login prompt if secret value is already in state\n if (secrets[requestUserCredentials.secretsKey]) {\n return;\n }\n\n // previously, we were encodeURI for state.host, workspace and state.repoName separately.\n // That created an issue where GitLab workspace can be nested like groupA/subgroupB\n // when we encodeURi separately and then join, the URL will be malformed and\n // resulting in 400 request error from GitLab API\n const [encodedHost, encodedRepoName] = [state.host, state.repoName].map(\n encodeURIComponent,\n );\n\n // user has requested that we use the users credentials\n // so lets grab them using the scmAuthApi and pass through\n // any additional scopes from the ui:options\n const { token } = await scmAuthApi.getCredentials({\n url: `https://${encodedHost}/${workspace}/${encodedRepoName}`,\n additionalScope: {\n repoWrite: true,\n customScopes: requestUserCredentials.additionalScopes,\n },\n });\n\n // set the secret using the key provided in the ui:options for use\n // in the templating the manifest with ${{ secrets[secretsKey] }}\n setSecrets({ [requestUserCredentials.secretsKey]: token });\n },\n 500,\n [state, uiSchema],\n );\n\n const hostType =\n (state.host && integrationApi.byHost(state.host)?.type) ?? null;\n return (\n <>\n {schema.title && (\n <Box my={1}>\n <Typography variant=\"h5\">{schema.title}</Typography>\n <Divider />\n </Box>\n )}\n {schema.description && (\n <Typography variant=\"body1\">{schema.description}</Typography>\n )}\n <RepoUrlPickerHost\n host={state.host}\n hosts={allowedHosts}\n onChange={host => setState(prevState => ({ ...prevState, host }))}\n rawErrors={rawErrors}\n />\n {hostType === 'github' && (\n <GithubRepoPicker\n allowedOwners={allowedOwners}\n onChange={updateLocalState}\n rawErrors={rawErrors}\n state={state}\n />\n )}\n {hostType === 'gitea' && (\n <GiteaRepoPicker\n allowedOwners={allowedOwners}\n allowedRepos={allowedRepos}\n rawErrors={rawErrors}\n state={state}\n onChange={updateLocalState}\n />\n )}\n {hostType === 'gitlab' && (\n <GitlabRepoPicker\n allowedOwners={allowedOwners}\n rawErrors={rawErrors}\n state={state}\n onChange={updateLocalState}\n />\n )}\n {hostType === 'bitbucket' && (\n <BitbucketRepoPicker\n allowedOwners={allowedOwners}\n allowedProjects={allowedProjects}\n rawErrors={rawErrors}\n state={state}\n onChange={updateLocalState}\n />\n )}\n {hostType === 'azure' && (\n <AzureRepoPicker\n allowedOrganizations={allowedOrganizations}\n allowedOwners={allowedOwners}\n rawErrors={rawErrors}\n state={state}\n onChange={updateLocalState}\n />\n )}\n {hostType === 'gerrit' && (\n <GerritRepoPicker\n rawErrors={rawErrors}\n state={state}\n onChange={updateLocalState}\n />\n )}\n <RepoUrlPickerRepoName\n repoName={state.repoName}\n allowedRepos={allowedRepos}\n onChange={repo =>\n setState(prevState => ({ ...prevState, repoName: repo }))\n }\n rawErrors={rawErrors}\n />\n </>\n );\n};\n"],"names":["_a","_b"],"mappings":";;;;;;;;;;;;;;;;;;;AA8Ca,MAAA,aAAA,GAAgB,CAAC,KAA8B,KAAA;AA9C5D,EAAA,IAAA,EAAA,EAAA,EAAA,CAAA;AA+CE,EAAA,MAAM,EAAE,QAAU,EAAA,QAAA,EAAU,SAAW,EAAA,QAAA,EAAU,QAAW,GAAA,KAAA,CAAA;AAC5D,EAAM,MAAA,CAAC,KAAO,EAAA,QAAQ,CAAI,GAAA,QAAA;AAAA,IACxB,mBAAmB,QAAQ,CAAA;AAAA,GAC7B,CAAA;AACA,EAAM,MAAA,cAAA,GAAiB,OAAO,qBAAqB,CAAA,CAAA;AACnD,EAAM,MAAA,UAAA,GAAa,OAAO,aAAa,CAAA,CAAA;AACvC,EAAA,MAAM,EA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