From cdb2906aaad41bb1339f4b39a93654e537757f2a Mon Sep 17 00:00:00 2001 From: Jonathan Taveras Date: Sat, 28 Dec 2019 09:08:57 -0400 Subject: [PATCH 01/30] Hotfix develop --- App/Screens/Calendar/Calendar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/App/Screens/Calendar/Calendar.js b/App/Screens/Calendar/Calendar.js index ba85578..63c2650 100644 --- a/App/Screens/Calendar/Calendar.js +++ b/App/Screens/Calendar/Calendar.js @@ -1,6 +1,6 @@ import React from 'react'; import Lodash from 'lodash'; -import Moment from 'moment'; +import Moment from 'moment/min/moment-with-locales'; import { connect } from 'react-redux'; import CalendarComponent from '../../Components/Calendar'; From 84a65d4bd54328f6a8e10879f9324e3aef96fee7 Mon Sep 17 00:00:00 2001 From: Jonathan Taveras Date: Sat, 28 Dec 2019 09:18:58 -0400 Subject: [PATCH 02/30] Hotfix develop --- App/Components/Common/CalendarDatePicker/CalendarDatePicker.js | 1 + App/index.js | 1 + 2 files changed, 2 insertions(+) diff --git a/App/Components/Common/CalendarDatePicker/CalendarDatePicker.js b/App/Components/Common/CalendarDatePicker/CalendarDatePicker.js index fe2de26..85faece 100644 --- a/App/Components/Common/CalendarDatePicker/CalendarDatePicker.js +++ b/App/Components/Common/CalendarDatePicker/CalendarDatePicker.js @@ -2,6 +2,7 @@ import React, { Component } from 'react'; import { StyleSheet } from 'react-native'; import PropTypes from 'prop-types'; import CalendarStrip from 'react-native-calendar-strip'; +import 'moment/locale/es'; // import CalendarStrip from 'react-native-slideable-calendar-strip'; import Moment from 'moment'; diff --git a/App/index.js b/App/index.js index 7cb1652..660c0db 100644 --- a/App/index.js +++ b/App/index.js @@ -4,6 +4,7 @@ import React, { Component } from 'react'; import { View, StyleSheet } from 'react-native'; import Moment from 'moment/min/moment-with-locales'; +import 'moment/locale/es'; import { Provider } from 'react-redux'; import * as Font from 'expo-font'; From 9a9e9df17df8233e96b5b9447dd1b719745cdc5c Mon Sep 17 00:00:00 2001 From: Jonathan Taveras Date: Sat, 28 Dec 2019 09:30:11 -0400 Subject: [PATCH 03/30] Hotfix develop --- App/Screens/EventForm/EventForm.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/App/Screens/EventForm/EventForm.js b/App/Screens/EventForm/EventForm.js index 405097f..930fe5e 100644 --- a/App/Screens/EventForm/EventForm.js +++ b/App/Screens/EventForm/EventForm.js @@ -54,6 +54,9 @@ class EventForm extends React.Component { errors.attachments = 'Necesita almenos un documento'; } } + if (startDate >= endDate) { + errors.dateTime = 'La fecha debe ser menor a la fecha final'; + } return errors; }; @@ -341,7 +344,4 @@ const mapDispatchToProps = dispatch => { ); }; -export default connect( - mapStateToProps, - mapDispatchToProps -)(EventForm); +export default connect(mapStateToProps, mapDispatchToProps)(EventForm); From e4012e8e8f493cffe7d35a91a43925f05ffe376f Mon Sep 17 00:00:00 2001 From: Jonathan Taveras Date: Sat, 28 Dec 2019 09:47:38 -0400 Subject: [PATCH 04/30] Hotfix develop --- App/Core/Api/Api.js | 5 ++ App/Screens/ChangePassword/ChangePassword.js | 7 +-- App/Screens/Settings/Settings.js | 58 ++++++++++++++------ 3 files changed, 47 insertions(+), 23 deletions(-) diff --git a/App/Core/Api/Api.js b/App/Core/Api/Api.js index cd62edd..9225f86 100644 --- a/App/Core/Api/Api.js +++ b/App/Core/Api/Api.js @@ -150,6 +150,10 @@ const RegisterForNotifications = pushToken => { return MemoApi.post(`notifications/register`, { pushToken }); }; +const UnRegisterForNotifications = () => { + return MemoApi.post(`/notifications/unregister`); +}; + const SendRecoveryEmail = objUserEmailParam => { return MemoApi.post(`auth/forgot`, objUserEmailParam); }; @@ -198,6 +202,7 @@ const Api = { ChangePassword, ValidateRecoveryCode, UploadFile, + UnRegisterForNotifications, }; export default Api; diff --git a/App/Screens/ChangePassword/ChangePassword.js b/App/Screens/ChangePassword/ChangePassword.js index 94769f2..d736678 100644 --- a/App/Screens/ChangePassword/ChangePassword.js +++ b/App/Screens/ChangePassword/ChangePassword.js @@ -138,9 +138,4 @@ const mapDispatchToProps = dispatch => { ); }; -export default WithLogger( - connect( - null, - mapDispatchToProps - )(ChangePassword) -); +export default WithLogger(connect(null, mapDispatchToProps)(ChangePassword)); diff --git a/App/Screens/Settings/Settings.js b/App/Screens/Settings/Settings.js index 036f3ba..4c7ce58 100644 --- a/App/Screens/Settings/Settings.js +++ b/App/Screens/Settings/Settings.js @@ -7,6 +7,7 @@ import * as IntentLauncher from 'expo-intent-launcher'; import { bindActionCreators } from 'redux'; import Lodash from 'lodash'; +import LoadingState from '../../Components/LoadingState'; import SettingsComponent from '../../Components/Settings'; import { selectors as userManagerSelectors, @@ -16,6 +17,13 @@ import WithLogger, { MessagesKey } from '../../HOCs/WithLogger'; import Api from '../../Core/Api'; class Settings extends React.Component { + constructor(props) { + super(props); + this.state = { + isLoading: false, + }; + } + goBack = () => { const { navigation: { pop }, @@ -41,8 +49,12 @@ class Settings extends React.Component { handleSetProfileImage = strImageUri => { const { logger, setUserInfo } = this.props; + this.setState({ isLoading: true }); + return Api.UploadProfilePicture(strImageUri) .then(objResponse => { + this.setState({ isLoading: false }); + const objUserInfo = Lodash.get(objResponse, ['data', 'data'], null); setUserInfo(objUserInfo); return logger.success({ @@ -51,6 +63,8 @@ class Settings extends React.Component { }); }) .catch(objError => { + this.setState({ isLoading: false }); + return setTimeout(() => { logger.error({ key: MessagesKey.CHANGE_PROFILE_PICTURE_FAILED, @@ -62,7 +76,18 @@ class Settings extends React.Component { handleLogout = () => { const { logout } = this.props; - return logout(); + this.setState({ isLoading: true }); + return Api.UnRegisterForNotifications() + .then(() => { + this.setState({ isLoading: false }); + + return logout(); + }) + .catch(() => { + this.setState({ isLoading: false }); + + return logout(); + }); }; handleOnSyncPress = () => { @@ -81,18 +106,22 @@ class Settings extends React.Component { }; render() { + const { isLoading } = this.state; const { firstName, lastName, userAvatarURI } = this.props; return ( - + <> + + + ); } } @@ -123,9 +152,4 @@ const mapDispatchToProps = dispatch => { ); }; -export default WithLogger( - connect( - mapStateToProps, - mapDispatchToProps - )(Settings) -); +export default WithLogger(connect(mapStateToProps, mapDispatchToProps)(Settings)); From 24dff5061cebcfd04f22553351ce0f47e600b436 Mon Sep 17 00:00:00 2001 From: Jonathan Taveras Date: Sat, 28 Dec 2019 11:22:44 -0400 Subject: [PATCH 05/30] Add loading state and animation and fix some issues --- .eslintrc | 2 +- App/Components/ClassHub/ClassHub.js | 59 ++++++++++- App/Components/ClassInfoCard/ClassInfoCard.js | 3 +- .../ClassInfoCardLoadingState.js | 15 +++ App/Components/ClassInfoCard/index.js | 3 +- App/Components/Common/InfoCard/InfoCard.js | 8 +- .../Common/InfoCard/InfoCardLoadingState.js | 29 ++++++ App/Components/Common/InfoCard/index.js | 3 +- .../EventCalendarLoadingState.js | 29 ++++++ App/Components/EventCalendar/index.js | 3 +- App/Components/Home/Home.js | 20 +++- App/Components/LoadingList/LoadingList.js | 22 +++++ App/Components/LoadingList/index.js | 3 + App/Components/LoadingState/LoadingState.js | 24 ++++- App/Screens/Home/Home.js | 22 ++++- package.json | 2 + yarn.lock | 98 +++++++++++++++++++ 17 files changed, 325 insertions(+), 20 deletions(-) create mode 100644 App/Components/ClassInfoCard/ClassInfoCardLoadingState.js create mode 100644 App/Components/Common/InfoCard/InfoCardLoadingState.js create mode 100644 App/Components/EventCalendar/EventCalendarLoadingState.js create mode 100644 App/Components/LoadingList/LoadingList.js create mode 100644 App/Components/LoadingList/index.js diff --git a/.eslintrc b/.eslintrc index ed04c54..ef0f437 100644 --- a/.eslintrc +++ b/.eslintrc @@ -5,7 +5,7 @@ "prettier/react" ], "rules": { - "react/prop-types": ["error", { "ignore": ["imageUri","onPress","children","style","predefinedStyle", "logger", "focused", "navigation","logout", "value","loggedIn","userToken","showActionSheetWithOptions", "MessagesKey", "initialsValue", "isModalVisible", "prevIsModalVisible", "initialsValue","toastRef", "myClasses", + "react/prop-types": ["error", { "ignore": ["renderItem","isLoading","imageUri","onPress","children","style","predefinedStyle", "logger", "focused", "navigation","logout", "value","loggedIn","userToken","showActionSheetWithOptions", "MessagesKey", "initialsValue", "isModalVisible", "prevIsModalVisible", "initialsValue","toastRef", "myClasses", "myClassesLookup"] }], "no-fallthrough": "off", "jsx-a11y/anchor-is-valid": "off", diff --git a/App/Components/ClassHub/ClassHub.js b/App/Components/ClassHub/ClassHub.js index bd0f2b9..bc43d92 100644 --- a/App/Components/ClassHub/ClassHub.js +++ b/App/Components/ClassHub/ClassHub.js @@ -1,5 +1,5 @@ import React from 'react'; -import { View, StyleSheet, FlatList } from 'react-native'; +import { View, StyleSheet, Animated } from 'react-native'; import PropTypes from 'prop-types'; import Text from '../Common/Text'; @@ -10,7 +10,49 @@ import { toBaseDesignPx, spacers, fonts, colors, constants } from '../../Core/Th import SubjectPostRecent from '../SubjectPostRecent'; import LoadingState from '../LoadingState'; +const OPACITY_VALUE = 1; + class ClassHub extends React.PureComponent { + constructor(props) { + super(props); + this.state = { + classHubHeaderHeight: new Animated.Value(toBaseDesignPx(297)), + }; + } + + handleInterpolateHeaderHub = () => { + const { classHubHeaderHeight } = this.state; + const headerHub = classHubHeaderHeight.interpolate({ + inputRange: [ + toBaseDesignPx(297), + toBaseDesignPx(297) * 2, + toBaseDesignPx(297) * 3, + toBaseDesignPx(297) * 4, + ], + outputRange: [ + toBaseDesignPx(297), + toBaseDesignPx(297) / 2, + toBaseDesignPx(297) / 3, + constants.DEVICE.STATUS_BAR_HEIGHT, + ], + extrapolate: 'clamp', + useNativeDriver: true, + }); + + const headerHubOpacity = classHubHeaderHeight.interpolate({ + inputRange: [ + toBaseDesignPx(297), + toBaseDesignPx(297) * 2, + toBaseDesignPx(297) * 3, + toBaseDesignPx(297) * 4, + ], + outputRange: [OPACITY_VALUE, OPACITY_VALUE / 2, OPACITY_VALUE / 4, 0], + extrapolate: 'clamp', + useNativeDriver: true, + }); + return { headerHub, headerHubOpacity }; + }; + renderHeaderHub = () => { const { onBackArrowPress, @@ -23,8 +65,13 @@ class ClassHub extends React.PureComponent { subjectSection, subjectRoom, } = this.props; + const headerHubTransitions = this.handleInterpolateHeaderHub(); + const { headerHub, headerHubOpacity } = headerHubTransitions; + return ( - + - + ); }; @@ -123,10 +170,12 @@ class ClassHub extends React.PureComponent { }; renderRecentPosts = () => { + const { classHubHeaderHeight } = this.state; + const { posts, isFetchingPost, onRefreshPosts } = this.props; return ( - item.id} ListEmptyComponent={this.renderPostsEmpty} ItemSeparatorComponent={() => } + ListFooterComponent={() => } + onScroll={Animated.event([{ nativeEvent: { contentOffset: { y: classHubHeaderHeight } } }])} /> ); }; diff --git a/App/Components/ClassInfoCard/ClassInfoCard.js b/App/Components/ClassInfoCard/ClassInfoCard.js index 5957c8d..b57a4b0 100644 --- a/App/Components/ClassInfoCard/ClassInfoCard.js +++ b/App/Components/ClassInfoCard/ClassInfoCard.js @@ -17,13 +17,14 @@ class ClassInfoCard extends React.Component { }; render() { - const { subject, schedule, onPress, disabled, titleStyle } = this.props; + const { subject, schedule, onPress, disabled, titleStyle, isLoading } = this.props; return ( diff --git a/App/Components/ClassInfoCard/ClassInfoCardLoadingState.js b/App/Components/ClassInfoCard/ClassInfoCardLoadingState.js new file mode 100644 index 0000000..8432f52 --- /dev/null +++ b/App/Components/ClassInfoCard/ClassInfoCardLoadingState.js @@ -0,0 +1,15 @@ +import React from 'react'; + +import InfoCard from '../Common/InfoCard'; + +class ClassInfoCardLoadingState extends React.Component { + renderClassInfoCardLoadingState = () => { + return ; + }; + + render() { + return this.renderClassInfoCardLoadingState(); + } +} + +export default ClassInfoCardLoadingState; diff --git a/App/Components/ClassInfoCard/index.js b/App/Components/ClassInfoCard/index.js index f5f8304..83719a9 100644 --- a/App/Components/ClassInfoCard/index.js +++ b/App/Components/ClassInfoCard/index.js @@ -1,3 +1,4 @@ import ClassInfoCard from './ClassInfoCard'; +import ClassInfoCardLoadingState from './ClassInfoCardLoadingState'; -export default ClassInfoCard; +export { ClassInfoCard as default, ClassInfoCardLoadingState }; diff --git a/App/Components/Common/InfoCard/InfoCard.js b/App/Components/Common/InfoCard/InfoCard.js index 8448b1f..83d2327 100644 --- a/App/Components/Common/InfoCard/InfoCard.js +++ b/App/Components/Common/InfoCard/InfoCard.js @@ -8,6 +8,7 @@ import { colors, toBaseDesignPx, spacers } from '../../../Core/Theme'; // Common import Text from '../Text'; +import InfoCardLoadingState from './InfoCardLoadingState'; class InfoCard extends React.Component { handleOnPress = () => { @@ -21,7 +22,12 @@ class InfoCard extends React.Component { }; render() { - const { children, title, style, titleStyle, disabled } = this.props; + const { children, title, style, titleStyle, disabled, isLoading } = this.props; + + if (isLoading) { + return ; + } + return ( { + return ( + + + + ); + }; + + render() { + return this.renderSectionLoadingState(); + } +} + +export default SectionLoadingState; diff --git a/App/Components/Common/InfoCard/index.js b/App/Components/Common/InfoCard/index.js index efe4fb6..a580f4b 100644 --- a/App/Components/Common/InfoCard/index.js +++ b/App/Components/Common/InfoCard/index.js @@ -1,3 +1,4 @@ import InfoCard from './InfoCard'; +import InfoCardLoadingState from './InfoCardLoadingState'; -export default InfoCard; +export { InfoCard as default, InfoCardLoadingState }; diff --git a/App/Components/EventCalendar/EventCalendarLoadingState.js b/App/Components/EventCalendar/EventCalendarLoadingState.js new file mode 100644 index 0000000..a71b539 --- /dev/null +++ b/App/Components/EventCalendar/EventCalendarLoadingState.js @@ -0,0 +1,29 @@ +import React from 'react'; +import SvgAnimatedLinearGradient from 'react-native-svg-animated-linear-gradient'; + +import { Rect } from 'react-native-svg'; + +import { toBaseDesignPx } from '../../Core/Theme'; + +class EventCalendarLoadingState extends React.Component { + renderEventCalendarLoadingState = () => { + return ( + + + + ); + }; + + render() { + return this.renderEventCalendarLoadingState(); + } +} + +export default EventCalendarLoadingState; diff --git a/App/Components/EventCalendar/index.js b/App/Components/EventCalendar/index.js index 9814769..c7b6852 100644 --- a/App/Components/EventCalendar/index.js +++ b/App/Components/EventCalendar/index.js @@ -1,3 +1,4 @@ import EventCalendar from './EventCalendar'; +import EventCalendarLoadingState from './EventCalendarLoadingState'; -export default EventCalendar; +export { EventCalendar as default, EventCalendarLoadingState }; diff --git a/App/Components/Home/Home.js b/App/Components/Home/Home.js index 0820971..0eb23a1 100644 --- a/App/Components/Home/Home.js +++ b/App/Components/Home/Home.js @@ -11,7 +11,9 @@ import Section from '../Common/Section'; import LoadingState from '../LoadingState'; import Link from '../Common/Link'; import Event from '../SwipeableEventCalendar'; +import { EventCalendarLoadingState } from '../EventCalendar'; import Subject from '../SubjectCalendar'; +import LoadingList from '../LoadingList'; class Home extends React.Component { renderTodayTitle = () => { @@ -66,6 +68,10 @@ class Home extends React.Component { ); }; + renderEventCalendarLoadingState = item => { + return ; + }; + renderListEvents = () => { const { events } = this.props; @@ -117,7 +123,16 @@ class Home extends React.Component { }; renderEvents = () => { - const { events, subjects, onMyCalendarPress } = this.props; + const { events, subjects, onMyCalendarPress, isLoading } = this.props; + + if (isLoading) { + return ( + } + /> + ); + } if (Lodash.isEmpty(events) && Lodash.isEmpty(subjects)) { return ( @@ -142,7 +157,7 @@ class Home extends React.Component { }; render() { - const { renderSubjects, refreshing, onRefresh } = this.props; + const { renderSubjects, refreshing, onRefresh, isLoading } = this.props; return (
@@ -156,6 +171,7 @@ class Home extends React.Component {
} >
{this.renderEvents()}
diff --git a/App/Components/LoadingList/LoadingList.js b/App/Components/LoadingList/LoadingList.js new file mode 100644 index 0000000..79753d9 --- /dev/null +++ b/App/Components/LoadingList/LoadingList.js @@ -0,0 +1,22 @@ +import React from 'react'; +import { FlatList } from 'react-native'; + +class LoadingList extends React.Component { + constructor(props) { + super(props); + this.state = { + data: [1, 2, 3, 4], + }; + } + + render() { + const { data } = this.state; + const { renderItem } = this.props; + + return ( + item} {...this.props} /> + ); + } +} + +export default LoadingList; diff --git a/App/Components/LoadingList/index.js b/App/Components/LoadingList/index.js new file mode 100644 index 0000000..f67ac9a --- /dev/null +++ b/App/Components/LoadingList/index.js @@ -0,0 +1,3 @@ +import LoadingList from './LoadingList'; + +export default LoadingList; diff --git a/App/Components/LoadingState/LoadingState.js b/App/Components/LoadingState/LoadingState.js index fe4a6c8..432bd2d 100644 --- a/App/Components/LoadingState/LoadingState.js +++ b/App/Components/LoadingState/LoadingState.js @@ -14,7 +14,9 @@ const SOURCE_ANIMATION_EMPTY_BOX = require('../../Core/Assets/Animations/emptyBo class LoadingState extends React.Component { componentDidMount() { - this.animation.play(); + if (this.animation) { + this.animation.play(); + } } getSize = () => { @@ -60,21 +62,30 @@ class LoadingState extends React.Component { render() { const loaderStyle = this.getSize(); const animationSrc = this.getAnimationSource(); + const { withoutLottie } = this.props; + + if (withoutLottie) { + return null; + } + return ; } } const LoadingStateModal = props => { - const { isVisible } = props; + const { isVisible, withoutLottie } = props; + const styleWithoutLottie = withoutLottie ? { backgroundColor: colors.TRANSPARENT } : null; + return ( - - + + ); @@ -87,6 +98,7 @@ const BaseLoadingState = { Modal: objProps => , NoEvents: objProps => , Empty: objProps => , + withoutLottie: objProps => , }; const styles = StyleSheet.create({ @@ -113,20 +125,24 @@ LoadingState.defaultProps = { size: null, noEventToday: false, isEmpty: false, + withoutLottie: false, }; LoadingState.propTypes = { size: PropTypes.string, noEventToday: PropTypes.bool, isEmpty: PropTypes.bool, + withoutLottie: PropTypes.bool, }; LoadingStateModal.defaultProps = { isVisible: false, + withoutLottie: false, }; LoadingStateModal.propTypes = { isVisible: PropTypes.bool, + withoutLottie: PropTypes.bool, }; export default BaseLoadingState; diff --git a/App/Screens/Home/Home.js b/App/Screens/Home/Home.js index 24a11af..95834e3 100644 --- a/App/Screens/Home/Home.js +++ b/App/Screens/Home/Home.js @@ -11,7 +11,7 @@ import HomeComponent from '../../Components/Home'; import { colors, fonts, spacers } from '../../Core/Theme'; import Api, { MemoApi, RegisterForNotifications } from '../../Core/Api'; import WithLogger, { MessagesKey } from '../../HOCs/WithLogger'; -import ClassInfoCard from '../../Components/ClassInfoCard'; +import ClassInfoCard, { ClassInfoCardLoadingState } from '../../Components/ClassInfoCard'; import { actions as classesActions, selectors as myClassesSelectors, @@ -22,7 +22,7 @@ import { actions as userActions, } from '../../Redux/Common/UserManager'; import { selectors as EventFormSelectors } from '../EventForm/Redux'; - +import LoadingList from '../../Components/LoadingList'; import { Classes, Events } from '../../Models'; class Home extends React.Component { @@ -252,11 +252,24 @@ class Home extends React.Component { ); }; + renderSubjectsLoadingState = item => { + return ; + }; + renderSubjects = () => { const { myClasses, myClassesLookup } = this.props; + const { isLoading } = this.state; const myClassesFormatted = Classes.getClassesData(myClasses, myClassesLookup); - if (Lodash.isNull(myClasses) || Lodash.isEmpty(myClassesLookup)) return null; + if (isLoading) { + return ( + + ); + } return ( - + = 0.3.2 < 0.4.0": version "0.3.8" resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.8.tgz#9f1276f5b2b463f2114d3f2c75250af8c1a36f4a" @@ -2627,6 +2655,18 @@ csstype@^2.2.0: resolved "https://registry.yarnpkg.com/csstype/-/csstype-2.6.8.tgz#0fb6fc2417ffd2816a418c9336da74d7f07db431" integrity sha512-msVS9qTuMT5zwAGCVm4mxfrZ18BNc6Csd0oJAtiFMZ1FAx1CCvy2+5MDmYoix63LM/6NDbNtodCiGYGmFgO0dA== +d3-color@1: + version "1.4.0" + resolved "https://registry.yarnpkg.com/d3-color/-/d3-color-1.4.0.tgz#89c45a995ed773b13314f06460df26d60ba0ecaf" + integrity sha512-TzNPeJy2+iEepfiL92LAAB7fvnp/dV2YwANPVHdDWmYMm23qIJBYww3qT8I8C1wXrmrg4UWs7BKc2tKIgyjzHg== + +d3-interpolate@^1.1.5: + version "1.4.0" + resolved "https://registry.yarnpkg.com/d3-interpolate/-/d3-interpolate-1.4.0.tgz#526e79e2d80daa383f9e0c1c1c7dcc0f0583e987" + integrity sha512-V9znK0zc3jOPV4VD2zZn0sDhZU3WAE2bmlxdIwwQPPzPjvyLkd8B3JUVdS1IDUFDkWZ72c9qnv1GK2ZagTZ8EA== + dependencies: + d3-color "1" + damerau-levenshtein@^1.0.4: version "1.0.5" resolved "https://registry.yarnpkg.com/damerau-levenshtein/-/damerau-levenshtein-1.0.5.tgz#780cf7144eb2e8dbd1c3bb83ae31100ccc31a414" @@ -2850,11 +2890,29 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" +dom-serializer@0: + version "0.2.2" + resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.2.2.tgz#1afb81f533717175d478655debc5e332d9f9bb51" + integrity sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g== + dependencies: + domelementtype "^2.0.1" + entities "^2.0.0" + dom-walk@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/dom-walk/-/dom-walk-0.1.1.tgz#672226dc74c8f799ad35307df936aba11acd6018" integrity sha1-ZyIm3HTI95mtNTB9+TaroRrNYBg= +domelementtype@1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.1.tgz#d048c44b37b0d10a7f2a3d5fee3f4333d790481f" + integrity sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w== + +domelementtype@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.0.1.tgz#1f8bdfe91f5a78063274e803b4bdcedf6e94f94d" + integrity sha512-5HOHUDsYZWV8FGWN0Njbr/Rn7f/eWSQi1v7+HsUVwXgn8nWWlL64zKDkS0n8ZmQ3mlWOMuXOnR+7Nx/5tMO5AQ== + domexception@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/domexception/-/domexception-1.0.1.tgz#937442644ca6a31261ef36e3ec677fe805582c90" @@ -2862,6 +2920,14 @@ domexception@^1.0.1: dependencies: webidl-conversions "^4.0.2" +domutils@^1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.7.0.tgz#56ea341e834e06e6748af7a1cb25da67ea9f8c2a" + integrity sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg== + dependencies: + dom-serializer "0" + domelementtype "1" + ecc-jsbn@~0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" @@ -2926,6 +2992,11 @@ end-of-stream@^1.1.0: dependencies: once "^1.4.0" +entities@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/entities/-/entities-2.0.0.tgz#68d6084cab1b079767540d80e56a39b423e4abf4" + integrity sha512-D9f7V0JSRwIxlRI2mjMqufDrRDnx8p+eEOz7aUM9SuvF8gsBzra0/6tbjl1m8eQHrZlYj6PxqE00hZ1SAIKPLw== + envinfo@^5.7.0: version "5.12.1" resolved "https://registry.yarnpkg.com/envinfo/-/envinfo-5.12.1.tgz#83068c33e0972eb657d6bc69a6df30badefb46ef" @@ -6045,6 +6116,11 @@ md5-file@^3.2.3: dependencies: buffer-alloc "^1.1.0" +mdn-data@2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.6.tgz#852dc60fcaa5daa2e8cf6c9189c440ed3e042978" + integrity sha512-rQvjv71olwNHgiTbfPZFkJtjNMciWgswYeciZhtvWLO8bmX3TnhyA62I6sTWOyZssWHJJjY6/KiWwqQsWWsqOA== + media-typer@0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" @@ -6823,6 +6899,13 @@ npmlog@^4.0.2: gauge "~2.7.3" set-blocking "~2.0.0" +nth-check@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-1.0.2.tgz#b2bd295c37e3dd58a3bf0700376663ba4d9cf05c" + integrity sha512-WeBOdju8SnzPN5vTUJYxYUxLeXpCaVP5i5e0LF8fg7WORF2Wd7wFX/pk0tYZk7s8T+J7VLy0Da6J1+wCT0AtHg== + dependencies: + boolbase "~1.0.0" + nullthrows@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/nullthrows/-/nullthrows-1.1.1.tgz#7818258843856ae971eae4208ad7d7eb19a431b1" @@ -7802,6 +7885,21 @@ react-native-screens@^2.0.0-alpha.11: dependencies: debounce "^1.2.0" +react-native-svg-animated-linear-gradient@^0.3.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/react-native-svg-animated-linear-gradient/-/react-native-svg-animated-linear-gradient-0.3.3.tgz#7177d46bb3bcdcfd1037b3f0731ec56f03a30432" + integrity sha512-oTA6snOJ7zCcQHzQM9SMRVp1f8m2s99VT9zNobO3PvsRHyhbtc5Cpwbs3tkX8FKpclHIXguqoy+fGA/HpHLKyQ== + dependencies: + d3-interpolate "^1.1.5" + +react-native-svg@^9.13.6: + version "9.13.6" + resolved "https://registry.yarnpkg.com/react-native-svg/-/react-native-svg-9.13.6.tgz#5365fba2bc460054b90851e71f2a71006a5d373f" + integrity sha512-vjjuJhEhQCwWjqsgWyGy6/C/LIBM2REDxB40FU1PMhi8T3zQUwUHnA6M15pJKlQG8vaZyA+QnLyIVhjtujRgig== + dependencies: + css-select "^2.0.2" + css-tree "^1.0.0-alpha.37" + react-native-swipeable@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/react-native-swipeable/-/react-native-swipeable-0.6.0.tgz#0fe551330018b83c754d27f505709a594f554370" From 23e8f69d053c1fef2c102854e18cdb6f1986441c Mon Sep 17 00:00:00 2001 From: Jonathan Taveras Date: Sat, 28 Dec 2019 11:54:32 -0400 Subject: [PATCH 06/30] Add loading state and animation and fix some issues --- App/Components/Common/DropDown/DropDown.js | 8 ++++++++ App/Components/Common/InfoCard/InfoCardLoadingState.js | 5 ++++- App/Components/EventCalendar/EventCalendarLoadingState.js | 6 +++++- App/Screens/SyncAccount/SyncAccount.js | 8 ++------ 4 files changed, 19 insertions(+), 8 deletions(-) diff --git a/App/Components/Common/DropDown/DropDown.js b/App/Components/Common/DropDown/DropDown.js index f89db09..1e10a79 100644 --- a/App/Components/Common/DropDown/DropDown.js +++ b/App/Components/Common/DropDown/DropDown.js @@ -1,3 +1,4 @@ +/* eslint-disable react/destructuring-assignment */ import React from 'react'; import { View, ViewPropTypes, StyleSheet } from 'react-native'; import PropTypes from 'prop-types'; @@ -26,6 +27,13 @@ class DropDownComponent extends React.Component { this.setState({ value }); } + componentDidUpdate(prevProps, prevState) { + if (prevProps.options !== this.props.options || prevState.value !== this.state.value) { + return true; + } + return false; + } + handleOptionChange = value => { const { onChange } = this.props; this.setState({ value }); diff --git a/App/Components/Common/InfoCard/InfoCardLoadingState.js b/App/Components/Common/InfoCard/InfoCardLoadingState.js index d70c755..c65b467 100644 --- a/App/Components/Common/InfoCard/InfoCardLoadingState.js +++ b/App/Components/Common/InfoCard/InfoCardLoadingState.js @@ -3,7 +3,7 @@ import SvgAnimatedLinearGradient from 'react-native-svg-animated-linear-gradient import { Rect } from 'react-native-svg'; -import { toBaseDesignPx } from '../../../Core/Theme'; +import { toBaseDesignPx, constants } from '../../../Core/Theme'; class SectionLoadingState extends React.Component { renderSectionLoadingState = () => { @@ -22,6 +22,9 @@ class SectionLoadingState extends React.Component { }; render() { + if (constants.isAndroid) { + return null; + } return this.renderSectionLoadingState(); } } diff --git a/App/Components/EventCalendar/EventCalendarLoadingState.js b/App/Components/EventCalendar/EventCalendarLoadingState.js index a71b539..905d816 100644 --- a/App/Components/EventCalendar/EventCalendarLoadingState.js +++ b/App/Components/EventCalendar/EventCalendarLoadingState.js @@ -3,7 +3,7 @@ import SvgAnimatedLinearGradient from 'react-native-svg-animated-linear-gradient import { Rect } from 'react-native-svg'; -import { toBaseDesignPx } from '../../Core/Theme'; +import { toBaseDesignPx, constants } from '../../Core/Theme'; class EventCalendarLoadingState extends React.Component { renderEventCalendarLoadingState = () => { @@ -22,6 +22,10 @@ class EventCalendarLoadingState extends React.Component { }; render() { + if (constants.isAndroid) { + return null; + } + return this.renderEventCalendarLoadingState(); } } diff --git a/App/Screens/SyncAccount/SyncAccount.js b/App/Screens/SyncAccount/SyncAccount.js index 40e001d..72f309d 100644 --- a/App/Screens/SyncAccount/SyncAccount.js +++ b/App/Screens/SyncAccount/SyncAccount.js @@ -46,6 +46,7 @@ class SyncAccount extends Component { ['data', 'universities'], [] ); + console.log({ objSupportedResponse }); this.setLoading(false); const universitiesFormatted = listSupportedUniversities.map(objUniversity => { return { @@ -181,9 +182,4 @@ const mapDispatchToProps = dispatch => { ); }; -export default WithLogger( - connect( - null, - mapDispatchToProps - )(SyncAccount) -); +export default WithLogger(connect(null, mapDispatchToProps)(SyncAccount)); From 4b7b0aa598ee2b89612d7cfcc262dbad52a4746b Mon Sep 17 00:00:00 2001 From: Carlos Rosario Date: Sat, 28 Dec 2019 12:28:41 -0400 Subject: [PATCH 07/30] Fix Stack Problem y navigation a ChangePassword --- App/Navigation/MainTabNavigator.js | 33 ++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/App/Navigation/MainTabNavigator.js b/App/Navigation/MainTabNavigator.js index 7791a75..2843ee4 100644 --- a/App/Navigation/MainTabNavigator.js +++ b/App/Navigation/MainTabNavigator.js @@ -24,6 +24,7 @@ import PostResourcesScreen from '../Screens/PostResources'; import SettingsScreen from '../Screens/Settings'; import ViewResourceScreen from '../Screens/ViewResource'; import SyncScreen from '../Screens/SyncAccount'; +import ChangePasswordScreen from '../Screens/ChangePassword'; // Screens import ClassHubScreen from '../Screens/ClassHub'; @@ -52,9 +53,17 @@ const HomeStack = createStackNavigator( config ); -HomeStack.navigationOptions = { - tabBarLabel: ({ focused }) => , - tabBarIcon: ({ focused }) => , +HomeStack.navigationOptions = ({ navigation }) => { + let tabBarVisible = true; + if (navigation.state.index > 0) { + tabBarVisible = false; + } + + return { + tabBarVisible, + tabBarLabel: ({ focused }) => , + tabBarIcon: ({ focused }) => , + }; }; HomeStack.path = ''; @@ -62,13 +71,22 @@ HomeStack.path = ''; const CalendarStack = createStackNavigator( { Calendar: CalendarScreen, + PostInfo, }, config ); -CalendarStack.navigationOptions = { - tabBarLabel: ({ focused }) => , - tabBarIcon: ({ focused }) => , +CalendarStack.navigationOptions = ({ navigation }) => { + let tabBarVisible = true; + if (navigation.state.index > 0) { + tabBarVisible = false; + } + + return { + tabBarVisible, + tabBarLabel: ({ focused }) => , + tabBarIcon: ({ focused }) => , + }; }; CalendarStack.path = ''; @@ -153,6 +171,9 @@ const ProfileStack = createStackNavigator( Profile: ProfileScreen, Settings: SettingsScreen, Sync: SyncScreen, + ChangePassword: { + screen: ChangePasswordScreen, + }, }, config ); From 37b7cfd47054b4e091e8f9fbe47de7385fe7d609 Mon Sep 17 00:00:00 2001 From: francinelucca Date: Sat, 28 Dec 2019 13:17:53 -0400 Subject: [PATCH 08/30] Disparates --- App/Components/Home/Home.js | 2 +- App/Screens/SyncAccount/SyncAccount.js | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/App/Components/Home/Home.js b/App/Components/Home/Home.js index 0eb23a1..1f4d02c 100644 --- a/App/Components/Home/Home.js +++ b/App/Components/Home/Home.js @@ -42,7 +42,7 @@ class Home extends React.Component { - +
diff --git a/App/Screens/SyncAccount/SyncAccount.js b/App/Screens/SyncAccount/SyncAccount.js index 72f309d..17440aa 100644 --- a/App/Screens/SyncAccount/SyncAccount.js +++ b/App/Screens/SyncAccount/SyncAccount.js @@ -46,7 +46,6 @@ class SyncAccount extends Component { ['data', 'universities'], [] ); - console.log({ objSupportedResponse }); this.setLoading(false); const universitiesFormatted = listSupportedUniversities.map(objUniversity => { return { From 9fc4ce18c782a442f999d33698ebeb91462ce16f Mon Sep 17 00:00:00 2001 From: Jonathan Taveras Date: Sat, 28 Dec 2019 13:32:46 -0400 Subject: [PATCH 09/30] hotfix form --- App/Screens/EventForm/EventForm.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/App/Screens/EventForm/EventForm.js b/App/Screens/EventForm/EventForm.js index 930fe5e..316195f 100644 --- a/App/Screens/EventForm/EventForm.js +++ b/App/Screens/EventForm/EventForm.js @@ -43,6 +43,9 @@ class EventForm extends React.Component { } if (hasDate) { + if (startDate >= endDate) { + errors.dateTime = 'La fecha debe ser menor a la fecha final'; + } if (!endDate || !startDate) { errors.startDate = 'Necesita una fecha'; errors.endDate = 'Necesita una fecha'; @@ -54,9 +57,6 @@ class EventForm extends React.Component { errors.attachments = 'Necesita almenos un documento'; } } - if (startDate >= endDate) { - errors.dateTime = 'La fecha debe ser menor a la fecha final'; - } return errors; }; @@ -180,7 +180,7 @@ class EventForm extends React.Component { startDate: hasDate ? startDate : null, endDate: hasDate ? endDate : null, section, - type: endTime && startTime ? 'Event' : 'Resource', + type: hasDate ? 'Event' : 'Resource', isPublic: type === 'public', }; From f4d3b1fc95908f80854aa12e9b6873dc83045acc Mon Sep 17 00:00:00 2001 From: francinelucca Date: Sat, 28 Dec 2019 13:37:11 -0400 Subject: [PATCH 10/30] fix changePassword navigation --- App/Screens/ChangePassword/ChangePassword.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/App/Screens/ChangePassword/ChangePassword.js b/App/Screens/ChangePassword/ChangePassword.js index d736678..0385659 100644 --- a/App/Screens/ChangePassword/ChangePassword.js +++ b/App/Screens/ChangePassword/ChangePassword.js @@ -10,6 +10,14 @@ import ChangePasswordForm from '../../Components/ChangePassword'; import { actions as userActions } from '../../Redux/Common/UserManager'; class ChangePassword extends Component { + static navigationOptions = ({ navigation }) => { + const { getParam } = navigation; + const canNavigate = getParam('canNavigate', false); + return { + gesturesEnabled: canNavigate, + }; + }; + constructor(props) { super(props); this.state = { From e775175265ebf5f285a5cfa80ec95cbdf0f0b8bc Mon Sep 17 00:00:00 2001 From: Jonathan Taveras Date: Sat, 28 Dec 2019 17:53:26 -0400 Subject: [PATCH 11/30] hotfix text inputs --- App/Components/Login/LoginForm.js | 4 ++++ App/Components/Register/Register.js | 6 ++++++ App/Components/SyncComponent/SyncForm.js | 5 ++++- App/Screens/Login/Login.js | 10 ++-------- App/Screens/Register/Register.js | 8 ++------ App/Screens/SyncAccount/SyncAccount.js | 1 + 6 files changed, 19 insertions(+), 15 deletions(-) diff --git a/App/Components/Login/LoginForm.js b/App/Components/Login/LoginForm.js index 5287fc4..04e87d7 100644 --- a/App/Components/Login/LoginForm.js +++ b/App/Components/Login/LoginForm.js @@ -58,6 +58,8 @@ class LoginForm extends Component { }; renderForm = objForm => { + const { isLoading } = this.props; + return ( @@ -72,6 +74,7 @@ class LoginForm extends Component { onSubmitEditing={() => { this.passwordInput.focus(); }} + disabled={isLoading} /> { @@ -82,6 +85,7 @@ class LoginForm extends Component { containerStyle={styles.input} returnKeyType="done" secureTextEntry + disabled={isLoading} />