Commit bce0939d authored by tejaswi's avatar tejaswi
Browse files

Changes

parent a4c44eae
Showing with 82 additions and 81 deletions
+82 -81
......@@ -48,7 +48,7 @@ export default class AddSprint extends React.Component {
targetdate: '',
targetDate: '',
};
this.getSprints();
}
//Open the Dialog Modal
modalDidOpen = () => console.log("Modal did open.");
......
......@@ -814,9 +814,9 @@ export default class AdminChat extends Component {
borderBottomColor: '#ffffff',
justifyContent: 'space-between',
}}>
<Left>
<Left>
<Icon name="arrow-left" size={20} style={{ color: '#fff', }} onPress={() =>
this.props.navigation.goBack(null)} />
this.props.navigation.push("UserDashboard")} />
</Left>
<Body style={{ paddingLeft: 30, }}>
<Title style={{ color: '#fff', paddingTop: 20 }}>CHAT</Title>
......
......@@ -56,7 +56,7 @@ export default class UserDashboard extends Component {
epicName: 'Select Epic',
abc: [],
squadName: '',
dataSource2:[],
dataSource2: [],
}
......@@ -273,7 +273,7 @@ export default class UserDashboard extends Component {
// alert(JSON.stringify(responseJson))
if (responseJson.status === 'True') {
// alert(responseJson.message)
// alert(responseJson.message)
this.GetStatus()
this.refs.toast.showBottom('Project Created Succesfully');
this.setState({ itemPressedDisabled: false })
......@@ -305,77 +305,77 @@ export default class UserDashboard extends Component {
getMessages() {
log("Info", " getMessages(role, userToken, cropcode) is used getting task related messages");
// const groupId = this.state.subtaskId;
// console.warn("getmessages");
AsyncStorage.multiGet(["cropcode", "userToken"], (err, response) => {
const cropcode = response[0][1];
const userToken = response[1][1];
this.setState({ userid: userToken });
// console.warn("userToken"+userToken)
// console.warn("cropcode"+cropcode)
getMessages() {
log("Info", " getMessages(role, userToken, cropcode) is used getting task related messages");
// const groupId = this.state.subtaskId;
// console.warn("getmessages");
AsyncStorage.multiGet(["cropcode", "userToken"], (err, response) => {
const cropcode = response[0][1];
const userToken = response[1][1];
this.setState({ userid: userToken });
// console.warn("userToken"+userToken)
// console.warn("cropcode"+cropcode)
NetInfo.fetch().then(state => {
if (state.type == "none") {
log("Warn", "No internet connection");
Snackbar.show({
title: 'No Internet Connection',
backgroundColor: 'red',
duration: Snackbar.LENGTH_LONG,
});
}
else {
fetch(API + "squad_chat.php",
{
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
NetInfo.fetch().then(state => {
if (state.type == "none") {
log("Warn", "No internet connection");
Snackbar.show({
title: 'No Internet Connection',
backgroundColor: 'red',
duration: Snackbar.LENGTH_LONG,
});
}
else {
fetch(API + "squad_chat.php",
{
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
action: "get_all_messages",
// corp_code: cropcode,
sendBy: userToken,
action: "get_all_messages",
// corp_code: cropcode,
sendBy: userToken,
})
})
.then((response) => response.json())
.then((responseJson) => {
// console.warn("Messages For chat application" + JSON.stringify(responseJson.data));
})
})
.then((response) => response.json())
.then((responseJson) => {
// console.warn("Messages For chat application" + JSON.stringify(responseJson.data));
// console.warn("Messages from users" + JSON.stringify(responseJson))
// console.warn("Send By Name" + JSON.stringify(responseJson.data))
// alert(JSON.stringify(responseJson.data))
if (responseJson.status === 'True') {
// console.warn("Messages from users" + JSON.stringify(responseJson))
// console.warn("Send By Name" + JSON.stringify(responseJson.data))
// alert(JSON.stringify(responseJson.data))
if (responseJson.status === 'True') {
// console.warn("Setted Data")
// console.warn("Setted Data")
this.setState({
dataSource2: responseJson.data,
});
// console.warn("Method data" + responseJson.data.sendBy)
}
else {
// console.warn("Empty Data")
this.setState({
dataSource2: [],
});
}
})
.catch((error) => {
console.error(error);
log("Error", "getting task related messages error");
});
this.setState({
dataSource2: responseJson.data,
});
// console.warn("Method data" + responseJson.data.sendBy)
}
else {
// console.warn("Empty Data")
this.setState({
dataSource2: [],
});
}
})
.catch((error) => {
console.error(error);
log("Error", "getting task related messages error");
});
}
});
});
}
}
});
});
}
......@@ -394,15 +394,16 @@ export default class UserDashboard extends Component {
}
//Navigates to TaskChat Screen
AdminChat() {
// console.warn("msgCount" + msgCount);
// console.warn("taskid" + taskid);
// alert(taskid)
// alert("taskid" + taskid)
// log("Info", "UserPendingMyTasks:TaskChat(item, index) used to navigate to taskchat")
this.props.navigation.navigate("AdminChat");
}
//Navigates to TaskChat Screen
AdminChat() {
// console.warn("msgCount" + msgCount);
// console.warn("taskid" + taskid);
// alert(taskid)
// alert("taskid" + taskid)
// log("Info", "UserPendingMyTasks:TaskChat(item, index) used to navigate to taskchat")
// this.props.navigation.navigate("AdminChat");
this.props.navigation.push("AdminChat");
}
render() {
......@@ -431,7 +432,7 @@ export default class UserDashboard extends Component {
justifyContent: 'space-between',
}}>
<View style={{ marginTop: 20, flexDirection: 'row' }}>
<Image style={{ width: 25, height: 25 }} source={require('../Images/add.png')} />
<Image style={{ width: 25, height: 25 }} source={require('../Images/add.png')} />
<TouchableOpacity onPress={this.openModal}>
<Text style={{ width: 150, borderRadius: 20, height: 45, flexDirection: 'row', color: 'white', padding: 5 }}>
......@@ -439,12 +440,12 @@ export default class UserDashboard extends Component {
</Text>
</TouchableOpacity>
</View>
<View style={{flexDirection:'row'}}>
<TouchableOpacity style={{ marginTop: 20, marginLeft: 18 }} onPress={() => { this.AdminChat() }}>
<Text style={{color:'white'}}>{this.state.dataSource2.length}</Text>
<Image style={{ width: 25, height: 25,color: 'white' }} source={require('../Images/chat.png')} />
<View style={{ flexDirection: 'row' }}>
<TouchableOpacity style={{ marginTop: 20, marginLeft: 18 }} onPress={() => { this.AdminChat() }}>
<Text style={{ color: 'white' }}>{this.state.dataSource2.length}</Text>
<Image style={{ width: 25, height: 25, color: 'white' }} source={require('../Images/chat.png')} />
</TouchableOpacity>
</TouchableOpacity>
</View>
<View style={{ marginTop: 20, flexDirection: 'row' }}>
<TouchableOpacity onPress={this.logOutOption.bind(this)}>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment