-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Support EXPORTINTEGRATION actions #44930
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
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
844baf2
remove EXPORTINTEGRATION from OldDot actions list
arosiclair 06f584c
add originalMessage for EXPORTINTEGRATION
arosiclair 624f550
add copy
arosiclair 3d9aa0f
add ExportIntegration action
arosiclair 99731b3
add more integration labels
arosiclair 9235c98
handle multiple non-reimbursable urls
arosiclair fdfb58b
calculate base62 reportID
arosiclair 22ab047
allow multiple links
arosiclair 854f5a7
remove trailing spaces from translations
arosiclair bb30de1
fix wrapping
arosiclair 91f500a
Merge branch 'main' of github.com:Expensify/App into arosiclair-expor…
arosiclair 8ed0db3
remove from OldDot actions
arosiclair 71ceaaf
support pending action
arosiclair b0c573c
add key
arosiclair 48d33a2
Merge branch 'main' of github.com:Expensify/App into arosiclair-expor…
arosiclair ceb811c
move to separate module to fix dependency cycle
arosiclair 34fd955
move message building to ReportActionUtils
arosiclair 48ca92b
use message util for LHN last message text
arosiclair 24db1d4
Merge branch 'main' of github.com:Expensify/App into arosiclair-expor…
arosiclair fbd6b62
add spanish translations
arosiclair bb4bc42
use consts
arosiclair abd2288
handle salesforce URLs
arosiclair 6a7c057
handle empty URLs
arosiclair 0c49035
copy formatted message text to clipboard
arosiclair f409e36
copy formatted html to preserve links
arosiclair 949bcec
Merge branch 'main' of github.com:Expensify/App into arosiclair-expor…
arosiclair 730a715
use string type
arosiclair 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| /* eslint-disable react/no-array-index-key */ | ||
| import React from 'react'; | ||
| import {View} from 'react-native'; | ||
| import type {OnyxEntry} from 'react-native-onyx'; | ||
| import Text from '@components/Text'; | ||
| import TextLink from '@components/TextLink'; | ||
| import useThemeStyles from '@hooks/useThemeStyles'; | ||
| import * as ReportActionUtils from '@libs/ReportActionsUtils'; | ||
| import type {ReportAction} from '@src/types/onyx'; | ||
|
|
||
| type ExportIntegrationProps = { | ||
| action: OnyxEntry<ReportAction>; | ||
| }; | ||
|
|
||
| function ExportIntegration({action}: ExportIntegrationProps) { | ||
| const styles = useThemeStyles(); | ||
| const fragments = ReportActionUtils.getExportIntegrationActionFragments(action); | ||
|
|
||
| return ( | ||
| <View style={[styles.flex1, styles.flexRow, styles.alignItemsCenter, styles.flexWrap]}> | ||
| {fragments.map((fragment, index) => { | ||
| if (!fragment.url) { | ||
| return ( | ||
| <Text | ||
| key={index} | ||
| style={[styles.chatItemMessage, styles.colorMuted]} | ||
| > | ||
| {fragment.text}{' '} | ||
| </Text> | ||
| ); | ||
| } | ||
|
|
||
| return ( | ||
| <TextLink | ||
| key={index} | ||
| href={fragment.url} | ||
| > | ||
| {fragment.text}{' '} | ||
| </TextLink> | ||
| ); | ||
| })} | ||
| </View> | ||
| ); | ||
| } | ||
|
|
||
| ExportIntegration.displayName = 'ExportIntegration'; | ||
|
|
||
| export default ExportIntegration; |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| /** | ||
| * Take an integer reportID and convert it to a string representing a Base-62 report ID. | ||
| * | ||
| * This is in it's own module to prevent a dependency cycle between libs/ReportUtils.ts and libs/ReportActionUtils.ts | ||
| * | ||
| * @return string The reportID in base 62-format, always 12 characters beginning with `R`. | ||
| */ | ||
| export default function getBase62ReportID(reportID: number): string { | ||
| const alphabet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; | ||
| let result = ''; | ||
| let remainder = reportID; | ||
| while (remainder > 0) { | ||
| const currentVal = remainder % 62; | ||
| result = alphabet[currentVal] + result; | ||
| remainder = Math.floor(remainder / 62); | ||
| } | ||
|
|
||
| return `R${result.padStart(11, '0')}`; | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.