mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-08 06:25:45 +01:00
scm-ui: new repository layout
This commit is contained in:
7
scm-ui/ui-types/src/Action.js
Normal file
7
scm-ui/ui-types/src/Action.js
Normal file
@@ -0,0 +1,7 @@
|
||||
// @flow
|
||||
export type Action = {
|
||||
type: string,
|
||||
payload?: any,
|
||||
itemId?: string | number,
|
||||
resetPending?: boolean
|
||||
};
|
||||
10
scm-ui/ui-types/src/Autocomplete.js
Normal file
10
scm-ui/ui-types/src/Autocomplete.js
Normal file
@@ -0,0 +1,10 @@
|
||||
// @flow
|
||||
export type AutocompleteObject = {
|
||||
id: string,
|
||||
displayName: string
|
||||
};
|
||||
|
||||
export type SelectValue = {
|
||||
value: AutocompleteObject,
|
||||
label: string
|
||||
};
|
||||
14
scm-ui/ui-types/src/Branches.js
Normal file
14
scm-ui/ui-types/src/Branches.js
Normal 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
|
||||
}
|
||||
25
scm-ui/ui-types/src/Changesets.js
Normal file
25
scm-ui/ui-types/src/Changesets.js
Normal 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
|
||||
}
|
||||
25
scm-ui/ui-types/src/Config.js
Normal file
25
scm-ui/ui-types/src/Config.js
Normal 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
|
||||
};
|
||||
20
scm-ui/ui-types/src/Group.js
Normal file
20
scm-ui/ui-types/src/Group.js
Normal 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
|
||||
};
|
||||
7
scm-ui/ui-types/src/IndexResources.js
Normal file
7
scm-ui/ui-types/src/IndexResources.js
Normal 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
11
scm-ui/ui-types/src/Me.js
Normal file
@@ -0,0 +1,11 @@
|
||||
// @flow
|
||||
|
||||
import type { Links } from "./hal";
|
||||
|
||||
export type Me = {
|
||||
name: string,
|
||||
displayName: string,
|
||||
mail: string,
|
||||
groups: [],
|
||||
_links: Links
|
||||
};
|
||||
9
scm-ui/ui-types/src/NamespaceStrategies.js
Normal file
9
scm-ui/ui-types/src/NamespaceStrategies.js
Normal file
@@ -0,0 +1,9 @@
|
||||
// @flow
|
||||
|
||||
import type { Links } from "./hal";
|
||||
|
||||
export type NamespaceStrategies = {
|
||||
current: string,
|
||||
available: string[],
|
||||
_links: Links
|
||||
};
|
||||
37
scm-ui/ui-types/src/Plugin.js
Normal file
37
scm-ui/ui-types/src/Plugin.js
Normal 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: []
|
||||
}
|
||||
}
|
||||
24
scm-ui/ui-types/src/Repositories.js
Normal file
24
scm-ui/ui-types/src/Repositories.js
Normal 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[]
|
||||
};
|
||||
15
scm-ui/ui-types/src/RepositoryPermissions.js
Normal file
15
scm-ui/ui-types/src/RepositoryPermissions.js
Normal 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[];
|
||||
13
scm-ui/ui-types/src/RepositoryRole.js
Normal file
13
scm-ui/ui-types/src/RepositoryRole.js
Normal 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
|
||||
};
|
||||
|
||||
14
scm-ui/ui-types/src/RepositoryTypes.js
Normal file
14
scm-ui/ui-types/src/RepositoryTypes.js
Normal 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[]
|
||||
}
|
||||
};
|
||||
25
scm-ui/ui-types/src/Sources.js
Normal file
25
scm-ui/ui-types/src/Sources.js
Normal 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[]
|
||||
}
|
||||
};
|
||||
8
scm-ui/ui-types/src/Tags.js
Normal file
8
scm-ui/ui-types/src/Tags.js
Normal file
@@ -0,0 +1,8 @@
|
||||
//@flow
|
||||
import type { Links } from "./hal";
|
||||
|
||||
export type Tag = {
|
||||
name: string,
|
||||
revision: string,
|
||||
_links: Links
|
||||
}
|
||||
20
scm-ui/ui-types/src/User.js
Normal file
20
scm-ui/ui-types/src/User.js
Normal 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
|
||||
};
|
||||
21
scm-ui/ui-types/src/hal.js
Normal file
21
scm-ui/ui-types/src/hal.js
Normal 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
|
||||
};
|
||||
32
scm-ui/ui-types/src/index.js
Normal file
32
scm-ui/ui-types/src/index.js
Normal 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";
|
||||
Reference in New Issue
Block a user