mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-19 17:55:17 -04:00
User profile page (#102)
* Added mock profile page * Added translations * Modularized page, added LoginProvider, started validation * Re-adding profile route after router refactoring * Added API calls for password and name change * Added user deletion modal * Refactored translations in profile-page to match new locales * Fixed merge-conflicted locales/de.json * Removed values for password fields * Fixed capitalization of LoginProvider * Fixed codestyle method declarations * Fix names of methods and started countdown * Fix countdown Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Co-authored-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
This commit is contained in:
parent
515cf1f34d
commit
747d9686fa
13 changed files with 356 additions and 13 deletions
|
@ -1,11 +1,20 @@
|
|||
import { Reducer } from 'redux'
|
||||
import { CLEAR_USER_ACTION_TYPE, LoginStatus, SET_USER_ACTION_TYPE, SetUserAction, UserActions, UserState } from './types'
|
||||
import {
|
||||
CLEAR_USER_ACTION_TYPE,
|
||||
LoginProvider,
|
||||
LoginStatus,
|
||||
SET_USER_ACTION_TYPE,
|
||||
SetUserAction,
|
||||
UserActions,
|
||||
UserState
|
||||
} from './types'
|
||||
|
||||
export const initialState: UserState = {
|
||||
id: '',
|
||||
name: '',
|
||||
photo: '',
|
||||
status: LoginStatus.forbidden
|
||||
status: LoginStatus.forbidden,
|
||||
provider: LoginProvider.EMAIL
|
||||
}
|
||||
|
||||
export const UserReducer: Reducer<UserState, UserActions> = (state: UserState = initialState, action: UserActions) => {
|
||||
|
|
|
@ -20,6 +20,7 @@ export interface UserState {
|
|||
id: string;
|
||||
name: string;
|
||||
photo: string;
|
||||
provider: LoginProvider;
|
||||
}
|
||||
|
||||
export enum LoginStatus {
|
||||
|
@ -27,4 +28,18 @@ export enum LoginStatus {
|
|||
ok = 'ok'
|
||||
}
|
||||
|
||||
export enum LoginProvider {
|
||||
FACEBOOK = 'facebook',
|
||||
GITHUB = 'github',
|
||||
TWITTER = 'twitter',
|
||||
GITLAB = 'gitlab',
|
||||
DROPBOX = 'dropbox',
|
||||
GOOGLE = 'google',
|
||||
SAML = 'saml',
|
||||
OAUTH2 = 'oauth2',
|
||||
EMAIL = 'email',
|
||||
LDAP = 'ldap',
|
||||
OPENID = 'openid'
|
||||
}
|
||||
|
||||
export type UserActions = SetUserAction | ClearUserAction;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue