Skip to content

Commit

Permalink
🐛 [#5087] Fix backendOptions not available error in registration vari…
Browse files Browse the repository at this point in the history
…ables table of JSON dump plugin

If the JSON dump plugin was not completely initialized yet (selected but not saved), and the user navigated to the registration variables of the variables table, the backend options would be an empty object, causing a crash.
  • Loading branch information
viktorvanwijk committed Feb 7, 2025
1 parent ff218d6 commit 1ab81fd
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ import {FormattedMessage} from 'react-intl';
import {IconNo, IconYes} from 'components/admin/BooleanIcons';

const JSONDumpSummaryHandler = ({variable, backendOptions}) => {
const isIncludedInVariables = backendOptions.variables.includes(variable.key);
const isIncludedInVariables = backendOptions.variables?.includes(variable.key);
// TODO-5087: is it OK to get the fixed variables from the backend options, or better to always
// use the API for it?
const isIncludedInMetadata =
backendOptions.fixedMetadataVariables.includes(variable.key) ||
backendOptions.additionalMetadataVariables.includes(variable.key);
backendOptions.fixedMetadataVariables?.includes(variable.key) ||
backendOptions.additionalMetadataVariables?.includes(variable.key);

return (
<>
Expand Down

0 comments on commit 1ab81fd

Please sign in to comment.