Sfoglia il codice sorgente

Rename all store references to lowercase

Store references are class instances and should use lowercase, using uppercase should be reserved for referencing static class methods.
Sergiu Miclea 8 anni fa
parent
commit
f3ece0de7b
30 ha cambiato i file con 453 aggiunte e 453 eliminazioni
  1. 2 2
      src/components/App.jsx
  2. 2 2
      src/components/atoms/CopyMultilineValue/index.jsx
  3. 3 3
      src/components/atoms/CopyValue/index.jsx
  4. 2 2
      src/components/molecules/ScheduleItem/index.jsx
  5. 2 2
      src/components/molecules/TaskItem/index.jsx
  6. 4 4
      src/components/organisms/DetailsPageHeader/index.jsx
  7. 33 33
      src/components/organisms/Endpoint/index.jsx
  8. 3 3
      src/components/organisms/EndpointValidation/index.jsx
  9. 2 2
      src/components/organisms/LoginForm/index.jsx
  10. 2 2
      src/components/organisms/Notifications/index.jsx
  11. 17 17
      src/components/organisms/PageHeader/index.jsx
  12. 2 2
      src/components/organisms/ReplicaDetailsContent/index.jsx
  13. 9 9
      src/components/organisms/WizardPageContent/index.jsx
  14. 54 54
      src/components/pages/AssessmentDetailsPage/index.jsx
  15. 53 53
      src/components/pages/AssessmentsPage/index.jsx
  16. 26 26
      src/components/pages/EndpointDetailsPage/index.jsx
  17. 25 25
      src/components/pages/EndpointsPage/index.jsx
  18. 6 6
      src/components/pages/LoginPage/index.jsx
  19. 20 20
      src/components/pages/MigrationDetailsPage/index.jsx
  20. 19 19
      src/components/pages/MigrationsPage/index.jsx
  21. 37 37
      src/components/pages/ReplicaDetailsPage/index.jsx
  22. 19 19
      src/components/pages/ReplicasPage/index.jsx
  23. 82 82
      src/components/pages/WizardPage/index.jsx
  24. 2 2
      src/sources/AssessmentSource.js
  25. 2 2
      src/sources/WizardSource.js
  26. 2 2
      src/stores/MigrationStore.js
  27. 1 1
      src/stores/ProviderStore.js
  28. 7 7
      src/stores/ReplicaStore.js
  29. 11 11
      src/stores/UserStore.js
  30. 4 4
      src/utils/ApiCaller.js

+ 2 - 2
src/components/App.jsx

@@ -29,7 +29,7 @@ import MigrationDetailsPage from './pages/MigrationDetailsPage'
 import EndpointsPage from './pages/EndpointsPage'
 import EndpointsPage from './pages/EndpointsPage'
 import EndpointDetailsPage from './pages/EndpointDetailsPage'
 import EndpointDetailsPage from './pages/EndpointDetailsPage'
 import WizardPage from './pages/WizardPage'
 import WizardPage from './pages/WizardPage'
-import UserStore from '../stores/UserStore'
+import userStore from '../stores/UserStore'
 import AssessmentsPage from './pages/AssessmentsPage'
 import AssessmentsPage from './pages/AssessmentsPage'
 import AssessmentDetailsPage from './pages/AssessmentDetailsPage'
 import AssessmentDetailsPage from './pages/AssessmentDetailsPage'
 
 
@@ -54,7 +54,7 @@ const Wrapper = styled.div``
 
 
 class App extends React.Component<{}> {
 class App extends React.Component<{}> {
   componentWillMount() {
   componentWillMount() {
-    UserStore.tokenLogin()
+    userStore.tokenLogin()
   }
   }
 
 
   render() {
   render() {

+ 2 - 2
src/components/atoms/CopyMultilineValue/index.jsx

@@ -20,7 +20,7 @@ import styled from 'styled-components'
 
 
 import CopyButton from '../CopyButton'
 import CopyButton from '../CopyButton'
 import DomUtils from '../../../utils/DomUtils'
 import DomUtils from '../../../utils/DomUtils'
-import NotificationStore from '../../../stores/NotificationStore'
+import notificationStore from '../../../stores/NotificationStore'
 
 
 const Wrapper = styled.div`
 const Wrapper = styled.div`
   cursor: pointer;
   cursor: pointer;
@@ -46,7 +46,7 @@ class CopyMultineValue extends React.Component<Props> {
     if (this.props.onCopy) this.props.onCopy(this.props.value)
     if (this.props.onCopy) this.props.onCopy(this.props.value)
 
 
     if (succesful) {
     if (succesful) {
-      NotificationStore.notify('The message has been copied to clipboard.')
+      notificationStore.notify('The message has been copied to clipboard.')
     }
     }
   }
   }
 
 

+ 3 - 3
src/components/atoms/CopyValue/index.jsx

@@ -20,7 +20,7 @@ import styled from 'styled-components'
 
 
 import CopyButton from '../CopyButton'
 import CopyButton from '../CopyButton'
 import DomUtils from '../../../utils/DomUtils'
 import DomUtils from '../../../utils/DomUtils'
-import NotificationStore from '../../../stores/NotificationStore'
+import notificationStore from '../../../stores/NotificationStore'
 
 
 const Wrapper = styled.div`
 const Wrapper = styled.div`
   cursor: pointer;
   cursor: pointer;
@@ -55,9 +55,9 @@ class CopyValue extends React.Component<Props> {
     if (this.props.onCopy) this.props.onCopy(this.props.value)
     if (this.props.onCopy) this.props.onCopy(this.props.value)
 
 
     if (succesful) {
     if (succesful) {
-      NotificationStore.notify('The value has been copied to clipboard.')
+      notificationStore.notify('The value has been copied to clipboard.')
     } else {
     } else {
-      NotificationStore.notify('The value couldn\'t be copied', 'error')
+      notificationStore.notify('The value couldn\'t be copied', 'error')
     }
     }
   }
   }
 
 

+ 2 - 2
src/components/molecules/ScheduleItem/index.jsx

@@ -29,7 +29,7 @@ import { executionOptions } from '../../../config'
 import Palette from '../../styleUtils/Palette'
 import Palette from '../../styleUtils/Palette'
 import StyleProps from '../../styleUtils/StyleProps'
 import StyleProps from '../../styleUtils/StyleProps'
 import DateUtils from '../../../utils/DateUtils'
 import DateUtils from '../../../utils/DateUtils'
-import NotificationStore from '../../../stores/NotificationStore'
+import notificationStore from '../../../stores/NotificationStore'
 import deleteImage from './images/delete.svg'
 import deleteImage from './images/delete.svg'
 import deleteHoverImage from './images/delete-hover.svg'
 import deleteHoverImage from './images/delete-hover.svg'
 import saveImage from './images/save.svg'
 import saveImage from './images/save.svg'
@@ -145,7 +145,7 @@ class ScheduleItem extends React.Component<Props> {
   handleExpirationDateChange(date: Date) {
   handleExpirationDateChange(date: Date) {
     let newDate = moment(date)
     let newDate = moment(date)
     if (newDate.diff(new Date(), 'minutes') < 60) {
     if (newDate.diff(new Date(), 'minutes') < 60) {
-      NotificationStore.notify('Please select a further expiration date.', 'error')
+      notificationStore.notify('Please select a further expiration date.', 'error')
       return
       return
     }
     }
 
 

+ 2 - 2
src/components/molecules/TaskItem/index.jsx

@@ -26,7 +26,7 @@ import StatusPill from '../../atoms/StatusPill'
 import CopyValue from '../../atoms/CopyValue'
 import CopyValue from '../../atoms/CopyValue'
 import ProgressBar from '../../atoms/ProgressBar'
 import ProgressBar from '../../atoms/ProgressBar'
 import CopyButton from '../../atoms/CopyButton'
 import CopyButton from '../../atoms/CopyButton'
-import NotificationStore from '../../../stores/NotificationStore'
+import notificationStore from '../../../stores/NotificationStore'
 import DomUtils from '../../../utils/DomUtils'
 import DomUtils from '../../../utils/DomUtils'
 import Palette from '../../styleUtils/Palette'
 import Palette from '../../styleUtils/Palette'
 import StyleProps from '../../styleUtils/StyleProps'
 import StyleProps from '../../styleUtils/StyleProps'
@@ -161,7 +161,7 @@ class TaskItem extends React.Component<Props> {
     let succesful = DomUtils.copyTextToClipboard(exceptionText)
     let succesful = DomUtils.copyTextToClipboard(exceptionText)
 
 
     if (succesful) {
     if (succesful) {
-      NotificationStore.notify('The message has been copied to clipboard.')
+      notificationStore.notify('The message has been copied to clipboard.')
     }
     }
   }
   }
 
 

+ 4 - 4
src/components/organisms/DetailsPageHeader/index.jsx

@@ -23,7 +23,7 @@ import NotificationDropdown from '../../molecules/NotificationDropdown'
 import UserDropdown from '../../molecules/UserDropdown'
 import UserDropdown from '../../molecules/UserDropdown'
 import type { User as UserType } from '../../../types/User'
 import type { User as UserType } from '../../../types/User'
 
 
-import NotificationStore from '../../../stores/NotificationStore'
+import notificationStore from '../../../stores/NotificationStore'
 
 
 import backgroundImage from './images/star-bg.jpg'
 import backgroundImage from './images/star-bg.jpg'
 import logoImage from './images/logo.svg'
 import logoImage from './images/logo.svg'
@@ -61,11 +61,11 @@ type Props = {
 @observer
 @observer
 export class DetailsPageHeader extends React.Component<Props> {
 export class DetailsPageHeader extends React.Component<Props> {
   componentDidMount() {
   componentDidMount() {
-    NotificationStore.loadNotifications()
+    notificationStore.loadNotifications()
   }
   }
 
 
   handleNotificationsClose() {
   handleNotificationsClose() {
-    NotificationStore.clearNotifications()
+    notificationStore.clearNotifications()
   }
   }
 
 
   render() {
   render() {
@@ -76,7 +76,7 @@ export class DetailsPageHeader extends React.Component<Props> {
           <Logo href="/#/replicas" />
           <Logo href="/#/replicas" />
         </Menu>
         </Menu>
         <User>
         <User>
-          <NotificationDropdown white items={NotificationStore.persistedNotifications} onClose={() => this.handleNotificationsClose()} />
+          <NotificationDropdown white items={notificationStore.persistedNotifications} onClose={() => this.handleNotificationsClose()} />
           <UserDropdownStyled
           <UserDropdownStyled
             white
             white
             user={this.props.user}
             user={this.props.user}

+ 33 - 33
src/components/organisms/Endpoint/index.jsx

@@ -29,9 +29,9 @@ import LoadingButton from '../../molecules/LoadingButton'
 
 
 import type { Endpoint as EndpointType } from '../../../types/Endpoint'
 import type { Endpoint as EndpointType } from '../../../types/Endpoint'
 import type { Field } from '../../../types/Field'
 import type { Field } from '../../../types/Field'
-import NotificationStore from '../../../stores/NotificationStore'
-import EndpointStore from '../../../stores/EndpointStore'
-import ProviderStore from '../../../stores/ProviderStore'
+import notificationStore from '../../../stores/NotificationStore'
+import endpointStore from '../../../stores/EndpointStore'
+import providerStore from '../../../stores/ProviderStore'
 import ObjectUtils from '../../../utils/ObjectUtils'
 import ObjectUtils from '../../../utils/ObjectUtils'
 import Palette from '../../styleUtils/Palette'
 import Palette from '../../styleUtils/Palette'
 import DomUtils from '../../../utils/DomUtils'
 import DomUtils from '../../../utils/DomUtils'
@@ -148,31 +148,31 @@ class Endpoint extends React.Component<Props, State> {
 
 
   componentWillMount() {
   componentWillMount() {
     this.componentWillReceiveProps(this.props)
     this.componentWillReceiveProps(this.props)
-    this.providerStoreObserver = observe(ProviderStore, 'connectionInfoSchema', () => {
+    this.providerStoreObserver = observe(providerStore, 'connectionInfoSchema', () => {
       this.props.onResizeUpdate(this.scrollableRef)
       this.props.onResizeUpdate(this.scrollableRef)
     })
     })
-    this.endpointValidationObserver = observe(EndpointStore, 'validation', () => {
+    this.endpointValidationObserver = observe(endpointStore, 'validation', () => {
       this.componentWillReceiveProps(this.props)
       this.componentWillReceiveProps(this.props)
     })
     })
   }
   }
 
 
   componentDidMount() {
   componentDidMount() {
-    ProviderStore.getConnectionInfoSchema(this.getEndpointType())
+    providerStore.getConnectionInfoSchema(this.getEndpointType())
     KeyboardManager.onEnter('endpoint', () => { if (this.isValidateButtonEnabled) this.handleValidateClick() }, 2)
     KeyboardManager.onEnter('endpoint', () => { if (this.isValidateButtonEnabled) this.handleValidateClick() }, 2)
   }
   }
 
 
   componentWillReceiveProps(props: Props) {
   componentWillReceiveProps(props: Props) {
     if (this.state.validating) {
     if (this.state.validating) {
-      if (EndpointStore.validation && !EndpointStore.validation.valid) {
+      if (endpointStore.validation && !endpointStore.validation.valid) {
         this.setState({ validating: false })
         this.setState({ validating: false })
       }
       }
     }
     }
 
 
-    if (props.endpoint && EndpointStore.connectionInfo) {
+    if (props.endpoint && endpointStore.connectionInfo) {
       this.setState({
       this.setState({
         endpoint: {
         endpoint: {
           ...ObjectUtils.flatten(props.endpoint || {}),
           ...ObjectUtils.flatten(props.endpoint || {}),
-          ...ObjectUtils.flatten(EndpointStore.connectionInfo || {}),
+          ...ObjectUtils.flatten(endpointStore.connectionInfo || {}),
         },
         },
       })
       })
     } else {
     } else {
@@ -189,8 +189,8 @@ class Endpoint extends React.Component<Props, State> {
   }
   }
 
 
   componentWillUnmount() {
   componentWillUnmount() {
-    EndpointStore.clearValidation()
-    ProviderStore.clearConnectionInfoSchema()
+    endpointStore.clearValidation()
+    providerStore.clearConnectionInfoSchema()
     clearTimeout(this.closeTimeout)
     clearTimeout(this.closeTimeout)
     KeyboardManager.removeKeyDown('endpoint')
     KeyboardManager.removeKeyDown('endpoint')
     this.providerStoreObserver()
     this.providerStoreObserver()
@@ -234,8 +234,8 @@ class Endpoint extends React.Component<Props, State> {
     if (!this.highlightRequired()) {
     if (!this.highlightRequired()) {
       this.setState({ validating: true })
       this.setState({ validating: true })
 
 
-      NotificationStore.notify('Saving endpoint ...')
-      EndpointStore.clearValidation()
+      notificationStore.notify('Saving endpoint ...')
+      endpointStore.clearValidation()
 
 
       if (this.state.isNew) {
       if (this.state.isNew) {
         this.add()
         this.add()
@@ -243,7 +243,7 @@ class Endpoint extends React.Component<Props, State> {
         this.update()
         this.update()
       }
       }
     } else {
     } else {
-      NotificationStore.notify('Please fill all the required fields', 'error')
+      notificationStore.notify('Please fill all the required fields', 'error')
     }
     }
   }
   }
 
 
@@ -254,20 +254,20 @@ class Endpoint extends React.Component<Props, State> {
   }
   }
 
 
   handleCopyErrorMessageClick() {
   handleCopyErrorMessageClick() {
-    if (!EndpointStore.validation) {
+    if (!endpointStore.validation) {
       return
       return
     }
     }
     // $FlowIssue
     // $FlowIssue
-    let succesful = DomUtils.copyTextToClipboard(EndpointStore.validation.message)
+    let succesful = DomUtils.copyTextToClipboard(endpointStore.validation.message)
 
 
     if (succesful) {
     if (succesful) {
-      NotificationStore.notify('The message has been copied to clipboard.')
+      notificationStore.notify('The message has been copied to clipboard.')
     }
     }
   }
   }
 
 
   handleCancelClick() {
   handleCancelClick() {
     if (this.props.deleteOnCancel && this.state.isNew === false) {
     if (this.props.deleteOnCancel && this.state.isNew === false) {
-      EndpointStore.delete(EndpointStore.endpoints[0])
+      endpointStore.delete(endpointStore.endpoints[0])
     }
     }
     this.props.onCancelClick()
     this.props.onCancelClick()
   }
   }
@@ -283,10 +283,10 @@ class Endpoint extends React.Component<Props, State> {
       return
       return
     }
     }
 
 
-    EndpointStore.update(this.state.endpoint).then(() => {
-      NotificationStore.notify('Validating endpoint ...')
+    endpointStore.update(this.state.endpoint).then(() => {
+      notificationStore.notify('Validating endpoint ...')
       // $FlowIssue
       // $FlowIssue
-      EndpointStore.validate(this.state.endpoint)
+      endpointStore.validate(this.state.endpoint)
     })
     })
   }
   }
 
 
@@ -295,16 +295,16 @@ class Endpoint extends React.Component<Props, State> {
       return
       return
     }
     }
 
 
-    EndpointStore.add(this.state.endpoint).then(() => {
-      let endpoint = EndpointStore.endpoints[0]
+    endpointStore.add(this.state.endpoint).then(() => {
+      let endpoint = endpointStore.endpoints[0]
       this.setState({ isNew: false, endpoint: ObjectUtils.flatten(endpoint) })
       this.setState({ isNew: false, endpoint: ObjectUtils.flatten(endpoint) })
-      NotificationStore.notify('Validating endpoint ...')
-      EndpointStore.validate(endpoint)
+      notificationStore.notify('Validating endpoint ...')
+      endpointStore.validate(endpoint)
     })
     })
   }
   }
 
 
   renderEndpointStatus() {
   renderEndpointStatus() {
-    const validation = EndpointStore.validation
+    const validation = endpointStore.validation
     if (!this.state.validating && !validation) {
     if (!this.state.validating && !validation) {
       return null
       return null
     }
     }
@@ -348,8 +348,8 @@ class Endpoint extends React.Component<Props, State> {
     let actionButton = <Button large onClick={() => this.handleValidateClick()}>Validate and save</Button>
     let actionButton = <Button large onClick={() => this.handleValidateClick()}>Validate and save</Button>
 
 
     let message = 'Validating Endpoint ...'
     let message = 'Validating Endpoint ...'
-    if (this.state.validating || (EndpointStore.validation && EndpointStore.validation.valid)) {
-      if (EndpointStore.validation && EndpointStore.validation.valid) {
+    if (this.state.validating || (endpointStore.validation && endpointStore.validation.valid)) {
+      if (endpointStore.validation && endpointStore.validation.valid) {
         message = 'Saving ...'
         message = 'Saving ...'
       }
       }
 
 
@@ -367,16 +367,16 @@ class Endpoint extends React.Component<Props, State> {
 
 
   renderContent() {
   renderContent() {
     const endpointType = this.getEndpointType()
     const endpointType = this.getEndpointType()
-    if (ProviderStore.connectionSchemaLoading || !endpointType) {
+    if (providerStore.connectionSchemaLoading || !endpointType) {
       return null
       return null
     }
     }
     return (
     return (
       <Content>
       <Content>
         {this.renderEndpointStatus()}
         {this.renderEndpointStatus()}
         {React.createElement(ContentPlugin[endpointType] || ContentPlugin.default, {
         {React.createElement(ContentPlugin[endpointType] || ContentPlugin.default, {
-          connectionInfoSchema: ProviderStore.connectionInfoSchema,
+          connectionInfoSchema: providerStore.connectionInfoSchema,
           // $FlowIgnore
           // $FlowIgnore
-          validation: EndpointStore.validation,
+          validation: endpointStore.validation,
           invalidFields: this.state.invalidFields,
           invalidFields: this.state.invalidFields,
           validating: this.state.validating,
           validating: this.state.validating,
           disabled: this.state.validating,
           disabled: this.state.validating,
@@ -404,7 +404,7 @@ class Endpoint extends React.Component<Props, State> {
   }
   }
 
 
   renderLoading() {
   renderLoading() {
-    if (!ProviderStore.connectionSchemaLoading) {
+    if (!providerStore.connectionSchemaLoading) {
       return null
       return null
     }
     }
 
 
@@ -417,7 +417,7 @@ class Endpoint extends React.Component<Props, State> {
   }
   }
 
 
   render() {
   render() {
-    if (EndpointStore.validation && EndpointStore.validation.valid
+    if (endpointStore.validation && endpointStore.validation.valid
       && !this.closeTimeout) {
       && !this.closeTimeout) {
       this.closeTimeout = setTimeout(() => {
       this.closeTimeout = setTimeout(() => {
         this.props.onCancelClick({ autoClose: true })
         this.props.onCancelClick({ autoClose: true })

+ 3 - 3
src/components/organisms/EndpointValidation/index.jsx

@@ -25,7 +25,7 @@ import StatusImage from '../../atoms/StatusImage'
 import Palette from '../../styleUtils/Palette'
 import Palette from '../../styleUtils/Palette'
 import type { Validation as ValidationType } from '../../../types/Endpoint'
 import type { Validation as ValidationType } from '../../../types/Endpoint'
 
 
-import NotificationStore from '../../../stores/NotificationStore'
+import notificationStore from '../../../stores/NotificationStore'
 import DomUtils from '../../../utils/DomUtils'
 import DomUtils from '../../../utils/DomUtils'
 
 
 const Wrapper = styled.div`
 const Wrapper = styled.div`
@@ -83,9 +83,9 @@ class EndpointValidation extends React.Component<Props> {
     let succesful = DomUtils.copyTextToClipboard(message)
     let succesful = DomUtils.copyTextToClipboard(message)
 
 
     if (succesful) {
     if (succesful) {
-      NotificationStore.notify('The value has been copied to clipboard.')
+      notificationStore.notify('The value has been copied to clipboard.')
     } else {
     } else {
-      NotificationStore.notify('The value couldn\'t be copied', 'error')
+      notificationStore.notify('The value couldn\'t be copied', 'error')
     }
     }
   }
   }
 
 

+ 2 - 2
src/components/organisms/LoginForm/index.jsx

@@ -28,7 +28,7 @@ import StyleProps from '../../styleUtils/StyleProps'
 import errorIcon from './images/error.svg'
 import errorIcon from './images/error.svg'
 
 
 import { loginButtons } from '../../../config'
 import { loginButtons } from '../../../config'
-import NotificationStore from '../../../stores/NotificationStore'
+import notificationStore from '../../../stores/NotificationStore'
 
 
 const Form = styled.form`
 const Form = styled.form`
   background: rgba(221, 224, 229, 0.5);
   background: rgba(221, 224, 229, 0.5);
@@ -120,7 +120,7 @@ class LoginForm extends React.Component<Props, State> {
     e.preventDefault()
     e.preventDefault()
 
 
     if (this.state.username.length === 0 || this.state.password.length === 0) {
     if (this.state.username.length === 0 || this.state.password.length === 0) {
-      NotificationStore.notify('Please fill in all fields')
+      notificationStore.notify('Please fill in all fields')
     } else {
     } else {
       this.props.onFormSubmit({ username: this.state.username, password: this.state.password })
       this.props.onFormSubmit({ username: this.state.username, password: this.state.password })
     }
     }

+ 2 - 2
src/components/organisms/Notifications/index.jsx

@@ -20,7 +20,7 @@ import styled, { injectGlobal } from 'styled-components'
 import NotificationSystem from 'react-notification-system'
 import NotificationSystem from 'react-notification-system'
 import { observe } from 'mobx'
 import { observe } from 'mobx'
 
 
-import NotificationStore from '../../../stores/NotificationStore'
+import notificationStore from '../../../stores/NotificationStore'
 import type { NotificationItem } from '../../../types/NotificationItem'
 import type { NotificationItem } from '../../../types/NotificationItem'
 
 
 import NotificationsStyle from './style.js'
 import NotificationsStyle from './style.js'
@@ -42,7 +42,7 @@ class Notifications extends React.Component<{}> {
   }
   }
 
 
   componentDidMount() {
   componentDidMount() {
-    observe(NotificationStore.notifications, change => {
+    observe(notificationStore.notifications, change => {
       this.handleStoreChange(change.object)
       this.handleStoreChange(change.object)
     })
     })
   }
   }

+ 17 - 17
src/components/organisms/PageHeader/index.jsx

@@ -27,10 +27,10 @@ import Modal from '../../molecules/Modal'
 import ChooseProvider from '../../organisms/ChooseProvider'
 import ChooseProvider from '../../organisms/ChooseProvider'
 import Endpoint from '../../organisms/Endpoint'
 import Endpoint from '../../organisms/Endpoint'
 
 
-import ProjectStore from '../../../stores/ProjectStore'
-import UserStore from '../../../stores/UserStore'
-import NotificationStore from '../../../stores/NotificationStore'
-import ProviderStore from '../../../stores/ProviderStore'
+import projectStore from '../../../stores/ProjectStore'
+import userStore from '../../../stores/UserStore'
+import notificationStore from '../../../stores/NotificationStore'
+import providerStore from '../../../stores/ProviderStore'
 import Palette from '../../styleUtils/Palette'
 import Palette from '../../styleUtils/Palette'
 import StyleProps from '../../styleUtils/StyleProps'
 import StyleProps from '../../styleUtils/StyleProps'
 
 
@@ -81,13 +81,13 @@ class PageHeader extends React.Component<Props, State> {
   }
   }
 
 
   componentDidMount() {
   componentDidMount() {
-    NotificationStore.loadNotifications()
+    notificationStore.loadNotifications()
   }
   }
 
 
   getCurrentProject() {
   getCurrentProject() {
-    let project = UserStore.user && UserStore.user.project ? UserStore.user.project : null
+    let project = userStore.user && userStore.user.project ? userStore.user.project : null
     if (project) {
     if (project) {
-      return ProjectStore.projects.find(p => p.id === project.id)
+      return projectStore.projects.find(p => p.id === project.id)
     }
     }
 
 
     return null
     return null
@@ -96,7 +96,7 @@ class PageHeader extends React.Component<Props, State> {
   handleUserItemClick(item: { value: string }) {
   handleUserItemClick(item: { value: string }) {
     switch (item.value) {
     switch (item.value) {
       case 'signout':
       case 'signout':
-        UserStore.logout()
+        userStore.logout()
         return
         return
       case 'profile':
       case 'profile':
         window.location.href = '/#/profile'
         window.location.href = '/#/profile'
@@ -108,7 +108,7 @@ class PageHeader extends React.Component<Props, State> {
   handleNewItem(item: ItemType) {
   handleNewItem(item: ItemType) {
     switch (item.value) {
     switch (item.value) {
       case 'endpoint':
       case 'endpoint':
-        ProviderStore.loadProviders()
+        providerStore.loadProviders()
         if (this.props.onModalOpen) {
         if (this.props.onModalOpen) {
           this.props.onModalOpen()
           this.props.onModalOpen()
         }
         }
@@ -119,7 +119,7 @@ class PageHeader extends React.Component<Props, State> {
   }
   }
 
 
   handleNotificationsClose() {
   handleNotificationsClose() {
-    NotificationStore.clearNotifications()
+    notificationStore.clearNotifications()
   }
   }
 
 
   handleCloseChooseProviderModal() {
   handleCloseChooseProviderModal() {
@@ -149,8 +149,8 @@ class PageHeader extends React.Component<Props, State> {
   }
   }
 
 
   handleProjectChange(project: Project) {
   handleProjectChange(project: Project) {
-    UserStore.switchProject(project.id).then(() => {
-      ProjectStore.getProjects()
+    userStore.switchProject(project.id).then(() => {
+      projectStore.getProjects()
 
 
       if (this.props.onProjectChange) {
       if (this.props.onProjectChange) {
         this.props.onProjectChange(project)
         this.props.onProjectChange(project)
@@ -165,14 +165,14 @@ class PageHeader extends React.Component<Props, State> {
         <Controls>
         <Controls>
           <Dropdown
           <Dropdown
             selectedItem={this.getCurrentProject()}
             selectedItem={this.getCurrentProject()}
-            items={ProjectStore.projects}
+            items={projectStore.projects}
             onChange={project => { this.handleProjectChange(project) }}
             onChange={project => { this.handleProjectChange(project) }}
             noItemsMessage="Loading..."
             noItemsMessage="Loading..."
             labelField="name"
             labelField="name"
           />
           />
           <NewItemDropdown onChange={item => { this.handleNewItem(item) }} />
           <NewItemDropdown onChange={item => { this.handleNewItem(item) }} />
-          <NotificationDropdown items={NotificationStore.persistedNotifications} onClose={() => this.handleNotificationsClose()} />
-          <UserDropdown user={UserStore.user} onItemClick={item => { this.handleUserItemClick(item) }} />
+          <NotificationDropdown items={notificationStore.persistedNotifications} onClose={() => this.handleNotificationsClose()} />
+          <UserDropdown user={userStore.user} onItemClick={item => { this.handleUserItemClick(item) }} />
         </Controls>
         </Controls>
         <Modal
         <Modal
           isOpen={this.state.showChooseProviderModal}
           isOpen={this.state.showChooseProviderModal}
@@ -181,8 +181,8 @@ class PageHeader extends React.Component<Props, State> {
         >
         >
           <ChooseProvider
           <ChooseProvider
             onCancelClick={() => { this.handleCloseChooseProviderModal() }}
             onCancelClick={() => { this.handleCloseChooseProviderModal() }}
-            providers={ProviderStore.providers}
-            loading={ProviderStore.providersLoading}
+            providers={providerStore.providers}
+            loading={providerStore.providersLoading}
             onProviderClick={providerName => { this.handleProviderClick(providerName) }}
             onProviderClick={providerName => { this.handleProviderClick(providerName) }}
           />
           />
         </Modal>
         </Modal>

+ 2 - 2
src/components/organisms/ReplicaDetailsContent/index.jsx

@@ -18,7 +18,7 @@ import React from 'react'
 import styled from 'styled-components'
 import styled from 'styled-components'
 import { observer } from 'mobx-react'
 import { observer } from 'mobx-react'
 
 
-import ScheduleStore from '../../../stores/ScheduleStore'
+import scheduleStore from '../../../stores/ScheduleStore'
 import Button from '../../atoms/Button'
 import Button from '../../atoms/Button'
 import DetailsNavigation from '../../molecules/DetailsNavigation'
 import DetailsNavigation from '../../molecules/DetailsNavigation'
 import MainDetails from '../../organisms/MainDetails'
 import MainDetails from '../../organisms/MainDetails'
@@ -71,7 +71,7 @@ type TimezoneValue = 'utc' | 'local'
 type Props = {
 type Props = {
   item: ?MainItem,
   item: ?MainItem,
   endpoints: Endpoint[],
   endpoints: Endpoint[],
-  scheduleStore: typeof ScheduleStore,
+  scheduleStore: typeof scheduleStore,
   page: string,
   page: string,
   detailsLoading: boolean,
   detailsLoading: boolean,
   executionsLoading: boolean,
   executionsLoading: boolean,

+ 9 - 9
src/components/organisms/WizardPageContent/index.jsx

@@ -38,11 +38,11 @@ import type { Instance, Nic } from '../../../types/Instance'
 import type { Field } from '../../../types/Field'
 import type { Field } from '../../../types/Field'
 import type { Network } from '../../../types/Network'
 import type { Network } from '../../../types/Network'
 import type { Schedule as ScheduleType } from '../../../types/Schedule'
 import type { Schedule as ScheduleType } from '../../../types/Schedule'
-import InstanceStore from '../../../stores/InstanceStore'
-import ProviderStore from '../../../stores/ProviderStore'
+import instanceStore from '../../../stores/InstanceStore'
+import providerStore from '../../../stores/ProviderStore'
 
 
 import migrationArrowImage from './images/migration.js'
 import migrationArrowImage from './images/migration.js'
-import NetworkStore from '../../../stores/NetworkStore'
+import networkStore from '../../../stores/NetworkStore'
 
 
 const Wrapper = styled.div`
 const Wrapper = styled.div`
   ${StyleProps.exactWidth(`${parseInt(StyleProps.contentWidth, 10) + 64}px`)}
   ${StyleProps.exactWidth(`${parseInt(StyleProps.contentWidth, 10) + 64}px`)}
@@ -94,9 +94,9 @@ type Props = {
   page: { id: string, title: string },
   page: { id: string, title: string },
   type: 'replica' | 'migration',
   type: 'replica' | 'migration',
   nextButtonDisabled: boolean,
   nextButtonDisabled: boolean,
-  providerStore: typeof ProviderStore,
-  instanceStore: typeof InstanceStore,
-  networkStore: typeof NetworkStore,
+  providerStore: typeof providerStore,
+  instanceStore: typeof instanceStore,
+  networkStore: typeof networkStore,
   wizardData: WizardData,
   wizardData: WizardData,
   endpoints: Endpoint[],
   endpoints: Endpoint[],
   onTypeChange: (isReplicaChecked: ?boolean) => void,
   onTypeChange: (isReplicaChecked: ?boolean) => void,
@@ -197,9 +197,9 @@ class WizardPageContent extends React.Component<Props, State> {
   isOptionsPageValid() {
   isOptionsPageValid() {
     const isValid = (field: Field): boolean => {
     const isValid = (field: Field): boolean => {
       return (this.props.wizardData.options &&
       return (this.props.wizardData.options &&
-          this.props.wizardData.options[field.name] !== null &&
-          this.props.wizardData.options[field.name] !== undefined &&
-          this.props.wizardData.options[field.name] !== ''
+        this.props.wizardData.options[field.name] !== null &&
+        this.props.wizardData.options[field.name] !== undefined &&
+        this.props.wizardData.options[field.name] !== ''
       ) || (field.default !== null && field.default !== undefined)
       ) || (field.default !== null && field.default !== undefined)
     }
     }
 
 

+ 54 - 54
src/components/pages/AssessmentDetailsPage/index.jsx

@@ -30,14 +30,14 @@ import type { VmItem, VmSize } from '../../../types/Assessment'
 import type { Field } from '../../../types/Field'
 import type { Field } from '../../../types/Field'
 import type { Network, NetworkMap } from '../../../types/Network'
 import type { Network, NetworkMap } from '../../../types/Network'
 
 
-import AzureStore from '../../../stores/AzureStore'
-import EndpointStore from '../../../stores/EndpointStore'
-import NotificationStore from '../../../stores/NotificationStore'
-import ReplicaStore from '../../../stores/ReplicaStore'
-import InstanceStore from '../../../stores/InstanceStore'
-import NetworkStore from '../../../stores/NetworkStore'
-import UserStore from '../../../stores/UserStore'
-import AssessmentStore from '../../../stores/AssessmentStore'
+import azureStore from '../../../stores/AzureStore'
+import endpointStore from '../../../stores/EndpointStore'
+import notificationStore from '../../../stores/NotificationStore'
+import replicaStore from '../../../stores/ReplicaStore'
+import instanceStore from '../../../stores/InstanceStore'
+import networkStore from '../../../stores/NetworkStore'
+import userStore from '../../../stores/UserStore'
+import assessmentStore from '../../../stores/AssessmentStore'
 
 
 import assessmentImage from './images/assessment.svg'
 import assessmentImage from './images/assessment.svg'
 
 
@@ -78,9 +78,9 @@ class AssessmentDetailsPage extends React.Component<Props, State> {
   }
   }
 
 
   componentWillUnmount() {
   componentWillUnmount() {
-    AzureStore.clearAssessmentDetails()
-    AzureStore.clearAssessedVms()
-    InstanceStore.clearInstancesDetails()
+    azureStore.clearAssessmentDetails()
+    azureStore.clearAssessedVms()
+    instanceStore.clearInstancesDetails()
   }
   }
 
 
   getUrlInfo() {
   getUrlInfo() {
@@ -89,8 +89,8 @@ class AssessmentDetailsPage extends React.Component<Props, State> {
   }
   }
 
 
   getEndpoints() {
   getEndpoints() {
-    let vms = AzureStore.assessedVms
-    let connectionsInfo = EndpointStore.connectionsInfo
+    let vms = azureStore.assessedVms
+    let connectionsInfo = endpointStore.connectionsInfo
 
 
     if (vms.length === 0 || connectionsInfo.length === 0) {
     if (vms.length === 0 || connectionsInfo.length === 0) {
       return []
       return []
@@ -103,17 +103,17 @@ class AssessmentDetailsPage extends React.Component<Props, State> {
   }
   }
 
 
   getInstancesDetailsProgress() {
   getInstancesDetailsProgress() {
-    let count = InstanceStore.instancesDetailsCount
+    let count = instanceStore.instancesDetailsCount
     if (count < 5) {
     if (count < 5) {
       return null
       return null
     }
     }
-    let remaining = InstanceStore.instancesDetailsRemaining
+    let remaining = instanceStore.instancesDetailsRemaining
     return (count - remaining) / count
     return (count - remaining) / count
   }
   }
 
 
   getFilteredAssessedVms(vms?: VmItem[]) {
   getFilteredAssessedVms(vms?: VmItem[]) {
     if (!vms) {
     if (!vms) {
-      vms = AzureStore.assessedVms
+      vms = azureStore.assessedVms
     }
     }
     return vms.filter(vm =>
     return vms.filter(vm =>
       `${vm.properties.datacenterContainer}/${vm.properties.displayName}`.toLowerCase().indexOf(this.state.vmSearchValue.toLowerCase()) > -1
       `${vm.properties.datacenterContainer}/${vm.properties.displayName}`.toLowerCase().indexOf(this.state.vmSearchValue.toLowerCase()) > -1
@@ -125,7 +125,7 @@ class AssessmentDetailsPage extends React.Component<Props, State> {
   }
   }
 
 
   getEnabledVms() {
   getEnabledVms() {
-    let sourceConnInfo = EndpointStore.connectionsInfo.find(e => e.id === this.getSourceEndpointId())
+    let sourceConnInfo = endpointStore.connectionsInfo.find(e => e.id === this.getSourceEndpointId())
     if (!sourceConnInfo) {
     if (!sourceConnInfo) {
       return []
       return []
     }
     }
@@ -134,9 +134,9 @@ class AssessmentDetailsPage extends React.Component<Props, State> {
     if (!sourceHost) {
     if (!sourceHost) {
       return []
       return []
     }
     }
-    return AzureStore.assessedVms.filter(vm => {
+    return azureStore.assessedVms.filter(vm => {
       if (vm.properties.datacenterManagementServer.toLowerCase() === sourceHost.toLowerCase() &&
       if (vm.properties.datacenterManagementServer.toLowerCase() === sourceHost.toLowerCase() &&
-        InstanceStore.instances.find(i => i.instance_name === `${vm.properties.datacenterContainer}/${vm.properties.displayName}`)) {
+        instanceStore.instances.find(i => i.instance_name === `${vm.properties.datacenterContainer}/${vm.properties.displayName}`)) {
         return true
         return true
       }
       }
       return false
       return false
@@ -166,7 +166,7 @@ class AssessmentDetailsPage extends React.Component<Props, State> {
 
 
   handleSourceEndpointChange(sourceEndpoint: ?Endpoint) {
   handleSourceEndpointChange(sourceEndpoint: ?Endpoint) {
     this.setState({ sourceEndpoint, selectedVms: [], selectedNetworks: [] })
     this.setState({ sourceEndpoint, selectedVms: [], selectedNetworks: [] })
-    InstanceStore.loadInstances(this.getSourceEndpointId(), true, true).then(() => {
+    instanceStore.loadInstances(this.getSourceEndpointId(), true, true).then(() => {
       this.initSelectedVms()
       this.initSelectedVms()
       this.loadInstancesDetails()
       this.loadInstancesDetails()
     })
     })
@@ -175,7 +175,7 @@ class AssessmentDetailsPage extends React.Component<Props, State> {
   handleUserItemClick(item: { value: string }) {
   handleUserItemClick(item: { value: string }) {
     switch (item.value) {
     switch (item.value) {
       case 'signout':
       case 'signout':
-        UserStore.logout()
+        userStore.logout()
         return
         return
       case 'profile':
       case 'profile':
         window.location.href = '/#/profile'
         window.location.href = '/#/profile'
@@ -198,8 +198,8 @@ class AssessmentDetailsPage extends React.Component<Props, State> {
 
 
   handleRefresh() {
   handleRefresh() {
     let urlInfo = this.getUrlInfo()
     let urlInfo = this.getUrlInfo()
-    AzureStore.getAssessmentDetails({ ...urlInfo })
-    AzureStore.getAssessedVms({ ...urlInfo })
+    azureStore.getAssessmentDetails({ ...urlInfo })
+    azureStore.getAssessedVms({ ...urlInfo })
     this.loadInstancesDetails()
     this.loadInstancesDetails()
   }
   }
 
 
@@ -212,7 +212,7 @@ class AssessmentDetailsPage extends React.Component<Props, State> {
   }
   }
 
 
   handleMigrationExecute(options: Field[]) {
   handleMigrationExecute(options: Field[]) {
-    let selectedInstances = InstanceStore.instancesDetails
+    let selectedInstances = instanceStore.instancesDetails
       .filter(i => this.state.selectedVms.find(m => i.instance_name === `${m.properties.datacenterContainer}/${m.properties.displayName}`))
       .filter(i => this.state.selectedVms.find(m => i.instance_name === `${m.properties.datacenterContainer}/${m.properties.displayName}`))
     let vmSizes = {}
     let vmSizes = {}
     selectedInstances.forEach(i => {
     selectedInstances.forEach(i => {
@@ -222,14 +222,14 @@ class AssessmentDetailsPage extends React.Component<Props, State> {
 
 
     this.setState({ executeButtonDisabled: true })
     this.setState({ executeButtonDisabled: true })
 
 
-    AssessmentStore.migrate({
+    assessmentStore.migrate({
       source: this.state.sourceEndpoint,
       source: this.state.sourceEndpoint,
       target: this.getUrlInfo().endpoint,
       target: this.getUrlInfo().endpoint,
       networks: [...this.state.selectedNetworks],
       networks: [...this.state.selectedNetworks],
       options: [...options],
       options: [...options],
       destinationEnv: {
       destinationEnv: {
         resource_group: this.getUrlInfo().resourceGroupName,
         resource_group: this.getUrlInfo().resourceGroupName,
-        location: AzureStore.assessmentDetails ? AzureStore.assessmentDetails.properties.azureLocation : '',
+        location: azureStore.assessmentDetails ? azureStore.assessmentDetails.properties.azureLocation : '',
       },
       },
       vmSizes,
       vmSizes,
       selectedInstances,
       selectedInstances,
@@ -237,11 +237,11 @@ class AssessmentDetailsPage extends React.Component<Props, State> {
       this.setState({ showMigrationOptions: false })
       this.setState({ showMigrationOptions: false })
       let useReplicaOption = options.find(o => o.name === 'use_replica')
       let useReplicaOption = options.find(o => o.name === 'use_replica')
       let type = useReplicaOption && useReplicaOption.value ? 'Replica' : 'Migration'
       let type = useReplicaOption && useReplicaOption.value ? 'Replica' : 'Migration'
-      NotificationStore.notify(`${type} was succesfully created`, 'success', { persist: true, persistInfo: { title: `${type} created` } })
+      notificationStore.notify(`${type} was succesfully created`, 'success', { persist: true, persistInfo: { title: `${type} created` } })
 
 
       if (type === 'Replica') {
       if (type === 'Replica') {
-        AssessmentStore.migrations.forEach(replica => {
-          ReplicaStore.execute(replica.id, options)
+        assessmentStore.migrations.forEach(replica => {
+          replicaStore.execute(replica.id, options)
         })
         })
       }
       }
 
 
@@ -266,14 +266,14 @@ class AssessmentDetailsPage extends React.Component<Props, State> {
 
 
   azureAuthenticate() {
   azureAuthenticate() {
     let connectionInfo = this.getUrlInfo().connectionInfo
     let connectionInfo = this.getUrlInfo().connectionInfo
-    AzureStore.authenticate(connectionInfo.user_credentials.username, connectionInfo.user_credentials.password).then(() => {
+    azureStore.authenticate(connectionInfo.user_credentials.username, connectionInfo.user_credentials.password).then(() => {
       this.loadAssessmentDetails()
       this.loadAssessmentDetails()
     })
     })
   }
   }
 
 
   loadSourceEndpoints() {
   loadSourceEndpoints() {
-    EndpointStore.getEndpoints({ showLoading: true }).then(() => {
-      EndpointStore.getConnectionsInfo(EndpointStore.endpoints.filter(e => e.type === 'vmware_vsphere')).then(() => {
+    endpointStore.getEndpoints({ showLoading: true }).then(() => {
+      endpointStore.getConnectionsInfo(endpointStore.endpoints.filter(e => e.type === 'vmware_vsphere')).then(() => {
         let endpoints = this.getEndpoints()
         let endpoints = this.getEndpoints()
         let sourceEndpoint = endpoints.find(e => e.id === this.getSourceEndpointId())
         let sourceEndpoint = endpoints.find(e => e.id === this.getSourceEndpointId())
         if (sourceEndpoint) {
         if (sourceEndpoint) {
@@ -289,11 +289,11 @@ class AssessmentDetailsPage extends React.Component<Props, State> {
 
 
   loadAssessmentDetails() {
   loadAssessmentDetails() {
     let urlInfo = this.getUrlInfo()
     let urlInfo = this.getUrlInfo()
-    AzureStore.getAssessmentDetails({ ...urlInfo }).then(() => {
-      AzureStore.getVmSizes({ ...urlInfo, location: AzureStore.assessmentDetails ? AzureStore.assessmentDetails.properties.azureLocation : '' })
+    azureStore.getAssessmentDetails({ ...urlInfo }).then(() => {
+      azureStore.getVmSizes({ ...urlInfo, location: azureStore.assessmentDetails ? azureStore.assessmentDetails.properties.azureLocation : '' })
       this.loadNetworks()
       this.loadNetworks()
     })
     })
-    AzureStore.getAssessedVms({ ...urlInfo }).then(() => {
+    azureStore.getAssessedVms({ ...urlInfo }).then(() => {
       this.initVmSizes()
       this.initVmSizes()
       this.loadSourceEndpoints()
       this.loadSourceEndpoints()
     })
     })
@@ -305,7 +305,7 @@ class AssessmentDetailsPage extends React.Component<Props, State> {
 
 
   initVmSizes() {
   initVmSizes() {
     let vmSizes = {}
     let vmSizes = {}
-    let vms = AzureStore.assessedVms
+    let vms = azureStore.assessedVms
 
 
     vms.forEach(vm => {
     vms.forEach(vm => {
       vmSizes[vm.id] = { name: vm.properties.recommendedSize }
       vmSizes[vm.id] = { name: vm.properties.recommendedSize }
@@ -316,23 +316,23 @@ class AssessmentDetailsPage extends React.Component<Props, State> {
 
 
   loadNetworks() {
   loadNetworks() {
     this.setState({ selectedNetworks: [] })
     this.setState({ selectedNetworks: [] })
-    let details = AzureStore.assessmentDetails
-    NetworkStore.loadNetworks(this.getUrlInfo().endpoint.id, {
+    let details = azureStore.assessmentDetails
+    networkStore.loadNetworks(this.getUrlInfo().endpoint.id, {
       location: details ? details.properties.azureLocation : '',
       location: details ? details.properties.azureLocation : '',
       resource_group: this.getUrlInfo().resourceGroupName,
       resource_group: this.getUrlInfo().resourceGroupName,
     })
     })
   }
   }
 
 
   loadInstancesDetails() {
   loadInstancesDetails() {
-    let instances = InstanceStore.instances.filter(i => this.state.selectedVms.find(m => i.instance_name === `${m.properties.datacenterContainer}/${m.properties.displayName}`))
-    InstanceStore.clearInstancesDetails()
-    InstanceStore.loadInstancesDetails(this.getSourceEndpointId(), instances)
+    let instances = instanceStore.instances.filter(i => this.state.selectedVms.find(m => i.instance_name === `${m.properties.datacenterContainer}/${m.properties.displayName}`))
+    instanceStore.clearInstancesDetails()
+    instanceStore.loadInstancesDetails(this.getSourceEndpointId(), instances)
   }
   }
 
 
   render() {
   render() {
-    let details = AzureStore.assessmentDetails
-    let loading = AzureStore.loadingAssessmentDetails || AzureStore.authenticating || AzureStore.loadingAssessedVms
-    let endpointsLoading = EndpointStore.connectionsInfoLoading || EndpointStore.loading
+    let details = azureStore.assessmentDetails
+    let loading = azureStore.loadingAssessmentDetails || azureStore.authenticating || azureStore.loadingAssessedVms
+    let endpointsLoading = endpointStore.connectionsInfoLoading || endpointStore.loading
     let status = details ? details.properties.status.toUpperCase() : ''
     let status = details ? details.properties.status.toUpperCase() : ''
     let statusLabel = status === 'COMPLETED' ? 'READY' : status
     let statusLabel = status === 'COMPLETED' ? 'READY' : status
 
 
@@ -340,7 +340,7 @@ class AssessmentDetailsPage extends React.Component<Props, State> {
       <Wrapper>
       <Wrapper>
         <DetailsTemplate
         <DetailsTemplate
           pageHeaderComponent={<DetailsPageHeader
           pageHeaderComponent={<DetailsPageHeader
-            user={UserStore.user}
+            user={userStore.user}
             onUserItemClick={item => { this.handleUserItemClick(item) }}
             onUserItemClick={item => { this.handleUserItemClick(item) }}
           />}
           />}
           contentHeaderComponent={<DetailsContentHeader
           contentHeaderComponent={<DetailsContentHeader
@@ -364,23 +364,23 @@ class AssessmentDetailsPage extends React.Component<Props, State> {
               sourceEndpoints={this.getEndpoints()}
               sourceEndpoints={this.getEndpoints()}
               sourceEndpointsLoading={endpointsLoading}
               sourceEndpointsLoading={endpointsLoading}
               sourceEndpoint={this.state.sourceEndpoint}
               sourceEndpoint={this.state.sourceEndpoint}
-              assessedVmsCount={AzureStore.assessedVms.length}
+              assessedVmsCount={azureStore.assessedVms.length}
               filteredAssessedVms={this.getFilteredAssessedVms()}
               filteredAssessedVms={this.getFilteredAssessedVms()}
               onSourceEndpointChange={endpoint => this.handleSourceEndpointChange(endpoint)}
               onSourceEndpointChange={endpoint => this.handleSourceEndpointChange(endpoint)}
               selectedVms={this.state.selectedVms}
               selectedVms={this.state.selectedVms}
               onVmSelectedChange={(vm, selected) => { this.handleVmSelectedChange(vm, selected) }}
               onVmSelectedChange={(vm, selected) => { this.handleVmSelectedChange(vm, selected) }}
               selectAllVmsChecked={this.getSelectAllVmsChecked()}
               selectAllVmsChecked={this.getSelectAllVmsChecked()}
               onSelectAllVmsChange={checked => { this.handleSelectAllVmsChange(checked) }}
               onSelectAllVmsChange={checked => { this.handleSelectAllVmsChange(checked) }}
-              instances={InstanceStore.instances}
-              instancesDetails={InstanceStore.instancesDetails}
-              instancesDetailsLoading={InstanceStore.loadingInstancesDetails}
-              instancesLoading={InstanceStore.instancesLoading}
-              networksLoading={NetworkStore.loading}
+              instances={instanceStore.instances}
+              instancesDetails={instanceStore.instancesDetails}
+              instancesDetailsLoading={instanceStore.loadingInstancesDetails}
+              instancesLoading={instanceStore.instancesLoading}
+              networksLoading={networkStore.loading}
               instancesDetailsProgress={this.getInstancesDetailsProgress()}
               instancesDetailsProgress={this.getInstancesDetailsProgress()}
-              networks={NetworkStore.networks}
+              networks={networkStore.networks}
               selectedNetworks={this.state.selectedNetworks}
               selectedNetworks={this.state.selectedNetworks}
-              loadingVmSizes={AzureStore.loadingVmSizes}
-              vmSizes={AzureStore.vmSizes}
+              loadingVmSizes={azureStore.loadingVmSizes}
+              vmSizes={azureStore.vmSizes}
               onVmSizeChange={(vm, size) => {
               onVmSizeChange={(vm, size) => {
                 // $FlowIgnore
                 // $FlowIgnore
                 this.handleVmSizeChange(vm, size)
                 this.handleVmSizeChange(vm, size)

+ 53 - 53
src/components/pages/AssessmentsPage/index.jsx

@@ -27,18 +27,18 @@ import AssessmentListItem from '../../molecules/AssessmentListItem'
 import type { Assessment } from '../../../types/Assessment'
 import type { Assessment } from '../../../types/Assessment'
 import type { Endpoint } from '../../../types/Endpoint'
 import type { Endpoint } from '../../../types/Endpoint'
 
 
-import AzureStore from '../../../stores/AzureStore'
-import AssessmentStore from '../../../stores/AssessmentStore'
-import EndpointStore from '../../../stores/EndpointStore'
-import ProjectStore from '../../../stores/ProjectStore'
-import UserStore from '../../../stores/UserStore'
+import azureStore from '../../../stores/AzureStore'
+import assessmentStore from '../../../stores/AssessmentStore'
+import endpointStore from '../../../stores/EndpointStore'
+import projectStore from '../../../stores/ProjectStore'
+import userStore from '../../../stores/UserStore'
 
 
 import { requestPollTimeout } from '../../../config'
 import { requestPollTimeout } from '../../../config'
 
 
 const Wrapper = styled.div``
 const Wrapper = styled.div``
 
 
 type Props = {}
 type Props = {}
-type State = {modalIsOpen: boolean}
+type State = { modalIsOpen: boolean }
 @observer
 @observer
 class AssessmentsPage extends React.Component<Props, State> {
 class AssessmentsPage extends React.Component<Props, State> {
   disablePolling: boolean
   disablePolling: boolean
@@ -49,20 +49,20 @@ class AssessmentsPage extends React.Component<Props, State> {
   }
   }
 
 
   componentWillMount() {
   componentWillMount() {
-    ProjectStore.getProjects()
+    projectStore.getProjects()
 
 
-    if (!AzureStore.isLoadedForCurrentProject()) {
-      AssessmentStore.clearSelection()
-      AzureStore.clearAssessments()
+    if (!azureStore.isLoadedForCurrentProject()) {
+      assessmentStore.clearSelection()
+      azureStore.clearAssessments()
     }
     }
 
 
     this.disablePolling = false
     this.disablePolling = false
     this.pollData()
     this.pollData()
 
 
-    EndpointStore.getEndpoints({ showLoading: true }).then(() => {
-      let endpoints = EndpointStore.endpoints.filter(e => e.type === 'azure')
+    endpointStore.getEndpoints({ showLoading: true }).then(() => {
+      let endpoints = endpointStore.endpoints.filter(e => e.type === 'azure')
       if (endpoints.length > 0) {
       if (endpoints.length > 0) {
-        this.chooseEndpoint(AssessmentStore.selectedEndpoint && AssessmentStore.selectedEndpoint.id ? AssessmentStore.selectedEndpoint : endpoints[0])
+        this.chooseEndpoint(assessmentStore.selectedEndpoint && assessmentStore.selectedEndpoint.id ? assessmentStore.selectedEndpoint : endpoints[0])
       }
       }
     })
     })
   }
   }
@@ -73,23 +73,23 @@ class AssessmentsPage extends React.Component<Props, State> {
   }
   }
 
 
   getEndpointsDropdownConfig() {
   getEndpointsDropdownConfig() {
-    let endpoints = EndpointStore.endpoints.filter(e => e.type === 'azure')
+    let endpoints = endpointStore.endpoints.filter(e => e.type === 'azure')
     return {
     return {
       key: 'endpoint',
       key: 'endpoint',
-      selectedItem: AssessmentStore.selectedEndpoint ? AssessmentStore.selectedEndpoint.id : '',
+      selectedItem: assessmentStore.selectedEndpoint ? assessmentStore.selectedEndpoint.id : '',
       items: endpoints.map(endpoint => ({ label: endpoint.name, value: endpoint.id, endpoint })),
       items: endpoints.map(endpoint => ({ label: endpoint.name, value: endpoint.id, endpoint })),
       onChange: (item: { endpoint: Endpoint }) => { this.chooseEndpoint(item.endpoint, true) },
       onChange: (item: { endpoint: Endpoint }) => { this.chooseEndpoint(item.endpoint, true) },
       selectItemLabel: 'Select Endpoint',
       selectItemLabel: 'Select Endpoint',
-      noItemsLabel: EndpointStore.loading ? 'Loading ...' : 'No Endpoints',
+      noItemsLabel: endpointStore.loading ? 'Loading ...' : 'No Endpoints',
       limitListOffset: true,
       limitListOffset: true,
     }
     }
   }
   }
 
 
   getResourceGroupsDropdownConfig() {
   getResourceGroupsDropdownConfig() {
-    let groups = AzureStore.resourceGroups
+    let groups = azureStore.resourceGroups
     return {
     return {
       key: 'resource-group',
       key: 'resource-group',
-      selectedItem: AssessmentStore.selectedResourceGroup ? AssessmentStore.selectedResourceGroup.id : '',
+      selectedItem: assessmentStore.selectedResourceGroup ? assessmentStore.selectedResourceGroup.id : '',
       items: groups.map(group => ({ label: group.name, value: group.id, group })),
       items: groups.map(group => ({ label: group.name, value: group.id, group })),
       onChange: (item: Assessment) => { this.chooseResourceGroup(item.group) },
       onChange: (item: Assessment) => { this.chooseResourceGroup(item.group) },
       selectItemLabel: 'Loading ...',
       selectItemLabel: 'Loading ...',
@@ -99,7 +99,7 @@ class AssessmentsPage extends React.Component<Props, State> {
 
 
   getFilterItems() {
   getFilterItems() {
     let types = [{ label: 'All projects', value: 'all' }]
     let types = [{ label: 'All projects', value: 'all' }]
-    let assessments = AzureStore.assessments
+    let assessments = azureStore.assessments
     let uniqueProjects = []
     let uniqueProjects = []
 
 
     assessments.forEach(a => {
     assessments.forEach(a => {
@@ -113,15 +113,15 @@ class AssessmentsPage extends React.Component<Props, State> {
   }
   }
 
 
   handleReloadButtonClick() {
   handleReloadButtonClick() {
-    if (!EndpointStore.connectionInfo) {
+    if (!endpointStore.connectionInfo) {
       return
       return
     }
     }
 
 
-    AzureStore.getAssessments(
+    azureStore.getAssessments(
       // $FlowIgnore
       // $FlowIgnore
-      EndpointStore.connectionInfo.subscription_id,
-      AssessmentStore.selectedResourceGroup ? AssessmentStore.selectedResourceGroup.name : '',
-      UserStore.user ? UserStore.user.project.id : ''
+      endpointStore.connectionInfo.subscription_id,
+      assessmentStore.selectedResourceGroup ? assessmentStore.selectedResourceGroup.name : '',
+      userStore.user ? userStore.user.project.id : ''
     )
     )
   }
   }
 
 
@@ -130,9 +130,9 @@ class AssessmentsPage extends React.Component<Props, State> {
       return
       return
     }
     }
 
 
-    let connectionInfo = EndpointStore.connectionInfo
-    let endpoint = AssessmentStore.selectedEndpoint
-    let resourceGroupName = AssessmentStore.selectedResourceGroup ? AssessmentStore.selectedResourceGroup.name : ''
+    let connectionInfo = endpointStore.connectionInfo
+    let endpoint = assessmentStore.selectedEndpoint
+    let resourceGroupName = assessmentStore.selectedResourceGroup ? assessmentStore.selectedResourceGroup.name : ''
     let projectName = assessment.project.name
     let projectName = assessment.project.name
     let groupName = assessment.group.name
     let groupName = assessment.group.name
     let assessmentName = assessment.name
     let assessmentName = assessment.name
@@ -143,12 +143,12 @@ class AssessmentsPage extends React.Component<Props, State> {
   }
   }
 
 
   handleProjectChange() {
   handleProjectChange() {
-    AssessmentStore.clearSelection()
-    AzureStore.clearAssessments()
-    EndpointStore.getEndpoints({ showLoading: true }).then(() => {
-      let endpoints = EndpointStore.endpoints.filter(e => e.type === 'azure')
+    assessmentStore.clearSelection()
+    azureStore.clearAssessments()
+    endpointStore.getEndpoints({ showLoading: true }).then(() => {
+      let endpoints = endpointStore.endpoints.filter(e => e.type === 'azure')
       if (endpoints.length > 0) {
       if (endpoints.length > 0) {
-        this.chooseEndpoint(AssessmentStore.selectedEndpoint && AssessmentStore.selectedEndpoint.id ? AssessmentStore.selectedEndpoint : endpoints[0])
+        this.chooseEndpoint(assessmentStore.selectedEndpoint && assessmentStore.selectedEndpoint.id ? assessmentStore.selectedEndpoint : endpoints[0])
       }
       }
     })
     })
   }
   }
@@ -164,7 +164,7 @@ class AssessmentsPage extends React.Component<Props, State> {
   }
   }
 
 
   areResourceGroupsLoading() {
   areResourceGroupsLoading() {
-    return AzureStore.authenticating || AzureStore.loadingResourceGroups
+    return azureStore.authenticating || azureStore.loadingResourceGroups
   }
   }
 
 
   pollData() {
   pollData() {
@@ -172,19 +172,19 @@ class AssessmentsPage extends React.Component<Props, State> {
       return
       return
     }
     }
 
 
-    let connectionInfo = EndpointStore.connectionInfo
-    let selectedResourceGroup = AssessmentStore.selectedResourceGroup
+    let connectionInfo = endpointStore.connectionInfo
+    let selectedResourceGroup = assessmentStore.selectedResourceGroup
 
 
     if (!connectionInfo || !connectionInfo.subscription_id || !selectedResourceGroup || !selectedResourceGroup.name) {
     if (!connectionInfo || !connectionInfo.subscription_id || !selectedResourceGroup || !selectedResourceGroup.name) {
       this.pollTimeout = setTimeout(() => { this.pollData() }, requestPollTimeout)
       this.pollTimeout = setTimeout(() => { this.pollData() }, requestPollTimeout)
       return
       return
     }
     }
 
 
-    AzureStore.getAssessments(
+    azureStore.getAssessments(
       // $FlowIgnore
       // $FlowIgnore
       connectionInfo.subscription_id,
       connectionInfo.subscription_id,
       selectedResourceGroup.name,
       selectedResourceGroup.name,
-      UserStore.user ? UserStore.user.project.id : '',
+      userStore.user ? userStore.user.project.id : '',
       { backgroundLoading: true }
       { backgroundLoading: true }
     ).then(() => {
     ).then(() => {
       this.pollTimeout = setTimeout(() => { this.pollData() }, requestPollTimeout)
       this.pollTimeout = setTimeout(() => { this.pollData() }, requestPollTimeout)
@@ -192,41 +192,41 @@ class AssessmentsPage extends React.Component<Props, State> {
   }
   }
 
 
   chooseResourceGroup(selectedResourceGroup: $PropertyType<Assessment, 'group'>) {
   chooseResourceGroup(selectedResourceGroup: $PropertyType<Assessment, 'group'>) {
-    if (!EndpointStore.connectionInfo) {
+    if (!endpointStore.connectionInfo) {
       return
       return
     }
     }
 
 
-    AssessmentStore.updateSelectedResourceGroup(selectedResourceGroup)
-    AzureStore.getAssessments(
+    assessmentStore.updateSelectedResourceGroup(selectedResourceGroup)
+    azureStore.getAssessments(
       // $FlowIssue
       // $FlowIssue
-      EndpointStore.connectionInfo.subscription_id,
+      endpointStore.connectionInfo.subscription_id,
       selectedResourceGroup.name,
       selectedResourceGroup.name,
-      UserStore.user ? UserStore.user.project.id : '',
+      userStore.user ? userStore.user.project.id : '',
     )
     )
   }
   }
 
 
   chooseEndpoint(selectedEndpoint: Endpoint, clearResourceGroup?: boolean) {
   chooseEndpoint(selectedEndpoint: Endpoint, clearResourceGroup?: boolean) {
-    if (AssessmentStore.selectedEndpoint && AssessmentStore.selectedEndpoint.id === selectedEndpoint.id) {
+    if (assessmentStore.selectedEndpoint && assessmentStore.selectedEndpoint.id === selectedEndpoint.id) {
       return
       return
     }
     }
 
 
-    AssessmentStore.updateSelectedEndpoint(selectedEndpoint)
+    assessmentStore.updateSelectedEndpoint(selectedEndpoint)
 
 
     if (clearResourceGroup) {
     if (clearResourceGroup) {
-      AssessmentStore.updateSelectedResourceGroup(null)
+      assessmentStore.updateSelectedResourceGroup(null)
     }
     }
 
 
-    EndpointStore.getConnectionInfo(selectedEndpoint).then(() => {
-      let connectionInfo = EndpointStore.connectionInfo
+    endpointStore.getConnectionInfo(selectedEndpoint).then(() => {
+      let connectionInfo = endpointStore.connectionInfo
       if (!connectionInfo) {
       if (!connectionInfo) {
         return
         return
       }
       }
       // $FlowIgnore
       // $FlowIgnore
-      AzureStore.authenticate(connectionInfo.user_credentials.username, connectionInfo.user_credentials.password).then(() => {
+      azureStore.authenticate(connectionInfo.user_credentials.username, connectionInfo.user_credentials.password).then(() => {
         // $FlowIgnore
         // $FlowIgnore
-        AzureStore.getResourceGroups(connectionInfo.subscription_id).then(() => {
-          let groups = AzureStore.resourceGroups
-          let selectedGroup = AssessmentStore.selectedResourceGroup
+        azureStore.getResourceGroups(connectionInfo.subscription_id).then(() => {
+          let groups = azureStore.resourceGroups
+          let selectedGroup = assessmentStore.selectedResourceGroup
           // $FlowIssue
           // $FlowIssue
           if (groups.filter(rg => rg.id === selectedGroup ? selectedGroup.id : '').length > 0) {
           if (groups.filter(rg => rg.id === selectedGroup ? selectedGroup.id : '').length > 0) {
             return
             return
@@ -260,10 +260,10 @@ class AssessmentsPage extends React.Component<Props, State> {
             <FilterList
             <FilterList
               filterItems={this.getFilterItems()}
               filterItems={this.getFilterItems()}
               selectionLabel="assessments"
               selectionLabel="assessments"
-              loading={this.areResourceGroupsLoading() || AzureStore.loadingAssessments}
+              loading={this.areResourceGroupsLoading() || azureStore.loadingAssessments}
               items={
               items={
                 // $FlowIgnore
                 // $FlowIgnore
-                AzureStore.assessments
+                azureStore.assessments
               }
               }
               onItemClick={item => {
               onItemClick={item => {
                 let itemAny: any = item
                 let itemAny: any = item

+ 26 - 26
src/components/pages/EndpointDetailsPage/index.jsx

@@ -27,10 +27,10 @@ import Modal from '../../molecules/Modal'
 import EndpointValidation from '../../organisms/EndpointValidation'
 import EndpointValidation from '../../organisms/EndpointValidation'
 import Endpoint from '../../organisms/Endpoint'
 import Endpoint from '../../organisms/Endpoint'
 
 
-import EndpointStore from '../../../stores/EndpointStore'
-import MigrationStore from '../../../stores/MigrationStore'
-import ReplicaStore from '../../../stores/ReplicaStore'
-import UserStore from '../../../stores/UserStore'
+import endpointStore from '../../../stores/EndpointStore'
+import migrationStore from '../../../stores/MigrationStore'
+import replicaStore from '../../../stores/ReplicaStore'
+import userStore from '../../../stores/UserStore'
 import type { Endpoint as EndpointType } from '../../../types/Endpoint'
 import type { Endpoint as EndpointType } from '../../../types/Endpoint'
 import type { MainItem } from '../../../types/MainItem'
 import type { MainItem } from '../../../types/MainItem'
 
 
@@ -47,7 +47,7 @@ type State = {
   showEndpointModal: boolean,
   showEndpointModal: boolean,
   showEndpointInUseModal: boolean,
   showEndpointInUseModal: boolean,
   showEndpointInUseLoadingModal: boolean,
   showEndpointInUseLoadingModal: boolean,
-  endpointUsage: {replicas: MainItem[], migrations: MainItem[]}
+  endpointUsage: { replicas: MainItem[], migrations: MainItem[] }
 }
 }
 @observer
 @observer
 class EndpointDetailsPage extends React.Component<Props, State> {
 class EndpointDetailsPage extends React.Component<Props, State> {
@@ -71,18 +71,18 @@ class EndpointDetailsPage extends React.Component<Props, State> {
   }
   }
 
 
   componentWillUnmount() {
   componentWillUnmount() {
-    EndpointStore.clearConnectionInfo()
+    endpointStore.clearConnectionInfo()
   }
   }
 
 
   getEndpoint(): ?EndpointType {
   getEndpoint(): ?EndpointType {
-    return EndpointStore.endpoints.find(e => e.id === this.props.match.params.id) || null
+    return endpointStore.endpoints.find(e => e.id === this.props.match.params.id) || null
   }
   }
 
 
-  getEndpointUsage(): {migrations: MainItem[], replicas: MainItem[]} {
+  getEndpointUsage(): { migrations: MainItem[], replicas: MainItem[] } {
     let endpointId = this.props.match.params.id
     let endpointId = this.props.match.params.id
-    let replicas = ReplicaStore.replicas.filter(
+    let replicas = replicaStore.replicas.filter(
       r => r.origin_endpoint_id === endpointId || r.destination_endpoint_id === endpointId)
       r => r.origin_endpoint_id === endpointId || r.destination_endpoint_id === endpointId)
-    let migrations = MigrationStore.migrations.filter(
+    let migrations = migrationStore.migrations.filter(
       r => r.origin_endpoint_id === endpointId || r.destination_endpoint_id === endpointId)
       r => r.origin_endpoint_id === endpointId || r.destination_endpoint_id === endpointId)
 
 
     return { migrations, replicas }
     return { migrations, replicas }
@@ -91,7 +91,7 @@ class EndpointDetailsPage extends React.Component<Props, State> {
   handleUserItemClick(item: { value: string }) {
   handleUserItemClick(item: { value: string }) {
     switch (item.value) {
     switch (item.value) {
       case 'signout':
       case 'signout':
-        UserStore.logout()
+        userStore.logout()
         return
         return
       case 'profile':
       case 'profile':
         window.location.href = '/#/profile'
         window.location.href = '/#/profile'
@@ -107,7 +107,7 @@ class EndpointDetailsPage extends React.Component<Props, State> {
   handleDeleteEndpointClick() {
   handleDeleteEndpointClick() {
     this.setState({ showEndpointInUseLoadingModal: true })
     this.setState({ showEndpointInUseLoadingModal: true })
 
 
-    Promise.all([ReplicaStore.getReplicas(), MigrationStore.getMigrations()]).then(() => {
+    Promise.all([replicaStore.getReplicas(), migrationStore.getMigrations()]).then(() => {
       const endpointUsage = this.getEndpointUsage()
       const endpointUsage = this.getEndpointUsage()
 
 
       if (endpointUsage.migrations.length === 0 && endpointUsage.replicas.length === 0) {
       if (endpointUsage.migrations.length === 0 && endpointUsage.replicas.length === 0) {
@@ -123,7 +123,7 @@ class EndpointDetailsPage extends React.Component<Props, State> {
     window.location.href = '/#/endpoints'
     window.location.href = '/#/endpoints'
     let endpoint = this.getEndpoint()
     let endpoint = this.getEndpoint()
     if (endpoint) {
     if (endpoint) {
-      EndpointStore.delete(endpoint)
+      endpointStore.delete(endpoint)
     }
     }
   }
   }
 
 
@@ -134,7 +134,7 @@ class EndpointDetailsPage extends React.Component<Props, State> {
   handleValidateClick() {
   handleValidateClick() {
     let endpoint = this.getEndpoint()
     let endpoint = this.getEndpoint()
     if (endpoint) {
     if (endpoint) {
-      EndpointStore.validate(endpoint)
+      endpointStore.validate(endpoint)
     }
     }
     this.setState({ showValidationModal: true })
     this.setState({ showValidationModal: true })
   }
   }
@@ -142,12 +142,12 @@ class EndpointDetailsPage extends React.Component<Props, State> {
   handleRetryValidation() {
   handleRetryValidation() {
     let endpoint = this.getEndpoint()
     let endpoint = this.getEndpoint()
     if (endpoint) {
     if (endpoint) {
-      EndpointStore.validate(endpoint)
+      endpointStore.validate(endpoint)
     }
     }
   }
   }
 
 
   handleCloseValidationModal() {
   handleCloseValidationModal() {
-    EndpointStore.clearValidation()
+    endpointStore.clearValidation()
     this.setState({ showValidationModal: false })
     this.setState({ showValidationModal: false })
   }
   }
 
 
@@ -156,7 +156,7 @@ class EndpointDetailsPage extends React.Component<Props, State> {
   }
   }
 
 
   handleEditValidateClick(endpoint: EndpointType) {
   handleEditValidateClick(endpoint: EndpointType) {
-    EndpointStore.validate(endpoint)
+    endpointStore.validate(endpoint)
   }
   }
 
 
   handleCloseEndpointModal() {
   handleCloseEndpointModal() {
@@ -168,17 +168,17 @@ class EndpointDetailsPage extends React.Component<Props, State> {
   }
   }
 
 
   loadData() {
   loadData() {
-    EndpointStore.getEndpoints().then(() => {
+    endpointStore.getEndpoints().then(() => {
       let endpoint = this.getEndpoint()
       let endpoint = this.getEndpoint()
 
 
       if (endpoint && endpoint.connection_info && endpoint.connection_info.secret_ref) {
       if (endpoint && endpoint.connection_info && endpoint.connection_info.secret_ref) {
-        EndpointStore.getConnectionInfo(endpoint)
+        endpointStore.getConnectionInfo(endpoint)
       } else if (endpoint && endpoint.connection_info) {
       } else if (endpoint && endpoint.connection_info) {
-        EndpointStore.setConnectionInfo(endpoint.connection_info)
+        endpointStore.setConnectionInfo(endpoint.connection_info)
       }
       }
     })
     })
 
 
-    Promise.all([ReplicaStore.getReplicas(), MigrationStore.getMigrations()]).then(() => {
+    Promise.all([replicaStore.getReplicas(), migrationStore.getMigrations()]).then(() => {
       this.setState({ endpointUsage: this.getEndpointUsage() })
       this.setState({ endpointUsage: this.getEndpointUsage() })
     })
     })
   }
   }
@@ -189,7 +189,7 @@ class EndpointDetailsPage extends React.Component<Props, State> {
       <Wrapper>
       <Wrapper>
         <DetailsTemplate
         <DetailsTemplate
           pageHeaderComponent={<DetailsPageHeader
           pageHeaderComponent={<DetailsPageHeader
-            user={UserStore.user}
+            user={userStore.user}
             onUserItemClick={item => { this.handleUserItemClick(item) }}
             onUserItemClick={item => { this.handleUserItemClick(item) }}
           />}
           />}
           contentHeaderComponent={<DetailsContentHeader
           contentHeaderComponent={<DetailsContentHeader
@@ -202,8 +202,8 @@ class EndpointDetailsPage extends React.Component<Props, State> {
           contentComponent={<EndpointDetailsContent
           contentComponent={<EndpointDetailsContent
             item={endpoint}
             item={endpoint}
             usage={this.state.endpointUsage}
             usage={this.state.endpointUsage}
-            loading={EndpointStore.connectionInfoLoading || EndpointStore.loading}
-            connectionInfo={EndpointStore.connectionInfo}
+            loading={endpointStore.connectionInfoLoading || endpointStore.loading}
+            connectionInfo={endpointStore.connectionInfo}
             onDeleteClick={() => { this.handleDeleteEndpointClick() }}
             onDeleteClick={() => { this.handleDeleteEndpointClick() }}
             onValidateClick={() => { this.handleValidateClick() }}
             onValidateClick={() => { this.handleValidateClick() }}
             onEditClick={() => { this.handleEditClick() }}
             onEditClick={() => { this.handleEditClick() }}
@@ -236,8 +236,8 @@ class EndpointDetailsPage extends React.Component<Props, State> {
           onRequestClose={() => { this.handleCloseValidationModal() }}
           onRequestClose={() => { this.handleCloseValidationModal() }}
         >
         >
           <EndpointValidation
           <EndpointValidation
-            validation={EndpointStore.validation}
-            loading={EndpointStore.validating}
+            validation={endpointStore.validation}
+            loading={endpointStore.validating}
             onCancelClick={() => { this.handleCloseValidationModal() }}
             onCancelClick={() => { this.handleCloseValidationModal() }}
             onRetryClick={() => { this.handleRetryValidation() }}
             onRetryClick={() => { this.handleRetryValidation() }}
           />
           />

+ 25 - 25
src/components/pages/EndpointsPage/index.jsx

@@ -31,11 +31,11 @@ import type { Endpoint as EndpointType } from '../../../types/Endpoint'
 
 
 import endpointImage from './images/endpoint-large.svg'
 import endpointImage from './images/endpoint-large.svg'
 
 
-import ProjectStore from '../../../stores/ProjectStore'
-import EndpointStore from '../../../stores/EndpointStore'
-import MigrationStore from '../../../stores/MigrationStore'
-import ReplicaStore from '../../../stores/ReplicaStore'
-import ProviderStore from '../../../stores/ProviderStore'
+import projectStore from '../../../stores/ProjectStore'
+import endpointStore from '../../../stores/EndpointStore'
+import migrationStore from '../../../stores/MigrationStore'
+import replicaStore from '../../../stores/ReplicaStore'
+import providerStore from '../../../stores/ProviderStore'
 import LabelDictionary from '../../../utils/LabelDictionary'
 import LabelDictionary from '../../../utils/LabelDictionary'
 import { requestPollTimeout } from '../../../config.js'
 import { requestPollTimeout } from '../../../config.js'
 
 
@@ -76,7 +76,7 @@ class EndpointsPage extends React.Component<{}, State> {
   componentDidMount() {
   componentDidMount() {
     document.title = 'Coriolis Endpoints'
     document.title = 'Coriolis Endpoints'
 
 
-    ProjectStore.getProjects()
+    projectStore.getProjects()
 
 
     this.stopPolling = false
     this.stopPolling = false
     this.pollData()
     this.pollData()
@@ -89,7 +89,7 @@ class EndpointsPage extends React.Component<{}, State> {
 
 
   getFilterItems() {
   getFilterItems() {
     let types = [{ label: 'All', value: 'all' }]
     let types = [{ label: 'All', value: 'all' }]
-    EndpointStore.endpoints.forEach(endpoint => {
+    endpointStore.endpoints.forEach(endpoint => {
       if (!types.find(t => t.value === endpoint.type)) {
       if (!types.find(t => t.value === endpoint.type)) {
         types.push({ label: LabelDictionary.get(endpoint.type), value: endpoint.type })
         types.push({ label: LabelDictionary.get(endpoint.type), value: endpoint.type })
       }
       }
@@ -99,25 +99,25 @@ class EndpointsPage extends React.Component<{}, State> {
   }
   }
 
 
   getEndpointUsage(endpoint: EndpointType) {
   getEndpointUsage(endpoint: EndpointType) {
-    let replicasCount = ReplicaStore.replicas.filter(
+    let replicasCount = replicaStore.replicas.filter(
       r => r.origin_endpoint_id === endpoint.id || r.destination_endpoint_id === endpoint.id).length
       r => r.origin_endpoint_id === endpoint.id || r.destination_endpoint_id === endpoint.id).length
-    let migrationsCount = MigrationStore.migrations.filter(
+    let migrationsCount = migrationStore.migrations.filter(
       r => r.origin_endpoint_id === endpoint.id || r.destination_endpoint_id === endpoint.id).length
       r => r.origin_endpoint_id === endpoint.id || r.destination_endpoint_id === endpoint.id).length
 
 
     return { migrationsCount, replicasCount }
     return { migrationsCount, replicasCount }
   }
   }
 
 
   handleProjectChange() {
   handleProjectChange() {
-    EndpointStore.getEndpoints({ showLoading: true })
-    MigrationStore.getMigrations()
-    ReplicaStore.getReplicas()
+    endpointStore.getEndpoints({ showLoading: true })
+    migrationStore.getMigrations()
+    replicaStore.getReplicas()
   }
   }
 
 
   handleReloadButtonClick() {
   handleReloadButtonClick() {
-    ProjectStore.getProjects()
-    EndpointStore.getEndpoints({ showLoading: true })
-    MigrationStore.getMigrations()
-    ReplicaStore.getReplicas()
+    projectStore.getProjects()
+    endpointStore.getEndpoints({ showLoading: true })
+    migrationStore.getMigrations()
+    replicaStore.getReplicas()
   }
   }
 
 
   handleItemClick(item: EndpointType) {
   handleItemClick(item: EndpointType) {
@@ -152,14 +152,14 @@ class EndpointsPage extends React.Component<{}, State> {
   handleDeleteEndpointsConfirmation() {
   handleDeleteEndpointsConfirmation() {
     if (this.state.confirmationItems) {
     if (this.state.confirmationItems) {
       this.state.confirmationItems.forEach(endpoint => {
       this.state.confirmationItems.forEach(endpoint => {
-        EndpointStore.delete(endpoint)
+        endpointStore.delete(endpoint)
       })
       })
     }
     }
     this.handleCloseDeleteEndpointsConfirmation()
     this.handleCloseDeleteEndpointsConfirmation()
   }
   }
 
 
   handleEmptyListButtonClick() {
   handleEmptyListButtonClick() {
-    ProviderStore.loadProviders()
+    providerStore.loadProviders()
     this.setState({ showChooseProviderModal: true })
     this.setState({ showChooseProviderModal: true })
   }
   }
 
 
@@ -194,7 +194,7 @@ class EndpointsPage extends React.Component<{}, State> {
       return
       return
     }
     }
 
 
-    Promise.all([EndpointStore.getEndpoints(), MigrationStore.getMigrations(), ReplicaStore.getReplicas()]).then(() => {
+    Promise.all([endpointStore.getEndpoints(), migrationStore.getMigrations(), replicaStore.getReplicas()]).then(() => {
       this.pollTimeout = setTimeout(() => { this.pollData() }, requestPollTimeout)
       this.pollTimeout = setTimeout(() => { this.pollData() }, requestPollTimeout)
     })
     })
   }
   }
@@ -203,8 +203,8 @@ class EndpointsPage extends React.Component<{}, State> {
     let endpoint: EndpointType = item
     let endpoint: EndpointType = item
     if ((filterItem !== 'all' && (endpoint.type !== filterItem)) ||
     if ((filterItem !== 'all' && (endpoint.type !== filterItem)) ||
       (endpoint.name.toLowerCase().indexOf(filterText || '') === -1 &&
       (endpoint.name.toLowerCase().indexOf(filterText || '') === -1 &&
-      // $FlowIssue
-      endpoint.description.toLowerCase().indexOf(filterText) === -1)
+        // $FlowIssue
+        endpoint.description.toLowerCase().indexOf(filterText) === -1)
     ) {
     ) {
       return false
       return false
     }
     }
@@ -213,7 +213,7 @@ class EndpointsPage extends React.Component<{}, State> {
   }
   }
 
 
   render() {
   render() {
-    let items: any = EndpointStore.endpoints
+    let items: any = endpointStore.endpoints
     return (
     return (
       <Wrapper>
       <Wrapper>
         <MainTemplate
         <MainTemplate
@@ -222,7 +222,7 @@ class EndpointsPage extends React.Component<{}, State> {
             <FilterList
             <FilterList
               filterItems={this.getFilterItems()}
               filterItems={this.getFilterItems()}
               selectionLabel="endpoint"
               selectionLabel="endpoint"
-              loading={EndpointStore.loading}
+              loading={endpointStore.loading}
               items={items}
               items={items}
               onItemClick={item => {
               onItemClick={item => {
                 let anyItem: any = item
                 let anyItem: any = item
@@ -275,8 +275,8 @@ class EndpointsPage extends React.Component<{}, State> {
         >
         >
           <ChooseProvider
           <ChooseProvider
             onCancelClick={() => { this.handleCloseChooseProviderModal() }}
             onCancelClick={() => { this.handleCloseChooseProviderModal() }}
-            providers={ProviderStore.providers}
-            loading={ProviderStore.providersLoading}
+            providers={providerStore.providers}
+            loading={providerStore.providersLoading}
             onProviderClick={providerName => { this.handleProviderClick(providerName) }}
             onProviderClick={providerName => { this.handleProviderClick(providerName) }}
           />
           />
         </Modal>
         </Modal>

+ 6 - 6
src/components/pages/LoginPage/index.jsx

@@ -23,7 +23,7 @@ import Logo from '../../atoms/Logo'
 import LoginForm from '../../organisms/LoginForm'
 import LoginForm from '../../organisms/LoginForm'
 
 
 import StyleProps from '../../styleUtils/StyleProps'
 import StyleProps from '../../styleUtils/StyleProps'
-import UserStore from '../../../stores/UserStore'
+import userStore from '../../../stores/UserStore'
 
 
 import backgroundImage from './images/star-bg.jpg'
 import backgroundImage from './images/star-bg.jpg'
 import cbsImage from './images/cbs-logo.svg'
 import cbsImage from './images/cbs-logo.svg'
@@ -50,7 +50,7 @@ const Content = styled.div`
     margin-top: 96px;
     margin-top: 96px;
   `}
   `}
 `
 `
-const StyledLoginForm = styled(LoginForm)`
+const StyledLoginForm = styled(LoginForm) `
   margin-top: 32px;
   margin-top: 32px;
   ${StyleProps.media.handheld`
   ${StyleProps.media.handheld`
     margin-top: 32px;
     margin-top: 32px;
@@ -82,14 +82,14 @@ class LoginPage extends React.Component<{}> {
   }
   }
 
 
   handleFormSubmit(data: { username: string, password: string }) {
   handleFormSubmit(data: { username: string, password: string }) {
-    UserStore.login({
+    userStore.login({
       name: data.username,
       name: data.username,
       password: data.password,
       password: data.password,
     })
     })
   }
   }
 
 
   render() {
   render() {
-    if (UserStore.user) {
+    if (userStore.user) {
       window.location.href = '/#/replicas'
       window.location.href = '/#/replicas'
     }
     }
 
 
@@ -100,8 +100,8 @@ class LoginPage extends React.Component<{}> {
             <Logo />
             <Logo />
             <StyledLoginForm
             <StyledLoginForm
               onFormSubmit={data => this.handleFormSubmit(data)}
               onFormSubmit={data => this.handleFormSubmit(data)}
-              loading={UserStore.loading}
-              loginFailedResponse={UserStore.loginFailedResponse}
+              loading={userStore.loading}
+              loginFailedResponse={userStore.loginFailedResponse}
             />
             />
             <Footer>
             <Footer>
               <FooterText>Coriolis® is a service offered by</FooterText>
               <FooterText>Coriolis® is a service offered by</FooterText>

+ 20 - 20
src/components/pages/MigrationDetailsPage/index.jsx

@@ -24,10 +24,10 @@ import DetailsContentHeader from '../../organisms/DetailsContentHeader'
 import MigrationDetailsContent from '../../organisms/MigrationDetailsContent'
 import MigrationDetailsContent from '../../organisms/MigrationDetailsContent'
 import AlertModal from '../../organisms/AlertModal'
 import AlertModal from '../../organisms/AlertModal'
 
 
-import MigrationStore from '../../../stores/MigrationStore'
-import UserStore from '../../../stores/UserStore'
-import EndpointStore from '../../../stores/EndpointStore'
-import NotificationStore from '../../../stores/NotificationStore'
+import migrationStore from '../../../stores/MigrationStore'
+import userStore from '../../../stores/UserStore'
+import endpointStore from '../../../stores/EndpointStore'
+import notificationStore from '../../../stores/NotificationStore'
 import { requestPollTimeout } from '../../../config'
 import { requestPollTimeout } from '../../../config'
 
 
 import migrationImage from './images/migration.svg'
 import migrationImage from './images/migration.svg'
@@ -57,20 +57,20 @@ class MigrationDetailsPage extends React.Component<Props, State> {
   componentDidMount() {
   componentDidMount() {
     document.title = 'Migration Details'
     document.title = 'Migration Details'
 
 
-    EndpointStore.getEndpoints()
+    endpointStore.getEndpoints()
     this.pollData(true)
     this.pollData(true)
     this.pollInterval = setInterval(() => { this.pollData() }, requestPollTimeout)
     this.pollInterval = setInterval(() => { this.pollData() }, requestPollTimeout)
   }
   }
 
 
   componentWillUnmount() {
   componentWillUnmount() {
-    MigrationStore.clearDetails()
+    migrationStore.clearDetails()
     clearInterval(this.pollInterval)
     clearInterval(this.pollInterval)
   }
   }
 
 
   handleUserItemClick(item: { value: string }) {
   handleUserItemClick(item: { value: string }) {
     switch (item.value) {
     switch (item.value) {
       case 'signout':
       case 'signout':
-        UserStore.logout()
+        userStore.logout()
         return
         return
       case 'profile':
       case 'profile':
         window.location.href = '/#/profile'
         window.location.href = '/#/profile'
@@ -90,8 +90,8 @@ class MigrationDetailsPage extends React.Component<Props, State> {
   handleDeleteMigrationConfirmation() {
   handleDeleteMigrationConfirmation() {
     this.setState({ showDeleteMigrationConfirmation: false })
     this.setState({ showDeleteMigrationConfirmation: false })
     window.location.href = '/#/migrations'
     window.location.href = '/#/migrations'
-    if (MigrationStore.migrationDetails) {
-      MigrationStore.delete(MigrationStore.migrationDetails.id)
+    if (migrationStore.migrationDetails) {
+      migrationStore.delete(migrationStore.migrationDetails.id)
     }
     }
   }
   }
 
 
@@ -109,20 +109,20 @@ class MigrationDetailsPage extends React.Component<Props, State> {
 
 
   handleCancelConfirmation() {
   handleCancelConfirmation() {
     this.setState({ showCancelConfirmation: false })
     this.setState({ showCancelConfirmation: false })
-    if (!MigrationStore.migrationDetails) {
+    if (!migrationStore.migrationDetails) {
       return
       return
     }
     }
-    MigrationStore.cancel(MigrationStore.migrationDetails.id).then(() => {
-      if (MigrationStore.canceling === false) {
-        NotificationStore.notify('Canceled', 'success')
+    migrationStore.cancel(migrationStore.migrationDetails.id).then(() => {
+      if (migrationStore.canceling === false) {
+        notificationStore.notify('Canceled', 'success')
       } else {
       } else {
-        NotificationStore.notify('The migration couldn\'t be canceled', 'error')
+        notificationStore.notify('The migration couldn\'t be canceled', 'error')
       }
       }
     })
     })
   }
   }
 
 
   pollData(showLoading?: boolean) {
   pollData(showLoading?: boolean) {
-    MigrationStore.getMigration(this.props.match.params.id, showLoading || false)
+    migrationStore.getMigration(this.props.match.params.id, showLoading || false)
   }
   }
 
 
   render() {
   render() {
@@ -130,21 +130,21 @@ class MigrationDetailsPage extends React.Component<Props, State> {
       <Wrapper>
       <Wrapper>
         <DetailsTemplate
         <DetailsTemplate
           pageHeaderComponent={<DetailsPageHeader
           pageHeaderComponent={<DetailsPageHeader
-            user={UserStore.user}
+            user={userStore.user}
             onUserItemClick={item => { this.handleUserItemClick(item) }}
             onUserItemClick={item => { this.handleUserItemClick(item) }}
           />}
           />}
           contentHeaderComponent={<DetailsContentHeader
           contentHeaderComponent={<DetailsContentHeader
-            item={MigrationStore.migrationDetails}
+            item={migrationStore.migrationDetails}
             onBackButonClick={() => { this.handleBackButtonClick() }}
             onBackButonClick={() => { this.handleBackButtonClick() }}
             typeImage={migrationImage}
             typeImage={migrationImage}
             primaryInfoPill
             primaryInfoPill
             onCancelClick={() => { this.handleCancelMigrationClick() }}
             onCancelClick={() => { this.handleCancelMigrationClick() }}
           />}
           />}
           contentComponent={<MigrationDetailsContent
           contentComponent={<MigrationDetailsContent
-            item={MigrationStore.migrationDetails}
-            endpoints={EndpointStore.endpoints}
+            item={migrationStore.migrationDetails}
+            endpoints={endpointStore.endpoints}
             page={this.props.match.params.page || ''}
             page={this.props.match.params.page || ''}
-            detailsLoading={EndpointStore.loading || MigrationStore.detailsLoading}
+            detailsLoading={endpointStore.loading || migrationStore.detailsLoading}
             onDeleteMigrationClick={() => { this.handleDeleteMigrationClick() }}
             onDeleteMigrationClick={() => { this.handleDeleteMigrationClick() }}
           />}
           />}
         />
         />

+ 19 - 19
src/components/pages/MigrationsPage/index.jsx

@@ -29,10 +29,10 @@ import type { MainItem } from '../../../types/MainItem'
 import migrationItemImage from './images/migration.svg'
 import migrationItemImage from './images/migration.svg'
 import migrationLargeImage from './images/migration-large.svg'
 import migrationLargeImage from './images/migration-large.svg'
 
 
-import ProjectStore from '../../../stores/ProjectStore'
-import MigrationStore from '../../../stores/MigrationStore'
-import EndpointStore from '../../../stores/EndpointStore'
-import NotificationStore from '../../../stores/NotificationStore'
+import projectStore from '../../../stores/ProjectStore'
+import migrationStore from '../../../stores/MigrationStore'
+import endpointStore from '../../../stores/EndpointStore'
+import notificationStore from '../../../stores/NotificationStore'
 import { requestPollTimeout } from '../../../config'
 import { requestPollTimeout } from '../../../config'
 
 
 const Wrapper = styled.div``
 const Wrapper = styled.div``
@@ -67,8 +67,8 @@ class MigrationsPage extends React.Component<{}, State> {
   componentDidMount() {
   componentDidMount() {
     document.title = 'Coriolis Migrations'
     document.title = 'Coriolis Migrations'
 
 
-    ProjectStore.getProjects()
-    EndpointStore.getEndpoints({ showLoading: true })
+    projectStore.getProjects()
+    endpointStore.getEndpoints({ showLoading: true })
 
 
     this.stopPolling = false
     this.stopPolling = false
     this.pollData()
     this.pollData()
@@ -80,7 +80,7 @@ class MigrationsPage extends React.Component<{}, State> {
   }
   }
 
 
   getEndpoint(endpointId: string) {
   getEndpoint(endpointId: string) {
-    return EndpointStore.endpoints.find(endpoint => endpoint.id === endpointId)
+    return endpointStore.endpoints.find(endpoint => endpoint.id === endpointId)
   }
   }
 
 
   getFilterItems() {
   getFilterItems() {
@@ -93,14 +93,14 @@ class MigrationsPage extends React.Component<{}, State> {
   }
   }
 
 
   handleProjectChange() {
   handleProjectChange() {
-    EndpointStore.getEndpoints({ showLoading: true })
-    MigrationStore.getMigrations({ showLoading: true })
+    endpointStore.getEndpoints({ showLoading: true })
+    migrationStore.getMigrations({ showLoading: true })
   }
   }
 
 
   handleReloadButtonClick() {
   handleReloadButtonClick() {
-    ProjectStore.getProjects()
-    EndpointStore.getEndpoints({ showLoading: true })
-    MigrationStore.getMigrations({ showLoading: true })
+    projectStore.getProjects()
+    endpointStore.getEndpoints({ showLoading: true })
+    migrationStore.getMigrations({ showLoading: true })
   }
   }
 
 
   handleItemClick(item: MainItem) {
   handleItemClick(item: MainItem) {
@@ -130,9 +130,9 @@ class MigrationsPage extends React.Component<{}, State> {
       return
       return
     }
     }
     this.state.confirmationItems.forEach(migration => {
     this.state.confirmationItems.forEach(migration => {
-      MigrationStore.cancel(migration.id)
+      migrationStore.cancel(migration.id)
     })
     })
-    NotificationStore.notify('Canceling migrations')
+    notificationStore.notify('Canceling migrations')
     this.handleCloseCancelMigration()
     this.handleCloseCancelMigration()
   }
   }
 
 
@@ -155,7 +155,7 @@ class MigrationsPage extends React.Component<{}, State> {
       return
       return
     }
     }
     this.state.confirmationItems.forEach(migration => {
     this.state.confirmationItems.forEach(migration => {
-      MigrationStore.delete(migration.id)
+      migrationStore.delete(migration.id)
     })
     })
     this.handleCloseDeleteMigrationConfirmation()
     this.handleCloseDeleteMigrationConfirmation()
   }
   }
@@ -206,7 +206,7 @@ class MigrationsPage extends React.Component<{}, State> {
       return
       return
     }
     }
 
 
-    Promise.all([MigrationStore.getMigrations(), EndpointStore.getEndpoints()]).then(() => {
+    Promise.all([migrationStore.getMigrations(), endpointStore.getEndpoints()]).then(() => {
       this.pollTimeout = setTimeout(() => { this.pollData() }, requestPollTimeout)
       this.pollTimeout = setTimeout(() => { this.pollData() }, requestPollTimeout)
     })
     })
   }
   }
@@ -234,8 +234,8 @@ class MigrationsPage extends React.Component<{}, State> {
             <FilterList
             <FilterList
               filterItems={this.getFilterItems()}
               filterItems={this.getFilterItems()}
               selectionLabel="migration"
               selectionLabel="migration"
-              loading={MigrationStore.loading}
-              items={MigrationStore.migrations}
+              loading={migrationStore.loading}
+              items={migrationStore.migrations}
               onItemClick={item => { this.handleItemClick(item) }}
               onItemClick={item => { this.handleItemClick(item) }}
               onReloadButtonClick={() => { this.handleReloadButtonClick() }}
               onReloadButtonClick={() => { this.handleReloadButtonClick() }}
               actions={BulkActions}
               actions={BulkActions}
@@ -250,7 +250,7 @@ class MigrationsPage extends React.Component<{}, State> {
                     if (endpoint) {
                     if (endpoint) {
                       return endpoint.type
                       return endpoint.type
                     }
                     }
-                    if (EndpointStore.loading) {
+                    if (endpointStore.loading) {
                       return 'Loading...'
                       return 'Loading...'
                     }
                     }
                     return 'Not Found'
                     return 'Not Found'

+ 37 - 37
src/components/pages/ReplicaDetailsPage/index.jsx

@@ -31,11 +31,11 @@ import type { Execution } from '../../../types/Execution'
 import type { Schedule } from '../../../types/Schedule'
 import type { Schedule } from '../../../types/Schedule'
 import type { Field } from '../../../types/Field'
 import type { Field } from '../../../types/Field'
 
 
-import ReplicaStore from '../../../stores/ReplicaStore'
-import MigrationStore from '../../../stores/MigrationStore'
-import UserStore from '../../../stores/UserStore'
-import EndpointStore from '../../../stores/EndpointStore'
-import ScheduleStore from '../../../stores/ScheduleStore'
+import replicaStore from '../../../stores/ReplicaStore'
+import migrationStore from '../../../stores/MigrationStore'
+import userStore from '../../../stores/UserStore'
+import endpointStore from '../../../stores/EndpointStore'
+import scheduleStore from '../../../stores/ScheduleStore'
 import { requestPollTimeout } from '../../../config'
 import { requestPollTimeout } from '../../../config'
 
 
 import replicaImage from './images/replica.svg'
 import replicaImage from './images/replica.svg'
@@ -75,23 +75,23 @@ class ReplicaDetailsPage extends React.Component<Props, State> {
   componentDidMount() {
   componentDidMount() {
     document.title = 'Replica Details'
     document.title = 'Replica Details'
 
 
-    ReplicaStore.getReplica(this.props.match.params.id)
-    EndpointStore.getEndpoints()
-    ScheduleStore.getSchedules(this.props.match.params.id)
+    replicaStore.getReplica(this.props.match.params.id)
+    endpointStore.getEndpoints()
+    scheduleStore.getSchedules(this.props.match.params.id)
     this.pollData(true)
     this.pollData(true)
   }
   }
 
 
   componentWillUnmount() {
   componentWillUnmount() {
-    ReplicaStore.clearDetails()
-    ScheduleStore.clearUnsavedSchedules()
+    replicaStore.clearDetails()
+    scheduleStore.clearUnsavedSchedules()
     clearTimeout(this.pollTimeout)
     clearTimeout(this.pollTimeout)
   }
   }
 
 
   isActionButtonDisabled() {
   isActionButtonDisabled() {
-    let originEndpoint = EndpointStore.endpoints.find(e => ReplicaStore.replicaDetails && e.id === ReplicaStore.replicaDetails.origin_endpoint_id)
-    let targetEndpoint = EndpointStore.endpoints.find(e => ReplicaStore.replicaDetails && e.id === ReplicaStore.replicaDetails.destination_endpoint_id)
-    let lastExecution = ReplicaStore.replicaDetails && ReplicaStore.replicaDetails.executions && ReplicaStore.replicaDetails.executions.length
-      && ReplicaStore.replicaDetails.executions[ReplicaStore.replicaDetails.executions.length - 1]
+    let originEndpoint = endpointStore.endpoints.find(e => replicaStore.replicaDetails && e.id === replicaStore.replicaDetails.origin_endpoint_id)
+    let targetEndpoint = endpointStore.endpoints.find(e => replicaStore.replicaDetails && e.id === replicaStore.replicaDetails.destination_endpoint_id)
+    let lastExecution = replicaStore.replicaDetails && replicaStore.replicaDetails.executions && replicaStore.replicaDetails.executions.length
+      && replicaStore.replicaDetails.executions[replicaStore.replicaDetails.executions.length - 1]
     let status = lastExecution && lastExecution.status
     let status = lastExecution && lastExecution.status
 
 
     return Boolean(!originEndpoint || !targetEndpoint || status === 'RUNNING')
     return Boolean(!originEndpoint || !targetEndpoint || status === 'RUNNING')
@@ -100,7 +100,7 @@ class ReplicaDetailsPage extends React.Component<Props, State> {
   handleUserItemClick(item: { value: string }) {
   handleUserItemClick(item: { value: string }) {
     switch (item.value) {
     switch (item.value) {
       case 'signout':
       case 'signout':
-        UserStore.logout()
+        userStore.logout()
         return
         return
       case 'profile':
       case 'profile':
         window.location.href = '/#/profile'
         window.location.href = '/#/profile'
@@ -125,7 +125,7 @@ class ReplicaDetailsPage extends React.Component<Props, State> {
     if (!this.state.confirmationItem) {
     if (!this.state.confirmationItem) {
       return
       return
     }
     }
-    ReplicaStore.deleteExecution(ReplicaStore.replicaDetails ? ReplicaStore.replicaDetails.id : '', this.state.confirmationItem.id)
+    replicaStore.deleteExecution(replicaStore.replicaDetails ? replicaStore.replicaDetails.id : '', this.state.confirmationItem.id)
     this.handleCloseExecutionConfirmation()
     this.handleCloseExecutionConfirmation()
   }
   }
 
 
@@ -154,7 +154,7 @@ class ReplicaDetailsPage extends React.Component<Props, State> {
   handleDeleteReplicaConfirmation() {
   handleDeleteReplicaConfirmation() {
     this.setState({ showDeleteReplicaConfirmation: false })
     this.setState({ showDeleteReplicaConfirmation: false })
     window.location.href = '/#/replicas'
     window.location.href = '/#/replicas'
-    ReplicaStore.delete(ReplicaStore.replicaDetails ? ReplicaStore.replicaDetails.id : '')
+    replicaStore.delete(replicaStore.replicaDetails ? replicaStore.replicaDetails.id : '')
   }
   }
 
 
   handleCloseDeleteReplicaConfirmation() {
   handleCloseDeleteReplicaConfirmation() {
@@ -163,8 +163,8 @@ class ReplicaDetailsPage extends React.Component<Props, State> {
 
 
   handleDeleteReplicaDisksConfirmation() {
   handleDeleteReplicaDisksConfirmation() {
     this.setState({ showDeleteReplicaDisksConfirmation: false })
     this.setState({ showDeleteReplicaDisksConfirmation: false })
-    ReplicaStore.deleteDisks(ReplicaStore.replicaDetails ? ReplicaStore.replicaDetails.id : '')
-    window.location.href = `/#/replica/executions/${ReplicaStore.replicaDetails ? ReplicaStore.replicaDetails.id : ''}`
+    replicaStore.deleteDisks(replicaStore.replicaDetails ? replicaStore.replicaDetails.id : '')
+    window.location.href = `/#/replica/executions/${replicaStore.replicaDetails ? replicaStore.replicaDetails.id : ''}`
   }
   }
 
 
   handleCloseDeleteReplicaDisksConfirmation() {
   handleCloseDeleteReplicaDisksConfirmation() {
@@ -180,27 +180,27 @@ class ReplicaDetailsPage extends React.Component<Props, State> {
   }
   }
 
 
   handleAddScheduleClick(schedule: Schedule) {
   handleAddScheduleClick(schedule: Schedule) {
-    ScheduleStore.addSchedule(this.props.match.params.id, schedule)
+    scheduleStore.addSchedule(this.props.match.params.id, schedule)
   }
   }
 
 
   handleScheduleChange(scheduleId: ?string, data: Schedule, forceSave?: boolean) {
   handleScheduleChange(scheduleId: ?string, data: Schedule, forceSave?: boolean) {
-    let oldData = ScheduleStore.schedules.find(s => s.id === scheduleId)
-    let unsavedData = ScheduleStore.unsavedSchedules.find(s => s.id === scheduleId)
+    let oldData = scheduleStore.schedules.find(s => s.id === scheduleId)
+    let unsavedData = scheduleStore.unsavedSchedules.find(s => s.id === scheduleId)
 
 
     if (scheduleId) {
     if (scheduleId) {
-      ScheduleStore.updateSchedule(this.props.match.params.id, scheduleId, data, oldData, unsavedData, forceSave)
+      scheduleStore.updateSchedule(this.props.match.params.id, scheduleId, data, oldData, unsavedData, forceSave)
     }
     }
   }
   }
 
 
   handleScheduleSave(schedule: Schedule) {
   handleScheduleSave(schedule: Schedule) {
     if (schedule.id) {
     if (schedule.id) {
-      ScheduleStore.updateSchedule(this.props.match.params.id, schedule.id, schedule, schedule, schedule, true)
+      scheduleStore.updateSchedule(this.props.match.params.id, schedule.id, schedule, schedule, schedule, true)
     }
     }
   }
   }
 
 
   handleScheduleRemove(scheduleId: ?string) {
   handleScheduleRemove(scheduleId: ?string) {
     if (scheduleId) {
     if (scheduleId) {
-      ScheduleStore.removeSchedule(this.props.match.params.id, scheduleId)
+      scheduleStore.removeSchedule(this.props.match.params.id, scheduleId)
     }
     }
   }
   }
 
 
@@ -216,23 +216,23 @@ class ReplicaDetailsPage extends React.Component<Props, State> {
     if (!this.state.confirmationItem) {
     if (!this.state.confirmationItem) {
       return
       return
     }
     }
-    ReplicaStore.cancelExecution(ReplicaStore.replicaDetails ? ReplicaStore.replicaDetails.id : '', this.state.confirmationItem.id)
+    replicaStore.cancelExecution(replicaStore.replicaDetails ? replicaStore.replicaDetails.id : '', this.state.confirmationItem.id)
     this.setState({ showCancelConfirmation: false })
     this.setState({ showCancelConfirmation: false })
   }
   }
 
 
   migrateReplica(options: Field[]) {
   migrateReplica(options: Field[]) {
-    MigrationStore.migrateReplica(ReplicaStore.replicaDetails ? ReplicaStore.replicaDetails.id : '', options)
+    migrationStore.migrateReplica(replicaStore.replicaDetails ? replicaStore.replicaDetails.id : '', options)
     this.handleCloseMigrationModal()
     this.handleCloseMigrationModal()
   }
   }
 
 
   executeReplica(fields: Field[]) {
   executeReplica(fields: Field[]) {
-    ReplicaStore.execute(ReplicaStore.replicaDetails ? ReplicaStore.replicaDetails.id : '', fields)
+    replicaStore.execute(replicaStore.replicaDetails ? replicaStore.replicaDetails.id : '', fields)
     this.handleCloseOptionsModal()
     this.handleCloseOptionsModal()
-    window.location.href = `/#/replica/executions/${ReplicaStore.replicaDetails ? ReplicaStore.replicaDetails.id : ''}`
+    window.location.href = `/#/replica/executions/${replicaStore.replicaDetails ? replicaStore.replicaDetails.id : ''}`
   }
   }
 
 
   pollData(showLoading: boolean) {
   pollData(showLoading: boolean) {
-    ReplicaStore.getReplicaExecutions(this.props.match.params.id, showLoading).then(() => {
+    replicaStore.getReplicaExecutions(this.props.match.params.id, showLoading).then(() => {
       this.pollTimeout = setTimeout(() => { this.pollData(false) }, requestPollTimeout)
       this.pollTimeout = setTimeout(() => { this.pollData(false) }, requestPollTimeout)
     })
     })
   }
   }
@@ -242,11 +242,11 @@ class ReplicaDetailsPage extends React.Component<Props, State> {
       <Wrapper>
       <Wrapper>
         <DetailsTemplate
         <DetailsTemplate
           pageHeaderComponent={<DetailsPageHeader
           pageHeaderComponent={<DetailsPageHeader
-            user={UserStore.user}
+            user={userStore.user}
             onUserItemClick={item => { this.handleUserItemClick(item) }}
             onUserItemClick={item => { this.handleUserItemClick(item) }}
           />}
           />}
           contentHeaderComponent={<DetailsContentHeader
           contentHeaderComponent={<DetailsContentHeader
-            item={ReplicaStore.replicaDetails}
+            item={replicaStore.replicaDetails}
             onBackButonClick={() => { this.handleBackButtonClick() }}
             onBackButonClick={() => { this.handleBackButtonClick() }}
             onActionButtonClick={() => { this.handleActionButtonClick() }}
             onActionButtonClick={() => { this.handleActionButtonClick() }}
             onCancelClick={item => {
             onCancelClick={item => {
@@ -260,11 +260,11 @@ class ReplicaDetailsPage extends React.Component<Props, State> {
             buttonLabel="Execute Now"
             buttonLabel="Execute Now"
           />}
           />}
           contentComponent={<ReplicaDetailsContent
           contentComponent={<ReplicaDetailsContent
-            item={ReplicaStore.replicaDetails}
-            endpoints={EndpointStore.endpoints}
-            scheduleStore={ScheduleStore}
-            detailsLoading={ReplicaStore.detailsLoading || EndpointStore.loading}
-            executionsLoading={ReplicaStore.executionsLoading}
+            item={replicaStore.replicaDetails}
+            endpoints={endpointStore.endpoints}
+            scheduleStore={scheduleStore}
+            detailsLoading={replicaStore.detailsLoading || endpointStore.loading}
+            executionsLoading={replicaStore.executionsLoading}
             page={this.props.match.params.page || ''}
             page={this.props.match.params.page || ''}
             onCancelExecutionClick={execution => { this.handleCancelExecutionClick(execution) }}
             onCancelExecutionClick={execution => { this.handleCancelExecutionClick(execution) }}
             onDeleteExecutionClick={execution => { this.handleDeleteExecutionClick(execution) }}
             onDeleteExecutionClick={execution => { this.handleDeleteExecutionClick(execution) }}

+ 19 - 19
src/components/pages/ReplicasPage/index.jsx

@@ -29,10 +29,10 @@ import type { MainItem } from '../../../types/MainItem'
 import replicaItemImage from './images/replica.svg'
 import replicaItemImage from './images/replica.svg'
 import replicaLargeImage from './images/replica-large.svg'
 import replicaLargeImage from './images/replica-large.svg'
 
 
-import ProjectStore from '../../../stores/ProjectStore'
-import ReplicaStore from '../../../stores/ReplicaStore'
-import EndpointStore from '../../../stores/EndpointStore'
-import NotificationStore from '../../../stores/NotificationStore'
+import projectStore from '../../../stores/ProjectStore'
+import replicaStore from '../../../stores/ReplicaStore'
+import endpointStore from '../../../stores/EndpointStore'
+import notificationStore from '../../../stores/NotificationStore'
 import { requestPollTimeout } from '../../../config'
 import { requestPollTimeout } from '../../../config'
 
 
 const Wrapper = styled.div``
 const Wrapper = styled.div``
@@ -65,8 +65,8 @@ class ReplicasPage extends React.Component<{}, State> {
   componentDidMount() {
   componentDidMount() {
     document.title = 'Coriolis Replicas'
     document.title = 'Coriolis Replicas'
 
 
-    ProjectStore.getProjects()
-    EndpointStore.getEndpoints({ showLoading: true })
+    projectStore.getProjects()
+    endpointStore.getEndpoints({ showLoading: true })
 
 
     this.stopPolling = false
     this.stopPolling = false
     this.pollData()
     this.pollData()
@@ -78,7 +78,7 @@ class ReplicasPage extends React.Component<{}, State> {
   }
   }
 
 
   getEndpoint(endpointId: string) {
   getEndpoint(endpointId: string) {
-    return EndpointStore.endpoints.find(endpoint => endpoint.id === endpointId)
+    return endpointStore.endpoints.find(endpoint => endpoint.id === endpointId)
   }
   }
 
 
   getFilterItems() {
   getFilterItems() {
@@ -98,14 +98,14 @@ class ReplicasPage extends React.Component<{}, State> {
   }
   }
 
 
   handleProjectChange() {
   handleProjectChange() {
-    ReplicaStore.getReplicas()
-    EndpointStore.getEndpoints({ showLoading: true })
+    replicaStore.getReplicas()
+    endpointStore.getEndpoints({ showLoading: true })
   }
   }
 
 
   handleReloadButtonClick() {
   handleReloadButtonClick() {
-    ProjectStore.getProjects()
-    ReplicaStore.getReplicas({ showLoading: true })
-    EndpointStore.getEndpoints({ showLoading: true })
+    projectStore.getProjects()
+    replicaStore.getReplicas({ showLoading: true })
+    endpointStore.getEndpoints({ showLoading: true })
   }
   }
 
 
   handleItemClick(item: MainItem) {
   handleItemClick(item: MainItem) {
@@ -120,9 +120,9 @@ class ReplicasPage extends React.Component<{}, State> {
   handleActionChange(items: MainItem[], action: string) {
   handleActionChange(items: MainItem[], action: string) {
     if (action === 'execute') {
     if (action === 'execute') {
       items.forEach(replica => {
       items.forEach(replica => {
-        ReplicaStore.execute(replica.id)
+        replicaStore.execute(replica.id)
       })
       })
-      NotificationStore.notify('Executing replicas')
+      notificationStore.notify('Executing replicas')
     } else if (action === 'delete') {
     } else if (action === 'delete') {
       this.setState({
       this.setState({
         showDeleteReplicaConfirmation: true,
         showDeleteReplicaConfirmation: true,
@@ -143,7 +143,7 @@ class ReplicasPage extends React.Component<{}, State> {
       return
       return
     }
     }
     this.state.confirmationItems.forEach(replica => {
     this.state.confirmationItems.forEach(replica => {
-      ReplicaStore.delete(replica.id)
+      replicaStore.delete(replica.id)
     })
     })
     this.handleCloseDeleteReplicaConfirmation()
     this.handleCloseDeleteReplicaConfirmation()
   }
   }
@@ -167,7 +167,7 @@ class ReplicasPage extends React.Component<{}, State> {
       return
       return
     }
     }
 
 
-    Promise.all([ReplicaStore.getReplicas(), EndpointStore.getEndpoints()]).then(() => {
+    Promise.all([replicaStore.getReplicas(), endpointStore.getEndpoints()]).then(() => {
       this.pollTimeout = setTimeout(() => { this.pollData() }, requestPollTimeout)
       this.pollTimeout = setTimeout(() => { this.pollData() }, requestPollTimeout)
     })
     })
   }
   }
@@ -209,8 +209,8 @@ class ReplicasPage extends React.Component<{}, State> {
             <FilterList
             <FilterList
               filterItems={this.getFilterItems()}
               filterItems={this.getFilterItems()}
               selectionLabel="replica"
               selectionLabel="replica"
-              loading={ReplicaStore.loading}
-              items={ReplicaStore.replicas}
+              loading={replicaStore.loading}
+              items={replicaStore.replicas}
               onItemClick={item => { this.handleItemClick(item) }}
               onItemClick={item => { this.handleItemClick(item) }}
               onReloadButtonClick={() => { this.handleReloadButtonClick() }}
               onReloadButtonClick={() => { this.handleReloadButtonClick() }}
               actions={BulkActions}
               actions={BulkActions}
@@ -225,7 +225,7 @@ class ReplicasPage extends React.Component<{}, State> {
                     if (endpoint) {
                     if (endpoint) {
                       return endpoint.type
                       return endpoint.type
                     }
                     }
-                    if (EndpointStore.loading) {
+                    if (endpointStore.loading) {
                       return 'Loading...'
                       return 'Loading...'
                     }
                     }
                     return 'Not Found'
                     return 'Not Found'

+ 82 - 82
src/components/pages/WizardPage/index.jsx

@@ -24,15 +24,15 @@ import WizardPageContent from '../../organisms/WizardPageContent'
 import Modal from '../../molecules/Modal'
 import Modal from '../../molecules/Modal'
 import Endpoint from '../../organisms/Endpoint'
 import Endpoint from '../../organisms/Endpoint'
 
 
-import UserStore from '../../../stores/UserStore'
-import ProviderStore from '../../../stores/ProviderStore'
-import EndpointStore from '../../../stores/EndpointStore'
-import WizardStore from '../../../stores/WizardStore'
-import InstanceStore from '../../../stores/InstanceStore'
-import NetworkStore from '../../../stores/NetworkStore'
-import NotificationStore from '../../../stores/NotificationStore'
-import ScheduleStore from '../../../stores/ScheduleStore'
-import ReplicaStore from '../../../stores/ReplicaStore'
+import userStore from '../../../stores/UserStore'
+import providerStore from '../../../stores/ProviderStore'
+import endpointStore from '../../../stores/EndpointStore'
+import wizardStore from '../../../stores/WizardStore'
+import instanceStore from '../../../stores/InstanceStore'
+import networkStore from '../../../stores/NetworkStore'
+import notificationStore from '../../../stores/NotificationStore'
+import scheduleStore from '../../../stores/ScheduleStore'
+import replicaStore from '../../../stores/ReplicaStore'
 import KeyboardManager from '../../../utils/KeyboardManager'
 import KeyboardManager from '../../../utils/KeyboardManager'
 import { wizardConfig, executionOptions } from '../../../config'
 import { wizardConfig, executionOptions } from '../../../config'
 import type { MainItem } from '../../../types/MainItem'
 import type { MainItem } from '../../../types/MainItem'
@@ -71,7 +71,7 @@ class WizardPage extends React.Component<Props, State> {
   }
   }
 
 
   componentWillMount() {
   componentWillMount() {
-    WizardStore.getDataFromPermalink()
+    wizardStore.getDataFromPermalink()
     let type = this.props.match && this.props.match.params.type
     let type = this.props.match && this.props.match.params.type
     if (type === 'migration' || type === 'replica') {
     if (type === 'migration' || type === 'replica') {
       this.setState({ type })
       this.setState({ type })
@@ -85,7 +85,7 @@ class WizardPage extends React.Component<Props, State> {
   }
   }
 
 
   componentWillUnmount() {
   componentWillUnmount() {
-    WizardStore.clearData()
+    wizardStore.clearData()
     KeyboardManager.removeKeyDown('wizard')
     KeyboardManager.removeKeyDown('wizard')
   }
   }
 
 
@@ -101,7 +101,7 @@ class WizardPage extends React.Component<Props, State> {
 
 
   handleCreationSuccess(items: MainItem[]) {
   handleCreationSuccess(items: MainItem[]) {
     let typeLabel = this.state.type.charAt(0).toUpperCase() + this.state.type.substr(1)
     let typeLabel = this.state.type.charAt(0).toUpperCase() + this.state.type.substr(1)
-    NotificationStore.notify(`${typeLabel} was succesfully created`, 'success', { persist: true, persistInfo: { title: `${typeLabel} created` } })
+    notificationStore.notify(`${typeLabel} was succesfully created`, 'success', { persist: true, persistInfo: { title: `${typeLabel} created` } })
     let schedulePromise = Promise.resolve()
     let schedulePromise = Promise.resolve()
 
 
     if (this.state.type === 'replica') {
     if (this.state.type === 'replica') {
@@ -129,7 +129,7 @@ class WizardPage extends React.Component<Props, State> {
   handleUserItemClick(item: { value: string }) {
   handleUserItemClick(item: { value: string }) {
     switch (item.value) {
     switch (item.value) {
       case 'signout':
       case 'signout':
-        UserStore.logout()
+        userStore.logout()
         return
         return
       case 'profile':
       case 'profile':
         window.location.href = '/#/profile'
         window.location.href = '/#/profile'
@@ -144,7 +144,7 @@ class WizardPage extends React.Component<Props, State> {
 
 
   handleBackClick() {
   handleBackClick() {
     let pages = wizardConfig.pages.filter(p => !p.excludeFrom || p.excludeFrom !== this.state.type)
     let pages = wizardConfig.pages.filter(p => !p.excludeFrom || p.excludeFrom !== this.state.type)
-    let currentPageIndex = pages.findIndex(p => p.id === WizardStore.currentPage.id)
+    let currentPageIndex = pages.findIndex(p => p.id === wizardStore.currentPage.id)
 
 
     if (currentPageIndex === 0) {
     if (currentPageIndex === 0) {
       window.history.back()
       window.history.back()
@@ -153,12 +153,12 @@ class WizardPage extends React.Component<Props, State> {
 
 
     let page = pages[currentPageIndex - 1]
     let page = pages[currentPageIndex - 1]
     this.loadDataForPage(page)
     this.loadDataForPage(page)
-    WizardStore.setCurrentPage(page)
+    wizardStore.setCurrentPage(page)
   }
   }
 
 
   handleNextClick() {
   handleNextClick() {
     let pages = wizardConfig.pages.filter(p => !p.excludeFrom || p.excludeFrom !== this.state.type)
     let pages = wizardConfig.pages.filter(p => !p.excludeFrom || p.excludeFrom !== this.state.type)
-    let currentPageIndex = pages.findIndex(p => p.id === WizardStore.currentPage.id)
+    let currentPageIndex = pages.findIndex(p => p.id === wizardStore.currentPage.id)
 
 
     if (currentPageIndex === pages.length - 1) {
     if (currentPageIndex === pages.length - 1) {
       this.create()
       this.create()
@@ -167,23 +167,23 @@ class WizardPage extends React.Component<Props, State> {
 
 
     let page = pages[currentPageIndex + 1]
     let page = pages[currentPageIndex + 1]
     this.loadDataForPage(page)
     this.loadDataForPage(page)
-    WizardStore.setCurrentPage(page)
+    wizardStore.setCurrentPage(page)
   }
   }
 
 
   handleSourceEndpointChange(source: EndpointType) {
   handleSourceEndpointChange(source: EndpointType) {
-    WizardStore.updateData({ source, selectedInstances: null, networks: null })
-    WizardStore.setPermalink(WizardStore.data)
+    wizardStore.updateData({ source, selectedInstances: null, networks: null })
+    wizardStore.setPermalink(wizardStore.data)
     // Preload instances for 'vms' page
     // Preload instances for 'vms' page
-    InstanceStore.loadInstances(source.id)
+    instanceStore.loadInstances(source.id)
   }
   }
 
 
   handleTargetEndpointChange(target: EndpointType) {
   handleTargetEndpointChange(target: EndpointType) {
-    WizardStore.updateData({ target, networks: null, options: null })
-    WizardStore.setPermalink(WizardStore.data)
+    wizardStore.updateData({ target, networks: null, options: null })
+    wizardStore.setPermalink(wizardStore.data)
     // Preload destination options schema
     // Preload destination options schema
-    ProviderStore.loadOptionsSchema(target.type, this.state.type).then(() => {
+    providerStore.loadOptionsSchema(target.type, this.state.type).then(() => {
       // Preload destination options values
       // Preload destination options values
-      return ProviderStore.getDestinationOptions(target.id, target.type)
+      return providerStore.getDestinationOptions(target.id, target.type)
     })
     })
   }
   }
 
 
@@ -198,99 +198,99 @@ class WizardPage extends React.Component<Props, State> {
   handleCloseNewEndpointModal(options?: { autoClose?: boolean }) {
   handleCloseNewEndpointModal(options?: { autoClose?: boolean }) {
     if (options) {
     if (options) {
       if (this.state.newEndpointFromSource) {
       if (this.state.newEndpointFromSource) {
-        WizardStore.updateData({ source: EndpointStore.endpoints[0] })
+        wizardStore.updateData({ source: endpointStore.endpoints[0] })
       } else {
       } else {
-        WizardStore.updateData({ target: EndpointStore.endpoints[0] })
+        wizardStore.updateData({ target: endpointStore.endpoints[0] })
       }
       }
     }
     }
-    WizardStore.setPermalink(WizardStore.data)
+    wizardStore.setPermalink(wizardStore.data)
     this.setState({ showNewEndpointModal: false })
     this.setState({ showNewEndpointModal: false })
   }
   }
 
 
   handleInstancesSearchInputChange(searchText: string) {
   handleInstancesSearchInputChange(searchText: string) {
-    if (WizardStore.data.source) {
-      InstanceStore.searchInstances(WizardStore.data.source.id, searchText)
+    if (wizardStore.data.source) {
+      instanceStore.searchInstances(wizardStore.data.source.id, searchText)
     }
     }
   }
   }
 
 
   handleInstancesNextPageClick(searchText: string) {
   handleInstancesNextPageClick(searchText: string) {
-    if (WizardStore.data.source) {
-      InstanceStore.loadNextPage(WizardStore.data.source.id, searchText)
+    if (wizardStore.data.source) {
+      instanceStore.loadNextPage(wizardStore.data.source.id, searchText)
     }
     }
   }
   }
 
 
   handleInstancesPreviousPageClick() {
   handleInstancesPreviousPageClick() {
-    InstanceStore.loadPreviousPage()
+    instanceStore.loadPreviousPage()
   }
   }
 
 
   handleInstancesReloadClick(searchText: string) {
   handleInstancesReloadClick(searchText: string) {
-    if (WizardStore.data.source) {
-      InstanceStore.reloadInstances(WizardStore.data.source.id, searchText)
+    if (wizardStore.data.source) {
+      instanceStore.reloadInstances(wizardStore.data.source.id, searchText)
     }
     }
   }
   }
 
 
   handleInstanceClick(instance: Instance) {
   handleInstanceClick(instance: Instance) {
-    WizardStore.updateData({ networks: null })
-    WizardStore.toggleInstanceSelection(instance)
-    WizardStore.setPermalink(WizardStore.data)
+    wizardStore.updateData({ networks: null })
+    wizardStore.toggleInstanceSelection(instance)
+    wizardStore.setPermalink(wizardStore.data)
   }
   }
 
 
   handleOptionsChange(field: Field, value: any) {
   handleOptionsChange(field: Field, value: any) {
-    WizardStore.updateData({ networks: null })
-    WizardStore.updateOptions({ field, value })
-    WizardStore.setPermalink(WizardStore.data)
+    wizardStore.updateData({ networks: null })
+    wizardStore.updateOptions({ field, value })
+    wizardStore.setPermalink(wizardStore.data)
   }
   }
 
 
   handleNetworkChange(sourceNic: Nic, targetNetwork: Network) {
   handleNetworkChange(sourceNic: Nic, targetNetwork: Network) {
-    WizardStore.updateNetworks({ sourceNic, targetNetwork })
-    WizardStore.setPermalink(WizardStore.data)
+    wizardStore.updateNetworks({ sourceNic, targetNetwork })
+    wizardStore.setPermalink(wizardStore.data)
   }
   }
 
 
   handleAddScheduleClick(schedule: Schedule) {
   handleAddScheduleClick(schedule: Schedule) {
-    WizardStore.addSchedule(schedule)
-    WizardStore.setPermalink(WizardStore.data)
+    wizardStore.addSchedule(schedule)
+    wizardStore.setPermalink(wizardStore.data)
   }
   }
 
 
   handleScheduleChange(scheduleId: string, data: Schedule) {
   handleScheduleChange(scheduleId: string, data: Schedule) {
-    WizardStore.updateSchedule(scheduleId, data)
-    WizardStore.setPermalink(WizardStore.data)
+    wizardStore.updateSchedule(scheduleId, data)
+    wizardStore.setPermalink(wizardStore.data)
   }
   }
 
 
   handleScheduleRemove(scheduleId: string) {
   handleScheduleRemove(scheduleId: string) {
-    WizardStore.removeSchedule(scheduleId)
-    WizardStore.setPermalink(WizardStore.data)
+    wizardStore.removeSchedule(scheduleId)
+    wizardStore.setPermalink(wizardStore.data)
   }
   }
 
 
   loadDataForPage(page: WizardPageType) {
   loadDataForPage(page: WizardPageType) {
     switch (page.id) {
     switch (page.id) {
       case 'source': {
       case 'source': {
-        ProviderStore.loadProviders()
-        EndpointStore.getEndpoints()
+        providerStore.loadProviders()
+        endpointStore.getEndpoints()
         // Preload instances if data is set from 'Permalink'
         // Preload instances if data is set from 'Permalink'
-        let source = WizardStore.data.source
-        if (InstanceStore.instances.length === 0 && source) {
-          InstanceStore.loadInstances(source.id)
+        let source = wizardStore.data.source
+        if (instanceStore.instances.length === 0 && source) {
+          instanceStore.loadInstances(source.id)
         }
         }
         break
         break
       }
       }
       case 'target': {
       case 'target': {
         // Preload destination options if data is set from 'Permalink'
         // Preload destination options if data is set from 'Permalink'
-        let target = WizardStore.data.target
-        if (ProviderStore.destinationOptions.length === 0 && target) {
-          ProviderStore.getDestinationOptions(target.id, target.type)
+        let target = wizardStore.data.target
+        if (providerStore.destinationOptions.length === 0 && target) {
+          providerStore.getDestinationOptions(target.id, target.type)
         }
         }
         // Preload destination options schema
         // Preload destination options schema
-        if (ProviderStore.optionsSchema.length === 0 && target) {
-          ProviderStore.loadOptionsSchema(target.type, this.state.type)
+        if (providerStore.optionsSchema.length === 0 && target) {
+          providerStore.loadOptionsSchema(target.type, this.state.type)
         }
         }
         break
         break
       }
       }
       case 'networks':
       case 'networks':
-        if (WizardStore.data.source && WizardStore.data.selectedInstances) {
-          InstanceStore.loadInstancesDetails(WizardStore.data.source.id, WizardStore.data.selectedInstances)
+        if (wizardStore.data.source && wizardStore.data.selectedInstances) {
+          instanceStore.loadInstancesDetails(wizardStore.data.source.id, wizardStore.data.selectedInstances)
         }
         }
-        if (WizardStore.data.target) {
-          NetworkStore.loadNetworks(WizardStore.data.target.id, WizardStore.data.options)
+        if (wizardStore.data.target) {
+          networkStore.loadNetworks(wizardStore.data.target.id, wizardStore.data.options)
         }
         }
         break
         break
       default:
       default:
@@ -299,11 +299,11 @@ class WizardPage extends React.Component<Props, State> {
 
 
   createMultiple() {
   createMultiple() {
     let typeLabel = this.state.type.charAt(0).toUpperCase() + this.state.type.substr(1)
     let typeLabel = this.state.type.charAt(0).toUpperCase() + this.state.type.substr(1)
-    NotificationStore.notify(`Creating ${typeLabel}s ...`)
-    WizardStore.createMultiple(this.state.type, WizardStore.data).then(() => {
-      let items = WizardStore.createdItems
+    notificationStore.notify(`Creating ${typeLabel}s ...`)
+    wizardStore.createMultiple(this.state.type, wizardStore.data).then(() => {
+      let items = wizardStore.createdItems
       if (!items) {
       if (!items) {
-        NotificationStore.notify(`${typeLabel}s couldn't be created`, 'error')
+        notificationStore.notify(`${typeLabel}s couldn't be created`, 'error')
         this.setState({ nextButtonDisabled: false })
         this.setState({ nextButtonDisabled: false })
         return
         return
       }
       }
@@ -313,11 +313,11 @@ class WizardPage extends React.Component<Props, State> {
 
 
   createSingle() {
   createSingle() {
     let typeLabel = this.state.type.charAt(0).toUpperCase() + this.state.type.substr(1)
     let typeLabel = this.state.type.charAt(0).toUpperCase() + this.state.type.substr(1)
-    NotificationStore.notify(`Creating ${typeLabel} ...`)
-    WizardStore.create(this.state.type, WizardStore.data).then(() => {
-      let item = WizardStore.createdItem
+    notificationStore.notify(`Creating ${typeLabel} ...`)
+    wizardStore.create(this.state.type, wizardStore.data).then(() => {
+      let item = wizardStore.createdItem
       if (!item) {
       if (!item) {
-        NotificationStore.notify(`${typeLabel} couldn't be created`, 'error')
+        notificationStore.notify(`${typeLabel} couldn't be created`, 'error')
         this.setState({ nextButtonDisabled: false })
         this.setState({ nextButtonDisabled: false })
         return
         return
       }
       }
@@ -326,7 +326,7 @@ class WizardPage extends React.Component<Props, State> {
   }
   }
 
 
   separateVms() {
   separateVms() {
-    let data = WizardStore.data
+    let data = wizardStore.data
     let separateVms = true
     let separateVms = true
 
 
     if (data.options && data.options.separate_vm !== null && data.options.separate_vm !== undefined) {
     if (data.options && data.options.separate_vm !== null && data.options.separate_vm !== undefined) {
@@ -350,17 +350,17 @@ class WizardPage extends React.Component<Props, State> {
   }
   }
 
 
   scheduleReplica(replica: MainItem): Promise<void> {
   scheduleReplica(replica: MainItem): Promise<void> {
-    let data = WizardStore.data
+    let data = wizardStore.data
 
 
     if (!data.schedules || data.schedules.length === 0) {
     if (!data.schedules || data.schedules.length === 0) {
       return Promise.resolve()
       return Promise.resolve()
     }
     }
 
 
-    return ScheduleStore.scheduleMultiple(replica.id, data.schedules)
+    return scheduleStore.scheduleMultiple(replica.id, data.schedules)
   }
   }
 
 
   executeCreatedReplica(replica: MainItem) {
   executeCreatedReplica(replica: MainItem) {
-    let options = WizardStore.data.options
+    let options = wizardStore.data.options
     let executeNow = true
     let executeNow = true
     if (options && options.execute_now !== null && options.execute_now !== undefined) {
     if (options && options.execute_now !== null && options.execute_now !== undefined) {
       executeNow = options.execute_now
       executeNow = options.execute_now
@@ -376,7 +376,7 @@ class WizardPage extends React.Component<Props, State> {
       return field
       return field
     })
     })
 
 
-    ReplicaStore.execute(replica.id, executeNowOptions)
+    replicaStore.execute(replica.id, executeNowOptions)
   }
   }
 
 
   render() {
   render() {
@@ -384,16 +384,16 @@ class WizardPage extends React.Component<Props, State> {
       <Wrapper>
       <Wrapper>
         <WizardTemplate
         <WizardTemplate
           pageHeaderComponent={<DetailsPageHeader
           pageHeaderComponent={<DetailsPageHeader
-            user={UserStore.user}
+            user={userStore.user}
             onUserItemClick={item => { this.handleUserItemClick(item) }}
             onUserItemClick={item => { this.handleUserItemClick(item) }}
           />}
           />}
           pageContentComponent={<WizardPageContent
           pageContentComponent={<WizardPageContent
-            page={WizardStore.currentPage}
-            providerStore={ProviderStore}
-            instanceStore={InstanceStore}
-            networkStore={NetworkStore}
-            endpoints={EndpointStore.endpoints}
-            wizardData={WizardStore.data}
+            page={wizardStore.currentPage}
+            providerStore={providerStore}
+            instanceStore={instanceStore}
+            networkStore={networkStore}
+            endpoints={endpointStore.endpoints}
+            wizardData={wizardStore.data}
             nextButtonDisabled={this.state.nextButtonDisabled}
             nextButtonDisabled={this.state.nextButtonDisabled}
             type={this.state.type}
             type={this.state.type}
             onTypeChange={isReplica => { this.handleTypeChange(isReplica) }}
             onTypeChange={isReplica => { this.handleTypeChange(isReplica) }}

+ 2 - 2
src/sources/AssessmentSource.js

@@ -20,7 +20,7 @@ import type { MigrationInfo } from '../types/Assessment'
 import type { MainItem } from '../types/MainItem'
 import type { MainItem } from '../types/MainItem'
 import Api from '../utils/ApiCaller'
 import Api from '../utils/ApiCaller'
 import { servicesUrl } from '../config'
 import { servicesUrl } from '../config'
-import NotificationStore from '../stores/NotificationStore'
+import notificationStore from '../stores/NotificationStore'
 
 
 class AssessmentSourceUtils {
 class AssessmentSourceUtils {
   static getDestinationEnv(data: MigrationInfo) {
   static getDestinationEnv(data: MigrationInfo) {
@@ -91,7 +91,7 @@ class AssessmentSource {
           }
           }
         }, () => {
         }, () => {
           count += 1
           count += 1
-          NotificationStore.notify(`Error while migrating instance ${instance.name}`, 'error', {
+          notificationStore.notify(`Error while migrating instance ${instance.name}`, 'error', {
             persist: true,
             persist: true,
             persistInfo: { title: 'Migration creation error' },
             persistInfo: { title: 'Migration creation error' },
           })
           })

+ 2 - 2
src/sources/WizardSource.js

@@ -17,7 +17,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 import cookie from 'js-cookie'
 import cookie from 'js-cookie'
 
 
 import Api from '../utils/ApiCaller'
 import Api from '../utils/ApiCaller'
-import NotificationStore from '../stores/NotificationStore'
+import notificationStore from '../stores/NotificationStore'
 import { servicesUrl, executionOptions } from '../config'
 import { servicesUrl, executionOptions } from '../config'
 import type { WizardData } from '../types/WizardData'
 import type { WizardData } from '../types/WizardData'
 import type { MainItem } from '../types/MainItem'
 import type { MainItem } from '../types/MainItem'
@@ -112,7 +112,7 @@ class WizardSource {
           }
           }
         }, () => {
         }, () => {
           count += 1
           count += 1
-          NotificationStore.notify(`Error while creating ${type} for instance ${instance.name}`, 'error', {
+          notificationStore.notify(`Error while creating ${type} for instance ${instance.name}`, 'error', {
             persist: true,
             persist: true,
             persistInfo: { title: `${type} creation error` },
             persistInfo: { title: `${type} creation error` },
           })
           })

+ 2 - 2
src/stores/MigrationStore.js

@@ -18,7 +18,7 @@ import { observable, action } from 'mobx'
 
 
 import type { MainItem } from '../types/MainItem'
 import type { MainItem } from '../types/MainItem'
 import type { Field } from '../types/Field'
 import type { Field } from '../types/Field'
-import NotificationStore from '../stores/NotificationStore'
+import notificationStore from '../stores/NotificationStore'
 import MigrationSource from '../sources/MigrationSource'
 import MigrationSource from '../sources/MigrationSource'
 
 
 class MigrationStore {
 class MigrationStore {
@@ -84,7 +84,7 @@ class MigrationStore {
         ...this.migrations,
         ...this.migrations,
       ]
       ]
 
 
-      NotificationStore.notify('Migration successfully created from replica.', 'success', {
+      notificationStore.notify('Migration successfully created from replica.', 'success', {
         action: {
         action: {
           label: 'View Migration Status',
           label: 'View Migration Status',
           callback: () => {
           callback: () => {

+ 1 - 1
src/stores/ProviderStore.js

@@ -70,7 +70,7 @@ class ProviderStore {
     })
     })
   }
   }
 
 
-   @action getDestinationOptions(endpointId: string, provider: string): Promise<void> {
+  @action getDestinationOptions(endpointId: string, provider: string): Promise<void> {
     if (!providersWithExtraOptions.find(p => p === provider)) {
     if (!providersWithExtraOptions.find(p => p === provider)) {
       return Promise.resolve()
       return Promise.resolve()
     }
     }

+ 7 - 7
src/stores/ReplicaStore.js

@@ -16,13 +16,13 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
 import { observable, action } from 'mobx'
 import { observable, action } from 'mobx'
 
 
-import NotificationStore from '../stores/NotificationStore'
+import notificationStore from '../stores/NotificationStore'
 import ReplicaSource from '../sources/ReplicaSource'
 import ReplicaSource from '../sources/ReplicaSource'
 import type { MainItem } from '../types/MainItem'
 import type { MainItem } from '../types/MainItem'
 import type { Execution } from '../types/Execution'
 import type { Execution } from '../types/Execution'
 import type { Field } from '../types/Field'
 import type { Field } from '../types/Field'
 
 
-class ReplicaStoreUtils {
+class replicaStoreUtils {
   static getNewReplica(replicaDetails: MainItem, execution: Execution): MainItem {
   static getNewReplica(replicaDetails: MainItem, execution: Execution): MainItem {
     if (replicaDetails.executions) {
     if (replicaDetails.executions) {
       return {
       return {
@@ -101,13 +101,13 @@ class ReplicaStore {
   @action execute(replicaId: string, fields?: Field[]): Promise<void> {
   @action execute(replicaId: string, fields?: Field[]): Promise<void> {
     return ReplicaSource.execute(replicaId, fields).then(execution => {
     return ReplicaSource.execute(replicaId, fields).then(execution => {
       if (this.replicaDetails && this.replicaDetails.id === replicaId) {
       if (this.replicaDetails && this.replicaDetails.id === replicaId) {
-        this.replicaDetails = ReplicaStoreUtils.getNewReplica(this.replicaDetails, execution)
+        this.replicaDetails = replicaStoreUtils.getNewReplica(this.replicaDetails, execution)
       }
       }
 
 
       let replicasItemIndex = this.replicas ? this.replicas.findIndex(r => r.id === replicaId) : -1
       let replicasItemIndex = this.replicas ? this.replicas.findIndex(r => r.id === replicaId) : -1
 
 
       if (replicasItemIndex > -1) {
       if (replicasItemIndex > -1) {
-        const updatedReplica = ReplicaStoreUtils.getNewReplica(this.replicas[replicasItemIndex], execution)
+        const updatedReplica = replicaStoreUtils.getNewReplica(this.replicas[replicasItemIndex], execution)
         this.replicas[replicasItemIndex] = updatedReplica
         this.replicas[replicasItemIndex] = updatedReplica
       }
       }
     })
     })
@@ -115,7 +115,7 @@ class ReplicaStore {
 
 
   @action cancelExecution(replicaId: string, executionId: string): Promise<void> {
   @action cancelExecution(replicaId: string, executionId: string): Promise<void> {
     return ReplicaSource.cancelExecution(replicaId, executionId).then(() => {
     return ReplicaSource.cancelExecution(replicaId, executionId).then(() => {
-      NotificationStore.notify('Cancelled', 'success')
+      notificationStore.notify('Cancelled', 'success')
     })
     })
   }
   }
 
 
@@ -145,13 +145,13 @@ class ReplicaStore {
   @action deleteDisks(replicaId: string) {
   @action deleteDisks(replicaId: string) {
     return ReplicaSource.deleteDisks(replicaId).then(execution => {
     return ReplicaSource.deleteDisks(replicaId).then(execution => {
       if (this.replicaDetails && this.replicaDetails.id === replicaId) {
       if (this.replicaDetails && this.replicaDetails.id === replicaId) {
-        this.replicaDetails = ReplicaStoreUtils.getNewReplica(this.replicaDetails, execution)
+        this.replicaDetails = replicaStoreUtils.getNewReplica(this.replicaDetails, execution)
       }
       }
 
 
       let replicasItemIndex = this.replicas ? this.replicas.findIndex(r => r.id === replicaId) : -1
       let replicasItemIndex = this.replicas ? this.replicas.findIndex(r => r.id === replicaId) : -1
 
 
       if (replicasItemIndex > -1) {
       if (replicasItemIndex > -1) {
-        const updatedReplica = ReplicaStoreUtils.getNewReplica(this.replicas[replicasItemIndex], execution)
+        const updatedReplica = replicaStoreUtils.getNewReplica(this.replicas[replicasItemIndex], execution)
         this.replicas[replicasItemIndex] = updatedReplica
         this.replicas[replicasItemIndex] = updatedReplica
       }
       }
     })
     })

+ 11 - 11
src/stores/UserStore.js

@@ -17,8 +17,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 import { observable, action } from 'mobx'
 import { observable, action } from 'mobx'
 import type { User, Credentials } from '../types/User'
 import type { User, Credentials } from '../types/User'
 import UserSource from '../sources/UserSource'
 import UserSource from '../sources/UserSource'
-import ProjectStore from './ProjectStore'
-import NotificationStore from '../stores/NotificationStore'
+import projectStore from './ProjectStore'
+import notificationStore from '../stores/NotificationStore'
 
 
 /**
 /**
  * This is the authentication / authorization flow:
  * This is the authentication / authorization flow:
@@ -42,7 +42,7 @@ class UserStore {
       return this.loginScoped()
       return this.loginScoped()
     }).then((user: User) => {
     }).then((user: User) => {
       this.loading = false
       this.loading = false
-      NotificationStore.notify('Signed in', 'success')
+      notificationStore.notify('Signed in', 'success')
       this.user = user
       this.user = user
       this.getUserInfo(user)
       this.getUserInfo(user)
     }).catch((reason) => {
     }).catch((reason) => {
@@ -54,15 +54,15 @@ class UserStore {
   @action loginScoped(projectId?: string): Promise<User> {
   @action loginScoped(projectId?: string): Promise<User> {
     return new Promise((resolve) => {
     return new Promise((resolve) => {
       const sourceLoginScoped = () => {
       const sourceLoginScoped = () => {
-        UserSource.loginScoped(projectId || ProjectStore.projects[0].id).then((user: User) => {
+        UserSource.loginScoped(projectId || projectStore.projects[0].id).then((user: User) => {
           this.user = { ...user, scoped: true }
           this.user = { ...user, scoped: true }
           resolve(user)
           resolve(user)
         })
         })
       }
       }
-      if (ProjectStore.projects && ProjectStore.projects.length) {
+      if (projectStore.projects && projectStore.projects.length) {
         sourceLoginScoped()
         sourceLoginScoped()
       } else {
       } else {
-        ProjectStore.getProjects().then(() => {
+        projectStore.getProjects().then(() => {
           sourceLoginScoped()
           sourceLoginScoped()
         })
         })
       }
       }
@@ -74,7 +74,7 @@ class UserStore {
       this.user = { ...this.user, ...userData }
       this.user = { ...this.user, ...userData }
     }).catch(reason => {
     }).catch(reason => {
       console.error('Error while getting user data', reason)
       console.error('Error while getting user data', reason)
-      NotificationStore.notify('Error while getting user data', 'error')
+      notificationStore.notify('Error while getting user data', 'error')
     })
     })
   }
   }
 
 
@@ -85,7 +85,7 @@ class UserStore {
     return UserSource.tokenLogin().then(user => {
     return UserSource.tokenLogin().then(user => {
       this.loading = false
       this.loading = false
       this.user = { ...this.user, ...user }
       this.user = { ...this.user, ...user }
-      NotificationStore.notify('Signed in', 'success')
+      notificationStore.notify('Signed in', 'success')
       this.getUserInfo(user)
       this.getUserInfo(user)
     }).catch(() => {
     }).catch(() => {
       this.loading = false
       this.loading = false
@@ -93,7 +93,7 @@ class UserStore {
   }
   }
 
 
   @action switchProject(projectId: string): Promise<void> {
   @action switchProject(projectId: string): Promise<void> {
-    NotificationStore.notify('Switching projects')
+    notificationStore.notify('Switching projects')
     return new Promise((resolve, reject) => {
     return new Promise((resolve, reject) => {
       UserSource.switchProject().then(() => {
       UserSource.switchProject().then(() => {
         return this.loginScoped(projectId)
         return this.loginScoped(projectId)
@@ -101,7 +101,7 @@ class UserStore {
         resolve()
         resolve()
       }).catch(reason => {
       }).catch(reason => {
         console.error('Error switching projects', reason)
         console.error('Error switching projects', reason)
-        NotificationStore.notify('Error switching projects')
+        notificationStore.notify('Error switching projects')
         this.logout()
         this.logout()
         reject()
         reject()
       })
       })
@@ -111,7 +111,7 @@ class UserStore {
   @action logout(): Promise<void> {
   @action logout(): Promise<void> {
     return UserSource.logout().catch(reason => {
     return UserSource.logout().catch(reason => {
       console.log('Error logging out', reason)
       console.log('Error logging out', reason)
-      NotificationStore.notify('Error logging out')
+      notificationStore.notify('Error logging out')
     })
     })
   }
   }
 }
 }

+ 4 - 4
src/utils/ApiCaller.js

@@ -17,7 +17,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 import axios from 'axios'
 import axios from 'axios'
 import type { AxiosXHRConfig, $AxiosXHR } from 'axios'
 import type { AxiosXHRConfig, $AxiosXHR } from 'axios'
 
 
-import NotificationStore from '../stores/NotificationStore'
+import notificationStore from '../stores/NotificationStore'
 
 
 type Cancelable = {
 type Cancelable = {
   requestId: string,
   requestId: string,
@@ -90,7 +90,7 @@ class ApiCaller {
           // The request was made and the server responded with a status code
           // The request was made and the server responded with a status code
           // that falls out of the range of 2xx
           // that falls out of the range of 2xx
           if (error.response.status !== 401 || window.location.hash !== loginUrl) {
           if (error.response.status !== 401 || window.location.hash !== loginUrl) {
-            NotificationStore.notify(error.response.data.error.message, 'error')
+            notificationStore.notify(error.response.data.error.message, 'error')
           }
           }
 
 
           if (error.response.status === 401 && window.location.hash !== loginUrl) {
           if (error.response.status === 401 && window.location.hash !== loginUrl) {
@@ -103,7 +103,7 @@ class ApiCaller {
           // The request was made but no response was received
           // The request was made but no response was received
           // `error.request` is an instance of XMLHttpRequest
           // `error.request` is an instance of XMLHttpRequest
           if (window.location.hash !== loginUrl) {
           if (window.location.hash !== loginUrl) {
-            NotificationStore.notify('Request failed, there might be a problem with the connection to the server.', 'error')
+            notificationStore.notify('Request failed, there might be a problem with the connection to the server.', 'error')
           }
           }
           console.log(`%cError No Response: ${axiosOptions.url}`, 'color: #D0021B')
           console.log(`%cError No Response: ${axiosOptions.url}`, 'color: #D0021B')
           reject({})
           reject({})
@@ -115,7 +115,7 @@ class ApiCaller {
           }
           }
 
 
           // Something happened in setting up the request that triggered an Error
           // Something happened in setting up the request that triggered an Error
-          NotificationStore.notify('Request failed, there might be a problem with the connection to the server.', 'error')
+          notificationStore.notify('Request failed, there might be a problem with the connection to the server.', 'error')
           console.log(`%cError Something happened in setting up the request: ${axiosOptions.url}`, 'color: #D0021B')
           console.log(`%cError Something happened in setting up the request: ${axiosOptions.url}`, 'color: #D0021B')
         }
         }
       })
       })