Skip to content

Commit

Permalink
Merge pull request #294 from ThalesGroup/hotfix/SA-validate-function-…
Browse files Browse the repository at this point in the history
…comments

Hotfix/sa validate function comments
  • Loading branch information
Alvin-JohnPagente authored Jun 7, 2024
2 parents 4d828dd + 64cf9ee commit efc9ecf
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion app/src/tabs/Supporting Assets/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,19 @@
let saBARef = field === 'businessAssetRef'? value : sa? sa.businessAssetRef : null
let saName = field === 'supportingAssetName'? value : sa ? sa.supportingAssetName : null

if (!checkBusinessAssetRefArray(saBARef) || (saBARef.length === 0 && !$(`${matrixTable}-${id} select`).length) || saBARef.length !== new Set(saBARef).size || !saName || saName==''){
// The Supporting Asset is invalid when...
if (
// Its Business Asset array is empty or has invalid values
!checkBusinessAssetRefArray(saBARef) ||
// Its select input has no option and Business Asset array is empty
(saBARef.length === 0 && !$(`${matrixTable}-${id} select`).length) ||
// Its Business Asset array contains duplicated values
saBARef.length !== new Set(saBARef).size ||
// Its Name is undefined
!saName ||
// Its Name is empty
saName==''
){
$(`${matrixTable}-${id} td.matrix-sa-id`).css('color', 'red');
$(`${matrixTable}-${id} td.matrix-sa-id`).css('font-weight', 'bold');
$(`${matrixTable}-${id} td.matrix-sa-name`).css('color', 'red');
Expand Down

0 comments on commit efc9ecf

Please sign in to comment.