From c9c9c50d6c35485f965712ad0599fbe7c5d2a25c Mon Sep 17 00:00:00 2001 From: Lorenzo Alberto Maria Ambrosi Date: Mon, 25 Nov 2019 16:15:47 +0100 Subject: [PATCH] Rework finish page with React Change-type: patch Signed-off-by: Lorenzo Alberto Maria Ambrosi --- lib/gui/app/app.js | 2 +- lib/gui/app/components/finish/finish.tsx | 127 +++++++++++++++ lib/gui/app/components/finish/index.ts | 35 ++++ .../flash-another/{index.js => index.ts} | 18 +-- .../flash-results/flash-results.jsx | 24 ++- .../flash-results/{index.js => index.ts} | 18 +-- .../components/safe-webview/safe-webview.jsx | 7 +- lib/gui/app/index.html | 4 +- .../app/pages/finish/controllers/finish.js | 98 ----------- lib/gui/app/pages/finish/finish.js | 46 ------ lib/gui/app/pages/finish/styles/_finish.scss | 10 +- .../pages/finish/templates/success.tpl.html | 45 ------ lib/gui/app/pages/main/main.js | 70 ++++++++ lib/gui/app/pages/main/styles/_main.scss | 9 +- lib/gui/app/scss/main.scss | 4 + lib/gui/css/main.css | 19 +-- npm-shrinkwrap.json | 152 ++++++++++++++---- tests/gui/pages/finish.spec.js | 45 ------ 18 files changed, 415 insertions(+), 318 deletions(-) create mode 100644 lib/gui/app/components/finish/finish.tsx create mode 100644 lib/gui/app/components/finish/index.ts rename lib/gui/app/components/flash-another/{index.js => index.ts} (66%) rename lib/gui/app/components/flash-results/{index.js => index.ts} (66%) delete mode 100644 lib/gui/app/pages/finish/controllers/finish.js delete mode 100644 lib/gui/app/pages/finish/finish.js delete mode 100644 lib/gui/app/pages/finish/templates/success.tpl.html create mode 100644 lib/gui/app/pages/main/main.js delete mode 100644 tests/gui/pages/finish.spec.js diff --git a/lib/gui/app/app.js b/lib/gui/app/app.js index 0a7e41d2..b157f627 100644 --- a/lib/gui/app/app.js +++ b/lib/gui/app/app.js @@ -91,7 +91,7 @@ const app = angular.module('Etcher', [ // Pages require('./pages/main/main.ts').MODULE_NAME, - require('./pages/finish/finish'), + require('./components/finish/index.ts').MODULE_NAME, require('./components/settings/index.ts').MODULE_NAME, // OS diff --git a/lib/gui/app/components/finish/finish.tsx b/lib/gui/app/components/finish/finish.tsx new file mode 100644 index 00000000..6e12eaa4 --- /dev/null +++ b/lib/gui/app/components/finish/finish.tsx @@ -0,0 +1,127 @@ +/* + * Copyright 2019 balena.io + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import * as _ from 'lodash'; +import * as React from 'react'; +import * as uuidV4 from 'uuid/v4'; +import * as messages from '../../../../shared/messages'; +import * as flashState from '../../models/flash-state'; +import * as selectionState from '../../models/selection-state'; +import * as store from '../../models/store'; +import * as analytics from '../../modules/analytics'; +import * as updateLock from '../../modules/update-lock'; +import * as FlashAnother from '../flash-another/flash-another'; +import * as FlashResults from '../flash-results/flash-results'; +import * as SVGIcon from '../svg-icon/svg-icon'; + +const restart = (options: any, $state: any) => { + const { + applicationSessionUuid, + flashingWorkflowUuid, + } = store.getState().toJS(); + if (!options.preserveImage) { + selectionState.deselectImage(); + } + selectionState.deselectAllDrives(); + analytics.logEvent('Restart', { + ...options, + applicationSessionUuid, + flashingWorkflowUuid, + }); + + // Re-enable lock release on inactivity + updateLock.resume(); + + // Reset the flashing workflow uuid + store.dispatch({ + type: 'SET_FLASHING_WORKFLOW_UUID', + data: uuidV4(), + }); + + $state.go('main'); +}; + +const formattedErrors = () => { + const errors = _.map( + _.get(flashState.getFlashResults(), ['results', 'errors']), + error => { + return `${error.device}: ${error.message || error.code}`; + }, + ); + return errors.join('\n'); +}; + +function FinishPage({ $state }: any) { + const results = flashState.getFlashResults().results || {}; + const progressMessage = messages.progress; + return ( +
+
+
+ + + restart(options, $state)} + > +
+ +
+
+
+ Thanks for using + + + +
+
+ made with + + by + + + +
+ +
+
+
+
+
+
+ ); +} + +export default FinishPage; diff --git a/lib/gui/app/components/finish/index.ts b/lib/gui/app/components/finish/index.ts new file mode 100644 index 00000000..25c580cb --- /dev/null +++ b/lib/gui/app/components/finish/index.ts @@ -0,0 +1,35 @@ +/* + * Copyright 2019 balena.io + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @module Etcher.Pages.Finish + */ + +import * as angular from 'angular'; +import { react2angular } from 'react2angular'; +import FinishPage from './finish'; + +export const MODULE_NAME = 'Etcher.Pages.Finish'; +const Finish = angular.module(MODULE_NAME, []); + +Finish.component('finish', react2angular(FinishPage, [], ['$state'])); + +Finish.config(($stateProvider: any) => { + $stateProvider.state('success', { + url: '/success', + template: '', + }); +}); diff --git a/lib/gui/app/components/flash-another/index.js b/lib/gui/app/components/flash-another/index.ts similarity index 66% rename from lib/gui/app/components/flash-another/index.js rename to lib/gui/app/components/flash-another/index.ts index d0545718..8a22fd1a 100644 --- a/lib/gui/app/components/flash-another/index.js +++ b/lib/gui/app/components/flash-another/index.ts @@ -14,21 +14,15 @@ * limitations under the License. */ -'use strict' - /** * @module Etcher.Components.FlashAnother */ -const angular = require('angular') -const { react2angular } = require('react2angular') +import * as angular from 'angular'; +import { react2angular } from 'react2angular'; +import * as FlashAnother from './flash-another'; -const MODULE_NAME = 'Etcher.Components.FlashAnother' -const FlashAnother = angular.module(MODULE_NAME, []) +export const MODULE_NAME = 'Etcher.Components.FlashAnother'; +const FlashAnotherModule = angular.module(MODULE_NAME, []); -FlashAnother.component( - 'flashAnother', - react2angular(require('./flash-another.jsx')) -) - -module.exports = MODULE_NAME +FlashAnotherModule.component('flashAnother', react2angular(FlashAnother)); diff --git a/lib/gui/app/components/flash-results/flash-results.jsx b/lib/gui/app/components/flash-results/flash-results.jsx index 29f6cbbb..107ebc4b 100644 --- a/lib/gui/app/components/flash-results/flash-results.jsx +++ b/lib/gui/app/components/flash-results/flash-results.jsx @@ -14,13 +14,35 @@ * limitations under the License. */ +/* + * Copyright 2018 resin.io + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + 'use strict' +// eslint-disable-next-line no-unused-vars const React = require('react') const PropTypes = require('prop-types') const _ = require('lodash') const styled = require('styled-components').default -const { position, left, top, space } = require('styled-system') +const { + position, + left, + top, + space +} = require('styled-system') const { Underline } = require('./../../styled-components') const Div = styled.div ` diff --git a/lib/gui/app/components/flash-results/index.js b/lib/gui/app/components/flash-results/index.ts similarity index 66% rename from lib/gui/app/components/flash-results/index.js rename to lib/gui/app/components/flash-results/index.ts index 325f3eea..f0b42025 100644 --- a/lib/gui/app/components/flash-results/index.js +++ b/lib/gui/app/components/flash-results/index.ts @@ -14,21 +14,15 @@ * limitations under the License. */ -'use strict' - /** * @module Etcher.Components.FlashResults */ -const angular = require('angular') -const { react2angular } = require('react2angular') +import * as angular from 'angular'; +import { react2angular } from 'react2angular'; +import * as FlashResults from './flash-results'; -const MODULE_NAME = 'Etcher.Components.FlashResults' -const FlashResults = angular.module(MODULE_NAME, []) +export const MODULE_NAME = 'Etcher.Components.FlashResults'; +const FlashResultsModule = angular.module(MODULE_NAME, []); -FlashResults.component( - 'flashResults', - react2angular(require('./flash-results.jsx')) -) - -module.exports = MODULE_NAME +FlashResultsModule.component('flashResults', react2angular(FlashResults)); diff --git a/lib/gui/app/components/safe-webview/safe-webview.jsx b/lib/gui/app/components/safe-webview/safe-webview.jsx index 68029356..5298151b 100644 --- a/lib/gui/app/components/safe-webview/safe-webview.jsx +++ b/lib/gui/app/components/safe-webview/safe-webview.jsx @@ -108,8 +108,8 @@ class SafeWebview extends react.PureComponent { this.didGetResponseDetails = _.bind(this.didGetResponseDetails, this) const logWebViewMessage = (event) => { - console.log('Message from SafeWebview:', event.message); - }; + console.log('Message from SafeWebview:', event.message) + } this.eventTuples = [ [ 'did-fail-load', this.didFailLoad ], @@ -174,6 +174,9 @@ class SafeWebview extends react.PureComponent { this.setState({ shouldShow: false }) + if (this.props.onWebviewShow) { + this.props.onWebviewShow(false) + } } /** diff --git a/lib/gui/app/index.html b/lib/gui/app/index.html index 89b4f880..892e71d8 100644 --- a/lib/gui/app/index.html +++ b/lib/gui/app/index.html @@ -10,6 +10,7 @@ +
-
+
+ diff --git a/lib/gui/app/pages/finish/controllers/finish.js b/lib/gui/app/pages/finish/controllers/finish.js deleted file mode 100644 index d072d8a9..00000000 --- a/lib/gui/app/pages/finish/controllers/finish.js +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright 2016 resin.io - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -'use strict' - -const _ = require('lodash') -const uuidV4 = require('uuid/v4') -const store = require('../../../models/store') -const settings = require('../../../models/settings') -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') - -module.exports = function ($state) { - /** - * @summary Settings model - * @type {Object} - * @public - */ - this.settings = settings - - /** - * @summary Flash state - * @type {Object} - * @public - */ - this.flash = flashState - - this.progressMessage = messages.progress - - this.results = this.flash.getFlashResults().results || {} - - /** - * @summary Restart the flashing process - * @function - * @public - * - * @param {Object} [options] - options - * @param {Boolean} [options.preserveImage=false] - preserve image - * - * @example - * FinishController.restart({ preserveImage: true }); - */ - this.restart = (options) => { - if (!options.preserveImage) { - selectionState.deselectImage() - } - selectionState.deselectAllDrives() - analytics.logEvent('Restart', _.assign({ - applicationSessionUuid: store.getState().toJS().applicationSessionUuid, - flashingWorkflowUuid: store.getState().toJS().flashingWorkflowUuid - }, options)) - - // Re-enable lock release on inactivity - updateLock.resume() - - // Reset the flashing workflow uuid - store.dispatch({ - type: 'SET_FLASHING_WORKFLOW_UUID', - data: uuidV4() - }) - - $state.go('main') - } - - /** - * @summary Format the result errors with newlines - * @function - * @public - * - * @returns {String} formatted errors - * - * @example - * const errors = FinishController.formattedErrors() - * console.log(errors) - */ - this.formattedErrors = () => { - const errors = _.map(_.get(flashState.getFlashResults(), [ 'results', 'errors' ]), (error) => { - return `${error.device}: ${error.message || error.code}` - }) - return errors.join('\n') - } -} diff --git a/lib/gui/app/pages/finish/finish.js b/lib/gui/app/pages/finish/finish.js deleted file mode 100644 index abb160af..00000000 --- a/lib/gui/app/pages/finish/finish.js +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2016 resin.io - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -'use strict' - -/** - * The finish page represents the application state where - * the the flash/validation has completed. - * - * Its purpose is to display success or failure information, - * as well as the "next steps". - * - * @module Etcher.Pages.Finish - */ - -const angular = require('angular') -const MODULE_NAME = 'Etcher.Pages.Finish' -const FinishPage = angular.module(MODULE_NAME, [ - require('angular-ui-router') -]) - -FinishPage.controller('FinishController', require('./controllers/finish')) - -FinishPage.config(($stateProvider) => { - $stateProvider - .state('success', { - url: '/success', - controller: 'FinishController as finish', - template: require('./templates/success.tpl.html') - }) -}) - -module.exports = MODULE_NAME diff --git a/lib/gui/app/pages/finish/styles/_finish.scss b/lib/gui/app/pages/finish/styles/_finish.scss index f6748964..68a92303 100644 --- a/lib/gui/app/pages/finish/styles/_finish.scss +++ b/lib/gui/app/pages/finish/styles/_finish.scss @@ -15,12 +15,12 @@ */ .page-finish { - margin-top: -15px; - flex: 1; +// margin-top: -15px; +// flex: 1; +} - .col-xs-5.inline-flex.items-baseline > span, .col-xs-5.inline-flex.items-baseline > div { - margin-bottom: -10px; - } +.col-xs-5.inline-flex.items-baseline > span, .col-xs-5.inline-flex.items-baseline > div { + margin-bottom: -10px; } .page-finish .button-label { diff --git a/lib/gui/app/pages/finish/templates/success.tpl.html b/lib/gui/app/pages/finish/templates/success.tpl.html deleted file mode 100644 index 152aa15d..00000000 --- a/lib/gui/app/pages/finish/templates/success.tpl.html +++ /dev/null @@ -1,45 +0,0 @@ -
-
-
- - - - - -
- -
-
-
Thanks for using - - - - -
- -
-
-
-
diff --git a/lib/gui/app/pages/main/main.js b/lib/gui/app/pages/main/main.js new file mode 100644 index 00000000..621eb629 --- /dev/null +++ b/lib/gui/app/pages/main/main.js @@ -0,0 +1,70 @@ +/* + * Copyright 2016 resin.io + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +'use strict' + +/** + * This page represents the application main page. + * + * @module Etcher.Pages.Main + */ + +const angular = require('angular') +const MODULE_NAME = 'Etcher.Pages.Main' + +require('angular-moment') + +const MainPage = angular.module(MODULE_NAME, [ + 'angularMoment', + + require('angular-ui-router'), + require('angular-seconds-to-date'), + + require('../../components/drive-selector/drive-selector'), + require('../../components/tooltip-modal/tooltip-modal'), + require('../../components/flash-error-modal/flash-error-modal'), + require('../../components/progress-button'), + require('../../components/image-selector'), + require('../../components/warning-modal/warning-modal'), + require('../../components/file-selector'), + require('../../components/featured-project'), + require('../../components/reduced-flashing-infos'), + require('../../components/flash-another/index.ts').MODULE_NAME, + require('../../components/flash-results/index.ts').MODULE_NAME, + require('../../components/drive-selector'), + + require('../../os/open-external/open-external'), + require('../../os/dropzone/dropzone'), + + require('../../utils/byte-size/byte-size'), + require('../../utils/middle-ellipsis/filter') +]) + +MainPage.controller('MainController', require('./controllers/main')) +MainPage.controller('ImageSelectionController', require('./controllers/image-selection')) +MainPage.controller('DriveSelectionController', require('./controllers/drive-selection')) +MainPage.controller('FlashController', require('./controllers/flash')) + +MainPage.config(($stateProvider) => { + $stateProvider + .state('main', { + url: '/main', + controller: 'MainController as main', + template: require('./templates/main.tpl.html') + }) +}) + +module.exports = MODULE_NAME diff --git a/lib/gui/app/pages/main/styles/_main.scss b/lib/gui/app/pages/main/styles/_main.scss index 48a6dfe7..655ff776 100644 --- a/lib/gui/app/pages/main/styles/_main.scss +++ b/lib/gui/app/pages/main/styles/_main.scss @@ -21,6 +21,7 @@ img[disabled] { .page-main { flex: 1; align-self: center; + margin: 20px; } .page-main > .col-xs { @@ -92,11 +93,6 @@ img[disabled] { width: $btn-min-width; } -.page-main .step-footer-underline { - border-bottom: 1px dotted; - padding-bottom: 2px; -} - .page-main .button.step-footer { font-size: 16px; color: $palette-theme-primary-background; @@ -169,8 +165,7 @@ img[disabled] { .target-status-line { display: flex; align-items: baseline; - font-size: 16px; - font-family: inherit; + margin-bottom: 9px; > .target-status-dot { width: 12px; diff --git a/lib/gui/app/scss/main.scss b/lib/gui/app/scss/main.scss index d478363f..3049fac2 100644 --- a/lib/gui/app/scss/main.scss +++ b/lib/gui/app/scss/main.scss @@ -224,6 +224,10 @@ body { height: 24px; margin: 0 10px; } + + * { + z-index: 1; + } } featured-project { diff --git a/lib/gui/css/main.css b/lib/gui/css/main.css index 1185b980..c9a35d8d 100644 --- a/lib/gui/css/main.css +++ b/lib/gui/css/main.css @@ -6306,7 +6306,8 @@ img[disabled] { .page-main { flex: 1; - align-self: center; } + align-self: center; + margin: 20px; } .page-main > .col-xs { height: 165px; } @@ -6366,10 +6367,6 @@ img[disabled] { justify-content: space-between; width: 170px; } -.page-main .step-footer-underline { - border-bottom: 1px dotted; - padding-bottom: 2px; } - .page-main .button.step-footer { font-size: 16px; color: #2297de; @@ -6430,8 +6427,7 @@ img[disabled] { .target-status-line { display: flex; align-items: baseline; - font-size: 16px; - font-family: inherit; } + margin-bottom: 9px; } .target-status-line > .target-status-dot { width: 12px; height: 12px; @@ -6477,11 +6473,8 @@ img[disabled] { * See the License for the specific language governing permissions and * limitations under the License. */ -.page-finish { - margin-top: -15px; - flex: 1; } - .page-finish .col-xs-5.inline-flex.items-baseline > span, .page-finish .col-xs-5.inline-flex.items-baseline > div { - margin-bottom: -10px; } +.col-xs-5.inline-flex.items-baseline > span, .col-xs-5.inline-flex.items-baseline > div { + margin-bottom: -10px; } .page-finish .button-label { margin: 0 auto 15px; @@ -9886,6 +9879,8 @@ body { vertical-align: middle; height: 24px; margin: 0 10px; } + .section-header * { + z-index: 1; } featured-project webview { flex: 0 1; diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 8a5fc39c..459020c1 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1521,9 +1521,9 @@ "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" }, "acorn": { - "version": "5.7.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", - "integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.1.0.tgz", + "integrity": "sha512-MW/FjM+IvU9CgBzjO3UIPCE2pyEwUsoFl+VGdczOPEdxfGFjuKny/gN54mOuX7Qxmb9Rg9MCn2oKiSUeW+pjrw==", "dev": true }, "acorn-jsx": { @@ -2470,12 +2470,6 @@ "chainsaw": "~0.1.0" } }, - "binary-extensions": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", - "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", - "dev": true - }, "bindings": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", @@ -2911,6 +2905,26 @@ "y18n": "^4.0.0" }, "dependencies": { + "bluebird": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.1.tgz", + "integrity": "sha512-DdmyoGCleJnkbp3nkbxTLJ18rjDsE4yCggEwKNXkeV123sPNfOCYeDoeuOY+F2FrSjO1YXcTU+dsy96KMy+gcg==", + "dev": true + }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, "lru-cache": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", @@ -4309,10 +4323,21 @@ } }, "data-uri-to-buffer": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-1.2.0.tgz", - "integrity": "sha512-vKQ9DTQPN1FLYiiEEOQ6IBGFqvjCa5rSK3cWMy/Nespm5d/x3dGFT9UBZnkLxCwua/IXBi2TYnwTEpsOvhC4UQ==", - "dev": true + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-2.0.0.tgz", + "integrity": "sha512-YbKCNLPPP4inc0E5If4OaalBc7gpaM2MRv77Pv2VThVComLKfbGYtJcdDCViDyp1Wd4SebhHLz94vp91zbK6bw==", + "dev": true, + "requires": { + "@types/node": "^8.0.7" + }, + "dependencies": { + "@types/node": { + "version": "8.10.40", + "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.40.tgz", + "integrity": "sha512-RRSjdwz63kS4u7edIwJUn8NqKLLQ6LyqF/X4+4jp38MBT3Vwetewi2N4dgJEshLbDwNgOJXNYoOwzVZUSSLhkQ==", + "dev": true + } + } }, "date-fns": { "version": "1.30.1", @@ -4776,9 +4801,9 @@ "dev": true }, "des.js": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", - "integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", + "integrity": "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==", "dev": true, "requires": { "inherits": "^2.0.1", @@ -5415,9 +5440,9 @@ "dev": true }, "elliptic": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.1.tgz", - "integrity": "sha512-xvJINNLbTeWQjrl6X+7eQCrIy/YPv5XCpKW6kB5mKvtnGILoLDcySuwomfdzt0BMdLNVnuRNTuzKNHj0bva1Cg==", + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.2.tgz", + "integrity": "sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw==", "dev": true, "requires": { "bn.js": "^4.4.0", @@ -8207,15 +8232,6 @@ "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==" }, - "is-binary-path": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", - "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", - "dev": true, - "requires": { - "binary-extensions": "^1.0.0" - } - }, "is-buffer": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.4.tgz", @@ -10286,9 +10302,9 @@ }, "dependencies": { "buffer": { - "version": "4.9.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", - "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=", + "version": "4.9.2", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz", + "integrity": "sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==", "dev": true, "requires": { "base64-js": "^1.0.2", @@ -14774,6 +14790,80 @@ "chokidar": "^2.0.2", "graceful-fs": "^4.1.2", "neo-async": "^2.5.0" + }, + "dependencies": { + "anymatch": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", + "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", + "dev": true, + "requires": { + "micromatch": "^3.1.4", + "normalize-path": "^2.1.1" + }, + "dependencies": { + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "requires": { + "remove-trailing-separator": "^1.0.1" + } + } + } + }, + "binary-extensions": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", + "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", + "dev": true + }, + "chokidar": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", + "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", + "dev": true, + "requires": { + "anymatch": "^2.0.0", + "async-each": "^1.0.1", + "braces": "^2.3.2", + "glob-parent": "^3.1.0", + "inherits": "^2.0.3", + "is-binary-path": "^1.0.0", + "is-glob": "^4.0.0", + "normalize-path": "^3.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.2.1", + "upath": "^1.1.1" + } + }, + "is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "dev": true, + "requires": { + "binary-extensions": "^1.0.0" + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, + "readdirp": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", + "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.11", + "micromatch": "^3.1.10", + "readable-stream": "^2.0.2" + } + } } }, "wdio-dot-reporter": { diff --git a/tests/gui/pages/finish.spec.js b/tests/gui/pages/finish.spec.js deleted file mode 100644 index b3632946..00000000 --- a/tests/gui/pages/finish.spec.js +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2018 resin.io - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -'use strict' - -const m = require('mochainon') -const fs = require('fs') -const angular = require('angular') - -describe('Browser: FinishPage', function () { - beforeEach(angular.mock.module( - require('../../../lib/gui/app/pages/finish/finish') - )) - - describe('page template', function () { - let $state - - beforeEach(angular.mock.inject(function (_$state_) { - $state = _$state_ - })) - - it('should match the file contents', function () { - const { - template - } = $state.get('success') - const contents = fs.readFileSync('lib/gui/app/pages/finish/templates/success.tpl.html', { - encoding: 'utf-8' - }) - m.chai.expect(template).to.equal(contents) - }) - }) -})