mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-09 23:15:43 +01:00
enhance NamespaceStrategy API / improve frontend validation and use namespace extension point in RenameRepository component
This commit is contained in:
@@ -25,17 +25,19 @@ import React from "react";
|
||||
import { connect } from "react-redux";
|
||||
import { withRouter } from "react-router-dom";
|
||||
import RepositoryForm from "../components/form";
|
||||
import { Repository } from "@scm-manager/ui-types";
|
||||
import { Repository, Links } from "@scm-manager/ui-types";
|
||||
import { getModifyRepoFailure, isModifyRepoPending, modifyRepo, modifyRepoReset } from "../modules/repos";
|
||||
import { History } from "history";
|
||||
import { ErrorNotification } from "@scm-manager/ui-components";
|
||||
import { ExtensionPoint } from "@scm-manager/ui-extensions";
|
||||
import { compose } from "redux";
|
||||
import DangerZone from "./DangerZone";
|
||||
import { getLinks } from "../../modules/indexResource";
|
||||
|
||||
type Props = {
|
||||
loading: boolean;
|
||||
error: Error;
|
||||
indexLinks: Links;
|
||||
|
||||
modifyRepo: (p1: Repository, p2: () => void) => void;
|
||||
modifyRepoReset: (p: Repository) => void;
|
||||
@@ -69,7 +71,7 @@ class EditRepo extends React.Component<Props> {
|
||||
};
|
||||
|
||||
render() {
|
||||
const { loading, error, repository } = this.props;
|
||||
const { loading, error, repository, indexLinks } = this.props;
|
||||
|
||||
const url = this.matchedUrl();
|
||||
|
||||
@@ -89,7 +91,7 @@ class EditRepo extends React.Component<Props> {
|
||||
}}
|
||||
/>
|
||||
<ExtensionPoint name="repo-config.route" props={extensionProps} renderAll={true} />
|
||||
<DangerZone repository={repository} />
|
||||
<DangerZone repository={repository} indexLinks={indexLinks} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -99,9 +101,12 @@ const mapStateToProps = (state: any, ownProps: Props) => {
|
||||
const { namespace, name } = ownProps.repository;
|
||||
const loading = isModifyRepoPending(state, namespace, name);
|
||||
const error = getModifyRepoFailure(state, namespace, name);
|
||||
const indexLinks = getLinks(state);
|
||||
|
||||
return {
|
||||
loading,
|
||||
error
|
||||
error,
|
||||
indexLinks
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user