-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[$250] Distance rates - Distance rate is not grayed out when workspace is created offline #43559
Comments
Triggered auto assignment to @isabelastisser ( |
@isabelastisser FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors |
We think that this bug might be related to #wave-collect - Release 1 |
ProposalPlease re-state the problem that we are trying to solve in this issue.The distance rate in the list is not grayed out when workspace is created offline. What is the root cause of that problem?
App/src/libs/actions/Policy/Policy.ts Lines 1406 to 1411 in 95c8202
What changes do you think we should make in order to solve the problem?Add App/src/libs/actions/Policy/Policy.ts Lines 1406 to 1411 in 95c8202
What alternative solutions did you explore? (Optional)N/A Result: Screen.Recording.2024-06-12.at.4.00.42.in.the.afternoon.mp4 |
ProposalPlease re-state the problem that we are trying to solve in this issue.Distance rates - Distance rate is not grayed out when workspace is created offline What is the root cause of that problem?We don't have pending action field for default rate. App/src/libs/actions/Policy/Policy.ts Lines 1406 to 1412 in 79e619a
What changes do you think we should make in order to solve the problem?Instead of adding the pending action property in the object we can simply check for const distanceRatesList = useMemo<RateForList[]>(
() =>
Object.values(customUnitRates).map((value) => {
const isPendingDefaultRate = value.name === CONST.CUSTOM_UNITS.DEFAULT_RATE && policy?.pendingAction === 'add' ? 'update' : undefined;
return {
value: value.customUnitRateID ?? '',
text: `${CurrencyUtils.convertAmountToDisplayString(value.rate, value.currency ?? CONST.CURRENCY.USD)} / ${translate(
`common.${customUnit?.attributes?.unit ?? CONST.CUSTOM_UNITS.DISTANCE_UNIT_MILES}`,
)}`,
keyForList: value.customUnitRateID ?? '',
isSelected: selectedDistanceRates.find((rate) => rate.customUnitRateID === value.customUnitRateID) !== undefined,
isDisabled: value.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE,
pendingAction: value.pendingAction ?? value.pendingFields?.rate ?? value.pendingFields?.enabled ?? value.pendingFields?.currency ?? isPendingDefaultRate,
errors: value.errors ?? undefined,
rightElement: <ListItemRightCaretWithLabel labelText={value.enabled ? translate('workspace.common.enabled') : translate('workspace.common.disabled')} />,
};
}),
[customUnit?.attributes?.unit, customUnitRates, selectedDistanceRates, translate, policy?.pendingAction],
); Or we can just add Note: we will use the pending action name from What alternative solutions did you explore? (Optional)We can add the const customUnitsSuccess: Record<string, CustomUnit> = {
[customUnitID]: {
rates: {
[customUnitRateID]: {
pendingAction: null,
},
},
},
};
return {
customUnits,
customUnitID,
customUnitRateID,
outputCurrency: currency,
customUnitsSuccess,
}; Then use the Note: We also need to update the types and we can use the object in the success and failure data directly without returning it from |
Proposal Updated
|
Job added to Upwork: https://www.upwork.com/jobs/~017bdb049912130299 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ahmedGaber93 ( |
Proposal Updated
|
Bump @ahmedGaber93 to review the proposals above. Thanks! |
Reviewing |
@etCoderDysto Thanks for the proposal, adding regression video20240614235630442.mp4I think we can move forward with @Krishna2323's alternative solutions which cover remove 🎀 👀 🎀 C+ reviewed |
Triggered auto assignment to @tylerkaraszewski, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
You are right, @ahmedGaber93. But I am not sure how adding 'pendingAction' in success data can be possible since we have to add it to |
We don't handle it manual, we just need to pass it to API.write(WRITE_COMMANDS.CREATE_WORKSPACE, params, {optimisticData, successData, failureData}); |
Got it! Thanks for the explanation 🙏 |
@tylerkaraszewski, @isabelastisser, @ahmedGaber93 Whoops! This issue is 2 days overdue. Let's get this updated quick! |
Ready to assignment |
This issue seems to be fixed here |
Can we check and see if this is already fixed and close this if so? |
checking |
I can't reproduce the issue in the latest main 20240620200426707.mp4 |
@isabelastisser - do we need to do anything special here for the C+ who's looked at this so far or can we just close it? |
I believe we can close this. @ahmedGaber93 please let us know if you disagree. Thanks! |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
#issue found when validating #43071
Version Number: 1.4.82-0
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause internal team
Slack conversation:
Action Performed:
Expected Result:
The distance rate in the list will be grayed out.
Actual Result:
The distance rate in the list is not grayed out when workspace is created offline.
Workaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Bug6510123_1718152969559.20240612_083929.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @ahmedGaber93The text was updated successfully, but these errors were encountered: