Skip to content

Commit 715715e

Browse files
author
Erika Perugachi
authored
Merge pull request #447 from erikaperugachi/composer
Composer and project structure
2 parents 32ff46e + d8af1be commit 715715e

File tree

12 files changed

+618
-7
lines changed

12 files changed

+618
-7
lines changed

CHANGELOG.md

Lines changed: 576 additions & 0 deletions
Large diffs are not rendered by default.

electron_app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "criptext",
3-
"version": "0.11.3",
3+
"version": "0.11.4",
44
"author": {
55
"name": "Criptext Inc.",
66
"email": "[email protected]",

email_composer/src/components/Autocomplete.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ class Autocomplete extends Component {
2525

2626
componentDidMount() {
2727
const inputName = this.props.inputProps.name;
28-
if (inputName === 'To') {
28+
if (
29+
inputName === 'To' &&
30+
this.props.inputProps.isfocuseditorinput === 'false'
31+
) {
2932
this.autosuggest.input.focus();
3033
}
3134
}

email_composer/src/components/AutocompleteWrapper.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ const AutocompleteWrapper = ({ addTag, ...props }) => {
8888

8989
AutocompleteWrapper.propTypes = {
9090
addTag: PropTypes.func,
91+
isfocuseditorinput: PropTypes.bool,
9192
onChange: PropTypes.func,
9293
value: PropTypes.object
9394
};

email_composer/src/components/Body.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const Body = props => (
1212
getHtmlBody={props.getHtmlBody}
1313
htmlBody={props.htmlBody}
1414
isDragActive={props.isDragActive}
15+
isFocusEditorInput={props.isFocusEditorInput}
1516
isToolbarHidden={props.isToolbarHidden}
1617
onClearFile={props.onClearFile}
1718
onDragLeave={props.handleDragLeave}
@@ -40,6 +41,7 @@ Body.propTypes = {
4041
handleDragOver: PropTypes.func,
4142
htmlBody: PropTypes.object,
4243
isDragActive: PropTypes.bool,
44+
isFocusEditorInput: PropTypes.bool,
4345
isToolbarHidden: PropTypes.bool,
4446
onClearFile: PropTypes.func,
4547
onClickDiscardDraft: PropTypes.func,

email_composer/src/components/BodyWrapper.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class BodyWrapper extends Component {
1616
{...this.props}
1717
getHtmlBody={this.props.getHtmlBody}
1818
htmlBody={this.props.htmlBody}
19+
isFocusEditorInput={this.props.isFocusEditorInput}
1920
isToolbarHidden={this.state.isToolbarHidden}
2021
onClickTextEditor={this.handleTextEditor}
2122
onDrop={this.props.onDrop}
@@ -32,6 +33,7 @@ class BodyWrapper extends Component {
3233
BodyWrapper.propTypes = {
3334
getHtmlBody: PropTypes.func,
3435
htmlBody: PropTypes.object,
36+
isFocusEditorInput: PropTypes.bool,
3537
onDrop: PropTypes.func,
3638
onFocusTextEditor: PropTypes.func
3739
};

email_composer/src/components/Composer.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const Composer = props => (
1818
getCcEmails={props.getCcEmails}
1919
getBccEmails={props.getBccEmails}
2020
isCollapsedMoreRecipient={props.isCollapsedMoreRecipient}
21+
isFocusEditorInput={props.isFocusEditorInput}
2122
onToggleRecipient={props.onToggleRecipient}
2223
/>
2324
<SubjectWrapper
@@ -33,6 +34,7 @@ const Composer = props => (
3334
handleDragOver={props.handleDragOver}
3435
htmlBody={props.htmlBody}
3536
isDragActive={props.isDragActive}
37+
isFocusEditorInput={props.isFocusEditorInput}
3638
onClearFile={props.onClearFile}
3739
onClickDiscardDraft={props.onClickDiscardDraft}
3840
onClickSendMessage={props.onClickSendMessage}
@@ -77,6 +79,7 @@ Composer.propTypes = {
7779
htmlBody: PropTypes.object,
7880
isCollapsedMoreRecipient: PropTypes.bool,
7981
isDragActive: PropTypes.bool,
82+
isFocusEditorInput: PropTypes.bool,
8083
onClickCancelSendMessage: PropTypes.func,
8184
onDrop: PropTypes.func,
8285
onClearFile: PropTypes.func,

email_composer/src/components/DropfileField.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const DropfileField = props => (
1515
>
1616
<EditorWrapper
1717
htmlBody={props.htmlBody}
18+
isFocusEditorInput={props.isFocusEditorInput}
1819
toolbarHidden={props.isToolbarHidden}
1920
getHtmlBody={props.getHtmlBody}
2021
blockRenderMap={props.blockRenderMap}
@@ -74,6 +75,7 @@ DropfileField.propTypes = {
7475
getHtmlBody: PropTypes.func,
7576
htmlBody: PropTypes.object,
7677
isDragActive: PropTypes.bool,
78+
isFocusEditorInput: PropTypes.bool,
7779
isToolbarHidden: PropTypes.bool,
7880
multiple: PropTypes.bool,
7981
onClearFile: PropTypes.func,

email_composer/src/components/EditorWrapper.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ class EditorWrapper extends Component {
88
return (
99
<Editor
1010
{...this.props}
11+
ref={editor => {
12+
this.editor = editor;
13+
}}
1114
toolbar={{
1215
options: [
1316
'inline',
@@ -38,6 +41,12 @@ class EditorWrapper extends Component {
3841
);
3942
}
4043

44+
componentDidMount() {
45+
if (this.props.isFocusEditorInput) {
46+
this.editor.focusEditor();
47+
}
48+
}
49+
4150
onChangeHtmlBody = html => {
4251
this.props.getHtmlBody(html);
4352
};
@@ -51,6 +60,7 @@ EditorWrapper.propTypes = {
5160
blockRenderMap: PropTypes.object,
5261
getHtmlBody: PropTypes.func,
5362
htmlBody: PropTypes.object,
63+
isFocusEditorInput: PropTypes.bool,
5464
onFocusTextEditor: PropTypes.func
5565
};
5666

email_composer/src/components/Recipient.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ const renderRecipientTo = props => (
4343
focusedClassName={'cstm-tags-border'}
4444
inputProps={{
4545
className: 'tags-input',
46+
isfocuseditorinput: props.isFocusEditorInput ? 'true' : 'false',
4647
placeholder: '',
4748
name: 'To'
4849
}}
@@ -121,12 +122,14 @@ const renderRecipientBcc = props => (
121122

122123
Recipient.propTypes = {
123124
isCollapsedMoreRecipient: PropTypes.bool,
125+
isFocusEditorInput: PropTypes.bool,
124126
onToggleRecipient: PropTypes.func
125127
};
126128

127129
renderRecipientTo.propTypes = {
128130
checkDisableSendButton: PropTypes.func,
129131
handleOnValidationRejectToTag: PropTypes.func,
132+
isFocusEditorInput: PropTypes.bool,
130133
onChangeToTag: PropTypes.func,
131134
toTags: PropTypes.string
132135
};

0 commit comments

Comments
 (0)