Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
manishoo committed Feb 10, 2023
2 parents 2658b66 + f037c31 commit 310e007
Show file tree
Hide file tree
Showing 60 changed files with 1,351 additions and 534 deletions.
6 changes: 6 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,9 @@ stages:
when: on_success
- if: $CI_COMMIT_BRANCH == "master"
when: manual

# Run automatic on develop only
.rule_automatic_develop:
rules:
- if: $CI_COMMIT_BRANCH == "develop"
when: on_success
14 changes: 10 additions & 4 deletions .gitlab/ci/maintenance.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
maintenance:update_changelog:
.maintenance_base:
image: alpine/curl
stage: maintenance
interruptible: true
tags: [minds-ci]
script:
# gets commits from the last tag to the commit which is tagged (including the commit)
- 'curl --request POST --header "PRIVATE-TOKEN: $PROJECT_TOKEN" "https://gitlab.com/api/v4/projects/10171280/repository/changelog?from=$(git describe --tags --abbrev=0)&to=$CI_COMMIT_SHA" --data "branch=master&version=$CI_COMMIT_TAG&message=[skip ci] Add changelog for $CI_COMMIT_TAG"'
allow_failure: true
variables:
RELEASE_VERSION: '${CI_COMMIT_TAG:1}'
PROJECT_URL: https://gitlab.com/api/v4/projects/10171280
only:
refs:
- /^master$/
- tags

maintenance:update_changelog:
extends: .maintenance_base
script:
- 'curl --fail --request POST --header "PRIVATE-TOKEN: $PROJECT_BOT" "$PROJECT_URL/repository/changelog" --data "branch=master&version=$RELEASE_VERSION&message=[skip ci] Add changelog for $RELEASE_VERSION"'
8 changes: 2 additions & 6 deletions .gitlab/ci/upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ upload:s3:oss: # Upload to S3
- build:androidproduction
rules:
- !reference [.rule_nonpatch_release_success, rules]
- if: $CI_COMMIT_BRANCH == "develop" # Run on develop
when: on_success
- if: $CI_RC_NIGHTLY_TESTS == "true" && $CI_PROD_NIGHTLY_TESTS == "true" # Skip on QA pipes
when: never

# Upload full APK to Browserstack
upload:browserstack:oss:
Expand Down Expand Up @@ -74,7 +70,7 @@ upload:browserstack:playstore:
# Upload production RC (develop branch)
upload:s3:oss:rc: # Upload to S3
<<: *upload_s3
extends: .rule_automatic_develop_manual_master
extends: .rule_automatic_develop
before_script:
- !reference [.getversion, script]
- export TARGET_NAME="Minds-$APPVERSION-RC.apk"
Expand All @@ -84,7 +80,7 @@ upload:s3:oss:rc: # Upload to S3
# Upload to Browserstack
upload:browserstack:oss:rc:
<<: *upload_browserstack
extends: .rule_automatic_develop_manual_master
extends: .rule_automatic_develop
before_script:
- !reference [.getversion, script]
- export TARGET_NAME="Minds-$APPVERSION-RC.apk"
Expand Down
32 changes: 17 additions & 15 deletions App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,21 +89,23 @@ class App extends Component<Props> {
RefreshControl.defaultProps.tintColor = ThemedStyles.getColor('IconActive');
RefreshControl.defaultProps.colors = [ThemedStyles.getColor('IconActive')];

codePush
.getUpdateMetadata()
.then(metadata => {
// using the deploymentKey from the active update makes sure
// switching environments works
logMessage(metadata, 'CodePush metadata:');
if (metadata?.deploymentKey) {
codePush.sync({
deploymentKey: metadata.deploymentKey,
});
} else {
codePush.sync();
}
})
.catch(logError);
if (!__DEV__) {
codePush
.getUpdateMetadata()
.then(metadata => {
// using the deploymentKey from the active update makes sure
// switching environments works
logMessage(metadata, 'CodePush metadata:');
if (metadata?.deploymentKey) {
codePush.sync({
deploymentKey: metadata.deploymentKey,
});
} else {
codePush.sync();
}
})
.catch(logError);
}
}

/**
Expand Down
9 changes: 3 additions & 6 deletions AppInitManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ export class AppInitManager {
{
text: 'Yes',
onPress: () => {
if (err instanceof Error) Clipboard.setString(err.stack || '');
if (err instanceof Error) {
Clipboard.setString(err.stack || '');
}
},
},
{ text: 'No' },
Expand Down Expand Up @@ -181,15 +183,10 @@ export class AppInitManager {
// handle deep link (if the app is opened by one)
if (deepLinkUrl) {
setTimeout(() => {
//TODO: remove after we check the push notification issue
console.log('[App] Handling deeplink');
deeplinkService.navigate(deepLinkUrl);
}, 300);
}

//TODO: remove after we check the push notification issue
console.log('[App] Handling initial notifications');

// handle initial notifications (if the app is opened by tap on one)
pushService.handleInitialNotification();

Expand Down
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,32 @@

Minds Mobile

## 4.31.6 (2023-02-08)

### Features ✨ (3 changes)

- [Make invite friends in-feed notice dismissible](minds/mobile-native!2101)
- [Added support for requiring a Twitter reply when requesting a Supermind](minds/mobile-native!2087)
- [Track notice viewed in snowplow & fix notices not shown error](minds/mobile-native!2086)

### Fixed 🐛 (7 changes)

- [Fixed discovery boosts with v3](minds/mobile-native!2105)
- [Fixed the boosted content service to work with v3 endpoint](minds/mobile-native!2104)
- [Fixed boost service reading FF before it is ready](minds/mobile-native!2102)
- [Fixed empty onboarding screen & start earning tokens buttons taking 2 minutes to be shown](minds/mobile-native!2098)
- [Fix white screen when double tapping a link thumbnail](minds/mobile-native!2096)
- [Fix boost shown in channels even with the FF turned off](minds/mobile-native!2090)
- [Fix channel's feed render & pagination when filter is image/video](minds/mobile-native!2088)

### Changed 🔧 (5 changes)

- [Fixed text for empty boosts in console](minds/mobile-native!2100)
- [Changed default boost amounts for token and cash payments](minds/mobile-native!2084)
- [correct subtitle audience](minds/mobile-native!2097)
- [rename Newsfeed to Content and Sidebar to Channel in Boost Console](minds/mobile-native!2091)
- [Fix link in comments opening behind the bottom sheet](minds/mobile-native!2083)

## 4.31.4 (2023-02-01)

### Added (5 changes)
Expand Down
43 changes: 33 additions & 10 deletions ExperimentsProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,28 @@ export const growthbook = new GrowthBook({
* @param { string|number|boolean } variation - variation to check, e.g. 'on' or 'off'.
* @returns { boolean } - true if params reflect current variation.
*/
export function hasVariation(featureKey: FeatureID, variation: string = 'on') {
const featureResult = growthbook.feature(featureKey);
return featureResult[variation];
export function hasVariation(
featureKey: FeatureID | FeatureID[],
variation: string = 'on',
) {
return Array.isArray(featureKey)
? featureKey.every(key => growthbook.feature(key)[variation])
: growthbook.feature(featureKey)[variation];
}

export function IfHasVariation({
featureKey,
children,
}: React.PropsWithChildren<{
featureKey: FeatureID;
}>) {
const on = useIsFeatureOn(featureKey);

if (!on) {
return null;
}

return <>{children}</>;
}

/**
Expand Down Expand Up @@ -66,6 +85,10 @@ export function useIsFeatureOn(feature: FeatureID) {
return useGrowthbookFeature(feature).on;
}

export function useFeature(feature: FeatureID) {
return useGrowthbookFeature(feature);
}

export default function ExperimentsProvider({ children }) {
return (
<GrowthBookProvider growthbook={growthbook}>{children}</GrowthBookProvider>
Expand All @@ -79,14 +102,14 @@ export const useIsAndroidFeatureOn = (feature: FeatureID) =>
useGrowthbookFeature(feature).on && !IS_IOS;

export type FeatureID =
| 'mobile-supermind'
| 'mob-4630-hide-chat-icon'
| 'minds-3055-email-codes'
| 'mob-discovery-redirect'
| 'mob-4424-sockets'
| 'mob-4472-in-app-verification'
| 'mob-4637-ios-hide-minds-superminds'
| 'mob-stripe-connect-4587'
| 'mob-4638-boost-v3'
| 'mob-minds-3119-captcha-for-engagement'
| 'mob-4722-track-code-push'
| 'mob-4424-sockets'
| 'mob-4472-in-app-verification'
| 'minds-3055-email-codes'
| 'mob-twitter-oauth-4715'
| 'engine-2503-twitter-feats'
| 'minds-3639-plus-notice'
| 'epic-303-boost-partners';
1 change: 0 additions & 1 deletion __tests__/auth/RegisterForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ jest.mock('../../src/auth/UserStore');
jest.mock('../../src/common/components/Captcha');
jest.mock('react-native-safe-area-context');
jest.mock('../../AppMessages', () => ({ showNotification: jest.fn() }));
jest.mock('@gorhom/bottom-sheet');

describe('RegisterScreen component', () => {
let navigation;
Expand Down
45 changes: 42 additions & 3 deletions locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,30 @@
},
"confirm": {
"title": "Confirm reply",
"description": "Are you sure you want to post this reply? Once posted your reply cannot be deleted."
"description": "Are you sure you want to post this reply? Once posted your reply cannot be deleted.",
"twitter": {
"title": "Post to my Twitter",
"description": "This Supermind offer requires posting the reply to Twitter.",
"example": "Example of a Twitter preview"
}
},
"confirmNoRefund": {
"title": "Confirm Offer",
"offerDescription": "I understand this transaction is non-refundable once the recipient approves my offer.",
"description": "I understand this transaction is non-refundable."
},
"supermind": "Supermind"
"supermind": "Supermind",
"requireTwitter": "Optional: Require reply to be posted on Twitter",
"twitterConnect": {
"connectSuccess": "You channel is now connected to your Twitter account",
"connectFailed": "Something went wrong while connecting to Twitter",
"connectConfigFailed": "An unexpected error has occurred getting your twitter configuration",
"twitterPermission": {
"title": "Twitter Permission",
"description": "To accept this Supermind offer, please connect your Twitter account. This will give Minds permission to repost your response on your behalf, but only when you consent.",
"connectTwitter": "Connect Twitter"
}
}
},
"auth": {
"2faRequired": "2FA required",
Expand Down Expand Up @@ -224,7 +240,19 @@
"uniquenessDescription": "Verify your uniqueness to get started earning token rewards for engagement on your content.",
"inviteFriendsTitle": "Invite Friends",
"inviteFriendsDescription": "Minds gets better with friends. Share your referral link to invite them to join. If they earn money on Minds, you'll earn a 5% referral fee.",
"inviteFriendsAction": "Invite Friend"
"inviteFriendsAction": "Invite Friend",
"plusUpgrade": {
"title": "Upgrade to Minds+",
"description": "Support Minds and unlock features such as earning revenue for your content, hiding ads, accessing exclusive content, receiving a badge and verifying your channel.",
"descriptionVariations": {
"1": "Free-thinking content creators like you earn more and grow their reach with Minds+.",
"2": "Access exclusive content produced by the Minds+ community.",
"3": "Get verified, hide ads, and get the most of your Minds experience",
"4": "Support Minds and creators like you."
},
"action": "Upgrade",
"secondaryAction": "Learn more"
}
},
"blockchain": {
"exportLegacyWallet": "Export legacy wallets",
Expand Down Expand Up @@ -791,6 +819,17 @@
},
"16": {
"label": "Inauthentic engagement"
},
"17": {
"label": "Security",
"reasons": {
"1": {
"label": "Hacked account"
}
}
},
"18": {
"label": "Violates Premium Content policy"
}
},
"DMCA": "Please submit a DMCA notice to [email protected].",
Expand Down
4 changes: 1 addition & 3 deletions src/auth/register/RegisterForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import KeyboardSpacingView from '~/common/components/keyboard/KeyboardSpacingVie
import FitScrollView from '~/common/components/FitScrollView';
import DismissKeyboard from '~/common/components/DismissKeyboard';
import FriendlyCaptcha from '~/common/components/friendly-captcha/FriendlyCaptcha';
import { useFeature } from '@growthbook/growthbook-react';

type PropsType = {
// called after registration is finished
Expand All @@ -42,7 +41,6 @@ const RegisterForm = observer(({ onRegister }: PropsType) => {
const scrollViewRef = useRef<ScrollView>();
const emailRef = useRef<InputContainerImperativeHandle>(null);
const passwordRef = useRef<InputContainerImperativeHandle>(null);
const friendlyCaptchaEnabled = useFeature('mob-4231-captcha').on;

const store = useLocalStore(() => ({
focused: false,
Expand All @@ -63,7 +61,7 @@ const RegisterForm = observer(({ onRegister }: PropsType) => {
});
store.usernameTaken = !response.valid;
}, 300),
friendlyCaptchaEnabled,
friendlyCaptchaEnabled: true,
setFriendlyCaptchaEnabled(enabled: boolean) {
store.friendlyCaptchaEnabled = enabled;
},
Expand Down
11 changes: 4 additions & 7 deletions src/channel/v2/ChannelButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import { withErrorBoundary } from '../../common/components/ErrorBoundary';
import Edit from './buttons/Edit';
import { Row } from '~ui';
import SupermindButton from '../../common/components/supermind/SupermindButton';
import { IfFeatureEnabled } from '@growthbook/growthbook-react';
import ThemedStyles from '../../styles/ThemedStyles';

type ButtonsType =
Expand Down Expand Up @@ -128,12 +127,10 @@ const ChannelButtons = withErrorBoundary(
)}
{showSubscribe && <Subscribe channel={props.store.channel} />}
{shouldShow('supermind') && (
<IfFeatureEnabled feature="mobile-supermind">
<SupermindButton
entity={props.store.channel}
style={ThemedStyles.style.marginLeft2x}
/>
</IfFeatureEnabled>
<SupermindButton
entity={props.store.channel}
style={ThemedStyles.style.marginLeft2x}
/>
)}
{shouldShow('more') && (
<ChannelMoreMenu
Expand Down
13 changes: 5 additions & 8 deletions src/channel/v2/ChannelHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import { B2, Column, H4, Row } from '~ui';
import { IS_IOS } from '~/config/Config';
import ChannelRecommendation from '~/common/components/ChannelRecommendation/ChannelRecommendation';
import UserModel from '../UserModel';
import { IfFeatureEnabled } from '@growthbook/growthbook-react';
import useModelEvent from '~/common/hooks/useModelEvent';
import MutualSubscribers from '../components/MutualSubscribers';

Expand Down Expand Up @@ -322,13 +321,11 @@ const ChannelHeader = withErrorBoundary(
)}

{shouldRenderChannelRecommendation && (
<IfFeatureEnabled feature="mob-4107-channelrecs">
<ChannelRecommendation
channel={channel}
visible={interacted}
location="channel"
/>
</IfFeatureEnabled>
<ChannelRecommendation
channel={channel}
visible={interacted}
location="channel"
/>
)}
</View>
);
Expand Down
Loading

0 comments on commit 310e007

Please sign in to comment.