Run prettier fix

Summary: Should also fix the build.

Reviewed By: jknoxville

Differential Revision: D14477777

fbshipit-source-id: 01fcfb2321c9b7a12acdf079473d91b6805d4dda
This commit is contained in:
Pascal Hartig
2019-03-15 05:09:43 -07:00
committed by Facebook Github Bot
parent b354a82066
commit 3141b954bf
16 changed files with 97 additions and 103 deletions

View File

@@ -94,11 +94,10 @@ export function setupMenuBar(
plugin.keyboardActions || [],
)
.reduce((acc: KeyboardActions, cv) => acc.concat(cv), [])
.map(
(action: DefaultKeyboardAction | KeyboardAction) =>
typeof action === 'string'
? defaultKeyboardActions.find(a => a.action === action)
: action,
.map((action: DefaultKeyboardAction | KeyboardAction) =>
typeof action === 'string'
? defaultKeyboardActions.find(a => a.action === action)
: action,
),
);

View File

@@ -600,26 +600,24 @@ class NotificationItem extends Component<ItemProps, ItemState> {
</Actions>
)}
</NotificationContent>
{action &&
!inactive &&
!isSelected && (
<FlexColumn style={{alignSelf: 'center'}}>
{action && (
<NotificationButton compact onClick={this.openDeeplink}>
Open
</NotificationButton>
)}
{this.state.reportedNotHelpful ? (
<NotificationButton compact onClick={this.onHide}>
Hide
</NotificationButton>
) : (
<NotificationButton compact onClick={this.reportNotUseful}>
Not helpful
</NotificationButton>
)}
</FlexColumn>
)}
{action && !inactive && !isSelected && (
<FlexColumn style={{alignSelf: 'center'}}>
{action && (
<NotificationButton compact onClick={this.openDeeplink}>
Open
</NotificationButton>
)}
{this.state.reportedNotHelpful ? (
<NotificationButton compact onClick={this.onHide}>
Hide
</NotificationButton>
) : (
<NotificationButton compact onClick={this.reportNotUseful}>
Not helpful
</NotificationButton>
)}
</FlexColumn>
)}
</ContextMenu>
);
}

View File

@@ -35,38 +35,34 @@ beforeAll(() => {
return server.init();
});
test(
'Device can connect successfully',
done => {
var testFinished = false;
var disconnectedTooEarly = false;
const registeredClients = [];
server.addListener('new-client', (client: Client) => {
// Check there is a connected device that has the same device_id as the new client
const deviceId = client.query.device_id;
expect(deviceId).toBeTruthy();
const devices = store.getState().connections.devices;
expect(devices.map(device => device.serial)).toContain(deviceId);
test('Device can connect successfully', done => {
var testFinished = false;
var disconnectedTooEarly = false;
const registeredClients = [];
server.addListener('new-client', (client: Client) => {
// Check there is a connected device that has the same device_id as the new client
const deviceId = client.query.device_id;
expect(deviceId).toBeTruthy();
const devices = store.getState().connections.devices;
expect(devices.map(device => device.serial)).toContain(deviceId);
// Make sure it only connects once
registeredClients.push(client);
expect(registeredClients).toHaveLength(1);
// Make sure it only connects once
registeredClients.push(client);
expect(registeredClients).toHaveLength(1);
// Make sure client stays connected for some time before passing test
setTimeout(() => {
testFinished = true;
expect(disconnectedTooEarly).toBe(false);
done();
}, 5000);
});
server.addListener('removed-client', (id: string) => {
if (!testFinished) {
disconnectedTooEarly = true;
}
});
},
20000,
);
// Make sure client stays connected for some time before passing test
setTimeout(() => {
testFinished = true;
expect(disconnectedTooEarly).toBe(false);
done();
}, 5000);
});
server.addListener('removed-client', (id: string) => {
if (!testFinished) {
disconnectedTooEarly = true;
}
});
}, 20000);
afterAll(() => {
return server.close();

View File

@@ -260,7 +260,8 @@ class BugReporterDialog extends Component<Props, State> {
'mailto:' + String(this.props.activePlugin?.bugs?.email)
}>
{this.props.activePlugin?.bugs?.email}
</Link>, the author/oncall of this plugin, directly
</Link>
, the author/oncall of this plugin, directly
</span>
)}
.

View File

@@ -257,7 +257,8 @@ class PluginDebugger extends Component<Props> {
known to have problems connecting to Flipper. Check out the{' '}
<Link href="https://fbflipper.com/docs/troubleshooting.html#known-incompatibilities">
known incompatibilities
</Link>.
</Link>
.
</InfoText>
);
} else if (
@@ -287,7 +288,8 @@ class PluginDebugger extends Component<Props> {
check out our documentation about{' '}
<Link href="https://fbflipper.com/docs/troubleshooting.html#connection-issues">
connection issues
</Link>.
</Link>
.
</InfoText>
</Fragment>
);

View File

@@ -88,7 +88,8 @@ class TitleBar extends Component<Props> {
<ScreenCaptureButtons />
{this.props.downloadingImportData && (
<Importing>
<LoadingIndicator size={16} />&nbsp;Importing data...
<LoadingIndicator size={16} />
&nbsp;Importing data...
</Importing>
)}
<Spacer />

View File

@@ -90,9 +90,7 @@ export default (store: Store, logger: Logger) => {
if (err.message === 'Connection closed') {
// adb server has shutdown, remove all android devices
const {connections} = store.getState();
const deviceIDsToRemove: Array<
string,
> = connections.devices
const deviceIDsToRemove: Array<string> = connections.devices
.filter(
(device: BaseDevice) => device instanceof AndroidDevice,
)

View File

@@ -405,10 +405,9 @@ class ImageItem extends PureComponent<{
return (
<ImageItem.Container onClick={this.onClick} size={size}>
{numberOfRequests > 0 &&
image != null && (
<ImageItem.Events>{numberOfRequests}</ImageItem.Events>
)}
{numberOfRequests > 0 && image != null && (
<ImageItem.Events>{numberOfRequests}</ImageItem.Events>
)}
{image != null ? (
<ImageItem.Image src={image.data} />
) : (

View File

@@ -36,7 +36,9 @@ export default class ImagesSidebar extends Component<
return (
<div>
{this.renderUri()}
{this.props.events.map(e => <EventDetails key={e.eventId} event={e} />)}
{this.props.events.map(e => (
<EventDetails key={e.eventId} event={e} />
))}
</div>
);
}

View File

@@ -1183,24 +1183,23 @@ class Layout extends FlipperPlugin<InspectorState> {
<LayoutSearchInput onSubmit={this.search.bind(this)} />
{outstandingSearchQuery && <LoadingSpinner size={16} />}
</SearchBox>
{inAXMode &&
showLithoAccessibilitySettings && (
<SearchIconContainer
onClick={this.onOpenAccessibilitySettings}
role="button">
<Glyph
name="settings"
size={16}
color={
accessibilitySettingsOpen
? colors.macOSTitleBarIconSelected
: colors.macOSTitleBarIconActive
}
/>
{accessibilitySettingsOpen &&
this.getAccessibilitySettingsPopover(forceLithoAXRender)}
</SearchIconContainer>
)}
{inAXMode && showLithoAccessibilitySettings && (
<SearchIconContainer
onClick={this.onOpenAccessibilitySettings}
role="button">
<Glyph
name="settings"
size={16}
color={
accessibilitySettingsOpen
? colors.macOSTitleBarIconSelected
: colors.macOSTitleBarIconActive
}
/>
{accessibilitySettingsOpen &&
this.getAccessibilitySettingsPopover(forceLithoAXRender)}
</SearchIconContainer>
)}
</Toolbar>
<FlexRow grow={true}>
{initialised ? (

View File

@@ -247,12 +247,14 @@ export default class Layout extends FlipperPlugin<State, void, PersistedState> {
)}
{/* TODO: Remove this when rolling out publicly */}
<BetaBar position="bottom" compact>
<Glyph name="beta" color="#8157C7" />&nbsp;
<Glyph name="beta" color="#8157C7" />
&nbsp;
<strong>Version 2.0:</strong>&nbsp; Provide feedback about this plugin
in our&nbsp;
<Link href="https://fb.workplace.com/groups/246035322947653/">
feedback group
</Link>.
</Link>
.
</BetaBar>
</FlexColumn>
);

View File

@@ -314,11 +314,10 @@ export default function reducer(
return {
...state,
uninitializedClients: state.uninitializedClients
.map(
c =>
isEqual(c.client, payload.client)
? {...c, deviceId: payload.deviceId}
: c,
.map(c =>
isEqual(c.client, payload.client)
? {...c, deviceId: payload.deviceId}
: c,
)
.sort((a, b) => a.client.appName.localeCompare(b.client.appName)),
};
@@ -337,11 +336,10 @@ export default function reducer(
return {
...state,
uninitializedClients: state.uninitializedClients
.map(
c =>
isEqual(c.client, payload.client)
? {...c, errorMessage: errorMessage}
: c,
.map(c =>
isEqual(c.client, payload.client)
? {...c, errorMessage: errorMessage}
: c,
)
.sort((a, b) => a.client.appName.localeCompare(b.client.appName)),
error: `Client setup error: ${errorMessage}`,

View File

@@ -284,7 +284,7 @@ export default class Server extends EventEmitter {
/* If a device gets disconnected without being cleaned up properly,
* Flipper won't be aware until it attempts to reconnect.
* When it does we need to terminate the zombie connection.
*/
*/
if (this.connections.has(id)) {
const connectionInfo = this.connections.get(id);
connectionInfo &&

View File

@@ -168,8 +168,7 @@ class ElementsRowAttribute extends PureComponent<{
const {name, value, matchingSearchQuery, selected} = this.props;
return (
<ElementsRowAttributeContainer code={true}>
<ElementsRowAttributeKey>{name}</ElementsRowAttributeKey>
=
<ElementsRowAttributeKey>{name}</ElementsRowAttributeKey>=
<ElementsRowAttributeValue>
<PartialHighlight
content={value}

View File

@@ -68,7 +68,7 @@ export type SecureServerConfig = {|
* It also deploys the Flipper CA cert to the app.
* The app can trust a server if and only if it has a certificate signed by the
* Flipper CA.
*/
*/
export default class CertificateProvider {
logger: Logger;
adb: Promise<any>;

View File

@@ -74,8 +74,8 @@ export function processNotificationStates(
devicePlugins: Map<string, Class<FlipperDevicePlugin<>>>,
): Array<PluginNotification> {
let activeNotifications = allActiveNotifications.filter(notif => {
const filteredClients = clients.filter(
client => (notif.client ? client.id.includes(notif.client) : false),
const filteredClients = clients.filter(client =>
notif.client ? client.id.includes(notif.client) : false,
);
return (
filteredClients.length > 0 ||