-
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
Allow HTML for task titles #55967
Open
johnmlee101
wants to merge
40
commits into
main
Choose a base branch
from
john-title-task-html
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Allow HTML for task titles #55967
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
cd226e9
Allow HTML for task titles
johnmlee101 72fb9d6
Don't encode task titles
johnmlee101 7f727d7
Support both html and non-html task titles
johnmlee101 7077d24
Eslint
johnmlee101 2cebebc
Additional html and text docs
johnmlee101 9834057
prettier
johnmlee101 96676ea
Safe access of task titles
johnmlee101 aa8fd5b
Fix name
johnmlee101 77f560d
prettier
johnmlee101 ea4fa84
MAke work with useOnyx
johnmlee101 d281ba1
Generalize getting report nmae
johnmlee101 36d8edb
Use new formatter for reportName to correctly access report names
johnmlee101 487f610
Fix imports
johnmlee101 7407194
Prettier
johnmlee101 e10dddc
Get working in a more simplified way
johnmlee101 905a9b6
Remove str
johnmlee101 b8feffa
Prettier
johnmlee101 fd505e6
Add task-title renderer
johnmlee101 31bae0f
Render HTML from task title
johnmlee101 0d17784
Grow height with taskttile page editing
johnmlee101 2c0adc0
Allow for createTask flows to render html when editing tasks
johnmlee101 8f937a2
Prettier
johnmlee101 b285f42
TaskUtils
johnmlee101 7221db7
Prettier
johnmlee101 d9bd484
Remove getParsedComment
johnmlee101 0bead0f
Default values
johnmlee101 d36bc52
Missing dependency
johnmlee101 d8b14fd
Merge branch 'main' into john-title-task-html
johnmlee101 23b8c93
Merge branch 'main' into john-title-task-html
johnmlee101 a45b1a0
Fix new schema
johnmlee101 4fe45d6
Rename file
johnmlee101 e0ce0f5
Fix reference
johnmlee101 344ba8d
Remove unnecessary formatting for getReportName
johnmlee101 4a6559c
Change defaults
johnmlee101 dbc7563
Fix default values for string values
johnmlee101 6e6981e
prettier
johnmlee101 75e1863
Merge branch 'main' into john-title-task-html
johnmlee101 70f63cc
Merge branch 'main' into john-title-task-html
johnmlee101 88c4526
Don't parse comment if we're getting original report title
johnmlee101 5d1a576
Multi-line support
johnmlee101 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
19 changes: 19 additions & 0 deletions
19
src/components/HTMLEngineProvider/HTMLRenderers/TaskTitleRenderer.tsx
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from 'react'; | ||
import type {CustomRendererProps, TPhrasing, TText} from 'react-native-render-html'; | ||
import {TNodeChildrenRenderer} from 'react-native-render-html'; | ||
import Text from '@components/Text'; | ||
import useThemeStyles from '@hooks/useThemeStyles'; | ||
|
||
function TaskTitleRenderer({tnode}: CustomRendererProps<TText | TPhrasing>) { | ||
const styles = useThemeStyles(); | ||
|
||
return ( | ||
<Text style={[styles.taskTitleMenuItem]}> | ||
<TNodeChildrenRenderer tnode={tnode} /> | ||
</Text> | ||
); | ||
} | ||
|
||
TaskTitleRenderer.displayName = 'TaskTitleRenderer'; | ||
|
||
export default TaskTitleRenderer; |
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 |
---|---|---|
|
@@ -10,6 +10,7 @@ import MenuItemWithTopDescription from '@components/MenuItemWithTopDescription'; | |
import OfflineWithFeedback from '@components/OfflineWithFeedback'; | ||
import {usePersonalDetails} from '@components/OnyxProvider'; | ||
import PressableWithSecondaryInteraction from '@components/PressableWithSecondaryInteraction'; | ||
import RenderHTML from '@components/RenderHTML'; | ||
import Text from '@components/Text'; | ||
import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails'; | ||
import useLocalize from '@hooks/useLocalize'; | ||
|
@@ -41,7 +42,6 @@ function TaskView({report}: TaskViewProps) { | |
useEffect(() => { | ||
setTaskReport(report); | ||
}, [report]); | ||
|
||
const taskTitle = convertToLTR(report?.reportName ?? ''); | ||
const assigneeTooltipDetails = getDisplayNamesWithTooltips(getPersonalDetailsForAccountIDs(report?.managerID ? [report?.managerID] : [], personalDetails), false); | ||
const isOpen = isOpenTaskReport(report); | ||
|
@@ -111,7 +111,7 @@ function TaskView({report}: TaskViewProps) { | |
numberOfLines={3} | ||
style={styles.taskTitleMenuItem} | ||
> | ||
{taskTitle} | ||
<RenderHTML html={`<task-title>${taskTitle}</task-title>`} /> | ||
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. Haven't found anything broken with this but |
||
</Text> | ||
</View> | ||
{!isDisableInteractive && ( | ||
|
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
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
Oops, something went wrong.
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.
Do you see a need for changing this to a
markdown-title
or a generic renderer so that we can reuse the logic, instead of tagging it to task title?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.
For now I think its fine, since tasks are the big focus at the moment