fixes webpack production build

This commit is contained in:
zmagod 2017-10-10 14:08:23 +02:00
parent 25e6eb4511
commit c014742a88
4 changed files with 21 additions and 14 deletions

View file

@ -5,7 +5,7 @@ import { Breadcrumb, Row, Col, Glyphicon, Well } from "react-bootstrap";
import { LinkContainer } from "react-router-bootstrap";
import { FormattedHTMLMessage, FormattedMessage } from "react-intl";
import moment from "moment";
import prettysize from "prettysize";
import { formatBytes } from "../../../../services/helpers/units_converter_helper";
import axios from "../../../../config/axios";
import { SETTINGS_TEAMS_ROUTE } from "../../../../config/routes";
@ -25,7 +25,9 @@ const Wrapper = styled.div`
padding: 16px 15px 50px 15px;
`;
const TabTitle = styled.div`padding: 15px;`;
const TabTitle = styled.div`
padding: 15px;
`;
const BadgeWrapper = styled.div`
font-size: 1.4em;
@ -39,7 +41,8 @@ const StyledWell = styled(Well)`
padding: 9px;
& > span {
padding-left: 5px;
}`;
}
`;
const StyledDescriptionWell = styled(Well)`
padding: 9px;
@ -59,7 +62,9 @@ const StyledH3 = styled.h3`
}
`;
const StyledOl = styled.ol`padding: 15px;`;
const StyledOl = styled.ol`
padding: 15px;
`;
class SettingsTeam extends Component {
constructor(props) {
@ -132,7 +137,7 @@ class SettingsTeam extends Component {
renderEditNameModel() {
if (this.state.showNameModal) {
return(
return (
<UpdateTeamNameModal
showModal={this.state.showNameModal}
hideModal={this.hideNameModalCallback}
@ -196,7 +201,7 @@ class SettingsTeam extends Component {
<FormattedHTMLMessage
id="settings_page.single_team.space_usage"
values={{
space_usage: prettysize(this.state.team.space_taken)
space_usage: formatBytes(this.state.team.space_taken)
}}
/>
</StyledWell>
@ -208,9 +213,7 @@ class SettingsTeam extends Component {
<Glyphicon glyph="info-sign" />
</BadgeWrapper>
<StyledDescriptionWell>
<span>
{this.renderDescription()}
</span>
<span>{this.renderDescription()}</span>
</StyledDescriptionWell>
</Col>
</Row>

View file

@ -0,0 +1,9 @@
// @flow
export function formatBytes(bytes: number) {
if (bytes === 0) return "0 Bytes";
const k = 1024;
const sizes = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
const i = Math.floor(Math.log(bytes) / Math.log(k));
return `${parseFloat((bytes / Math.pow(k, i)).toFixed(2))} ${sizes[i]}`;
}

View file

@ -63,7 +63,6 @@
"postcss-loader": "^2.0.6",
"postcss-smart-import": "^0.7.5",
"precss": "^2.0.0",
"prettysize": "^1.1.0",
"prop-types": "^15.5.10",
"rails-erb-loader": "^5.0.2",
"react": "15.6.1",

View file

@ -4815,10 +4815,6 @@ prettier@^1.7.0:
version "1.7.4"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.7.4.tgz#5e8624ae9363c80f95ec644584ecdf55d74f93fa"
prettysize@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/prettysize/-/prettysize-1.1.0.tgz#c6c52f87161ff172ea435f375f99831dd9a97bb0"
private@^0.1.6, private@^0.1.7:
version "0.1.7"
resolved "https://registry.yarnpkg.com/private/-/private-0.1.7.tgz#68ce5e8a1ef0a23bb570cc28537b5332aba63ef1"