Repository navigation
Strip new magic codes instances #97457
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
Changes from all commits
1e91c19
9019e85
2b9b17a
d867ce3
6a3b35f
31fdb92
5237667
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| name: Check validateCode terminology | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize] | ||
| branches: [main] | ||
| paths: ['**.ts', '**.tsx', '**.md'] | ||
|
|
||
| jobs: | ||
| check: | ||
| runs-on: blacksmith-2vcpu-ubuntu-2404 | ||
| steps: | ||
| - name: Checkout | ||
| uses: useblacksmith/checkout@1c9394c220d293645707b625ba9d79685f093a8f # v1 | ||
|
|
||
| - name: Check validateCode terminology | ||
| run: ./scripts/checkValidateCodeTerminology.sh |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| #!/bin/bash | ||
| # | ||
| # Enforces validateCode terminology across the codebase: | ||
| # - User-facing copy (src/languages) must use "security code" / "security link", not "magic code" | ||
| # - Internal identifiers (src, tests) must use validateCode, not magicCode / MagicCode / MAGIC_CODE | ||
|
|
||
| set -e | ||
|
|
||
| ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" | ||
| readonly ROOT_DIR | ||
|
|
||
| # grep output format: path:line:content — filter lines whose content is a pure comment | ||
| filter_comments() { | ||
| grep -v ":[0-9]*:[[:space:]]*//" | grep -v ":[0-9]*:[[:space:]]*\*" | ||
| } | ||
|
|
||
| LANG_HITS=$(grep -rni --include="*.ts" "magic.code\|magic code" "$ROOT_DIR/src/languages" 2>/dev/null | filter_comments || true) | ||
| CODE_HITS=$(grep -rn --include="*.ts" --include="*.tsx" "magicCode\|MagicCode\|MAGIC_CODE" "$ROOT_DIR/src" "$ROOT_DIR/tests" 2>/dev/null | filter_comments || true) | ||
| DOCS_HITS=$(grep -rn --include="*.md" "magic.code\|magic code\|magicCode\|MagicCode\|MAGIC_CODE" "$ROOT_DIR" 2>/dev/null | grep -v "node_modules" || true) | ||
|
|
||
| if [[ -z "$LANG_HITS" && -z "$CODE_HITS" && -z "$DOCS_HITS" ]]; then | ||
| echo "✅ Validate code terminology check passed." | ||
| exit 0 | ||
| fi | ||
|
|
||
| echo "❌ Validate code terminology violations found." | ||
| echo " User-facing copy: use 'security code' / 'security link'." | ||
| echo " Internal identifiers: use 'validateCode'." | ||
| echo "" | ||
| [[ -n "$LANG_HITS" ]] && echo "$LANG_HITS" | ||
| [[ -n "$CODE_HITS" ]] && echo "$CODE_HITS" | ||
| [[ -n "$DOCS_HITS" ]] && echo "$DOCS_HITS" | ||
| exit 1 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,7 +29,7 @@ import { | |
|
|
||
| import getWalletPersonalDetailsParams from '@pages/EnablePayments/shared/getWalletPersonalDetailsParams'; | ||
| import IdologyQuestions from '@pages/EnablePayments/shared/IdologyQuestions'; | ||
| import useWalletPhoneMagicCode from '@pages/EnablePayments/shared/useWalletPhoneMagicCode'; | ||
| import useWalletPhoneValidateCode from '@pages/EnablePayments/shared/useWalletPhoneValidateCode'; | ||
|
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.
This new import points at Useful? React with 👍 / 👎. |
||
| import AddressFormFields from '@pages/ReimbursementAccount/AddressFormFields'; | ||
|
|
||
| import {setAdditionalDetailsQuestions} from '@userActions/Wallet'; | ||
|
|
@@ -82,7 +82,7 @@ function AdditionalDetailsStep({currentUserPersonalDetails}: AdditionalDetailsSt | |
| const maxDate = subYears(currentDate, CONST.DATE_BIRTH.MIN_AGE_FOR_PAYMENT); | ||
| const shouldAskForFullSSN = walletAdditionalDetails?.errorCode === CONST.WALLET.ERROR.SSN; | ||
|
|
||
| const {submitPersonalDetails} = useWalletPhoneMagicCode(); | ||
| const {submitPersonalDetails} = useWalletPhoneValidateCode(); | ||
|
|
||
| const validate = (values: FormOnyxValues<typeof ONYXKEYS.FORMS.WALLET_ADDITIONAL_DETAILS>): FormInputErrors<typeof ONYXKEYS.FORMS.WALLET_ADDITIONAL_DETAILS> => { | ||
| const errors = getFieldRequiredErrors(values, STEP_FIELDS, translate); | ||
|
|
||
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.
SCREENS.SETTINGS.WALLET.ENABLE_PAYMENTS_CONFIRM_VALIDATE_CODEis not defined insrc/SCREENS.ts(the navigator/types/RHP relation still useENABLE_PAYMENTS_CONFIRM_MAGIC_CODE). In the transpiled app this creates anundefinedkey in the linking config, sosettings/wallet/enable-payments/confirm-validate-codeis not mapped to the mounted wallet confirmation screen and navigation to the new URL cannot resolve correctly.Useful? React with 👍 / 👎.