Skip to content
This repository has been archived by the owner on Sep 27, 2022. It is now read-only.

Commit

Permalink
Merge pull request #217 from simde-utc/release/v1.1.1
Browse files Browse the repository at this point in the history
Release v1.1.1
  • Loading branch information
NastuzziSamy authored Sep 2, 2019
2 parents 4ea638f + 09051e2 commit eb4e71b
Show file tree
Hide file tree
Showing 17 changed files with 288 additions and 100 deletions.
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ buildscript {
compileSdkVersion = 29
targetSdkVersion = 29
supportLibVersion = "28.0.0"
versionCode = 5
versionName = "1.1.0"
versionCode = 6
versionName = "1.1.1"
}
repositories {
google()
Expand Down
4 changes: 2 additions & 2 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@
},
"displayName": "PayUTC",
"name": "PayUTC",
"versionCode": 5,
"versionName": "1.1.0"
"versionCode": 6,
"versionName": "1.1.1"
}
24 changes: 24 additions & 0 deletions assets/changelogs/en.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,28 @@
[
{
"version": "v1.1.1",
"data": [
{
"title": "News",
"data": [
"Handle BDE-UTC contribution",
"Add a link to review the application"
]
},
{
"title": "Changes",
"data": [
"Handle new students during connection"
]
},
{
"title": "Fixed bugs",
"data": [
"Fix the refill end page"
]
}
]
},
{
"version": "v1.1.0",
"data": [
Expand Down
24 changes: 24 additions & 0 deletions assets/changelogs/fr.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,28 @@
[
{
"version": "v1.1.1",
"data": [
{
"title": "Nouveautés",
"data": [
"Gestion de la cotisation BDE-UTC",
"Ajout d'un bouton pour noter l'application"
]
},
{
"title": "Modifications",
"data": [
"Gestion des nouveaux étudiants à la connexion"
]
},
{
"title": "Problèmes réglés",
"data": [
"Corrige la finalisation de rechargement"
]
}
]
},
{
"version": "v1.1.0",
"data": [
Expand Down
8 changes: 8 additions & 0 deletions config.example.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ export const PAYUTC_SYSTEM_ID = '';
// PayUTC email adress.
export const PAYUTC_EMAIL = '';

// Ginger api url.
export const GINGER_API_URL = '';

// Ginger API key.
export const GINGER_KEY = '';

// Main team contributors.
export const CONTRIBUTORS_MAIN_TEAM = {
NastuzziSamy: 'project_chief',
Expand Down Expand Up @@ -83,6 +89,8 @@ export default {
PAYUTC_CALLBACK_URL,
PAYUTC_SYSTEM_ID,
PAYUTC_EMAIL,
GINGER_API_URL,
GINGER_KEY,
CONTRIBUTORS_MAIN_TEAM,
CONTRIBUTORS_DESIGN_TEAM,
CONTRIBUTORS_TRANSLATION_TEAM,
Expand Down
4 changes: 2 additions & 2 deletions ios/PayUTC/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key><string>1.1.0</string>
<key>CFBundleShortVersionString</key><string>1.1.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key><string>5</string>
<key>CFBundleVersion</key><string>6</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
Expand Down
9 changes: 8 additions & 1 deletion src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,11 @@
"wrong_cas": "Check that you correctly wrote down your CAS-UTC login and password.",
"button": "Let's go !",
"cas_connection": "CAS-UTC connection...",
"payutc_connection": "Connexion to the PayUTC service...",
"payutc_connection": "PayUTC service connection...",
"ginger_verification": "Account verification...",
"valid_terms": "By clicking \"%{button}\" you accept all the terms",
"hey_nouvo": "Hey Nouvô !",
"wrong_nouvo": "To use the application, you need to finish your registration to the UTC.",
},
"History": {
"title": "Historic",
Expand Down Expand Up @@ -153,6 +156,7 @@
"lang": "Application language :",
"about": "About",
"contact_us": "Contact us",
"opinion": "Give its opinion",
"mail_body": "Hello ! \n\nFirst of all, thank you for this application !\n\n",
"profile_desc": "Account information, badge management and disconnection.",
},
Expand Down Expand Up @@ -245,6 +249,9 @@
"change_pin_desc": "The PIN code is for the sellers in order to use PayUTC payment terminals.",
"cant_change_pin": "You don't have the right to do this.",
"sign_out": "Disconnect",
"is_contributor": "You are a BDE-UTC contributor!",
"is_not_contributor": "You are not a BDE-UTC contributor",
"contributor_desc": "Being a contributor allows you to access the MDE, the Picasso and any event organized by the BDE. It also gives you a lot of advantages in Compiègne shops.",
},
"ChangePin": {
"title": "Update the PIN code",
Expand Down
7 changes: 7 additions & 0 deletions src/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,10 @@
"button": "C'est parti !",
"cas_connection": "Connexion au CAS-UTC...",
"payutc_connection": "Connexion au service PayUTC...",
"ginger_verification": "Vérification du compte...",
"valid_terms": "En cliquant sur \"%{button}\" vous acceptez tous les termes",
"hey_nouvo": "Salut Nouvô !",
"wrong_nouvo": "Pour pouvoir utiliser l'application, il faut terminer son inscription administrative auprès de l'UTC.",
},
"History": {
"title": "Historique",
Expand Down Expand Up @@ -155,6 +158,7 @@
"lang": "Langue de l'application :",
"about": "À propos",
"contact_us": "Nous contacter",
"opinion": "Donner son avis",
"mail_body": "Salut ! \n\nAvant tout, merci pour cette magnifique application !\n\n",
"profile_desc": "Informations du compte, gestion du badge et déconnexion.",
},
Expand Down Expand Up @@ -247,6 +251,9 @@
"lock_error": "Impossible de verrouiller le badge.",
"unlock_error": "Impossible de déverrouiller le badge.",
"sign_out": "Se déconnecter",
"is_contributor": "Vous êtes cotisant BDE-UTC !",
"is_not_contributor": "Vous n'êtes pas cotisant BDE-UTC",
"contributor_desc": "Être cotisant permet d'accéder à la MDE, au Picasso et aux évenements organisés par le BDE. Cela apporte également des avantages auprès des commerçants Compiègnois."
},
"ChangePin": {
"title": "Modification du code PIN",
Expand Down
3 changes: 3 additions & 0 deletions src/redux/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import CASAuthService from '../services/CASAuth';
import PayUTCService from '../services/PayUTC';
import GitHubService from '../services/GitHub';
import GingerService from '../services/Ginger';
import PortailService from '../services/Portail';

// Generate actions for services. Each call, is a service method call.
Expand All @@ -28,6 +29,7 @@ export const generateActions = service => {
export const CASAuth = generateActions(CASAuthService);
export const PayUTC = generateActions(PayUTCService);
export const GitHub = generateActions(GitHubService);
export const Ginger = generateActions(GingerService);
export const Portail = generateActions(PortailService);
export const Config = new Proxy(
{},
Expand All @@ -46,6 +48,7 @@ export default {
CASAuth,
PayUTC,
GitHub,
Ginger,
Portail,
Config,
};
2 changes: 2 additions & 0 deletions src/redux/reducers.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { combineReducers } from 'redux';
import CASAuthService from '../services/CASAuth';
import PayUTCService from '../services/PayUTC';
import GitHubService from '../services/GitHub';
import GingerService from '../services/Ginger';
import PortailService from '../services/Portail';
import { configReducer } from './config';

Expand Down Expand Up @@ -116,6 +117,7 @@ const generateServiceReducer = service => {
generateServiceReducer(CASAuthService);
generateServiceReducer(PayUTCService);
generateServiceReducer(GitHubService);
generateServiceReducer(GingerService);
generateServiceReducer(PortailService);

export default combineReducers(reducers);
82 changes: 51 additions & 31 deletions src/screens/Auth/AuthScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { TERMS_VERSION } from '../Settings/TermsScreen';
import Logo from '../../images/payutc-logo.png';
import CASAuth from '../../services/CASAuth';
import PayUTC from '../../services/PayUTC';
import Ginger from '../../services/Ginger';
import { Config } from '../../redux/actions';
import { _, Auth as t, Global as g } from '../../utils/i18n';
import { isUserExt } from '../../utils';
Expand Down Expand Up @@ -118,6 +119,21 @@ class AuthScreen extends React.Component {
return terms.version === TERMS_VERSION;
}

checkGingerStatus(login) {
const { dispatch } = this.props;

dispatch(
Config.spinner({
visible: true,
textContent: t('ginger_verification'),
})
);

Ginger.getInformation(login)
.catch(() => this.openWrongCas())
.then(() => this.openNouvoPopup());
}

connectWithCas() {
const { dispatch } = this.props;
const { login, password } = this.state;
Expand All @@ -129,16 +145,20 @@ class AuthScreen extends React.Component {
})
);

return CASAuth.login(login, password).then(() => {
dispatch(
Config.spinner({
visible: true,
textContent: t('payutc_connection'),
})
);
return CASAuth.login(login, password)
.then(() => {
dispatch(
Config.spinner({
visible: true,
textContent: t('payutc_connection'),
})
);

return PayUTC.connectWithCas(login, password);
});
return PayUTC.connectWithCas(login, password)
.then(() => this.goHome())
.catch(() => this.checkGingerStatus(login));
})
.catch(() => this.openWrongCas());
}

connectWithEmail() {
Expand All @@ -152,13 +172,14 @@ class AuthScreen extends React.Component {
})
);

return PayUTC.connectWithEmail(login, password);
PayUTC.connectWithEmail(login, password)
.then(() => this.goHome())
.catch(() => this.openWrongExt());
}

submit() {
const { navigation, dispatch } = this.props;
const { navigation } = this.props;
const { login } = this.state;
let promise;

if (!this.areTermsValidated()) {
this.setState({ needValidation: true });
Expand All @@ -167,30 +188,22 @@ class AuthScreen extends React.Component {
}

if (isUserExt(login)) {
promise = this.connectWithEmail();
this.connectWithEmail();
} else {
promise = this.connectWithCas();
this.connectWithCas();
}
}

promise
.then(() => {
dispatch(
Config.spinner({
visible: false,
})
);
goHome() {
const { navigation, dispatch } = this.props;

navigation.navigate('Home');
dispatch(
Config.spinner({
visible: false,
})
.catch(e => {
console.log(e);

if (isUserExt(login)) {
this.openWrongExt();
} else {
this.openWrongCas();
}
});
);

navigation.navigate('Home');
}

openWrongExt() {
Expand Down Expand Up @@ -231,6 +244,13 @@ class AuthScreen extends React.Component {
);
}

openNouvoPopup() {
Alert.alert(t('hey_nouvo'), t('wrong_nouvo'), this.getAlertButtons(), {
cancelable: true,
onDismiss: this.dismissWrong,
});
}

dismissWrong() {
const { dispatch } = this.props;

Expand Down
Loading

0 comments on commit eb4e71b

Please sign in to comment.