mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-12-16 21:59:00 +08:00
fixes webpack production build
This commit is contained in:
parent
25e6eb4511
commit
c014742a88
4 changed files with 21 additions and 14 deletions
|
|
@ -5,7 +5,7 @@ import { Breadcrumb, Row, Col, Glyphicon, Well } from "react-bootstrap";
|
||||||
import { LinkContainer } from "react-router-bootstrap";
|
import { LinkContainer } from "react-router-bootstrap";
|
||||||
import { FormattedHTMLMessage, FormattedMessage } from "react-intl";
|
import { FormattedHTMLMessage, FormattedMessage } from "react-intl";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import prettysize from "prettysize";
|
import { formatBytes } from "../../../../services/helpers/units_converter_helper";
|
||||||
import axios from "../../../../config/axios";
|
import axios from "../../../../config/axios";
|
||||||
|
|
||||||
import { SETTINGS_TEAMS_ROUTE } from "../../../../config/routes";
|
import { SETTINGS_TEAMS_ROUTE } from "../../../../config/routes";
|
||||||
|
|
@ -25,7 +25,9 @@ const Wrapper = styled.div`
|
||||||
padding: 16px 15px 50px 15px;
|
padding: 16px 15px 50px 15px;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const TabTitle = styled.div`padding: 15px;`;
|
const TabTitle = styled.div`
|
||||||
|
padding: 15px;
|
||||||
|
`;
|
||||||
|
|
||||||
const BadgeWrapper = styled.div`
|
const BadgeWrapper = styled.div`
|
||||||
font-size: 1.4em;
|
font-size: 1.4em;
|
||||||
|
|
@ -39,7 +41,8 @@ const StyledWell = styled(Well)`
|
||||||
padding: 9px;
|
padding: 9px;
|
||||||
& > span {
|
& > span {
|
||||||
padding-left: 5px;
|
padding-left: 5px;
|
||||||
}`;
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
const StyledDescriptionWell = styled(Well)`
|
const StyledDescriptionWell = styled(Well)`
|
||||||
padding: 9px;
|
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 {
|
class SettingsTeam extends Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
|
|
@ -132,7 +137,7 @@ class SettingsTeam extends Component {
|
||||||
|
|
||||||
renderEditNameModel() {
|
renderEditNameModel() {
|
||||||
if (this.state.showNameModal) {
|
if (this.state.showNameModal) {
|
||||||
return(
|
return (
|
||||||
<UpdateTeamNameModal
|
<UpdateTeamNameModal
|
||||||
showModal={this.state.showNameModal}
|
showModal={this.state.showNameModal}
|
||||||
hideModal={this.hideNameModalCallback}
|
hideModal={this.hideNameModalCallback}
|
||||||
|
|
@ -196,7 +201,7 @@ class SettingsTeam extends Component {
|
||||||
<FormattedHTMLMessage
|
<FormattedHTMLMessage
|
||||||
id="settings_page.single_team.space_usage"
|
id="settings_page.single_team.space_usage"
|
||||||
values={{
|
values={{
|
||||||
space_usage: prettysize(this.state.team.space_taken)
|
space_usage: formatBytes(this.state.team.space_taken)
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</StyledWell>
|
</StyledWell>
|
||||||
|
|
@ -208,9 +213,7 @@ class SettingsTeam extends Component {
|
||||||
<Glyphicon glyph="info-sign" />
|
<Glyphicon glyph="info-sign" />
|
||||||
</BadgeWrapper>
|
</BadgeWrapper>
|
||||||
<StyledDescriptionWell>
|
<StyledDescriptionWell>
|
||||||
<span>
|
<span>{this.renderDescription()}</span>
|
||||||
{this.renderDescription()}
|
|
||||||
</span>
|
|
||||||
</StyledDescriptionWell>
|
</StyledDescriptionWell>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
|
|
||||||
|
|
@ -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]}`;
|
||||||
|
}
|
||||||
|
|
@ -63,7 +63,6 @@
|
||||||
"postcss-loader": "^2.0.6",
|
"postcss-loader": "^2.0.6",
|
||||||
"postcss-smart-import": "^0.7.5",
|
"postcss-smart-import": "^0.7.5",
|
||||||
"precss": "^2.0.0",
|
"precss": "^2.0.0",
|
||||||
"prettysize": "^1.1.0",
|
|
||||||
"prop-types": "^15.5.10",
|
"prop-types": "^15.5.10",
|
||||||
"rails-erb-loader": "^5.0.2",
|
"rails-erb-loader": "^5.0.2",
|
||||||
"react": "15.6.1",
|
"react": "15.6.1",
|
||||||
|
|
|
||||||
|
|
@ -4815,10 +4815,6 @@ prettier@^1.7.0:
|
||||||
version "1.7.4"
|
version "1.7.4"
|
||||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.7.4.tgz#5e8624ae9363c80f95ec644584ecdf55d74f93fa"
|
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:
|
private@^0.1.6, private@^0.1.7:
|
||||||
version "0.1.7"
|
version "0.1.7"
|
||||||
resolved "https://registry.yarnpkg.com/private/-/private-0.1.7.tgz#68ce5e8a1ef0a23bb570cc28537b5332aba63ef1"
|
resolved "https://registry.yarnpkg.com/private/-/private-0.1.7.tgz#68ce5e8a1ef0a23bb570cc28537b5332aba63ef1"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue