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