-
Notifications
You must be signed in to change notification settings - Fork 253
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(assets): add controller stub for the asset issuance form
- Loading branch information
1 parent
16abbc6
commit 8e6cc03
Showing
7 changed files
with
121 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
(function () { | ||
'use strict'; | ||
|
||
var ASSET_DESCRIPTION_MAX = 1000; | ||
var ASSET_NAME_MIN = 4; | ||
var ASSET_NAME_MAX = 16; | ||
var TOKEN_DECIMALS_MAX = 8; | ||
|
||
angular | ||
.module('app.tokens') | ||
.controller('tokenCreateController', ['$scope', 'constants.ui', 'dialogService', function ($scope, constants, dialogService) { | ||
var transaction; | ||
var ctrl = this; | ||
|
||
ctrl.issuanceValidationOptions = { | ||
rules: { | ||
assetName: { | ||
required: true, | ||
minlength: ASSET_NAME_MIN, | ||
maxlength: ASSET_NAME_MAX | ||
}, | ||
assetDescription: { | ||
maxlength: ASSET_DESCRIPTION_MAX | ||
}, | ||
assetTotalTokens: { | ||
required: true, | ||
min: 0, | ||
max: constants.JAVA_MAX_LONG | ||
}, | ||
assetTokenDecimalPlaces: { | ||
required: true, | ||
min: 0, | ||
max: TOKEN_DECIMALS_MAX | ||
} | ||
}, | ||
messages: { | ||
assetName: { | ||
required: 'Asset name is required', | ||
minlength: 'Asset name minimum length must be ' + ASSET_NAME_MIN + ' characters', | ||
maxlength: 'Asset name maximum length must be ' + ASSET_NAME_MAX + ' characters' | ||
}, | ||
assetDescription: { | ||
maxlength: 'Maximum length of asset description must be less than ' + ASSET_DESCRIPTION_MAX + | ||
' characters' | ||
}, | ||
assetTotalTokens: { | ||
required: 'Total amount of issued tokens in required', | ||
min: 'Total issued tokens amount must be greater than or equal to zero', | ||
max: 'Total issued tokens amount must be less than ' + constants.JAVA_MAX_LONG | ||
}, | ||
assetTokenDecimalPlaces: { | ||
required: 'Number of token decimal places is required', | ||
min: 'Number of token decimal places must be greater or equal to zero', | ||
max: 'Number of token decimal places must be less than or equal to ' + TOKEN_DECIMALS_MAX | ||
} | ||
} | ||
}; | ||
ctrl.confirm = { | ||
pendingIssuance: false | ||
}; | ||
ctrl.broadcastIssueTransaction = broadcastIssueTransaction; | ||
ctrl.assetIssueConfirmation = assetIssueConfirmation; | ||
|
||
function assetIssueConfirmation(form) { | ||
if (!form.validate()) | ||
return; | ||
|
||
//to the stuff | ||
dialogService.open('#create-asset-confirmation'); | ||
} | ||
|
||
function broadcastIssueTransaction() { | ||
console.log('broadcast'); | ||
} | ||
}]); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
(function() { | ||
'use strict'; | ||
|
||
angular.module('app.tokens', ['app.shared']); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters