Skip to content

Commit

Permalink
Fixes #36136 - handle the case where Ansible variable is an array
Browse files Browse the repository at this point in the history
(cherry picked from commit cea1eca)
  • Loading branch information
nofaralfasi committed Aug 7, 2023
1 parent 25886c6 commit 4593de7
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@ import { sprintf, translate as __ } from 'foremanReact/common/I18n';

import { showToast } from '../../../../toastHelper';

const formatSourceLink = currentValue =>
`${__(currentValue.element)}: ${currentValue.elementName}`;
function formatSourceLink(currentValue) {
const element =
typeof currentValue.element !== 'string'
? currentValue.element.toString()
: currentValue.element;
return `${__(element)}: ${currentValue.elementName}`;
}

export const formatSourceAttr = variable =>
variable.currentValue
Expand Down

0 comments on commit 4593de7

Please sign in to comment.