Commit bce0939d authored by tejaswi's avatar tejaswi
Browse files

Changes

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