Add ConfigurationAdapterBase and extension points for trash bin

Adds the new abstract class ConfigurationAdapterBase to simplify the creation of global configuration views. In addition there is some cleanup, interfaces and extension points for the repository trash bin plugin.

Committed-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
Co-authored-by: Konstantin Schaper <konstantin.schaper@cloudogu.com>
This commit is contained in:
Eduard Heimbuch
2023-01-12 14:01:04 +01:00
parent 5c4c759bd2
commit ac419daa3f
34 changed files with 879 additions and 84 deletions

View File

@@ -29,6 +29,7 @@ import RenameRepository from "./RenameRepository";
import DeleteRepo from "./DeleteRepo";
import ArchiveRepo from "./ArchiveRepo";
import UnarchiveRepo from "./UnarchiveRepo";
import { ExtensionPoint, extensionPoints, useBinder } from "@scm-manager/ui-extensions";
type Props = {
repository: Repository;
@@ -36,12 +37,18 @@ type Props = {
const RepositoryDangerZone: FC<Props> = ({ repository }) => {
const [t] = useTranslation("repos");
const binder = useBinder();
const dangerZone = [];
if (repository?._links?.rename || repository?._links?.renameWithNamespace) {
dangerZone.push(<RenameRepository repository={repository} />);
}
if (repository?._links?.delete) {
if (binder.hasExtension<extensionPoints.RepositoryDeleteButton>("repository.deleteButton", { repository })) {
dangerZone.push(
<ExtensionPoint<extensionPoints.RepositoryDeleteButton> name="repository.deleteButton" props={{ repository }} />
);
} else if (repository?._links?.delete) {
dangerZone.push(<DeleteRepo repository={repository} />);
}
if (repository?._links?.archive) {