Skip to content
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

[Wallet] Hide get invite code link for pilot build and firebase db fixes #1651

Merged
merged 2 commits into from
Nov 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/mobile/.env
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ DEFAULT_SYNC_MODE=5
DEV_SETTINGS_ACTIVE_INITIALLY=true
FIREBASE_ENABLED=true
SECRETS_KEY=debug
SHOW_TESTNET_BANNER=true
SHOW_TESTNET_BANNER=true
SHOW_GET_INVITE_LINK=false
1 change: 1 addition & 0 deletions packages/mobile/.env.alfajores
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ DEV_SETTINGS_ACTIVE_INITIALLY=false
FIREBASE_ENABLED=true
SECRETS_KEY=production
SHOW_TESTNET_BANNER=true
SHOW_GET_INVITE_LINK=true
3 changes: 2 additions & 1 deletion packages/mobile/.env.integration
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ DEFAULT_SYNC_MODE=5
DEV_SETTINGS_ACTIVE_INITIALLY=true
FIREBASE_ENABLED=true
SECRETS_KEY=integration
SHOW_TESTNET_BANNER=true
SHOW_TESTNET_BANNER=true
SHOW_GET_INVITE_LINK=false
1 change: 1 addition & 0 deletions packages/mobile/.env.pilot
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ DEV_SETTINGS_ACTIVE_INITIALLY=false
FIREBASE_ENABLED=true
SECRETS_KEY=production
SHOW_TESTNET_BANNER=false
SHOW_GET_INVITE_LINK=false
1 change: 1 addition & 0 deletions packages/mobile/.env.pilotstaging
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ DEV_SETTINGS_ACTIVE_INITIALLY=true
FIREBASE_ENABLED=true
SECRETS_KEY=pilotstaging
SHOW_TESTNET_BANNER=false
SHOW_GET_INVITE_LINK=false
1 change: 1 addition & 0 deletions packages/mobile/.env.production
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ DEV_SETTINGS_ACTIVE_INITIALLY=false
FIREBASE_ENABLED=true
SECRETS_KEY=production
SHOW_TESTNET_BANNER=false
SHOW_GET_INVITE_LINK=true
3 changes: 2 additions & 1 deletion packages/mobile/.env.staging
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ DEFAULT_SYNC_MODE=5
DEV_SETTINGS_ACTIVE_INITIALLY=true
FIREBASE_ENABLED=true
SECRETS_KEY=staging
SHOW_TESTNET_BANNER=
SHOW_TESTNET_BANNER=true
SHOW_GET_INVITE_LINK=true
1 change: 1 addition & 0 deletions packages/mobile/.env.test
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ DEV_SETTINGS_ACTIVE_INITIALLY=true
FIREBASE_ENABLED=false
SECRETS_KEY=debug
SHOW_TESTNET_BANNER=false
SHOW_GET_INVITE_LINK=true
Binary file modified packages/mobile/android/app/google-services.json.enc
Binary file not shown.
Binary file not shown.
Binary file modified packages/mobile/android/app/src/debug/google-services.json.enc
Binary file not shown.
Binary file not shown.
Binary file modified packages/mobile/android/app/src/pilot/google-services.json.enc
Binary file not shown.
Binary file modified packages/mobile/android/app/src/staging/google-services.json.enc
Binary file not shown.
2 changes: 2 additions & 0 deletions packages/mobile/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ export const ESCROW_PAYMENT_EXPIRY_SECONDS = 172800 // 2 days

export const SHOW_TESTNET_BANNER = stringToBoolean(Config.SHOW_TESTNET_BANNER || 'false')

export const SHOW_GET_INVITE_LINK = stringToBoolean(Config.SHOW_GET_INVITE_LINK || 'false')

// The minimum allowed value for a transaction such as a transfer
export const DOLLAR_TRANSACTION_MIN_AMOUNT = 0.01
export const GOLD_TRANSACTION_MIN_AMOUNT = 0.001
Expand Down
7 changes: 7 additions & 0 deletions packages/mobile/src/invite/EnterInviteCode.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ import EnterInviteCode, {
} from 'src/invite/EnterInviteCode'
import { createMockStore, getMockI18nProps } from 'test/utils'

jest.mock('src/config', () => {
return {
...jest.requireActual('src/config'),
SHOW_GET_INVITE_LINK: true,
}
})

const VALID_INVITE =
'Something something pFCr5NAAf/vUcWypJiQFnF6DHI+6vCGxMhhShki07ow= another thing else'
const VALID_INVITE_KEY = '0xa450abe4d0007ffbd4716ca92624059c5e831c8fbabc21b13218528648b4ee8c'
Expand Down
14 changes: 8 additions & 6 deletions packages/mobile/src/invite/EnterInviteCode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { hideAlert, showError } from 'src/alert/actions'
import { componentWithAnalytics } from 'src/analytics/wrapper'
import { ErrorMessages } from 'src/app/ErrorMessages'
import DevSkipButton from 'src/components/DevSkipButton'
import { CELO_FAUCET_LINK, DEFAULT_TESTNET } from 'src/config'
import { CELO_FAUCET_LINK, DEFAULT_TESTNET, SHOW_GET_INVITE_LINK } from 'src/config'
import { Namespaces } from 'src/i18n'
import { redeemInvite } from 'src/invite/actions'
import { extractValidInviteCode, getValidInviteCodeFromReferrerData } from 'src/invite/utils'
Expand Down Expand Up @@ -212,12 +212,14 @@ export class EnterInviteCode extends React.Component<Props, State> {
</ScrollView>

<View>
<Text style={styles.askInviteText}>
{t('inviteCodeText.askForInvite.0', { testnet: _.startCase(DEFAULT_TESTNET) })}
<Text onPress={this.onPressGoToFaucet} style={styles.askInviteLink}>
{t('inviteCodeText.askForInvite.1')}
{SHOW_GET_INVITE_LINK && (
<Text style={styles.askInviteText}>
{t('inviteCodeText.askForInvite.0', { testnet: _.startCase(DEFAULT_TESTNET) })}
<Text onPress={this.onPressGoToFaucet} style={styles.askInviteLink}>
{t('inviteCodeText.askForInvite.1')}
</Text>
</Text>
</Text>
)}
<Button
onPress={this.onPressContinue}
disabled={isRedeemingInvite || !redeemComplete || !account}
Expand Down
6 changes: 2 additions & 4 deletions scripts/key_placer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,9 @@ for file_path in "${files[@]}"; do
continue
fi

# When encrypting ensure the plaintext file exists and the encrypted file does not.
# When encrypting ensure the plaintext file exists.
if [[ $1 == "encrypt" ]]; then
if [[ -f "$encrypted_file_path" ]]; then
continue
elif [[ ! -f "$file_path" ]]; then
if [[ ! -f "$file_path" ]]; then
i1skn marked this conversation as resolved.
Show resolved Hide resolved
echo "$file_path does not exist, cannot encrypt - skipping file" >&2
continue
fi
Expand Down