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

[CP Staging] Fix unable to add custom tag name in a new workspace #42734

Merged
merged 4 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
14 changes: 7 additions & 7 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1852,7 +1852,7 @@ PODS:
- RNGoogleSignin (10.0.1):
- GoogleSignIn (~> 7.0)
- React-Core
- RNLiveMarkdown (0.1.70):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we have the Podfile.lock changes in this one?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missed to restore this change when running IOS.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted this change.

- RNLiveMarkdown (0.1.76):
- glog
- hermes-engine
- RCT-Folly (= 2022.05.16.00)
Expand All @@ -1870,9 +1870,9 @@ PODS:
- React-utils
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- RNLiveMarkdown/common (= 0.1.70)
- RNLiveMarkdown/common (= 0.1.76)
- Yoga
- RNLiveMarkdown/common (0.1.70):
- RNLiveMarkdown/common (0.1.76):
- glog
- hermes-engine
- RCT-Folly (= 2022.05.16.00)
Expand Down Expand Up @@ -1942,7 +1942,7 @@ PODS:
- React-Codegen
- React-Core
- ReactCommon/turbomodule/core
- RNReanimated (3.7.2):
- RNReanimated (3.8.1):
- glog
- hermes-engine
- RCT-Folly (= 2022.05.16.00)
Expand Down Expand Up @@ -2589,12 +2589,12 @@ SPEC CHECKSUMS:
RNFS: 4ac0f0ea233904cb798630b3c077808c06931688
RNGestureHandler: 74b7b3d06d667ba0bbf41da7718f2607ae0dfe8f
RNGoogleSignin: ccaa4a81582cf713eea562c5dd9dc1961a715fd0
RNLiveMarkdown: 23250f3d64c9d5f82ff36c4733c03544af0222d2
RNLiveMarkdown: 2f85ea0c790dafad04c89db96a91f642629a76fd
RNLocalize: d4b8af4e442d4bcca54e68fc687a2129b4d71a81
rnmapbox-maps: df8fe93dbd251f25022f4023d31bc04160d4d65c
RNPermissions: 0b61d30d21acbeafe25baaa47d9bae40a0c65216
RNReactNativeHapticFeedback: 616c35bdec7d20d4c524a7949ca9829c09e35f37
RNReanimated: 51db0fff543694d931bd3b7cab1a3b36bd86c738
RNReanimated: 323436b1a5364dca3b5f8b1a13458455e0de9efe
RNScreens: 9ec969a95987a6caae170ef09313138abf3331e1
RNShare: 2a4cdfc0626ad56b0ef583d424f2038f772afe58
RNSound: 6c156f925295bdc83e8e422e7d8b38d33bc71852
Expand All @@ -2606,7 +2606,7 @@ SPEC CHECKSUMS:
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
Turf: 13d1a92d969ca0311bbc26e8356cca178ce95da2
VisionCamera: 1394a316c7add37e619c48d7aa40b38b954bf055
Yoga: 64cd2a583ead952b0315d5135bf39e053ae9be70
Yoga: 1b901a6d6eeba4e8a2e8f308f708691cdb5db312

PODFILE CHECKSUM: 66a5c97ae1059e4da1993a4ad95abe5d819f555b

Expand Down
21 changes: 21 additions & 0 deletions src/libs/actions/Policy/Policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3792,6 +3792,27 @@ function enablePolicyTags(policyID: string, enabled: boolean) {
},
],
};
const policyTagList = allPolicyTags?.[policyID];
if (!policyTagList) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need an isEmpty check here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we don't need policyTagList will never be an empty object.

const defaultTagList: PolicyTagList = {
Tag: {
name: 'Tag',
orderWeight: 0,
required: false,
tags: {},
},
};
onyxData.optimisticData?.push({
onyxMethod: Onyx.METHOD.SET,
key: `${ONYXKEYS.COLLECTION.POLICY_TAGS}${policyID}`,
value: defaultTagList,
});
onyxData.failureData?.push({
onyxMethod: Onyx.METHOD.SET,
key: `${ONYXKEYS.COLLECTION.POLICY_TAGS}${policyID}`,
value: null,
});
}

const parameters: EnablePolicyTagsParams = {policyID, enabled};

Expand Down
Loading