Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/letstrace/letstrace into…
Browse files Browse the repository at this point in the history
… newUI

* 'develop' of https://github.com/letstrace/letstrace:
  Add custom map styles to the Overlap map (Path-Check#246)
  Italian missing licenses file- Andy's translation added (Path-Check#241)
  Add jest snapshot testing to the main views (Path-Check#187)
  Typo fix from Enrico Santus on latest (Path-Check#239)
  Update macos_build.yml (Path-Check#236)
  Andynuzzo/it (Path-Check#223)
  Dutch translation (Path-Check#225)
  Brazilian Portuguese language support (Path-Check#229)
  • Loading branch information
Jin committed Mar 27, 2020
2 parents 1d4b005 + c6e23e8 commit 5df8463
Show file tree
Hide file tree
Showing 45 changed files with 1,933 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/macos_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
run: brew tap adoptopenjdk/openjdk && brew cask install adoptopenjdk/openjdk/adoptopenjdk8

- name: Installing Gradle
run: brew install gradle
run: brew upgrade gradle

- name: Installing Android Studio
run: brew cask install android-sdk
Expand Down
43 changes: 43 additions & 0 deletions __mocks__/react-native-fs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
export default {
mkdir: jest.fn(),
moveFile: jest.fn(),
copyFile: jest.fn(),
pathForBundle: jest.fn(),
pathForGroup: jest.fn(),
getFSInfo: jest.fn(),
getAllExternalFilesDirs: jest.fn(),
unlink: jest.fn(),
exists: jest.fn(),
stopDownload: jest.fn(),
resumeDownload: jest.fn(),
isResumable: jest.fn(),
stopUpload: jest.fn(),
completeHandlerIOS: jest.fn(),
readDir: jest.fn(),
readDirAssets: jest.fn(),
existsAssets: jest.fn(),
readdir: jest.fn(),
setReadable: jest.fn(),
stat: jest.fn(),
readFile: jest.fn(),
read: jest.fn(),
readFileAssets: jest.fn(),
hash: jest.fn(),
copyFileAssets: jest.fn(),
copyFileAssetsIOS: jest.fn(),
copyAssetsVideoIOS: jest.fn(),
writeFile: jest.fn(),
appendFile: jest.fn(),
write: jest.fn(),
downloadFile: jest.fn(),
uploadFiles: jest.fn(),
touch: jest.fn(),
MainBundlePath: jest.fn(),
CachesDirectoryPath: jest.fn(),
DocumentDirectoryPath: jest.fn(),
ExternalDirectoryPath: jest.fn(),
ExternalStorageDirectoryPath: jest.fn(),
TemporaryDirectoryPath: jest.fn(),
LibraryDirectoryPath: jest.fn(),
PicturesDirectoryPath: jest.fn(),
};
7 changes: 7 additions & 0 deletions __mocks__/react-native-i18n.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export function getLanguages() {
return new Promise((resolve, reject) => {
process.nextTick(() =>
resolve(['en-US'])
);
})
};
7 changes: 7 additions & 0 deletions __mocks__/react-native-push-notification.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default {
configure: jest.fn(),
onRegister: jest.fn(),
onNotification: jest.fn(),
addEventListener: jest.fn(),
requestPermissions: jest.fn(),
};
4 changes: 4 additions & 0 deletions __mocks__/react-native-zip-archive.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default {
unzip: jest.fn(),
subscribe: jest.fn(),
};
7 changes: 6 additions & 1 deletion __tests__/App-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ import App from '../App';
// Note: test renderer must be required after react-native.
import renderer from 'react-test-renderer';

jest.mock('../app/Entry', () => 'Entry');

it('renders correctly', () => {
renderer.create(<App />);
const tree = renderer
.create(<App />)
.toJSON();
expect(tree).toMatchSnapshot();
});
7 changes: 7 additions & 0 deletions __tests__/__snapshots__/App-test.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`renders correctly 1`] = `
<MenuProvider>
<Entry />
</MenuProvider>
`;
4 changes: 2 additions & 2 deletions app/assets/LICENSE.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"licenses": [{
"name": "Private Kit",
"text": "MIT License\n\nCopyright (c) 2020 TripleBlind, Inc\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE."
}, ]
}
}]
}
2 changes: 1 addition & 1 deletion app/locales/en/exportscreen.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
"export_para_2":"Location is shared as a simple list of times and coordinates, no other identifying information.",
"share":"SHARE",
"data_hint":"Log has data of"
}
}
2 changes: 1 addition & 1 deletion app/locales/it/exportscreen.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"export_para_1":"Puoi condividere i tuoi movimenti con chiunque, premendo il tasto CONDIVIDI. Una volta premuto il tasto, l'applicazione ti chiederà con chi e come vuoi condivide le informazioni.",
"export_para_1":"Puoi condividere i tuoi movimenti con chiunque, premendo il tasto CONDIVIDI. Una volta premuto il tasto, l'applicazione ti chiederà con chi e come vuoi condividere le informazioni.",
"export_para_2":"La posizione è condivisa come una semplice lista di date e coordinate, senza alcuna informazione che possa permettere l'identificazione dell'utente.",
"share":"CONDIVIDI",
"data_hint":"Log contiene dati di"
Expand Down
2 changes: 1 addition & 1 deletion app/locales/it/import.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"import_title":"Importa le Posizioni",
"import_step_1":"1. Fai login nel tuo account Google e scarica la storia dei tuoi movimenti.",
"import_step_1":"1. Fai login nel tuo account Google e scarica l'archivio dei tuoi movimenti.",
"import_step_2":"2. Una volta scaricati i movimenti, apri questa schermata. I dati saranno importati automaticamente."
}
12 changes: 8 additions & 4 deletions app/locales/it/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@ import intro from './intro.json';
import locationTracking from './locationTracking.json';
import importFile from './import.json';
import exportFile from './exportscreen.json';
import licensesFile from './licensesscreen.json';
import overlapFile from './overlap.json';

export default {
...intro,
...locationTracking,
...importFile,
...exportFile,
...intro,
...locationTracking,
...importFile,
...exportFile,
...overlapFile,
...licensesFile,
};
6 changes: 3 additions & 3 deletions app/locales/it/intro.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"private_kit":"Private Kit",
"intro1_para1":"Progettato tenendo a cuore la sicurezza dei dati e della privacy, MIT Private Kit è la nuova generazione di registrazione privata della localizzazione.",
"intro1_para1":"Progettato tenendo a cuore la sicurezza dei dati e della privacy, MIT Private Kit è la nuova generazione di traciamento sicuro della tua posizione.",
"next":"PROSSIMO",
"back":"INDIETRO",
"start":"INIZIA",
Expand All @@ -9,6 +9,6 @@
"intro2_title2":"Sei tu che decidi",
"intro2_para2":"I tuoi dati non lasceranno mai il tuo telefono senza il tuo consenso",
"intro3_title1":"Il Futuro",
"intro3_para1":"Il prossimo passo per risolvere i problemi di oggi e di domani consiste nel permettere agli individui di salvare i propri movimenti, offrendo nuove opportunita' per ricercatori che studiano pandemie, migrazioni e spostamenti.",
"intro3_para2":"Scopri di piu' http://privatekit.mit.edu/"
"intro3_para1":"Il prossimo passo per risolvere i problemi di oggi e di domani consiste nel permettere agli individui di salvare i propri movimenti, offrendo nuove opportunità per ricercatori che studiano pandemie, migrazioni o semplici spostamenti.",
"intro3_para2":"Scopri di più su http://privatekit.mit.edu/"
}
5 changes: 5 additions & 0 deletions app/locales/it/licensesscreen.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"license_placeholder": "L'app è protetta dalla licenza open source MIT."
}


3 changes: 2 additions & 1 deletion app/locales/it/locationTracking.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
"news":"novità",
"latest_news":"Ultime Novità",
"url_info":"Per più informazioni, visita la homepage di Private Kit:",
"private_kit_url":"privatekit.mit.edu"
"private_kit_url":"privatekit.mit.edu",
"overlap":"CONTROLLA LE INTERSEZIONI"
}
11 changes: 11 additions & 0 deletions app/locales/it/overlap.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

{
"overlap_title": "Controlla Sovrapposizioni",
"overlap_para_1": "Le aree verdi sono dati aggregati della tua posizione, clicca per ingrandire. Gli indicatori rossi sono le tue posizioni registrate. \n\nClicca il pulsante per scaricare informazioni pubbliche su casi confermati, indicati come aree viola.",
"show_overlap": "Controllo dati pubblici",
"loading_public_data": "Caricamento dati...",
"overlap_no_results_button_label": "Nessun risultato trovato",
"overlap_found_button_label": "Dati pubblici caricati",
"nCoV2019_url_info": "Per maggiori informazioni su questa mappa",
"nCoV2019_url": "github.com/beoutbreakprepared/nCoV2019"
}
6 changes: 6 additions & 0 deletions app/locales/languages.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import itlabels from './it';
import ptlabels from './pt';
import mrlabels from './mr';
import nllabels from './nl';
import pt_BRlabels from './pt_BR';

// This will fetch the user's language
let userLang = undefined;
Expand Down Expand Up @@ -73,6 +74,11 @@ i18next.init({
label: nllabels,
},
},
pt_BR: {
translation: {
label: pt_BRlabels,
},
},
},
});

Expand Down
2 changes: 2 additions & 0 deletions app/locales/nl/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ import locationTracking from './locationTracking.json';
import importFile from './import.json';
import exportFile from './exportscreen.json';
import licensesFile from './licensesscreen.json';
import overlapFile from './overlap.json';

export default {
...intro,
...locationTracking,
...importFile,
...exportFile,
...overlapFile,
...licensesFile,
};
5 changes: 3 additions & 2 deletions app/locales/nl/locationTracking.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
"news":"Nieuws",
"latest_news":"Laatste nieuws",
"url_info":"Voor meer informatie bezoek de Private Kit website:",
"private_kit_url":"privatekit.mit.edu"
}
"private_kit_url":"privatekit.mit.edu",
"overlap": "Controleer Overlap"
}
10 changes: 10 additions & 0 deletions app/locales/nl/overlap.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"overlap_title": "Controleer Overlap",
"overlap_para_1": "Groene cirkels zijn clusters van uw locaties, klik om in te zoomen. Rode markeringen zijn uw geregistreerde locaties.\n\nDruk op de knop om openbare informatie over bevestigde gevallen te downloaden, weergegeven als vage paarse cirkels.",
"show_overlap": "Check Openbare Informatie",
"loading_public_data": "Openbare informatie laden...",
"overlap_no_results_button_label": "Openbare Informatie Geladen",
"overlap_found_button_label": "Openbare Informatie Geladen",
"nCoV2019_url_info": "Voor meer informatie over de dataset van deze kaart",
"nCoV2019_url": "github.com/beoutbreakprepared/nCoV2019"
}
6 changes: 6 additions & 0 deletions app/locales/pt_BR/exportscreen.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"export_para_1":"Você pode compartilhar sua trilha de localização com qualquer pessoa usando o botão Compartilhar abaixo. Depois de pressionar o botão, ele perguntará com quem e como você deseja compartilhá-lo.",
"export_para_2":"O local é compartilhado como uma lista simples de horários e coordenadas, nenhuma outra informação de identificação.",
"share":"COMPARTILHAR",
"data_hint":"Registro possui dados de"
}
5 changes: 5 additions & 0 deletions app/locales/pt_BR/import.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"import_title":"Importar Locais",
"import_step_1":"1. Faça login na sua Conta do Google e faça o download do seu Histórico de Localização",
"import_step_2":"2. Após o download, abra esta tela novamente. Os dados serão importados automaticamente."
}
15 changes: 15 additions & 0 deletions app/locales/pt_BR/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import intro from './intro.json';
import locationTracking from './locationTracking.json';
import importFile from './import.json';
import exportFile from './exportscreen.json';
import licensesFile from './licensesscreen.json';
import overlapFile from './overlap.json';

export default {
...intro,
...locationTracking,
...importFile,
...exportFile,
...overlapFile,
...licensesFile,
};
14 changes: 14 additions & 0 deletions app/locales/pt_BR/intro.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"private_kit":"Private Kit",
"intro1_para1":"Projetado com segurança de dados e proteção de privacidade em mente, o MIT Private Kit é a próxima geração de registro de localização seguro.",
"next":"Próximo",
"back":"Retornar",
"start":"Iniciar",
"intro2_title1":"Menos de 100 KB",
"intro2_para1":"O gerador de trilhas do Private Kit registra os dados de localização do seu dispositivo em menos de 100 KB de espaço - menos espaço que uma única imagem.",
"intro2_title2":"Você está no controle",
"intro2_para2": "Os dados nunca saem do seu dispositivo sem o seu consentimento",
"intro3_title1":"O Futuro",
"intro3_para1": "A próxima etapa na solução dos problemas de hoje e de amanhã. Habilitando indivíduos para registrar sua trilha de localização oferece novas oportunidades para os pesquisadores que estudam rastreamento de pandemia, migração de refugiados e análise de tráfego da comunidade.",
"intro3_para2":"Saiba mais http://privatekit.mit.edu/"
}
3 changes: 3 additions & 0 deletions app/locales/pt_BR/licensesscreen.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"license_placeholder": "Este aplicativo foi desenvolvido sob a licença MIT."
}
13 changes: 13 additions & 0 deletions app/locales/pt_BR/locationTracking.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"start_logging":"Comece a Registrar",
"stop_logging":"Pare de Registrar",
"logging_message":"No momento, ele está registrando sua localização em privado a cada cinco minutos. Suas informações de localização NÃO deixarão o telefone.",
"not_logging_message":"NOTA: Depois de clicar neste botão, você pode ser solicitado a conceder acesso ao Private Kit à sua localização.",
"import":"Importar",
"export":"Exportar",
"news":"Notícias",
"latest_news":"Últimas Notícias",
"url_info":"url_info:",
"private_kit_url":"privatekit.mit.edu",
"overlap": "VERIFICAR SOBREPOSIÇÃO"
}
10 changes: 10 additions & 0 deletions app/locales/pt_BR/overlap.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"overlap_title": "Verificar Sobreposição",
"overlap_para_1": "Círculos verdes são agrupamentos de seus locais, clique para ampliar. Marcadores vermelhos são seus locais gravados. \n\nPressione o botão para baixar informações públicas de casos confirmados, mostrados como círculos roxo claro.",
"show_overlap": "Verificar dados públicos",
"loading_public_data": "carregando dados...",
"overlap_no_results_button_label": "Dados públicos carregados",
"overlap_found_button_label": "Dados públicos carregados",
"nCoV2019_url_info": "Para mais informações sobre o conjunto de dados para este mapa",
"nCoV2019_url": "github.com/beoutbreakprepared/nCoV2019"
}
2 changes: 0 additions & 2 deletions app/views/LocationTracking.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ class LocationTracking extends Component {
BackHandler.addEventListener('hardwareBackPress', this.handleBackPress);
GetStoreData('PARTICIPATE')
.then(isParticipating => {
console.log(isParticipating);

if (isParticipating === 'true') {
this.setState({
isLogging: true,
Expand Down
Loading

0 comments on commit 5df8463

Please sign in to comment.