From 295123e5edfb419eb0b02c7e70124a9938962e40 Mon Sep 17 00:00:00 2001 From: henrydays Date: Mon, 11 Mar 2019 18:29:21 +0000 Subject: [PATCH 01/13] p --- App/app/screens/calendarDetail.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/App/app/screens/calendarDetail.js b/App/app/screens/calendarDetail.js index 171acf8c..27741894 100644 --- a/App/app/screens/calendarDetail.js +++ b/App/app/screens/calendarDetail.js @@ -32,7 +32,9 @@ import Swiper from 'react-native-swiper'; const SCREEN_HEIGHT = Dimensions.get("window").height; const SCREEN_WIDTH = Dimensions.get("window").width; + import FitImage from 'react-native-fit-image'; + import MapView, {PROVIDER_GOOGLE} from 'react-native-maps'; const formatObj = (obj) => { @@ -132,7 +134,7 @@ class calendarDetail extends React.Component { ) }; - +/* renderMap = () => { return ( @@ -154,7 +156,7 @@ class calendarDetail extends React.Component { /> ) }; - +*/ renderAttendee = () => { return ( @@ -211,7 +213,7 @@ class calendarDetail extends React.Component { Localização - {this.renderMap()} + From 4b7909da4cdcaa523af96c70a7ef7ee24471dd83 Mon Sep 17 00:00:00 2001 From: henrydays Date: Mon, 11 Mar 2019 19:14:10 +0000 Subject: [PATCH 02/13] up --- App/app/screens/choosePath.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/App/app/screens/choosePath.js b/App/app/screens/choosePath.js index ce320784..b9994a66 100644 --- a/App/app/screens/choosePath.js +++ b/App/app/screens/choosePath.js @@ -261,7 +261,7 @@ class choosePath extends React.Component { style={{ width: "100%" }} onValueChange={(itemValue, itemIndex) => { this.setState({ guest: itemValue }); - this.props.timerChangeGuest(); + // this.props.timerChangeGuest(); this.props.waitChangeGuest(); this.props.changeGuestList( From 116fc1b3a97b6eb6b54e022b5330febe7f0c3707 Mon Sep 17 00:00:00 2001 From: henrydays Date: Tue, 12 Mar 2019 03:34:40 +0000 Subject: [PATCH 03/13] calendar v3 --- App/app/Router.js | 8 +- App/app/screens/Calendar.js | 13 +- App/app/screens/Home.js | 5 +- App/app/screens/calendarDetail.js | 60 +++- App/app/screens/choosePath.js | 19 +- App/app/store/actions/actionTypes.js | 1 + App/app/store/actions/api.js | 316 +++++++++++------- App/app/store/actions/index.js | 4 +- App/app/store/reducers/api.js | 65 +++- api/Controllers/AuthController.cs | 41 ++- api/Dtos/tokenDto.cs | 23 ++ api/Dtos/userDetails.cs | 18 + api/Startup.cs | 2 +- api/api.csproj | 11 +- .../Debug/netcoreapp2.1/project.razor.json | 2 +- 15 files changed, 412 insertions(+), 176 deletions(-) create mode 100644 api/Dtos/tokenDto.cs create mode 100644 api/Dtos/userDetails.cs diff --git a/App/app/Router.js b/App/app/Router.js index 511994d6..4fa334cd 100755 --- a/App/app/Router.js +++ b/App/app/Router.js @@ -104,10 +104,7 @@ const AppStack = createBottomTabNavigator( }, { - //initialRouteName: 'Home', - initialRouteName: 'Eventos', - - //initialRouteName: 'Calendário', + initialRouteName: 'Home', tabBarOptions: { showLabel: true, // hide labels @@ -125,7 +122,8 @@ const Stack = createStackNavigator({ screen: AppStack, navigationOptions: ({navigation}) => { const index = navigation.state.index; - + + if (navigation.state.routes[index].routeName == 'Home') { return { headerTitle: `${navigation.state.routes[index].routeName}`, diff --git a/App/app/screens/Calendar.js b/App/app/screens/Calendar.js index b68a44a0..25d9720d 100644 --- a/App/app/screens/Calendar.js +++ b/App/app/screens/Calendar.js @@ -19,7 +19,7 @@ import * as Progress from "react-native-progress"; import { connect } from "react-redux"; import { bindActionCreators } from "redux"; - +import PTRView from 'react-native-pull-to-refresh'; import * as Actions from "../store/actions"; //Import your actionss const formatObj = obj => { @@ -140,6 +140,10 @@ class Calendar extends React.Component { constructor() { super(); } + _refresh=()=>{ + this.props.getEvents(this.props.user); + this.props.getSessions(this.props.userDetails.token); + } render() { const ThirdRoute = () => ( @@ -275,7 +279,9 @@ class Calendar extends React.Component { ); return ( + + {this.props.careerPath != undefined && ( )} + + + Caso tenhas problemas com este processo deves contactar a comissão atravês do email geral. + + + + Não sabes a password? - }> + {this.setState({modalResetPassword:true})}}> Recuperar Password @@ -292,6 +330,26 @@ const styles = { cameraContainer: { height: Dimensions.get('window').height , }, + resetPassword:{ + + borderRadius: 90, + + borderColor: "#bfbdbd", + borderWidth: 1, + margin:20, + marginTop: 60, + marginBottom: 60, + + width: SCREEN_WIDTH * 0.8, + + backgroundColor: "white", + + borderRadius: 90, + height: SCREEN_HEIGHT * 0.08, + borderColor: "#bfbdbd", + borderWidth: 1, + paddingLeft: SCREEN_WIDTH * 0.05 + }, passwordInput: { borderRadius: 90, diff --git a/App/app/screens/choosePath.js b/App/app/screens/choosePath.js index d1e1ef09..9df0550c 100644 --- a/App/app/screens/choosePath.js +++ b/App/app/screens/choosePath.js @@ -325,7 +325,7 @@ class choosePath extends React.Component { {this._verifySession(item[index].Id) && ( { - + this.props.waitChangeGuest() this.props.removeSession( this.props.user, this.props.userDetails.token, @@ -347,7 +347,7 @@ class choosePath extends React.Component { { this.props.getUserInfo(this.props.userDetails.token) - //this.props.waitChangeGuest() + this.props.waitChangeGuest() this.props.signSession( this.props.user, this.props.userDetails.token, diff --git a/App/app/store/actions/api.js b/App/app/store/actions/api.js index c68caaa0..dd1dec31 100644 --- a/App/app/store/actions/api.js +++ b/App/app/store/actions/api.js @@ -294,6 +294,9 @@ export function signSession(user, token, idSession) { //se não existir erro na chamada... .then(a => { if (a.data.Success) { + axios.defaults.headers.common = { + Authorization: `bearer ${token.access_token}` + }; axios .get("/Attendee/AvailableSessions") @@ -315,7 +318,7 @@ export function signSession(user, token, idSession) { "Sucesso", "Inscrição na sessão efectuada com sucesso" ); - + console.log("aqui1") //obter informações pessoais: axios .get("/Attendee/Detail") @@ -324,6 +327,7 @@ export function signSession(user, token, idSession) { alert(error); }) .then(sucess => { + console.log("aqui2") var result = getE(user); dispatch({ type: SIGN_SESSION, @@ -453,7 +457,7 @@ export function changeGuestList(token, guestID) { axios .get(full) .then(function(response) { - console.log(response); + axios.defaults.baseURL = "http://enei2019.uingress.com/internal/api"; axios.defaults.headers.common = { @@ -464,7 +468,9 @@ export function changeGuestList(token, guestID) { .get("/Attendee/AvailableSessions") .then(function(response) { + // handle success + //console.log(response); var cenas = []; @@ -476,11 +482,14 @@ export function changeGuestList(token, guestID) { )(response.data); for (let key in result) { + result[key].option = 0; cenas.push(result[key]); - console.log(); + } + console.log("-.-.-..-.-.-.-.-.-.") console.log(cenas); + console.log("-.-.-..-.-.-.-.-.-.") dispatch({ type: CHANGE_GUEST, sessions: response.data, From c20718bfbadeba7806c44e66bee5c84e0af140cd Mon Sep 17 00:00:00 2001 From: henrydays Date: Tue, 12 Mar 2019 23:27:58 +0000 Subject: [PATCH 07/13] reset --- App/app/App.js | 63 +++++++++++++++++++++++++++++--------------------- 1 file changed, 37 insertions(+), 26 deletions(-) diff --git a/App/app/App.js b/App/app/App.js index 070e30ab..f55f2fe2 100755 --- a/App/app/App.js +++ b/App/app/App.js @@ -132,6 +132,12 @@ class App extends Component { _toggle=()=>{ this.setState({modalResetPassword:false}) } + //faz call + _reset=()=>{ + //fecha modal + this.setState({modalResetPassword:false}) + //faz call + } _keyboardDidShow() { //alert('Keyboard Shown'); @@ -191,6 +197,8 @@ class App extends Component { isVisible={this.state.modalResetPassword} onBackdropPress={this._toggle} onBackButtonPress={this._toggle} + animationInTiming={1500} + animationOutTiming={1500} > @@ -211,11 +219,11 @@ class App extends Component { /> - Caso tenhas problemas com este processo deves contactar a comissão atravês do email geral. + Caso tenhas problemas com este processo deves contactar a comissão organizadora atravês do email geral. @@ -249,10 +257,10 @@ class App extends Component { - Scan QR + @@ -271,13 +279,11 @@ class App extends Component { placeholder="Password" /> { !this.props.loadingLogin && - - Entrar - + + + Login + + } {this.props.alignItems && @@ -300,8 +306,8 @@ class App extends Component { Não sabes a password? {this.setState({modalResetPassword:true})}}> - - Recuperar Password + + Reset Password @@ -332,7 +338,7 @@ const styles = { }, resetPassword:{ - borderRadius: 90, + borderColor: "#bfbdbd", borderWidth: 1, @@ -344,14 +350,14 @@ const styles = { backgroundColor: "white", - borderRadius: 90, + borderRadius: 3, height: SCREEN_HEIGHT * 0.08, borderColor: "#bfbdbd", borderWidth: 1, paddingLeft: SCREEN_WIDTH * 0.05 }, passwordInput: { - borderRadius: 90, + borderColor: "#bfbdbd", borderWidth: 1, @@ -361,7 +367,7 @@ const styles = { backgroundColor: "white", - borderRadius: 90, + borderRadius: 3, height: SCREEN_HEIGHT * 0.08, borderColor: "#bfbdbd", borderWidth: 1, @@ -373,15 +379,19 @@ const styles = { }, scanQR: { //flexDirection: 'row', - paddingTop: 5, + flex:1, +//paddingTop: 5, backgroundColor: 10, + alignItems:'center', + padding:5, + paddingRight:15, - width: 80, - paddingLeft: 10, - backgroundColor: "#f24b4b", - borderBottomRightRadius: 90, - borderTopRightRadius: 90, - height: "100%" + //width: 80, + // paddingLeft: 10, + backgroundColor: "#CC1A17", + borderBottomRightRadius: 3, + borderTopRightRadius: 3, + // height: "100%" }, inputSection: { flexDirection: "row", @@ -389,7 +399,7 @@ const styles = { backgroundColor: "white", - borderRadius: 90, + borderRadius: 3, height: SCREEN_HEIGHT * 0.08, borderColor: "#bfbdbd", borderWidth: 1 @@ -448,7 +458,8 @@ const styles = { justifyContent: "center", alignItems: "center", - marginTop: 200 + marginTop: 200, + }, logo2: { From adef17b12e3a8e4be8d26cc29adbe61d7df6bfdd Mon Sep 17 00:00:00 2001 From: henrydays Date: Wed, 13 Mar 2019 00:36:42 +0000 Subject: [PATCH 08/13] =?UTF-8?q?reset=20em=20condi=C3=A7=C3=B5es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App/app/App.js | 18 +++++++------- App/app/store/actions/actionTypes.js | 2 +- App/app/store/actions/api.js | 36 +++++++++++++++++++++++++++- App/app/store/actions/index.js | 3 ++- App/package-lock.json | 5 ++++ App/package.json | 1 + 6 files changed, 54 insertions(+), 11 deletions(-) diff --git a/App/app/App.js b/App/app/App.js index f55f2fe2..33efa9f0 100755 --- a/App/app/App.js +++ b/App/app/App.js @@ -135,6 +135,7 @@ class App extends Component { //faz call _reset=()=>{ //fecha modal + this.props.resetPassword(this.props.userDetails.token,this.state.resetText), this.setState({modalResetPassword:false}) //faz call } @@ -193,12 +194,12 @@ class App extends Component { /> - @@ -207,15 +208,15 @@ class App extends Component { this.setState({ resetText })} + + onChangeText={r => this.setState({ resetText:r })} clearButtonMode="always" value={this.state.resetText} clearTextOnFocus={true} onSubmitEditing={Keyboard.dismiss} - placeholder="geral@enei.pt" + placeholder="Email ou Qr code" />