Improve error handling / roundtrip behavior
Summary: Slightly improves the support form interactions / code flow: * When uploading, input fields are hidden * WHen upload succeeded: Show link to final post * When upload succeeded: be able to start a new bug report * Styled error messages, and unified error flow * Don't support report if errors occurred Reviewed By: priteshrnandgaonkar Differential Revision: D18779791 fbshipit-source-id: 28e873d0509865c66d861fe9cedb62a31f0e8bae
This commit is contained in:
committed by
Facebook Github Bot
parent
3e8a026618
commit
b1fb67c9c4
@@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import React, {PureComponent} from 'react';
|
import React, {PureComponent} from 'react';
|
||||||
import {FlexColumn, Text, styled} from '../ui';
|
import {Text, styled, Info, VBox} from '../ui';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
errors: Array<Error>;
|
errors: Array<Error>;
|
||||||
@@ -22,25 +22,6 @@ const ErrorMessage = styled(Text)({
|
|||||||
lineHeight: 1.35,
|
lineHeight: 1.35,
|
||||||
});
|
});
|
||||||
|
|
||||||
const Padder = styled('div')(
|
|
||||||
({
|
|
||||||
paddingLeft,
|
|
||||||
paddingRight,
|
|
||||||
paddingBottom,
|
|
||||||
paddingTop,
|
|
||||||
}: {
|
|
||||||
paddingLeft?: number;
|
|
||||||
paddingRight?: number;
|
|
||||||
paddingBottom?: number;
|
|
||||||
paddingTop?: number;
|
|
||||||
}) => ({
|
|
||||||
paddingLeft: paddingLeft || 0,
|
|
||||||
paddingRight: paddingRight || 0,
|
|
||||||
paddingBottom: paddingBottom || 0,
|
|
||||||
paddingTop: paddingTop || 0,
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
|
|
||||||
const Title = styled(Text)({
|
const Title = styled(Text)({
|
||||||
marginBottom: 6,
|
marginBottom: 6,
|
||||||
});
|
});
|
||||||
@@ -65,18 +46,16 @@ export default class Popover extends PureComponent<Props> {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<>
|
<VBox>
|
||||||
<Padder paddingBottom={8}>
|
<Info type="error">
|
||||||
<FlexColumn>
|
|
||||||
<Title bold>
|
<Title bold>
|
||||||
The following errors occurred while exporting your data
|
The following errors occurred while exporting your data
|
||||||
</Title>
|
</Title>
|
||||||
{this.props.errors.map((e: Error) => (
|
{this.props.errors.map((e: Error) => (
|
||||||
<ErrorMessage code>{formatError(e)}</ErrorMessage>
|
<ErrorMessage code>{formatError(e)}</ErrorMessage>
|
||||||
))}
|
))}
|
||||||
</FlexColumn>
|
</Info>
|
||||||
</Padder>
|
</VBox>
|
||||||
</>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ StyledLink.displayName = 'Link:StyledLink';
|
|||||||
export default class Link extends Component<{
|
export default class Link extends Component<{
|
||||||
href: string;
|
href: string;
|
||||||
children?: React.ReactNode;
|
children?: React.ReactNode;
|
||||||
|
style?: React.CSSProperties;
|
||||||
}> {
|
}> {
|
||||||
onClick = () => {
|
onClick = () => {
|
||||||
shell.openExternal(this.props.href);
|
shell.openExternal(this.props.href);
|
||||||
@@ -32,7 +33,7 @@ export default class Link extends Component<{
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<StyledLink onClick={this.onClick}>
|
<StyledLink onClick={this.onClick} style={this.props.style}>
|
||||||
{this.props.children || this.props.href}
|
{this.props.children || this.props.href}
|
||||||
</StyledLink>
|
</StyledLink>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user