Skip to content

Commit

Permalink
Merge pull request #43635 from Krishna2323/krishna2323/issue/42917
Browse files Browse the repository at this point in the history
fix: Tags - Enable tag option is no longer grayed out after renaming tag offline.
  • Loading branch information
marcochavezf authored Jun 17, 2024
2 parents eb59c33 + d58edc3 commit 73569e7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/libs/actions/Policy/Tag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,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 @@ -220,6 +221,7 @@ function setWorkspaceTagEnabled(policyID: string, tagsToUpdate: Record<string, {
...tagsToUpdate[key],
errors: null,
pendingFields: {
...policyTag.tags[key].pendingFields,
enabled: null,
},
pendingAction: null,
Expand All @@ -245,6 +247,7 @@ function setWorkspaceTagEnabled(policyID: string, tagsToUpdate: Record<string, {
...tagsToUpdate[key],
errors: ErrorUtils.getMicroSecondOnyxErrorWithTranslationKey('workspace.tags.genericFailureMessage'),
pendingFields: {
...policyTag.tags[key].pendingFields,
enabled: null,
},
pendingAction: null,
Expand Down Expand Up @@ -395,6 +398,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 @@ -415,6 +419,7 @@ function renamePolicyTag(policyID: string, policyTag: {oldName: string; newName:
[newTagName]: {
pendingAction: null,
pendingFields: {
...tag.pendingFields,
name: null,
},
},
Expand All @@ -435,6 +440,7 @@ function renamePolicyTag(policyID: string, policyTag: {oldName: string; newName:
...tag,
pendingAction: null,
pendingFields: {
...tag.pendingFields,
name: null,
},
errors: ErrorUtils.getMicroSecondOnyxErrorWithTranslationKey('workspace.tags.genericFailureMessage'),
Expand Down

0 comments on commit 73569e7

Please sign in to comment.