change guests
This commit is contained in:
parent
e36614b55f
commit
ffd5d41b13
|
@ -145,7 +145,24 @@ const Stack = createStackNavigator({
|
|||
)
|
||||
}
|
||||
}
|
||||
|
||||
else if(navigation.state.routes[index].routeName == 'choosePath'){
|
||||
return {
|
||||
headerTitle: 'Calendário',
|
||||
headerRight: (
|
||||
<View style={{flex:1, flexDirection:'row'}}>
|
||||
<TouchableOpacity style={{marginRight: 20, flex:1, flexDirection:'row'}} onPress={() => navigation.navigate('Edit')}>
|
||||
<Text>FAQ</Text>
|
||||
|
||||
</TouchableOpacity>
|
||||
|
||||
<TouchableOpacity style={{marginRight: 20, flex:1, flexDirection:'row'}} onPress={() => navigation.navigate('choosePath')}>
|
||||
<Text>Escolher</Text>
|
||||
<IconFA name="user-edit" size={22}/>
|
||||
</TouchableOpacity></View>
|
||||
|
||||
)
|
||||
}
|
||||
}
|
||||
else {
|
||||
return {
|
||||
header: null
|
||||
|
|
|
@ -7,7 +7,9 @@ import {
|
|||
ScrollView,
|
||||
Text,
|
||||
Button,
|
||||
TouchableOpacity
|
||||
TouchableOpacity,
|
||||
Picker,
|
||||
CheckBox
|
||||
} from 'react-native';
|
||||
|
||||
import {TabView, TabBar, SceneMap} from 'react-native-tab-view';
|
||||
|
@ -32,8 +34,8 @@ const SCREEN_WIDTH = Dimensions.get("window").width;
|
|||
import FitImage from 'react-native-fit-image';
|
||||
|
||||
import { Dropdown } from 'react-native-material-dropdown';
|
||||
|
||||
|
||||
import {Card, Divider} from 'react-native-elements'
|
||||
import IconF from "react-native-vector-icons/Foundation"
|
||||
const formatObj = (obj) => {
|
||||
|
||||
let a = {};
|
||||
|
@ -48,13 +50,24 @@ const formatObj = (obj) => {
|
|||
|
||||
class choosePath extends React.Component {
|
||||
|
||||
state = {
|
||||
static navigationOptions = ({ navigation }) => ({
|
||||
|
||||
headerTitleStyle : {textAlign: 'center',alignSelf:'center'},
|
||||
headerStyle:{
|
||||
backgroundColor:'rgba(0,0,0,0)',
|
||||
shadowRadius:0,
|
||||
elevation:0
|
||||
},
|
||||
});
|
||||
|
||||
state = {
|
||||
calendar:{}
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
|
||||
this.props.getEvents(this.props.user);
|
||||
// this.props.getEvents(this.props.user);
|
||||
this.props.getAvailableGuestlists(this.props.userDetails.token)
|
||||
console.log('didMount');
|
||||
console.log(this.props.events);
|
||||
}
|
||||
|
@ -80,101 +93,217 @@ class choosePath extends React.Component {
|
|||
]
|
||||
}
|
||||
getCareerPaths=()=>{
|
||||
this.props.getAvailableGuestlists(this.props.userDetails.token)
|
||||
}
|
||||
render() {
|
||||
let data = [{
|
||||
value: 'Desenvolvimento Web',
|
||||
}, {
|
||||
value: 'Inteligencia artificial',
|
||||
}, {
|
||||
value: 'Redes e segurança',
|
||||
}];
|
||||
|
||||
return (
|
||||
<View style={{flex:1,width:SCREEN_WIDTH*0.7, alignContent:'center'}}>
|
||||
|
||||
<Dropdown
|
||||
label='Career Path'
|
||||
data={data}
|
||||
|
||||
/>
|
||||
|
||||
<Button onPress={this.getCareerPaths} title="teste"/>
|
||||
</View>
|
||||
this.props.getAvailableGuestlists(this.props.userDetails.token)
|
||||
console.log(this.props.calendar)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
render() {
|
||||
|
||||
|
||||
return (
|
||||
<ScrollView style={styles.page}>
|
||||
|
||||
<View style={styles.companyContainer}>
|
||||
|
||||
</View>
|
||||
|
||||
<View style={{flex:1,width:SCREEN_WIDTH*0.7, alignContent:'center'}}>
|
||||
|
||||
|
||||
<View style={styles.pickerCareer}>
|
||||
<Picker
|
||||
selectedValue={this.state.guest}
|
||||
style={{width:'100%'}}
|
||||
onValueChange={(itemValue, itemIndex) =>{
|
||||
this.setState({guest: itemValue})
|
||||
this.props.changeGuestList(this.props.userDetails.token,itemValue)
|
||||
}
|
||||
|
||||
}>
|
||||
<Picker.Item label="Inteligência Artificial" value="9" />
|
||||
<Picker.Item label="Redes e Segurança" value="10" />
|
||||
<Picker.Item label="Data Science" value="15" />
|
||||
<Picker.Item label="Desenvolvimento Web" value="14" />
|
||||
<Picker.Item label="Internet das Coisas" value="12" />
|
||||
<Picker.Item label="Desenvolvimento Mobile" value="11" />
|
||||
|
||||
</Picker>
|
||||
</View>
|
||||
|
||||
|
||||
|
||||
</View>
|
||||
|
||||
|
||||
<View style={styles.block}>
|
||||
|
||||
<View style={styles.time}>
|
||||
<Text style={
|
||||
{
|
||||
margin:10,
|
||||
fontSize:25,
|
||||
color:'#CC1A17',
|
||||
marginBottom:0
|
||||
}
|
||||
}>
|
||||
9:00</Text>
|
||||
<Text style={{marginLeft:20}}>até</Text>
|
||||
<Text style={
|
||||
{
|
||||
margin:10,
|
||||
fontSize:25,
|
||||
color:'#CC1A17',
|
||||
marginTop:5
|
||||
}
|
||||
}>
|
||||
9:30</Text>
|
||||
|
||||
</View>
|
||||
|
||||
<View style={styles.sessions}>
|
||||
|
||||
<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 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 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>
|
||||
|
||||
|
||||
|
||||
|
||||
</ScrollView>
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
|
||||
carreerPathContainer:{
|
||||
backgroundColor:'#CC1A17',
|
||||
height:50,
|
||||
flex:1,
|
||||
alignItems:'center',
|
||||
justifyContent:'center',
|
||||
paddingTop:15,
|
||||
sessionInfo:{
|
||||
margin:5
|
||||
},
|
||||
carreerPathText:{
|
||||
|
||||
height:50,
|
||||
color:'white',
|
||||
fontWeight:'bold',
|
||||
sessionTitle:{
|
||||
fontSize:15,
|
||||
fontWeight:'bold'
|
||||
},
|
||||
day:{
|
||||
margin:10
|
||||
},
|
||||
dayText:{
|
||||
fontSize:20,
|
||||
|
||||
},
|
||||
companyHeader:{
|
||||
backgroundColor:'#dddddd',
|
||||
// height:150,
|
||||
borderRadius:5,
|
||||
margin:10,
|
||||
padding:10
|
||||
|
||||
|
||||
},
|
||||
companyTitle:{
|
||||
paddingBottom:5,
|
||||
fontWeight:'bold',
|
||||
color:'#777777',
|
||||
fontSize:17,
|
||||
|
||||
// padding:20
|
||||
},
|
||||
companyLogo: {
|
||||
|
||||
borderRadius: 20,
|
||||
|
||||
},
|
||||
|
||||
wrapper: {
|
||||
color: '#CC1A17',
|
||||
textAlign: 'center',
|
||||
|
||||
},
|
||||
company:{
|
||||
time:{
|
||||
alignContent:'center',
|
||||
width:SCREEN_WIDTH*0.20,
|
||||
backgroundColor:'white'
|
||||
},
|
||||
|
||||
block:{
|
||||
|
||||
flex:1,
|
||||
flexDirection:'row',
|
||||
// backgroundColor:'red',
|
||||
color:'black'
|
||||
},
|
||||
|
||||
companyLogoContainer:{
|
||||
flex:1,
|
||||
justifyContent: 'center',
|
||||
width:'60%',
|
||||
// backgroundColor:'white',
|
||||
margin:20,
|
||||
|
||||
backgroundColor:'red',
|
||||
margin:10,
|
||||
borderRadius:5
|
||||
|
||||
},
|
||||
aboutCompany:{
|
||||
width:SCREEN_WIDTH,
|
||||
flex:1,
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
}
|
||||
|
||||
companyContainer:{
|
||||
flex:1,
|
||||
backgroundColor:'blue',
|
||||
height:SCREEN_HEIGHT*0.25,
|
||||
|
||||
},
|
||||
|
||||
|
||||
sessions:{
|
||||
flex:1,
|
||||
flexDirection:'column',
|
||||
|
||||
backgroundColor:'white',
|
||||
|
||||
},
|
||||
|
||||
page:{
|
||||
backgroundColor:'#eeeeee',
|
||||
|
||||
},
|
||||
pickerCareer:{
|
||||
|
||||
paddingLeft:30,
|
||||
paddingRight:30,
|
||||
backgroundColor:'white',
|
||||
width:SCREEN_WIDTH,
|
||||
|
||||
},
|
||||
session:{
|
||||
margin:10,
|
||||
flex:1,
|
||||
flexDirection:'row',
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
@ -184,11 +313,12 @@ function mapStateToProps(state, props) {
|
|||
|
||||
return {
|
||||
|
||||
token: state.apiReducer.token,
|
||||
// token: state.apiReducer.token,
|
||||
user: state.apiReducer.user,
|
||||
logged: state.apiReducer.logged,
|
||||
events: state.apiReducer.events,
|
||||
userDetails: state.apiReducer.userDetails
|
||||
userDetails: state.apiReducer.userDetails,
|
||||
calendar : state.apiReducer.calendar
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -9,9 +9,14 @@ export const LOGOUT_USER= 'LOGOUT_USER';
|
|||
export const USER_INFO= 'USER_INFO'
|
||||
export const HOLD='HOLD'
|
||||
export const GET_EVENTS='GET_EVENTS'
|
||||
export const GET_CAREERS='GET_CAREERS'
|
||||
|
||||
|
||||
//API BLUETREND CALENDÁRIO
|
||||
export const GET_CAREERS='GET_CAREERS' //GET GEST LISTS
|
||||
export const CHANGE_GUEST = 'CHANGE_GUEST'
|
||||
export const GET_SESSIONS= 'GET_SESSIONS'
|
||||
export const SIGN_SESSION= 'SIGN_SESSION'
|
||||
|
||||
|
||||
|
||||
//UI
|
||||
|
|
|
@ -3,7 +3,7 @@ import { AsyncStorage } from 'react-native';
|
|||
import { NetInfo } from 'react-native';
|
||||
|
||||
|
||||
import { DATA_AVAILABLE, API_LOGIN, CHECK_USER, LOGOUT_USER, USER_INFO, HOLD, GET_EVENTS, GET_CAREERS } 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 } from "./actionTypes" //Import the actions types constant we defined in our actions
|
||||
|
||||
import moment from 'moment'
|
||||
|
||||
|
@ -14,6 +14,7 @@ const axios = require('axios');
|
|||
|
||||
|
||||
export const connectionState = (status) => {
|
||||
|
||||
console.log(status);
|
||||
return { type: 'CHANGE_CONNECTION_STATUS', isConnected: status };
|
||||
};
|
||||
|
@ -29,14 +30,11 @@ const apiBaseUrl= 'https://tickets.enei.pt/internal/api'
|
|||
export function getAvailableGuestlists(token){
|
||||
|
||||
axios.defaults.baseURL = 'http://enei2019.uingress.com/internal/api'
|
||||
|
||||
axios.defaults.headers.common = {'Authorization': `bearer ${token.access_token}`}
|
||||
|
||||
|
||||
let completeUrl= apiBaseUrl + "/Attendee/AvailableGuestlists";
|
||||
|
||||
return (dispatch)=>{
|
||||
|
||||
console.log(completeUrl)
|
||||
axios.get('/Attendee/AvailableGuestlists')
|
||||
.then(function (response) {
|
||||
|
||||
|
@ -44,21 +42,96 @@ export function getAvailableGuestlists(token){
|
|||
console.log(response);
|
||||
dispatch({
|
||||
type: GET_CAREERS,
|
||||
//events: events
|
||||
guests: response.data
|
||||
|
||||
});
|
||||
})
|
||||
.catch(function (error) {
|
||||
// handle error
|
||||
// handle error
|
||||
console.log(error);
|
||||
})
|
||||
.then(function () {
|
||||
// always executed
|
||||
// always executed
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
8 - group
|
||||
9 - IA
|
||||
10 - NET
|
||||
11 - MOB
|
||||
12 - IOT
|
||||
14 - WB
|
||||
15 - DS
|
||||
|
||||
*/
|
||||
export function changeGuestList(token, guestID){
|
||||
//http://enei2019.uingress.com/internal/api/Attendee/ChangeGuestlist/
|
||||
axios.defaults.baseURL = 'http://enei2019.uingress.com/internal/api'
|
||||
|
||||
axios.defaults.headers.common = {'Authorization': `bearer ${token.access_token}`}
|
||||
|
||||
|
||||
return (dispatch)=>{
|
||||
|
||||
var full= `/Attendee/ChangeGuestlist/${guestID}`
|
||||
console.log(full)
|
||||
axios.get(full)
|
||||
.then(function (response) {
|
||||
|
||||
// handle success
|
||||
console.log(response);
|
||||
dispatch({
|
||||
type: GET_CAREERS,
|
||||
guests: response.data
|
||||
|
||||
});
|
||||
})
|
||||
.catch(function (error) {
|
||||
// handle error
|
||||
console.log(response);
|
||||
console.log(error);
|
||||
})
|
||||
.then(function () {
|
||||
// always executed
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export function getAvailableSessions(token){
|
||||
//http://enei2019.uingress.com/internal/api/Attendee/AvailableSessions
|
||||
|
||||
axios.defaults.baseURL = 'http://enei2019.uingress.com/internal/api'
|
||||
|
||||
axios.defaults.headers.common = {'Authorization': `bearer ${token.access_token}`}
|
||||
|
||||
return (dispatch)=>{
|
||||
|
||||
axios.get('/Attendee/AvailableSessions')
|
||||
.then(function (response) {
|
||||
|
||||
// handle success
|
||||
console.log(response);
|
||||
dispatch({
|
||||
type: GET_SESSIONS,
|
||||
sessions: response.data
|
||||
|
||||
});
|
||||
})
|
||||
.catch(function (error) {
|
||||
// handle error
|
||||
console.log(error);
|
||||
})
|
||||
.then(function () {
|
||||
// always executed
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export function getEvents(user){
|
||||
|
||||
return (dispatch)=>{
|
||||
|
|
|
@ -1,4 +1,10 @@
|
|||
export {checkUser, login,getEvents, hold, getUserInfo,logoutUser,getAvailableGuestlists} from "./api"
|
||||
export {checkUser,
|
||||
login,getEvents,
|
||||
hold, getUserInfo,
|
||||
logoutUser,
|
||||
getAvailableGuestlists,
|
||||
changeGuestList
|
||||
} from "./api"
|
||||
export {openScannerLogin,closeLoginQRScan}from "./ui"
|
||||
|
||||
|
||||
|
|
|
@ -18,6 +18,9 @@ let apiState= {
|
|||
access_token:''
|
||||
}
|
||||
},
|
||||
calendar:{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -27,47 +30,49 @@ const apiReducer = (state = apiState, action) => {
|
|||
|
||||
case REHYDRATE:
|
||||
|
||||
console.log( action.payload)
|
||||
console.log( action.payload)
|
||||
|
||||
var expirationDateTokenA=0;
|
||||
var access_tokenA='';
|
||||
var expirationDateTokenA=0;
|
||||
var access_tokenA='';
|
||||
|
||||
if(action.payload.apiReducer.userDetails.token!=undefined){
|
||||
if(action.payload.apiReducer.userDetails.token.expirationDateToken!= undefined){
|
||||
if(action.payload.apiReducer.userDetails.token!=undefined){
|
||||
|
||||
expirationDateTokenA= action.payload.apiReducer.userDetails.token.expirationDateToken;
|
||||
}
|
||||
if((action.payload.apiReducer.userDetails.token.access_token!= undefined)){
|
||||
if(action.payload.apiReducer.userDetails.token.expirationDateToken!= undefined){
|
||||
|
||||
expirationDateTokenA= action.payload.apiReducer.userDetails.token.expirationDateToken;
|
||||
}
|
||||
|
||||
if((action.payload.apiReducer.userDetails.token.access_token!= undefined)){
|
||||
|
||||
access_tokenA= action.payload.apiReducer.userDetails.token.access_token;
|
||||
access_tokenA= action.payload.apiReducer.userDetails.token.access_token;
|
||||
|
||||
}
|
||||
}
|
||||
return {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
// token: action.payload.apiReducer.token,
|
||||
user: action.payload.apiReducer.user,
|
||||
|
||||
userDetails:{
|
||||
token:{
|
||||
expirationDateToken: expirationDateTokenA,
|
||||
access_token:access_tokenA,
|
||||
token:{
|
||||
expirationDateToken: expirationDateTokenA,
|
||||
access_token:access_tokenA,
|
||||
|
||||
},
|
||||
username:action.payload.apiReducer.userDetails.username,
|
||||
password:action.payload.apiReducer.userDetails.password
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
case 'CHANGE_CONNECTION_STATUS':
|
||||
return Object.assign({}, state, {
|
||||
isConnected: action.isConnected,
|
||||
});
|
||||
|
||||
case GET_CAREERS:
|
||||
|
||||
state=Object.assign({},state, { });
|
||||
return state;
|
||||
|
||||
|
||||
case HOLD:
|
||||
|
||||
state=Object.assign({},state, { onHold:true });
|
||||
|
@ -91,7 +96,7 @@ if(action.payload.apiReducer.userDetails.token!=undefined){
|
|||
case CHECK_USER:
|
||||
|
||||
var u= action.userDetails;
|
||||
u.token= action.token;
|
||||
//u.token= action.token;
|
||||
|
||||
state=Object.assign({},state, {logged:action.logged, onHold:action.onHold, userDetails:u });
|
||||
|
||||
|
@ -114,7 +119,47 @@ if(action.payload.apiReducer.userDetails.token!=undefined){
|
|||
state=Object.assign({},state, { events: action.events});
|
||||
|
||||
return state;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
case GET_CAREERS:
|
||||
var c= {
|
||||
guests:action.guests
|
||||
}
|
||||
state=Object.assign({},state, { calendar:c });
|
||||
|
||||
return state;
|
||||
|
||||
|
||||
|
||||
default:
|
||||
|
|
|
@ -7807,6 +7807,14 @@
|
|||
"prop-types": "^15.6.2"
|
||||
}
|
||||
},
|
||||
"react-native-check-box": {
|
||||
"version": "2.1.7",
|
||||
"resolved": "https://registry.npmjs.org/react-native-check-box/-/react-native-check-box-2.1.7.tgz",
|
||||
"integrity": "sha512-dPVOoz4jKs2je2HSHp7+XJXNyZFq8Kij7IHutigrQKzB550Dko6ZAQu/1mG1FzdUMFxxkZ2nX59KmbR0Co0T8Q==",
|
||||
"requires": {
|
||||
"prop-types": "^15.5.7"
|
||||
}
|
||||
},
|
||||
"react-native-confirmation-code-input": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/react-native-confirmation-code-input/-/react-native-confirmation-code-input-1.0.4.tgz",
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
"react-native-action-button": "^2.8.5",
|
||||
"react-native-app-intro-slider": "^1.0.1",
|
||||
"react-native-camera": "^1.9.2",
|
||||
"react-native-check-box": "^2.1.7",
|
||||
"react-native-confirmation-code-input": "^1.0.4",
|
||||
"react-native-device-info": "^0.26.4",
|
||||
"react-native-elements": "^1.0.0",
|
||||
|
|
Loading…
Reference in New Issue