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 @@
+
-
+
+