Skip to content

Commit

Permalink
Merge branch 'master' into fix/service-worker-external-symbol-sets-api
Browse files Browse the repository at this point in the history
  • Loading branch information
martin committed Nov 2, 2019
2 parents f349b9f + bfbcab0 commit d5122d1
Show file tree
Hide file tree
Showing 37 changed files with 4,747 additions and 4,416 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
# Build Docker Image
# https://circleci.com/docs/2.0/building-docker-images/#overview
- setup_remote_docker: # (2)
docker_layer_caching: true # (3)
docker_layer_caching: false # (3)
# build and push Docker image
- run: |
TAG=0.1.$CIRCLE_BUILD_NUM
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ _Note: These keys/secrets are *not* required to run or develop Cboard._ They are
## Contributors

This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].
<a href="graphs/contributors"><img src="https://opencollective.com/cboard/contributors.svg?width=890&button=false" /></a>
<a href="https://github.com/cboard-org/cboard/graphs/contributors"><img src="https://opencollective.com/cboard/contributors.svg?width=890&button=false" /></a>

## Backers

Expand Down
21 changes: 11 additions & 10 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,26 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no, user-scalable=no">
<meta http-equiv="Content-Security-Policy"
content="
content="
default-src 'self'
'unsafe-inline'
'unsafe-eval'
http://localhost:10010/
https://*.app.cboard.io/
https://*.app.qa.cboard.io/
http://localhost:3000/
http://localhost:10010/
https://*.app.cboard.io/
https://*.app.qa.cboard.io/
https://www.google-analytics.com/
https://www.google.com/ads/
https://www.google.com.ar/ads/
https://stats.g.doubleclick.net/
https://*.blob.core.windows.net/
https://www.google.com.ar/ads/
https://stats.g.doubleclick.net/
https://*.blob.core.windows.net/
https://www.madaportal.org/tawasol/
https://api.arasaac.org/api/
https://globalsymbols.com/api/
https://www.googletagmanager.com/
https://ssl.gstatic.com
gap:
https://ssl.gstatic.com
blob:
gap:
data:;
img-src * data: filesystem: blob: ;
">
Expand All @@ -42,7 +44,6 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->

<!-- Add to homescreen for Chrome on Android -->
<meta name="mobile-web-app-capable" content="yes">
<meta name="application-name" content="Cboard">
Expand Down
11 changes: 10 additions & 1 deletion src/api/api.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import axios from 'axios';
import { alpha2ToAlpha3T } from '@cospired/i18n-iso-languages';

import {
API_URL,
ARASAAC_BASE_PATH_API,
Expand Down Expand Up @@ -78,7 +80,14 @@ class API {
}

async globalsymbolsPictogramsSearch(locale, searchText) {
const pictogSearchTextPath = `${GLOBALSYMBOLS_BASE_PATH_API}concepts/suggest/?query=${searchText}&language=${locale}&language_iso_format=639-1&limit=20`;
let language = 'eng';
if (locale.length === 3) {
language = locale;
}
if (locale.length === 2) {
language = alpha2ToAlpha3T(locale);
}
const pictogSearchTextPath = `${GLOBALSYMBOLS_BASE_PATH_API}labels/search/?query=${searchText}&language=${language}&language_iso_format=639-3&limit=20`;
try {
const { status, data } = await this.axiosInstance.get(
pictogSearchTextPath
Expand Down
4 changes: 3 additions & 1 deletion src/components/Account/SignUp/SignUp.actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ import get from 'lodash/fp/get';
import { API_URL } from '../../../constants';

export function signUp(formValues) {
const endpoint =
API_URL[API_URL.length - 1] === '/' ? `${API_URL}user` : `${API_URL}/user`;
return axios
.post(`${API_URL}/user`, formValues)
.post(endpoint, formValues)
.then(get('data'))
.catch(get('response.data'));
}
37 changes: 21 additions & 16 deletions src/components/AuthScreen/AuthScreen.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import Information from './Information';
import CboardLogo from '../WelcomeScreen/CboardLogo/CboardLogo.component';
import './AuthScreen.css';
import { API_URL } from '../../constants';
import { isCordova } from '../../cordova-util';

class AuthScreen extends Component {
state = {
Expand Down Expand Up @@ -68,23 +69,27 @@ class AuthScreen extends Component {
<FormattedMessage {...messages.signUp} />
</Button>

<GoogleLoginButton
className="AuthScreen__button AuthScreen__button--google"
onClick={() => {
window.location = `${API_URL}/login/google`;
}}
>
<FormattedMessage {...messages.google} />
</GoogleLoginButton>
{!isCordova() && (
<div className="AuthScreen__button AuthScreen__button">
<GoogleLoginButton
className="AuthScreen__button AuthScreen__button--google"
onClick={() => {
window.location = `${API_URL}/login/google`;
}}
>
<FormattedMessage {...messages.google} />
</GoogleLoginButton>

<FacebookLoginButton
className="AuthScreen__button AuthScreen__button--facebook"
onClick={() => {
window.location = `${API_URL}/login/facebook`;
}}
>
<FormattedMessage {...messages.facebook} />
</FacebookLoginButton>
<FacebookLoginButton
className="AuthScreen__button AuthScreen__button--facebook"
onClick={() => {
window.location = `${API_URL}/login/facebook`;
}}
>
<FormattedMessage {...messages.facebook} />
</FacebookLoginButton>
</div>
)}
</footer>
</div>
<Login
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,26 +50,30 @@ exports[`AuthScreen tests default renderer 1`] = `
values={Object {}}
/>
</WithStyles(Button)>
<Unknown
className="AuthScreen__button AuthScreen__button--google"
onClick={[Function]}
<div
className="AuthScreen__button AuthScreen__button"
>
<FormattedMessage
defaultMessage="Sign in with Google"
id="cboard.components.WelcomeScreen.google"
values={Object {}}
/>
</Unknown>
<Unknown
className="AuthScreen__button AuthScreen__button--facebook"
onClick={[Function]}
>
<FormattedMessage
defaultMessage="Sign in with Facebook"
id="cboard.components.WelcomeScreen.facebook"
values={Object {}}
/>
</Unknown>
<Unknown
className="AuthScreen__button AuthScreen__button--google"
onClick={[Function]}
>
<FormattedMessage
defaultMessage="Sign in with Google"
id="cboard.components.WelcomeScreen.google"
values={Object {}}
/>
</Unknown>
<Unknown
className="AuthScreen__button AuthScreen__button--facebook"
onClick={[Function]}
>
<FormattedMessage
defaultMessage="Sign in with Facebook"
id="cboard.components.WelcomeScreen.facebook"
values={Object {}}
/>
</Unknown>
</div>
</footer>
</div>
<UNDEFINED
Expand Down
Loading

0 comments on commit d5122d1

Please sign in to comment.