-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flip TU constants for QA #31094
Merged
Merged
Flip TU constants for QA #31094
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
671cd2d
Update TEACHERS_UNITE constants
marcochavezf 3f45a72
Add policyID and publicRoomReportID parameters to
marcochavezf e266572
Add useEnvironment hook to
marcochavezf 0903d8f
Add useEnvironment hook to KnowATeacherPage
marcochavezf 30f0fcc
Show "I'm a teacher" button always
marcochavezf 880a00a
Remove unused imports from SaveTheWorldPage.js
marcochavezf 8c9a587
Refactor environment variable to isProduction in
marcochavezf 1fb005d
Refactor useEnvironment hook to use isProduction
marcochavezf 5ff73dc
Fix import statement and remove unnecessary
marcochavezf 9978397
Merge branch 'main' into marco-flipTUConstants
marcochavezf 072c07d
Use the global reportID as optimistic reportID for the TU room
marcochavezf 6da2729
Change param to reportID
marcochavezf 789edde
Merge branch 'main' into marco-flipTUConstants
marcochavezf 47e8c87
Pass policyID to check if we're using test TU policyID
marcochavezf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,5 @@ | ||
import _ from 'lodash'; | ||
import PropTypes from 'prop-types'; | ||
import React from 'react'; | ||
import {View} from 'react-native'; | ||
import {withOnyx} from 'react-native-onyx'; | ||
import IllustratedHeaderPageLayout from '@components/IllustratedHeaderPageLayout'; | ||
import LottieAnimations from '@components/LottieAnimations'; | ||
import MenuItem from '@components/MenuItem'; | ||
|
@@ -11,28 +8,13 @@ import useLocalize from '@hooks/useLocalize'; | |
import useTheme from '@hooks/useTheme'; | ||
import useThemeStyles from '@hooks/useThemeStyles'; | ||
import Navigation from '@libs/Navigation/Navigation'; | ||
import CONST from '@src/CONST'; | ||
import ONYXKEYS from '@src/ONYXKEYS'; | ||
import ROUTES from '@src/ROUTES'; | ||
import SCREENS from '@src/SCREENS'; | ||
|
||
const propTypes = { | ||
/** The list of this user's policies */ | ||
policy: PropTypes.shape({ | ||
/** The user's role in the policy */ | ||
role: PropTypes.string, | ||
}), | ||
}; | ||
|
||
const defaultProps = { | ||
policy: {}, | ||
}; | ||
|
||
function SaveTheWorldPage(props) { | ||
function SaveTheWorldPage() { | ||
marcochavezf marked this conversation as resolved.
Show resolved
Hide resolved
|
||
const theme = useTheme(); | ||
const styles = useThemeStyles(); | ||
const {translate} = useLocalize(); | ||
const isTeacherAlreadyInvited = !_.isUndefined(props.policy) && props.policy.role === CONST.POLICY.ROLE.USER; | ||
|
||
return ( | ||
<IllustratedHeaderPageLayout | ||
|
@@ -53,23 +35,14 @@ function SaveTheWorldPage(props) { | |
onPress={() => Navigation.navigate(ROUTES.I_KNOW_A_TEACHER)} | ||
/> | ||
|
||
{!isTeacherAlreadyInvited && ( | ||
<MenuItem | ||
shouldShowRightIcon | ||
title={translate('teachersUnitePage.iAmATeacher')} | ||
onPress={() => Navigation.navigate(ROUTES.I_AM_A_TEACHER)} | ||
/> | ||
)} | ||
<MenuItem | ||
shouldShowRightIcon | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I removed this condition to allow the teacher to enter again the principal email in case they entered the email incorrectly |
||
title={translate('teachersUnitePage.iAmATeacher')} | ||
onPress={() => Navigation.navigate(ROUTES.I_AM_A_TEACHER)} | ||
/> | ||
</IllustratedHeaderPageLayout> | ||
); | ||
} | ||
|
||
SaveTheWorldPage.propTypes = propTypes; | ||
SaveTheWorldPage.defaultProps = defaultProps; | ||
SaveTheWorldPage.displayName = 'SaveTheWorldPage'; | ||
|
||
export default withOnyx({ | ||
policy: { | ||
key: () => `${ONYXKEYS.COLLECTION.POLICY}${CONST.TEACHERS_UNITE.POLICY_ID}`, | ||
}, | ||
})(SaveTheWorldPage); | ||
export default SaveTheWorldPage; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can create a hook to return the teachers' unite policyID and publicRoomID based on the environment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This constants will be only used in these two places, so I think it's not necessary to move it to a hook atm