Skip to content
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

fix: Tags - Enable tag option is no longer grayed out after renaming tag offline. #43635

Merged
merged 2 commits into from
Jun 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/libs/actions/Policy/Tag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ function setWorkspaceTagEnabled(policyID: string, tagsToUpdate: Record<string, {
...tagsToUpdate[key],
errors: null,
pendingFields: {
...policyTag.tags[key].pendingFields,
enabled: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE,
},
pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE,
Expand All @@ -219,6 +220,7 @@ function setWorkspaceTagEnabled(policyID: string, tagsToUpdate: Record<string, {
...tagsToUpdate[key],
errors: null,
pendingFields: {
...policyTag.tags[key].pendingFields,
enabled: null,
},
pendingAction: null,
Expand All @@ -244,6 +246,7 @@ function setWorkspaceTagEnabled(policyID: string, tagsToUpdate: Record<string, {
...tagsToUpdate[key],
errors: ErrorUtils.getMicroSecondOnyxError('workspace.tags.genericFailureMessage'),
pendingFields: {
...policyTag.tags[key].pendingFields,
enabled: null,
},
pendingAction: null,
Expand Down Expand Up @@ -379,6 +382,7 @@ function renamePolicyTag(policyID: string, policyTag: {oldName: string; newName:
name: newTagName,
pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE,
pendingFields: {
...tag.pendingFields,
name: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE,
},
previousTagName: oldTagName,
Expand All @@ -399,6 +403,7 @@ function renamePolicyTag(policyID: string, policyTag: {oldName: string; newName:
[newTagName]: {
pendingAction: null,
pendingFields: {
...tag.pendingFields,
name: null,
},
},
Expand All @@ -419,6 +424,7 @@ function renamePolicyTag(policyID: string, policyTag: {oldName: string; newName:
...tag,
pendingAction: null,
pendingFields: {
...tag.pendingFields,
name: null,
},
errors: ErrorUtils.getMicroSecondOnyxError('workspace.tags.genericFailureMessage'),
Expand Down
Loading