Merge pull request #3701 from oleggator/json-stable-stringify

scripts: replace JSON.stringify with json-stable-stringify
This commit is contained in:
Filip Barl
2019-10-07 17:12:57 +02:00
committed by GitHub
8 changed files with 16 additions and 8 deletions

View File

@@ -1,6 +1,7 @@
import React from 'react';
import moment from 'moment';
import { connect } from 'react-redux';
import stableStringify from 'json-stable-stringify';
import NodeDetailsHealthItem from './node-details-health-item';
import CloudLink from '../cloud-link';
@@ -30,7 +31,7 @@ export function appendTime(url, time) {
return url;
}
return `${url.substr(0, pos + cloudLinkPathEnd.length)}${encodeURIComponent(JSON.stringify(payload) || '')}`;
return `${url.substr(0, pos + cloudLinkPathEnd.length)}${encodeURIComponent(stableStringify(payload) || '')}`;
}
if (url.indexOf('?') !== -1) {

View File

@@ -6,6 +6,7 @@ import classNames from 'classnames';
import { debounce } from 'lodash';
import { Terminal as Term } from 'xterm';
import * as fit from 'xterm/lib/addons/fit/fit';
import stableStringify from 'json-stable-stringify';
import { closeTerminal } from '../actions/app-actions';
import { getPipeStatus } from '../actions/request-actions';
@@ -230,7 +231,7 @@ class Terminal extends React.Component {
handlePopoutTerminal(ev) {
ev.preventDefault();
const paramString = JSON.stringify(this.props);
const paramString = stableStringify(this.props);
this.props.dispatch(closeTerminal(this.getPipeId()));
this.setState({detached: true});

View File

@@ -3,6 +3,7 @@ import classNames from 'classnames';
import { connect } from 'react-redux';
import { clamp, debounce, pick } from 'lodash';
import { fromJS } from 'immutable';
import stableStringify from 'json-stable-stringify';
import { drag } from 'd3-drag';
import { event as d3Event, select } from 'd3-selection';
@@ -275,7 +276,7 @@ function mapStateToProps(state, props) {
canvasMargins: canvasMarginsSelector(state),
forceRelayout: state.get('forceRelayout'),
height: canvasHeightSelector(state),
layoutId: JSON.stringify(activeTopologyZoomCacheKeyPathSelector(state)),
layoutId: stableStringify(activeTopologyZoomCacheKeyPathSelector(state)),
layoutLimits: props.limitsSelector(state),
layoutZoomState: props.zoomStateSelector(state),
width: canvasWidthSelector(state),