diff --git a/README.md b/README.md index f32c42f2b..e8de0a4f5 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ Finally, an email service that's built around your privacy. Get your @criptext.c ## Contributing Bug reports We use GitHub for bug tracking. Please search the existing issues for your bug and create a new one if the issue is not yet tracked! +[https://github.com/Criptext/Criptext-Email-React-Client/issues](https://github.com/Criptext/Criptext-Email-React-Client/issues) ## Contributing Translations @@ -22,7 +23,7 @@ We use Lokalise for translations. If you are interested in helping please write To build Criptext on your machine you'll need: -* Node.js (Recommended 8.12+) +* Node.js (Recommended 8.15+) * Yarn ## Run locally @@ -32,16 +33,40 @@ Clone this repository and run a few scripts: ``` bash git clone https://github.com/Criptext/Criptext-Email-React-Client cd Criptext-Email-React-Client -node install.js # Install dependencies -node start.js # Run locally +node install.js # Install dependenciess ``` -On some directories, like `email_login` it is recommended to have a .env file +To up all projects, got to each project and run: +``` bash +yarn start # Run locally +``` +First up the projects like `email_*` and last `electrop_app` + +On all directories, like `email_*` it is recommended to have a .env file with the following content: ``` +PORT=#### SKIP_PREFLIGHT_CHECK=true +REACT_APP_APPDOMAIN=criptext.com +REACT_APP_AVATAR_URL=https://api.criptext.com/user/avatar/ +``` + +The project `electrop_app` the .env file should have this: +``` +NODE_ENV=development +MAILBOX_URL=http://localhost:#### +LOGIN_URL=http://localhost:#### +LOADING_URL=http://localhost:#### +COMPOSER_URL=http://localhost:#### +DEV_SOCKET_URL=wss://socket.criptext.com +DEV_SERVER_URL=https://api.criptext.com +DEV_DATA_TRANSFER_URL=https://transfer.criptext.com +CSC_IDENTITY_AUTO_DISCOVERY=true +DEV_APP_DOMAIN=criptext.com ``` + + ## Contributing Code Contributions are welcome. This project contains subdirectories according to each module of the app: diff --git a/electron_app/package.json b/electron_app/package.json index 3f681ff9b..c37b777a7 100644 --- a/electron_app/package.json +++ b/electron_app/package.json @@ -1,6 +1,6 @@ { "name": "criptext", - "version": "0.23.0", + "version": "0.23.1", "author": { "name": "Criptext Inc", "email": "support@criptext.com", diff --git a/email_mailbox/package.json b/email_mailbox/package.json index 0dab23f57..7770f89cb 100644 --- a/email_mailbox/package.json +++ b/email_mailbox/package.json @@ -1,6 +1,6 @@ { "name": "email_mailbox", - "version": "0.23.0", + "version": "0.23.1", "private": true, "dependencies": { "@criptext/electron-better-ipc": "^0.1.2-rc5", diff --git a/email_mailbox/src/components/HeaderMainWrapper.js b/email_mailbox/src/components/HeaderMainWrapper.js index e00570ecb..2ed03c28c 100644 --- a/email_mailbox/src/components/HeaderMainWrapper.js +++ b/email_mailbox/src/components/HeaderMainWrapper.js @@ -40,6 +40,7 @@ class HeaderMainWrapper extends Component { } componentDidMount() { + if (!this.props.sectionSelected) return; const text = this.props.sectionSelected.params.searchParams ? this.props.sectionSelected.params.searchParams.text : false; diff --git a/email_mailbox/src/components/contacttag.scss b/email_mailbox/src/components/contacttag.scss index 65c17cafe..647722c09 100644 --- a/email_mailbox/src/components/contacttag.scss +++ b/email_mailbox/src/components/contacttag.scss @@ -8,6 +8,7 @@ .tag{ font-size: 12px; + font-weight: 300; text-decoration: none; } } diff --git a/email_mailbox/src/utils/electronEventInterface.js b/email_mailbox/src/utils/electronEventInterface.js index 3ed003dc6..32c6e8a8f 100644 --- a/email_mailbox/src/utils/electronEventInterface.js +++ b/email_mailbox/src/utils/electronEventInterface.js @@ -1429,6 +1429,7 @@ ipcRenderer.on(TOKEN_UPDATED, async (_, token) => { }); ipcRenderer.on(NOTIFICATION_RECEIVED, async (_, { data }) => { + isGettingEvents = true; try { const eventData = await fetchGetSingleEvent({ rowId: data.rowId }); await parseAndStoreEventsBatch({ @@ -1441,6 +1442,7 @@ ipcRenderer.on(NOTIFICATION_RECEIVED, async (_, { data }) => { // eslint-disable-next-line no-console console.error(`[Firebase Error]: `, firebaseNotifErr); } + isGettingEvents = false; }); ipcRenderer.send(START_NOTIFICATION_SERVICE, senderNotificationId); diff --git a/install.js b/install.js index 3d1249938..8cb114dbd 100644 --- a/install.js +++ b/install.js @@ -6,26 +6,28 @@ const { spawn } = require('child_process') const abs = r => path.join(__dirname, r); const packageDirs = [ - abs('electron_app'), abs('email_composer'), abs('email_loading'), abs('email_login'), - abs('email_mailbox') + abs('email_mailbox'), + abs('electron_app') ] const installModules = cwd => new Promise((resolve, reject) => { const cp = spawn('yarn', [], { cwd }); + const names = cwd.split('/'); + const nameProject = names[names.length-1]; cp.on('exit', code => { code == 0 - ? resolve() + ? resolve(`Project ${nameProject} installed ...wait`) : reject(` Failed to install modules at ${cwd}.\n Yarn exited with code: ${code}`) }); - }) + }).then(value => {console.log(value)}); const installations = Promise.all(packageDirs.map(installModules)); installations.then( - () => console.log(' Installed modules successfully!'), + () => console.log('Installed modules successfully!'), err => console.error(err) ); diff --git a/start.js b/start.js deleted file mode 100644 index 6fffbf6ab..000000000 --- a/start.js +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/env node - -const path = require('path') -const { spawn } = require('child_process') - -const startDevServer = { - cmd: 'node', - args: ['node_modules/react-scripts/scripts/start.js'] -} - -const startCustomDevServer = { - cmd: 'node', - args: ['node_modules/@criptext/react-scripts/scripts/start.js'] -} - -const runSass = { - cmd: 'node_modules/.bin/node-sass-chokidar', - args: ['src', '-o', 'src', '--watch', '--recursive'] -} - -const abs = r => path.join(__dirname, r); - -const tasks = [ - { - ...startDevServer, - cwd: abs('./email_composer'), - env: { - PORT: '3004', - } - }, - { - ...runSass, - cwd: abs('./email_composer') - }, - { - ...runSass, - cwd: abs('./email_dialog') - }, - { - ...startDevServer, - cwd: abs('./email_loading'), - env: { - PORT: '3003', - } - }, - { - ...runSass, - cwd: abs('./email_loading') - }, - { - ...startCustomDevServer, - cwd: abs('./email_login'), - env: { - PORT: '3005', - } - }, - { - ...startDevServer, - cwd: abs('./email_mailbox'), - env: { - PORT: '3000', - } - }, - { - ...runSass, - cwd: abs('./email_mailbox') - } -] - - -const children = tasks.map(({ cmd, cwd, env, args }) => { - const cp = spawn(cmd, args, { cwd, env }); - - cp.on('close', (code) => { - console.log(`Command "${cmd} ${args.join(' ')}" in "${cwd}" exited with status code: ${code}`) - }); - - return cp; -}); - -const electronApp = spawn('node_modules/.bin/electron', ['.'], { - cwd: abs('./electron_app'), - env: { - ...process.env, - NODE_ENV: 'development', - CSC_LINK: 'build/Certificates.p12', - CSC_KEY_PASSWORD: 'xxxxxxxx', - CSC_IDENTITY_AUTO_DISCOVERY: 'true', - MAILBOX_URL: 'http://localhost:3000', - DIALOG_URL: 'http://localhost:3006', - LOGIN_URL: 'http://localhost:3005', - LOADING_URL: 'http://localhost:3003', - COMPOSER_URL:'http://localhost:3004' - }, - }) -electronApp.stderr.on('data', data => console.log(data.toString())) - -electronApp.on('close', (code) => { - console.log(`electron app exited with status code: ${code}`); - children.forEach(c => c.kill()); - process.exit(1); -}); -