Skip to content

Commit 4469a0e

Browse files
author
Erika Perugachi
authored
Merge pull request #1153 from erikaperugachi/enterprise
Enterprise
2 parents d7206b5 + 9e73115 commit 4469a0e

34 files changed

+161
-37
lines changed

electron_app/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "criptext",
3-
"version": "0.23.3",
3+
"version": "0.23.4",
44
"author": {
55
"name": "Criptext Inc",
66
"email": "[email protected]",
@@ -136,7 +136,7 @@
136136
"@criptext/api": "^0.15.18",
137137
"@criptext/data-transfer-client": "^0.1.1",
138138
"@criptext/electron-better-ipc": "^0.1.2-rc5",
139-
"@criptext/electron-push-receiver": "^2.1.2",
139+
"@criptext/electron-push-receiver": "^2.1.2-rc1",
140140
"@criptext/news-api-client": "^1.0.1",
141141
"dotenv": "^6.2.0",
142142
"electron-context-menu": "^0.10.1",
@@ -151,6 +151,7 @@
151151
"os-locale": "^3.0.1",
152152
"recursive-copy": "^2.0.10",
153153
"rimraf": "^2.6.3",
154+
"rmdir-recursive": "^0.0.1",
154155
"sqlite3": "4.0.2",
155156
"unused-filename": "^2.1.0",
156157
"websocket": "^1.0.28"

electron_app/src/BackupManager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ const createTempEmailsBackup = () => {
121121
const EmailsFolder = getUserEmailsPath(process.env.NODE_ENV, getUsername());
122122
return new Promise((resolve, reject) => {
123123
try {
124-
copy(EmailsFolder, TempEmailsBackupPath);
124+
copy(EmailsFolder, TempEmailsBackupPath, { overwrite: true });
125125
resolve();
126126
} catch (error) {
127127
reject({ error: 'Preparing backup error' });

electron_app/src/dbExporter.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,9 @@ const exportLabelTable = async db => {
127127
};
128128

129129
const exportEmailTable = async db => {
130-
const username = `${myAccount.recipientId}@${APP_DOMAIN}`;
130+
const username = myAccount.recipientId.includes('@')
131+
? myAccount.recipientId
132+
: `${myAccount.recipientId}@${APP_DOMAIN}`;
131133
let emailRows = [];
132134
let shouldEnd = false;
133135
let offset = 0;
@@ -508,7 +510,9 @@ const importDatabaseFromFile = async ({ filepath, databasePath }) => {
508510
};
509511

510512
const storeEmailBodies = emailRows => {
511-
const username = `${myAccount.recipientId}@${APP_DOMAIN}`;
513+
const username = myAccount.recipientId.includes('@')
514+
? myAccount.recipientId
515+
: `${myAccount.recipientId}@${APP_DOMAIN}`;
512516
return Promise.all(
513517
emailRows.map(email => {
514518
const body = email.content;

electron_app/src/ipc/manager.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ ipc.answerRenderer(
3737
);
3838

3939
ipc.answerRenderer('db-clean-database', async username => {
40-
const user = username ? `${username}@${APP_DOMAIN}` : getUsername();
40+
const user = username
41+
? username.includes('@')
42+
? username
43+
: `${username}@${APP_DOMAIN}`
44+
: getUsername();
4145
if (user) {
4246
await fileUtils.removeUserDir(user);
4347
}

electron_app/src/utils/FileUtils.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
const fs = require('fs');
2+
const copy = require('recursive-copy');
3+
const rmdirRecursive = require('rmdir-recursive');
24
const path = require('path');
35
const rimraf = require('rimraf');
46
const { app } = require('electron');
@@ -16,7 +18,8 @@ const getUserEmailsPath = (node_env, user) => {
1618
const emailsPath = path
1719
.join(__dirname, '/../userData', `${user}`, 'emails')
1820
.replace('/src', '');
19-
createPathRecursive(emailsPath);
21+
const userToReplace = `${user}@${APP_DOMAIN}`;
22+
createPathRecursive(emailsPath, userToReplace, user);
2023
return emailsPath;
2124
}
2225
default: {
@@ -153,7 +156,16 @@ const createPathRecursive = (fullpath, oldUser, newUser) => {
153156
const lastPath = path.resolve(parentDir, oldUser);
154157
if (fs.existsSync(lastPath)) {
155158
curDir = path.resolve(parentDir, newUser);
156-
fs.renameSync(lastPath, curDir);
159+
try {
160+
fs.renameSync(lastPath, curDir);
161+
} catch (err) {
162+
const source = path.resolve(parentDir, `${oldUser}/emails/`);
163+
const dest = path.resolve(parentDir, `${newUser}/emails/`);
164+
copy(source, dest, { overwrite: true }).then(function() {
165+
const folder = path.resolve(parentDir, `${oldUser}`);
166+
rmdirRecursive(folder);
167+
});
168+
}
157169
return curDir;
158170
}
159171
}

electron_app/src/windows/composer.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,10 @@ const sendEventToMailbox = (eventName, data) => {
168168
};
169169

170170
const saveDraftToDatabase = async (composerId, data) => {
171-
const username = `${myAccount.recipientId}@${APP_DOMAIN}`;
171+
const recipientId = myAccount.recipientId;
172+
const username = recipientId.includes('@')
173+
? recipientId
174+
: `${recipientId}@${APP_DOMAIN}`;
172175
const filteredRecipients = {
173176
from: data.recipients.from,
174177
to: filterInvalidEmailAddresses(data.recipients.to),

electron_app/src/windows/mailbox.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ const create = () => {
7070
mailboxWindow.on('close', e => {
7171
if (!globalManager.forcequit.get()) {
7272
e.preventDefault();
73-
if (mailboxWindow.isFullScreen()) {
73+
if (mailboxWindow && mailboxWindow.isFullScreen()) {
7474
mailboxWindow.setFullScreen(false);
7575
setTimeout(() => hide(), 1200);
7676
} else {

electron_app/yarn.lock

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,10 @@
113113
version "0.1.2-rc5"
114114
resolved "https://registry.yarnpkg.com/@criptext/electron-better-ipc/-/electron-better-ipc-0.1.2-rc5.tgz#4a51755de1168b441fe6a68872fe8b95eaa742ab"
115115

116-
"@criptext/electron-push-receiver@^2.1.2":
117-
version "2.1.2"
118-
resolved "https://registry.yarnpkg.com/@criptext/electron-push-receiver/-/electron-push-receiver-2.1.2.tgz#d971523d21bb473e9340f157af0c30760f7c417b"
119-
integrity sha512-1QIx54AuC/XtdO37a7ExXF1yoKvyEnq7kXnsCGo1mTh9ER3hNqS9ox8hpBPRuA7TgkH2dQzDeAqsQS7IflsKMw==
116+
"@criptext/electron-push-receiver@^2.1.2-rc1":
117+
version "2.1.2-rc1"
118+
resolved "https://registry.yarnpkg.com/@criptext/electron-push-receiver/-/electron-push-receiver-2.1.2-rc1.tgz#4c6be8acc7d5d17390a31872b52228866f757643"
119+
integrity sha512-rYy1ZW5vQ6Z8QuMGMomXW7vKUXHbnsr4rMr7ee1aDjnNA3wzAMDWVTKiYmI3r9NFdnYTmIs2MwKCrQ4PQHy+rw==
120120
dependencies:
121121
electron-config "^1.0.0"
122122
push-receiver "^2.0.2"
@@ -186,9 +186,9 @@
186186
integrity sha512-1w52Nyx4Gq47uuu0EVcsHBxZFJgurQ+rTKS3qMHxR1GY2T8c2AJYd6vZoZ9q1rupaDjU0yT+Jc2XTyXkjeMA+Q==
187187

188188
"@types/node@^10.1.0":
189-
version "10.14.4"
190-
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.14.4.tgz#1c586b991457cbb58fef51bc4e0cfcfa347714b5"
191-
integrity sha512-DT25xX/YgyPKiHFOpNuANIQIVvYEwCWXgK2jYYwqgaMrYE6+tq+DtmMwlD3drl6DJbUwtlIDnn0d7tIn/EbXBg==
189+
version "10.14.16"
190+
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.14.16.tgz#4d690c96cbb7b2728afea0e260d680501b3da5cf"
191+
integrity sha512-/opXIbfn0P+VLt+N8DE4l8Mn8rbhiJgabU96ZJ0p9mxOkIks5gh6RUnpHak7Yh0SFkyjO/ODbxsQQPV2bpMmyA==
192192

193193
"@types/node@^8.0.24":
194194
version "8.10.49"
@@ -3349,9 +3349,9 @@ lodash@^4.13.1, lodash@^4.17.10, lodash@^4.17.4, lodash@^4.2.0, lodash@^4.3.0:
33493349
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7"
33503350

33513351
lodash@^4.17.11:
3352-
version "4.17.11"
3353-
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d"
3354-
integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==
3352+
version "4.17.15"
3353+
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548"
3354+
integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==
33553355

33563356
long@^3.2.0:
33573357
version "3.2.0"
@@ -4591,6 +4591,11 @@ rimraf@^2.6.3:
45914591
dependencies:
45924592
glob "^7.1.3"
45934593

4594+
rmdir-recursive@^0.0.1:
4595+
version "0.0.1"
4596+
resolved "https://registry.yarnpkg.com/rmdir-recursive/-/rmdir-recursive-0.0.1.tgz#57c0234af6e22ce642d0069cb2850f92966581b1"
4597+
integrity sha1-V8AjSvbiLOZC0AacsoUPkpZlgbE=
4598+
45944599
rsvp@^3.3.3:
45954600
version "3.6.2"
45964601
resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-3.6.2.tgz#2e96491599a96cde1b515d5674a8f7a91452926a"
@@ -5441,9 +5446,9 @@ write-file-atomic@^2.0.0, write-file-atomic@^2.1.0:
54415446
signal-exit "^3.0.2"
54425447

54435448
write-file-atomic@^2.3.0:
5444-
version "2.4.2"
5445-
resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.4.2.tgz#a7181706dfba17855d221140a9c06e15fcdd87b9"
5446-
integrity sha512-s0b6vB3xIVRLWywa6X9TOMA7k9zio0TMOsl9ZnDkliA/cfJlpHXAscj0gbHVJiTdIuAYpIyqS5GW91fqm6gG5g==
5449+
version "2.4.3"
5450+
resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.4.3.tgz#1fd2e9ae1df3e75b8d8c367443c692d4ca81f481"
5451+
integrity sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==
54475452
dependencies:
54485453
graceful-fs "^4.1.11"
54495454
imurmurhash "^0.1.4"

email_composer/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "email_composer",
3-
"version": "0.23.3",
3+
"version": "0.23.4",
44
"private": true,
55
"dependencies": {
66
"@criptext/electron-better-ipc": "^0.1.2-rc5",

email_composer/src/app.scss

Lines changed: 85 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,90 @@ TABLE OF CONTENTS
175175
font-style: italic;
176176
}
177177

178+
@font-face {
179+
font-family: "Roboto";
180+
src:url(#{$_PATH_TO_FONTS}/roboto/Roboto-Thin.ttf) format("truetype");
181+
font-weight: normal;
182+
font-style: normal;
183+
}
184+
185+
@font-face {
186+
font-family: "Roboto";
187+
src:url(#{$_PATH_TO_FONTS}/roboto/Roboto-ThinItalic.ttf) format("truetype");
188+
font-weight: normal;
189+
font-style: italic;
190+
}
191+
192+
@font-face {
193+
font-family: "Roboto";
194+
src:url(#{$_PATH_TO_FONTS}/roboto/Roboto-Light.ttf) format("truetype");
195+
font-weight: 200;
196+
font-style: normal;
197+
}
198+
199+
@font-face {
200+
font-family: "Roboto";
201+
src:url(#{$_PATH_TO_FONTS}/roboto/Roboto-LightItalic.ttf) format("truetype");
202+
font-weight: 200;
203+
font-style: italic;
204+
}
205+
206+
@font-face {
207+
font-family: "Roboto";
208+
src:url(#{$_PATH_TO_FONTS}/roboto/Roboto-Regular.ttf) format("truetype");
209+
font-weight: 300;
210+
font-style: normal;
211+
}
212+
213+
@font-face {
214+
font-family: "Roboto";
215+
src:url(#{$_PATH_TO_FONTS}/roboto/Roboto-Italic.ttf) format("truetype");
216+
font-weight: 300;
217+
font-style: italic;
218+
}
219+
220+
@font-face {
221+
font-family: "Roboto";
222+
src:url(#{$_PATH_TO_FONTS}/roboto/Roboto-Medium.ttf) format("truetype");
223+
font-weight: 600;
224+
font-style: normal;
225+
}
226+
227+
@font-face {
228+
font-family: "Roboto";
229+
src:url(#{$_PATH_TO_FONTS}/roboto/Roboto-MediumItalic.ttf) format("truetype");
230+
font-weight: 600;
231+
font-style: italic;
232+
}
233+
234+
@font-face {
235+
font-family: "Roboto";
236+
src:url(#{$_PATH_TO_FONTS}/roboto/Roboto-Bold.ttf) format("truetype");
237+
font-weight: 700;
238+
font-style: normal;
239+
}
240+
241+
@font-face {
242+
font-family: "Roboto";
243+
src:url(#{$_PATH_TO_FONTS}/roboto/Roboto-BoldItalic.ttf) format("truetype");
244+
font-weight: 700;
245+
font-style: italic;
246+
}
247+
248+
@font-face {
249+
font-family: "Roboto";
250+
src:url(#{$_PATH_TO_FONTS}/roboto/Roboto-Black.ttf) format("truetype");
251+
font-weight: 800;
252+
font-style: normal;
253+
}
254+
255+
@font-face {
256+
font-family: "Roboto";
257+
src:url(#{$_PATH_TO_FONTS}/roboto/Roboto-BlackItalic.ttf) format("truetype");
258+
font-weight: 800;
259+
font-style: italic;
260+
}
261+
178262
/* 1.2.- FONTS: Icon
179263
----------------------------- */
180264
@font-face {
@@ -405,7 +489,7 @@ TABLE OF CONTENTS
405489
/* 2.- CONTENT
406490
----------------------------- */
407491
*{
408-
font-family: NunitoSans;
492+
font-family: NunitoSans, Roboto;
409493
}
410494

411495
html, html body {

0 commit comments

Comments
 (0)