-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Update delete workspace error message when frozen expensify cards are present #92917
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
9facbae
8ae1a01
065411a
700097b
0ff99a4
f4d8790
74c13dd
53efab6
0653121
18939ab
21fa9b4
bbd55a8
bfb8b66
689536c
3abb92a
da15d0b
c06f23d
8d3d912
765eb1a
5e31a98
01b9991
fdf73b3
c8dd6ca
b603369
f5c663d
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 |
|---|---|---|
|
|
@@ -17,8 +17,11 @@ import type {TranslationKeyError} from '@src/types/onyx/OnyxCommon'; | |
| import type {ReceiptError} from '@src/types/onyx/Transaction'; | ||
| import Button from './Button'; | ||
| import Icon from './Icon'; | ||
| import RenderHTML from './RenderHTML'; | ||
| import Text from './Text'; | ||
|
|
||
| const HTML_TAG_PATTERN = /<\/?[a-z][^>]*>/i; | ||
|
|
||
| type DotIndicatorMessageProps = { | ||
|
Contributor
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. Is the change in this file necessary? I checked with AI, and it said:
Could you clarify whether this change is actually needed?
Contributor
Author
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. |
||
| /** | ||
| * In most cases this should just be errors from onxyData | ||
|
|
@@ -74,7 +77,31 @@ function DotIndicatorMessage({messages = {}, style, type, textStyles, dismissErr | |
| } | ||
|
|
||
| const displayMessage = isTranslationKeyError(message) ? translate(message.translationKey) : message; | ||
| const formattedMessage = typeof displayMessage === 'string' ? Str.htmlDecode(displayMessage) : displayMessage; | ||
|
|
||
| if (typeof displayMessage !== 'string') { | ||
| return ( | ||
| <Text | ||
| key={index} | ||
| style={[StyleUtils.getDotIndicatorTextStyles(isErrorMessage), textStyles, isTextSelectable ? styles.userSelectText : styles.userSelectNone]} | ||
| accessibilityRole={isErrorMessage ? CONST.ROLE.ALERT : undefined} | ||
| accessibilityLiveRegion={isErrorMessage ? 'assertive' : undefined} | ||
| > | ||
| {displayMessage} | ||
| </Text> | ||
| ); | ||
| } | ||
|
|
||
| if (HTML_TAG_PATTERN.test(displayMessage)) { | ||
| const html = isErrorMessage ? `<rbr>${displayMessage}</rbr>` : `<muted-text-label>${displayMessage}</muted-text-label>`; | ||
|
|
||
| return ( | ||
| <RenderHTML | ||
| key={index} | ||
| html={html} | ||
| isSelectable={isTextSelectable} | ||
| /> | ||
| ); | ||
| } | ||
|
|
||
| return ( | ||
| <Text | ||
|
|
@@ -83,7 +110,7 @@ function DotIndicatorMessage({messages = {}, style, type, textStyles, dismissErr | |
| accessibilityRole={isErrorMessage ? CONST.ROLE.ALERT : undefined} | ||
| accessibilityLiveRegion={isErrorMessage ? 'assertive' : undefined} | ||
| > | ||
| {formattedMessage} | ||
| {Str.htmlDecode(displayMessage)} | ||
| </Text> | ||
| ); | ||
| }; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4516,7 +4516,7 @@ const translations = { | |
| defaultNote: `Receipts sent to ${CONST.EMAIL.RECEIPTS} will appear in this workspace.`, | ||
| deleteConfirmation: 'Are you sure you want to delete this workspace?', | ||
| deleteWithCardsConfirmation: 'Are you sure you want to delete this workspace? This will remove all card feeds and assigned cards.', | ||
| deleteOpenExpensifyCardsError: 'Your company still has open Expensify Cards.', | ||
| deleteOpenExpensifyCardsError: 'Your company still has Expensify Cards. Please <concierge-link>reach out to Concierge</concierge-link> to remove them.', | ||
|
Contributor
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. Missing translations in other languages. I think we can trigger translations workflow for this
Contributor
Author
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. Right! I'll ask someone on slack to trigger the translation script |
||
| outstandingBalanceWarning: | ||
| 'You have an outstanding balance that must be settled before deleting your last workspace. Please go to your subscription settings to resolve the payment.', | ||
| settleBalance: 'Go to subscription', | ||
|
|
||

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.
@jnowakow Could you please add this to CONST
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.
@staszekscp Could you please address this one?