Skip to content

Commit 069efc2

Browse files
authored
Merge pull request #1087 from erikaperugachi/composer
Composer
2 parents bc8d4b4 + af8a720 commit 069efc2

File tree

16 files changed

+146
-76
lines changed

16 files changed

+146
-76
lines changed

email_composer/src/app.scss

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,10 @@ TABLE OF CONTENTS
404404

405405
/* 2.- CONTENT
406406
----------------------------- */
407+
*{
408+
font-family: NunitoSans;
409+
}
410+
407411
html, html body {
408412
height: 100%;
409413
margin: 0;
@@ -423,7 +427,7 @@ html, html body {
423427

424428
/* 2.1.- CONTENT: SCROLLBAR
425429
----------------------------- */
426-
.cptx-scrollbar{
430+
@mixin cptx-scrollbar-scheme{
427431
&::-webkit-scrollbar-track{
428432
background-color: transparent;
429433
box-shadow: inset 0 0 10px rgba(220,220,220,0.1);
@@ -440,6 +444,14 @@ html, html body {
440444
}
441445
}
442446

447+
.cptx-scrollbar{
448+
@include cptx-scrollbar-scheme
449+
}
450+
451+
.react-autosuggest__suggestions-container--open{
452+
@include cptx-scrollbar-scheme
453+
}
454+
443455
/* 3.- CONTROLS
444456
----------------------------- */
445457

@@ -494,7 +506,7 @@ button{
494506
&.wrapper{
495507
background-color: $_BACKGROUND_COLOR_MAIN;
496508

497-
.cptx-scrollbar{
509+
.cptx-scrollbar, .react-autosuggest__suggestions-container--open{
498510
&::-webkit-scrollbar-track{
499511
background-color: $_BACKGROUND_COLOR_SCROLLBAR;
500512
}

email_composer/src/components/Composer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ Composer.propTypes = {
9797
tagBlured: PropTypes.func,
9898
tagChanged: PropTypes.func,
9999
textSubject: PropTypes.string,
100-
tagUpdated: PropTypes.string,
100+
tagUpdated: PropTypes.func,
101101
toEmails: PropTypes.array
102102
};
103103

email_composer/src/components/avatarimage.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
.avatar-letters {
2-
position: relative;
32
align-items: center;
43
border-radius: 50%;
54
display: flex;
6-
overflow: hidden;
75
height: 100%;
6+
overflow: hidden;
7+
position: relative;
88
width: 100%;
99

1010
img {
@@ -16,6 +16,7 @@
1616
}
1717

1818
span{
19+
color: white;
1920
font-weight: 300;
2021
margin: 0 auto;
2122
}

email_composer/src/components/dropfilefield.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
border: 2px solid transparent;
55
display: flex;
66
flex-direction: column;
7-
height: calc(100% - 72px);
7+
height: calc(100% - 64px);
88
justify-content: space-between;
99
margin: 0;
1010
overflow-y: auto;

email_composer/src/components/suggestion.scss

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
font-weight: 200;
1212
left: 0;
1313
position: absolute;
14-
overflow: hidden;
14+
overflow: auto;
1515
top: 31px;
1616
width: 370px;
1717
max-height: calc(100vh - 100px);
@@ -50,6 +50,7 @@
5050
.react-autosuggest__suggestion {
5151
color: #6a707e;
5252
cursor: pointer;
53+
margin: 0;
5354
padding: 8px 16px;
5455
}
5556

@@ -63,19 +64,19 @@
6364
border-radius: 50%;
6465
color: #fff;
6566
display: flex;
67+
font-size: 12px;
68+
font-weight: 200;
6669
height: 27px;
6770
justify-content: center;
6871
position: relative;
6972
width: 27px;
70-
71-
.recipient-icon-letters{
72-
font-size: 11px;
73-
}
7473
}
7574

7675
.recipient-text {
7776
align-items: center;
7877
display: flex;
78+
font-size: 12px;
79+
font-weight: 200;
7980
margin-left: 10px;
8081
position: relative;
8182
width: 130px;
@@ -94,8 +95,10 @@
9495
.sugestion-email-right {
9596
align-items: center;
9697
display: flex;
98+
font-size: 12px;
99+
font-weight: 200;
97100
margin-left: 10px;
98-
width: 160px;
101+
width: 150px;
99102

100103
> span{
101104
overflow: hidden;

email_composer/src/components/tagrecipient.scss

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
display: flex;
88
flex-grow: 0;
99
font-size: 13px;
10-
font-weight: 200;
1110
height: 18px;
1211
margin: 2px 10px 2px 0;
1312
padding: 3px 2px 3px 10px;
@@ -72,11 +71,16 @@
7271
}
7372
}
7473

75-
a.icon-exit{
76-
background-color: transparent;
77-
font-size: 22px;
78-
line-height: 10px;
74+
a{
75+
font-weight: 200;
7976
text-decoration: none;
77+
78+
&.icon-exit{
79+
background-color: transparent;
80+
font-size: 22px;
81+
line-height: 10px;
82+
text-decoration: none;
83+
}
8084
}
8185
}
8286

@@ -91,14 +95,17 @@
9195
&.tag-app-domain{
9296
background-color: $_BACKGROUND_COLOR_TAG_APP_DOMAIN;
9397
border-color: $_BORDER_COLOR_TAG_APP_DOMAIN;
94-
color: $_COLOR_TEXT_TAG_APP_DOMAIN;
9598

9699
&.tag-expanded{
97100
border-color: $_BORDER_COLOR_TAG_APP_DOMAIN_EDIT;
98101
}
99102

100-
a.icon-exit{
101-
color: $_COLOR_ICON_TAG_APP_DOMAIN;
103+
a{
104+
color: $_COLOR_TEXT_TAG_APP_DOMAIN;
105+
106+
&.icon-exit{
107+
color: $_COLOR_ICON_TAG_APP_DOMAIN;
108+
}
102109
}
103110
}
104111

@@ -110,22 +117,29 @@
110117
border-color: $_BORDER_COLOR_TAG_DEFAULT_EDIT;
111118
}
112119

113-
a.icon-exit{
114-
color: $_COLOR_ICON_TAG_DEFAULT;
120+
a{
121+
color: $_COLOR_TEXT_TAG_DEFAULT;
122+
123+
&.icon-exit{
124+
color: $_COLOR_ICON_TAG_DEFAULT;
125+
}
115126
}
116127
}
117128

118129
&.tag-error {
119130
background-color: $_BACKGROUND_COLOR_TAG_ERROR;
120131
border-color: $_BORDER_COLOR_TAG_ERROR;
121-
color: $_COLOR_TEXT_TAG_ERROR;
122132

123133
&.tag-expanded{
124134
border-color: $_BORDER_COLOR_TAG_ERROR_EDIT;
125135
}
126136

127-
a.icon-exit{
128-
color: $_COLOR_ICON_TAG_ERROR;
137+
a{
138+
color: $_COLOR_TEXT_TAG_ERROR;
139+
140+
&.icon-exit{
141+
color: $_COLOR_ICON_TAG_ERROR;
142+
}
129143
}
130144
}
131145
}

email_composer/src/utils/EmailUtils.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,16 @@ const insertEmptyLine = quantity => {
192192
};
193193

194194
const formRecipientObject = contact => {
195-
return contact.name ? { name: contact.name, email: contact.email } : contact;
195+
const name = contact.name;
196+
const email = contact.email || contact;
197+
const emailTag = `<${email}>`;
198+
const complete = `${name || ''} ${emailTag}`;
199+
const form = emailRegex.test(email)
200+
? email.includes(`@${appDomain}`) || email.includes(`@${enterpriseDomain}`)
201+
? 'tag-app-domain'
202+
: 'tag-default'
203+
: 'tag-error';
204+
return { name, email, complete: complete.trim(), form };
196205
};
197206

198207
const formReplyForwardContent = (replyType, subject, date, from, to, body) => {

email_composer/src/utils/FileUtils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export const formFileParamsToDatabase = files => {
109109
export const getFileParamsToSend = files => {
110110
if (!files.length) return [];
111111

112-
return new Promise((resolve, reject) => {
112+
return new Promise(resolve => {
113113
const tokensToDuplicate = files
114114
.filter(file => file.shouldDuplicate === true)
115115
.map(file => file.token);
@@ -132,7 +132,7 @@ export const getFileParamsToSend = files => {
132132
} else if (tokensToDuplicate.length > 0) {
133133
fileManager.duplicateFiles(tokensToDuplicate, (err, res) => {
134134
if (err) {
135-
return reject(undefined);
135+
return resolve([]);
136136
}
137137
const { duplicates } = JSON.parse(res);
138138
const data = files.map(file => {

email_composer/src/utils/__tests__/__snapshots__/EmailUtils.js.snap

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,9 @@ Object {
141141
"threadId": "1",
142142
"toEmails": Array [
143143
Object {
144+
"complete": "From1 <[email protected]>",
144145
"email": "[email protected]",
146+
"form": "tag-app-domain",
145147
"name": "From1",
146148
},
147149
],
@@ -153,10 +155,16 @@ Object {
153155
"bccEmails": Array [],
154156
"ccEmails": Array [
155157
Object {
158+
"complete": "<[email protected]>",
156159
"email": "[email protected]",
160+
"form": "tag-app-domain",
161+
"name": undefined,
157162
},
158163
Object {
164+
"complete": "<[email protected]>",
159165
"email": "[email protected]",
166+
"form": "tag-app-domain",
167+
"name": undefined,
160168
},
161169
],
162170
"files": Array [],
@@ -166,7 +174,9 @@ Object {
166174
"threadId": "1",
167175
"toEmails": Array [
168176
Object {
177+
"complete": "From1 <[email protected]>",
169178
"email": "[email protected]",
179+
"form": "tag-app-domain",
170180
"name": "From1",
171181
},
172182
],

email_mailbox/src/components/PanelWrapper.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,8 @@ class PanelWrapper extends Component {
296296
.threadIdSelected;
297297
const currentLabelId = this.state.sectionSelected.params.mailboxSelected
298298
.id;
299-
const limit =
300-
this.props.threadsCount > 20 ? this.props.threadsCount : undefined;
299+
const currentMailboxSize = this.props[currentLabelId];
300+
const limit = currentMailboxSize > 22 ? currentMailboxSize : undefined;
301301
if (labelIds && isRenderingMailbox) {
302302
if (labelIds.includes(currentLabelId)) {
303303
this.props.onLoadThreads(

0 commit comments

Comments
 (0)