Skip to content

Commit

Permalink
Merge pull request #31 from monarc-project/feature/353
Browse files Browse the repository at this point in the history
Feature/353
  • Loading branch information
cedricbonhomme authored Sep 2, 2021
2 parents 7b76a71 + 2d131c6 commit e836437
Show file tree
Hide file tree
Showing 14 changed files with 4,322 additions and 3,636 deletions.
718 changes: 392 additions & 326 deletions po/de.po

Large diffs are not rendered by default.

715 changes: 389 additions & 326 deletions po/es.po

Large diffs are not rendered by default.

719 changes: 393 additions & 326 deletions po/fr.po

Large diffs are not rendered by default.

715 changes: 389 additions & 326 deletions po/it.po

Large diffs are not rendered by default.

715 changes: 389 additions & 326 deletions po/ja.po

Large diffs are not rendered by default.

716 changes: 390 additions & 326 deletions po/nl.po

Large diffs are not rendered by default.

715 changes: 389 additions & 326 deletions po/pl.po

Large diffs are not rendered by default.

715 changes: 389 additions & 326 deletions po/pt.po

Large diffs are not rendered by default.

715 changes: 389 additions & 326 deletions po/ru.po

Large diffs are not rendered by default.

741 changes: 390 additions & 351 deletions po/template.pot

Large diffs are not rendered by default.

715 changes: 389 additions & 326 deletions po/zh.po

Large diffs are not rendered by default.

13 changes: 9 additions & 4 deletions src/ClientAccountCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
$scope.user.mospApiKey = data.data['api-key'];
$scope.updateProfile();
}, function(error){
if (error.data.Error == "Account deactivated.") {
if (error.data.Error == "Account is not active.") {
$mdDialog.show(activationMospAccountAlert);
} else{
toastr.error(error.data.Error, gettextCatalog.getString('Error'));
Expand Down Expand Up @@ -118,9 +118,14 @@
}
};

// get cryptographically strong random values for the API key
var byteArray = new Uint32Array(8);
window.crypto.getRandomValues(byteArray);
mospAccount.apikey = byteArray.join('');

$http.post($rootScope.mospApiUrl + 'v2/user/', mospAccount, params)
.then(function(data){
$scope.user.mospApiKey = data.data[0].apikey;
$scope.user.mospApiKey = mospAccount.apikey;
$scope.updateProfile();
toastr.success(gettextCatalog.getString('The MOSP account has been created successfully'), gettextCatalog.getString('Creation successful'));
}, function(error){
Expand Down Expand Up @@ -152,10 +157,10 @@
.then(function (){
promise.resolve(true);
}, function (data){
if (data.data.Error == "Account deactivated.") {
if (data.data.Error == "Account is not active.") {
$mdDialog.show(activationMospAccountAlert);
promise.resolve(true);
} else{
} else {
toastr.error(gettextCatalog.getString('Wrong MOSP API Key. Try again.'), data.data.Error);
promise.resolve(false);
}
Expand Down
44 changes: 24 additions & 20 deletions src/ClientDashboardCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -1406,8 +1406,9 @@
dataTargetCartographyRiskOp = [];

let impacts = cartoCurrent.Impact;
let opRiskimpacts = cartoCurrent.OpRiskImpact;
let likelihoods = cartoCurrent.MxV;
let probabilities = cartoCurrent.Probability;
let probabilities = cartoCurrent.Likelihood;
let countersCurrent = cartoCurrent.riskInfo.counters;
let countersTarget = cartoTarget.riskInfo.counters;
let countersRiskOpCurrent = cartoCurrent.riskOp.counters;
Expand All @@ -1433,26 +1434,29 @@
countersTarget[impact][likelihood] : null
})
});
probabilities.forEach(function(likelihood) {
dataCurrentCartographyRiskOp.push({
y: impact,
x: likelihood,
value: (countersRiskOpCurrent[impact] !== undefined && countersRiskOpCurrent[impact][likelihood] !== undefined) ?
countersRiskOpCurrent[impact][likelihood].length : null,
rolfRisksCurrent: (countersRiskOpCurrent[impact] !== undefined && countersRiskOpCurrent[impact][likelihood] !== undefined) ?
countersRiskOpCurrent[impact][likelihood] : null
})

dataTargetCartographyRiskOp.push({
y: impact,
x: likelihood,
value: (countersRiskOpTarget[impact] !== undefined && countersRiskOpTarget[impact][likelihood] !== undefined) ?
countersRiskOpTarget[impact][likelihood].length : null,
rolfRisksTarget: (countersRiskOpTarget[impact] !== undefined && countersRiskOpTarget[impact][likelihood] !== undefined) ?
countersRiskOpTarget[impact][likelihood] : null
})
});
})

opRiskimpacts.forEach(function(impact) {
probabilities.forEach(function(likelihood) {
dataCurrentCartographyRiskOp.push({
y: impact,
x: likelihood,
value: (countersRiskOpCurrent[impact] !== undefined && countersRiskOpCurrent[impact][likelihood] !== undefined) ?
countersRiskOpCurrent[impact][likelihood].length : null,
rolfRisksCurrent: (countersRiskOpCurrent[impact] !== undefined && countersRiskOpCurrent[impact][likelihood] !== undefined) ?
countersRiskOpCurrent[impact][likelihood] : null
})

dataTargetCartographyRiskOp.push({
y: impact,
x: likelihood,
value: (countersRiskOpTarget[impact] !== undefined && countersRiskOpTarget[impact][likelihood] !== undefined) ?
countersRiskOpTarget[impact][likelihood].length : null,
rolfRisksTarget: (countersRiskOpTarget[impact] !== undefined && countersRiskOpTarget[impact][likelihood] !== undefined) ?
countersRiskOpTarget[impact][likelihood] : null
})
});
});
};

function updateCompliance(referentials, categories, data) {
Expand Down
2 changes: 1 addition & 1 deletion views/passwordforgotten.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<md-input-container flex>
<label translate>New password</label>
<md-icon>vpn_key</md-icon>
<input ng-model="user.password" name="passwordnew" type="password" autocomplete="off" ng-minlength="9" required ng-pattern="/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/">
<input ng-model="user.password" name="passwordnew" type="password" autocomplete="off" ng-minlength="9" ng-pattern="/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[\W_])[A-Za-z\d\W_]{9,}/" required>
<div ng-messages="passwordForm.passwordnew.$error" ng-messages-multiple>
<p ng-message="minlength" translate>Your password is too short (min 9 characters).</p>
<p ng-message="pattern" translate>Your password must contain at least: one uppercase, one number and one special character.</p>
Expand Down

0 comments on commit e836437

Please sign in to comment.