[ABANDONED] React/Redux front end for the Flexor social network.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

98 lines
2.0 KiB

import { EntityStore } from './entities'
export enum NotificationType {
Info = 'info',
Success = 'success',
Error = 'error',
Welcome = 'welcome',
}
export enum RequestKey {
FetchGroup = 'fetch_group',
FetchGroups = 'fetch_groups',
FetchGroupAvailability = 'fetch_group_availability',
FetchUserAvailability = 'fetch_user_availability',
CreateGroup = 'create_group',
Register = 'register',
Authenticate = 'authenticate',
FetchGroupMembers = 'fetch_group_members',
FetchGroupLogs = 'fetch_group_logs',
CreateInvitation = 'create_invitation',
}
export type FormValue = string | number | boolean
export interface FormNotification {
field?: string
type: NotificationType
message: string
}
export interface APIRequest {
id: RequestKey
fetching: boolean
started: number
succeeded: boolean
}
export interface APIRequestCollection {
[id: string]: APIRequest
}
export interface Notification {
id: string
type: NotificationType
content: string
auto: boolean
}
export interface AuthenticationState {
checked: boolean
authenticated: boolean
userId?: string
}
export interface MenuState {
collapsed: boolean
}
export interface FormField {
name: string
apiName?: string
value?: FormValue
notification?: FormNotification
}
export interface Form {
[name: string]: FormField
}
export interface FormsState {
form: Form
notification?: FormNotification
}
export interface DirectoryState {
groups: string[]
continuation?: string
}
export interface RegistrationState {
step: number
}
export type RequestsState = APIRequestCollection
export type NotificationsState = Notification[]
export type EntitiesState = EntityStore
export interface AppState {
authentication: AuthenticationState
directory: DirectoryState
entities: EntitiesState
forms: FormsState
menu: MenuState
notifications: NotificationsState
registration: RegistrationState
requests: RequestsState
}