mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-14 17:26:22 +01:00
add indexResources to extensionProps
This commit is contained in:
@@ -33,7 +33,7 @@ export { default as Checkbox } from "./Checkbox";
|
||||
export { default as Radio } from "./Radio";
|
||||
export { default as FilterInput } from "./FilterInput";
|
||||
export { default as InputField } from "./InputField";
|
||||
export { default as Select } from "./Select";
|
||||
export { default as Select, SelectItem } from "./Select";
|
||||
export { default as Textarea } from "./Textarea";
|
||||
export { default as PasswordConfirmation } from "./PasswordConfirmation";
|
||||
export { default as LabelWithHelpIcon } from "./LabelWithHelpIcon";
|
||||
|
||||
@@ -50,6 +50,7 @@ type Props = WithTranslation & {
|
||||
repositoryTypes?: RepositoryType[];
|
||||
namespaceStrategy?: string;
|
||||
loading?: boolean;
|
||||
indexResources: any;
|
||||
};
|
||||
|
||||
type State = {
|
||||
@@ -221,11 +222,12 @@ class RepositoryForm extends React.Component<Props, State> {
|
||||
if (!this.isCreateMode()) {
|
||||
return null;
|
||||
}
|
||||
const { repositoryTypes, t } = this.props;
|
||||
const { repositoryTypes, indexResources, t } = this.props;
|
||||
const repository = this.state.repository;
|
||||
const extensionProps = {
|
||||
repository,
|
||||
setCreationContextEntry: this.setCreationContextEntry
|
||||
setCreationContextEntry: this.setCreationContextEntry,
|
||||
indexResources
|
||||
};
|
||||
return (
|
||||
<>
|
||||
@@ -255,11 +257,11 @@ class RepositoryForm extends React.Component<Props, State> {
|
||||
onChange={this.toggleInitCheckbox}
|
||||
helpText={t("help.initializeRepository")}
|
||||
/>
|
||||
</CheckboxWrapper>
|
||||
</SpaceBetween>
|
||||
{this.state.initRepository && (
|
||||
<ExtensionPoint name="repos.create.initialize" props={extensionProps} renderAll={false} />
|
||||
)}
|
||||
</CheckboxWrapper>
|
||||
</SpaceBetween>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -50,6 +50,7 @@ type Props = WithTranslation & {
|
||||
createLoading: boolean;
|
||||
error: Error;
|
||||
repoLink: string;
|
||||
indexResources: any;
|
||||
|
||||
// dispatch functions
|
||||
fetchNamespaceStrategiesIfNeeded: () => void;
|
||||
@@ -81,7 +82,7 @@ class Create extends React.Component<Props> {
|
||||
};
|
||||
|
||||
render() {
|
||||
const { pageLoading, createLoading, repositoryTypes, namespaceStrategies, createRepo, error } = this.props;
|
||||
const { pageLoading, createLoading, repositoryTypes, namespaceStrategies, createRepo, error, indexResources } = this.props;
|
||||
|
||||
const { t, repoLink } = this.props;
|
||||
return (
|
||||
@@ -99,6 +100,7 @@ class Create extends React.Component<Props> {
|
||||
submitForm={(repo, initRepository) => {
|
||||
createRepo(repoLink, repo, initRepository, (repo: Repository) => this.repoCreated(repo));
|
||||
}}
|
||||
indexResources={indexResources}
|
||||
/>
|
||||
</Page>
|
||||
);
|
||||
@@ -113,13 +115,16 @@ const mapStateToProps = (state: any) => {
|
||||
const error =
|
||||
getFetchRepositoryTypesFailure(state) || getCreateRepoFailure(state) || getFetchNamespaceStrategiesFailure(state);
|
||||
const repoLink = getRepositoriesLink(state);
|
||||
const indexResources = state?.indexResources;
|
||||
|
||||
return {
|
||||
repositoryTypes,
|
||||
namespaceStrategies,
|
||||
pageLoading,
|
||||
createLoading,
|
||||
error,
|
||||
repoLink
|
||||
repoLink,
|
||||
indexResources
|
||||
};
|
||||
};
|
||||
|
||||
@@ -131,7 +136,7 @@ const mapDispatchToProps = (dispatch: any) => {
|
||||
fetchNamespaceStrategiesIfNeeded: () => {
|
||||
dispatch(fetchNamespaceStrategiesIfNeeded());
|
||||
},
|
||||
createRepo: (link: string, repository: Repository, initRepository: boolean, callback: () => void) => {
|
||||
createRepo: (link: string, repository: RepositoryCreation, initRepository: boolean, callback: () => void) => {
|
||||
dispatch(createRepo(link, repository, initRepository, callback));
|
||||
},
|
||||
resetForm: () => {
|
||||
|
||||
Reference in New Issue
Block a user