fixed merge problems

This commit is contained in:
José Valdiviesso 2019-03-09 18:10:26 +00:00
parent dede15911f
commit 5a2744f8c1
23 changed files with 226 additions and 707 deletions

View File

@ -23,8 +23,7 @@ import Scan from './screens/Scan'
import Calendar from './screens/Calendar'
import Home from './screens/Home'
import febrada from './screens/febrada'
import compras from './screens/compras'
/*Icons*/
@ -184,12 +183,6 @@ const Stack = createStackNavigator({
},
calendarDetail:{
screen:calendarDetail
},
febrada:{
screen:febrada
},
compras:{
screen: compras
}

View File

@ -49,16 +49,13 @@ class Calendar extends React.Component {
{key: 'fourth', weekDay: 'seg', day:15},
],
CP:'SEM'
};
componentDidMount() {
this.props.getEvents(this.props.user);
this.props.getSessions(this.props.userDetails.token)
console.log('didMount');
console.log(this.props.events);
}
_openDetails=()=>{
@ -138,7 +135,6 @@ class Calendar extends React.Component {
};
constructor() {
super()
@ -276,7 +272,7 @@ class Calendar extends React.Component {
textAlign:'center',
}}>
{this.props.careerPath}
WEB DEVELOPMENT
</Text>
</View>
<TabView
@ -388,10 +384,7 @@ function mapStateToProps(state, props) {
token: state.apiReducer.token,
user: state.apiReducer.user,
logged: state.apiReducer.logged,
events: state.apiReducer.events,
userDetails: state.apiReducer.userDetails,
sessions: state.apiReducer.sessions,
careerPath: state.apiReducer.careerPath
events: state.apiReducer.events
}
}

View File

@ -3,8 +3,7 @@ import {
View,
StyleSheet,
Dimensions,
Text,
Button
Text
} from 'react-native';
import { TabView, TabBar, SceneMap } from 'react-native-tab-view';
@ -45,10 +44,7 @@ export default class Eventos extends React.Component {
render() {
return (
<View>
<Button
title="Febrada"
onPress={() => this.props.navigation.navigate('febrada')}
/>
<Text>asd</Text>
</View>
);
}

View File

@ -162,8 +162,7 @@ _update=()=>{
</View>
</ImageBackground>
<TouchableOpacity onPress={() => this.props.navigation.navigate('compras')}>
<View style={styles.userStats}>
<Text style={styles.userStatsTitle}>O meu saldo:</Text>
@ -182,7 +181,7 @@ _update=()=>{
</View>
</View>
</View>
</TouchableOpacity>

View File

@ -14,7 +14,6 @@ import {
SectionList,
FlatList
} from 'react-native';
import moment from 'moment'
import {TabView, TabBar, SceneMap} from 'react-native-tab-view';
import {
@ -43,9 +42,7 @@ import IconF from "react-native-vector-icons/Foundation"
import LinearGradient from 'react-native-linear-gradient';
import ProgressBarAnimated from 'react-native-progress-bar-animated';
import IconFA from "react-native-vector-icons/FontAwesome5"
const formatObj = (obj) => {
let a = {};
@ -61,18 +58,6 @@ const formatObj = (obj) => {
class choosePath extends React.Component {
_verifySession=(Id)=>{
var sessions= this.props.user.Sessions
for(let key in sessions){
if(sessions[key].Id==Id)
return true
// cenas.push(result[key]);
console.log();
}
}
static navigationOptions = ({ navigation }) => ({
headerTitleStyle : {textAlign: 'center',alignSelf:'center'},
@ -88,31 +73,12 @@ class choosePath extends React.Component {
guest:'9'
};
_mount=()=>{
var sessions= this.props.sessions
for(let key in sessions){
if(sessions[key].Name=='IA'){
this.setState({guest:'9'})
}
}
}
componentDidMount() {
// this.props.getEvents(this.props.user);
this.props.getAvailableGuestlists(this.props.userDetails.token)
this.props.getSessions(this.props.userDetails.token)
this._mount()
//console.log('didMount');
// console.log(this.props.events);
console.log('didMount');
console.log(this.props.events);
}
@ -122,29 +88,11 @@ class choosePath extends React.Component {
console.log(this.props.events);
}
_findPath=(id)=> {
var sessions= this.props.sessions
for(let key in sessions){
if(sessions[key].Name==id){
return true;
}
}
return false
}
constructor() {
super()
this.state={
Blocks:[],
onHoldBlocks:true,
checked:true
}
this.data = [
@ -178,18 +126,14 @@ class choosePath extends React.Component {
});
};
_render=({item})=>{
<Text>Cenas: {item.Name}</Text>
}
render() {
return (
<ScrollView style={styles.page}>
{this._findPath('IA') && <LinearGradient colors={[ '#D95856', '#CC1A17']} style={styles.linearGradient}>
{this.state.guest=='9' && <LinearGradient colors={[ '#D95856', '#CC1A17']} style={styles.linearGradient}>
<Text style={{margin:15,marginBottom:0, fontWeight:'bold', color:'white'}}> Empresa responsável: </Text>
<View style={styles.companyContainer}>
<View style={styles.companyDescription}>
@ -205,7 +149,7 @@ aplicações essenciais aos negócios.</Text>
</View>
</View>
</LinearGradient>}
{this._findPath('NET') && <LinearGradient colors={[ '#5887FF', '#715AFF']} style={styles.linearGradient}>
{this.state.guest=='10' && <LinearGradient colors={[ '#5887FF', '#715AFF']} style={styles.linearGradient}>
<Text style={{margin:15,marginBottom:0, fontWeight:'bold', color:'white'}}> Empresa responsável: </Text>
<View style={styles.companyContainer}>
<View style={styles.companyDescription}>
@ -231,26 +175,16 @@ aplicações essenciais aos negócios.</Text>
selectedValue={this.state.guest}
style={{width:'100%'}}
onValueChange={(itemValue, itemIndex) =>{
this.setState({guest: itemValue})
this.props.timerChangeGuest();
this.props.waitChangeGuest();
this.props.changeGuestList(this.props.userDetails.token,itemValue)
// this.props.waitChangeGuest();
// this.props.getAvailableSessions(this.props.userDetails.token);
// this.props.waitChangeGuest();
// this.props.getSessionBlocks(this.props.sessions)
this.props.waitChangeGuest();
this.props.getAvailableSessions(this.props.userDetails.token);
}
}>
<Picker.Item label="Escolhe o teu career path!" value="0" />
<Picker.Item label="Inteligência Artificial" value="9" />
<Picker.Item label="Redes e Segurança" value="10" />
<Picker.Item label="Data Science" value="15" />
@ -260,13 +194,26 @@ aplicações essenciais aos negócios.</Text>
</Picker>
</View>
<View style={{width:SCREEN_WIDTH}}>
{
!this.props.changingGuest &&<FlatList
data={this.props.Blocks}
renderItem={({item, index}) => <View style={styles.block}>
<View style={styles.time}>
<FlatList
data={this.state.data}
renderItem={({ item }) => (
<ListItem
title={`${item.name.first} ${item.name.last}`}
subtitle={item.email}
avatar={{ uri: item.picture.thumbnail }}
containerStyle={{ borderBottomWidth: 0 }}
/>
)}
keyExtractor={item => item.email}
/>
</View >
{ !this.props.changingGuest &&
<View style={styles.block}>
<View style={styles.time}>
<Text style={
{
margin:10,
@ -275,8 +222,8 @@ aplicações essenciais aos negócios.</Text>
marginBottom:0
}
}>
{moment(item[0].SessionStart).format('HH:mm')}</Text>
<Text style={{marginLeft:20}}>às</Text>
9:00</Text>
<Text style={{marginLeft:20}}>até</Text>
<Text style={
{
margin:10,
@ -285,52 +232,77 @@ aplicações essenciais aos negócios.</Text>
marginTop:5
}
}>
{moment(item[0].SessionEnd).format('HH:mm')}</Text>
9:30</Text>
</View>
<View style={styles.sessions}>
<FlatList
data={item}
renderItem={({data, index}) => <View><View style={styles.session}>
{ this._verifySession(item[index].Id) &&
<TouchableOpacity>
<IconFA name="check-square" size={30} color={'#CC1A17'}/>
</TouchableOpacity>
}{
!this._verifySession(item[index].Id)
&&
<TouchableOpacity>
<IconFA name="square" size={30}/>
</TouchableOpacity>
}
<TouchableOpacity><View style={styles.sessionInfo}>
<Text style={styles.sessionTitle}>{item[index].Name}</Text>
<Text style={{marginTop:10, marginBottom:5}}>{item[index].MaxAttendees - item[index].Enrolled} Lugares disponíveis</Text>
<Progress.Bar color={'#000000'} progress={(item[index].Enrolled/item[index].MaxAttendees)} unfilledColor={'white'} width={170}/>
</View></TouchableOpacity>
</View>
<Divider style={{ backgroundColor: '#eeeeee' }} />
<View style={styles.session}>
</View>}
/>
</View>
</View>}
/>}</View>
<CheckBox
style={{margin:10}}
value={this.state.checkbox1}
onChange={() => this.setState({ checkbox1: !this.state.checkbox1 })}
/>
<TouchableOpacity><View style={styles.sessionInfo}>
<Text style={styles.sessionTitle}>Nome da palestra</Text>
<Text style={{marginTop:10, marginBottom:5}}>12 Lugares disponíveis</Text>
<Progress.Bar color={'#000000'} progress={0.3} unfilledColor={'white'} width={150}/>
</View></TouchableOpacity>
</View>
<Divider style={{ backgroundColor: '#eeeeee' }} />
<View style={styles.session}>
<CheckBox
style={{margin:10}}
value={this.state.checkbox1}
onChange={() => this.setState({ checkbox1: !this.state.checkbox1 })}
/>
<TouchableOpacity><View style={styles.sessionInfo}>
<Text style={styles.sessionTitle}>Nome da palestra</Text>
<Text style={{marginTop:10, marginBottom:5}}>12 Lugares disponíveis</Text>
<Progress.Bar color={'#000000'} progress={0.3} unfilledColor={'white'} width={150}/>
</View></TouchableOpacity>
</View>
</View >
{(this.props.changingGuest || this.props.Blocks==true) &&
<Divider style={{ backgroundColor: '#eeeeee' }} />
<ActivityIndicator size="large" color="red" style={{flex:1, alignContent:'center'}}/>
<View style={styles.session}>
<CheckBox
style={{margin:10}}
value={this.state.checkbox1}
onChange={() => this.setState({ checkbox1: !this.state.checkbox1 })}
/>
<TouchableOpacity><View style={styles.sessionInfo}>
<Text style={styles.sessionTitle}>Nome da palestra</Text>
<Text style={{marginTop:10, marginBottom:5}}>12 Lugares disponíveis</Text>
<Progress.Bar color={'#000000'} progress={0.3} unfilledColor={'white'} width={150}/>
</View></TouchableOpacity>
</View>
<Divider style={{ backgroundColor: '#eeeeee' }} />
</View>
</View>
}
{this.props.changingGuest &&
<ActivityIndicator size="large" color="red"/>
}
@ -374,7 +346,7 @@ const styles = StyleSheet.create({
},
time:{
alignContent:'center',
width:SCREEN_WIDTH*0.23,
width:SCREEN_WIDTH*0.20,
backgroundColor:'white'
},
@ -442,9 +414,6 @@ function mapStateToProps(state, props) {
calendar : state.apiReducer.calendar,
changingGuest : state.apiReducer.changingGuest,
sessions:state.apiReducer.sessions,
Blocks: state.apiReducer.Blocks,
onHoldBlocks:state.apiReducer.onHoldBlocks,
}

View File

@ -1,102 +0,0 @@
import * as React from 'react';
import {View, StyleSheet, Dimensions, Image, ScrollView, Text, Button, TouchableOpacity, Animated} from 'react-native';
import {TabView, TabBar, SceneMap} from 'react-native-tab-view';
import {
RkButton, RkCard, RkText,
RkTheme
} from 'react-native-ui-kitten';
import Timeline from 'react-native-timeline-feed'
import * as Progress from 'react-native-progress';
import {connect} from 'react-redux';
import {bindActionCreators} from 'redux';
import * as Actions from '../store/actions'; //Import your actionss
import { Slider } from 'react-native-elements';
function round(value, decimals) {
return Number(Math.round(value+'e'+decimals)+'e-'+decimals);
}
const SCREEN_HEIGHT = Dimensions.get("window").height;
const SCREEN_WIDTH = Dimensions.get("window").width;
class compras extends React.Component {
state = {
index: 0,
value:0
};
componentDidMount() {
this.props.getEvents(this.props.user);
console.log('didMount');
console.log(this.props.events);
}
constructor() {
super()
}
render() {
return (
<View style={{flex:1}}>
<View style={{ flex: 1, alignItems: 'stretch', justifyContent: 'center' ,width:SCREEN_WIDTH*0.7}}>
<Slider
maximumValue={20}
minimumValue={2}
value={this.state.value}
onValueChange={value => this.setState({ value })}
/>
<Text>Finos: {Math.round(this.state.value)}</Text>
</View>
<Text>Preço Unitário : { round(0.598 + 0.63 * Math.pow(Math.E ,(-0.221* this.state.value)),2)}</Text>
<Text>Preço total: {round((0.598 + 0.63 * Math.pow(Math.E ,(-0.221* this.state.value)))* this.state.value,2)}</Text>
<Button
title="PAGAR COM MBWAY"
onPress={() => this.props.navigation.navigate('febrada')}
/>
</View>
);
}
}
const styles = StyleSheet.create({
});
function mapStateToProps(state, props) {
return {
token: state.apiReducer.token,
user: state.apiReducer.user,
logged: state.apiReducer.logged,
events: state.apiReducer.events,
userDetails: state.apiReducer.userDetails,
}
}
function mapDispatchToProps(dispatch) {
return bindActionCreators(Actions, dispatch);
}
export default connect(mapStateToProps, mapDispatchToProps)(compras);

View File

@ -1,92 +0,0 @@
import * as React from 'react';
import {View, StyleSheet, Dimensions, Image, ScrollView, Text, Button, TouchableOpacity, Animated} from 'react-native';
import {TabView, TabBar, SceneMap} from 'react-native-tab-view';
import {
RkButton, RkCard, RkText,
RkTheme
} from 'react-native-ui-kitten';
import Timeline from 'react-native-timeline-feed'
import * as Progress from 'react-native-progress';
import {connect} from 'react-redux';
import {bindActionCreators} from 'redux';
import * as Actions from '../store/actions'; //Import your actionss
import { Slider } from 'react-native-elements';
const SCREEN_HEIGHT = Dimensions.get("window").height;
const SCREEN_WIDTH = Dimensions.get("window").width;
class febrada extends React.Component {
state = {
index: 0,
};
componentDidMount() {
this.props.getEvents(this.props.user);
console.log('didMount');
console.log(this.props.events);
}
constructor() {
super()
}
render() {
return (
<View style={{flex:1}}>
<View style={{ flex: 1, alignItems: 'stretch', justifyContent: 'center' ,width:SCREEN_WIDTH*0.7}}>
<Slider
maximumValue={50}
minimumValue={2}
value={this.state.value}
onValueChange={value => this.setState({ value })}
/>
<Text>Value: {Math.round(this.state.value)}</Text>
</View></View>
);
}
}
const styles = StyleSheet.create({
});
function mapStateToProps(state, props) {
return {
token: state.apiReducer.token,
user: state.apiReducer.user,
logged: state.apiReducer.logged,
events: state.apiReducer.events,
userDetails: state.apiReducer.userDetails,
}
}
function mapDispatchToProps(dispatch) {
return bindActionCreators(Actions, dispatch);
}
export default connect(mapStateToProps, mapDispatchToProps)(febrada);

View File

@ -17,8 +17,7 @@ export const CHANGE_GUEST = 'CHANGE_GUEST'
export const GET_SESSIONS= 'GET_SESSIONS'
export const SIGN_SESSION= 'SIGN_SESSION'
export const WAIT_CHANGE='WAIT_CHANGE'
export const SESSION_BLOCKS='SESSION_BLOCKS'
export const TIMERWAIT_CHANGE='TIMERWAIT_CHANGE'
//UI

View File

@ -2,18 +2,13 @@ import { AsyncStorage } from 'react-native';
import { NetInfo } from 'react-native';
var _ = require('lodash');
import {TIMERWAIT_CHANGE,SESSION_BLOCKS, DATA_AVAILABLE, API_LOGIN, CHECK_USER, LOGOUT_USER, USER_INFO, HOLD, GET_EVENTS, GET_CAREERS, GET_SESSIONS, CHANGE_GUEST, WAIT_CHANGE } from "./actionTypes" //Import the actions types constant we defined in our actions
import { DATA_AVAILABLE, API_LOGIN, CHECK_USER, LOGOUT_USER, USER_INFO, HOLD, GET_EVENTS, GET_CAREERS, GET_SESSIONS, CHANGE_GUEST, WAIT_CHANGE } from "./actionTypes" //Import the actions types constant we defined in our actions
import moment from 'moment'
import { compose } from 'redux';
import tap from "lodash/fp/tap";
import flow from "lodash/fp/flow";
import groupBy from "lodash/fp/groupBy";
const axios = require('axios');
axios.defaults.baseURL = 'http://enei2019.uingress.com/internal/api'
@ -21,22 +16,17 @@ axios.defaults.baseURL = 'http://enei2019.uingress.com/internal/api'
//http://enei2019.uingress.com/internal/api/Attendee/Edit
const map = require('lodash/fp/map').convert({ 'cap': false });
export function updateUser(token, user){
axios.defaults.headers.common = {'Authorization': `bearer ${token.access_token}`}
console.log("asdasdasdasd")
return (dispatch)=>{
axios.post('/Attendee/Edit', user).then(a=>{
console.log(a);
alert("guardado com sucesso")
dispatch({
type: UPDATE_USER
axios.post('/Attendee/Edit', user).then(a=>{
console.log(a);
alert("guardado com sucesso")
dispatch({
type: UPDATE_USER
// guests: response.data
});
@ -53,16 +43,6 @@ export const waitChangeGuest= ()=>{
return (dispatch)=>{
dispatch({
type: WAIT_CHANGE,
});
}
}
export const timerChangeGuest= ()=>{
return (dispatch)=>{
dispatch({
type: TIMERWAIT_CHANGE,
});
}
@ -79,85 +59,13 @@ export const connectionState = (status) => {
///Attendee/AvailableGuestlists
export function signSession(token, idSession){
//http://enei2019.uingress.com/internal/api/Session/AddAttendee
axios.defaults.headers.common = {'Authorization': `bearer ${token.access_token}`}
var obj={
"IdSession": idSession,
"Direction": 0
}
axios.post('/Session/AddAttendee', user).then(a=>{
console.log(a);
alert("guardado com sucesso")
dispatch({
type: UPDATE_USER
// guests: response.data
});
}).catch(b=>{
alert("Erro a guardar os dados")
});
}
export function getSessions(token){
console.log("aquiiii")
axios.defaults.headers.common = {'Authorization': `bearer ${token.access_token}`}
return (dispatch)=>{
axios.defaults.baseURL = 'http://enei2019.uingress.com/internal/api'
axios.defaults.headers.common = {'Authorization': `bearer ${token.access_token}`}
axios.get('/Attendee/AvailableSessions')
.then(function (response) {
var careerPath='SEM'
var sessions= response.data;
var cenas=[];
for(let key in sessions){
if(sessions[key].Name=='IA'){
careerPath='IA'
}
}
const result = flow(
groupBy('SessionStart'),
// map((Id) => ({Id})),
//tap(console.log)
)(response.data)
for(let key in result){
result[key].option=0;
cenas.push(result[key]);
}
dispatch({
type: GET_SESSIONS,
sessions: response.data,
Blocks: cenas,
careerPath:careerPath
//guests: response.data
});
})
.catch(function (error) {
alert("Error a obter sessões disponíveis!!");
console.log(error);
})
}
}
export function getAvailableGuestlists(token){
axios.defaults.headers.common = {'Authorization': `bearer ${token.access_token}`}
return (dispatch)=>{
@ -165,9 +73,6 @@ export function getAvailableGuestlists(token){
axios.get('/Attendee/AvailableGuestlists')
.then(function (response) {
// handle success
console.log(response);
dispatch({
@ -208,87 +113,28 @@ export function changeGuestList(token, guestID){
return (dispatch)=>{
var full= `/Attendee/ChangeGuestlist/${guestID}`
console.log(full)
axios.get(full)
.then(function (response) {
axios.defaults.baseURL = 'http://enei2019.uingress.com/internal/api'
axios.defaults.headers.common = {'Authorization': `bearer ${token.access_token}`}
// handle success
console.log(response);
dispatch({
type: CHANGE_GUEST,
//guests: response.data
axios.get('/Attendee/AvailableSessions')
.then(function (response) {
// handle success
//console.log(response);
var cenas=[];
const result = flow(
groupBy('SessionStart'),
// map((Id) => ({Id})),
//tap(console.log)
)(response.data)
for(let key in result){
result[key].option=0;
cenas.push(result[key]);
console.log();
}
console.log(cenas);
dispatch({
type: CHANGE_GUEST,
sessions: response.data,
Blocks: cenas
//guests: response.data
});
})
.catch(function (error) {
alert("Error a obter sessões disponíveis!!");
console.log(error);
})
});
})
.catch(function (error) {
// handle error
console.log(response);
console.log(error);
alert("Erro a mudar de career path")
})
.then(function () {
// always executed
});
}
}
export function getSessionBlocks(sessions){
var a;
var cenas=[];
const result = flow(
groupBy('SessionStart'),
// map((Id) => ({Id})),
//tap(console.log)
)(sessions)
return(dispatch)=>{
for(let key in result){
cenas.push(result[key]);
console.log();
}
console.log(cenas);
dispatch({
type:SESSION_BLOCKS,
Blocks: cenas
})
}}
export function getAvailableSessions(token){
//http://enei2019.uingress.com/internal/api/Attendee/AvailableSessions
@ -304,32 +150,19 @@ export function getAvailableSessions(token){
// handle success
console.log(response);
var cenas=[];
const result = flow(
groupBy('SessionStart'),
// map((Id) => ({Id})),
//tap(console.log)
)(response.data)
for(let key in result){
cenas.push(result[key]);
console.log();
}
dispatch({
type: GET_SESSIONS,
sessions: response.data,
Blocks: cenas
sessions: response.data
});
})
.catch(function (error) {
alert("Error a obter sessões disponíveis!!");
console.log(error);
})
.then(function () {
// always executed
});
}
}
@ -345,8 +178,8 @@ export function getEvents(user){
for(let key in user.Sessions){
events.push({
time: moment(user.Sessions[key].SessionStart).format('HH:mm'),
timeEnd: moment(user.Sessions[key].SessionEnd).format('HH:mm'),
time: moment(user.Sessions[key].SessionStart).format('h:mm'),
timeEnd: moment(user.Sessions[key].SessionEnd).format('h:mm'),
//lineColor:'#009688',
imageUrl: 'https://d2v9y0dukr6mq2.cloudfront.net/video/thumbnail/Vjkyj2hBg/welcome-white-sign-with-falling-colorful-confetti-animation-on-white-background_sglmmh3qm__F0013.png',
description:user.Sessions[key].Description,

View File

@ -7,9 +7,6 @@ export {checkUser,
waitChangeGuest,
getAvailableSessions,
updateUser,
getSessionBlocks,
timerChangeGuest,
getSessions,
} from "./api"
export {

View File

@ -1,4 +1,4 @@
import { DATA_AVAILABLE, API_LOGIN, CHECK_USER, LOGOUT_USER, USER_INFO, HOLD, GET_EVENTS, GET_CAREERS, CHANGE_GUEST, WAIT_CHANGE, GET_SESSIONS, SESSION_BLOCKS, TIMERWAIT_CHANGE } from "../actions/actionTypes" //Import the actions types constant we defined in our actions
import { DATA_AVAILABLE, API_LOGIN, CHECK_USER, LOGOUT_USER, USER_INFO, HOLD, GET_EVENTS, GET_CAREERS, CHANGE_GUEST, WAIT_CHANGE, GET_SESSIONS } from "../actions/actionTypes" //Import the actions types constant we defined in our actions
import { REHYDRATE } from 'redux-persist';
let apiState= {
@ -20,10 +20,7 @@ let apiState= {
},
changingGuest:false,
sessions:{},
Blocks:{},
onHoldBlocks:true,
careerPath:'SEM'
sessions:{}
}
@ -39,7 +36,6 @@ const apiReducer = (state = apiState, action) => {
var expirationDateTokenA=0;
var access_tokenA='';
if(action.payload.apiReducer.userDetails.token!=undefined){
@ -60,7 +56,7 @@ const apiReducer = (state = apiState, action) => {
// token: action.payload.apiReducer.token,
user: action.payload.apiReducer.user,
onHoldBlocks:true,
userDetails:{
token:{
expirationDateToken: expirationDateTokenA,
@ -158,9 +154,7 @@ const apiReducer = (state = apiState, action) => {
case SESSION_BLOCKS:
state=Object.assign({},state, { Blocks: action.Blocks, onHoldBlocks:false, changingGuest:false});
return state;
case GET_CAREERS:
var c= {
@ -171,18 +165,15 @@ const apiReducer = (state = apiState, action) => {
return state;
case CHANGE_GUEST:
state=Object.assign({},state, { changingGuest:false, sessions:action.sessions, Blocks:action.Blocks});
state=Object.assign({},state, { changingGuest:false});
return state;
case WAIT_CHANGE:
state=Object.assign({},state, { changingGuest:true});
return state;
case TIMERWAIT_CHANGE:
state=Object.assign({},state, { Blocks:true});
return state;
case GET_SESSIONS:
state=Object.assign({},state, { sessions:action.sessions, Blocks: action.Blocks, careerPath:action.careerPath});
state=Object.assign({},state, { changingGuest:false, sessions:action.sessions});
return state;
default:
return state;

View File

@ -5,7 +5,6 @@
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; };
00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; };
@ -36,7 +35,6 @@
2D16E6881FA4F8E400B85C8A /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2D16E6891FA4F8E400B85C8A /* libReact.a */; };
2DCD954D1E0B4F2C00145EB5 /* appTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* appTests.m */; };
2DF0FFEE2056DD460020B375 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3EA31DF850E9000B6D8A /* libReact.a */; };
4EBB88037B054A508BF35245 /* libRNDeviceInfo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0F42241E0235464C91B24049 /* libRNDeviceInfo.a */; };
514DB1DF2E3B452F9EF272E3 /* libRNVectorIcons-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 95B0A42B6CD8441E904E6EB9 /* libRNVectorIcons-tvOS.a */; };
69E1B84AE0DF486CB1B1D226 /* libBVLinearGradient.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C00CE8A4E3B747F9816B91CF /* libBVLinearGradient.a */; };
832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; };
@ -60,6 +58,7 @@
BE5EAB86221B7D5400E92E5B /* Zocial.ttf in Resources */ = {isa = PBXBuildFile; fileRef = BE5EAB77221B7D5400E92E5B /* Zocial.ttf */; };
BE5EAC3A221B83CF00E92E5B /* Ionicons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = BE302B75221B7C3B005626CF /* Ionicons.ttf */; };
BE5EAC41221B889900E92E5B /* libReactNativePermissions.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BE5EAC40221B888C00E92E5B /* libReactNativePermissions.a */; };
4EBB88037B054A508BF35245 /* libRNDeviceInfo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0F42241E0235464C91B24049 /* libRNDeviceInfo.a */; };
E677346A94D54E90817979B0 /* libRNDeviceInfo-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3C4D43A092A4408B91B32E76 /* libRNDeviceInfo-tvOS.a */; };
/* End PBXBuildFile section */
@ -337,20 +336,6 @@
remoteGlobalIDString = 358F4ED71D1E81A9004DF814;
remoteInfo = RCTBlob;
};
BE05D7E2222EFEA100EC8AFD /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 5BA133418E6F4967BC5BC234 /* RNDeviceInfo.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = DA5891D81BA9A9FC002B4DB2;
remoteInfo = RNDeviceInfo;
};
BE05D7E4222EFEA100EC8AFD /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 5BA133418E6F4967BC5BC234 /* RNDeviceInfo.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = E72EC1401F7ABB5A0001BC90;
remoteInfo = "RNDeviceInfo-tvOS";
};
BE302B6B221B7860005626CF /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = BE302B67221B7860005626CF /* RNCamera.xcodeproj */;
@ -412,7 +397,6 @@
00E356EE1AD99517003FC87E /* appTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = appTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
00E356F21AD99517003FC87E /* appTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = appTests.m; sourceTree = "<group>"; };
0F42241E0235464C91B24049 /* libRNDeviceInfo.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNDeviceInfo.a; sourceTree = "<group>"; };
139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = "../node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj"; sourceTree = "<group>"; };
139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = "../node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj"; sourceTree = "<group>"; };
13B07F961A680F5B00A75B9A /* app.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = app.app; sourceTree = BUILT_PRODUCTS_DIR; };
@ -427,8 +411,6 @@
2D02E47B1E0B4A5D006451C7 /* app-tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "app-tvOS.app"; sourceTree = BUILT_PRODUCTS_DIR; };
2D02E4901E0B4A5D006451C7 /* app-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "app-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
2D16E6891FA4F8E400B85C8A /* libReact.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libReact.a; sourceTree = BUILT_PRODUCTS_DIR; };
3C4D43A092A4408B91B32E76 /* libRNDeviceInfo-tvOS.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = "libRNDeviceInfo-tvOS.a"; sourceTree = "<group>"; };
5BA133418E6F4967BC5BC234 /* RNDeviceInfo.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNDeviceInfo.xcodeproj; path = "../node_modules/react-native-device-info/ios/RNDeviceInfo.xcodeproj"; sourceTree = "<group>"; };
5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAnimation.xcodeproj; path = "../node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj"; sourceTree = "<group>"; };
664970B9D10A41A18B44727F /* RNVectorIcons.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNVectorIcons.xcodeproj; path = "../node_modules/react-native-vector-icons/RNVectorIcons.xcodeproj"; sourceTree = "<group>"; };
78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = "<group>"; };
@ -455,6 +437,9 @@
BE5EAC3B221B888C00E92E5B /* ReactNativePermissions.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ReactNativePermissions.xcodeproj; path = "../node_modules/react-native-permissions/ios/ReactNativePermissions.xcodeproj"; sourceTree = "<group>"; };
C00CE8A4E3B747F9816B91CF /* libBVLinearGradient.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libBVLinearGradient.a; sourceTree = "<group>"; };
EB0A5A258CBE4EEFAD3C358E /* libRNVectorIcons.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNVectorIcons.a; sourceTree = "<group>"; };
5BA133418E6F4967BC5BC234 /* RNDeviceInfo.xcodeproj */ = {isa = PBXFileReference; name = "RNDeviceInfo.xcodeproj"; path = "../node_modules/react-native-device-info/ios/RNDeviceInfo.xcodeproj"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; };
0F42241E0235464C91B24049 /* libRNDeviceInfo.a */ = {isa = PBXFileReference; name = "libRNDeviceInfo.a"; path = "libRNDeviceInfo.a"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };
3C4D43A092A4408B91B32E76 /* libRNDeviceInfo-tvOS.a */ = {isa = PBXFileReference; name = "libRNDeviceInfo-tvOS.a"; path = "libRNDeviceInfo-tvOS.a"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -731,15 +716,6 @@
name = Products;
sourceTree = "<group>";
};
BE05D7DE222EFEA000EC8AFD /* Products */ = {
isa = PBXGroup;
children = (
BE05D7E3222EFEA100EC8AFD /* libRNDeviceInfo.a */,
BE05D7E5222EFEA100EC8AFD /* libRNDeviceInfo-tvOS.a */,
);
name = Products;
sourceTree = "<group>";
};
BE302B68221B7860005626CF /* Products */ = {
isa = PBXGroup;
children = (
@ -784,8 +760,6 @@
EB0A5A258CBE4EEFAD3C358E /* libRNVectorIcons.a */,
95B0A42B6CD8441E904E6EB9 /* libRNVectorIcons-tvOS.a */,
C00CE8A4E3B747F9816B91CF /* libBVLinearGradient.a */,
0F42241E0235464C91B24049 /* libRNDeviceInfo.a */,
3C4D43A092A4408B91B32E76 /* libRNDeviceInfo-tvOS.a */,
);
name = "Recovered References";
sourceTree = "<group>";
@ -902,7 +876,6 @@
TargetAttributes = {
00E356ED1AD99517003FC87E = {
CreatedOnToolsVersion = 6.2;
DevelopmentTeam = HLA62A6826;
TestTargetID = 13B07F861A680F5B00A75B9A;
};
13B07F861A680F5B00A75B9A = {
@ -991,10 +964,6 @@
ProductGroup = BE302B68221B7860005626CF /* Products */;
ProjectRef = BE302B67221B7860005626CF /* RNCamera.xcodeproj */;
},
{
ProductGroup = BE05D7DE222EFEA000EC8AFD /* Products */;
ProjectRef = 5BA133418E6F4967BC5BC234 /* RNDeviceInfo.xcodeproj */;
},
{
ProductGroup = BE302B6F221B7AC7005626CF /* Products */;
ProjectRef = BE302B6E221B7AC7005626CF /* RNGestureHandler.xcodeproj */;
@ -1274,20 +1243,6 @@
remoteRef = ADBDB9261DFEBF0700ED6528 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
BE05D7E3222EFEA100EC8AFD /* libRNDeviceInfo.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libRNDeviceInfo.a;
remoteRef = BE05D7E2222EFEA100EC8AFD /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
BE05D7E5222EFEA100EC8AFD /* libRNDeviceInfo-tvOS.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = "libRNDeviceInfo-tvOS.a";
remoteRef = BE05D7E4222EFEA100EC8AFD /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
BE302B6C221B7860005626CF /* libRNCamera.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
@ -1486,7 +1441,6 @@
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
DEVELOPMENT_TEAM = HLA62A6826;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
@ -1523,7 +1477,6 @@
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
COPY_PHASE_STRIP = NO;
DEVELOPMENT_TEAM = HLA62A6826;
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager",

View File

@ -10,7 +10,6 @@
"@redux-offline/redux-offline": "^2.5.1",
"axios": "^0.18.0",
"expo": "^32.0.5",
"lodash": "^4.17.11",
"material-icons-react": "^1.0.4",
"moment": "^2.24.0",
"prop-types": "^15.6.2",

View File

@ -66,21 +66,14 @@ namespace api.Controllers
[HttpPost("add")]
public async Task<IActionResult> AddEventLoc(EventLocVisitedAdd EventLocVisitedData)
{
List<Team> uTeam = await context.Teams.Include(t=>t.Membros).ToListAsync();
EventLoc Loc = await context.EventLocs.FirstOrDefaultAsync(a=>a.Id == EventLocVisitedData.EventLocID);
var userT = await context.Users.FirstOrDefaultAsync(u=>u.QRcode==EventLocVisitedData.USerQR);
Team TeamToEdit = new Team();
if(userT.team == null){
return StatusCode(403);
}
uTeam.ForEach(delegate (Team t){
if(t.EventId == Loc.EventId){
t.Membros.ForEach(delegate (User u){
if(u.QRcode == EventLocVisitedData.USerQR){
TeamToEdit = t;
}
});
}
});
Team TeamToEdit = userT.team;
TeamToEdit.Pontos += EventLocVisitedData.pontos;

View File

@ -68,21 +68,24 @@ namespace api.Controllers
User tCap = await context.Users.FirstOrDefaultAsync(u=>u.QRcode == TeamAddDetails.capQR);
List<User> memb = new List<User>();
if(tCap.team == null){
Team tAdd = new Team{EventId = TeamAddDetails.EventId, Nome = TeamAddDetails.Nome, Cap = tCap, NMembros = 1, Pontos = 0};
memb.Add(tCap);
tCap.team = tAdd;
Team tAdd = new Team{EventId = TeamAddDetails.EventId, Nome = TeamAddDetails.Nome, Cap = tCap, Membros = memb, NMembros = 1, Pontos = 0};
await context.Teams.AddAsync(tAdd);
context.Users.Update(tCap);
await context.Teams.AddAsync(tAdd);
var result = context.SaveChanges();
if (result == 1)
{
return StatusCode(201);
}
return BadRequest();
var result = context.SaveChanges();
if (result >= 1)
{
return StatusCode(201);
}
return BadRequest();
}else{
return BadRequest();
}
}
@ -94,35 +97,22 @@ namespace api.Controllers
User newMember = await context.Users.FirstOrDefaultAsync(u=>u.QRcode == MemberToAdd.newQR);
Team tEdit = await context.Teams.Include(t=>t.Membros).FirstOrDefaultAsync(t=>t.Id == MemberToAdd.id);
Team tEdit = await context.Teams.FirstOrDefaultAsync(t=>t.Id == MemberToAdd.id);
List<Team> allTeams = await context.Teams.Include(t=>t.Membros).Include(t=>t.Cap).ToListAsync();
var valido = true;
allTeams.ForEach(delegate(Team t){
if(newMember == t.Cap){
valido = false;
}
t.Membros.ForEach(delegate(User m){
if(newMember == m){
valido = false;
}
});
});
if(valido){
if(newMember.team == null){
tEdit.NMembros++;
tEdit.Membros.Add(newMember);
newMember.team = tEdit;
context.Update(tEdit);
context.Teams.Update(tEdit);
context.Users.Update(newMember);
var result = context.SaveChanges();
return StatusCode(201);
}
return StatusCode(403);
return StatusCode(201);
}else{
return StatusCode(403);
}
}
@ -140,7 +130,7 @@ namespace api.Controllers
tEdit.Nome = NameChange.nome;
}
context.Update(tEdit);
context.Teams.Update(tEdit);