Notes![what is notes.io? What is notes.io?](/theme/images/whatisnotesio.png)
![]() ![]() Notes - notes.io |
props.CyberRiskCallback(domainData);
setUnAnsweredQuestions(null);
}
const updateUWScore = (riskData, uwScores) => {
let domainData = _.cloneDeep(riskData);
domainData.map((data) => {
var uwScore = uwScores.find(x => x.cyberdomaiN_ID === data.CYBERDOMAIN_ID);
data.RAW_UNDERWRITER_SCORE = uwScore.raW_UNDERWRITER_SCORE.toString();
data.ADJUSTED_UNDERWRITER_SCORE = uwScore.adjusteD_UNDERWRITER_SCORE.toString();
});
onUpdate(domainData);
}
const getCyberDomain = async () => {
var domainData = [];
var includeOT = getArrayFromSectionTitleControlID(props.sections, "Trade", "OT_IN_USE").controlValue;
await ApiService.getCyberDomain(props.pricingVersion, props.revenueSize)
.then((response) => {
if (response.status === 200) {
if ((props.revenueSize === "M" || props.revenueSize === "L") && includeOT === "No") {
domainData = response.data.payLoad.cyberDomainSRM.filter(x => x.cyberdomaiN_NAME !== "OT Security");
} else {
domainData = response.data.payLoad.cyberDomainSRM;
}
domainData.forEach((element) => {
for (var key in element) {
if (element.hasOwnProperty(key)) {
element[key.toUpperCase()] = element[key];
delete element[key];
}
}
});
// copy default values from all
copyAnswer(props.TabledataAll, domainData, false);
if (!riskAssessmentDataMemory) {
// first time
// If first time, store all bands in memory
let allInMemory = _.cloneDeep(riskAssessmentData);
setRiskAssessmentDataMemory(allInMemory);
// copy response from current band to new band
copyAnswer(riskAssessmentData, domainData, false);
}
else {
// copy current band response to memory
copyAnswer(riskAssessmentData, riskAssessmentDataMemory, true);
// copy from previous memory to the latest band
copyAnswer(riskAssessmentDataMemory, domainData, false);
}
}
setRAFScoreData(null);
setRiskAssessmentData(domainData);
onUpdate(domainData);
})
.catch((error) => {
console.log(error);
});
}
const onChangeCheckbox = (domainIndex, questionIndex, optionIndex) => {
let data = _.cloneDeep(riskAssessmentData);
let question = getQuestion(data, domainIndex, questionIndex);
if (question) {
let answer = question.answer;
let containsAnswer = answer?.split(";").some(x => compareIgnoreCase(x, optionIndex));
if (!answer || !containsAnswer) {
// answer is in value1;value2;value3;value4 format and append optionIndex from answer
// if answer is empty then append optionIndex, otherwise add comma in between
answer = answer ? answer + ";" + optionIndex : optionIndex;
} else if (containsAnswer) {
// answer is in value1;value2;value3;alue4 format and remove optionIndex from answer
let splittedAnswer = answer?.split(";");
answer = splittedAnswer?.filter(x => x !== optionIndex).join(";");
answer = answer.replace(";;", ";");
}
// check if answer only contains ;
const regex = /^;$/;
if (regex.test(answer)) {
answer = "";
}
question.answer = answer;
setRiskAssessmentData(data);
onUpdate(data);
}
};
const onChangeRadio = (domainIndex, questionIndex, value) => {
let data = _.cloneDeep(riskAssessmentData);
let question = getQuestion(data, domainIndex, questionIndex);
if (question) {
question.answer = value;
// reset value of nested question when answer is index = 1 ("No")
if (value !== "0" && question.nesteD_QUESTIONS_ANSWERS?.length > 0) {
question.nesteD_QUESTIONS_ANSWERS.forEach(x => x.answer = "");
}
setRiskAssessmentData(data);
onUpdate(data);
}
};
const onChangeText = (domainIndex, questionIndex, value, type) => {
let data = _.cloneDeep(riskAssessmentData);
let storedValue = value;
if (type == 'number') {
storedValue = (value === "" || value.match(/^d+$/)) ? value : null;
}
else if (type == 'percent') {
storedValue = (value === "" || (value.match(/^d+$/) && value <= 100)) ? value : null;
}
let question = getQuestion(data, domainIndex, questionIndex);
if (question && storedValue != null) {
question.answer = storedValue;
setRiskAssessmentData(data);
onUpdate(data);
}
};
ERROR
props.onUpdate is not a function
TypeError: props.onUpdate is not a function
at updateSections (http://localhost:3000/static/js/bundle.js:32932:11)
at handleFormChange (http://localhost:3000/static/js/bundle.js:33384:5)
at children.section.sectionControls.<computed>.controlID.children._section$sectionContr64 (http://localhost:3000/static/js/bundle.js:34093:849)
at _onChange (http://localhost:3000/static/js/bundle.js:539408:7)
at HTMLUnknownElement.callCallback (http://localhost:3000/static/js/bundle.js:285284:18)
at Object.invokeGuardedCallbackDev (http://localhost:3000/static/js/bundle.js:285328:20)
at invokeGuardedCallback (http://localhost:3000/static/js/bundle.js:285376:35)
at invokeGuardedCallbackAndCatchFirstError (http://localhost:3000/static/js/bundle.js:285390:29)
at executeDispatch (http://localhost:3000/static/js/bundle.js:285466:7)
at executeDispatchesInOrder (http://localhost:3000/static/js/bundle.js:285488:9)
const updateSections = (data) => {
props.onUpdate(data);
setSections(data);
};
ERROR
Cannot read properties of undefined (reading 'Option1')
TypeError: Cannot read properties of undefined (reading 'Option1')
at handleFormChange (http://localhost:3000/static/js/bundle.js:33166:203)
at children.children._section$sectionContr79 (http://localhost:3000/static/js/bundle.js:34186:531)
at HTMLUnknownElement.callCallback (http://localhost:3000/static/js/bundle.js:285294:18)
at Object.invokeGuardedCallbackDev (http://localhost:3000/static/js/bundle.js:285338:20)
at invokeGuardedCallback (http://localhost:3000/static/js/bundle.js:285386:35)
at invokeGuardedCallbackAndCatchFirstError (http://localhost:3000/static/js/bundle.js:285400:29)
at executeDispatch (http://localhost:3000/static/js/bundle.js:285476:7)
at executeDispatchesInOrder (http://localhost:3000/static/js/bundle.js:285498:9)
at executeDispatchesAndRelease (http://localhost:3000/static/js/bundle.js:288029:9)
at executeDispatchesAndReleaseTopLevel (http://localhost:3000/static/js/bundle.js:288036:14)
![]() |
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team