PromucFlow_constructor/app/client/src/actions/userActions.ts
Ankita Kinger 9b7944e7ee
feat: migrate organisation to workspace (#13863)
* migration from organization to workspace on code level

* updated a few more files

* fixed runtime errors

* update org settings URL

* Renamed organizationId in domain objects

* changed field named from organization to workspace

* Reverted AppsmithRole changes

* fixed migrations

* recreating indexes

* migration update

* seed data runs before migration, undo changes

* mock commit

* seedmongo to populate upgraded data, datasource upgrade

* fixed two test cases

* updated migrations

* updated prop name

* Upgraded AclPermission

* comment

* migrated AppsmithRole

* more changes

* final set of changes

* variable name changes

* update cypress variable name

* Update app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ce/ApplicationControllerCE.java

* Update app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/Datasource.java

Co-authored-by: Trisha Anand <trisha@appsmith.com>

* reverting encryption handler change

* migrated a few missed out org to workspace

* migrated a few missed out org to workspace

* migration changes

* Removed Permission import

* fixed AppsmithRole

* mongodb version update

* fixed compile error

* fixed compile issue

* fixed some tests

* simplified embedded mongodb config

* updated a cypress test

Co-authored-by: Sidhant Goel <sidhant@appsmith.com>
Co-authored-by: Trisha Anand <trisha@appsmith.com>
Co-authored-by: Sidhant Goel <sidhant@hexcod.in>
2022-06-15 21:07:41 +05:30

121 lines
2.9 KiB
TypeScript

import {
ReduxActionErrorTypes,
ReduxActionTypes,
} from "@appsmith/constants/ReduxActionConstants";
import {
CommentsOnboardingState,
CurrentUserDetailsRequestPayload,
} from "constants/userConstants";
import {
TokenPasswordUpdateRequest,
UpdateUserRequest,
VerifyTokenRequest,
} from "@appsmith/api/UserApi";
import FeatureFlags from "entities/FeatureFlags";
export const logoutUser = (payload?: { redirectURL: string }) => ({
type: ReduxActionTypes.LOGOUT_USER_INIT,
payload,
});
export const logoutUserSuccess = (isEmptyInstance: boolean) => ({
type: ReduxActionTypes.LOGOUT_USER_SUCCESS,
payload: isEmptyInstance,
});
export const logoutUserError = (error: any) => ({
type: ReduxActionErrorTypes.LOGOUT_USER_ERROR,
payload: {
error,
},
});
export const setCurrentUserDetails = () => ({
type: ReduxActionTypes.SET_CURRENT_USER_INIT,
payload: CurrentUserDetailsRequestPayload,
});
export const verifyInviteSuccess = () => ({
type: ReduxActionTypes.VERIFY_INVITE_SUCCESS,
});
export const verifyInvite = (payload: VerifyTokenRequest) => ({
type: ReduxActionTypes.VERIFY_INVITE_INIT,
payload,
});
export const verifyInviteError = (error: any) => ({
type: ReduxActionErrorTypes.VERIFY_INVITE_ERROR,
payload: { error },
});
export const invitedUserSignup = (
payload: TokenPasswordUpdateRequest & { resolve: any; reject: any },
) => ({
type: ReduxActionTypes.INVITED_USER_SIGNUP_INIT,
payload,
});
export const invitedUserSignupSuccess = () => ({
type: ReduxActionTypes.INVITED_USER_SIGNUP_SUCCESS,
});
export const invitedUserSignupError = (error: any) => ({
type: ReduxActionErrorTypes.INVITED_USER_SIGNUP_ERROR,
payload: {
error,
},
});
export const updateUserDetails = (payload: UpdateUserRequest) => ({
type: ReduxActionTypes.UPDATE_USER_DETAILS_INIT,
payload,
});
export const updateUsersCommentOnboardingState = (
payload: CommentsOnboardingState,
) => ({
type: ReduxActionTypes.UPDATE_USERS_COMMENTS_ONBOARDING_STATE,
payload,
});
export const updatePhoto = (payload: {
file: File;
callback?: (id: string) => void;
}) => ({
type: ReduxActionTypes.UPLOAD_PROFILE_PHOTO,
payload,
});
export const removePhoto = (callback: (id: string) => void) => ({
type: ReduxActionTypes.REMOVE_PROFILE_PHOTO,
payload: { callback },
});
export const updatePhotoId = (payload: { photoId: string }) => ({
type: ReduxActionTypes.UPDATE_PHOTO_ID,
payload,
});
export const leaveWorkspace = (workspaceId: string) => {
return {
type: ReduxActionTypes.LEAVE_WORKSPACE_INIT,
payload: {
workspaceId,
},
};
};
export const fetchFeatureFlagsInit = () => ({
type: ReduxActionTypes.FETCH_FEATURE_FLAGS_INIT,
});
export const fetchFeatureFlagsSuccess = (payload: FeatureFlags) => ({
type: ReduxActionTypes.FETCH_FEATURE_FLAGS_SUCCESS,
payload,
});
export const fetchFeatureFlagsError = (error: any) => ({
type: ReduxActionErrorTypes.FETCH_FEATURE_FLAGS_ERROR,
payload: { error, show: false },
});