Refactor project structure

This commit is contained in:
Thomas Nordquist
2019-04-07 20:16:48 +02:00
parent 16c72fa9be
commit e2c60cca64
44 changed files with 306 additions and 529 deletions

View File

@@ -2,7 +2,7 @@ import * as q from '../../../backend/src/Model'
import { Action } from 'redux'
import { createReducer } from './lib'
import { MqttOptions } from '../../../backend/src/DataSource'
import { TopicViewModel } from '../TopicViewModel'
import { TopicViewModel } from '../model/TopicViewModel'
export type ConnectionHealth = 'offline' | 'online' | 'connecting'
export interface ConnectionState {

View File

@@ -1,7 +1,7 @@
import * as q from '../../../backend/src/Model'
import { Action } from 'redux'
import { createReducer } from './lib'
import { TopicViewModel } from '../TopicViewModel'
import { TopicViewModel } from '../model/TopicViewModel'
export interface TreeState {
tree?: q.Tree<TopicViewModel>

View File

@@ -3,7 +3,7 @@ import { connectionManagerReducer, ConnectionManagerState } from './ConnectionMa
import { connectionReducer, ConnectionState } from './Connection'
import { publishReducer, PublishState } from './Publish'
import { settingsReducer, SettingsState } from './Settings'
import { trackEvent } from '../tracking'
import { trackEvent } from '../utils/tracking'
import { treeReducer, TreeState } from './Tree'
export enum ActionTypes {
@@ -50,30 +50,30 @@ const globalState: Reducer<GlobalState | undefined, CustomAction> = (state = ini
switch (action.type) {
case ActionTypes.showUpdateNotification:
return {
...state,
showUpdateNotification: action.showUpdateNotification,
}
...state,
showUpdateNotification: action.showUpdateNotification,
}
case ActionTypes.showError:
return {
...state,
error: action.error,
}
...state,
error: action.error,
}
case ActionTypes.didLaunch:
return {
...state,
launching: false,
}
...state,
launching: false,
}
case ActionTypes.showUpdateDetails:
if (action.showUpdateDetails === undefined) {
return state
}
return state
}
return {
...state,
showUpdateDetails: action.showUpdateDetails,
}
...state,
showUpdateDetails: action.showUpdateDetails,
}
default:
return state