Skip to content

Commit 8f77a66

Browse files
committed
making sanitized objects and arrays look like objects and arrays
1 parent 0c1a30c commit 8f77a66

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

apps/st2-actions/actions-details.component.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,14 @@ export default class ActionsDetails extends React.Component {
274274
sanitizePreview(code) {
275275
return _.mapValues(code, (value, key) => {
276276
if (value && this.props.action.parameters[key] && this.props.action.parameters[key].secret) {
277-
return '*'.repeat(value.length);
277+
switch (this.props.action.parameters[key].type) {
278+
case "object":
279+
return `{${'*'.repeat(Math.max(0, JSON.stringify(value).length -2))}}`;
280+
case "array":
281+
return `[${'*'.repeat(Math.max(0, JSON.stringify(value).length -2))}]`;
282+
default:
283+
return '*'.repeat(value.length);
284+
}
278285
}
279286

280287
return value;

0 commit comments

Comments
 (0)