Skip to content

Commit

Permalink
Merge branch 'master' into bump/NodejsV18
Browse files Browse the repository at this point in the history
  • Loading branch information
martinbedouret committed Nov 17, 2023
2 parents 9bf3c9f + 5772ae3 commit fa8e641
Show file tree
Hide file tree
Showing 19 changed files with 2,729 additions and 2,792 deletions.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@
"license": "GPL-3.0-only",
"dependencies": {
"@cospired/i18n-iso-languages": "^2.2.0",
"@crowdin/crowdin-api-client": "^1.24.0",
"@crowdin/crowdin-api-client": "^1.25.0",
"@ctrl/react-adsense": "^1.7.0",
"@material-ui/core": "^4.12.4",
"@material-ui/icons": "^4.11.3",
"@material-ui/lab": "4.0.0-alpha.57",
"@microsoft/applicationinsights-web": "^2.8.15",
"@microsoft/applicationinsights-web": "^2.8.16",
"@paypal/react-paypal-js": "^7.8.3",
"@redux-beacon/google-analytics-gtag": "^1.1.0",
"@redux-beacon/logger": "^1.0.0",
"@redux-beacon/offline-web": "^1.0.0",
"axios": "^0.26.1",
"browser-image-resizer": "^1.2.0",
"browser-image-resizer": "^2.4.1",
"dom-to-image": "^2.6.0",
"dotenv": "^16.1.4",
"echarts": "5.4.3",
Expand All @@ -54,12 +54,12 @@
"microsoft-cognitiveservices-speech-sdk": "^1.32.0",
"mime-types": "^2.1.35",
"moment": "2.29.4",
"mongoose": "^6.12.0",
"mongoose": "^6.12.1",
"ogv": "^1.8.9",
"pdfmake": "^0.2.7",
"prop-types": "^15.8.1",
"query-string": "^6.14.1",
"ramda": "^0.29.0",
"ramda": "^0.29.1",
"react": "^17.0.2",
"react-autosuggest": "^10.1.0",
"react-cropper": "^2.3.3",
Expand All @@ -70,7 +70,7 @@
"react-helmet": "^6.1.0",
"react-icons": "^4.11.0",
"react-intl": "^2.7.2",
"react-joyride": "^2.5.4",
"react-joyride": "^2.6.0",
"react-markdown": "^5.0.3",
"react-media-recorder": "^0.7.1",
"react-redux": "^5.1.2",
Expand Down
15 changes: 8 additions & 7 deletions src/components/Board/TileEditor/TileEditor.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ import EditIcon from '@material-ui/icons/Edit';
import ImageEditor from '../ImageEditor';

import API from '../../../api';
import { isAndroid, writeCvaFile } from '../../../cordova-util';
import {
isAndroid,
requestCvaPermissions,
writeCvaFile
} from '../../../cordova-util';
import { convertImageUrlToCatchable } from '../../../helpers';
import PremiumFeature from '../../PremiumFeature';

Expand Down Expand Up @@ -119,12 +123,9 @@ export class TileEditor extends Component {
this.setState({ editingTiles: props.editingTiles });
}
componentDidUpdate(prevProps) {
if (
this.props.open !== prevProps.open &&
this.props.open &&
this.editingTile()
) {
this.setLinkedBoard();
if (this.props.open !== prevProps.open && this.props.open) {
if (this.editingTile()) this.setLinkedBoard();
if (isAndroid()) requestCvaPermissions();
}
}

Expand Down
80 changes: 78 additions & 2 deletions src/components/Settings/Export/Export.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ import FullScreenDialog from '../../UI/FullScreenDialog';
import messages from './Export.messages';

import './Export.css';
import ListSubheader from '@material-ui/core/ListSubheader';
import {
LARGE_FONT_SIZE,
MEDIUM_FONT_SIZE,
SMALL_FONT_SIZE
} from './Export.constants';

const propTypes = {
/**
Expand All @@ -39,6 +45,7 @@ class Export extends React.Component {
this.state = {
exportSingleBoard: '',
exportAllBoard: '',
labelFontSize: MEDIUM_FONT_SIZE,
singleBoard: '',
loadingSingle: false,
loadingAll: false,
Expand All @@ -61,6 +68,13 @@ class Export extends React.Component {
});
};

handleSizeChange = event => {
this.setState({
boardError: false,
labelFontSize: event.target.value
});
};

handleAllBoardChange = event => {
const doneCallback = () => {
this.setState({
Expand All @@ -74,7 +88,12 @@ class Export extends React.Component {
exportAllBoard: event.target.value
},
() => {
this.props.onExportClick(this.state.exportAllBoard, '', doneCallback);
this.props.onExportClick(
this.state.exportAllBoard,
'',
this.state.labelFontSize,
doneCallback
);
}
);
};
Expand All @@ -101,6 +120,7 @@ class Export extends React.Component {
this.props.onExportClick(
this.state.exportSingleBoard,
this.state.singleBoard,
this.state.labelFontSize,
doneCallback
);
}
Expand All @@ -116,7 +136,7 @@ class Export extends React.Component {
title={<FormattedMessage {...messages.export} />}
onClose={onClose}
>
<Paper>
<Paper className="Export__section">
<List>
<ListItem className="Export__ListItem">
<ListItemText
Expand Down Expand Up @@ -284,6 +304,62 @@ class Export extends React.Component {
</ListItem>
</List>
</Paper>
<Paper className="Export__section">
<List
className="Export__List"
subheader={
<ListSubheader>
<FormattedMessage {...messages.pdfSettings} />
</ListSubheader>
}
>
<ListItem>
<ListItemText
className="Export__ListItemText"
primary={<FormattedMessage {...messages.fontSize} />}
secondary={
<FormattedMessage {...messages.fontSizeSecondary} />
}
/>
<ListItemSecondaryAction>
<div className="Export__SelectContainer">
{this.state.loadingAll && (
<CircularProgress
size={25}
className="Export__SelectContainer--spinner"
thickness={7}
/>
)}
<FormControl
className="Export__SelectContainer__Select"
variant="standard"
>
<InputLabel id="export-all-select-label-size">
{intl.formatMessage(messages.fontSize)}
</InputLabel>
<Select
labelId="export-all-select-label-size"
id="export-all-select-size"
autoWidth={false}
value={this.state.labelFontSize}
onChange={this.handleSizeChange}
>
<MenuItem value={SMALL_FONT_SIZE}>
<FormattedMessage {...messages.small} />
</MenuItem>
<MenuItem value={MEDIUM_FONT_SIZE}>
<FormattedMessage {...messages.medium} />
</MenuItem>
<MenuItem value={LARGE_FONT_SIZE}>
<FormattedMessage {...messages.large} />
</MenuItem>
</Select>
</FormControl>
</div>
</ListItemSecondaryAction>
</ListItem>
</List>
</Paper>
</FullScreenDialog>
</div>
);
Expand Down
3 changes: 3 additions & 0 deletions src/components/Settings/Export/Export.constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ export const EMPTY_IMAGE =
export const PICSEEPAL_GRID_WIDTH = 553;
export const PDF_GRID_WIDTH = 800;
export const PDF_BORDER_WIDTH = 2;
export const SMALL_FONT_SIZE = 9;
export const MEDIUM_FONT_SIZE = 12;
export const LARGE_FONT_SIZE = 16;

export const EXPORT_CONFIG_BY_TYPE = {
cboard: {
Expand Down
27 changes: 23 additions & 4 deletions src/components/Settings/Export/Export.container.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export class ExportContainer extends PureComponent {
handleExportClick = async (
type = 'cboard',
singleBoard = '',
labelFontSize = '',
doneCallback
) => {
const exportConfig = EXPORT_CONFIG_BY_TYPE[type];
Expand All @@ -42,25 +43,43 @@ export class ExportContainer extends PureComponent {
if (singleBoard) {
await EXPORT_HELPERS[exportConfig.callback](
[singleBoard],
labelFontSize,
intl,
true
);
} else {
const currentBoard = boards.filter(
board => board.id === activeBoardId
);
await EXPORT_HELPERS[exportConfig.callback](currentBoard, intl, true);
await EXPORT_HELPERS[exportConfig.callback](
currentBoard,
labelFontSize,
intl,
true
);
}
} else if (type !== 'pdf' && !singleBoard) {
await EXPORT_HELPERS[exportConfig.callback](boards, intl);
await EXPORT_HELPERS[exportConfig.callback](
boards,
labelFontSize,
intl
);
} else {
if (singleBoard) {
await EXPORT_HELPERS[exportConfig.callback]([singleBoard], intl);
await EXPORT_HELPERS[exportConfig.callback](
[singleBoard],
labelFontSize,
intl
);
} else {
const currentBoard = boards.filter(
board => board.id === activeBoardId
);
await EXPORT_HELPERS[exportConfig.callback](currentBoard, intl);
await EXPORT_HELPERS[exportConfig.callback](
currentBoard,
labelFontSize,
intl
);
}
}
const showBoardDowloadedNotification = () => {
Expand Down
9 changes: 9 additions & 0 deletions src/components/Settings/Export/Export.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,12 @@
.Export__SelectContainer--spinner {
vertical-align: middle;
}

.Export__section {
margin-bottom: 8px;
}

.Export__List .MuiListSubheader-root {
line-height: 16px;
padding-top: 16px;
}
Loading

0 comments on commit fa8e641

Please sign in to comment.