From 5f071ca4013e4f99d202a709330b5be9c1ca0051 Mon Sep 17 00:00:00 2001 From: Bohdan Iakymets Date: Tue, 20 Nov 2018 13:38:02 +0100 Subject: [PATCH] Changed aliases to `_` - root folder --- .flowconfig | 1 + README.md | 28 ------------------- config/webpack.config.commons.js | 8 +----- jsconfig.json | 16 +++++++++++ package.json | 8 ++---- src/App.js | 2 +- src/GlobalErrorBoundary.js | 2 +- src/actions/activeRequests.js | 2 +- src/actions/clusters.js | 2 +- src/actions/console.js | 2 +- src/actions/dataCenters.js | 2 +- src/actions/error.js | 2 +- src/actions/hosts.js | 2 +- src/actions/index.js | 2 +- src/actions/operatingSystems.js | 2 +- src/actions/options.js | 2 +- src/actions/pendingTasks.js | 4 +-- src/actions/pool.js | 2 +- src/actions/storageDomains.js | 2 +- src/actions/templates.js | 2 +- src/actions/userMessages.js | 2 +- src/actions/visibility.js | 2 +- src/actions/vm.js | 2 +- src/actions/vnicProfiles.js | 2 +- src/components/About.js | 2 +- src/components/Breadcrumb/index.js | 2 +- src/components/CloudInitEditor/index.js | 2 +- src/components/ConsoleOptions/index.js | 2 +- src/components/FieldHelp/index.js | 2 +- src/components/HostConsole/index.js | 4 +-- src/components/LoadingData/index.js | 2 +- .../NavigationConfirmationModal/index.js | 2 +- src/components/NewDiskDialog/actions.js | 2 +- src/components/NewDiskDialog/index.js | 5 ++-- src/components/NewDiskDialog/reducers.js | 2 +- src/components/OptionsDialog/index.js | 2 +- src/components/OptionsDialog/sagas.js | 2 +- src/components/OvirtApiCheckFailed.js | 2 +- src/components/Pages/index.js | 8 +++--- src/components/SelectBox.js | 2 +- src/components/Switch.js | 2 +- src/components/Time.js | 2 +- src/components/ToastNotifications.js | 2 +- src/components/TokenExpired.js | 2 +- src/components/Toolbar/index.js | 2 +- src/components/VmActions/Button.js | 2 +- src/components/VmActions/ConfirmationModal.js | 2 +- .../VmActions/ConsoleConfirmationModal.js | 4 +-- src/components/VmActions/WindowsRdpButton.js | 6 ++-- src/components/VmActions/index.js | 6 ++-- src/components/VmDetail/VmConsoles.js | 2 +- src/components/VmDetail/VmStatus.js | 2 +- src/components/VmDetail/index.js | 12 ++++---- src/components/VmDetail/labels.js | 2 +- src/components/VmDetailRow/ExpandableList.js | 2 +- src/components/VmDetailRow/index.js | 2 +- .../cards/DetailsCard/ConsoleList.js | 4 +-- .../DetailsCard/HotPlugConfirmationModal.js | 2 +- .../NextRunChangeConfirmationModal.js | 2 +- .../VmDetails/cards/DetailsCard/index.js | 12 ++++---- .../VmDetails/cards/DisksCard/index.js | 4 +-- .../VmDetails/cards/NicsCard/NicEditor.js | 2 +- .../cards/NicsCard/NicLinkStateIcon.js | 2 +- .../VmDetails/cards/NicsCard/NicListItem.js | 2 +- .../VmDetails/cards/NicsCard/index.js | 6 ++-- .../VmDetails/cards/OverviewCard/index.js | 6 ++-- .../cards/SnapshotsCard/NewSnapshotModal.js | 2 +- .../SnapshotsCard/RestoreConfirmationModal.js | 2 +- .../cards/SnapshotsCard/SnapshotDetail.js | 4 +-- .../cards/SnapshotsCard/SnapshotItem.js | 4 +-- .../VmDetails/cards/SnapshotsCard/index.js | 2 +- .../VmDetails/cards/SnapshotsCard/sagas.js | 8 +++--- .../cards/UtilizationCard/DiskCharts.js | 2 +- .../cards/UtilizationCard/MemoryCharts.js | 2 +- src/components/VmDialog/AddVmButton.js | 2 +- src/components/VmDialog/IconUpload/index.js | 2 +- src/components/VmDialog/index.js | 12 ++++---- src/components/VmDisks/VmDisk.js | 6 ++-- src/components/VmDisks/index.js | 2 +- src/components/VmDisks/utils.js | 4 +-- .../VmModals/DeleteConfirmationModal.js | 2 +- src/components/VmNics/NewNicModal.js | 2 +- src/components/VmNics/index.js | 6 ++-- src/components/VmUserMessages/index.js | 6 ++-- src/components/VmsList/Pool.js | 4 +-- src/components/VmsList/Vm.js | 4 +-- src/components/VmsList/Vms.js | 2 +- src/components/VmsList/index.js | 2 +- src/components/VmsListNavigation/index.js | 2 +- src/components/VmsPageHeader/UserMenu.js | 4 +-- src/components/VmsPageHeader/index.js | 6 ++-- src/config.js | 2 +- src/helpers.js | 2 +- src/helpers.test.js | 2 +- src/index.js | 6 ++-- src/reducers/activeRequests.js | 2 +- src/reducers/clusters.js | 4 +-- src/reducers/config.js | 2 +- src/reducers/consoles.js | 2 +- src/reducers/dataCenters.js | 2 +- src/reducers/hosts.js | 4 +-- src/reducers/icons.js | 2 +- src/reducers/operatingSystems.js | 4 +-- src/reducers/options.js | 2 +- src/reducers/pendingTasks.js | 2 +- src/reducers/storageDomains.js | 4 +-- src/reducers/templates.js | 4 +-- src/reducers/userMessages.js | 2 +- src/reducers/utils.js | 2 +- src/reducers/vms.js | 2 +- src/reducers/vnicProfiles.js | 2 +- src/routes.js | 4 +-- src/saga/console/index.js | 6 ++-- src/saga/disks.js | 2 +- src/saga/login.js | 4 +-- src/saga/utils.js | 6 ++-- src/sagas.js | 6 ++-- 117 files changed, 196 insertions(+), 218 deletions(-) create mode 100644 jsconfig.json diff --git a/.flowconfig b/.flowconfig index 5dfe324b1..486593c9d 100644 --- a/.flowconfig +++ b/.flowconfig @@ -7,5 +7,6 @@ [options] module.name_mapper.extension='css' -> '/config/flow/css.js.flow' +module.name_mapper='^_\/\(.*\)$' ->'/src/\1' suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe suppress_comment=\\(.\\|\n\\)*\\$FlowIssue diff --git a/README.md b/README.md index 1d61995af..56168a4b9 100644 --- a/README.md +++ b/README.md @@ -130,34 +130,6 @@ For Chrome: [https://chrome.google.com/webstore/detail/redux-devtools/lmhkpmbekc For Firefox: [https://addons.mozilla.org/en-us/firefox/addon/remotedev/](https://addons.mozilla.org/en-us/firefox/addon/remotedev/) - -### Aliases configuration in IDE - -You need to configure your IDE to properly work with aliases. - -#### VSCode - -Find or create `jsconfig.json` in root project folder and add there next lines: - -``` -{ - "compilerOptions": { - ... - "allowSyntheticDefaultImports": false, - "baseUrl": "./", - "paths": { - "ovirtapi": ["src/ovirtapi/index.js"], - "app-intl": ["src/intl/index.js"], - "app-actions": ["src/actions/index.js"], - "app-reducers/*": ["src/reducers/*"], - "app-constants": ["src/constants/index.js"], - "app-helpers": ["src/helpers.js"] - } - }, - ... -} -``` - ## Technical Details - based on React, Patternfly, Redux, Redux-Saga - based on ejected [create-react-app](https://facebook.github.io/react/blog/2016/07/22/create-apps-with-no-configuration.html) diff --git a/config/webpack.config.commons.js b/config/webpack.config.commons.js index 650ec4ee7..e8d4d7fdb 100644 --- a/config/webpack.config.commons.js +++ b/config/webpack.config.commons.js @@ -24,12 +24,6 @@ exports.addFlowBabelWebpackPlugin = function (webpackConfig) { exports.commonAliases = function () { return { - 'ovirtapi': `${paths.appSrc}/ovirtapi/index.js`, - 'app-utils': `${paths.appSrc}/utils/index.js`, - 'app-intl': `${paths.appSrc}/intl/index.js`, - 'app-reducers': `${paths.appSrc}/reducers`, - 'app-actions': `${paths.appSrc}/actions/index.js`, - 'app-helpers': `${paths.appSrc}/helpers.js`, - 'app-constants': `${paths.appSrc}/constants/index.js` + '_': `${paths.appSrc}` } } diff --git a/jsconfig.json b/jsconfig.json new file mode 100644 index 000000000..0a8d52e63 --- /dev/null +++ b/jsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "target": "es2017", + "allowSyntheticDefaultImports": false, + "baseUrl": "./", + "paths": { + "ovirtapi": ["src/ovirtapi/index.js"], + "app-intl": ["src/intl/index.js"], + "app-actions": ["src/actions/index.js"], + "app-reducers/*": ["src/reducers/*"], + "app-constants": ["src/constants/index.js"], + "app-helpers": ["src/helpers.js"] + } + }, + "exclude": ["node_modules", "dist"] +} diff --git a/package.json b/package.json index 6ae2d2c83..f3a5b1d88 100644 --- a/package.json +++ b/package.json @@ -123,12 +123,8 @@ "moduleNameMapper": { "^.+\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "/config/jest/FileStub.js", "^.+\\.css$": "/config/jest/CSSStub.js", - "ovirtapi": "/src/mock/ovirtapi.mock.js", - "app-intl": "/src/intl/index.js", - "app-actions": "/src/actions/index.js", - "app-reducers(.*)$": "/src/reducers/$1", - "app-constants": "/src/constants/index.js", - "app-helpers": "/src/helpers.js" + "_/ovirtapi": "/src/mock/ovirtapi.mock.js", + "_/(.*)$": "/src/$1" }, "transform": { ".*": "/config/jest/transform.js" diff --git a/src/App.js b/src/App.js index 295b296aa..e31aa7499 100644 --- a/src/App.js +++ b/src/App.js @@ -15,7 +15,7 @@ import ToastNotifications from './components/ToastNotifications' import getRoutes from './routes' import AppConfiguration from './config' import { fixedStrings } from './branding' -import { msg } from 'app-intl' +import { msg } from '_/intl' /** * Login (token) to Engine is missing. diff --git a/src/GlobalErrorBoundary.js b/src/GlobalErrorBoundary.js index 587464370..74fe1978e 100644 --- a/src/GlobalErrorBoundary.js +++ b/src/GlobalErrorBoundary.js @@ -1,7 +1,7 @@ import React from 'react' import PropTypes from 'prop-types' import * as branding from './branding' -import { msg } from 'app-intl' +import { msg } from '_/intl' import styles from './error.css' import AppConfiguration from './config' diff --git a/src/actions/activeRequests.js b/src/actions/activeRequests.js index b5a19810e..1f70c0209 100644 --- a/src/actions/activeRequests.js +++ b/src/actions/activeRequests.js @@ -2,7 +2,7 @@ import { ADD_ACTIVE_REQUEST, REMOVE_ACTIVE_REQUEST, DELAYED_REMOVE_ACTIVE_REQUEST, -} from 'app-constants' +} from '_/constants' export function addActiveRequest (requestId) { return { diff --git a/src/actions/clusters.js b/src/actions/clusters.js index 23ec2e389..817765b45 100644 --- a/src/actions/clusters.js +++ b/src/actions/clusters.js @@ -1,7 +1,7 @@ import { GET_ALL_CLUSTERS, SET_CLUSTERS, -} from 'app-constants' +} from '_/constants' export function setClusters (clusters) { return { diff --git a/src/actions/console.js b/src/actions/console.js index 0af90426b..5b82d8f41 100644 --- a/src/actions/console.js +++ b/src/actions/console.js @@ -1,4 +1,4 @@ -import { SET_CONSOLE_IN_USE, CHECK_CONSOLE_IN_USE, SET_CONSOLE_VALID } from 'app-constants' +import { SET_CONSOLE_IN_USE, CHECK_CONSOLE_IN_USE, SET_CONSOLE_VALID } from '_/constants' export function setConsoleInUse ({ vmId, consoleInUse }) { return { diff --git a/src/actions/dataCenters.js b/src/actions/dataCenters.js index c5c3c156f..8a51d2c87 100644 --- a/src/actions/dataCenters.js +++ b/src/actions/dataCenters.js @@ -2,7 +2,7 @@ import { SET_DATA_CENTERS, -} from 'app-constants' +} from '_/constants' export function setDataCenters (dataCenters: Array): Object { return { diff --git a/src/actions/error.js b/src/actions/error.js index b47692a0a..6d4aa7155 100644 --- a/src/actions/error.js +++ b/src/actions/error.js @@ -1,4 +1,4 @@ -import { FAILED_EXTERNAL_ACTION, LOGIN_FAILED } from 'app-constants' +import { FAILED_EXTERNAL_ACTION, LOGIN_FAILED } from '_/constants' function customizeErrorMessage (message) { const result = message.replace('Vm ', 'VM ') diff --git a/src/actions/hosts.js b/src/actions/hosts.js index faa32f169..356ec09fa 100644 --- a/src/actions/hosts.js +++ b/src/actions/hosts.js @@ -1,7 +1,7 @@ import { GET_ALL_HOSTS, SET_HOSTS, -} from 'app-constants' +} from '_/constants' export function setHosts (hosts) { return { diff --git a/src/actions/index.js b/src/actions/index.js index 313b1ad69..dab3646b1 100644 --- a/src/actions/index.js +++ b/src/actions/index.js @@ -16,7 +16,7 @@ import { SHOW_TOKEN_EXPIRED_MSG, START_SCHEDULER_FIXED_DELAY, STOP_SCHEDULER_FIXED_DELAY, -} from 'app-constants' +} from '_/constants' export * from './error' export * from './vm' diff --git a/src/actions/operatingSystems.js b/src/actions/operatingSystems.js index 194e752dc..09e01a5d8 100644 --- a/src/actions/operatingSystems.js +++ b/src/actions/operatingSystems.js @@ -1,7 +1,7 @@ import { GET_ALL_OS, SET_OPERATING_SYSTEMS, -} from 'app-constants' +} from '_/constants' /** * @param {Array} operatingSystems diff --git a/src/actions/options.js b/src/actions/options.js index 98a17365b..da4ae91ed 100644 --- a/src/actions/options.js +++ b/src/actions/options.js @@ -2,7 +2,7 @@ import { GET_CONSOLE_OPTIONS, SAVE_CONSOLE_OPTIONS, SET_CONSOLE_OPTIONS, -} from 'app-constants' +} from '_/constants' export function setConsoleOptions ({ vmId, options }) { return { diff --git a/src/actions/pendingTasks.js b/src/actions/pendingTasks.js index 45c411cc9..b27cdded6 100644 --- a/src/actions/pendingTasks.js +++ b/src/actions/pendingTasks.js @@ -10,9 +10,9 @@ import { REMOVE_SNAPSHOT_ADD_PENDING_TASK, REMOVE_SNAPSHOT_REMOVAL_PENDING_TASK, REMOVE_SNAPSHOT_RESTORE_PENDING_TASK, -} from 'app-constants' +} from '_/constants' -import { PendingTaskTypes } from 'app-reducers/pendingTasks' +import { PendingTaskTypes } from '_/reducers/pendingTasks' export function addDiskRemovalPendingTask (diskId: string) { return { diff --git a/src/actions/pool.js b/src/actions/pool.js index 912734986..7cbcd7f28 100644 --- a/src/actions/pool.js +++ b/src/actions/pool.js @@ -8,7 +8,7 @@ import { START_POOL, UPDATE_POOLS, UPDATE_VMPOOLS_COUNT, -} from 'app-constants' +} from '_/constants' export function getPoolsByPage ({ page }) { return { diff --git a/src/actions/storageDomains.js b/src/actions/storageDomains.js index a6553824d..07948a135 100644 --- a/src/actions/storageDomains.js +++ b/src/actions/storageDomains.js @@ -6,7 +6,7 @@ import { GET_ISO_STORAGE_DOMAINS, SET_STORAGE_DOMAIN_FILES, SET_STORAGE_DOMAINS, -} from 'app-constants' +} from '_/constants' export function getAllStorageDomains (): Object { return { diff --git a/src/actions/templates.js b/src/actions/templates.js index dfe02ab7d..38c653749 100644 --- a/src/actions/templates.js +++ b/src/actions/templates.js @@ -1,7 +1,7 @@ import { GET_ALL_TEMPLATES, SET_TEMPLATES, -} from 'app-constants' +} from '_/constants' /** * @param {Array} templates diff --git a/src/actions/userMessages.js b/src/actions/userMessages.js index 29e22a509..37055df48 100644 --- a/src/actions/userMessages.js +++ b/src/actions/userMessages.js @@ -3,7 +3,7 @@ import { CLEAR_USER_MSGS, DISMISS_USER_MSG, SET_USERMSG_NOTIFIED, -} from 'app-constants' +} from '_/constants' export function addUserMessage ({ message, shortMessage, type = '' }) { return { diff --git a/src/actions/visibility.js b/src/actions/visibility.js index 20ba3df1f..21f5f678f 100644 --- a/src/actions/visibility.js +++ b/src/actions/visibility.js @@ -1,7 +1,7 @@ import { SELECT_POOL_DETAIL, SELECT_VM_DETAIL, -} from 'app-constants' +} from '_/constants' export function selectVmDetail ({ vmId }) { return { diff --git a/src/actions/vm.js b/src/actions/vm.js index 974b663e4..9bd7647f5 100644 --- a/src/actions/vm.js +++ b/src/actions/vm.js @@ -35,7 +35,7 @@ import { UPDATE_VM_DISK, UPDATE_VMS, VM_ACTION_IN_PROGRESS, -} from 'app-constants' +} from '_/constants' export function login ({ username, password, token, userId }) { return { diff --git a/src/actions/vnicProfiles.js b/src/actions/vnicProfiles.js index 6b91dd0cb..b613cc427 100644 --- a/src/actions/vnicProfiles.js +++ b/src/actions/vnicProfiles.js @@ -2,7 +2,7 @@ import { ADD_NETWORKS_TO_VNIC_PROFILES, SET_VNIC_PROFILES, GET_ALL_VNIC_PROFILES, -} from 'app-constants' +} from '_/constants' export function setVnicProfiles ({ vnicProfiles }) { return { diff --git a/src/components/About.js b/src/components/About.js index a8d785571..7c53958c5 100644 --- a/src/components/About.js +++ b/src/components/About.js @@ -3,7 +3,7 @@ import PropTypes from 'prop-types' import { connect } from 'react-redux' -import { msg } from 'app-intl' +import { msg } from '_/intl' import { Modal } from 'patternfly-react' import Product from '../version' diff --git a/src/components/Breadcrumb/index.js b/src/components/Breadcrumb/index.js index 235fcb04d..c87d9605c 100644 --- a/src/components/Breadcrumb/index.js +++ b/src/components/Breadcrumb/index.js @@ -2,7 +2,7 @@ import React from 'react' import PropTypes from 'prop-types' import { Link } from 'react-router-dom' import { connect } from 'react-redux' -import { msg } from 'app-intl' +import { msg } from '_/intl' const buildPath = (vms, branches) => { const res = [] diff --git a/src/components/CloudInitEditor/index.js b/src/components/CloudInitEditor/index.js index e4e0806ca..83b606143 100644 --- a/src/components/CloudInitEditor/index.js +++ b/src/components/CloudInitEditor/index.js @@ -2,7 +2,7 @@ import React from 'react' import PropTypes from 'prop-types' import Switch from 'react-bootstrap-switch' -import { msg } from 'app-intl' +import { msg } from '_/intl' import FieldHelp from '../FieldHelp/index' import style from './style.css' diff --git a/src/components/ConsoleOptions/index.js b/src/components/ConsoleOptions/index.js index a6bdd466a..ac2e9eca1 100644 --- a/src/components/ConsoleOptions/index.js +++ b/src/components/ConsoleOptions/index.js @@ -5,7 +5,7 @@ import Switch from 'react-bootstrap-switch' import style from './style.css' import FieldHelp from '../FieldHelp/index' -import { msg } from 'app-intl' +import { msg } from '_/intl' class ConsoleOptions extends React.Component { constructor (props) { diff --git a/src/components/FieldHelp/index.js b/src/components/FieldHelp/index.js index 61883a861..c8f8d81c7 100644 --- a/src/components/FieldHelp/index.js +++ b/src/components/FieldHelp/index.js @@ -5,7 +5,7 @@ import $ from 'jquery' import { Popover, OverlayTrigger } from 'react-bootstrap' -import { msg } from 'app-intl' +import { msg } from '_/intl' import style from './style.css' /** diff --git a/src/components/HostConsole/index.js b/src/components/HostConsole/index.js index d254787e8..4152fc2ee 100644 --- a/src/components/HostConsole/index.js +++ b/src/components/HostConsole/index.js @@ -3,8 +3,8 @@ import PropTypes from 'prop-types' import { connect } from 'react-redux' -import AppConfiguration from '../../config' -import { msg } from 'app-intl' +import AppConfiguration from '_/config' +import { msg } from '_/intl' import style from './style.css' diff --git a/src/components/LoadingData/index.js b/src/components/LoadingData/index.js index a15adada3..f61efe8f1 100644 --- a/src/components/LoadingData/index.js +++ b/src/components/LoadingData/index.js @@ -3,7 +3,7 @@ import PropTypes from 'prop-types' import { connect } from 'react-redux' -import { msg } from 'app-intl' +import { msg } from '_/intl' import style from './style.css' /** diff --git a/src/components/NavigationConfirmationModal/index.js b/src/components/NavigationConfirmationModal/index.js index 259176b37..7c8f33d21 100644 --- a/src/components/NavigationConfirmationModal/index.js +++ b/src/components/NavigationConfirmationModal/index.js @@ -1,7 +1,7 @@ import React from 'react' import PropTypes from 'prop-types' import { Modal, Button, Alert } from 'patternfly-react' -import { msg } from 'app-intl' +import { msg } from '_/intl' const NavigationConfirmationModal = ({ show, onYes, onNo }) => { const idPrefix = 'close-dialog-confim' diff --git a/src/components/NewDiskDialog/actions.js b/src/components/NewDiskDialog/actions.js index 3b362df41..91b95d5ea 100644 --- a/src/components/NewDiskDialog/actions.js +++ b/src/components/NewDiskDialog/actions.js @@ -6,7 +6,7 @@ import { SET_NEW_DISK_DIALOG_PROGRESS_INDICATOR, SET_NEW_DISK_DIALOG_ERROR_TEXT, SET_NEW_DISK_DIALOG_DONE, -} from 'app-constants' +} from '_/constants' export function cleanNewDiskDialogSubtree () { return { diff --git a/src/components/NewDiskDialog/index.js b/src/components/NewDiskDialog/index.js index a6b29bf89..e728df583 100644 --- a/src/components/NewDiskDialog/index.js +++ b/src/components/NewDiskDialog/index.js @@ -5,10 +5,9 @@ import { Modal } from 'patternfly-react' import { createDiskForVm } from '_/actions' import { cleanNewDiskDialogSubtree } from './actions' - -import { msg } from 'app-intl' +import { msg } from '_/intl' import SelectBox from '../SelectBox' -import { flatMap, parseGbToBytes } from 'app-utils' +import { flatMap, parseGbToBytes } from '_/utils' import style from './style.css' class NewDiskDialog extends React.Component { diff --git a/src/components/NewDiskDialog/reducers.js b/src/components/NewDiskDialog/reducers.js index 1a25f8fbf..3d4f66487 100644 --- a/src/components/NewDiskDialog/reducers.js +++ b/src/components/NewDiskDialog/reducers.js @@ -1,6 +1,6 @@ import { fromJS } from 'immutable' -import { actionReducer } from 'app-reducers/utils.js' +import { actionReducer } from '_/reducers/utils.js' import { CLEAN_NEW_DISK_DIALOG_SUBTREE, SET_NEW_DISK_DIALOG_DONE, diff --git a/src/components/OptionsDialog/index.js b/src/components/OptionsDialog/index.js index 0ce654da2..beef43975 100644 --- a/src/components/OptionsDialog/index.js +++ b/src/components/OptionsDialog/index.js @@ -11,7 +11,7 @@ import { saveSSHKey, } from './actions' -import { msg } from 'app-intl' +import { msg } from '_/intl' class OptionsDialog extends React.Component { constructor (props) { diff --git a/src/components/OptionsDialog/sagas.js b/src/components/OptionsDialog/sagas.js index 03e0b0f92..b5b34acab 100644 --- a/src/components/OptionsDialog/sagas.js +++ b/src/components/OptionsDialog/sagas.js @@ -1,7 +1,7 @@ import { put, takeEvery } from 'redux-saga/effects' import { SAVE_SSH_KEY, GET_SSH_KEY } from './constants' import { setSSHKey, setUnloaded } from './actions' -import Api from 'ovirtapi' +import Api from '_/ovirtapi' function* saveSSHKey (sagas, action) { yield sagas.callExternalAction('saveSSHKey', Api.saveSSHKey, action) diff --git a/src/components/OvirtApiCheckFailed.js b/src/components/OvirtApiCheckFailed.js index d69c9604d..96a263b58 100644 --- a/src/components/OvirtApiCheckFailed.js +++ b/src/components/OvirtApiCheckFailed.js @@ -3,7 +3,7 @@ import PropTypes from 'prop-types' import { connect } from 'react-redux' import Product from '../version' -import { msg } from 'app-intl' +import { msg } from '_/intl' import { fixedStrings } from '../branding' import ErrorAlert from './ErrorAlert' diff --git a/src/components/Pages/index.js b/src/components/Pages/index.js index 6069104b2..7edb2b845 100644 --- a/src/components/Pages/index.js +++ b/src/components/Pages/index.js @@ -1,19 +1,19 @@ import React from 'react' import PropTypes from 'prop-types' import { connect } from 'react-redux' -import { RouterPropTypeShapes } from '../../propTypeShapes' +import { RouterPropTypeShapes } from '_/propTypeShapes' import { push } from 'connected-react-router' -import { msg } from 'app-intl' -import { canUserUseAnyClusters } from 'app-utils' +import { msg } from '_/intl' +import { canUserUseAnyClusters } from '_/utils' import VmDialog from '../VmDialog' import VmsList from '../VmsList' import VmDetails from '../VmDetails' import { default as LegacyVmDetails } from '../VmDetail' -import { addUserMessage } from 'app-actions' +import { addUserMessage } from '_/actions' /** * Route component (for PageRouter) to view the list of VMs and Pools diff --git a/src/components/SelectBox.js b/src/components/SelectBox.js index 2430542d4..9b67d5faa 100644 --- a/src/components/SelectBox.js +++ b/src/components/SelectBox.js @@ -1,6 +1,6 @@ import React from 'react' import PropTypes from 'prop-types' -import { sortedBy } from 'app-helpers' +import { sortedBy } from '_/helpers' import style from './sharedStyle.css' diff --git a/src/components/Switch.js b/src/components/Switch.js index d457ad62b..ffa86a672 100644 --- a/src/components/Switch.js +++ b/src/components/Switch.js @@ -1,6 +1,6 @@ import React from 'react' import { Switch as PfSwitch } from 'patternfly-react' -import { enumMsg } from 'app-intl' +import { enumMsg } from '_/intl' const Switch = (props) => { const t = new Date(time) diff --git a/src/components/ToastNotifications.js b/src/components/ToastNotifications.js index b0ff451ee..39ce52805 100644 --- a/src/components/ToastNotifications.js +++ b/src/components/ToastNotifications.js @@ -3,7 +3,7 @@ import PropTypes from 'prop-types' import { connect } from 'react-redux' import { TimedToastNotification, ToastNotificationList } from 'patternfly-react' -import { setNotificationNotified } from 'app-actions' +import { setNotificationNotified } from '_/actions' import style from './sharedStyle.css' diff --git a/src/components/TokenExpired.js b/src/components/TokenExpired.js index daa8c6387..decd9bbe4 100644 --- a/src/components/TokenExpired.js +++ b/src/components/TokenExpired.js @@ -3,7 +3,7 @@ import PropTypes from 'prop-types' import { connect } from 'react-redux' import ErrorAlert from './ErrorAlert' -import { msg } from 'app-intl' +import { msg } from '_/intl' // TODO: allow the user to cancel the automatic reload? // If so, change config.isTokenExpired to false and add additional check to doCheckTokenExpired() before actual reload diff --git a/src/components/Toolbar/index.js b/src/components/Toolbar/index.js index 16a77426f..dd683024e 100644 --- a/src/components/Toolbar/index.js +++ b/src/components/Toolbar/index.js @@ -2,7 +2,7 @@ import React from 'react' import PropTypes from 'prop-types' import { connect } from 'react-redux' -import { RouterPropTypeShapes } from '../../propTypeShapes' +import { RouterPropTypeShapes } from '_/propTypeShapes' import VmActions from '../VmActions' const VmDetailToolbar = ({ match, vms }) => { diff --git a/src/components/VmActions/Button.js b/src/components/VmActions/Button.js index f6e4af254..61c8aac6d 100644 --- a/src/components/VmActions/Button.js +++ b/src/components/VmActions/Button.js @@ -3,7 +3,7 @@ import PropTypes from 'prop-types' import style from './style.css' -import { hrefWithoutHistory } from 'app-helpers' +import { hrefWithoutHistory } from '_/helpers' class Button extends React.Component { render () { diff --git a/src/components/VmActions/ConfirmationModal.js b/src/components/VmActions/ConfirmationModal.js index 94b4b39ba..953c73037 100644 --- a/src/components/VmActions/ConfirmationModal.js +++ b/src/components/VmActions/ConfirmationModal.js @@ -1,7 +1,7 @@ import React from 'react' import PropsTypes from 'prop-types' import { Modal, Icon } from 'patternfly-react' -import { msg } from 'app-intl' +import { msg } from '_/intl' const btnPropType = PropsTypes.shape({ title: PropsTypes.string, diff --git a/src/components/VmActions/ConsoleConfirmationModal.js b/src/components/VmActions/ConsoleConfirmationModal.js index 70b802aa2..60a22bda7 100644 --- a/src/components/VmActions/ConsoleConfirmationModal.js +++ b/src/components/VmActions/ConsoleConfirmationModal.js @@ -3,9 +3,9 @@ import PropTypes from 'prop-types' import { connect } from 'react-redux' import ConfirmationModal from './ConfirmationModal' -import { downloadConsole, checkConsoleInUse, setConsoleInUse } from 'app-actions' +import { downloadConsole, checkConsoleInUse, setConsoleInUse } from '_/actions' -import { msg } from 'app-intl' +import { msg } from '_/intl' class ConsoleConfirmationModal extends React.Component { constructor (props) { diff --git a/src/components/VmActions/WindowsRdpButton.js b/src/components/VmActions/WindowsRdpButton.js index 35297b785..861afde75 100644 --- a/src/components/VmActions/WindowsRdpButton.js +++ b/src/components/VmActions/WindowsRdpButton.js @@ -2,9 +2,9 @@ import React from 'react' import PropTypes from 'prop-types' import { connect } from 'react-redux' -import { getRDP } from 'app-actions' -import { isWindows } from 'app-helpers' -import { canConsole } from '../../vm-status' +import { getRDP } from '_/actions' +import { isWindows } from '_/helpers' +import { canConsole } from '_/vm-status' /** * Button to send a RDP connection file to the user for a Windows VM. diff --git a/src/components/VmActions/index.js b/src/components/VmActions/index.js index 4d55d947e..cc6fc07c3 100644 --- a/src/components/VmActions/index.js +++ b/src/components/VmActions/index.js @@ -5,8 +5,8 @@ import { connect } from 'react-redux' import { withRouter } from 'react-router-dom' import style from './style.css' -import { msg } from 'app-intl' -import { RouterPropTypeShapes } from '../../propTypeShapes' +import { msg } from '_/intl' +import { RouterPropTypeShapes } from '_/propTypeShapes' import { canRestart, @@ -24,7 +24,7 @@ import { startPool, startVm, removeVm, -} from 'app-actions' +} from '_/actions' import { SplitButton, MenuItem } from 'patternfly-react' import Checkbox from '../Checkbox' diff --git a/src/components/VmDetail/VmConsoles.js b/src/components/VmDetail/VmConsoles.js index 62b2ba3cc..39c4bbb7f 100644 --- a/src/components/VmDetail/VmConsoles.js +++ b/src/components/VmDetail/VmConsoles.js @@ -1,7 +1,7 @@ import React from 'react' import PropTypes from 'prop-types' -import { isWindows } from 'app-helpers' +import { isWindows } from '_/helpers' import { ActionButtonWraper } from '../VmActions/Action' import ConsoleConfirmationModal from '../VmActions/ConsoleConfirmationModal' import { canConsole } from '../../vm-status' diff --git a/src/components/VmDetail/VmStatus.js b/src/components/VmDetail/VmStatus.js index 857aa56e3..560b59ed0 100644 --- a/src/components/VmDetail/VmStatus.js +++ b/src/components/VmDetail/VmStatus.js @@ -5,7 +5,7 @@ import { connect } from 'react-redux' import VmStatusIcon from '../VmStatusIcon' import FieldHelp from '../FieldHelp' -import { msg, enumMsg } from 'app-intl' +import { msg, enumMsg } from '_/intl' import HostConsole, { hasUserHostConsoleAccess, CockpitAHREF } from '../HostConsole/index' diff --git a/src/components/VmDetail/index.js b/src/components/VmDetail/index.js index 7d4a27881..6fe3ef445 100644 --- a/src/components/VmDetail/index.js +++ b/src/components/VmDetail/index.js @@ -3,9 +3,9 @@ import PropTypes from 'prop-types' import { connect } from 'react-redux' -import AppConfiguration from '../../config' -import { msg } from 'app-intl' -import { canDeleteDisk } from '../../vm-status' +import AppConfiguration from '_/config' +import { msg } from '_/intl' +import { canDeleteDisk } from '_/vm-status' import style from './style.css' import sharedStyle from '../sharedStyle.css' @@ -13,9 +13,9 @@ import sharedStyle from '../sharedStyle.css' import { getConsoleOptions, saveConsoleOptions, -} from 'app-actions' +} from '_/actions' -import { templateNameRenderer, userFormatOfBytes } from 'app-helpers' +import { templateNameRenderer, userFormatOfBytes } from '_/helpers' import ConsoleOptions from '../ConsoleOptions' import DetailContainer from '../DetailContainer' @@ -29,7 +29,7 @@ import VmsListNavigation from '../VmsListNavigation' import VmStatus from './VmStatus' import { NextRunLabel } from './labels' -import Selectors from '../../selectors' +import Selectors from '_/selectors' import { getOsHumanName, getVmIcon } from '../utils' function rephraseVmType (vmType) { diff --git a/src/components/VmDetail/labels.js b/src/components/VmDetail/labels.js index 5cb8a008f..58988f474 100644 --- a/src/components/VmDetail/labels.js +++ b/src/components/VmDetail/labels.js @@ -2,7 +2,7 @@ import React from 'react' import PropTypes from 'prop-types' import FieldHelp from '../FieldHelp/index' -import { msg } from 'app-intl' +import { msg } from '_/intl' import style from './style.css' diff --git a/src/components/VmDetailRow/ExpandableList.js b/src/components/VmDetailRow/ExpandableList.js index 8eba08028..9e5327968 100644 --- a/src/components/VmDetailRow/ExpandableList.js +++ b/src/components/VmDetailRow/ExpandableList.js @@ -1,6 +1,6 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' -import { msg } from 'app-intl' +import { msg } from '_/intl' import style from './style.css' diff --git a/src/components/VmDetailRow/index.js b/src/components/VmDetailRow/index.js index 8af2ecfd1..d98fd9b32 100644 --- a/src/components/VmDetailRow/index.js +++ b/src/components/VmDetailRow/index.js @@ -1,6 +1,6 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' -import { msg } from 'app-intl' +import { msg } from '_/intl' import FieldHelp from '../FieldHelp' import ExpandableList from './ExpandableList' diff --git a/src/components/VmDetails/cards/DetailsCard/ConsoleList.js b/src/components/VmDetails/cards/DetailsCard/ConsoleList.js index 37ec7af54..b3aa28c05 100644 --- a/src/components/VmDetails/cards/DetailsCard/ConsoleList.js +++ b/src/components/VmDetails/cards/DetailsCard/ConsoleList.js @@ -2,8 +2,8 @@ import React from 'react' import PropTypes from 'prop-types' import { connect } from 'react-redux' -import { canConsole } from '../../../../vm-status' -import { isWindows } from 'app-helpers' +import { canConsole } from '_/vm-status' +import { isWindows } from '_/helpers' import Action from '../../../VmActions/Action' import ConsoleConfirmationModal from '../../../VmActions/ConsoleConfirmationModal' diff --git a/src/components/VmDetails/cards/DetailsCard/HotPlugConfirmationModal.js b/src/components/VmDetails/cards/DetailsCard/HotPlugConfirmationModal.js index 46fafea7d..10d6b9467 100644 --- a/src/components/VmDetails/cards/DetailsCard/HotPlugConfirmationModal.js +++ b/src/components/VmDetails/cards/DetailsCard/HotPlugConfirmationModal.js @@ -6,7 +6,7 @@ import { Icon, noop, } from 'patternfly-react' -import { msg } from 'app-intl' +import { msg } from '_/intl' const HotPlugChangeConfirmationModal = ({ show, onCancel, onApplyLater, onApplyNow }) => { return { return { const isVmInPreview = !!snapshots.find(snapshot => snapshot.get('status') === 'in_preview') diff --git a/src/components/VmDetails/cards/SnapshotsCard/sagas.js b/src/components/VmDetails/cards/SnapshotsCard/sagas.js index b34c113a3..81c967c3d 100644 --- a/src/components/VmDetails/cards/SnapshotsCard/sagas.js +++ b/src/components/VmDetails/cards/SnapshotsCard/sagas.js @@ -1,9 +1,9 @@ import { takeEvery, put } from 'redux-saga/effects' import { ADD_VM_SNAPSHOT, DELETE_VM_SNAPSHOT, RESTORE_VM_SNAPSHOT } from './constants' -import Api from 'ovirtapi' -import { callExternalAction, delay } from '../../../../saga/utils' -import { fetchVmSnapshots, startProgress, stopProgress } from '../../../../sagas' +import Api from '_/ovirtapi' +import { callExternalAction, delay } from '_/saga/utils' +import { fetchVmSnapshots, startProgress, stopProgress } from '_/sagas' import { addSnapshotRemovalPendingTask, removeSnapshotRemovalPendingTask, @@ -11,7 +11,7 @@ import { removeSnapshotRestorePendingTask, addSnapshotAddPendingTask, removeSnapshotAddPendingTask, -} from 'app-actions' +} from '_/actions' function* addVmSnapshot (action) { yield put(addSnapshotAddPendingTask()) diff --git a/src/components/VmDetails/cards/UtilizationCard/DiskCharts.js b/src/components/VmDetails/cards/UtilizationCard/DiskCharts.js index 5e80ea40e..0608b38de 100644 --- a/src/components/VmDetails/cards/UtilizationCard/DiskCharts.js +++ b/src/components/VmDetails/cards/UtilizationCard/DiskCharts.js @@ -13,7 +13,7 @@ import { DonutChart, } from 'patternfly-react' -import { convertValueMap, round } from 'app-utils' +import { convertValueMap, round } from '_/utils' import style from './style.css' diff --git a/src/components/VmDetails/cards/UtilizationCard/MemoryCharts.js b/src/components/VmDetails/cards/UtilizationCard/MemoryCharts.js index 00b1d5e71..76de25cd5 100644 --- a/src/components/VmDetails/cards/UtilizationCard/MemoryCharts.js +++ b/src/components/VmDetails/cards/UtilizationCard/MemoryCharts.js @@ -14,7 +14,7 @@ import { SparklineChart, } from 'patternfly-react' -import { convertValueMap, round } from 'app-utils' +import { convertValueMap, round } from '_/utils' import style from './style.css' diff --git a/src/components/VmDialog/AddVmButton.js b/src/components/VmDialog/AddVmButton.js index 3bf455604..f99988783 100644 --- a/src/components/VmDialog/AddVmButton.js +++ b/src/components/VmDialog/AddVmButton.js @@ -4,7 +4,7 @@ import { connect } from 'react-redux' import { Link } from 'react-router-dom' -import { msg } from 'app-intl' +import { msg } from '_/intl' const AddVmButton = ({ id, isEnabled }) => { if (!isEnabled) { diff --git a/src/components/VmDialog/IconUpload/index.js b/src/components/VmDialog/IconUpload/index.js index 2d492b46f..aa0bd3738 100644 --- a/src/components/VmDialog/IconUpload/index.js +++ b/src/components/VmDialog/IconUpload/index.js @@ -1,7 +1,7 @@ import React from 'react' import PropTypes from 'prop-types' -import { msg } from 'app-intl' +import { msg } from '_/intl' import FieldHelp from '../../FieldHelp/index' import style from './style.css' diff --git a/src/components/VmDialog/index.js b/src/components/VmDialog/index.js index 72d1400d4..adaa39a1a 100644 --- a/src/components/VmDialog/index.js +++ b/src/components/VmDialog/index.js @@ -8,8 +8,8 @@ import { Link } from 'react-router-dom' import NavigationPrompt from 'react-router-navigation-prompt' import Switch from 'react-bootstrap-switch' -import logger from '../../logger' -import { generateUnique, templateNameRenderer } from 'app-helpers' +import logger from '_/logger' +import { generateUnique, templateNameRenderer } from '_/helpers' import { isRunning, getVmIconId, isValidOsIcon, isVmNameValid } from '../utils' import style from './style.css' @@ -24,11 +24,11 @@ import NavigationConfirmationModal from '../NavigationConfirmationModal' import SelectBox from '../SelectBox' import VmIcon from '../VmIcon' -import { createVm, editVm } from 'app-actions' +import { createVm, editVm } from '_/actions' -import Selectors from '../../selectors' -import { MAX_VM_MEMORY_FACTOR } from 'app-constants' -import { msg } from 'app-intl' +import Selectors from '_/selectors' +import { MAX_VM_MEMORY_FACTOR } from '_/constants' +import { msg } from '_/intl' const zeroUID = '00000000-0000-0000-0000-000000000000' const FIRST_DEVICE = 0 diff --git a/src/components/VmDisks/VmDisk.js b/src/components/VmDisks/VmDisk.js index 9ddcc5ba7..a26329a41 100644 --- a/src/components/VmDisks/VmDisk.js +++ b/src/components/VmDisks/VmDisk.js @@ -3,13 +3,13 @@ import PropTypes from 'prop-types' import { connect } from 'react-redux' import { Modal } from 'patternfly-react' -import { userFormatOfBytes } from 'app-helpers' +import { userFormatOfBytes } from '_/helpers' import { removeDisk } from '_/actions' import FieldHelp from '../FieldHelp/index' -import { msg } from 'app-intl' +import { msg } from '_/intl' import style from './style.css' -import { PendingTaskTypes } from 'app-reducers/pendingTasks' +import { PendingTaskTypes } from '_/reducers/pendingTasks' class VmDisk extends React.PureComponent { constructor (props) { diff --git a/src/components/VmDisks/index.js b/src/components/VmDisks/index.js index 1ff0888c3..5cdcd6386 100644 --- a/src/components/VmDisks/index.js +++ b/src/components/VmDisks/index.js @@ -1,7 +1,7 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' -import { msg } from 'app-intl' +import { msg } from '_/intl' import VmDisk from './VmDisk' import style from './style.css' import NewDiskDialog from '../NewDiskDialog' diff --git a/src/components/VmDisks/utils.js b/src/components/VmDisks/utils.js index cde62e078..7736e10ac 100644 --- a/src/components/VmDisks/utils.js +++ b/src/components/VmDisks/utils.js @@ -1,6 +1,6 @@ -import { locale as appLocale } from 'app-intl' -import { localeCompare } from 'app-helpers' +import { locale as appLocale } from '_/intl' +import { localeCompare } from '_/helpers' /* * Sort an Immutable List of Maps (set of disks) for display on the VmDisks list. diff --git a/src/components/VmModals/DeleteConfirmationModal.js b/src/components/VmModals/DeleteConfirmationModal.js index 72c4f55f6..386bd6f18 100644 --- a/src/components/VmModals/DeleteConfirmationModal.js +++ b/src/components/VmModals/DeleteConfirmationModal.js @@ -1,7 +1,7 @@ import React from 'react' import PropTypes from 'prop-types' import { MessageDialog, Icon } from 'patternfly-react' -import { msg } from 'app-intl' +import { msg } from '_/intl' class DeleteConfirmationModal extends React.Component { constructor (props) { diff --git a/src/components/VmNics/NewNicModal.js b/src/components/VmNics/NewNicModal.js index eac615bbc..96b2de4bf 100644 --- a/src/components/VmNics/NewNicModal.js +++ b/src/components/VmNics/NewNicModal.js @@ -2,7 +2,7 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' import { Button, Modal, Icon } from 'patternfly-react' import SelectBox from '../SelectBox' -import { msg } from 'app-intl' +import { msg } from '_/intl' const EMPTY_ID = '' diff --git a/src/components/VmNics/index.js b/src/components/VmNics/index.js index 46a4240a6..ea83b3b5a 100644 --- a/src/components/VmNics/index.js +++ b/src/components/VmNics/index.js @@ -1,13 +1,13 @@ import React from 'react' import PropTypes from 'prop-types' import { connect } from 'react-redux' -import { addVmNic, deleteVmNic } from 'app-actions' +import { addVmNic, deleteVmNic } from '_/actions' import { Button } from 'patternfly-react' import DeleteConfirmationModal from '../VmModals/DeleteConfirmationModal' -import { msg } from 'app-intl' +import { msg } from '_/intl' import FieldHelp from '../FieldHelp' import VmDetailRow, { ExpandableList } from '../VmDetailRow' -import { localeCompare } from 'app-helpers' +import { localeCompare } from '_/helpers' import NewNicModal from './NewNicModal' import style from './style.css' diff --git a/src/components/VmUserMessages/index.js b/src/components/VmUserMessages/index.js index cfb8e9d55..8f60b25b3 100644 --- a/src/components/VmUserMessages/index.js +++ b/src/components/VmUserMessages/index.js @@ -7,9 +7,9 @@ import { Notification, NotificationDrawer, MenuItem, Icon, Button } from 'patter import style from './style.css' -import { clearUserMessages, dismissUserMessage } from 'app-actions' -import { hrefWithoutHistory, getFormatedDateTime } from 'app-helpers' -import { msg } from 'app-intl' +import { clearUserMessages, dismissUserMessage } from '_/actions' +import { hrefWithoutHistory, getFormatedDateTime } from '_/helpers' +import { msg } from '_/intl' const UserMessage = ({ record, id, onDismissMessage }) => { const time = getFormatedDateTime(record.get('time')) diff --git a/src/components/VmsList/Pool.js b/src/components/VmsList/Pool.js index f2f364f03..19496a055 100644 --- a/src/components/VmsList/Pool.js +++ b/src/components/VmsList/Pool.js @@ -11,10 +11,10 @@ import VmActions from '../VmActions' import VmIcon from '../VmIcon' import VmStatusIcon from '../VmStatusIcon' -import { startPool } from 'app-actions' +import { startPool } from '_/actions' import { getOsHumanName } from '../utils' -import { enumMsg } from 'app-intl' +import { enumMsg } from '_/intl' /** * Single icon-card in the list for a Pool diff --git a/src/components/VmsList/Vm.js b/src/components/VmsList/Vm.js index b1bb24738..c34f7ce5c 100644 --- a/src/components/VmsList/Vm.js +++ b/src/components/VmsList/Vm.js @@ -11,10 +11,10 @@ import VmActions from '../VmActions' import VmIcon from '../VmIcon' import VmStatusIcon from '../VmStatusIcon' -import { startVm } from 'app-actions' +import { startVm } from '_/actions' import { getOsHumanName, getVmIcon } from '../utils' -import { enumMsg } from 'app-intl' +import { enumMsg } from '_/intl' /** * Single icon-card in the list for a VM diff --git a/src/components/VmsList/Vms.js b/src/components/VmsList/Vms.js index 28d827e50..d7d7faadb 100644 --- a/src/components/VmsList/Vms.js +++ b/src/components/VmsList/Vms.js @@ -7,7 +7,7 @@ import style from './style.css' import Vm from './Vm' import Pool from './Pool' import ScrollPositionHistory from '../ScrollPositionHistory' -import { getByPage } from 'app-actions' +import { getByPage } from '_/actions' import InfiniteScroll from 'react-infinite-scroller' /** diff --git a/src/components/VmsList/index.js b/src/components/VmsList/index.js index 621118d69..a03421575 100644 --- a/src/components/VmsList/index.js +++ b/src/components/VmsList/index.js @@ -6,7 +6,7 @@ import { withRouter } from 'react-router-dom' import { Grid } from 'patternfly-react' import Vms from './Vms' -import { msg } from 'app-intl' +import { msg } from '_/intl' /** * Component displayed when VMs or Pools exist but the data is still loading. diff --git a/src/components/VmsListNavigation/index.js b/src/components/VmsListNavigation/index.js index 8e98f8834..6f78f8834 100644 --- a/src/components/VmsListNavigation/index.js +++ b/src/components/VmsListNavigation/index.js @@ -3,7 +3,7 @@ import PropTypes from 'prop-types' import { Link } from 'react-router-dom' import { connect } from 'react-redux' -import { getByPage } from 'app-actions' +import { getByPage } from '_/actions' import InfiniteScroll from 'react-infinite-scroller' import naturalCompare from 'string-natural-compare' diff --git a/src/components/VmsPageHeader/UserMenu.js b/src/components/VmsPageHeader/UserMenu.js index 12762824d..8095a81a1 100644 --- a/src/components/VmsPageHeader/UserMenu.js +++ b/src/components/VmsPageHeader/UserMenu.js @@ -3,9 +3,9 @@ import PropTypes from 'prop-types' import { connect } from 'react-redux' -import { logout } from 'app-actions' +import { logout } from '_/actions' -import { msg } from 'app-intl' +import { msg } from '_/intl' import AboutDialog from '../About' import OptionsDialog from '../OptionsDialog' diff --git a/src/components/VmsPageHeader/index.js b/src/components/VmsPageHeader/index.js index d082e61f1..ecee1930f 100644 --- a/src/components/VmsPageHeader/index.js +++ b/src/components/VmsPageHeader/index.js @@ -5,10 +5,10 @@ import { connect } from 'react-redux' import VmUserMessages from '../VmUserMessages' import UserMenu from './UserMenu' -import { hrefWithoutHistory } from 'app-helpers' +import { hrefWithoutHistory } from '_/helpers' -import { refresh } from 'app-actions' -import * as branding from '../../branding' +import { refresh } from '_/actions' +import * as branding from '_/branding' /** * Main application header on top of the page diff --git a/src/config.js b/src/config.js index be9634e64..b1f03402e 100644 --- a/src/config.js +++ b/src/config.js @@ -1,6 +1,6 @@ import $ from 'jquery' -import { getURLQueryParameterByName } from 'app-helpers' +import { getURLQueryParameterByName } from '_/helpers' import { setLogDebug } from './logger' const CONFIG_URL = '/ovirt-engine/web-ui/ovirt-web-ui.config' diff --git a/src/helpers.js b/src/helpers.js index 98b812ad4..159ac28fb 100644 --- a/src/helpers.js +++ b/src/helpers.js @@ -1,5 +1,5 @@ import { Blob } from 'blob-util' -import { locale as appLocale, msg } from 'app-intl' +import { locale as appLocale, msg } from '_/intl' // "payload":{"message":"Not Found","shortMessage":"LOGIN failed","type":404,"action":{"type":"LOGIN","payload":{"credentials":{"username":"admin@internal","password":"admi"}}}}} export function hidePassword ({ action, param }) { diff --git a/src/helpers.test.js b/src/helpers.test.js index 81260544b..f91551b46 100644 --- a/src/helpers.test.js +++ b/src/helpers.test.js @@ -1,5 +1,5 @@ /* eslint-env jest */ -import { formatDateFromNow } from 'app-helpers' +import { formatDateFromNow } from '_/helpers' describe('testing formating from now date', function () { const nowDate = Date.now() diff --git a/src/index.js b/src/index.js index 2e50583d2..986539d99 100644 --- a/src/index.js +++ b/src/index.js @@ -18,12 +18,12 @@ import 'patternfly/dist/css/patternfly-additions.css' import './index-nomodules.css' import * as branding from './branding' -import { getSelectedMessages, locale } from 'app-intl' +import { getSelectedMessages, locale } from '_/intl' import configureStore from './store' import Selectors from './selectors' import AppConfiguration, { readConfiguration } from './config' import { loadStateFromLocalStorage } from './storage' -import { valuesOfObject } from 'app-helpers' +import { valuesOfObject } from '_/helpers' import { rootSaga } from './sagas' import { login, @@ -31,7 +31,7 @@ import { setDomain, addActiveRequest, delayedRemoveActiveRequest, -} from 'app-actions' +} from '_/actions' import OvirtApi from './ovirtapi' import App from './App' diff --git a/src/reducers/activeRequests.js b/src/reducers/activeRequests.js index b76786485..f3f05f236 100644 --- a/src/reducers/activeRequests.js +++ b/src/reducers/activeRequests.js @@ -1,7 +1,7 @@ import { Set } from 'immutable' import { actionReducer } from './utils' -import { ADD_ACTIVE_REQUEST, REMOVE_ACTIVE_REQUEST } from 'app-constants' +import { ADD_ACTIVE_REQUEST, REMOVE_ACTIVE_REQUEST } from '_/constants' const initialState = Set() diff --git a/src/reducers/clusters.js b/src/reducers/clusters.js index c4c71e109..d6ff3ca32 100644 --- a/src/reducers/clusters.js +++ b/src/reducers/clusters.js @@ -1,8 +1,8 @@ import { fromJS } from 'immutable' import { actionReducer } from './utils' -import { arrayToMap } from 'app-helpers' -import { SET_CLUSTERS } from 'app-constants' +import { arrayToMap } from '_/helpers' +import { SET_CLUSTERS } from '_/constants' const initialState = fromJS({}) diff --git a/src/reducers/config.js b/src/reducers/config.js index 1bb1758d1..b92e8a179 100644 --- a/src/reducers/config.js +++ b/src/reducers/config.js @@ -12,7 +12,7 @@ import { SET_USER_FILTER_PERMISSION, SET_USER_GROUPS, SHOW_TOKEN_EXPIRED_MSG, -} from 'app-constants' +} from '_/constants' const initialState = Immutable.fromJS({ loginToken: undefined, diff --git a/src/reducers/consoles.js b/src/reducers/consoles.js index 9a82bd6fb..d438e7adc 100644 --- a/src/reducers/consoles.js +++ b/src/reducers/consoles.js @@ -1,5 +1,5 @@ import Immutable from 'immutable' -import { SET_CONSOLE_IN_USE, SET_CONSOLE_VALID } from 'app-constants' +import { SET_CONSOLE_IN_USE, SET_CONSOLE_VALID } from '_/constants' import { actionReducer } from './utils' const initialState = Immutable.fromJS({ vms: {} }) diff --git a/src/reducers/dataCenters.js b/src/reducers/dataCenters.js index bc0292766..b1d81ab02 100644 --- a/src/reducers/dataCenters.js +++ b/src/reducers/dataCenters.js @@ -1,6 +1,6 @@ import { fromJS } from 'immutable' -import { SET_DATA_CENTERS } from 'app-constants' +import { SET_DATA_CENTERS } from '_/constants' import { actionReducer } from './utils' const initialState = fromJS([]) diff --git a/src/reducers/hosts.js b/src/reducers/hosts.js index ad8ef07a5..a2b80dcca 100644 --- a/src/reducers/hosts.js +++ b/src/reducers/hosts.js @@ -1,8 +1,8 @@ import { fromJS } from 'immutable' -import { SET_HOSTS } from 'app-constants' +import { SET_HOSTS } from '_/constants' import { actionReducer } from './utils' -import { arrayToMap } from 'app-helpers' +import { arrayToMap } from '_/helpers' const initialState = fromJS({}) diff --git a/src/reducers/icons.js b/src/reducers/icons.js index 5e6a5505c..53472e6e8 100644 --- a/src/reducers/icons.js +++ b/src/reducers/icons.js @@ -1,5 +1,5 @@ import { Map } from 'immutable' -import { UPDATE_ICONS } from 'app-constants' +import { UPDATE_ICONS } from '_/constants' import { actionReducer } from './utils' const initialState = Map() diff --git a/src/reducers/operatingSystems.js b/src/reducers/operatingSystems.js index 7f1afa1b8..b8e304a74 100644 --- a/src/reducers/operatingSystems.js +++ b/src/reducers/operatingSystems.js @@ -1,7 +1,7 @@ import { fromJS } from 'immutable' -import { arrayToMap } from 'app-helpers' -import { SET_OPERATING_SYSTEMS } from 'app-constants' +import { arrayToMap } from '_/helpers' +import { SET_OPERATING_SYSTEMS } from '_/constants' import { actionReducer } from './utils' const initialState = fromJS({}) diff --git a/src/reducers/options.js b/src/reducers/options.js index 193814581..db0a343e3 100644 --- a/src/reducers/options.js +++ b/src/reducers/options.js @@ -1,5 +1,5 @@ import Immutable from 'immutable' -import { SET_CONSOLE_OPTIONS } from 'app-constants' +import { SET_CONSOLE_OPTIONS } from '_/constants' import { actionReducer } from './utils' function setOptions ({ state, type, options }) { diff --git a/src/reducers/pendingTasks.js b/src/reducers/pendingTasks.js index c0a62d898..05245aab1 100644 --- a/src/reducers/pendingTasks.js +++ b/src/reducers/pendingTasks.js @@ -19,7 +19,7 @@ import { REMOVE_SNAPSHOT_REMOVAL_PENDING_TASK, REMOVE_SNAPSHOT_RESTORE_PENDING_TASK, REMOVE_SNAPSHOT_ADD_PENDING_TASK, -} from 'app-constants' +} from '_/constants' export const PendingTaskTypes = { DISK_REMOVAL: 'DISK_REMOVAL', diff --git a/src/reducers/storageDomains.js b/src/reducers/storageDomains.js index 29017de8b..ffd684ef0 100644 --- a/src/reducers/storageDomains.js +++ b/src/reducers/storageDomains.js @@ -4,9 +4,9 @@ import { ADD_STORAGE_DOMAINS, SET_STORAGE_DOMAIN_FILES, SET_STORAGE_DOMAINS, -} from 'app-constants' +} from '_/constants' import { actionReducer } from './utils' -import { arrayToMap } from 'app-helpers' +import { arrayToMap } from '_/helpers' const initialState = fromJS({}) diff --git a/src/reducers/templates.js b/src/reducers/templates.js index a887cf725..54dec8ae2 100644 --- a/src/reducers/templates.js +++ b/src/reducers/templates.js @@ -1,8 +1,8 @@ import { fromJS } from 'immutable' import { actionReducer } from './utils' -import { arrayToMap } from 'app-helpers' -import { SET_TEMPLATES } from 'app-constants' +import { arrayToMap } from '_/helpers' +import { SET_TEMPLATES } from '_/constants' const initialState = fromJS({}) diff --git a/src/reducers/userMessages.js b/src/reducers/userMessages.js index 8619f95ee..8475bde6a 100644 --- a/src/reducers/userMessages.js +++ b/src/reducers/userMessages.js @@ -6,7 +6,7 @@ import { FAILED_EXTERNAL_ACTION, LOGIN_FAILED, SET_USERMSG_NOTIFIED, -} from 'app-constants' +} from '_/constants' import { actionReducer } from './utils' /*flow-include diff --git a/src/reducers/utils.js b/src/reducers/utils.js index dbc0cb6d4..601699cf0 100644 --- a/src/reducers/utils.js +++ b/src/reducers/utils.js @@ -1,6 +1,6 @@ import { Map } from 'immutable' import logger from '../logger' -import { UPDATE_ICONS, REMOVE_ACTIVE_REQUEST, DELAYED_REMOVE_ACTIVE_REQUEST, ADD_ACTIVE_REQUEST } from 'app-constants' +import { UPDATE_ICONS, REMOVE_ACTIVE_REQUEST, DELAYED_REMOVE_ACTIVE_REQUEST, ADD_ACTIVE_REQUEST } from '_/constants' /** * Takes initial state of the reducer and a map of action handlers and returns a redux-compatible reducer. diff --git a/src/reducers/vms.js b/src/reducers/vms.js index aadb82a45..752d2fd06 100644 --- a/src/reducers/vms.js +++ b/src/reducers/vms.js @@ -22,7 +22,7 @@ import { UPDATE_VM_DISK, UPDATE_VMS, VM_ACTION_IN_PROGRESS, -} from 'app-constants' +} from '_/constants' import logger from '../logger' import { actionReducer, removeMissingItems } from './utils' diff --git a/src/reducers/vnicProfiles.js b/src/reducers/vnicProfiles.js index 10cc9e260..d964e4def 100644 --- a/src/reducers/vnicProfiles.js +++ b/src/reducers/vnicProfiles.js @@ -3,7 +3,7 @@ import { actionReducer } from './utils' import { ADD_NETWORKS_TO_VNIC_PROFILES, SET_VNIC_PROFILES, -} from 'app-constants' +} from '_/constants' const initialState = fromJS({}) diff --git a/src/routes.js b/src/routes.js index 7c20bf59c..4efaff450 100644 --- a/src/routes.js +++ b/src/routes.js @@ -5,8 +5,8 @@ import PageRouter from './components/PageRouter' import { VmDetailToolbar, PoolDetailToolbar } from './components/Toolbar' import { PoolDetailsPage, VmDetailsPage, VmEditPage, VmCreatePage, VmsPage, LegacyVmDetailsPage } from './components/Pages' -import { msg } from 'app-intl' -import { DETAIL_PAGE_TYPE, DIALOG_PAGE_TYPE, MAIN_PAGE_TYPE, POOL_PAGE_TYPE } from './constants' +import { msg } from '_/intl' +import { DETAIL_PAGE_TYPE, DIALOG_PAGE_TYPE, MAIN_PAGE_TYPE, POOL_PAGE_TYPE } from '_/constants' /** * Function get vms object, and return routes object diff --git a/src/saga/console/index.js b/src/saga/console/index.js index 42063c605..c7444b3a5 100644 --- a/src/saga/console/index.js +++ b/src/saga/console/index.js @@ -1,10 +1,10 @@ import { put } from 'redux-saga/effects' -import Api from 'ovirtapi' +import Api from '_/ovirtapi' import Selectors from '../../selectors' import OptionsManager from '../../optionsManager' import logger from '../../logger' -import { fileDownload } from 'app-helpers' +import { fileDownload } from '_/helpers' import { downloadConsole, getConsoleOptions as getConsoleOptionsAction, @@ -13,7 +13,7 @@ import { setVmConsoles, vmActionInProgress, setConsoleIsValid, -} from 'app-actions' +} from '_/actions' import { callExternalAction } from '../utils' import { fetchVmSessions } from '../../sagas' diff --git a/src/saga/disks.js b/src/saga/disks.js index 55663d06d..6fe4bdc08 100644 --- a/src/saga/disks.js +++ b/src/saga/disks.js @@ -1,7 +1,7 @@ import { takeEvery, put } from 'redux-saga/effects' import { CREATE_DISK_FOR_VM, REMOVE_DISK, EDIT_VM_DISK } from '../constants' -import Api from 'ovirtapi' +import Api from '../ovirtapi' import { callExternalAction, delay, delayInMsSteps } from './utils' import { fetchDisks } from '../sagas' diff --git a/src/saga/login.js b/src/saga/login.js index 61a4dcc12..45dd320c6 100644 --- a/src/saga/login.js +++ b/src/saga/login.js @@ -1,5 +1,5 @@ import Product from '../version' -import Api from 'ovirtapi' +import Api from '_/ovirtapi' import AppConfiguration from '../config' import OptionsManager from '../optionsManager' import Selectors from '../selectors' @@ -39,7 +39,7 @@ import { getSingleVm, updateVms, -} from 'app-actions' +} from '_/actions' import { callExternalAction, diff --git a/src/saga/utils.js b/src/saga/utils.js index 8cea840c2..64b8b6e32 100644 --- a/src/saga/utils.js +++ b/src/saga/utils.js @@ -4,14 +4,14 @@ import { } from 'redux-saga/effects' import logger from '../logger' -import { hidePassword } from 'app-helpers' +import { hidePassword } from '_/helpers' -import { msg } from 'app-intl' +import { msg } from '_/intl' import { failedExternalAction, checkTokenExpired, -} from 'app-actions' +} from '_/actions' export const delay = (ms) => new Promise(resolve => setTimeout(resolve, ms)) diff --git a/src/sagas.js b/src/sagas.js index 47b00f840..1b89ce69e 100644 --- a/src/sagas.js +++ b/src/sagas.js @@ -1,4 +1,4 @@ -import Api from 'ovirtapi' +import Api from '_/ovirtapi' import { persistStateToLocalStorage } from './storage' import Selectors from './selectors' import AppConfiguration from './config' @@ -70,7 +70,7 @@ import { changeVmCdRom as actionChangeVmCdRom, restartVm as actionRestartVm, setCurrentPage, -} from 'app-actions' +} from '_/actions' import { callExternalAction, @@ -142,7 +142,7 @@ import { DIALOG_PAGE_TYPE, MAIN_PAGE_TYPE, POOL_PAGE_TYPE, -} from 'app-constants' +} from '_/constants' import { canUserEditVm, getUserPermits, canUserUseCluster } from './utils'