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

feat: add config attribute to enable/disable contacts section in Settings screen, default as enabled #1374

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

jian4on
Copy link
Contributor

@jian4on jian4on commented Dec 24, 2024

Summary of Changes

Added a new boolean field 'disableContactsInSettings' in Config, default value is false (Enabled)

Screenshots, videos, or gifs

N/A

Breaking change guide

N/A

Related Issues

N/A

Pull Request Checklist

Tick all boxes below to demonstrate that you have completed the respective task. If the item does not apply to your this PR check it anyway to make it apparent that there's nothing to do.

  • All commits contain a DCO Signed-off-by line (we use the DCO GitHub app to enforce this)
  • If applicable, screenshots, gifs, or video are included for UI changes
  • If applicable, breaking changes are described above along with how to address them
  • Updated documentation as needed for changed code and new or modified features
  • Added sufficient tests so that overall code coverage is not reduced

If you have any questions to any of the points above, just submit and ask! This checklist is here to help you, not to deter you from contributing!

Pro Tip 🤓

  • Read our contribution guide at least once; it will save you a few review cycles!
  • Your PR will likely not be reviewed until all the above boxes are checked and all automated checks have passed

Copy link
Contributor

@bryce-mcmath bryce-mcmath left a comment

Choose a reason for hiding this comment

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

A few things to fix but headed in the right direction!

@@ -167,6 +167,11 @@ const Settings: React.FC<SettingsProps> = ({ navigation }) => {
},
...(settings || []),
]

// Remove the Contact section from Setting per TOKENS.CONFIG
if ("true" === `${disableContactsInSettings}`) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if ("true" === `${disableContactsInSettings}`) {
if (disableContactsInSettings) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will change it. The bad habit from writing plain JS, worry about entering other strings to make it to be true.

Copy link
Contributor

Choose a reason for hiding this comment

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

This change should not be included in this PR. Rather than run pod install you can use the command yarn ios:setup from the app folder to properly install pods without diverging from the set versions in the Gemfile.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, that's a big help to me

Copy link
Contributor

Choose a reason for hiding this comment

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

This diff should not be committed as it is a change specific to your local development environment, and will be different for different developers

@jian4on jian4on requested a review from bryce-mcmath December 30, 2024 15:40
@jian4on
Copy link
Contributor Author

jian4on commented Dec 30, 2024

@bryce-mcmath, The ios unit tests failed in build stage after restored the "Podfile.lock" and "project.pbxproj" files. The log shows the "IPHONEOS_DEPLOYMENT_TARGET = 11.0" defined in "project.pbxproj" not supported by the Pods specified devices range.
Merge this PR or merge it after fixed the building confliction? The unit test passed in my local run

@bryce-mcmath bryce-mcmath changed the title feat: Add config attribute to enable/disable Contacts section in Settings screen, default as Enabled feat: add config attribute to enable/disable contacts section in Settings screen, default as enabled Dec 30, 2024
@bryce-mcmath
Copy link
Contributor

@bryce-mcmath, The ios unit tests failed in build stage after restored the "Podfile.lock" and "project.pbxproj" files. The log shows the "IPHONEOS_DEPLOYMENT_TARGET = 11.0" defined in "project.pbxproj" not supported by the Pods specified devices range. Merge this PR or merge it after fixed the building confliction? The unit test passed in my local run

So I don't see anything in your PR that would cause this error, the only change remaining is the EOF changes to the iOS files which you could remove and see if it helps. In the meantime I have rerun the action, hopefully it was just a one off. But yes, we should fix any build issues before merging

Copy link
Contributor

@bryce-mcmath bryce-mcmath left a comment

Choose a reason for hiding this comment

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

Suggestion that might get the GHA to work

Copy link
Contributor

Choose a reason for hiding this comment

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

There is still an EOF change to this file and the project.pbxproj file. It's unlikely, but perhaps the action will succeed if we make no unnecessary changes to these files, not even EOF. Other PRs in this repo seem to be passing so I don't know what else the cause could be

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed, sorry for making this weird trouble. My IDE change those files after CTRL+S even I didn't enter anything.

Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above

@jian4on jian4on requested a review from bryce-mcmath January 3, 2025 14:26
Copy link
Contributor

@bryce-mcmath bryce-mcmath left a comment

Choose a reason for hiding this comment

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

That seems to have fixed it! Nice. Approved, and I will reapprove if needed after you update with the latest main. Great work!

…to remove the Contacts section in Settings rows, added test case for this feature

Signed-off-by: Jian Wang <[email protected]>
…atement matching the boolean type

Signed-off-by: Jian Wang <[email protected]>
…stream to fix the file EOF issue

Signed-off-by: Jian Wang <[email protected]>
Copy link

sonarqubecloud bot commented Jan 4, 2025

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 55.73%. Comparing base (9e81308) to head (b28fb76).
Report is 23 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1374      +/-   ##
==========================================
+ Coverage   55.17%   55.73%   +0.55%     
==========================================
  Files         219      220       +1     
  Lines        7737     7897     +160     
  Branches     2192     2229      +37     
==========================================
+ Hits         4269     4401     +132     
- Misses       3446     3473      +27     
- Partials       22       23       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants