mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-22 02:36:32 +00:00
refactor(gui): Move shared models to app/models
This commit is contained in:
parent
6232cc7d49
commit
687e0b563b
@ -36,13 +36,13 @@ const release = require('../../shared/release')
|
||||
const store = require('./models/store')
|
||||
const errors = require('../../shared/errors')
|
||||
const packageJSON = require('../../../package.json')
|
||||
const flashState = require('../../shared/models/flash-state')
|
||||
const flashState = require('./models/flash-state')
|
||||
const settings = require('./models/settings')
|
||||
const windowProgress = require('./os/window-progress')
|
||||
const analytics = require('./modules/analytics')
|
||||
const updateNotifier = require('./components/update-notifier')
|
||||
const availableDrives = require('../../shared/models/available-drives')
|
||||
const selectionState = require('../../shared/models/selection-state')
|
||||
const availableDrives = require('./models/available-drives')
|
||||
const selectionState = require('./models/selection-state')
|
||||
const driveScanner = require('./modules/drive-scanner')
|
||||
const osDialog = require('./os/dialog')
|
||||
const exceptionReporter = require('./modules/exception-reporter')
|
||||
|
@ -21,8 +21,8 @@ const _ = require('lodash')
|
||||
const Bluebird = require('bluebird')
|
||||
const constraints = require('../../../../../shared/drive-constraints')
|
||||
const analytics = require('../../../modules/analytics')
|
||||
const availableDrives = require('../../../../../shared/models/available-drives')
|
||||
const selectionState = require('../../../../../shared/models/selection-state')
|
||||
const availableDrives = require('../../../models/available-drives')
|
||||
const selectionState = require('../../../models/selection-state')
|
||||
const utils = require('../../../../../shared/utils')
|
||||
|
||||
module.exports = function (
|
||||
|
@ -37,7 +37,7 @@ const Storage = require('../../../models/storage')
|
||||
const analytics = require('../../../modules/analytics')
|
||||
const middleEllipsis = require('../../../utils/middle-ellipsis')
|
||||
const files = require('../../../../../shared/files')
|
||||
const selectionState = require('../../../../../shared/models/selection-state')
|
||||
const selectionState = require('../../../models/selection-state')
|
||||
const imageStream = require('../../../../../sdk/image-stream')
|
||||
const errors = require('../../../../../shared/errors')
|
||||
const messages = require('../../../../../shared/messages')
|
||||
|
@ -16,8 +16,8 @@
|
||||
|
||||
'use strict'
|
||||
|
||||
const flashState = require('../../../../../shared/models/flash-state')
|
||||
const selectionState = require('../../../../../shared/models/selection-state')
|
||||
const flashState = require('../../../models/flash-state')
|
||||
const selectionState = require('../../../models/selection-state')
|
||||
const analytics = require('../../../modules/analytics')
|
||||
|
||||
module.exports = function (WarningModalService) {
|
||||
|
@ -17,7 +17,7 @@
|
||||
'use strict'
|
||||
|
||||
const _ = require('lodash')
|
||||
const store = require('../../gui/app/models/store')
|
||||
const store = require('./store')
|
||||
|
||||
/**
|
||||
* @summary Check if there are available drives
|
@ -17,8 +17,8 @@
|
||||
'use strict'
|
||||
|
||||
const _ = require('lodash')
|
||||
const store = require('../../gui/app/models/store')
|
||||
const units = require('../units')
|
||||
const store = require('./store')
|
||||
const units = require('../../../shared/units')
|
||||
|
||||
/**
|
||||
* @summary Reset flash state
|
@ -17,7 +17,7 @@
|
||||
'use strict'
|
||||
|
||||
const _ = require('lodash')
|
||||
const store = require('../../gui/app/models/store')
|
||||
const store = require('./store')
|
||||
const availableDrives = require('./available-drives')
|
||||
|
||||
/**
|
@ -24,14 +24,14 @@ const ipc = require('node-ipc')
|
||||
const isRunningInAsar = require('electron-is-running-in-asar')
|
||||
const electron = require('electron')
|
||||
const settings = require('../models/settings')
|
||||
const flashState = require('../../../shared/models/flash-state')
|
||||
const flashState = require('../models/flash-state')
|
||||
const errors = require('../../../shared/errors')
|
||||
const permissions = require('../../../shared/permissions')
|
||||
const windowProgress = require('../os/window-progress')
|
||||
const analytics = require('../modules/analytics')
|
||||
const updateLock = require('./update-lock')
|
||||
const packageJSON = require('../../../../package.json')
|
||||
const selectionState = require('../../../shared/models/selection-state')
|
||||
const selectionState = require('../models/selection-state')
|
||||
|
||||
/**
|
||||
* @summary Number of threads per CPU to allocate to the UV_THREADPOOL
|
||||
|
@ -18,8 +18,8 @@
|
||||
|
||||
const _ = require('lodash')
|
||||
const settings = require('../../../models/settings')
|
||||
const flashState = require('../../../../../shared/models/flash-state')
|
||||
const selectionState = require('../../../../../shared/models/selection-state')
|
||||
const flashState = require('../../../models/flash-state')
|
||||
const selectionState = require('../../../models/selection-state')
|
||||
const analytics = require('../../../modules/analytics')
|
||||
const updateLock = require('../../../modules/update-lock')
|
||||
const messages = require('../../../../../shared/messages')
|
||||
|
@ -20,7 +20,7 @@ const _ = require('lodash')
|
||||
const angular = require('angular')
|
||||
const prettyBytes = require('pretty-bytes')
|
||||
const settings = require('../../../models/settings')
|
||||
const selectionState = require('../../../../../shared/models/selection-state')
|
||||
const selectionState = require('../../../models/selection-state')
|
||||
const analytics = require('../../../modules/analytics')
|
||||
const exceptionReporter = require('../../../modules/exception-reporter')
|
||||
const utils = require('../../../../../shared/utils')
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
const _ = require('lodash')
|
||||
const messages = require('../../../../../shared/messages')
|
||||
const flashState = require('../../../../../shared/models/flash-state')
|
||||
const flashState = require('../../../models/flash-state')
|
||||
const driveScanner = require('../../../modules/drive-scanner')
|
||||
const progressStatus = require('../../../modules/progress-status')
|
||||
const notification = require('../../../os/notification')
|
||||
@ -27,7 +27,8 @@ const imageWriter = require('../../../modules/image-writer')
|
||||
const path = require('path')
|
||||
const store = require('../../../models/store')
|
||||
const constraints = require('../../../../../shared/drive-constraints')
|
||||
const availableDrives = require('../../../../../shared/models/available-drives')
|
||||
const availableDrives = require('../../../models/available-drives')
|
||||
const debug = require('debug')('etcher:controller:flash')
|
||||
|
||||
module.exports = function (
|
||||
$q,
|
||||
@ -139,7 +140,10 @@ module.exports = function (
|
||||
|
||||
// Trigger Angular digests along with store updates, as the flash state
|
||||
// updates. Without this there is essentially no progress to watch.
|
||||
const unsubscribe = store.subscribe($timeout)
|
||||
const unsubscribe = store.subscribe(() => {
|
||||
debug('store.onChange')
|
||||
$timeout()
|
||||
})
|
||||
|
||||
const iconPath = '../../../assets/icon.png'
|
||||
|
||||
|
@ -24,7 +24,7 @@ const errors = require('../../../../../shared/errors')
|
||||
const imageStream = require('../../../../../sdk/image-stream')
|
||||
const supportedFormats = require('../../../../../shared/supported-formats')
|
||||
const analytics = require('../../../modules/analytics')
|
||||
const selectionState = require('../../../../../shared/models/selection-state')
|
||||
const selectionState = require('../../../models/selection-state')
|
||||
const osDialog = require('../../../os/dialog')
|
||||
const exceptionReporter = require('../../../modules/exception-reporter')
|
||||
|
||||
|
@ -17,11 +17,11 @@
|
||||
'use strict'
|
||||
|
||||
const settings = require('../../../models/settings')
|
||||
const flashState = require('../../../../../shared/models/flash-state')
|
||||
const flashState = require('../../../models/flash-state')
|
||||
const analytics = require('../../../modules/analytics')
|
||||
const exceptionReporter = require('../../../modules/exception-reporter')
|
||||
const availableDrives = require('../../../../../shared/models/available-drives')
|
||||
const selectionState = require('../../../../../shared/models/selection-state')
|
||||
const availableDrives = require('../../../models/available-drives')
|
||||
const selectionState = require('../../../models/selection-state')
|
||||
const driveConstraints = require('../../../../../shared/drive-constraints')
|
||||
const messages = require('../../../../../shared/messages')
|
||||
|
||||
|
@ -4,7 +4,7 @@ const m = require('mochainon')
|
||||
const ipc = require('node-ipc')
|
||||
const angular = require('angular')
|
||||
const Bluebird = require('bluebird')
|
||||
const flashState = require('../../../lib/shared/models/flash-state')
|
||||
const flashState = require('../../../lib/gui/app/models/flash-state')
|
||||
const imageWriter = require('../../../lib/gui/app/modules/image-writer')
|
||||
require('angular-mocks')
|
||||
|
||||
|
@ -22,9 +22,9 @@ const fs = require('fs')
|
||||
const path = require('path')
|
||||
const supportedFormats = require('../../../lib/shared/supported-formats')
|
||||
const angular = require('angular')
|
||||
const flashState = require('../../../lib/shared/models/flash-state')
|
||||
const availableDrives = require('../../../lib/shared/models/available-drives')
|
||||
const selectionState = require('../../../lib/shared/models/selection-state')
|
||||
const flashState = require('../../../lib/gui/app/models/flash-state')
|
||||
const availableDrives = require('../../../lib/gui/app/models/available-drives')
|
||||
const selectionState = require('../../../lib/gui/app/models/selection-state')
|
||||
require('angular-mocks')
|
||||
|
||||
// Mock HTML requires by reading from the file-system
|
||||
|
@ -18,8 +18,8 @@
|
||||
|
||||
const m = require('mochainon')
|
||||
const path = require('path')
|
||||
const availableDrives = require('../../../lib/shared/models/available-drives')
|
||||
const selectionState = require('../../../lib/shared/models/selection-state')
|
||||
const availableDrives = require('../../../lib/gui/app/available-drives')
|
||||
const selectionState = require('../../../lib/gui/app/selection-state')
|
||||
const constraints = require('../../../lib/shared/drive-constraints')
|
||||
|
||||
describe('Model: availableDrives', function () {
|
||||
|
@ -17,7 +17,7 @@
|
||||
'use strict'
|
||||
|
||||
const m = require('mochainon')
|
||||
const flashState = require('../../../lib/shared/models/flash-state')
|
||||
const flashState = require('../../../lib/gui/app/models/flash-state')
|
||||
|
||||
describe('Model: flashState', function () {
|
||||
beforeEach(function () {
|
||||
|
@ -19,8 +19,8 @@
|
||||
const m = require('mochainon')
|
||||
const _ = require('lodash')
|
||||
const path = require('path')
|
||||
const availableDrives = require('../../../lib/shared/models/available-drives')
|
||||
const selectionState = require('../../../lib/shared/models/selection-state')
|
||||
const availableDrives = require('../../../lib/gui/app/available-drives')
|
||||
const selectionState = require('../../../lib/gui/app/selection-state')
|
||||
|
||||
describe('Model: selectionState', function () {
|
||||
describe('given a clean state', function () {
|
||||
|
Loading…
x
Reference in New Issue
Block a user