Skip to content

Commit

Permalink
Merge pull request #39584 from nkdengineer/fix/39169
Browse files Browse the repository at this point in the history
fix: Tags & Categories - Name row in item RHP is not grayed out when edited offline
  • Loading branch information
arosiclair authored Apr 9, 2024
2 parents 792c697 + 338ab2c commit a277936
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 12 deletions.
12 changes: 12 additions & 0 deletions src/libs/actions/Policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3075,6 +3075,9 @@ function renamePolicyCategory(policyID: string, policyCategory: {oldName: string
name: policyCategory.newName,
unencodedName: decodeURIComponent(policyCategory.newName),
pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE,
pendingFields: {
name: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE,
},
},
},
},
Expand All @@ -3091,6 +3094,9 @@ function renamePolicyCategory(policyID: string, policyCategory: {oldName: string
unencodedName: decodeURIComponent(policyCategory.newName),
errors: null,
pendingAction: null,
pendingFields: {
name: null,
},
},
},
},
Expand Down Expand Up @@ -3381,6 +3387,9 @@ function renamePolicyTag(policyID: string, policyTag: {oldName: string; newName:
...oldTag,
name: policyTag.newName,
pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE,
pendingFields: {
name: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE,
},
},
},
},
Expand All @@ -3397,6 +3406,9 @@ function renamePolicyTag(policyID: string, policyTag: {oldName: string; newName:
[policyTag.newName]: {
errors: null,
pendingAction: null,
pendingFields: {
name: null,
},
},
},
},
Expand Down
14 changes: 8 additions & 6 deletions src/pages/workspace/categories/CategorySettingsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,14 @@ function CategorySettingsPage({route, policyCategories}: CategorySettingsPagePro
</View>
</View>
</OfflineWithFeedback>
<MenuItemWithTopDescription
title={policyCategory.name}
description={translate(`workspace.categories.categoryName`)}
onPress={navigateToEditCategory}
shouldShowRightIcon
/>
<OfflineWithFeedback pendingAction={policyCategory.pendingFields?.name}>
<MenuItemWithTopDescription
title={policyCategory.name}
description={translate(`workspace.categories.categoryName`)}
onPress={navigateToEditCategory}
shouldShowRightIcon
/>
</OfflineWithFeedback>
</View>
</ScreenWrapper>
</FeatureEnabledAccessOrNotFoundWrapper>
Expand Down
14 changes: 8 additions & 6 deletions src/pages/workspace/tags/TagSettingsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,14 @@ function TagSettingsPage({route, policyTags}: TagSettingsPageProps) {
</View>
</View>
</OfflineWithFeedback>
<MenuItemWithTopDescription
title={currentPolicyTag.name}
description={translate(`workspace.tags.tagName`)}
onPress={navigateToEditTag}
shouldShowRightIcon
/>
<OfflineWithFeedback pendingAction={currentPolicyTag.pendingFields?.name}>
<MenuItemWithTopDescription
title={currentPolicyTag.name}
description={translate(`workspace.tags.tagName`)}
onPress={navigateToEditTag}
shouldShowRightIcon
/>
</OfflineWithFeedback>
</View>
</ScreenWrapper>
</FeatureEnabledAccessOrNotFoundWrapper>
Expand Down

0 comments on commit a277936

Please sign in to comment.