From 090a8c07da6cb07d7f5b5acbcbf9773e551be650 Mon Sep 17 00:00:00 2001
From: santhosh <santhosh>
Date: Fri, 19 Nov 2021 09:31:26 +0530
Subject: [PATCH] dashboard changes

---
 src/LaunchScreens/Login.js          |  2 +-
 src/UserComponents/UserDashboard.js | 31 ++++++++++++++++------------
 src/UserComponents/UserMyTask.js    | 19 +++++++++--------
 src/WebServices/RestClient.js       | 32 ++++++++++++++++++-----------
 4 files changed, 50 insertions(+), 34 deletions(-)

diff --git a/src/LaunchScreens/Login.js b/src/LaunchScreens/Login.js
index bf9c08b..dfdb4dd 100644
--- a/src/LaunchScreens/Login.js
+++ b/src/LaunchScreens/Login.js
@@ -113,7 +113,7 @@ export default class Login extends Component {
 
         // alert("deviceid" + userId)
         if (userId === null) {
-          alert("Relogin Again")
+          alert("Your Device Id  is not detected. \n Please relaunch app and Try again...")
           this.setState({
           
             username: '',
diff --git a/src/UserComponents/UserDashboard.js b/src/UserComponents/UserDashboard.js
index b237b1f..a710d26 100644
--- a/src/UserComponents/UserDashboard.js
+++ b/src/UserComponents/UserDashboard.js
@@ -13,9 +13,10 @@ import {
     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 { 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 Icon from 'react-native-vector-icons/FontAwesome';
 import AsyncStorage from '@react-native-community/async-storage';
 import { ReportsAPI } from "../WebServices/RestClient";
 import { API } from "../WebServices/RestClient";
@@ -330,16 +331,20 @@ export default class UserDashboard extends Component {
                         borderBottomColor: '#ffffff',
                         justifyContent: 'space-between',
                     }}>
-                    <View style={{ marginTop: 20 }}>
+                    <View style={{ marginTop: 20 ,flexDirection:'row'}}>
+                    <Icon name="plus-circle" style={{ color: 'white', paddingRight: 5 }} size={25} />
+
                         <TouchableOpacity onPress={this.openModal}>
-                            <Text style={{ width: 300, borderRadius: 20, height: 45, flexDirection: 'row', color: 'white' }}>
+                            <Text style={{ width: 100, borderRadius: 20, height: 45, flexDirection: 'row', color: 'white',padding:5 }}>
                                 Add Project
                         </Text>
                         </TouchableOpacity>
                     </View>
-                    <View style={{ marginTop: 20 }}>
+                    <View style={{ marginTop: 20 ,flexDirection:'row'}}>
                         <TouchableOpacity onPress={this.logOutOption.bind(this)}>
-                            <Text style={{ width: 300, borderRadius: 20, height: 45, flexDirection: 'row', color: 'white' }}>Logout</Text>
+                            {/* <Text style={{ borderRadius: 20, height: 45,color: 'white' }}>Logout</Text> */}
+                            <Icon name="power-off" style={{ color: 'white'}} size={25} />
+
                         </TouchableOpacity>
                     </View>
                 </Header>
@@ -432,7 +437,7 @@ export default class UserDashboard extends Component {
 
                         </TouchableOpacity>
                         <TouchableOpacity style={styles.opencancel} onPress={this.closeModal}>
-                            <Text style={{ color: 'black' }}>CANCEL</Text>
+                            <Text style={{ color: 'white' }}>CANCEL</Text>
                         </TouchableOpacity>
 
                     </View>
@@ -575,15 +580,15 @@ const styles = StyleSheet.create({
 
     },
     opencancel: {
-        flex: 1,
+        // flex: 1,
         ...Platform.select({
             ios: {
-                backgroundColor: 'red', margin: 20, height: 30, alignItems:
-                    "center", justifyContent: 'center'
+                backgroundColor: 'red', height: 30, margin: 5, alignItems:
+                    "center", justifyContent: 'center',paddingLeft:10,paddingRight:10
             },
             android: {
-                backgroundColor: 'red', margin: 20, height: 30, alignItems:
-                    "center", justifyContent: 'center'
+                backgroundColor: 'red', height: 30, margin: 5, alignItems:
+                    "center", justifyContent: 'center',paddingLeft:10,paddingRight:10
             },
         }),
     },
@@ -592,11 +597,11 @@ const styles = StyleSheet.create({
         ...Platform.select({
             ios: {
                 backgroundColor: 'green', height: 30, margin: 5, alignItems:
-                    "center", justifyContent: 'center'
+                    "center", justifyContent: 'center',paddingLeft:10,paddingRight:10
             },
             android: {
                 backgroundColor: 'green', height: 30, margin: 5, alignItems:
-                    "center", justifyContent: 'center'
+                    "center", justifyContent: 'center',paddingLeft:10,paddingRight:10
             },
         }),
     },
diff --git a/src/UserComponents/UserMyTask.js b/src/UserComponents/UserMyTask.js
index 0604623..73e186d 100644
--- a/src/UserComponents/UserMyTask.js
+++ b/src/UserComponents/UserMyTask.js
@@ -441,7 +441,8 @@ export default class MyTask extends Component {
             // ToastAndroid.showWithGravity('"Enter sub Task', ToastAndroid.SHORT,ToastAndroid.CENTER);
             // this.setState({ error1: 'Module Title ' });
         }
-        else if (moment(startDate).format('YYYY.MM.DD') >= moment(targetDate).format('YYYY.MM.DD')) {
+        else if (startDate >= targetDate) {
+        // else if (moment(startDate).format('MM.DD.YYYY') >= moment(targetDate).format('YYYY.MM.DD')) {
             log("Warn", "Start date should not be less than or equal to  End date");
             alert("Start date should not be less than or equal to  End date")
             // ToastAndroid.showWithGravity('"Enter sub Task', ToastAndroid.SHORT,ToastAndroid.CENTER);
@@ -838,6 +839,8 @@ export default class MyTask extends Component {
 
               </View>
             </TouchableOpacity> */}
+            {(this.state.emp_role !== "Contributor") &&
+           
                 <View style={styles.bottomView} >
                     <TouchableOpacity onPress={this.openModal} >
                         {/* <Icon name='lightbulb-o'color='white' type='MaterialCommunityIcons' size={30} /> */}
@@ -846,7 +849,7 @@ export default class MyTask extends Component {
                 </View>
 
 
-
+        }
 
                 <Modal
                     offset={this.state.offset}
@@ -874,9 +877,9 @@ export default class MyTask extends Component {
                         date={this.state.startDate}
                         mode="date"
                         placeholder="From Date"
-                        format="YYYY-MM-DD"
-                        minDate="2020-01-01"
-                        maxDate="2080-12-31"
+                        format="MM.DD.YYYY"
+                        // minDate="2020-01-01"
+                        // maxDate="2080-12-31"
                         // minDate="01-01-2019"
                         // maxDate="01-06-2075"
                         confirmBtnText="Ok"
@@ -893,9 +896,9 @@ export default class MyTask extends Component {
                         date={this.state.targetDate}
                         mode="date"
                         placeholder="To Date"
-                        format="YYYY-MM-DD"
-                        minDate="2020-01-01"
-                        maxDate="2080-12-31"
+                        format="MM.DD.YYYY"
+                        // minDate="2020-01-01"
+                        // maxDate="2080-12-31"
                         // minDate="01-01-2019"
                         // maxDate="01-06-2075"
                         confirmBtnText="Ok"
diff --git a/src/WebServices/RestClient.js b/src/WebServices/RestClient.js
index b18fa95..04e97d4 100644
--- a/src/WebServices/RestClient.js
+++ b/src/WebServices/RestClient.js
@@ -1,19 +1,27 @@
-// ------------ Testing data single db 
-// export const API = "https://api-single.agile24x7.com/release/"; //production
-// export const ReportsAPI = "https://apiv2reporting.agile24x7.com/"//Reports
 
+/*MySql*/
+//pre production environment (development)
+export const API = "https://api-single.agile24x7.com/release/";
+export const ReportsAPI = "https://apiv2reporting.agile24x7.com/";
+export const Client_URL = "https://www.agile24x7.com/";
 
-// ------------ Live data single db 
+/*Postgress*/
+//pre production environment (development)
+// export const API = "https://api-single.agile24x7.com/pg_migration/";
+// export const ReportsAPI = "https://testapiv2reporting.agile24x7.com/";
+// export const Client_URL = "https://pgtest.agile24x7.com/";
 
-// export const ReportsAPI="https://testapiv2reporting.agile24x7.com/" //pre production"
 
-// ------------ Live data single db 
+/*MySql*/
+//production environment
+// export const API = "https://api-single.agile24x7.com/Migration/";
+// export const ReportsAPI = "https://apiv2reporting.agile24x7.com/";
+// export const Client_URL = "https://sdtest.agile24x7.com/#/";
 
-// export const API = "https://api-single.agile24x7.com/Migration/"; //production
-// export const ReportsAPI = "https://apiv2reporting.agile24x7.com/"//Reports
+/*Postgress*/
+//production environment
+// export const API = "https://api-single.agile24x7.com/Migration/";
+// export const ReportsAPI = "https://apiv2reporting.agile24x7.com/";
+// export const Client_URL = "https://www.agile24x7.com/";
 
-// ------------ pgURls 
-export const API = "https://api-single.agile24x7.com/pg_migration/";
-export const ReportsAPI = "https://pgreporting.agile24x7.com/";
-export const Client_URL = "https://sdtest.agile24x7.com/#/";
 
-- 
GitLab