Skip to content

Commit 7f5b77c

Browse files
authored
Merge branch 'master' into Delete_Action/Workflow
2 parents 4ba1ac1 + 79c7eba commit 7f5b77c

File tree

10 files changed

+80
-9
lines changed

10 files changed

+80
-9
lines changed

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ then you need to bootstrap the micromodules
3939
$ lerna bootstrap
4040
```
4141

42+
to avoid conflicts on node_modules, delete those generated by lerna:
43+
44+
```shell
45+
$ rm -rf apps/st2-workflows/node_modules/
46+
```
47+
4248
and finally run build system to fetch the font, compile css and so on
4349

4450
```shell

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export default class HistoryDetails extends React.Component {
112112
}
113113

114114
setTitle([ execution.action.ref, 'History' ]);
115-
115+
116116
return (
117117
<PanelDetails data-test="details">
118118
<DetailsHeader

apps/st2-history/history-popup.component.js

+28-1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ export default class HistoryPopup extends React.Component {
4646
payload: {
4747
...props.payload,
4848
},
49+
payloadCopy: {
50+
...props.payload, // Here first made copy of data for later comparison
51+
},
4952
...state,
5053
};
5154
}
@@ -59,8 +62,32 @@ export default class HistoryPopup extends React.Component {
5962
}
6063

6164
handleSubmit(e) {
65+
// 1. Whenever user changes any parameter,it is stored into payload.So we get changed data into payload.
66+
// 2. We have copy of original data without any parameter change in payloadCopy object on line no 49.
67+
// 3. Here we are first identifying key name of secret parameter, payloadKey is key variable name for
68+
// payload object and payloadCopyKey is variable name for payloadCopy object.
69+
// 4. Once we get both key, we are checking value of that key in both object.
70+
// 5. So if user change secret parameter data, it will get in payload.
71+
// 6. When user does not change secret parameter,in payload secret parameter value is *** and in
72+
// payloadCopyKey object it is always *** because we are getting changed value in payload object only.
73+
// 7. If data in both key same, then there is no any change and if data is not same in both key
74+
// i.e payloadKey and payloadCopyKey, data is changed and we will send changed data to API.
6275
e.preventDefault();
63-
76+
const hasValue = Object.values(this.state.payload).includes('********');
77+
let payLoadKey;
78+
if (hasValue === true) {
79+
payLoadKey = Object.keys(this.state.payload).find(key => this.state.payload[key] === '********');
80+
}
81+
82+
const isValue = Object.values(this.state.payloadCopy).includes('********');
83+
let payloadCopyKey ;
84+
if (isValue === true) {
85+
payloadCopyKey = Object.keys(this.state.payloadCopy).find(key => this.state.payloadCopy[key] === '********');
86+
}
87+
88+
if (this.state.payload[payLoadKey] === this.state.payloadCopy[payloadCopyKey]) {
89+
delete this.state.payload[payLoadKey];
90+
}
6491
this.props.onSubmit(this.state.payload);
6592
}
6693

config.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ angular.module('main')
2323
// render and likely freeze the browser window for deeply nested JSON object results.
2424
// Value is in bytes.
2525
// max_execution_result_size_for_render: 200 * 1024,
26-
//
26+
// set application inactivity time default for 2 hr, here it is in seconds.
27+
// application_inactivity_time : 7200,
2728
// Set to true to display StackStorm and st2web version in the header
2829
//show_version_in_header: false;
2930

modules/st2-action-reporter/reporters/run-local.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,17 @@ export default function runLocal(execution) {
2828
execution.result && execution.result.stderr ? [
2929
<div key="error" className={style.source}>Error</div>,
3030
<Highlight well lines={20} className={style.highlight} key="error-code" code={execution.result.stderr} type="result" id={execution.id} />,
31+
] : execution.result && execution.result.error ? [
32+
<div key="error" className={style.source}>Error</div>,
33+
<Highlight well lines={20} className={style.highlight} key="error-code" code={execution.result.error} type="result" id={execution.id} />,
3134
] : null,
3235

3336
execution.result && execution.result.traceback ? [
3437
<div key="traceback" className={style.source}>Traceback</div>,
3538
<Highlight well lines={20} className={style.highlight} key="traceback-code" code={[ execution.result.error, execution.result.traceback ].join('\n')} type="result" id={execution.id} />,
3639
] : null,
3740

38-
!execution.result || (!execution.result.stdout && !execution.result.stderr && !execution.result.traceback) ? (
41+
!execution.result || (!execution.result.stdout && !execution.result.stderr && !execution.result.error && !execution.result.traceback) ? (
3942
<Highlight well className={style.highlight} key="none" code="// Action produced no data" type="result" id={execution.id} />
4043
) : null,
4144
];

modules/st2-action-reporter/reporters/run-python.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,17 @@ export default function runPython(execution) {
3333
execution.result && execution.result.stderr ? [
3434
<div key="error" className={style.source}>Error</div>,
3535
<Highlight well lines={20} className={style.highlight} key="error-code" code={execution.result.stderr} type="result" id={execution.id} />,
36+
] : execution.result && execution.result.error ? [
37+
<div key="error" className={style.source}>Error</div>,
38+
<Highlight well lines={20} className={style.highlight} key="error-code" code={execution.result.error} type="result" id={execution.id} />,
3639
] : null,
3740

3841
execution.result && execution.result.traceback ? [
3942
<div key="traceback" className={style.source}>Traceback</div>,
4043
<Highlight well lines={20} className={style.highlight} key="traceback-code" code={[ execution.result.error, execution.result.traceback ].join('\n')} type="result" id={execution.id} />,
4144
] : null,
4245

43-
!execution.result || (!execution.result.result && !execution.result.stdout && !execution.result.stderr && !execution.result.traceback) ? (
46+
!execution.result || (!execution.result.result && !execution.result.stdout && !execution.result.stderr && !execution.result.error && !execution.result.traceback) ? (
4447
<Highlight well className={style.highlight} key="none" code="// Action produced no data" />
4548
) : null,
4649
].filter(v => v);

modules/st2-action-reporter/reporters/run-remote.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,17 @@ export default function runRemote(execution) {
3939
result && result.stderr ? [
4040
<div key="error" className={style.source}>Error</div>,
4141
<Highlight well lines={20} className={style.highlight} key="error-code" code={result.stderr} type="result" id={execution.id} />,
42+
] :result && result.error ? [
43+
<div key="error" className={style.source}>Error</div>,
44+
<Highlight well lines={20} className={style.highlight} key="error-code" code={result.error} type="result" id={execution.id} />,
4245
] : null,
4346

4447
result && result.traceback ? [
4548
<div key="traceback" className={style.source}>Traceback</div>,
4649
<Highlight well lines={20} className={style.highlight} key="traceback-code" code={[ result.error, result.traceback ].join('\n')} type="result" id={execution.id} />,
4750
] : null,
4851

49-
!result || (!result.result && !result.stderr && !result.stdout && !result.traceback) ? (
52+
!result || (!result.result && !result.stderr && !result.stdout && !result.error && !result.traceback) ? (
5053
<Highlight well className={style.highlight} key="none" code="// Action produced no data" />
5154
) : null,
5255
];

modules/st2-login/login.component.js

+2
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ export default class Login extends React.Component {
219219
placeholder="Username"
220220
required
221221
value={this.state.username}
222+
maxLength="256"
222223
onChange={({ target: { value: username } }) => this.setState({ username })}
223224
/>
224225
</LoginRow>
@@ -230,6 +231,7 @@ export default class Login extends React.Component {
230231
placeholder="Password"
231232
required
232233
value={this.state.password}
234+
maxLength="256"
233235
onChange={({ target: { value: password } }) => this.setState({ password })}
234236
/>
235237
</LoginRow>

modules/st2-menu/menu.component.js

+28-2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import api from '@stackstorm/module-api';
2222
import Link from '@stackstorm/module-router/link.component';
2323

2424
import componentStyle from './style.css';
25+
const APPLICATION_INACTIVITY_TIME = 7200; // 2 hr time here it is in seconds
2526

2627
class Icon extends React.Component {
2728
static propTypes = {
@@ -63,17 +64,42 @@ export default class Menu extends React.Component {
6364
style: componentStyle,
6465
}
6566

66-
componentDidMount() {
67+
componentDidMount () {
68+
this.idleLogout();
6769
window.addEventListener('storage', this.storageChange());
68-
}
6970

71+
}
72+
7073
componentWillUnmount() {
7174
window.removeEventListener('storage',this.storageChange());
7275
}
7376

7477
docsLink = 'https://docs.stackstorm.com/'
7578
supportLink = 'https://forum.stackstorm.com/'
7679

80+
idleLogout() {
81+
let t;
82+
window.onload = resetTimer;
83+
window.onmousemove = resetTimer;
84+
window.onmousedown = resetTimer; // catches touchscreen presses as well
85+
window.ontouchstart = resetTimer; // catches touchscreen swipes as well
86+
window.onclick = resetTimer; // catches touchpad clicks as well
87+
window.onkeydown = resetTimer;
88+
window.addEventListener('scroll', resetTimer, true);
89+
90+
function logoutFunction() {
91+
// your logout code for too long inactivity goes here
92+
api.disconnect();
93+
window.location.reload();
94+
}
95+
96+
function resetTimer() {
97+
window.clearTimeout(t);
98+
const millisecondTime = window.st2constants.st2Config.application_inactivity_time * 1000 || APPLICATION_INACTIVITY_TIME * 1000;
99+
t = window.setTimeout(logoutFunction, millisecondTime); // time is in milliseconds,application will logout after 2 hr. We can set whatever time we want.
100+
}
101+
}
102+
77103
storageChange () {
78104
window.addEventListener('storage', (event) => {
79105
if (event.key === 'logged_in' && (event.oldValue !== event.newValue)) {

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "st2web",
33
"version": "2.4.3",
4-
"st2_version": "3.5dev",
4+
"st2_version": "3.6dev",
55
"private": true,
66
"scripts": {
77
"eslint": "eslint .",

0 commit comments

Comments
 (0)