Skip to content
Projects
Groups
Snippets
Help
Sign in / Register
Toggle navigation
Minds Mobile
Project overview
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
180
Merge Requests
18
Security & Compliance
Packages
Wiki
Snippets
Members
Collapse sidebar
Close sidebar
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Minds
Minds Mobile
Compare Revisions
769f5f5b4bb1de52d611e10ac71f18ab058c2505...b6466a24152751fec959164c6d6dec7e0a938cf3
Source
b6466a24152751fec959164c6d6dec7e0a938cf3
...
Target
769f5f5b4bb1de52d611e10ac71f18ab058c2505
Compare
Commits (2)
(feat) handle email confirmation deeplink, fix top bar issues with email message
· 6d02b1fb
Martin Santangelo
authored
46 minutes ago
6d02b1fb
(chore) update snapshots
· b6466a24
Martin Santangelo
authored
45 minutes ago
b6466a24
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
173 additions
and
46 deletions
+173
-46
.prettierrc.js
View file @
b6466a24
module
.
exports
=
{
"
prettier.printWidth
"
:
100
,
bracketSpacing
:
false
,
jsxBracketSameLine
:
true
,
singleQuote
:
true
,
semi
:
true
,
bracketSpacing
:
true
,
trailingComma
:
'
all
'
,
};
This diff is collapsed.
__tests__/activity/components/__snapshots__/Activity.js.snap
View file @
b6466a24
...
...
@@ -38,6 +38,7 @@ exports[`Activity component renders correctly 1`] = `
"message": "Message",
"ownerObj": UserModel {
"__list": null,
"confirmEmail": [Function],
"guid": "824853017709780997",
"isOwner": [Function],
"subtype": false,
...
...
@@ -98,6 +99,7 @@ exports[`Activity component renders correctly 1`] = `
"message": "Message",
"ownerObj": UserModel {
"__list": null,
"confirmEmail": [Function],
"guid": "824853017709780997",
"isOwner": [Function],
"subtype": false,
...
...
@@ -174,6 +176,7 @@ exports[`Activity component renders correctly 1`] = `
"message": "Message",
"ownerObj": UserModel {
"__list": null,
"confirmEmail": [Function],
"guid": "824853017709780997",
"isOwner": [Function],
"subtype": false,
...
...
@@ -279,6 +282,7 @@ exports[`Activity component renders correctly 1`] = `
"message": "Message",
"ownerObj": UserModel {
"__list": null,
"confirmEmail": [Function],
"guid": "824853017709780997",
"isOwner": [Function],
"subtype": false,
...
...
@@ -350,6 +354,7 @@ exports[`Activity component renders correctly 1`] = `
"message": "Message",
"ownerObj": UserModel {
"__list": null,
"confirmEmail": [Function],
"guid": "824853017709780997",
"isOwner": [Function],
"subtype": false,
...
...
@@ -417,6 +422,7 @@ exports[`Activity component renders correctly 1`] = `
"message": "Message",
"ownerObj": UserModel {
"__list": null,
"confirmEmail": [Function],
"guid": "824853017709780997",
"isOwner": [Function],
"subtype": false,
...
...
@@ -490,6 +496,7 @@ exports[`Activity component renders correctly 1`] = `
"message": "Message",
"ownerObj": UserModel {
"__list": null,
"confirmEmail": [Function],
"guid": "824853017709780997",
"isOwner": [Function],
"subtype": false,
...
...
@@ -556,6 +563,7 @@ exports[`Activity component renders correctly 1`] = `
"message": "Message",
"ownerObj": UserModel {
"__list": null,
"confirmEmail": [Function],
"guid": "824853017709780997",
"isOwner": [Function],
"subtype": false,
...
...
This diff is collapsed.
__tests__/activity/components/__snapshots__/ActivityScreen.js.snap
View file @
b6466a24
...
...
@@ -37,6 +37,7 @@ exports[`Activity screen component renders correctly with an entity as param 2`]
"message": "Message",
"ownerObj": UserModel {
"__list": null,
"confirmEmail": [Function],
"guid": "824853017709780997",
"isOwner": [Function],
"subtype": false,
...
...
@@ -88,6 +89,7 @@ exports[`Activity screen component renders correctly with an entity as param 2`]
"message": "Message",
"ownerObj": UserModel {
"__list": null,
"confirmEmail": [Function],
"guid": "824853017709780997",
"isOwner": [Function],
"subtype": false,
...
...
This diff is collapsed.
__tests__/blogs/__snapshots__/BlogCard.js.snap
View file @
b6466a24
...
...
@@ -357,6 +357,7 @@ exports[`blog card component should renders correctly 1`] = `
],
"chat": true,
"city": "",
"confirmEmail": [Function],
"container_guid": "0",
"deleted": "0",
"disabled_boost": false,
...
...
This diff is collapsed.
__tests__/blogs/__snapshots__/BlogsViewScreen.js.snap
View file @
b6466a24
...
...
@@ -66,6 +66,7 @@ exports[`blog view screen component should renders correctly 1`] = `
],
"chat": true,
"city": "",
"confirmEmail": [Function],
"container_guid": "0",
"deleted": "0",
"disabled_boost": false,
...
...
@@ -260,6 +261,7 @@ exports[`blog view screen component should renders correctly 1`] = `
],
"chat": true,
"city": "",
"confirmEmail": [Function],
"container_guid": "0",
"deleted": "0",
"disabled_boost": false,
...
...
@@ -437,6 +439,7 @@ exports[`blog view screen component should renders correctly 1`] = `
],
"chat": true,
"city": "",
"confirmEmail": [Function],
"container_guid": "0",
"deleted": "0",
"disabled_boost": false,
...
...
@@ -593,6 +596,7 @@ exports[`blog view screen component should renders correctly 1`] = `
],
"chat": true,
"city": "",
"confirmEmail": [Function],
"container_guid": "0",
"deleted": "0",
"disabled_boost": false,
...
...
@@ -740,6 +744,7 @@ exports[`blog view screen component should renders correctly 1`] = `
],
"chat": true,
"city": "",
"confirmEmail": [Function],
"container_guid": "0",
"deleted": "0",
"disabled_boost": false,
...
...
This diff is collapsed.
__tests__/channel/__snapshots__/ChannelScreen.js.snap
View file @
b6466a24
...
...
@@ -81,6 +81,7 @@ exports[`Channel screen component should renders correctly 1`] = `
],
"chat": true,
"city": "",
"confirmEmail": [Function],
"container_guid": "0",
"deleted": "0",
"disabled_boost": false,
...
...
@@ -347,6 +348,7 @@ exports[`Channel screen component should renders correctly 1`] = `
],
"chat": true,
"city": "",
"confirmEmail": [Function],
"container_guid": "0",
"deleted": "0",
"disabled_boost": false,
...
...
@@ -608,6 +610,7 @@ exports[`Channel screen component should show closed channel message 1`] = `
],
"chat": true,
"city": "",
"confirmEmail": [Function],
"container_guid": "0",
"deleted": "0",
"disabled_boost": false,
...
...
@@ -895,6 +898,7 @@ exports[`Channel screen component should show closed channel message 1`] = `
],
"chat": true,
"city": "",
"confirmEmail": [Function],
"container_guid": "0",
"deleted": "0",
"disabled_boost": false,
...
...
This diff is collapsed.
locales/en.json
View file @
b6466a24
...
...
@@ -600,10 +600,14 @@
},
"validation"
:{
"email"
:
"Invalid email"
,
"number"
:
"Invalid number"
,
"confirm"
:
"Please confirm your email anddress. Didn't get it?"
,
"number"
:
"Invalid number"
},
"emailConfirm"
:
{
"confirmed"
:
"Email address confirmed!"
,
"confirm"
:
"Please confirm your email address. Didn't get it?"
,
"sendAgain"
:
"Click here to send again."
,
"confirmNote"
:
"Note: If you change your email address, it will need to be confirmed again."
"confirmNote"
:
"Note: If you change your email address, it will need to be confirmed again."
,
"sent"
:
"Email sent"
},
"imagePicker"
:{
"gallery"
:
"Choose from gallery"
,
...
...
This diff is collapsed.
src/auth/UserStore.js
View file @
b6466a24
...
...
@@ -14,6 +14,14 @@ import { Alert } from 'react-native';
*/
class
UserStore
{
@
observable
me
=
{};
@
observable
emailConfirmMessageDismiss
=
false
;
@
action
setDissmis
(
value
)
{
console
.
log
(
this
.
emailConfirmMessageDismiss
)
this
.
emailConfirmMessageDismiss
=
value
;
console
.
log
(
this
.
emailConfirmMessageDismiss
)
}
@
action
setUser
(
user
)
{
...
...
This diff is collapsed.
src/channel/UserModel.js
View file @
b6466a24
...
...
@@ -56,6 +56,22 @@ export default class UserModel extends BaseModel {
*/
@
observable
email_confirmed
=
false
;
/**
* Confirm email
* @param {Object} params
*/
confirmEmail
=
async
params
=>
{
// call any api endpoint with the param
try
{
console
.
log
(
{
urn
:
this
.
urn
,
...
params
});
await
apiService
.
get
(
'
api/v2/entities/
'
,
{
urn
:
this
.
urn
,
...
params
});
this
.
setEmailConfirmed
(
true
);
return
true
;
}
catch
(
error
)
{
return
false
;
}
};
getOwnerIcontime
()
{
if
(
sessionService
.
getUser
().
guid
===
this
.
guid
)
{
return
sessionService
.
getUser
().
icontime
;
...
...
This diff is collapsed.
src/common/services/email-confirmation.service.js
View file @
b6466a24
...
...
@@ -12,6 +12,7 @@ class EmailConfirmationService {
return
Boolean
(
response
&&
response
.
sent
);
}
catch
(
err
)
{
logService
.
exception
(
'
[EmailConfirmationService] send
'
,
err
);
return
false
;
}
}
}
...
...
This diff is collapsed.
src/config/Config.e2e.js
View file @
b6466a24
...
...
@@ -23,7 +23,7 @@ export const MINDS_URI_SETTINGS = {
export
const
MINDS_MAX_VIDEO_LENGTH
=
5
;
// in minutes
export
const
SOCKET_URI
=
'
wss://ha-socket-io-us-east-1.minds.com:3030
'
export
const
SOCKET_URI
=
'
wss://ha-socket-io-us-east-1.minds.com:3030
'
;
export
const
MINDS_CDN_URI
=
'
https://cdn.minds.com/
'
;
export
const
MINDS_ASSETS_CDN_URI
=
'
https://cdn-assets.minds.com/
'
;
...
...
@@ -45,6 +45,7 @@ export const MINDS_FEATURES = {
* Deeplink to screen/params maping
*/
export
const
MINDS_DEEPLINK
=
[
[
'
email-confirmation
'
,
'
EmailConfirmation
'
],
[
'
groups/profile/:guid/feed
'
,
'
GroupView
'
],
[
'
groups/profile/:guid
'
,
'
GroupView
'
],
[
'
notifications
'
,
'
Notifications
'
],
...
...
@@ -59,7 +60,7 @@ export const MINDS_DEEPLINK = [
[
'
wallet/tokens/:section
'
,
'
Wallet
'
],
];
export
const
DISABLE_PASSWORD_INPUTS
=
tru
e
;
export
const
DISABLE_PASSWORD_INPUTS
=
fals
e
;
// IF TRUE COMMENT THE SMS PERMISSIONS IN ANDROID MANIFEST TOO!!!
export
const
GOOGLE_PLAY_STORE
=
DeviceInfo
.
getBuildNumber
()
<
1050000000
&&
Platform
.
OS
==
'
android
'
;
This diff is collapsed.
src/onboarding/EmailConfirmationScreen.js
View file @
b6466a24
import
React
,
{
Component
}
from
'
react
'
;
import
React
,
{
Component
}
from
'
react
'
;
import
{
View
,
Text
}
from
'
react-native
'
;
import
{
CommonStyle
}
from
'
../styles/Common
'
;
import
{
View
,
Text
}
from
'
react-native
'
;
import
{
CommonStyle
as
CS
}
from
'
../styles/Common
'
;
import
CenteredLoading
from
'
../common/components/CenteredLoading
'
;
import
i18n
from
'
../common/services/i18n.service
'
;
import
sessionService
from
'
../common/services/session.service
'
;
/**
* Email confirmation screen
*/
export
default
class
EmailConfirmationScreen
extends
Component
{
static
navigationOptions
=
{
title
:
'
Email confirm
'
,
};
/**
* State
*/
state
=
{
confirmed
:
false
,
error
:
false
,
};
/**
* Component did mount
*/
componentDidMount
()
{
// TODO: Implement call to the api for confirmation using the deeplinks params (this.props.navigation.state.params)
console
.
log
(
'
ConfirmParams
'
,
this
.
props
.
navigation
.
state
.
params
);
this
.
confirm
();
}
/**
* Confirm
*/
confirm
=
async
()
=>
{
this
.
setState
({
error
:
false
});
const
result
=
await
sessionService
.
getUser
()
.
confirmEmail
(
this
.
props
.
navigation
.
state
.
params
);
if
(
!
result
)
{
this
.
setState
({
error
:
true
});
}
else
{
this
.
setState
({
confirmed
:
true
});
}
};
/**
* Render body
*/
renderBody
()
{
if
(
this
.
state
.
error
)
{
return
(
<
Text
style
=
{[
CS
.
fontL
,
CS
.
textCenter
,
CS
.
colorDarkGreyed
]}
onPress
=
{
this
.
confirm
}
>
{
i18n
.
t
(
'
errorMessage
'
)
+
'
\n
'
}
<
Text
style
=
{[
CS
.
colorPrimary
]}
>
{
i18n
.
t
(
'
tryAgain
'
)}
<
/Text
>
<
/Text
>
);
}
if
(
this
.
state
.
confirmed
)
{
return
(
<
Text
style
=
{[
CS
.
fontXL
,
CS
.
textCenter
,
CS
.
colorDarkGreyed
]}
onPress
=
{()
=>
this
.
props
.
navigation
.
goBack
()}
>
{
i18n
.
t
(
'
emailConfirm.confirmed
'
)
+
'
\n
'
}
<
Text
style
=
{[
CS
.
colorPrimary
]}
>
{
i18n
.
t
(
'
goback
'
)}
<
/Text
>
<
/Text
>
);
}
return
<
CenteredLoading
/>
;
}
/**
...
...
@@ -20,9 +80,7 @@ export default class EmailConfirmationScreen extends Component {
*/
render
()
{
return
(
<
View
style
=
{
CommonStyle
.
flexContainer
}
>
<
Text
style
=
{
CommonStyle
.
fontL
}
>
Sending
email
confirmation
<
/Text
>
<
/View
>
<
View
style
=
{[
CS
.
flexContainer
,
CS
.
centered
]}
>
{
this
.
renderBody
()}
<
/View
>
);
}
}
This diff is collapsed.
src/settings/screens/EmailScreen.js
View file @
b6466a24
...
...
@@ -91,7 +91,8 @@ export default class EmailScreen extends Component {
// validate
const
error
=
validator
.
emailMessage
(
email
);
const
message
=
error
?
<
FormValidationMessage
>
{
error
}
<
/FormValidationMessage> : null
;
const
confirmNote
=
showConfirmNote
?
<
FormValidationMessage
>
{
i18n
.
t
(
'
validation.confirmNote
'
)}
<
/FormValidationMessage> : null
;
const
confirmNote
=
showConfirmNote
?
<
FormValidationMessage
>
{
i18n
.
t
(
'
emailConfirm.confirmNote
'
)}
<
/FormValidationMessage> : null
;
return
(
<
View
style
=
{[
CommonStyle
.
flexContainer
,
CommonStyle
.
backgroundWhite
]}
>
<
FormLabel
labelStyle
=
{
CommonStyle
.
fieldLabel
}
>
{
i18n
.
t
(
'
settings.currentEmail
'
)}
<
/FormLabel
>
...
...
This diff is collapsed.
src/topbar/EmailConfirmation.js
View file @
b6466a24
import
React
,
{
Component
}
from
'
react
'
;
import
{
Text
,
StyleSheet
,
View
}
from
'
react-native
'
;
import
React
,
{
Component
}
from
'
react
'
;
import
{
Text
,
StyleSheet
,
View
,
Alert
}
from
'
react-native
'
;
import
i18n
from
'
../common/services/i18n.service
'
;
import
Touchable
from
'
../common/components/Touchable
'
;
import
emailConfirmationService
from
'
../common/services/email-confirmation.service
'
;
import
IonIcon
from
'
react-native-vector-icons/Ionicons
'
;
import
{
CommonStyle
as
CS
}
from
'
../styles/Common
'
;
import
{
observer
,
inject
}
from
'
mobx-react/native
'
;
export
default
class
EmailConfirmation
extends
Component
{
send
=
()
=>
{
const
sended
=
emailConfirmationService
.
send
();
};
state
=
{
dismiss
:
false
,
/**
* Email Confirmation Message
*/
export
default
@
inject
(
'
user
'
)
@
observer
class
EmailConfirmation
extends
Component
{
/**
* Send confirmation email
*/
send
=
async
()
=>
{
if
(
await
emailConfirmationService
.
send
())
{
Alert
.
alert
(
i18n
.
t
(
'
emailConfirm.sent
'
));
}
else
{
Alert
.
alert
(
i18n
.
t
(
'
pleaseTryAgain
'
));
}
};
/**
* Dismiss message
*/
dismiss
=
()
=>
{
this
.
setState
({
dismiss
:
true
}
);
this
.
props
.
user
.
setDissmis
(
true
);
};
/**
* Render
*/
render
()
{
const
show
=
!
this
.
state
.
dismiss
&&
this
.
props
.
user
.
me
.
email_confirmed
===
false
;
!
this
.
props
.
user
.
emailConfirmMessageDismiss
&&
this
.
props
.
user
.
me
.
email_confirmed
===
false
;
if
(
!
show
)
{
return
null
;
}
return
(
show
&&
<
View
style
=
{
styles
.
container
}
>
<
Text
style
=
{[
styles
.
text
,
styles
.
paddingRight
]}
>
{
i18n
.
t
(
'
validation.confirm
'
)}
<
/Text
>
<
Touchable
style
=
{
styles
.
paddingRight
}
onPress
=
{
this
.
send
}
>
<
Text
style
=
{
styles
.
textBold
}
>
{
i18n
.
t
(
'
validation.sendAgain
'
)}
<
/Text
>
<
/Touchable
>
<
View
style
=
{
styles
.
container
}
>
<
Text
style
=
{[
CS
.
fontM
,
CS
.
colorWhite
]}
>
{
i18n
.
t
(
'
emailConfirm.confirm
'
)}
<
/Text
>
<
Text
style
=
{[
CS
.
bold
,
CS
.
colorWhite
]}
onPress
=
{
this
.
send
}
>
{
i18n
.
t
(
'
emailConfirm.sendAgain
'
)}
<
/Text
>
<
IonIcon
style
=
{
styles
.
modalCloseIcon
}
style
=
{
[
styles
.
modalCloseIcon
,
CS
.
colorWhite
]
}
size
=
{
28
}
name
=
"
ios-close
"
onPress
=
{
this
.
dismiss
}
color
=
{
'
#FFF
'
}
/
>
<
/View
>
);
...
...
@@ -47,19 +70,9 @@ const styles = StyleSheet.create({
justifyContent
:
'
center
'
,
flexDirection
:
'
column
'
,
},
text
:
{
color
:
'
#fff
'
,
},
textBold
:
{
color
:
'
#fff
'
,
fontWeight
:
'
700
'
},
modalCloseIcon
:
{
position
:
'
absolute
'
,
alignSelf
:
'
flex-end
'
,
paddingRight
:
15
,
},
paddingRight
:
{
paddingRight
:
15
,
}
});
This diff is collapsed.
src/topbar/Topbar.js
View file @
b6466a24
...
...
@@ -19,13 +19,15 @@ import featuresService from '../common/services/features.service';
import
{
SafeAreaView
}
from
'
react-navigation
'
;
import
isIphoneX
from
'
../common/helpers/isIphoneX
'
;
import
testID
from
'
../common/helpers/testID
'
;
import
EmailConfirmation
from
'
./EmailConfirmation
'
;
const
forceInset
=
isIphoneX
?
{
top
:
32
}
:
null
export
default
@
inject
(
'
user
'
)
@
inject
(
'
wallet
'
)
@
observer
export
default
class
Topbar
extends
Component
{
class
Topbar
extends
Component
{
componentDidMount
()
{
this
.
props
.
wallet
.
refresh
();
...
...
@@ -57,7 +59,6 @@ export default class Topbar extends Component {
testID
=
"
AvatarButton
"
/>
}
<
/View
>
<
TouchableOpacity
onPress
=
{()
=>
this
.
props
.
navigation
.
navigate
(
'
More
'
,
{
navigation
:
this
.
props
.
navigation
})}
{...
testID
(
'
Main menu button
'
)}
>
<
View
style
=
{
styles
.
topbarRight
}
>
<
Icon
name
=
"
menu
"
size
=
{
22
}
color
=
'
#444
'
style
=
{
styles
.
button
}
/
>
...
...
@@ -65,6 +66,7 @@ export default class Topbar extends Component {
<
/TouchableOpacity
>
<
/View
>
<
EmailConfirmation
user
=
{
this
.
props
.
user
}
/
>
<
/SafeAreaView
>
);
}
...
...
@@ -81,7 +83,7 @@ const styles = StyleSheet.create({
container
:
{
height
:
topbarHeight
,
display
:
'
flex
'
,
flexDirection
:
'
row
'
,
flexDirection
:
'
column
'
,
borderBottomWidth
:
StyleSheet
.
hairlineWidth
,
borderBottomColor
:
'
#EEE
'
,
backgroundColor
:
'
#FFFFFF
'
,
...
...
This diff is collapsed.