Skip to content

Commit

Permalink
Merge branch 'develop' into RocketChat#821
Browse files Browse the repository at this point in the history
  • Loading branch information
Scarvis committed Jan 21, 2021
2 parents 8836ae7 + ae9e11a commit 26abaf1
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
4 changes: 2 additions & 2 deletions app/protocols/client/views/EditItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ function EditItemWithData({ close, onChange, protocol, sectionId, itemId, ...pro
close();
onChange();
}, [saveAction, close, onChange]);

return <VerticalBar.ScrollableContent {...props}>
<Field>
<Field.Label>{t('Item_Number')}</Field.Label>
Expand All @@ -121,7 +121,7 @@ function EditItemWithData({ close, onChange, protocol, sectionId, itemId, ...pro
language: 'ru',
toolbar: [ 'bold', 'italic', 'link' ]
} }
data={name}
data={previousName}
onChange={ (event, editor) => {
const data = editor.getData();
setName(data);
Expand Down
4 changes: 2 additions & 2 deletions app/protocols/client/views/Protocol.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export function ProtocolPage() {
const data = useEndpointData('protocols.findOne', query) || {};
const workingGroups = useEndpointData('working-groups.list', useMemo(() => ({ query: JSON.stringify({ type: { $ne: 'subject' } }) }), [])) || { workingGroups: [] };

const title = t('Protocol').concat(' ').concat(data.num).concat(' ').concat(t('Date_to')).concat(' ').concat(formatDate(data.d));
const title = t('Protocol').concat(' ').concat(t('Date_to')).concat(' ').concat(formatDate(data.d)).concat(' ').concat(' ').concat(data.num);

const deleteSection = useMethod('deleteSection');
const deleteItem = useMethod('deleteItem');
Expand Down Expand Up @@ -270,7 +270,7 @@ export function ProtocolPage() {
}, [])

const goBack = () => {
window.history.back();
FlowRouter.go('/protocols')
};

const workingGroupOptions = useMemo(() => {
Expand Down
11 changes: 7 additions & 4 deletions app/protocols/client/views/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export function ProtocolsPage() {
}, []);

const goBack = () => {
window.history.back();
FlowRouter.go('home')
};

return <Page flexDirection='row'>
Expand All @@ -88,9 +88,12 @@ export function ProtocolsPage() {
</Button>
<Label fontScale='h1'>{t('Protocols')}</Label>
</Field>
<Button small onClick={handleHeaderButtonClick('new')} aria-label={t('New')}>
<Icon name='plus'/>
</Button>

<Field width={'6%'} display={'block'} marginBlock={'15px'}>
<Button className='go-back-button' onClick={handleHeaderButtonClick('new')} aria-label={t('New')}>
<Icon name='plus'/>
</Button>
</Field>
</Page.Header>
<Page.Content>
<Protocols setParam={setParams} params={params} onHeaderClick={onHeaderClick} data={data} onEditClick={onEditClick} onClick={onClick} sort={sort}/>
Expand Down
8 changes: 4 additions & 4 deletions app/protocols/server/methods/insertOrUpdateItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ Meteor.methods({
}

if (!protocolId) {
throw new Meteor.Error('error-the-field-is-required', 'The field ProtocolId is required', { method: 'insertOrUpdateSection', field: 'ProtocolId' });
throw new Meteor.Error('error-the-field-is-required', 'The field ProtocolId is required', { method: 'insertOrUpdateItem', field: 'ProtocolId' });
}

if (!sectionId) {
throw new Meteor.Error('error-the-field-is-required', 'The field SectionId is required', { method: 'insertOrUpdateSection', field: 'SectionId' });
throw new Meteor.Error('error-the-field-is-required', 'The field SectionId is required', { method: 'insertOrUpdateItem', field: 'SectionId' });
}

if (!s.trim(item.num)) {
throw new Meteor.Error('error-the-field-is-required', 'The field Number is required', { method: 'insertOrUpdateSection', field: 'Number' });
throw new Meteor.Error('error-the-field-is-required', 'The field Number is required', { method: 'insertOrUpdateItem', field: 'Number' });
}

if (!s.trim(item.name)) {
throw new Meteor.Error('error-the-field-is-required', 'The field Name is required', { method: 'insertOrUpdateSection', field: 'Name' });
throw new Meteor.Error('error-the-field-is-required', 'The field Name is required', { method: 'insertOrUpdateItem', field: 'Name' });
}

if (!item._id) {
Expand Down

0 comments on commit 26abaf1

Please sign in to comment.