19 Commitit

Tekijä SHA1 Viesti Päivämäärä
  ErnestoOrtiz2 dca856a60d Quite el boton de prueba, probe muchas veces confirm y funciona. voy a hacer push. 3 vuotta sitten
  ErnestoOrtiz2 a98cca2adf Quite el boton de prueba en home_page 3 vuotta sitten
  ErnestoOrtiz2 abcae8f21e Merging el pull 3 vuotta sitten
  ErnestoOrtiz2 64ebe7b730 Bug ortografico 3 vuotta sitten
  ErnestoOrtiz2 4f47895e77 Merge branch 'Freehand' of https://git.ccom.uprrp.edu/ccorrada/ErEduGilMor 3 vuotta sitten
  ErnestoOrtiz2 73b6bf59ee Arreglo de bug en Confirm (finalmente) 3 vuotta sitten
  ErnestoOrtiz2 fa2ed6e0ae Merge branch 'Freehand' of https://git.ccom.uprrp.edu/ccorrada/ErEduGilMor 3 vuotta sitten
  ErnestoOrtiz2 a2b14efe32 Merge branch 'Freehand' of https://git.ccom.uprrp.edu/ccorrada/ErEduGilMor 3 vuotta sitten
  ErnestoOrtiz2 857f084c6e Tratando todavia de resolver bug en Confirm. Ahora mismo funciona. Por alguna razon, a veces el arreglo appointments llega vacio al listener de respuesta a la notificacion, en cuyo caso no pasa nada a Confirm y se rompe en confirm porque no tiene ningun valor para usar en el query. 3 vuotta sitten
  ErnestoOrtiz2 a08ad74e9a A veces el transferir el appointment en la navegacion de home_page a confirm se rompe. No se la explicacion. Como esta ahora esta funcionando la mayoria de las veces. 3 vuotta sitten
  ErnestoOrtiz2 c482f99609 Merge branch 'Freehand' of https://git.ccom.uprrp.edu/ccorrada/ErEduGilMor 3 vuotta sitten
  ErnestoOrtiz2 f651d86983 Fix al bug de confirm 'new', funciona ...a veces. A veces inexplicablemente, el mismo codigo tira errores. 3 vuotta sitten
  ErnestoOrtiz2 33a7953cf4 Merge branch 'Freehand' of https://git.ccom.uprrp.edu/ccorrada/ErEduGilMor 3 vuotta sitten
  ErnestoOrtiz2 a08bfaea43 Correccion error ortagrafico 3 vuotta sitten
  ErnestoOrtiz2 ee8c0b419f Merge branch 'Freehand' of https://git.ccom.uprrp.edu/ccorrada/ErEduGilMor 3 vuotta sitten
  ErnestoOrtiz2 3b023b46bd Merge branch 'Freehand' of https://git.ccom.uprrp.edu/ccorrada/ErEduGilMor 3 vuotta sitten
  ErnestoOrtiz2 16e148faac Debugging home 3 vuotta sitten
  ErnestoOrtiz2 c20c4d842a Merge branch 'Freehand' of https://git.ccom.uprrp.edu/ccorrada/ErEduGilMor 3 vuotta sitten
  ErnestoOrtiz2 150b837072 punto y como en dia 3 vuotta sitten
4 muutettua tiedostoa jossa 23 lisäystä ja 65 poistoa
  1. 1
    1
      screens/main/Cita.js
  2. 7
    5
      screens/main/Confirm.js
  3. 15
    54
      screens/main/Home_page.js
  4. 0
    5
      screens/main/StateTime.js

+ 1
- 1
screens/main/Cita.js Näytä tiedosto

236
             descriptionNumberOfLines={1}
236
             descriptionNumberOfLines={1}
237
           />
237
           />
238
           <List.Item
238
           <List.Item
239
-            title='Día'
239
+            title='Día:'
240
             description={item.Day}
240
             description={item.Day}
241
             titleNumberOfLines={1}
241
             titleNumberOfLines={1}
242
             titleStyle={styles.listTitle}
242
             titleStyle={styles.listTitle}

+ 7
- 5
screens/main/Confirm.js Näytä tiedosto

24
 });
24
 });
25
 
25
 
26
 
26
 
27
-export function Confirm({navigation}) {
27
+export function Confirm({route, navigation}) {
28
   const [threads, setThreads] = useState([]);  
28
   const [threads, setThreads] = useState([]);  
29
   const [loading, setLoading] = useState(true);
29
   const [loading, setLoading] = useState(true);
30
   const [appointments, setAppointments] = useState([]); 
30
   const [appointments, setAppointments] = useState([]); 
45
       navigation.navigate('Search');
45
       navigation.navigate('Search');
46
     });
46
     });
47
 
47
 
48
-    const cita = firebase.firestore().collection('APPOINTMENTS').where("new", "==", 'true').onSnapshot(snapShot => {
48
+    //console.log("en confirm", route.params.tag.citaID);
49
+    //const cita = firebase.firestore().collection('APPOINTMENTS').where("new", "==", "true").onSnapshot(snapShot => {
50
+    const cita = firebase.firestore().collection('APPOINTMENTS').where("citaID", "==", route.params.x).onSnapshot(snapShot => {
49
       const appointments = snapShot.docs.map(docSnap => {
51
       const appointments = snapShot.docs.map(docSnap => {
50
         return{
52
         return{
51
           _id:docSnap.id,
53
           _id:docSnap.id,
60
         };
62
         };
61
       });
63
       });
62
       setAppointments(appointments);
64
       setAppointments(appointments);
63
-      console.log("appointment", appointments);
65
+      console.log("appointment query de confirm", appointments);
64
     });
66
     });
65
       
67
       
66
     return () => {
68
     return () => {
125
             console.log("date");
127
             console.log("date");
126
           }}
128
           }}
127
           >
129
           >
128
-            <List.Item
130
+          <List.Item
129
             title='Usuario:'
131
             title='Usuario:'
130
             description={item.User}
132
             description={item.User}
131
             titleNumberOfLines={1}
133
             titleNumberOfLines={1}
142
             descriptionNumberOfLines={1}
144
             descriptionNumberOfLines={1}
143
           />
145
           />
144
           <List.Item
146
           <List.Item
145
-            title='Día'
147
+            title='Día:'
146
             description={item.Day}
148
             description={item.Day}
147
             titleNumberOfLines={1}
149
             titleNumberOfLines={1}
148
             titleStyle={styles.listTitle}
150
             titleStyle={styles.listTitle}

+ 15
- 54
screens/main/Home_page.js Näytä tiedosto

24
 });
24
 });
25
 
25
 
26
 
26
 
27
+let x = "x";
28
+console.log(x);
29
+
30
+
27
 export function Home_page({navigation}) {
31
 export function Home_page({navigation}) {
28
 
32
 
29
   const [threads, setThreads] = useState([]);  
33
   const [threads, setThreads] = useState([]);  
47
     });
51
     });
48
 
52
 
49
     responseListener.current = Notifications.addNotificationResponseReceivedListener(response => {
53
     responseListener.current = Notifications.addNotificationResponseReceivedListener(response => {
50
-      console.log("response", response);
51
       if (response.notification.request.content.body == 'Le solicitan una cita'){
54
       if (response.notification.request.content.body == 'Le solicitan una cita'){
52
-        navigation.navigate('Confirm');
55
+        console.log("response appointments ", appointments[0])
56
+        navigation.navigate('Confirm',{x})
53
       } 
57
       } 
54
     });
58
     });
55
 
59
 
94
   });
98
   });
95
 
99
 
96
 
100
 
97
-    const fire = firebase.firestore()
98
-    .collection('THREADS')
99
-    .where("members", "array-contains", firebase.auth().currentUser.uid)
100
-    .onSnapshot(querySnapshot => {
101
-      const threads = querySnapshot.docs.map(documentSnapshot => {
102
-        return{
103
-          _id:documentSnapshot.id,
104
-          name:'',
105
-          ...documentSnapshot.data()
106
-        };
107
-      });
108
-
109
-      setThreads(threads);
110
-
111
-      if(loading){
112
-        setLoading(false);
113
-      }
114
-    });
115
-
116
     const cita = firebase.firestore().collection('APPOINTMENTS').where("participantes", "array-contains", firebase.auth().currentUser.uid).onSnapshot(snapShot => {
101
     const cita = firebase.firestore().collection('APPOINTMENTS').where("participantes", "array-contains", firebase.auth().currentUser.uid).onSnapshot(snapShot => {
117
       const appointments = snapShot.docs.map(docSnap => {
102
       const appointments = snapShot.docs.map(docSnap => {
118
         return{
103
         return{
130
         };
115
         };
131
       });
116
       });
132
       setAppointments(appointments);
117
       setAppointments(appointments);
133
-      console.log("appointment", appointments);
118
+      //console.log("appointment", appointments);
134
     });
119
     });
135
 
120
 
136
       
121
       
137
     return () => {
122
     return () => {
138
       Notifications.removeNotificationSubscription(notificationListener.current);
123
       Notifications.removeNotificationSubscription(notificationListener.current);
139
       Notifications.removeNotificationSubscription(responseListener.current);
124
       Notifications.removeNotificationSubscription(responseListener.current);
140
-      fire();
141
       cita();
125
       cita();
142
       Iuser_data();
126
       Iuser_data();
143
       user_data();
127
       user_data();
185
   
169
   
186
 
170
 
187
   check_user_type_INT();
171
   check_user_type_INT();
188
-  console.log("interpreter", interpreter);
172
+  //console.log("interpreter", interpreter);
189
 
173
 
190
   
174
   
191
   if(interpreter == false){
175
   if(interpreter == false){
202
         renderItem = {({item}) => (
186
         renderItem = {({item}) => (
203
         <TouchableOpacity
187
         <TouchableOpacity
204
         onPress={async () => {
188
         onPress={async () => {
205
-          console.log("item._id, home, client", item.Pin)
189
+          //console.log("item._id, home, client", item.Pin)
206
           navigation.navigate('Cita',{tag: item, Pin: item})
190
           navigation.navigate('Cita',{tag: item, Pin: item})
207
         }}
191
         }}
208
         >
192
         >
223
             descriptionNumberOfLines={1}
207
             descriptionNumberOfLines={1}
224
           />
208
           />
225
           <List.Item
209
           <List.Item
226
-            title='Día'
210
+            title='Día:'
227
             description={item.Day}
211
             description={item.Day}
228
             titleNumberOfLines={1}
212
             titleNumberOfLines={1}
229
             titleStyle={styles.listTitle}
213
             titleStyle={styles.listTitle}
256
               onPress={ async () => {
240
               onPress={ async () => {
257
                 await sendPushNotification(item.i_token);
241
                 await sendPushNotification(item.i_token);
258
                 citaId(item._id);
242
                 citaId(item._id);
243
+                x = item._id;
259
                 }
244
                 }
260
               }
245
               }
261
             /> 
246
             /> 
288
           renderItem = {({item}) => (
273
           renderItem = {({item}) => (
289
           <TouchableOpacity
274
           <TouchableOpacity
290
           onPress={async () => {
275
           onPress={async () => {
291
-            console.log("item._id, home, interpreter", item)
276
+            //console.log("item._id, home, interpreter", item)
292
             navigation.navigate('Cita',{tag: item, Pin: item})
277
             navigation.navigate('Cita',{tag: item, Pin: item})
293
           }}
278
           }}
294
           >
279
           >
309
             descriptionNumberOfLines={1}
294
             descriptionNumberOfLines={1}
310
           />
295
           />
311
           <List.Item
296
           <List.Item
312
-            title='Día'
297
+            title='Día:'
313
             description={item.Day}
298
             description={item.Day}
314
             titleNumberOfLines={1}
299
             titleNumberOfLines={1}
315
             titleStyle={styles.listTitle}
300
             titleStyle={styles.listTitle}
326
           />
311
           />
327
           </TouchableOpacity>
312
           </TouchableOpacity>
328
         )}
313
         )}
329
-            />
330
-
331
-
332
-            <FlatList style={{
333
-             flex: 1,
334
-             width: screenWidth,
335
-            }}
336
-            data={appointments}
337
-            keyExtractor = {item => item._id}
338
-            renderItem={({ item }) => {
339
-            if(item.new == 'true'){
340
-            return (
341
-              <Button
342
-                title ='Pedir Cita'
343
-                onPress={ async () => {
344
-                  await sendPushNotification(item.i_token);
345
-                  citaId(item._id);
346
-                  }
347
-                }
348
-              /> 
349
-            )
350
-            }}}
351
-            />
352
-
353
-
314
+        />
354
           <Button
315
           <Button
355
           title ='Availability'
316
           title ='Availability'
356
           onPress= {() => navigation.navigate('Availability')}
317
           onPress= {() => navigation.navigate('Availability')}
398
       return;
359
       return;
399
     }
360
     }
400
     token = (await Notifications.getExpoPushTokenAsync()).data;
361
     token = (await Notifications.getExpoPushTokenAsync()).data;
401
-    console.log('Token:', token)
362
+    //console.log('Token:', token)
402
   } else {
363
   } else {
403
     alert('Must use physical device for Push Notifications');
364
     alert('Must use physical device for Push Notifications');
404
   }
365
   }

+ 0
- 5
screens/main/StateTime.js Näytä tiedosto

216
     );
216
     );
217
   }
217
   }
218
 }
218
 }
219
-
220
-
221
-
222
-
223
-