Skip to content
This repository has been archived by the owner on Apr 15, 2019. It is now read-only.

Commit

Permalink
Merge branch 'development' into 367-load-more-in-forging
Browse files Browse the repository at this point in the history
  • Loading branch information
reyraa authored Jun 9, 2017
2 parents c6a77fb + 4db48b8 commit 0516a1b
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 117 deletions.
9 changes: 6 additions & 3 deletions src/components/delegateRegistration/delegateRegistration.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ import './delegateRegistration.less';
*/
app.component('delegateRegistration', {
template: require('./delegateRegistration.pug')(),
controller($scope, $mdDialog, delegateApi, Account, dialog, $rootScope) {
bindings: {
closeDialog: '&',
},
controller($scope, delegateApi, Account, dialog, $rootScope) {
function checkPendingRegistration() {
delegateApi.getDelegate({
username: $scope.username,
Expand Down Expand Up @@ -42,7 +45,7 @@ app.component('delegateRegistration', {
checkPendingRegistration();
});
$scope.reset(form);
$mdDialog.hide();
this.closeDialog();
});
})
.catch((error) => {
Expand Down Expand Up @@ -74,7 +77,7 @@ app.component('delegateRegistration', {
*/
$scope.cancel = (form) => {
$scope.reset(form);
// $mdDialog.hide();
this.closeDialog();
};
},
});
32 changes: 7 additions & 25 deletions src/components/delegates/delegates.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,14 @@ app.component('delegates', {
* @constructor
*/
controller: class delegates {
constructor($scope, $rootScope, Peers, $mdDialog, $mdMedia,
dialog, $timeout, delegateApi, Account) {
constructor($scope, $rootScope, Peers, dialog, $mdMedia,
$timeout, delegateApi, Account) {
this.$scope = $scope;
this.$rootScope = $rootScope;
this.peers = Peers;
this.delegateApi = delegateApi;
this.$mdDialog = $mdDialog;
this.$mdMedia = $mdMedia;
this.dialog = dialog;
this.$mdMedia = $mdMedia;
this.$timeout = $timeout;
this.account = Account;

Expand Down Expand Up @@ -339,31 +338,14 @@ app.component('delegates', {
}

/**
* Uses mdDialog to show vote list directive.
* Uses dialog.modal to show vote list directive.
*
* @method openVoteDialog
* @todo Use a general dialog service instead.
*/
openVoteDialog() {
this.$mdDialog.show({
controllerAs: '$ctrl',
controller: class voteDialog {
constructor($scope, voteList, unvoteList) {
this.$scope = $scope;
this.$scope.voteList = voteList;
this.$scope.unvoteList = unvoteList;
}
},
template:
'<md-dialog flex="80">' +
'<vote vote-list="voteList" unvote-list="unvoteList">' +
'</vote>' +
'</md-dialog>',
fullscreen: (this.$mdMedia('sm') || this.$mdMedia('xs')) && this.$scope.customFullscreen,
locals: {
voteList: this.voteList,
unvoteList: this.unvoteList,
},
this.dialog.modal('vote', {
'vote-list': this.voteList,
'unvote-list': this.unvoteList,
}).then((() => {
this.setPendingVotes();
}));
Expand Down
3 changes: 1 addition & 2 deletions src/components/header/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ app.component('header', {
* @constructor
*/
controller: class header {
constructor($rootScope, Account, signVerify) {
constructor($rootScope, Account) {
this.$rootScope = $rootScope;
this.account = Account;
this.signVerify = signVerify;
}
},
});
Expand Down
4 changes: 2 additions & 2 deletions src/components/header/header.pug
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ md-content.header(layout='row', layout-align='center center', layout-padding)
div(layout='row', flex='')
p(flex='') Register as delegate
md-menu-item
md-button.sign-message(ng-click='$ctrl.signVerify.openSignMessageDialog()')
md-button.sign-message(data-open-dialog='sign-message')
div(layout='row', flex='')
p(flex='') Sign message
md-menu-item
md-button.verify-message(ng-click='$ctrl.signVerify.openVerifyMessageDialog()')
md-button.verify-message(data-open-dialog='verify-message')
div(layout='row', flex='')
p(flex='') Verify message
1 change: 0 additions & 1 deletion src/liskNano.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import './services/api/forgingApi';
import './services/api/peers';
import './services/dialog';
import './services/lsk';
import './services/signVerify';
import './services/sync';
import './services/notification';

Expand Down
5 changes: 3 additions & 2 deletions src/services/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @module app
* @submodule dialog
*/
app.factory('dialog', ($mdDialog, $mdToast) => ({
app.factory('dialog', ($mdDialog, $mdToast, $mdMedia) => ({

/**
* Uses mdToast to show a toast with error theme
Expand Down Expand Up @@ -114,13 +114,14 @@ app.factory('dialog', ($mdDialog, $mdToast) => ({
return $mdDialog.show({
parent: angular.element(document.body),
template: `
<md-dialog flex="80" >
<md-dialog flex-gt-sm="75" flex="95" >
<${component} ${attrs} close-dialog="closeDialog()" ></${component}>
</md-dialog>
`,
locals: {
option: options,
},
fullscreen: $mdMedia('xs'),
controller: modalController,
});
},
Expand Down
36 changes: 0 additions & 36 deletions src/services/signVerify.js

This file was deleted.

2 changes: 1 addition & 1 deletion test/components/delegates/delegates.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ describe('delegates component controller', () => {

describe('openVoteDialog()', () => {
it('opens vote dialog', () => {
const spy = sinon.spy(controller.$mdDialog, 'show');
const spy = sinon.spy(controller.dialog, 'modal');
controller.openVoteDialog();
expect(spy).to.have.been.calledWith();
});
Expand Down
44 changes: 0 additions & 44 deletions test/services/signVerify.spec.js

This file was deleted.

1 change: 0 additions & 1 deletion test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ require('./services/api/forgingApi.spec');
require('./services/api/peers.spec');
require('./services/lsk.spec');
require('./services/passphrase.spec');
require('./services/signVerify.spec');
require('./services/notification.spec');

require('./run.spec');
Expand Down

0 comments on commit 0516a1b

Please sign in to comment.