Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade: angular to v1.6.1; angular-ui-bootstrap to v2.5.0 #1083

Merged
merged 1 commit into from
Feb 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/gui/modules/error.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
*/

const angular = require('angular');
const _ = require('lodash');

const MODULE_NAME = 'Etcher.Modules.Error';
const error = angular.module(MODULE_NAME, [
Expand All @@ -41,6 +42,10 @@ error.service('ErrorService', function(AnalyticsService, OSDialogService) {
* ErrorService.reportException(new Error('Something happened'));
*/
this.reportException = (exception) => {
if (_.isUndefined(exception)) {
return;
}

OSDialogService.showError(exception, exception.description);
AnalyticsService.logException(exception);
};
Expand Down
19 changes: 18 additions & 1 deletion lib/gui/pages/main/controllers/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ module.exports = function(
FlashStateModel,
SettingsModel,
TooltipModalService,
ErrorService,
OSOpenExternalService
) {

Expand All @@ -31,7 +32,6 @@ module.exports = function(
this.state = FlashStateModel;
this.settings = SettingsModel;
this.external = OSOpenExternalService;
this.tooltipModal = TooltipModalService;

/**
* @summary Determine if the image step should be disabled
Expand Down Expand Up @@ -65,4 +65,21 @@ module.exports = function(
return !SelectionStateModel.hasImage() || this.shouldImageStepBeDisabled();
};

/**
* @summary Display a tooltip with the selected image details
* @function
* @public
*
* @returns {Promise}
*
* @example
* MainController.showSelectedImageDetails()
*/
this.showSelectedImageDetails = () => {
return TooltipModalService.show({
title: 'Image File Name',
message: SelectionStateModel.getImagePath()
}).catch(ErrorService.reportException);
};

};
5 changes: 4 additions & 1 deletion lib/gui/pages/main/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,12 @@
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-moment'),
require('angular-middle-ellipses'),
require('angular-seconds-to-date'),

Expand Down
5 changes: 1 addition & 4 deletions lib/gui/pages/main/templates/main.tpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,7 @@
<div ng-if="main.selection.hasImage()">
<div class="step-selection-text">
<span
ng-click="main.tooltipModal.show({
title: 'Image File Name',
message: main.selection.getImagePath()
})"
ng-click="main.showSelectedImageDetails()"
class="step-image step-name"
ng-class="{ 'text-disabled': main.shouldImageStepBeDisabled() }"
ng-bind="main.selection.getImageName() || main.selection.getImagePath() | basename | middleEllipses:20"
Expand Down
30 changes: 15 additions & 15 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@
"removedrive": "^1.1.1"
},
"dependencies": {
"angular": "^1.5.3",
"angular": "^1.6.1",
"angular-if-state": "^1.0.0",
"angular-middle-ellipses": "^1.0.0",
"angular-moment": "^1.0.0-beta.6",
"angular-moment": "^1.0.1",
"angular-seconds-to-date": "^1.0.0",
"angular-ui-bootstrap": "^1.3.2",
"angular-ui-router": "^0.2.18",
"angular-ui-bootstrap": "^2.5.0",
"angular-ui-router": "^0.4.2",
"archive-type": "^3.2.0",
"bluebird": "^3.0.5",
"bootstrap-sass": "^3.3.5",
Expand Down Expand Up @@ -104,7 +104,7 @@
"yauzl": "^2.6.0"
},
"devDependencies": {
"angular-mocks": "^1.4.7",
"angular-mocks": "^1.6.1",
"browserify": "^13.0.1",
"electron-builder": "^2.6.0",
"electron-mocha": "^3.1.1",
Expand Down
6 changes: 3 additions & 3 deletions tests/gui/modules/image-writer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ describe('Browser: ImageWriter', function() {
});

ImageWriterService.flash('foo.img', '/dev/disk2');
ImageWriterService.flash('foo.img', '/dev/disk2');
ImageWriterService.flash('foo.img', '/dev/disk2').catch(angular.noop);
$rootScope.$apply();
m.chai.expect(this.performWriteStub).to.have.been.calledOnce;
});
Expand Down Expand Up @@ -97,13 +97,13 @@ describe('Browser: ImageWriter', function() {
});

it('should set flashing to false when done', function() {
ImageWriterService.flash('foo.img', '/dev/disk2');
ImageWriterService.flash('foo.img', '/dev/disk2').catch(angular.noop);
$rootScope.$apply();
m.chai.expect(FlashStateModel.isFlashing()).to.be.false;
});

it('should set the error code in the flash results', function() {
ImageWriterService.flash('foo.img', '/dev/disk2');
ImageWriterService.flash('foo.img', '/dev/disk2').catch(angular.noop);
$rootScope.$apply();
const flashResults = FlashStateModel.getFlashResults();
m.chai.expect(flashResults.errorCode).to.equal('FOO');
Expand Down