Commit 3dcf118c authored by tejaswi's avatar tejaswi
Browse files

admin project reports

parent 25ba9f4f
This commit is part of merge request !2. Comments created here will be created in the context of that merge request.
Showing with 722 additions and 22 deletions
+722 -22
......@@ -4106,6 +4106,11 @@
}
}
},
"base-64": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/base-64/-/base-64-0.1.0.tgz",
"integrity": "sha1-eAqZyE59YAJgNhURxId2E78k9rs="
},
"base64-js": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
......@@ -14055,6 +14060,30 @@
"glob": "^7.1.3"
}
},
"rn-fetch-blob": {
"version": "0.12.0",
"resolved": "https://registry.npmjs.org/rn-fetch-blob/-/rn-fetch-blob-0.12.0.tgz",
"integrity": "sha512-+QnR7AsJ14zqpVVUbzbtAjq0iI8c9tCg49tIoKO2ezjzRunN7YL6zFSFSWZm6d+mE/l9r+OeDM3jmb2tBb2WbA==",
"requires": {
"base-64": "0.1.0",
"glob": "7.0.6"
},
"dependencies": {
"glob": {
"version": "7.0.6",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.0.6.tgz",
"integrity": "sha1-IRuvr0nlJbjNkyYNFKsTYVKz9Xo=",
"requires": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^3.0.2",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
}
}
}
},
"rsvp": {
"version": "4.8.5",
"resolved": "https://registry.npmjs.org/rsvp/-/rsvp-4.8.5.tgz",
......
......@@ -63,6 +63,7 @@
"react-navigation-drawer": "^2.6.0",
"react-navigation-stack": "^2.10.2",
"react-navigation-tabs": "^2.11.0",
"rn-fetch-blob": "^0.12.0",
"sharingan-rn-modal-dropdown": "^1.3.0"
},
"devDependencies": {
......
/*
FileName:AdminReports1.js
Version:1.0.0
Purpose:Working Hours showing in table formate
Devloper:Mahesh,Santhosh
*/
import React, { Component } from 'react';
import {
Platform, StyleSheet, TextPropTypes, Picker, Text, Button, View, Image, StatusBar, Dimensions, TextInput, Alert,
KeyboardAvoidingView,
TouchableWithoutFeedback,
FlatList,
Keyboard
} from 'react-native';
// import { Chart, VerticalAxis, HorizontalAxis, Line } from 'react-native-responsive-linechart'
import { Icon, Title, Container, Content, Header, Right, Left, Body } from 'native-base';
import { widthPercentageToDP as wp, heightPercentageToDP as hp } from 'react-native-responsive-screen';
import { TouchableOpacity } from 'react-native-gesture-handler';
import AsyncStorage from '@react-native-community/async-storage';
import { ReportsAPI } from "../WebServices/RestClient";
import { API } from "../WebServices/RestClient";
import NetInfo from '@react-native-community/netinfo';
import Snackbar from 'react-native-snackbar';
import log from '../LogFile/Log';
import ProffileOffline from '../OfflineDB/Profile';
const db = new ProffileOffline();
import Main from '../Maintenance/Main';
import jwt_decode from "jwt-decode";
import ModalSelector from 'react-native-modal-selector';
const check = new Main()
import {
DotIndicator,
} from 'react-native-indicators';
// import { LineChart, BarChart } from "react-native-chart-kit";
import { ScrollView } from 'react-native-gesture-handler';
import { PROFILE, CHANGEPASSWORD, EMPLOYEEID, USERNAME, EMAIL, MOBILE, FULLNAME1, DESIGNATION, TEAM, ROLE, FMANAGER, RMANAGER, STATUS1 } from '../CommonComponents/Header';
import SearchableDropdown from 'react-native-searchable-dropdown';
import PureChart from 'react-native-pure-chart';
import moment from "moment";
import DateRangePicker from "react-native-daterange-picker";
import { DataTable } from 'react-native-paper';
class ListItem extends React.Component {
constructor(props) {
super(props);
this.state = {
isLoading: true,
// roledata: '',
}
}
render() {
const { item } = this.props;
// alert("Setting")
AsyncStorage.getItem("emp_role", (err, res) => {
this.setState({
roledata: res
})
});
return (
<View style={styles.container}>
<View style={{ flexDirection: 'row' }}>
<View style={{ flexDirection: 'row', width: 140, borderWidth: 1, borderColor: 'black' }}>
<Text style={{}} >{item.story_title}</Text>
</View>
<View style={{ flexDirection: 'row', }}>
<View style={{ flexDirection: 'row', borderWidth: 1, borderColor: 'black' }}>
<Text style={{ width: 80 }} > {item.working_hours} </Text>
</View>
</View>
</View>
</View>
)
}
}
export default class AdminProjectReports extends Component {
constructor(props) {
super(props);
this.state = {
isLoading: false,
isVisibleB: false,
sprintName: 'Select User',
epicName: 'Select Epic',
resource: [],
resource1: [],
dataSource: [],
// employee:[],
// startDate: null,
// endDate: null,
displayedDate: moment(),
startDate: moment().set("date", -15),
endDate: moment().set("date", 15),
selectedDays: [],
selectedWeeks: [],
select: ''
}
AsyncStorage.getItem("cropcode", (err, res) => {
this.setState({ squadName: res });
console.warn("squadname" + this.state.squadName);
});
}
setDates = (dates) => {
this.setState({
...dates,
});
};
// getDates = (startDate, stopDate) => {
// var dateArray = [];
// var currentDate = moment(startDate);
// stopDate = moment(stopDate);
// while (currentDate <= stopDate) {
// dateArray.push(moment(currentDate).format('MM-DD-YYYY'))
// currentDate = moment(currentDate).add(1, 'days');
// }
// return dateArray;
// }
// getWeeks = (startDate, stopDate) => {
// var dateArray = [];
// var currentDate = moment(startDate);
// stopDate = moment(stopDate);
// while (currentDate <= stopDate) {
// dateArray.push(moment(currentDate).format('dddd'))
// currentDate = moment(currentDate).add(1, 'days');
// }
// return dateArray;
// }
componentDidMount() {
this.Reports();
}
Reports() {
const { assignedto, sprintName, startDate, endDate } = this.state;
// alert("Test")
// alert("value:"+assignedto+"label:"+sprintName)
// alert("startDate :"+moment(this.state.startDate).format('YYYY-MM-DD[T]hh:mm:ss.SSS[Z]')+"endDate :"+moment(this.state.startDate).format('YYYY-MM-DD[T]hh:mm:ss.SSS[Z]'))
// const data = {
// "selectedOption":
// {
// "value": assignedto,
// "label": sprintName
// }
// }
const filter =[{
startDate: moment(this.state.startDate).format('YYYY-MM-DD[T]hh:mm:ss.SSS[Z]'),
endDate: moment(this.state.endDate).format('YYYY-MM-DD[T]hh:mm:ss.SSS[Z]'),
"key": "selection"
}]
// alert(JSON.stringify({data,filter}))
// {"data":{"selectedOption":
// {"value":"6b2218ba7636d07530aa63b3848656ba",
// "label":"Naveen Gade"}},"
// filter":[{"startDate":"2021-06-30T18:30:00.000Z",
// "endDate":"2021-07-30T18:30:00.000Z","key":"selection"}]}
// alert(JSON.stringify(filter1));
NetInfo.fetch().then(state => {
if (state.type == "none") {
Snackbar.show({
title: 'No Internet Connection',
backgroundColor: 'red',
duration: Snackbar.LENGTH_LONG,
});
} else {
fetch(ReportsAPI + `getAllCount`, {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
// data,
filter
})
}).then((response) => response.json())
.then((responseJson) => {
// alert("data" + JSON.stringify(responseJson))
// var sprintList = [];
// responseJson.map((sprints) => {
// return (
// sprintList.push({
// 'id': sprints.emp_id, 'name': sprints.fullname
// })
// );
// })
var employee = [];
responseJson.map((x) => {
return (x.name !== "admin@novisync.com" ? employee.push(x) : null);
})
this.setState({
dataSource: employee,
},
function () {
}
);
// alert("data "+JSON.stringify(this.state.dataSource)+"test")
}).catch((error) => {
check.Maintenance();
console.error(error);
log("Error", "Error in getting profile data");
});
}
});
}
render() {
const { assignedto, sprintName, startDate, endDate, displayedDate } = this.state;
const data = {
"selectedOption":
{
"value": assignedto,
"label": sprintName
}
}
//alert(JSON.stringify(data));
//alert(JSON.stringify(this.state.startDate));
// alert("Employee "+this.state.resource1+"test")
// var filter = [{
// "startDate": moment(this.state.startDate).format('YYYY-MM-DD'),
// "endDate": moment(this.state.endDate).format('YYYY-MM-DD'),
// // "key": "selection"
// }]
//alert(JSON.stringify(filter));
// const { startDate, endDate, displayedDate, minDate, maxDate } = this.state;
// alert("data "+this.state.dataSource+"test")
if (this.state.isLoading) {
return (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<DotIndicator color='#00A2C1' />
</View>
);
}
return (
// <KeyboardAvoidingView
// style={{ flex: 1 }}
// behavior={Platform.OS === "ios" ? "padding" : "height"}
// >
<Container>
<Header
androidStatusBarColor="#00A2C1"
style={{
backgroundColor: '#00A2C1',
height: 60,
width: Dimensions.get('window').width,
borderBottomColor: '#ffffff',
justifyContent: 'space-between',
}}>
<View style={{ marginTop: 20 }}>
<Icon name="md-menu" size={25} style={{ color: 'white', }} onPress={() =>
this.props.navigation.toggleDrawer()} />
</View>
<View style={{ width: 300, borderRadius: 20, height: 45, marginTop: 5, flexDirection: 'row' }}>
<Text style={{ width: 300, borderRadius: 20, height: 45, marginTop: 20, flexDirection: 'row', color: 'white' }}>Admin Project Reports</Text>
</View>
</Header>
<Content>
<View style={{ paddingTop: 20, flexDirection: 'row', }}>
<DateRangePicker
style={{ zIndex: -100, position: 'absolute', }}
onChange={this.setDates}
startDate={startDate}
endDate={endDate}
presetButtons={true}
completed
range
displayedDate={displayedDate}
moment={moment}
>
<Image style={{ width: wp('8%'), height: hp('4%'), margin: 5 }} source={require('../Images/calender.jpeg')} />
</DateRangePicker>
<TouchableOpacity style={styles.opensave} onPress={() => { this.Reports() }}>
<Text style={{ color: 'white', padding: 5 }}>Show</Text>
</TouchableOpacity>
</View>
{/*
<View style={{ flexDirection: 'row', marginLeft: 17 }}>
<View style={{ flexDirection: 'row', width: 140, borderWidth: 1, borderColor: 'black', }}>
<Text style={styles.signUpText0} >USER STORY</Text>
</View>
<View style={{ flexDirection: 'row', }}>
<View style={{ flexDirection: 'row', borderWidth: 1, borderColor: 'black' }}>
<Text style={styles.signUpText0} > Completed </Text>
</View>
</View>
</View>
<FlatList
extraData={this.state}
keyExtractor={this._keyExtractor}
renderItem={this._renderItem}
data={this.state.dataSource}
refreshing={this.state.isFetching}
ItemSeparatorComponent={this.FlatListItemSeparator}
renderItem={({ item, index }) =>
<View>
<ListItem navigation={this.props.navigation}
item={item}
ReOpenProjectAction={() => this.ReOpenProjectAction(item, index)}//For ReOpen Project
/>
</View>
}
keyExtractor={item => item.id}
ListEmptyComponent={this._listEmptyComponent}
/> */}
<ScrollView horizontal style={{ height: '40%', marginTop: 10 }}>
<View>
<DataTable>
<DataTable.Header style={{ backgroundColor: '#333f50', color: "white" }}>
<DataTable.Title style={{ width: 200 }}><Text style={{ color: "white" }}>EMPLOYEE_NAME</Text></DataTable.Title>
<DataTable.Title style={{ width: 200 }}><Text style={{ color: "white" }}>NO_OF_PROJECTS_INVOLVED</Text></DataTable.Title>
<DataTable.Title style={{ width: 200 }}><Text style={{ color: "white" }}>ASSIGNED_STORY_POINTS</Text></DataTable.Title>
<DataTable.Title style={{ width: 100 }}><Text style={{ color: "white" }}>PENDING</Text></DataTable.Title>
<DataTable.Title style={{ width: 100 }}><Text style={{ color: "white" }}>COMPLETED</Text></DataTable.Title>
</DataTable.Header>
</DataTable>
{this.state.dataSource.length !== 0 ? this.state.dataSource.map((item, index) => {
return (
<DataTable>
<DataTable.Row style={{ marginLeft: -10,}} key={index}>
<TouchableOpacity onPress={() => this.props.navigation.navigate("AdminReportsUser", { emp_id: item.emp_id,name: item.name,projects_involved:item.data[0].projects_involved,startDate:this.state.startDate,endDate:this.state.endDate })}>
<DataTable.Cell style={{ backgroundColor: '#eaedf3', width: 200,marginTop:15 }}>{item.name}</DataTable.Cell>
</TouchableOpacity>
<DataTable.Cell style={{ paddingLeft: 20, width: 200 }}>{item.data[0].projects_involved}</DataTable.Cell>
{item.data[0].estimated !== null ? <DataTable.Cell style={{ width: 200 }}>{item.data[0].estimated}</DataTable.Cell> : <DataTable.Cell style={{ width: 200 }}>0</DataTable.Cell>}
{item.data[0].pending !== null ? <DataTable.Cell style={{ width: 100 }}>{item.data[0].pending}</DataTable.Cell> : <DataTable.Cell style={{ width: 100 }}>0</DataTable.Cell>}
{item.data[0].completed !== null ? <DataTable.Cell style={{ width: 100 }}>{item.data[0].completed}</DataTable.Cell> : <DataTable.Cell style={{ width: 100 }}>0</DataTable.Cell>}
</DataTable.Row>
</DataTable>
)
}) : null}
</View>
</ScrollView>
</Content>
</Container>
// </KeyboardAvoidingView >
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
width: '90%',
paddingLeft: hp('2%'),
},
footer: {
position: 'absolute',
flex: 0.1,
left: 0,
right: 0,
bottom: -10,
backgroundColor: 'green',
flexDirection: 'row',
height: 80,
alignItems: 'center',
},
bottomButtons: {
alignItems: 'center',
justifyContent: 'center',
flex: 1,
},
footerText: {
color: 'white',
fontWeight: 'bold',
alignItems: 'center',
fontSize: 18,
},
buttonContainer: {
width: wp('90%'),
alignSelf: 'baseline',
marginBottom: 10,
color: '#d2691e',
marginLeft: 4,
},
signupButton: {
backgroundColor: '#ffffff',
},
subcontainer: {
flex: 2,
flexDirection: 'row',
paddingTop: 40
},
signUpText0: {
fontSize: 13,
color: 'green',
paddingTop: 10,
},
signUpText1: {
fontSize: 13,
color: 'green',
paddingTop: 10,
paddingLeft: 10,
},
end: {
alignItems: 'flex-end',
},
end1: {
flex: 2,
height: '50%',
paddingTop: 20,
justifyContent: 'space-between',
flexDirection: 'row',
},
s: {
justifyContent: 'center',
backgroundColor: '#ed7070',
shadowOffset: { width: 50, height: 50 },
alignItems: 'center',
width: wp('40%'),
height: hp('12%'),
},
signUpText2: {
fontSize: 13,
marginLeft: 20,
color: 'green',
paddingTop: 10,
},
signUpText3: {
fontSize: 13,
paddingTop: 10,
paddingLeft: 10,
alignItems: 'center',
},
signUpText4: {
fontSize: 13,
paddingTop: 10,
alignItems: 'center',
},
signup: {
color: "#FFF",
},
boxone: {
flex: 1,
marginTop: 5,
},
boxtwo: {
flex: 1,
},
boxthree: {
flex: 1,
},
box: {
flexDirection: 'row',
position: 'relative',
marginBottom: 10,
},
opensave: {
// flex: 1,
...Platform.select({
ios: {
backgroundColor: 'green', height: 30, margin: 5, alignItems:
"center", justifyContent: 'center'
},
android: {
backgroundColor: 'green', height: 30, margin: 5, alignItems:
"center", justifyContent: 'center'
},
}),
},
top: {
// flex: 1,
...Platform.select({
ios: {
flex: 1, marginTop: 10, marginBottom: 10,
},
android: {
flex: 1, marginTop: 10, marginBottom: 10, height: 400
},
}),
},
signUpText: {
fontSize: 13,
justifyContent: 'center',
color: 'white',
alignSelf: 'center',
},
});
\ No newline at end of file
......@@ -48,6 +48,7 @@ export default class TaskChat extends Component {
userid: '',
groupName: '',
groupList: '',
file:'',
};
}
......@@ -670,16 +671,19 @@ export default class TaskChat extends Component {
ImagePicker.openPicker({
width: 300,
height: 400,
cropping: true
cropping: false,
includeBase64: true,
includeExif: true,
})
.then((image) => {
console.log('received image', image);
console.warn('Image Path'+image.path)
this.setState({
image: {
uri: image.path,
uri:image.path,
// data:image.data,
width: image.width,
height: image.height,
mime: image.mime,
......@@ -691,29 +695,80 @@ export default class TaskChat extends Component {
const userToken = response[1][1];
AsyncStorage.getItem("projectId", (err, res) => {
const projectId = res;
this.setState({ itemPressedDisabled: true })
// var data = {
// file: image,
// message: image.path,
// action: 'media',
// corp_code: cropcode,
// groupId: groupId,
// messagedBy: userToken,
// api:'https://api-single.agile24x7.com/pg_migration',
// groupName: this.state.groupName,
// // groupEmail: groupEmail,
// // projectId: projectId,
// }
const data = new FormData();
data.append('file', image);
data.append('message', image.path);
// required data for send message
data.append('action', 'media');
data.append('corp_code', cropcode);
data.append('groupId',groupId);
data.append('messagedBy', userToken);
data.append('api','https://api-single.agile24x7.com/pg_migration');
data.append('groupName', this.state.groupName);
data.append('groupEmail', groupEmail);
console.warn('Image testing data'+JSON.stringify(data))
fetch(API + 'user_story_chat1.php',
{
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
'Content-Type': 'multipart/form-data',
},
body: JSON.stringify({
file: image.uri,
message: message,
action: 'media',
corp_code: cropcode,
groupId: groupId,
messagedBy: userToken,
api:'https://api-single.agile24x7.com/pg_migration',
groupName: this.state.groupName,
groupEmail: groupEmail,
projectId: projectId,
// body:data
body: (
data
)
})
.then((response) => response.json())
.then((responseJson) => {
console.log(responseJson)
console.warn('Image testing '+JSON.stringify(data))
alert(JSON.stringify(responseJson))
if (responseJson.status == 'True') {
alert(JSON.stringify(responseJson))
this.setState({ open: false });
this.setState({
itemPressedDisabled: false,
// isVisible: !this.state.isVisible,
})
// this.getEvent();
//Navigate to AddModule screen
// this.props.navigation.navigate("UserTaskStatus1");
// this.props.navigation.navigate("UserBacklog");
Snackbar.show({
title: 'Event Updated',
backgroundColor: 'green',
duration: Snackbar.LENGTH_LONG,
});
}
// this.refs.toast.show('Project Modified', Toast.Duration.long, Toast.Position.center);
})
})
})
.catch((e) => {
console.log(e);
Alert.alert(e.message ? e.message : e);
......
......@@ -109,6 +109,12 @@ export default class drawerContentComponents1 extends Component {
<Text style={{ color: '#000000', marginLeft: 20 }}>AdminReports</Text>
</View>
</TouchableOpacity>
<TouchableOpacity onPress={this.navigateToScreen('AdminProjectReports')}>
<View style={styles.screenStyle}>
<Image style={{ width: wp('6%'), height: hp('3%') }} source={require('../Images/reports.png')} />
<Text style={{ color: '#000000', marginLeft: 20 }}>AdminProjectReports</Text>
</View>
</TouchableOpacity>
{/* <TouchableOpacity onPress={this.navigateToScreen('AdminReports')}>
<View style={styles.screenStyle}>
......
......@@ -48,6 +48,7 @@ import AdminRoadblock from '../AdminComponets/AdminRoadblock';
import AdminTimeSheet from '../AdminComponets/AdminTimeSheet';
import AdminGroupChat from '../AdminComponets/AdminGroupChat';
import AdminGroupChatModify from '../AdminComponets/AdminGroupChatModify';
import AdminProjectReports from '../AdminComponets/AdminProjectReports';
import MyTask from '../UserComponents/UserMyTask';
......@@ -304,6 +305,7 @@ const AdminDrawer = createDrawerNavigator(
// AdminReports: { screen: AdminReports },
AdminReports1: { screen: AdminReports1 },
AdminTimeSheet:{screen:AdminTimeSheet},
AdminProjectReports:{screen:AdminProjectReports},
AdminAgileSquad: { screen: AdminAgileSquad },
Settings:{screen:Settings},
AdminGroupChat:{screen:AdminGroupChat},
......@@ -397,6 +399,13 @@ const adminAppStack = createStackNavigator({
header:null,
},
},
AdminProjectReports:{
screen:AdminProjectReports,
navigationOptions:{
header:null,
},
},
AdminAgileSquad:{
screen:AdminAgileSquad,
navigationOptions:{
......
/*****MySql********/
//pre production environment (development)
// export const API = "https://api-single.agile24x7.com/release/";
// export const ReportsAPI = "https://testapiv2reporting.agile24x7.com/";
// export const Client_URL = "https://sdtest.agile24x7.com/#/";
export const API = "https://api-single.agile24x7.com/release/";
export const ReportsAPI = "https://testapiv2reporting.agile24x7.com/";
export const Client_URL = "https://sdtest.agile24x7.com/#/";
//production environment
// export const API = "https://api-single.agile24x7.com/Migration/";
......@@ -15,9 +15,9 @@
//pre production environment (development)
export const API = "https://api-single.agile24x7.com/pg_migration/";
export const ReportsAPI = "https://pgtestreporting.agile24x7.com/";
export const Client_URL = "https://pgtest.agile24x7.com/#/";
// export const API = "https://api-single.agile24x7.com/pg_migration/";
// export const ReportsAPI = "https://pgtestreporting.agile24x7.com/";
// export const Client_URL = "https://pgtest.agile24x7.com/#/";
......
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