-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Tasks Detailed View #17940
Merged
Merged
Tasks Detailed View #17940
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
e3b8cc0
Add check if it is a task
thienlnam 2f1ac41
Update header to show multi select
thienlnam 3d1789f
add new h1 headline
thienlnam d807c31
add it as an option in MenuItem
thienlnam 822b1be
add default / cleanup
thienlnam 190b82d
Add Task report specific methods
thienlnam 1dbb30a
Move into component
thienlnam af5351e
use the passed in report
thienlnam b40ae92
Add routing for title page
thienlnam a4876a0
Update ModalStackNavigators.js
thienlnam 30a8b3d
add new push to page title
thienlnam 8bffea3
update title to pass in task route
thienlnam 5d83a7b
navigation for push to page for description
thienlnam a23136b
Add description page
thienlnam 65f7e6b
Clean up TaskHeaderView
thienlnam 2d6e0c6
update to use ref
thienlnam 8d05766
Merge branch 'main' into jack-DetailedView
thienlnam 9f45a62
style / cleanup
thienlnam 34a9c79
update options shown in header
thienlnam 2ebebb4
revert shouldShowCallButton changes
thienlnam 8b583ba
clean up
thienlnam 5897950
Merge branch 'main' into jack-DetailedView
thienlnam feb14f2
Merge branch 'main' into jack-DetailedView
thienlnam 20bcf89
add ref
thienlnam dd8ef23
autofocus
thienlnam 4e0b418
Update TaskDescriptionPage.js
thienlnam 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import React from 'react'; | ||
import lodashGet from 'lodash/get'; | ||
import reportPropTypes from '../reportPropTypes'; | ||
import MenuItemWithTopDescription from '../../components/MenuItemWithTopDescription'; | ||
import Navigation from '../../libs/Navigation/Navigation'; | ||
import ROUTES from '../../ROUTES'; | ||
|
||
const propTypes = { | ||
/** The report currently being looked at */ | ||
report: reportPropTypes.isRequired, | ||
}; | ||
|
||
function TaskHeaderView(props) { | ||
return ( | ||
<> | ||
<MenuItemWithTopDescription | ||
shouldShowHeaderTitle | ||
title={props.report.reportName} | ||
description="Task" | ||
onPress={() => Navigation.navigate(ROUTES.getTaskReportTitleRoute(props.report.reportID))} | ||
/> | ||
<MenuItemWithTopDescription | ||
title={lodashGet(props.report, 'description', '')} | ||
description="Description" | ||
onPress={() => Navigation.navigate(ROUTES.getTaskReportDescriptionRoute(props.report.reportID))} | ||
/> | ||
</> | ||
); | ||
} | ||
|
||
TaskHeaderView.propTypes = propTypes; | ||
TaskHeaderView.displayName = 'TaskHeaderView'; | ||
|
||
export default TaskHeaderView; |
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,99 @@ | ||
import _ from 'underscore'; | ||
import React, {useCallback, useRef} from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import {View} from 'react-native'; | ||
import ScreenWrapper from '../../components/ScreenWrapper'; | ||
import HeaderWithCloseButton from '../../components/HeaderWithCloseButton'; | ||
import withLocalize, {withLocalizePropTypes} from '../../components/withLocalize'; | ||
import Form from '../../components/Form'; | ||
import ONYXKEYS from '../../ONYXKEYS'; | ||
import TextInput from '../../components/TextInput'; | ||
import styles from '../../styles/styles'; | ||
import Navigation from '../../libs/Navigation/Navigation'; | ||
import reportPropTypes from '../reportPropTypes'; | ||
import compose from '../../libs/compose'; | ||
import withReportOrNotFound from '../home/report/withReportOrNotFound'; | ||
|
||
const propTypes = { | ||
/** URL Route params */ | ||
route: PropTypes.shape({ | ||
/** Params from the URL path */ | ||
params: PropTypes.shape({ | ||
/** taskReportID passed via route: /r/:taskReportID/title */ | ||
taskReportID: PropTypes.string, | ||
}), | ||
}).isRequired, | ||
|
||
/** The report currently being looked at */ | ||
report: reportPropTypes.isRequired, | ||
|
||
/* Onyx Props */ | ||
...withLocalizePropTypes, | ||
}; | ||
|
||
const defaultProps = { | ||
|
||
}; | ||
|
||
function TaskDescriptionPage(props) { | ||
/** | ||
* @param {Object} values | ||
* @param {String} values.description | ||
* @returns {Object} - An object containing the errors for each inputID | ||
*/ | ||
const validate = useCallback((values) => { | ||
const errors = {}; | ||
|
||
if (_.isEmpty(values.description)) { | ||
errors.description = props.translate('common.error.fieldRequired'); | ||
} | ||
Comment on lines
+47
to
+49
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 introduced a regression in #19022, the |
||
|
||
return errors; | ||
}, [props]); | ||
|
||
const submit = useCallback(() => { | ||
// Functionality will be implemented in https://github.com/Expensify/App/issues/16856 | ||
}, []); | ||
|
||
const inputRef = useRef(null); | ||
|
||
return ( | ||
<ScreenWrapper | ||
includeSafeAreaPaddingBottom={false} | ||
onEntryTransitionEnd={() => inputRef.current && inputRef.current.focus()} | ||
> | ||
<HeaderWithCloseButton | ||
title={props.translate('newTaskPage.task')} | ||
shouldShowBackButton | ||
onBackButtonPress={() => Navigation.goBack()} | ||
onCloseButtonPress={() => Navigation.dismissModal(true)} | ||
/> | ||
<Form | ||
style={[styles.flexGrow1, styles.ph5]} | ||
formID={ONYXKEYS.FORMS.EDIT_TASK_FORM} | ||
validate={validate} | ||
onSubmit={submit} | ||
submitButtonText={props.translate('common.save')} | ||
enabledWhenOffline | ||
> | ||
<View style={[styles.mb4]}> | ||
<TextInput | ||
inputID="description" | ||
name="description" | ||
label={props.translate('newTaskPage.description')} | ||
defaultValue={props.report.description || ''} | ||
ref={el => inputRef.current = el} | ||
/> | ||
</View> | ||
</Form> | ||
</ScreenWrapper> | ||
); | ||
} | ||
|
||
TaskDescriptionPage.propTypes = propTypes; | ||
TaskDescriptionPage.defaultProps = defaultProps; | ||
|
||
export default compose( | ||
withLocalize, | ||
withReportOrNotFound, | ||
)(TaskDescriptionPage); |
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.
✋ Coming from #19631
This introduces a regression where the user non-assignee, or not owner, can still see the action button and press it.