Backed out changeset 661f27f91e1e (bug 1434885) for ESlint failure on MonitorPanel.js. CLOSED TREE

This commit is contained in:
Brindusan Cristian 2018-03-08 15:03:20 +02:00
Родитель 8a03829a53
Коммит a6b9d1aa67
6 изменённых файлов: 1 добавлений и 59 удалений

Просмотреть файл

@ -7,7 +7,6 @@
const {
ACTIVITY_TYPE,
OPEN_NETWORK_DETAILS,
RESIZE_NETWORK_DETAILS,
ENABLE_PERSISTENT_LOGS,
DISABLE_BROWSER_CACHE,
OPEN_STATISTICS,
@ -29,20 +28,6 @@ function openNetworkDetails(open) {
};
}
/**
* Change network details panel size.
*
* @param {integer} width
* @param {integer} height
*/
function resizeNetworkDetails(width, height) {
return {
type: RESIZE_NETWORK_DETAILS,
width,
height,
};
}
/**
* Change persistent logs state.
*
@ -161,7 +146,6 @@ function toggleStatistics(connector) {
module.exports = {
openNetworkDetails,
resizeNetworkDetails,
enablePersistentLogs,
disableBrowserCache,
openStatistics,

Просмотреть файл

@ -65,6 +65,7 @@
.requests-list-contents {
display: table-row-group;
position: absolute;
width: 100%;
overflow-x: hidden;
overflow-y: auto;
--timings-scale: 1;

Просмотреть файл

@ -40,7 +40,6 @@ class MonitorPanel extends Component {
isEmpty: PropTypes.bool.isRequired,
networkDetailsOpen: PropTypes.bool.isRequired,
openNetworkDetails: PropTypes.func.isRequired,
onNetworkDetailsResize: PropTypes.func.isRequired,
request: PropTypes.object,
selectedRequestVisible: PropTypes.bool.isRequired,
sourceMapService: PropTypes.object,
@ -57,7 +56,6 @@ class MonitorPanel extends Component {
};
this.onLayoutChange = this.onLayoutChange.bind(this);
this.onNetworkDetailsResized = this.onNetworkDetailsResized.bind(this);
}
componentDidMount() {
@ -96,16 +94,6 @@ class MonitorPanel extends Component {
});
}
onNetworkDetailsResized(width, height) {
// Cleaning width and height parameters, because SplitBox passes ALWAYS two values,
// while depending on orientation ONLY ONE dimension is managed by it at a time.
let { isVerticalSpliter } = this.state;
return this.props.onNetworkDetailsResized(
isVerticalSpliter ? width : null,
isVerticalSpliter ? null : height
)
}
render() {
let {
connector,
@ -140,7 +128,6 @@ class MonitorPanel extends Component {
endPanelCollapsed: !networkDetailsOpen,
endPanelControl: true,
vert: this.state.isVerticalSpliter,
onControlledPanelResized: this.onNetworkDetailsResized,
}),
)
);
@ -156,9 +143,6 @@ module.exports = connect(
}),
(dispatch) => ({
openNetworkDetails: (open) => dispatch(Actions.openNetworkDetails(open)),
onNetworkDetailsResized: (width, height) => dispatch(
Actions.resizeNetworkDetails(width, height)
),
updateRequest: (id, data, batch) => dispatch(Actions.updateRequest(id, data, batch)),
}),
)(MonitorPanel);

Просмотреть файл

@ -50,9 +50,6 @@ class RequestListContent extends Component {
return {
connector: PropTypes.object.isRequired,
columns: PropTypes.object.isRequired,
networkDetailsOpen: PropTypes.bool.isRequired,
networkDetailsWidth: PropTypes.number.isRequired,
networkDetailsHeight: PropTypes.number.isRequired,
cloneSelectedRequest: PropTypes.func.isRequired,
displayedRequests: PropTypes.array.isRequired,
firstRequestStartedMillis: PropTypes.number.isRequired,
@ -117,12 +114,6 @@ class RequestListContent extends Component {
// Using maximum scroll height rather than node.scrollHeight to avoid sync reflow.
node.scrollTop = MAX_SCROLL_HEIGHT;
}
if (prevProps.networkDetailsOpen !== this.props.networkDetailsOpen ||
prevProps.networkDetailsWidth !== this.props.networkDetailsWidth ||
prevProps.networkDetailsHeight !== this.props.networkDetailsHeight
) {
this.onResize();
}
}
componentWillUnmount() {
@ -135,7 +126,6 @@ class RequestListContent extends Component {
onResize() {
let parent = this.refs.contentEl.parentNode;
this.refs.contentEl.style.width = parent.offsetWidth + "px";
this.refs.contentEl.style.height = parent.offsetHeight + "px";
}
@ -310,9 +300,6 @@ class RequestListContent extends Component {
module.exports = connect(
(state) => ({
columns: state.ui.columns,
networkDetailsOpen: state.ui.networkDetailsOpen,
networkDetailsWidth: state.ui.networkDetailsWidth,
networkDetailsHeight: state.ui.networkDetailsHeight,
displayedRequests: getDisplayedRequests(state),
firstRequestStartedMillis: state.requests.firstStartedMillis,
selectedRequest: getSelectedRequest(state),

Просмотреть файл

@ -14,7 +14,6 @@ const actionTypes = {
CLONE_SELECTED_REQUEST: "CLONE_SELECTED_REQUEST",
ENABLE_REQUEST_FILTER_TYPE_ONLY: "ENABLE_REQUEST_FILTER_TYPE_ONLY",
OPEN_NETWORK_DETAILS: "OPEN_NETWORK_DETAILS",
RESIZE_NETWORK_DETAILS: "RESIZE_NETWORK_DETAILS",
ENABLE_PERSISTENT_LOGS: "ENABLE_PERSISTENT_LOGS",
DISABLE_BROWSER_CACHE: "DISABLE_BROWSER_CACHE",
OPEN_STATISTICS: "OPEN_STATISTICS",

Просмотреть файл

@ -8,7 +8,6 @@ const Services = require("Services");
const {
CLEAR_REQUESTS,
OPEN_NETWORK_DETAILS,
RESIZE_NETWORK_DETAILS,
ENABLE_PERSISTENT_LOGS,
DISABLE_BROWSER_CACHE,
OPEN_STATISTICS,
@ -56,8 +55,6 @@ function UI(initialState = {}) {
columns: Columns(),
detailsPanelSelectedTab: PANELS.HEADERS,
networkDetailsOpen: false,
networkDetailsWidth: null,
networkDetailsHeight: null,
persistentLogsEnabled: Services.prefs.getBoolPref("devtools.netmonitor.persistlog"),
browserCacheDisabled: Services.prefs.getBoolPref("devtools.cache.disabled"),
statisticsOpen: false,
@ -87,14 +84,6 @@ function openNetworkDetails(state, action) {
};
}
function resizeNetworkDetails(state, action) {
return {
...state,
networkDetailsWidth: action.width,
networkDetailsHeight: action.height,
};
}
function enablePersistentLogs(state, action) {
return {
...state,
@ -145,8 +134,6 @@ function ui(state = UI(), action) {
return openNetworkDetails(state, { open: false });
case OPEN_NETWORK_DETAILS:
return openNetworkDetails(state, action);
case RESIZE_NETWORK_DETAILS:
return resizeNetworkDetails(state, action);
case ENABLE_PERSISTENT_LOGS:
return enablePersistentLogs(state, action);
case DISABLE_BROWSER_CACHE: