Conversation
|
Please add one release label: |
Lighthouse Performance ReportMetrics📄Full Report |
04cd37e to
3f98e55
Compare
johnny-hausman
left a comment
There was a problem hiding this comment.
OK, I have made some changes to your plugin code. Let me know if you have any additional questions
AppBuilder/platform/plugins/included/view_detail/FNAbviewdetail.js
Outdated
Show resolved
Hide resolved
AppBuilder/platform/plugins/included/view_detail/FNAbviewdetail.js
Outdated
Show resolved
Hide resolved
7ada954 to
af57c65
Compare
af57c65 to
cfbeaff
Compare
johnny-hausman
left a comment
There was a problem hiding this comment.
These look good!
Have we fixed the display issues you were worried about?
| } | ||
| val = myVal; | ||
| } else { | ||
| const items = (val || []).map((value) => { |
Check warning
Code scanning / CodeQL
Useless conditional Warning
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 15 hours ago
In general, to fix useless conditionals where a variable is always truthy/falsey at a given point, remove the redundant logical operation or rewrite the logic to reflect the true set of possible values. Here, val is already ensured to be a non-empty array when the else branch is executed, because falsy and empty-array cases are caught earlier and converted to "". Thus (val || []) will always evaluate to val, making the || [] part useless. The best fix is to remove the fallback and iterate directly over val.
Concretely, in AppBuilder/platform/plugins/included/view_detail/FNAbviewdetailComponent.js, locate the case "list": handling, in the else block for field.settings.isMultiple !== 0. On line 141, change:
const items = (val || []).map((value) => {to:
const items = val.map((value) => {No additional imports, methods, or definitions are needed; this is a localized change that preserves existing functionality while removing the useless conditional.
| @@ -138,7 +138,7 @@ | ||
| } | ||
| val = myVal; | ||
| } else { | ||
| const items = (val || []).map((value) => { | ||
| const items = val.map((value) => { | ||
| let myVal = ""; | ||
| (field.settings.options || []).forEach((opt) => { | ||
| if (opt.id === value.id) myVal = opt.text; |
There was a problem hiding this comment.
I have changed this line of code to "if (!val || (Array.isArray(val) && val.length === 0))".
56388ab to
ed0d7e2
Compare

migrate Detail Widget as plugin