scm-ui: new repository layout

This commit is contained in:
Sebastian Sdorra
2019-10-07 10:57:09 +02:00
parent 09c7def874
commit c05798e254
417 changed files with 3620 additions and 52971 deletions

View File

@@ -0,0 +1,7 @@
// @flow
export type Action = {
type: string,
payload?: any,
itemId?: string | number,
resetPending?: boolean
};

View File

@@ -0,0 +1,10 @@
// @flow
export type AutocompleteObject = {
id: string,
displayName: string
};
export type SelectValue = {
value: AutocompleteObject,
label: string
};

View File

@@ -0,0 +1,14 @@
//@flow
import type {Links} from "./hal";
export type Branch = {
name: string,
revision: string,
defaultBranch?: boolean,
_links: Links
}
export type BranchRequest = {
name: string,
parent: string
}

View File

@@ -0,0 +1,25 @@
//@flow
import type {Collection, Links} from "./hal";
import type {Tag} from "./Tags";
import type {Branch} from "./Branches";
export type Changeset = Collection & {
id: string,
date: Date,
author: {
name: string,
mail?: string
},
description: string,
_links: Links,
_embedded: {
tags?: Tag[],
branches?: Branch[],
parents?: ParentChangeset[]
};
}
export type ParentChangeset = {
id: string,
_links: Links
}

View File

@@ -0,0 +1,25 @@
//@flow
import type { Links } from "./hal";
export type Config = {
proxyPassword: string | null,
proxyPort: number,
proxyServer: string,
proxyUser: string | null,
enableProxy: boolean,
realmDescription: string,
disableGroupingGrid: boolean,
dateFormat: string,
anonymousAccessEnabled: boolean,
baseUrl: string,
forceBaseUrl: boolean,
loginAttemptLimit: number,
proxyExcludes: string[],
skipFailedAuthenticators: boolean,
pluginUrl: string,
loginAttemptLimitTimeout: number,
enabledXsrfProtection: boolean,
namespaceStrategy: string,
loginInfoUrl: string,
_links: Links
};

View File

@@ -0,0 +1,20 @@
//@flow
import type { Collection, Links } from "./hal";
export type Member = {
name: string,
_links: Links
};
export type Group = Collection & {
name: string,
description: string,
type: string,
external: boolean,
members: string[],
_embedded: {
members: Member[]
},
creationDate?: string,
lastModified?: string
};

View File

@@ -0,0 +1,7 @@
//@flow
import type { Links } from "./hal";
export type IndexResources = {
version: string,
_links: Links
};

11
scm-ui/ui-types/src/Me.js Normal file
View File

@@ -0,0 +1,11 @@
// @flow
import type { Links } from "./hal";
export type Me = {
name: string,
displayName: string,
mail: string,
groups: [],
_links: Links
};

View File

@@ -0,0 +1,9 @@
// @flow
import type { Links } from "./hal";
export type NamespaceStrategies = {
current: string,
available: string[],
_links: Links
};

View File

@@ -0,0 +1,37 @@
//@flow
import type {Collection, Links} from "./hal";
export type Plugin = {
name: string,
version: string,
newVersion?: string,
displayName: string,
description?: string,
author: string,
category: string,
avatarUrl: string,
pending: boolean,
markedForUninstall?: boolean,
dependencies: string[],
_links: Links
};
export type PluginCollection = Collection & {
_embedded: {
plugins: Plugin[] | string[]
}
};
export type PluginGroup = {
name: string,
plugins: Plugin[]
};
export type PendingPlugins = {
_links: Links,
_embedded: {
new: [],
update: [],
uninstall: []
}
}

View File

@@ -0,0 +1,24 @@
//@flow
import type { PagedCollection, Links } from "./hal";
export type Repository = {
namespace: string,
name: string,
type: string,
contact?: string,
description?: string,
creationDate?: string,
lastModified?: string,
_links: Links
};
export type RepositoryCollection = PagedCollection & {
_embedded: {
repositories: Repository[] | string[]
}
};
export type RepositoryGroup = {
name: string,
repositories: Repository[]
};

View File

@@ -0,0 +1,15 @@
//@flow
import type {Links} from "./hal";
export type PermissionCreateEntry = {
name: string,
role?: string,
verbs?: string[],
groupPermission: boolean
}
export type Permission = PermissionCreateEntry & {
_links: Links
};
export type PermissionCollection = Permission[];

View File

@@ -0,0 +1,13 @@
// @flow
import type {Links} from "./hal";
export type RepositoryRole = {
name: string,
verbs: string[],
type?: string,
creationDate?: string,
lastModified?: string,
_links: Links
};

View File

@@ -0,0 +1,14 @@
// @flow
import type { Collection } from "./hal";
export type RepositoryType = {
name: string,
displayName: string
};
export type RepositoryTypeCollection = Collection & {
_embedded: {
repositoryTypes: RepositoryType[]
}
};

View File

@@ -0,0 +1,25 @@
// @flow
import type { Links } from "./hal";
// TODO ?? check ?? links
export type SubRepository = {
repositoryUrl: string,
browserUrl: string,
revision: string
};
export type File = {
name: string,
path: string,
directory: boolean,
description?: string,
revision: string,
length: number,
lastModified?: string,
subRepository?: SubRepository, // TODO
_links: Links,
_embedded: {
children: ?File[]
}
};

View File

@@ -0,0 +1,8 @@
//@flow
import type { Links } from "./hal";
export type Tag = {
name: string,
revision: string,
_links: Links
}

View File

@@ -0,0 +1,20 @@
//@flow
import type { Links } from "./hal";
export type DisplayedUser = {
id: string,
displayName: string,
mail: string
};
export type User = {
displayName: string,
name: string,
mail: string,
password: string,
active: boolean,
type?: string,
creationDate?: string,
lastModified?: string,
_links: Links
};

View File

@@ -0,0 +1,21 @@
// @flow
export type Link = {
href: string,
name?: string
};
type LinkValue = Link | Link[];
// TODO use LinkValue
export type Links = { [string]: any };
export type Collection = {
_embedded: Object,
// $FlowFixMe
_links: Links
};
export type PagedCollection = Collection & {
page: number,
pageTotal: number
};

View File

@@ -0,0 +1,32 @@
// @flow
export type { Action } from "./Action";
export type { Link, Links, Collection, PagedCollection } from "./hal";
export type { Me } from "./Me";
export type { DisplayedUser, User } from "./User";
export type { Group, Member } from "./Group";
export type { Repository, RepositoryCollection, RepositoryGroup } from "./Repositories";
export type { RepositoryType, RepositoryTypeCollection } from "./RepositoryTypes";
export type { Branch, BranchRequest } from "./Branches";
export type { Changeset } from "./Changesets";
export type { Tag } from "./Tags";
export type { Config } from "./Config";
export type { IndexResources } from "./IndexResources";
export type { Permission, PermissionCreateEntry, PermissionCollection } from "./RepositoryPermissions";
export type { SubRepository, File } from "./Sources";
export type { SelectValue, AutocompleteObject } from "./Autocomplete";
export type { Plugin, PluginCollection, PluginGroup, PendingPlugins } from "./Plugin";
export type { RepositoryRole } from "./RepositoryRole";
export type { NamespaceStrategies } from "./NamespaceStrategies";