From a788e69a11dde300143a7c80fe8e8a1bcbf96f38 Mon Sep 17 00:00:00 2001 From: Vishawdeep Singh Date: Thu, 26 Dec 2024 14:21:49 +0530 Subject: [PATCH] Divided the constants.js of redux into submodules --- client/constants.js | 166 +++----------------- client/constants/authActions.js | 10 ++ client/constants/collectionsActions.js | 6 + client/constants/errorActions.js | 5 + client/constants/fileActions.js | 5 + client/constants/miscActions.js | 10 ++ client/constants/projectActions.js | 15 ++ client/constants/sketchActions.js | 6 + client/constants/statePersistenceActions.js | 2 + client/constants/uiActions.js | 17 ++ client/constants/userPreferencesActions.js | 10 ++ client/modules/IDE/actions/assets.js | 2 +- client/modules/IDE/actions/collections.js | 2 +- client/modules/IDE/actions/files.js | 2 +- client/modules/IDE/actions/ide.js | 2 +- client/modules/IDE/actions/preferences.js | 2 +- client/modules/IDE/actions/project.js | 2 +- client/modules/IDE/actions/projects.js | 2 +- client/modules/IDE/actions/sorting.js | 2 +- client/modules/IDE/actions/toast.js | 2 +- client/modules/IDE/reducers/collections.js | 2 +- client/modules/IDE/reducers/files.js | 2 +- client/modules/IDE/reducers/ide.js | 2 +- client/modules/IDE/reducers/preferences.js | 2 +- client/modules/IDE/reducers/project.js | 2 +- client/modules/IDE/reducers/projects.js | 2 +- client/modules/IDE/reducers/search.js | 2 +- client/modules/IDE/reducers/sorting.js | 2 +- client/modules/IDE/reducers/toast.js | 2 +- client/modules/User/actions.js | 2 +- client/modules/User/reducers.js | 2 +- 31 files changed, 131 insertions(+), 161 deletions(-) create mode 100644 client/constants/authActions.js create mode 100644 client/constants/collectionsActions.js create mode 100644 client/constants/errorActions.js create mode 100644 client/constants/fileActions.js create mode 100644 client/constants/miscActions.js create mode 100644 client/constants/projectActions.js create mode 100644 client/constants/sketchActions.js create mode 100644 client/constants/statePersistenceActions.js create mode 100644 client/constants/uiActions.js create mode 100644 client/constants/userPreferencesActions.js diff --git a/client/constants.js b/client/constants.js index fa6010aed1..90b9c49905 100644 --- a/client/constants.js +++ b/client/constants.js @@ -1,141 +1,25 @@ -// TODO Organize this file by reducer type, to break this apart into -// multiple files -export const UPDATE_FILE_CONTENT = 'UPDATE_FILE_CONTENT'; -export const TOGGLE_SKETCH = 'TOGGLE_SKETCH'; -export const START_SKETCH = 'START_SKETCH'; -export const STOP_SKETCH = 'STOP_SKETCH'; - -export const START_ACCESSIBLE_OUTPUT = 'START_ACCESSIBLE_OUTPUT'; -export const STOP_ACCESSIBLE_OUTPUT = 'STOP_ACCESSIBLE_OUTPUT'; - -export const OPEN_PREFERENCES = 'OPEN_PREFERENCES'; -export const CLOSE_PREFERENCES = 'CLOSE_PREFERENCES'; -export const SET_FONT_SIZE = 'SET_FONT_SIZE'; -export const SET_LINE_NUMBERS = 'SET_LINE_NUMBERS'; - -export const AUTH_USER = 'AUTH_USER'; -export const UNAUTH_USER = 'UNAUTH_USER'; -export const AUTH_ERROR = 'AUTH_ERROR'; - -export const SETTINGS_UPDATED = 'SETTINGS_UPDATED'; - -export const API_KEY_CREATED = 'API_KEY_CREATED'; -export const API_KEY_REMOVED = 'API_KEY_REMOVED'; - -export const SET_PROJECT_NAME = 'SET_PROJECT_NAME'; -export const RENAME_PROJECT = 'RENAME_PROJECT'; - -export const PROJECT_SAVE_SUCCESS = 'PROJECT_SAVE_SUCCESS'; -export const PROJECT_SAVE_FAIL = 'PROJECT_SAVE_FAIL'; -export const NEW_PROJECT = 'NEW_PROJECT'; -export const RESET_PROJECT = 'RESET_PROJECT'; - -export const SET_PROJECT = 'SET_PROJECT'; -export const SET_PROJECTS = 'SET_PROJECTS'; - -export const SET_COLLECTIONS = 'SET_COLLECTIONS'; -export const CREATE_COLLECTION = 'CREATED_COLLECTION'; -export const DELETE_COLLECTION = 'DELETE_COLLECTION'; - -export const ADD_TO_COLLECTION = 'ADD_TO_COLLECTION'; -export const REMOVE_FROM_COLLECTION = 'REMOVE_FROM_COLLECTION'; -export const EDIT_COLLECTION = 'EDIT_COLLECTION'; - -export const DELETE_PROJECT = 'DELETE_PROJECT'; - -export const SET_SELECTED_FILE = 'SET_SELECTED_FILE'; -export const SHOW_MODAL = 'SHOW_MODAL'; -export const HIDE_MODAL = 'HIDE_MODAL'; -export const CREATE_FILE = 'CREATE_FILE'; -export const SET_BLOB_URL = 'SET_BLOB_URL'; - -export const EXPAND_SIDEBAR = 'EXPAND_SIDEBAR'; -export const COLLAPSE_SIDEBAR = 'COLLAPSE_SIDEBAR'; - -export const EXPAND_CONSOLE = 'EXPAND_CONSOLE'; -export const COLLAPSE_CONSOLE = 'COLLAPSE_CONSOLE'; - -export const TOGGLE_FORCE_DESKTOP = 'TOGGLE_FORCE_DESKTOP'; - -export const UPDATE_FILE_NAME = 'UPDATE_FILE_NAME'; -export const DELETE_FILE = 'DELETE_FILE'; - -export const SET_AUTOSAVE = 'SET_AUTOSAVE'; -export const SET_LINEWRAP = 'SET_LINEWRAP'; -export const SET_LINT_WARNING = 'SET_LINT_WARNING'; -export const SET_PREFERENCES = 'SET_PREFERENCES'; -export const SET_TEXT_OUTPUT = 'SET_TEXT_OUTPUT'; -export const SET_GRID_OUTPUT = 'SET_GRID_OUTPUT'; -export const SET_SOUND_OUTPUT = 'SET_SOUND_OUTPUT'; -export const SET_AUTOCLOSE_BRACKETS_QUOTES = 'SET_AUTOCLOSE_BRACKETS_QUOTES'; -export const SET_AUTOCOMPLETE_HINTER = 'SET_AUTOCOMPLETE_HINTER'; - -export const OPEN_PROJECT_OPTIONS = 'OPEN_PROJECT_OPTIONS'; -export const CLOSE_PROJECT_OPTIONS = 'CLOSE_PROJECT_OPTIONS'; -export const SHOW_NEW_FOLDER_MODAL = 'SHOW_NEW_FOLDER_MODAL'; -export const CLOSE_NEW_FOLDER_MODAL = 'CLOSE_NEW_FOLDER_MODAL'; -export const SHOW_FOLDER_CHILDREN = 'SHOW_FOLDER_CHILDREN'; -export const HIDE_FOLDER_CHILDREN = 'HIDE_FOLDER_CHILDREN'; -export const OPEN_UPLOAD_FILE_MODAL = 'OPEN_UPLOAD_FILE_MODAL'; -export const CLOSE_UPLOAD_FILE_MODAL = 'CLOSE_UPLOAD_FILE_MODAL'; - -export const SHOW_SHARE_MODAL = 'SHOW_SHARE_MODAL'; -export const CLOSE_SHARE_MODAL = 'CLOSE_SHARE_MODAL'; -export const SHOW_EDITOR_OPTIONS = 'SHOW_EDITOR_OPTIONS'; -export const CLOSE_EDITOR_OPTIONS = 'CLOSE_EDITOR_OPTIONS'; -export const SHOW_KEYBOARD_SHORTCUT_MODAL = 'SHOW_KEYBOARD_SHORTCUT_MODAL'; -export const CLOSE_KEYBOARD_SHORTCUT_MODAL = 'CLOSE_KEYBOARD_SHORTCUT_MODAL'; -export const SHOW_TOAST = 'SHOW_TOAST'; -export const HIDE_TOAST = 'HIDE_TOAST'; -export const SET_TOAST_TEXT = 'SET_TOAST_TEXT'; -export const SET_THEME = 'SET_THEME'; -export const SET_LANGUAGE = 'SET_LANGUAGE'; - -export const SET_UNSAVED_CHANGES = 'SET_UNSAVED_CHANGES'; -export const SET_AUTOREFRESH = 'SET_AUTOREFRESH'; -export const START_SKETCH_REFRESH = 'START_SKETCH_REFRESH'; -export const END_SKETCH_REFRESH = 'END_SKETCH_REFRESH'; - -export const DETECT_INFINITE_LOOPS = 'DETECT_INFINITE_LOOPS'; -export const RESET_INFINITE_LOOPS = 'RESET_INFINITE_LOOPS'; - -export const RESET_PASSWORD_INITIATE = 'RESET_PASSWORD_INITIATE'; -export const RESET_PASSWORD_RESET = 'RESET_PASSWORD_RESET'; -export const INVALID_RESET_PASSWORD_TOKEN = 'INVALID_RESET_PASSWORD_TOKEN'; - -export const EMAIL_VERIFICATION_INITIATE = 'EMAIL_VERIFICATION_INITIATE'; -export const EMAIL_VERIFICATION_VERIFY = 'EMAIL_VERIFICATION_VERIFY'; -export const EMAIL_VERIFICATION_VERIFIED = 'EMAIL_VERIFICATION_VERIFIED'; -export const EMAIL_VERIFICATION_INVALID = 'EMAIL_VERIFICATION_INVALID'; - -// eventually, handle errors more specifically and better -export const ERROR = 'ERROR'; - -export const JUST_OPENED_PROJECT = 'JUST_OPENED_PROJECT'; -export const RESET_JUST_OPENED_PROJECT = 'RESET_JUST_OPENED_PROJECT'; - -export const SET_PROJECT_SAVED_TIME = 'SET_PROJECT_SAVED_TIME'; -export const RESET_PROJECT_SAVED_TIME = 'RESET_PROJECT_SAVED_TIME'; -export const SET_PREVIOUS_PATH = 'SET_PREVIOUS_PATH'; -export const SHOW_ERROR_MODAL = 'SHOW_ERROR_MODAL'; -export const HIDE_ERROR_MODAL = 'HIDE_ERROR_MODAL'; - -export const PERSIST_STATE = 'PERSIST_STATE'; -export const CLEAR_PERSISTED_STATE = 'CLEAR_PERSISTED_STATE'; - -export const HIDE_RUNTIME_ERROR_WARNING = 'HIDE_RUNTIME_ERROR_WARNING'; -export const SHOW_RUNTIME_ERROR_WARNING = 'SHOW_RUNTIME_ERROR_WARNING'; - -export const TOGGLE_DIRECTION = 'TOGGLE_DIRECTION'; -export const SET_SORTING = 'SET_SORTING'; -export const SET_SORT_PARAMS = 'SET_SORT_PARAMS'; -export const SET_SEARCH_TERM = 'SET_SEARCH_TERM'; -export const CLOSE_SKETCHLIST_MODAL = 'CLOSE_SKETCHLIST_MODAL'; - -export const START_SAVING_PROJECT = 'START_SAVING_PROJECT'; -export const END_SAVING_PROJECT = 'END_SAVING_PROJECT'; - -export const SET_COOKIE_CONSENT = 'SET_COOKIE_CONSENT'; - -export const CONSOLE_EVENT = 'CONSOLE_EVENT'; -export const CLEAR_CONSOLE = 'CLEAR_CONSOLE'; +import * as authActions from './constants/authActions'; +import * as collectionActions from './constants/collectionsActions'; +import * as errorActions from './constants/errorActions'; +import * as fileActions from './constants/fileActions'; +import * as projectActions from './constants/projectActions'; +import * as miscActions from './constants/miscActions'; +import * as sketchActions from './constants/sketchActions'; +import * as statePersistenceActions from './constants/statePersistenceActions'; +import * as uiActions from './constants/uiActions'; +import * as userPreferencesActions from './constants/userPreferencesActions'; + +const ActionTypes = { + ...authActions, + ...collectionActions, + ...errorActions, + ...fileActions, + ...projectActions, + ...miscActions, + ...sketchActions, + ...statePersistenceActions, + ...uiActions, + ...userPreferencesActions +}; + +export default ActionTypes; diff --git a/client/constants/authActions.js b/client/constants/authActions.js new file mode 100644 index 0000000000..9070dff72c --- /dev/null +++ b/client/constants/authActions.js @@ -0,0 +1,10 @@ +export const AUTH_USER = 'AUTH_USER'; +export const UNAUTH_USER = 'UNAUTH_USER'; +export const AUTH_ERROR = 'AUTH_ERROR'; +export const RESET_PASSWORD_INITIATE = 'RESET_PASSWORD_INITIATE'; +export const RESET_PASSWORD_RESET = 'RESET_PASSWORD_RESET'; +export const INVALID_RESET_PASSWORD_TOKEN = 'INVALID_RESET_PASSWORD_TOKEN'; +export const EMAIL_VERIFICATION_INITIATE = 'EMAIL_VERIFICATION_INITIATE'; +export const EMAIL_VERIFICATION_VERIFY = 'EMAIL_VERIFICATION_VERIFY'; +export const EMAIL_VERIFICATION_VERIFIED = 'EMAIL_VERIFICATION_VERIFIED'; +export const EMAIL_VERIFICATION_INVALID = 'EMAIL_VERIFICATION_INVALID'; diff --git a/client/constants/collectionsActions.js b/client/constants/collectionsActions.js new file mode 100644 index 0000000000..15ddd029b9 --- /dev/null +++ b/client/constants/collectionsActions.js @@ -0,0 +1,6 @@ +export const SET_COLLECTIONS = 'SET_COLLECTIONS'; +export const CREATE_COLLECTION = 'CREATED_COLLECTION'; +export const DELETE_COLLECTION = 'DELETE_COLLECTION'; +export const ADD_TO_COLLECTION = 'ADD_TO_COLLECTION'; +export const REMOVE_FROM_COLLECTION = 'REMOVE_FROM_COLLECTION'; +export const EDIT_COLLECTION = 'EDIT_COLLECTION'; diff --git a/client/constants/errorActions.js b/client/constants/errorActions.js new file mode 100644 index 0000000000..1430a61b7e --- /dev/null +++ b/client/constants/errorActions.js @@ -0,0 +1,5 @@ +export const ERROR = 'ERROR'; +export const SHOW_ERROR_MODAL = 'SHOW_ERROR_MODAL'; +export const HIDE_ERROR_MODAL = 'HIDE_ERROR_MODAL'; +export const HIDE_RUNTIME_ERROR_WARNING = 'HIDE_RUNTIME_ERROR_WARNING'; +export const SHOW_RUNTIME_ERROR_WARNING = 'SHOW_RUNTIME_ERROR_WARNING'; diff --git a/client/constants/fileActions.js b/client/constants/fileActions.js new file mode 100644 index 0000000000..a109508e3b --- /dev/null +++ b/client/constants/fileActions.js @@ -0,0 +1,5 @@ +export const UPDATE_FILE_CONTENT = 'UPDATE_FILE_CONTENT'; +export const UPDATE_FILE_NAME = 'UPDATE_FILE_NAME'; +export const DELETE_FILE = 'DELETE_FILE'; +export const CREATE_FILE = 'CREATE_FILE'; +export const SET_SELECTED_FILE = 'SET_SELECTED_FILE'; diff --git a/client/constants/miscActions.js b/client/constants/miscActions.js new file mode 100644 index 0000000000..ecc7242b29 --- /dev/null +++ b/client/constants/miscActions.js @@ -0,0 +1,10 @@ +export const TOGGLE_FORCE_DESKTOP = 'TOGGLE_FORCE_DESKTOP'; +export const DETECT_INFINITE_LOOPS = 'DETECT_INFINITE_LOOPS'; +export const RESET_INFINITE_LOOPS = 'RESET_INFINITE_LOOPS'; +export const CONSOLE_EVENT = 'CONSOLE_EVENT'; +export const CLEAR_CONSOLE = 'CLEAR_CONSOLE'; +export const SET_COOKIE_CONSENT = 'SET_COOKIE_CONSENT'; +export const TOGGLE_DIRECTION = 'TOGGLE_DIRECTION'; +export const SET_SORTING = 'SET_SORTING'; +export const SET_SORT_PARAMS = 'SET_SORT_PARAMS'; +export const SET_SEARCH_TERM = 'SET_SEARCH_TERM'; diff --git a/client/constants/projectActions.js b/client/constants/projectActions.js new file mode 100644 index 0000000000..64b4fc9991 --- /dev/null +++ b/client/constants/projectActions.js @@ -0,0 +1,15 @@ +export const SET_PROJECT = 'SET_PROJECT'; +export const SET_PROJECTS = 'SET_PROJECTS'; +export const SET_PROJECT_NAME = 'SET_PROJECT_NAME'; +export const RENAME_PROJECT = 'RENAME_PROJECT'; +export const PROJECT_SAVE_SUCCESS = 'PROJECT_SAVE_SUCCESS'; +export const PROJECT_SAVE_FAIL = 'PROJECT_SAVE_FAIL'; +export const NEW_PROJECT = 'NEW_PROJECT'; +export const RESET_PROJECT = 'RESET_PROJECT'; +export const SET_PROJECT_SAVED_TIME = 'SET_PROJECT_SAVED_TIME'; +export const RESET_PROJECT_SAVED_TIME = 'RESET_PROJECT_SAVED_TIME'; +export const START_SAVING_PROJECT = 'START_SAVING_PROJECT'; +export const END_SAVING_PROJECT = 'END_SAVING_PROJECT'; +export const JUST_OPENED_PROJECT = 'JUST_OPENED_PROJECT'; +export const RESET_JUST_OPENED_PROJECT = 'RESET_JUST_OPENED_PROJECT'; +export const DELETE_PROJECT = 'DELETE_PROJECT'; diff --git a/client/constants/sketchActions.js b/client/constants/sketchActions.js new file mode 100644 index 0000000000..6f61616de5 --- /dev/null +++ b/client/constants/sketchActions.js @@ -0,0 +1,6 @@ +export const TOGGLE_SKETCH = 'TOGGLE_SKETCH'; +export const START_SKETCH = 'START_SKETCH'; +export const STOP_SKETCH = 'STOP_SKETCH'; +export const START_SKETCH_REFRESH = 'START_SKETCH_REFRESH'; +export const END_SKETCH_REFRESH = 'END_SKETCH_REFRESH'; +export const CLOSE_SKETCHLIST_MODAL = 'CLOSE_SKETCHLIST_MODAL'; diff --git a/client/constants/statePersistenceActions.js b/client/constants/statePersistenceActions.js new file mode 100644 index 0000000000..f43646e2a3 --- /dev/null +++ b/client/constants/statePersistenceActions.js @@ -0,0 +1,2 @@ +export const PERSIST_STATE = 'PERSIST_STATE'; +export const CLEAR_PERSISTED_STATE = 'CLEAR_PERSISTED_STATE'; diff --git a/client/constants/uiActions.js b/client/constants/uiActions.js new file mode 100644 index 0000000000..75a9ee5ca1 --- /dev/null +++ b/client/constants/uiActions.js @@ -0,0 +1,17 @@ +export const SHOW_MODAL = 'SHOW_MODAL'; +export const HIDE_MODAL = 'HIDE_MODAL'; +export const EXPAND_SIDEBAR = 'EXPAND_SIDEBAR'; +export const COLLAPSE_SIDEBAR = 'COLLAPSE_SIDEBAR'; +export const EXPAND_CONSOLE = 'EXPAND_CONSOLE'; +export const COLLAPSE_CONSOLE = 'COLLAPSE_CONSOLE'; +export const SHOW_TOAST = 'SHOW_TOAST'; +export const HIDE_TOAST = 'HIDE_TOAST'; +export const SET_TOAST_TEXT = 'SET_TOAST_TEXT'; +export const SHOW_ERROR_MODAL = 'SHOW_ERROR_MODAL'; +export const HIDE_ERROR_MODAL = 'HIDE_ERROR_MODAL'; +export const SHOW_SHARE_MODAL = 'SHOW_SHARE_MODAL'; +export const CLOSE_SHARE_MODAL = 'CLOSE_SHARE_MODAL'; +export const SHOW_EDITOR_OPTIONS = 'SHOW_EDITOR_OPTIONS'; +export const CLOSE_EDITOR_OPTIONS = 'CLOSE_EDITOR_OPTIONS'; +export const SHOW_KEYBOARD_SHORTCUT_MODAL = 'SHOW_KEYBOARD_SHORTCUT_MODAL'; +export const CLOSE_KEYBOARD_SHORTCUT_MODAL = 'CLOSE_KEYBOARD_SHORTCUT_MODAL'; diff --git a/client/constants/userPreferencesActions.js b/client/constants/userPreferencesActions.js new file mode 100644 index 0000000000..65b57dc73b --- /dev/null +++ b/client/constants/userPreferencesActions.js @@ -0,0 +1,10 @@ +export const OPEN_PREFERENCES = 'OPEN_PREFERENCES'; +export const CLOSE_PREFERENCES = 'CLOSE_PREFERENCES'; +export const SET_FONT_SIZE = 'SET_FONT_SIZE'; +export const SET_LINE_NUMBERS = 'SET_LINE_NUMBERS'; +export const SET_THEME = 'SET_THEME'; +export const SET_LANGUAGE = 'SET_LANGUAGE'; +export const SET_AUTOSAVE = 'SET_AUTOSAVE'; +export const SET_LINEWRAP = 'SET_LINEWRAP'; +export const SET_AUTOCLOSE_BRACKETS_QUOTES = 'SET_AUTOCLOSE_BRACKETS_QUOTES'; +export const SET_AUTOCOMPLETE_HINTER = 'SET_AUTOCOMPLETE_HINTER'; diff --git a/client/modules/IDE/actions/assets.js b/client/modules/IDE/actions/assets.js index ecd16fb7c6..2fa81865aa 100644 --- a/client/modules/IDE/actions/assets.js +++ b/client/modules/IDE/actions/assets.js @@ -1,7 +1,7 @@ import apiClient from '../../../utils/apiClient'; -import * as ActionTypes from '../../../constants'; import { startLoader, stopLoader } from '../reducers/loading'; import { assetsActions } from '../reducers/assets'; +import ActionTypes from '../../../constants'; const { setAssets, deleteAsset } = assetsActions; diff --git a/client/modules/IDE/actions/collections.js b/client/modules/IDE/actions/collections.js index 32790e681e..36487b124e 100644 --- a/client/modules/IDE/actions/collections.js +++ b/client/modules/IDE/actions/collections.js @@ -1,6 +1,6 @@ import browserHistory from '../../../browserHistory'; import apiClient from '../../../utils/apiClient'; -import * as ActionTypes from '../../../constants'; +import ActionTypes from '../../../constants'; import { startLoader, stopLoader } from '../reducers/loading'; import { setToastText, showToast } from './toast'; diff --git a/client/modules/IDE/actions/files.js b/client/modules/IDE/actions/files.js index 84b76b6f41..323fbff6db 100644 --- a/client/modules/IDE/actions/files.js +++ b/client/modules/IDE/actions/files.js @@ -1,7 +1,7 @@ import objectID from 'bson-objectid'; import blobUtil from 'blob-util'; import apiClient from '../../../utils/apiClient'; -import * as ActionTypes from '../../../constants'; +import ActionTypes from '../../../constants'; import { setUnsavedChanges, closeNewFolderModal, diff --git a/client/modules/IDE/actions/ide.js b/client/modules/IDE/actions/ide.js index 80a43443bc..65887e8e52 100644 --- a/client/modules/IDE/actions/ide.js +++ b/client/modules/IDE/actions/ide.js @@ -1,4 +1,4 @@ -import * as ActionTypes from '../../../constants'; +import ActionTypes from '../../../constants'; import { clearConsole } from './console'; import { dispatchMessage, MessageTypes } from '../../../utils/dispatcher'; diff --git a/client/modules/IDE/actions/preferences.js b/client/modules/IDE/actions/preferences.js index e0473bd995..877cc72de5 100644 --- a/client/modules/IDE/actions/preferences.js +++ b/client/modules/IDE/actions/preferences.js @@ -1,6 +1,6 @@ import i18next from 'i18next'; import apiClient from '../../../utils/apiClient'; -import * as ActionTypes from '../../../constants'; +import ActionTypes from '../../../constants'; function updatePreferences(formParams, dispatch) { apiClient diff --git a/client/modules/IDE/actions/project.js b/client/modules/IDE/actions/project.js index 1d8943336b..bd7a4221a5 100644 --- a/client/modules/IDE/actions/project.js +++ b/client/modules/IDE/actions/project.js @@ -4,7 +4,7 @@ import { isEqual } from 'lodash'; import browserHistory from '../../../browserHistory'; import apiClient from '../../../utils/apiClient'; import getConfig from '../../../utils/getConfig'; -import * as ActionTypes from '../../../constants'; +import ActionTypes from '../../../constants'; import { showToast, setToastText } from './toast'; import { setUnsavedChanges, diff --git a/client/modules/IDE/actions/projects.js b/client/modules/IDE/actions/projects.js index 34ca2a35bf..6ac98e03db 100644 --- a/client/modules/IDE/actions/projects.js +++ b/client/modules/IDE/actions/projects.js @@ -1,5 +1,5 @@ import apiClient from '../../../utils/apiClient'; -import * as ActionTypes from '../../../constants'; +import ActionTypes from '../../../constants'; import { startLoader, stopLoader } from '../reducers/loading'; // eslint-disable-next-line diff --git a/client/modules/IDE/actions/sorting.js b/client/modules/IDE/actions/sorting.js index b9aa0354cb..bb414085cd 100644 --- a/client/modules/IDE/actions/sorting.js +++ b/client/modules/IDE/actions/sorting.js @@ -1,4 +1,4 @@ -import * as ActionTypes from '../../../constants'; +import ActionTypes from '../../../constants'; export const DIRECTION = { ASC: 'ASCENDING', diff --git a/client/modules/IDE/actions/toast.js b/client/modules/IDE/actions/toast.js index b1e43d9e59..3bc9f5a8e0 100644 --- a/client/modules/IDE/actions/toast.js +++ b/client/modules/IDE/actions/toast.js @@ -1,4 +1,4 @@ -import * as ActionTypes from '../../../constants'; +import ActionTypes from '../../../constants'; export function hideToast() { return { diff --git a/client/modules/IDE/reducers/collections.js b/client/modules/IDE/reducers/collections.js index c7017c29a7..86aefb0768 100644 --- a/client/modules/IDE/reducers/collections.js +++ b/client/modules/IDE/reducers/collections.js @@ -1,4 +1,4 @@ -import * as ActionTypes from '../../../constants'; +import ActionTypes from '../../../constants'; const sketches = (state = [], action) => { switch (action.type) { diff --git a/client/modules/IDE/reducers/files.js b/client/modules/IDE/reducers/files.js index de1b9b1aa7..cac2a06619 100644 --- a/client/modules/IDE/reducers/files.js +++ b/client/modules/IDE/reducers/files.js @@ -1,5 +1,5 @@ import objectID from 'bson-objectid'; -import * as ActionTypes from '../../../constants'; +import ActionTypes from '../../../constants'; import { defaultSketch, defaultCSS, diff --git a/client/modules/IDE/reducers/ide.js b/client/modules/IDE/reducers/ide.js index 8d45b8b50a..16d3a02c1e 100644 --- a/client/modules/IDE/reducers/ide.js +++ b/client/modules/IDE/reducers/ide.js @@ -1,4 +1,4 @@ -import * as ActionTypes from '../../../constants'; +import ActionTypes from '../../../constants'; const initialState = { isPlaying: false, diff --git a/client/modules/IDE/reducers/preferences.js b/client/modules/IDE/reducers/preferences.js index 087d927aed..e2257e530e 100644 --- a/client/modules/IDE/reducers/preferences.js +++ b/client/modules/IDE/reducers/preferences.js @@ -1,4 +1,4 @@ -import * as ActionTypes from '../../../constants'; +import ActionTypes from '../../../constants'; export const initialState = { fontSize: 18, diff --git a/client/modules/IDE/reducers/project.js b/client/modules/IDE/reducers/project.js index 89a03529e6..5f1969c79d 100644 --- a/client/modules/IDE/reducers/project.js +++ b/client/modules/IDE/reducers/project.js @@ -1,4 +1,4 @@ -import * as ActionTypes from '../../../constants'; +import ActionTypes from '../../../constants'; import { generateProjectName } from '../../../utils/generateRandomName'; const initialState = () => { diff --git a/client/modules/IDE/reducers/projects.js b/client/modules/IDE/reducers/projects.js index 5950a042fa..907c62dcc8 100644 --- a/client/modules/IDE/reducers/projects.js +++ b/client/modules/IDE/reducers/projects.js @@ -1,4 +1,4 @@ -import * as ActionTypes from '../../../constants'; +import ActionTypes from '../../../constants'; const sketches = (state = [], action) => { switch (action.type) { diff --git a/client/modules/IDE/reducers/search.js b/client/modules/IDE/reducers/search.js index 67d352433e..a28cc8969b 100644 --- a/client/modules/IDE/reducers/search.js +++ b/client/modules/IDE/reducers/search.js @@ -1,4 +1,4 @@ -import * as ActionTypes from '../../../constants'; +import ActionTypes from '../../../constants'; const initialState = { collectionSearchTerm: '', diff --git a/client/modules/IDE/reducers/sorting.js b/client/modules/IDE/reducers/sorting.js index 747d16c80a..0d4f89641f 100644 --- a/client/modules/IDE/reducers/sorting.js +++ b/client/modules/IDE/reducers/sorting.js @@ -1,4 +1,4 @@ -import * as ActionTypes from '../../../constants'; +import ActionTypes from '../../../constants'; import { DIRECTION } from '../actions/sorting'; const initialState = { diff --git a/client/modules/IDE/reducers/toast.js b/client/modules/IDE/reducers/toast.js index b680c7cfef..4c0fe64ee3 100644 --- a/client/modules/IDE/reducers/toast.js +++ b/client/modules/IDE/reducers/toast.js @@ -1,4 +1,4 @@ -import * as ActionTypes from '../../../constants'; +import ActionTypes from '../../../constants'; const initialState = { isVisible: false, diff --git a/client/modules/User/actions.js b/client/modules/User/actions.js index db367d388d..067442c857 100644 --- a/client/modules/User/actions.js +++ b/client/modules/User/actions.js @@ -1,5 +1,5 @@ import { FORM_ERROR } from 'final-form'; -import * as ActionTypes from '../../constants'; +import ActionTypes from '../../constants'; import browserHistory from '../../browserHistory'; import apiClient from '../../utils/apiClient'; import { showErrorModal, justOpenedProject } from '../IDE/actions/ide'; diff --git a/client/modules/User/reducers.js b/client/modules/User/reducers.js index 2832190b28..e013cdd9f3 100644 --- a/client/modules/User/reducers.js +++ b/client/modules/User/reducers.js @@ -1,4 +1,4 @@ -import * as ActionTypes from '../../constants'; +import ActionTypes from '../../constants'; const user = (state = { authenticated: false }, action) => { switch (action.type) {