File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import React from 'react';
1717import { PropTypes } from 'prop-types' ;
1818import { connect } from 'react-redux' ;
1919import store from './store' ;
20+ import _ from 'lodash' ;
2021
2122import api from '@stackstorm/module-api' ;
2223import notification from '@stackstorm/module-notification' ;
@@ -270,6 +271,16 @@ export default class ActionsDetails extends React.Component {
270271 this . setState ( { runPreview } ) ;
271272 }
272273
274+ sanitizePreview ( code ) {
275+ return _ . mapValues ( code , ( value , key ) => {
276+ if ( value && this . props . action . parameters [ key ] && this . props . action . parameters [ key ] . secret ) {
277+ return '*' . repeat ( value . length ) ;
278+ }
279+
280+ return value ;
281+ } ) ;
282+ }
283+
273284 handleToggleExecution ( id ) {
274285 this . setState ( {
275286 executionsVisible : {
@@ -477,7 +488,7 @@ export default class ActionsDetails extends React.Component {
477488 </ Link >
478489 ) : null }
479490 </ DetailsToolbar >
480- { this . state . runPreview && < Highlight key = "preview" well data-test = "action_code" code = { this . state . runValue } /> }
491+ { this . state . runPreview && < Highlight key = "preview" well data-test = "action_code" code = { this . sanitizePreview ( this . state . runValue ) } /> }
481492 < DetailsPanel key = "panel" data-test = "action_parameters" >
482493 < DetailsPanelBody >
483494 < form >
You can’t perform that action at this time.
0 commit comments