Skip to content

Commit

Permalink
Merge pull request #353 from manojVivek/feature/chrome-native-inspector
Browse files Browse the repository at this point in the history
Feature/chrome native inspector
  • Loading branch information
esprush authored Jul 26, 2020
2 parents 1b9e6bf + 486d4a7 commit 95f2192
Show file tree
Hide file tree
Showing 41 changed files with 395 additions and 5,206 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ jobs:
with:
repo-token: ${{secrets.GITHUB_TOKEN}}
source-root: desktop-app
env:
NODE_ENV: development
8 changes: 0 additions & 8 deletions desktop-app/app/actions/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import {
NAVIGATION_RELOAD,
SCREENSHOT_ALL_DEVICES,
FLIP_ORIENTATION_ALL_DEVICES,
ENABLE_INSPECTOR_ALL_DEVICES,
DISABLE_INSPECTOR_ALL_DEVICES,
TOGGLE_DEVICE_MUTED_STATE,
RELOAD_CSS,
DELETE_STORAGE,
Expand Down Expand Up @@ -704,12 +702,6 @@ export function toggleInspector() {
browser: {isInspecting},
} = getState();

pubsub.publish(
!isInspecting
? ENABLE_INSPECTOR_ALL_DEVICES
: DISABLE_INSPECTOR_ALL_DEVICES
);

dispatch(newInspectorState(!isInspecting));
};
}
Expand Down
21 changes: 12 additions & 9 deletions desktop-app/app/actions/networkConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,40 @@ import pubsub from 'pubsub.js';
import type {Dispatch, GetState} from '../reducers/types';
import {
SET_NETWORK_TROTTLING_PROFILE,
CLEAR_NETWORK_CACHE
CLEAR_NETWORK_CACHE,
} from '../constants/pubsubEvents';

export const CHANGE_ACTIVE_THROTTLING_PROFILE = 'CHANGE_ACTIVE_THROTTLING_PROFILE';
export const CHANGE_ACTIVE_THROTTLING_PROFILE =
'CHANGE_ACTIVE_THROTTLING_PROFILE';
export const SAVE_THROTTLING_PROFILES = 'SAVE_THROTTLING_PROFILES';

export function changeActiveThrottlingProfile(title='Online') {
export function changeActiveThrottlingProfile(title = 'Online') {
return {
type: CHANGE_ACTIVE_THROTTLING_PROFILE,
title,
type: CHANGE_ACTIVE_THROTTLING_PROFILE,
title,
};
}

export function saveThrottlingProfilesList(profiles) {
return {
type: SAVE_THROTTLING_PROFILES,
profiles,
type: SAVE_THROTTLING_PROFILES,
profiles,
};
}

export function onActiveThrottlingProfileChanged(title) {
return (dispatch: Dispatch, getState: GetState) => {
const {
browser: {networkConfiguration: {throttling}},
browser: {
networkConfiguration: {throttling},
},
} = getState();

const activeProfile = throttling.find(x => x.title === title);

if (activeProfile != null) {
pubsub.publish(SET_NETWORK_TROTTLING_PROFILE, [activeProfile]);
dispatch(changeActiveThrottlingProfile(title))
dispatch(changeActiveThrottlingProfile(title));
}
};
}
Expand Down
2 changes: 1 addition & 1 deletion desktop-app/app/components/ClearNetworkCache/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default function ClearNetworkCache(props) {
return (
<div className={cx(commonStyles.sidebarContentSection)}>
<div className={cx(commonStyles.sidebarContentSectionTitleBar)}>
<CachedIcon style={{marginRight: 5}} /> Network Cache
<CachedIcon style={{marginRight: 5}} /> Network Cache
</div>
<div className={cx(commonStyles.sidebarContentSectionContainer)}>
<Button
Expand Down
7 changes: 4 additions & 3 deletions desktop-app/app/components/LeftIconsPane/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
SCREENSHOT_MANAGER,
USER_PREFERENCES,
EXTENSIONS_MANAGER,
NETWORK_CONFIGURATION
NETWORK_CONFIGURATION,
} from '../../constants/DrawerContents';

const LeftIconsPane = props => {
Expand Down Expand Up @@ -87,12 +87,13 @@ const LeftIconsPane = props => {
item
className={cx(commonStyles.icons, styles.icon, commonStyles.enabled, {
[commonStyles.selected]:
props.drawer.open && props.drawer.content === NETWORK_CONFIGURATION,
props.drawer.open &&
props.drawer.content === NETWORK_CONFIGURATION,
})}
onClick={() => toggleState(NETWORK_CONFIGURATION)}
>
<div>
<NetworkIcon {...iconProps} color='white' className="networkIcon" />
<NetworkIcon {...iconProps} color="white" className="networkIcon" />
</div>
</Grid>
</Grid>
Expand Down
8 changes: 4 additions & 4 deletions desktop-app/app/components/NetworkConfiguration/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import cx from 'classnames';
import ClearNetworkCache from '../ClearNetworkCache'
import NetworkThrottling from '../NetworkThrottling'
import ClearNetworkCache from '../ClearNetworkCache';
import NetworkThrottling from '../NetworkThrottling';

import styles from './styles.css';
import commonStyles from '../common.styles.css';
Expand All @@ -10,12 +10,12 @@ export default function DeviceDrawer({
throttling,
onActiveThrottlingProfileChanged,
onThrottlingProfilesListChanged,
onClearNetworkCache
onClearNetworkCache,
}) {
return (
<div>
<ClearNetworkCache onClearNetworkCache={onClearNetworkCache} />
<NetworkThrottling
<NetworkThrottling
throttling={throttling}
onActiveThrottlingProfileChanged={onActiveThrottlingProfileChanged}
onThrottlingProfilesListChanged={onThrottlingProfilesListChanged}
Expand Down
Loading

0 comments on commit 95f2192

Please sign in to comment.