summaryrefslogtreecommitdiffstats
path: root/runtime/ui-react/src/utils/OnapUtils.js
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2021-11-09 15:22:22 +0000
committerliamfallon <liam.fallon@est.tech>2021-11-10 08:57:23 +0000
commit2022e5ce5a03788a6edc5761c495cfadc5ded485 (patch)
tree2df93f088fb323440945ce93ce67be1f2208c9bf /runtime/ui-react/src/utils/OnapUtils.js
parent579085240812aa593ebafe787d97868e16fc3318 (diff)
Align ui-react file in policy-clamp and policy-gui
When the ui-react code was transferred to policy-gui, the white space was cleaned up and reformatted. This makes it difficult to track the real functional changes if any between ui-react in policy-clamp and policy-gui. This review brings the white space changes into ui-react in policy-clamp to make file comparisons easier. Issue-ID: POLICY-3358 Change-Id: Ic303e71b341e5c0f7ca0de0ed4c4962ebf2f988a Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'runtime/ui-react/src/utils/OnapUtils.js')
-rw-r--r--runtime/ui-react/src/utils/OnapUtils.js64
1 files changed, 32 insertions, 32 deletions
diff --git a/runtime/ui-react/src/utils/OnapUtils.js b/runtime/ui-react/src/utils/OnapUtils.js
index 316a0d65f..9ba938240 100644
--- a/runtime/ui-react/src/utils/OnapUtils.js
+++ b/runtime/ui-react/src/utils/OnapUtils.js
@@ -23,43 +23,43 @@
export default class OnapUtils {
- constructor() {
- this.clickBlocked = false;
- }
+ constructor() {
+ this.clickBlocked = false;
+ }
- static jsonEditorErrorFormatter(errors) {
+ static jsonEditorErrorFormatter(errors) {
- let messages = [];
- let messagesOutputString = null;
+ let messages = [];
+ let messagesOutputString = null;
- // errors is an array of JSON Editor "error" objects, where each
- // object looks like this:
+ // errors is an array of JSON Editor "error" objects, where each
+ // object looks like this:
- // {
- // message: "Please populate the required property "Threshold""
- // path: "root.signatures.0"
- // property: "required"
- // }
+ // {
+ // message: "Please populate the required property "Threshold""
+ // path: "root.signatures.0"
+ // property: "required"
+ // }
- // In this function we concatenate all the messages, removing any duplicates,
- // and adding a newline between each message. The result returned is a single
- // string that can be displayed to the user in an alert message
+ // In this function we concatenate all the messages, removing any duplicates,
+ // and adding a newline between each message. The result returned is a single
+ // string that can be displayed to the user in an alert message
- if (!Array.isArray(errors)) {
- console.error('jsoneEditorErrorFormatter was passed a non-array argument');
- } else {
- for (let ii=0; ii < errors.length; ++ii) {
- if (!messages.includes(errors[ii].message)) {
- messages.push(errors[ii].message);
- if (messagesOutputString) {
- messagesOutputString += '\n' + errors[ii].message;
- } else {
- messagesOutputString = errors[ii].message;
- }
- }
- }
- }
+ if (!Array.isArray(errors)) {
+ console.error('jsoneEditorErrorFormatter was passed a non-array argument');
+ } else {
+ for (let ii = 0; ii < errors.length; ++ii) {
+ if (!messages.includes(errors[ii].message)) {
+ messages.push(errors[ii].message);
+ if (messagesOutputString) {
+ messagesOutputString += '\n' + errors[ii].message;
+ } else {
+ messagesOutputString = errors[ii].message;
+ }
+ }
+ }
+ }
- return messagesOutputString;
- }
+ return messagesOutputString;
+ }
}