Commit 5d2fbabc authored by santhosh's avatar santhosh
Browse files
parents 2536fbe4 55f7ad36
Showing with 453 additions and 21 deletions
+453 -21
......@@ -100,24 +100,19 @@ class ListItem extends Component {
.then((response) => response.json())
.then((responseJson) => {
console.warn("Messages For chat application" + JSON.stringify(responseJson.data));
// alert(JSON.stringify(responseJson))
// alert("datasource3"+JSON.stringify(responseJson))
// console.warn("Messages from users" + JSON.stringify(responseJson))
// console.warn("Send By Name" + JSON.stringify(responseJson.data))
if (responseJson.status === 'True') {
console.warn("Setted Data")
this.setState({
dataSource3: responseJson.data,
});
}
else {
console.warn("Empty Data")
this.setState({
dataSource: '',
dataSource3: '',
});
}
})
......@@ -192,7 +187,7 @@ class ListItem extends Component {
else {
console.warn("Empty Data")
this.setState({
dataSource: '',
dataSource2: '',
});
}
})
......@@ -260,7 +255,7 @@ class ListItem extends Component {
return groupMsg[groupMsg.length - 1]
}
// alert(getLastMsgTime)
// var data1=this.state.dataSource1;
const getMessagesCount = (data1, id) => {
// console.warn("ids"+JSON.stringify(data1) +id)
......@@ -846,7 +841,7 @@ export default class AdminChat extends Component {
.then((responseJson) => {
// alert(JSON.stringify(responseJson))
// console.warn("Employees" + JSON.stringify(responseJson));
this.addManageEmployeesList(responseJson.data, cropcode) //Store Manage Employee List in Offline
// this.addManageEmployeesList(responseJson.data, cropcode) //Store Manage Employee List in Offline
// this.setState({
// isLoading: false,
......
/*
FileName:UserSupport.js
Version:1.0.0
Purpose: User Support Screen
Devloper:Mahesh Reddy
*/
import React, { Component } from 'react';
import { Platform, StyleSheet, Text, View, StatusBar, Dimensions, Picker, TouchableOpacity, Linking, TextInput, Alert } from 'react-native';
import { Title, Button, Container, Content, Header, Right, Left, Body, Tab, Tabs, TabHeading, Footer, Item, Input, FooterTab } from 'native-base';
import { widthPercentageToDP as wp, heightPercentageToDP as hp } from 'react-native-responsive-screen';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import SearchableDropdown from 'react-native-searchable-dropdown';
import AsyncStorage from '@react-native-community/async-storage';
// import { tsMethodSignature } from '@babel/types';
import { API, CHATAPI } from "../WebServices/RestClient";
import NetInfo from '@react-native-community/netinfo';
import Snackbar from 'react-native-snackbar';
import ModalSelector from 'react-native-modal-selector';
// import { Dropdown } from 'react-native-material-dropdown';
import log from '../LogFile/Log';
import Toast from 'react-native-whc-toast';
import { MAINTASKINFO, MAINTASKTITLE, DESCRIPTION, } from '../CommonComponents/Header';
import { ScrollView } from 'react-native-gesture-handler';
import { EMPLOYEEID1, FULLNAME, USERNAME1, EMAIL1, MOBILE1, ADDEMPLOYEE, EMPLOYEEDETAILS } from '../CommonComponents/Header';
import RadioButtonRN from 'radio-buttons-react-native';
import { launchCamera, launchImageLibrary } from 'react-native-image-picker';
const options = {
title: 'Select Image',
type: 'library',
options: {
maxHeight: 200,
maxWidth: 200,
selectionLimit: 1,
mediaType: 'photo',
includeBase64: false
},
}
export default class ReportBug extends Component {
constructor(props) {
super(props);
this.state = {
email_to_contact: '',
bug_one_sen: '',
steps_for_bug: '',
docFile: '',
};
}
//upload Report
reportBugimage = async () => {
log("Info", " onSignIn( usertype, user_status, password) is used to Adding the new Employee");
const images = await launchImageLibrary(options);
if (this.isValid()) {
AsyncStorage.multiGet(["cropcode", "userName", "fullName"], (err, response) => {
const cropcode = response[0][1];
const userName = response[1][1];
const { empId, bug_one_sen, steps_for_bug, docFile } = this.state;
const data = new FormData();
data.append('file', {
uri: images.assets[0].uri,
type: images.assets[0].type,
name: images.assets[0].fileName,
})
data.append('action', 'releaseBug');
data.append('api', CHATAPI);
data.append('bug_one_sen', bug_one_sen);
data.append('email_to_contact', userName);
data.append('steps_for_bug', steps_for_bug);
NetInfo.fetch().then(state => {
if (state.type == "none") {
console.log(state.type);
log("Warn", "No internet connection");
Snackbar.show({
title: 'No Internet Connection',
backgroundColor: 'red',
duration: Snackbar.LENGTH_LONG,
});
} else {
fetch(API + 'report_bug.php', {
method: 'post',
body: data,
headers: {
'Content-Type': 'multipart/form-data; ',
},
}).then((response) => response.json())
.then((responseJson) => {
//alert(responseJson);
console.log(JSON.stringify(responseJson));
console.log(responseJson);
alert("Your report was sent successfully")
if (responseJson.status === 'True') {
this.props.navigation.navigate('MyTask');
}
else {
console.log(JSON.stringify(responseJson));
log("Warn", "Error found");
// alert("error");
// alert(responseJson.message)
}
}).catch((error) => {
console.error(error);
log("Error", "Adding the new Employee error");
});
}
});
});
}
}
//upload Report
reportBug() {
if (this.isValid()) {
AsyncStorage.multiGet(["cropcode", "userName", "fullName"], (err, response) => {
const cropcode = response[0][1];
const userName = response[1][1];
const { empId, bug_one_sen, steps_for_bug, email_to_contact, docFile } = this.state;
const data = new FormData();
data.append('file', '')
data.append('action', 'releaseBug');
data.append('api', CHATAPI);
data.append('bug_one_sen', bug_one_sen);
data.append('email_to_contact', email_to_contact);
data.append('steps_for_bug', steps_for_bug);
NetInfo.fetch().then(state => {
if (state.type == "none") {
console.log(state.type);
log("Warn", "No internet connection");
Snackbar.show({
title: 'No Internet Connection',
backgroundColor: 'red',
duration: Snackbar.LENGTH_LONG,
});
} else {
fetch(API + 'report_bug.php', {
method: 'post',
body: data,
headers: {
'Content-Type': 'multipart/form-data; ',
},
}).then((response) => response.json())
.then((responseJson) => {
//alert(responseJson);
console.log(JSON.stringify(responseJson));
console.log(responseJson);
alert("Your report was sent successfully")
if (responseJson.status === 'True') {
this.props.navigation.navigate('Login');
}
else {
console.log(JSON.stringify(responseJson));
log("Warn", "Error found");
// alert("error");
// alert(responseJson.message)
}
}).catch((error) => {
console.error(error);
log("Error", "Adding the new Employee error");
});
}
});
});
}
}
//Checking the Validations start
isValid() {
var { email_to_contact, bug_one_sen, steps_for_bug } = this.state;
let valid = false;
// if (empId.length === 0) {
// log("Warn", "empId should not be empty");
// alert("Enter Employee Id");
// }
if (!this.verifyEmail(email_to_contact)) {
log("Warn", "Email should not be empty");
alert("Enter Email ");
}
else if (bug_one_sen.length === 0) {
log("Warn", "Bug should not be empty");
// alert("Enter Bug Report");
}
else if (steps_for_bug.length === 0) {
log("Warn", "Steps should not be empty");
// alert("Enter Steps of Bugs");
}
// else if (mobile.length === 0) {
// log("Warn", "mobile should not be empty");
// alert("Enter phonenumber");
// }
// else if (mobile.length > 10) {
// log("Warn", "mobile should not be greater than 10");
// alert("Invalid phonenumber");
// }
// else if (mobile.length < 10) {
// log("Warn", "mobile should not be less than 10");
// alert("Invalid phonenumber");
// }
else {
valid = true;
}
return valid;
}
verifyEmail(email_to_contact) {
var reg = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
return reg.test(email_to_contact);
}
//Checking the Validations end
//Add or Mpdify the Maintask close
componentDidMount() {
//Getting Employees List
log("Debug", "Add Task screen is loaded");
// alert("")
}
render() {
return (
<Container>
<Header
androidStatusBarColor="#00A2C1"
style={{
backgroundColor: '#00A2C1',
height: 60,
width: Dimensions.get('window').width,
borderBottomColor: '#ffffff',
justifyContent: 'space-between',
}}>
<Left>
<Icon name="menu" size={25} style={{ color: '#fff' }} onPress={() =>
this.props.navigation.toggleDrawer()} />
</Left>
<Body>
<Title style={{ color: '#fff', fontWeight: '600' }}>Report Support</Title>
</Body>
</Header>
<Content>
<Toast ref="toast" />
<View style={{ paddingTop: 20, }}>
<Text style={{ paddingTop: 10, paddingLeft: 20 }}>
Tell us about the bug you found!
</Text>
</View>
<View style={{ paddingTop: 20, }}>
<View style={{ paddingLeft: 10, }}>
<View style={{ width: wp('95%'), }}>
<Text>
When The Bug Is Resolved, Which Email Should We Contact You At?*
</Text>
</View>
<View>
<TextInput style={{ width: wp('95%'), height: 45, borderBottomWidth: 1, }}
placeholder="Enter Emai"
underlineColorAndroid='transparent'
// value={this.state.email_to_contact}
onChangeText={(email_to_contact) => this.setState({ email_to_contact })}
/>
</View>
</View>
<View style={{ paddingLeft: 10, }}>
<View style={{ width: wp('95%'), }}>
<Text>
Could You Please Describe This Bug In One Sentence?* </Text>
</View>
<View>
<TextInput style={{ width: wp('95%'), height: 45, borderBottomWidth: 1, }}
placeholder="Scrum board or Active Sprint: Sprint Name not displaying "
underlineColorAndroid='transparent'
// value={this.state.bug_one_sen}
onChangeText={(bug_one_sen) => this.setState({ bug_one_sen })}
/>
</View>
</View>
<View style={{ paddingLeft: 10, }}>
<View style={{ width: wp('95%'), }}>
<Text>
Let Us Know How To Reproduce The Bug For Us To Work On?*
</Text>
</View>
<View>
<TextInput style={{ width: wp('95%'), height: 45, borderBottomWidth: 1, }}
placeholder="1. Go to Dashboards | 2. Add a new Project "
// maxLength={10}
// keyboardType={"number-pad"}
underlineColorAndroid='transparent'
// value={this.state.steps_for_bug}
onChangeText={(steps_for_bug) => this.setState({ steps_for_bug })}
/>
</View>
</View>
<TouchableOpacity style={styles.upload}
onPress={this.reportBugimage} >
<Text style={{ color: 'white' }}>Uplaod</Text>
</TouchableOpacity>
<View style={{ flexDirection: 'row', marginTop: 10, justifyContent: "space-between" }}>
<TouchableOpacity style={styles.opensave}
onPress={this.reportBug()} >
<Text style={{ color: 'white' }}>Submit</Text>
</TouchableOpacity>
</View>
</View>
</Content>
</Container>
);
}
}
//Styles for UI
const styles = StyleSheet.create({
opencancel: {
flex: 1,
...Platform.select({
ios: {
backgroundColor: 'red', margin: 20, height: 30, alignItems:
"center", justifyContent: 'center'
},
android: {
backgroundColor: 'red', margin: 20, height: 30, alignItems:
"center", justifyContent: 'center'
},
}),
},
opensave: {
flex: 1,
...Platform.select({
ios: {
backgroundColor: 'green', margin: 20, height: 30, alignItems:
"center", justifyContent: 'center'
},
android: {
backgroundColor: 'green', margin: 20, height: 30, alignItems:
"center", justifyContent: 'center'
},
}),
},
upload: {
flex: 1,
...Platform.select({
ios: {
backgroundColor: '#f1f0ef', margin: 20, height: 30, alignItems:
"center", justifyContent: 'center'
},
android: {
backgroundColor: '#f1f0ef', margin: 20, height: 30, alignItems:
"center", justifyContent: 'center'
},
}),
},
});
\ No newline at end of file
......@@ -551,7 +551,7 @@ export default class Login extends Component {
<Text style={styles.signUpTextforgotred}>Click here</Text>
</TouchableOpacity>
<TouchableOpacity onPress={() => this.props.navigation.navigate("Support")} style={[styles.buttonContainerforgot,]}>
<TouchableOpacity onPress={() => this.props.navigation.navigate("ReportBug")} style={[styles.buttonContainerforgot,]}>
<Text style={styles.signUpTextforgot}>Support</Text>
<Icon name="handshake-o" size={20} style={{ color: '#fff',}} />
</TouchableOpacity>
......
......@@ -92,6 +92,7 @@ import UserGroupChat from '../UserComponents/UserGroupChat';
import UserGroupChatModify from '../UserComponents/UserGroupChatModify';
import UserDashboard from '../UserComponents/UserDashboard';
import Instruction from '../UserComponents/Instruction';
// import UserSupport from '../UserComponents/UserSupport';
import AddModule from '../CommonComponents/AddModule';
import AddMainTask from '../CommonComponents/AddMainTask';
......@@ -151,6 +152,7 @@ import ViewTask from '../CommonComponents/ViewTask';
import AssignTemplate from '../CommonComponents/AssignTemplate';
import ModifyPersonalTodo from '../CommonComponents/ModifyPersonalTodo';
import AssignTodo from '../CommonComponents/AssignTodo';
import ReportBug from '../CommonComponents/ReportBug';
......@@ -658,7 +660,12 @@ const adminAppStack = createStackNavigator({
header: null,
},
},
// ReportBug:{
// screen:ReportBug,
// navigationOptions:{
// header:null,
// },
// },
AddRoadblock: {
screen: AddRoadblock,
......@@ -1146,6 +1153,12 @@ const userAppStack = createStackNavigator({
header: null,
},
},
// UserSupport:{
// screen:UserSupport,
// navigationOptions:{
// header:null,
// },
// },
RoadBlockList: {
screen: RoadBlockList,
navigationOptions: {
......@@ -1186,6 +1199,12 @@ const userAppStack = createStackNavigator({
header: null,
},
},
// ReportBug:{
// screen:ReportBug,
// navigationOptions:{
// header:null,
// },
// },
UserManageProjects1: {
screen: UserManageProjects1,
navigationOptions: {
......@@ -1264,10 +1283,10 @@ const AuthStack = createStackNavigator({
header: null,
},
},
Support: {
screen: Support,
navigationOptions: {
header: null,
ReportBug:{
screen:ReportBug,
navigationOptions:{
header:null,
},
},
......
......@@ -981,6 +981,17 @@ export default class UserDashboard extends Component {
</View>
</TouchableOpacity>
{/* <TouchableOpacity onPress={() => this.props.navigation.push("ReportBug")}>
<View style={{ marginTop: 20, flexDirection: 'row' }}>
<Text style={{ width: 150, borderRadius: 20, height: 45, flexDirection: 'row', color: 'white', padding: 5 }}>
Report
</Text>
</View>
</TouchableOpacity> */}
{/* <View style={{ flexDirection: 'row', marginTop: 20, }}>
<View style={{ marginRight: 2, }} >
<Text style={{ color: 'white' }}>{this.state.dataSource2.length}</Text>
......
......@@ -161,12 +161,15 @@ reportBug(){
//alert(responseJson);
console.log(JSON.stringify(responseJson));
console.log(responseJson);
alert("Your report was sent successfully")
// alert("Your report was sent successfully")
if (responseJson.status === 'True') {
alert(responseJson.message);
this.props.navigation.navigate('MyTask');
}
else {
console.log(JSON.stringify(responseJson));
......@@ -202,7 +205,7 @@ isValid() {
// }
if (bug_one_sen.length === 0) {
log("Warn", "Bug should not be empty");
// alert("Enter Bug Report");
alert("Enter Bug Report");
}
else if (steps_for_bug.length === 0) {
......@@ -290,7 +293,7 @@ render() {
<TextInput style={{ width: wp('95%'), height: 45, borderBottomWidth: 1, }}
placeholder="Scrum board or Active Sprint: Sprint Name not displaying "
underlineColorAndroid='transparent'
value={this.state.bug_one_sen}
// value={this.state.bug_one_sen}
onChangeText={(bug_one_sen) => this.setState({ bug_one_sen })}
/>
......@@ -309,7 +312,7 @@ render() {
// maxLength={10}
// keyboardType={"number-pad"}
underlineColorAndroid='transparent'
value={this.state.steps_for_bug}
// value={this.state.steps_for_bug}
onChangeText={(steps_for_bug) => this.setState({ steps_for_bug })}
/>
......
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