2021-05-14 09:15:35 +02:00
|
|
|
/*
|
|
|
|
|
* MIT License
|
|
|
|
|
*
|
|
|
|
|
* Copyright (c) 2020-present Cloudogu GmbH and Contributors
|
|
|
|
|
*
|
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
|
* of this software and associated documentation files (the "Software"), to deal
|
|
|
|
|
* in the Software without restriction, including without limitation the rights
|
|
|
|
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
|
* copies of the Software, and to permit persons to whom the Software is
|
|
|
|
|
* furnished to do so, subject to the following conditions:
|
|
|
|
|
*
|
|
|
|
|
* The above copyright notice and this permission notice shall be included in all
|
|
|
|
|
* copies or substantial portions of the Software.
|
|
|
|
|
*
|
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
|
|
* SOFTWARE.
|
|
|
|
|
*/
|
|
|
|
|
|
2021-07-13 11:40:49 +02:00
|
|
|
import React from "react";
|
2021-05-14 09:15:35 +02:00
|
|
|
import {
|
2021-09-30 16:41:04 +02:00
|
|
|
File,
|
2021-07-13 11:40:49 +02:00
|
|
|
Branch,
|
2021-05-14 09:15:35 +02:00
|
|
|
IndexResources,
|
2021-07-28 14:28:33 +02:00
|
|
|
Links,
|
2021-05-14 09:15:35 +02:00
|
|
|
NamespaceStrategies,
|
2021-06-04 14:05:47 +02:00
|
|
|
Repository,
|
2021-05-14 09:15:35 +02:00
|
|
|
RepositoryCreation,
|
2021-06-04 14:05:47 +02:00
|
|
|
RepositoryTypeCollection,
|
2021-05-14 09:15:35 +02:00
|
|
|
} from "@scm-manager/ui-types";
|
2021-07-13 11:40:49 +02:00
|
|
|
import { ExtensionPointDefinition } from "./binder";
|
2021-05-14 09:15:35 +02:00
|
|
|
|
|
|
|
|
type RepositoryCreatorSubFormProps = {
|
|
|
|
|
repository: RepositoryCreation;
|
|
|
|
|
onChange: (repository: RepositoryCreation) => void;
|
|
|
|
|
setValid: (valid: boolean) => void;
|
|
|
|
|
disabled?: boolean;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export type RepositoryCreatorComponentProps = {
|
|
|
|
|
namespaceStrategies: NamespaceStrategies;
|
|
|
|
|
repositoryTypes: RepositoryTypeCollection;
|
|
|
|
|
index: IndexResources;
|
|
|
|
|
|
|
|
|
|
nameForm: React.ComponentType<RepositoryCreatorSubFormProps>;
|
|
|
|
|
informationForm: React.ComponentType<RepositoryCreatorSubFormProps>;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export type RepositoryCreatorExtension = {
|
|
|
|
|
subtitle: string;
|
|
|
|
|
path: string;
|
|
|
|
|
icon: string;
|
|
|
|
|
label: string;
|
|
|
|
|
component: React.ComponentType<RepositoryCreatorComponentProps>;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export type RepositoryCreator = ExtensionPointDefinition<"repos.creator", RepositoryCreatorExtension>;
|
2021-06-04 14:05:47 +02:00
|
|
|
|
|
|
|
|
export type RepositoryFlags = ExtensionPointDefinition<"repository.flags", { repository: Repository }>;
|
2021-07-13 11:40:49 +02:00
|
|
|
|
|
|
|
|
export type ReposSourcesActionbarExtensionProps = {
|
|
|
|
|
baseUrl: string;
|
|
|
|
|
revision: string;
|
|
|
|
|
branch: Branch | undefined;
|
|
|
|
|
path: string;
|
|
|
|
|
sources: File;
|
|
|
|
|
repository: Repository;
|
|
|
|
|
};
|
|
|
|
|
export type ReposSourcesActionbarExtension = React.ComponentType<ReposSourcesActionbarExtensionProps>;
|
|
|
|
|
export type ReposSourcesActionbar = ExtensionPointDefinition<"repos.sources.actionbar", ReposSourcesActionbarExtension>;
|
|
|
|
|
|
|
|
|
|
export type ReposSourcesEmptyActionbarExtensionProps = {
|
|
|
|
|
sources: File;
|
|
|
|
|
repository: Repository;
|
|
|
|
|
};
|
|
|
|
|
export type ReposSourcesEmptyActionbarExtension = ReposSourcesActionbarExtension;
|
|
|
|
|
export type ReposSourcesEmptyActionbar = ExtensionPointDefinition<
|
|
|
|
|
"repos.sources.empty.actionbar",
|
|
|
|
|
ReposSourcesEmptyActionbarExtension
|
|
|
|
|
>;
|
2021-07-28 14:28:33 +02:00
|
|
|
|
2021-09-30 16:41:04 +02:00
|
|
|
export type ReposSourcesTreeWrapperProps = {
|
|
|
|
|
repository: Repository;
|
|
|
|
|
directory: File;
|
|
|
|
|
baseUrl: string;
|
|
|
|
|
revision: string;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export type ReposSourcesTreeWrapperExtension = ExtensionPointDefinition<
|
|
|
|
|
"repos.source.tree.wrapper",
|
|
|
|
|
React.ComponentType<ReposSourcesTreeWrapperProps>
|
|
|
|
|
>;
|
|
|
|
|
|
|
|
|
|
export type ReposSourcesTreeRowProps = {
|
|
|
|
|
file: File;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export type ReposSourcesTreeRowRightExtension = ExtensionPointDefinition<
|
|
|
|
|
"repos.sources.tree.row.right",
|
|
|
|
|
React.ComponentType<ReposSourcesTreeRowProps>
|
|
|
|
|
>;
|
|
|
|
|
export type ReposSourcesTreeRowAfterExtension = ExtensionPointDefinition<
|
|
|
|
|
"repos.sources.tree.row.after",
|
|
|
|
|
React.ComponentType<ReposSourcesTreeRowProps>
|
|
|
|
|
>;
|
|
|
|
|
|
2021-07-28 14:28:33 +02:00
|
|
|
export type PrimaryNavigationLoginButtonProps = {
|
|
|
|
|
links: Links;
|
|
|
|
|
label: string;
|
|
|
|
|
loginUrl: string;
|
|
|
|
|
from: string;
|
|
|
|
|
to: string;
|
|
|
|
|
className: string;
|
|
|
|
|
content: React.ReactNode;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export type PrimaryNavigationLoginButtonExtension = ExtensionPointDefinition<
|
|
|
|
|
"primary-navigation.login",
|
|
|
|
|
PrimaryNavigationLoginButtonProps
|
|
|
|
|
>;
|
|
|
|
|
|
|
|
|
|
export type PrimaryNavigationLogoutButtonProps = {
|
|
|
|
|
links: Links;
|
|
|
|
|
label: string;
|
|
|
|
|
className: string;
|
|
|
|
|
content: React.ReactNode;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export type PrimaryNavigationLogoutButtonExtension = ExtensionPointDefinition<
|
|
|
|
|
"primary-navigation.logout",
|
|
|
|
|
PrimaryNavigationLogoutButtonProps
|
|
|
|
|
>;
|
2021-10-19 09:31:40 +02:00
|
|
|
|
|
|
|
|
export type RepositoryOverviewTopExtensionProps = {
|
|
|
|
|
page: number;
|
|
|
|
|
search: string;
|
|
|
|
|
namespace?: string;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export type RepositoryOverviewTopExtension = ExtensionPointDefinition<
|
|
|
|
|
"repository.overview.top",
|
|
|
|
|
React.ComponentType<RepositoryOverviewTopExtensionProps>,
|
|
|
|
|
RepositoryOverviewTopExtensionProps
|
|
|
|
|
>;
|
|
|
|
|
export type RepositoryOverviewLeftExtension = ExtensionPointDefinition<"repository.overview.left", React.ComponentType>;
|
|
|
|
|
export type RepositoryOverviewTitleExtension = ExtensionPointDefinition<
|
|
|
|
|
"repository.overview.title",
|
|
|
|
|
React.ComponentType
|
|
|
|
|
>;
|
|
|
|
|
export type RepositoryOverviewSubtitleExtension = ExtensionPointDefinition<
|
|
|
|
|
"repository.overview.subtitle",
|
|
|
|
|
React.ComponentType
|
|
|
|
|
>;
|