fixed item titles

This commit is contained in:
muerwre 2019-03-07 12:35:47 +07:00
parent e5d60f2e33
commit 364f6b165e
4 changed files with 8 additions and 6 deletions

View file

@ -9,7 +9,7 @@ module.exports = async (req, res) => {
if (!owner) return res.send({ success: false, reason: 'unauthorized' }); if (!owner) return res.send({ success: false, reason: 'unauthorized' });
const title = parseString(body.title, 32); const title = parseString(body.title, 64);
const is_public = !!body.is_public; const is_public = !!body.is_public;
const exists = await Route.findOne({ _id: address, is_deleted: false }).populate('owner', '_id'); const exists = await Route.findOne({ _id: address, is_deleted: false }).populate('owner', '_id');

View file

@ -8,7 +8,7 @@ module.exports = async (req, res) => {
const owner = await User.findOne({ _id: id, token }).populate('routes'); const owner = await User.findOne({ _id: id, token }).populate('routes');
if (!owner) return res.send({ success: false, reason: 'unauthorized', id, token }); if (!owner) return res.send({ success: false, reason: 'unauthorized', id, token });
const title = parseString(body.title, 32); const title = parseString(body.title, 64);
const address = parseString(body.address, 32); const address = parseString(body.address, 32);
const route = parseRoute(body.route); const route = parseRoute(body.route);
const stickers = parseStickers(body.stickers); const stickers = parseStickers(body.stickers);

View file

@ -42,12 +42,12 @@ export class SaveDialog extends React.Component<Props, State> {
const { path } = getUrlData(); const { path } = getUrlData();
const { title, address } = this.state; const { title, address } = this.state;
return toTranslit(address.trim()) || toTranslit(title.trim().toLowerCase()) || toTranslit(path.trim()).substr(0, 32); return toTranslit(address.trim()) || toTranslit(title.trim().toLowerCase()).substr(0, 32) || toTranslit(path.trim()).substr(0, 32);
}; };
setTitle = ({ target: { value } }) => this.setState({ title: (value || '') }); setTitle = ({ target: { value } }) => this.setState({ title: ((value && value.substr(0, 64)) || '') });
setAddress = ({ target: { value } }) => this.setState({ address: (value || '') }); setAddress = ({ target: { value } }) => this.setState({ address: (value && value.substr(0, 32) || '') });
cancelSaving = () => this.props.setMode(MODES.NONE); cancelSaving = () => this.props.setMode(MODES.NONE);

View file

@ -379,8 +379,10 @@
text-overflow: ellipsis; text-overflow: ellipsis;
overflow: hidden; overflow: hidden;
white-space: nowrap; //white-space: nowrap;
position: relative; position: relative;
max-height: 2.4em;
word-break: break-word;
} }
.route-description { .route-description {