Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
thalia
ThaliApp
Commits
d05d7d39
Commit
d05d7d39
authored
Dec 12, 2018
by
Sébastiaan Versteeg
Browse files
Merge branch 'feature/add-societies-to-profile' into 'master'
Added societies to profile Closes #83 See merge request
!216
parents
e9e97b21
89cb352d
Changes
6
Hide whitespace changes
Inline
Side-by-side
__tests__/assets/locales/__snapshots__/index.js.spec.js.snap
View file @
d05d7d39
...
...
@@ -112,6 +112,7 @@ Object {
"Computing science": "Informatica",
"Information sciences": "Informatiekunde",
"Personal information": "Persoonlijke gegevens",
"Societies": "Gezelschappen",
"Sorry! We couldn't load any data.": "Sorry! We konden geen gegevens laden.",
"Study programme": "Studie",
"This member has not written a description yet.": "Dit lid heeft nog geen beschrijving geschreven.",
...
...
__tests__/reducers/__snapshots__/profile.spec.js.snap
View file @
d05d7d39
...
...
@@ -18,6 +18,7 @@ Object {
"pk": -1,
"profile_description": "",
"programme": "",
"societies": Array [],
"starting_year": -1,
"website": "",
},
...
...
app/assets/locales/nl/app/ui/screens/profile/ProfileScreen.json
View file @
d05d7d39
...
...
@@ -11,5 +11,6 @@
"Achievements for Thalia"
:
"Verdiensten voor Thalia"
,
"today"
:
"heden"
,
"Chair"
:
"Voorzitter"
,
"Sorry! We couldn't load any data."
:
"Sorry! We konden geen gegevens laden."
"Sorry! We couldn't load any data."
:
"Sorry! We konden geen gegevens laden."
,
"Societies"
:
"Gezelschappen"
}
app/reducers/profile.js
View file @
d05d7d39
...
...
@@ -20,6 +20,7 @@ const initialState = {
website
:
''
,
membership_type
:
''
,
achievements
:
[],
societies
:
[],
},
success
:
false
,
hasLoaded
:
false
,
...
...
app/ui/screens/memberList/MemberListScreen.js
View file @
d05d7d39
...
...
@@ -92,7 +92,12 @@ MemberListScreen.propTypes = {
memberList
:
PropTypes
.
arrayOf
(
PropTypes
.
shape
({
pk
:
PropTypes
.
number
.
isRequired
,
display_name
:
PropTypes
.
string
.
isRequired
,
photo
:
PropTypes
.
string
.
isRequired
,
avatar
:
PropTypes
.
shape
({
full
:
PropTypes
.
string
.
isRequired
,
large
:
PropTypes
.
string
.
isRequired
,
medium
:
PropTypes
.
string
.
isRequired
,
small
:
PropTypes
.
string
.
isRequired
,
}).
isRequired
,
})).
isRequired
,
status
:
PropTypes
.
string
.
isRequired
,
loading
:
PropTypes
.
bool
.
isRequired
,
...
...
app/ui/screens/profile/ProfileScreen.js
View file @
d05d7d39
...
...
@@ -98,13 +98,13 @@ const getPersonalInfo = (profile, t) => {
return
<
View
/>
;
};
const
get
Achievements
=
(
profile
,
t
)
=>
{
if
(
profile
.
achievement
s
.
length
)
{
const
get
Memberships
=
(
memberships
,
sectionHeader
,
t
)
=>
{
if
(
membership
s
.
length
)
{
return
(
<
CardSection
sectionHeader
=
{
t
(
'
Achievements for Thalia
'
)
}
sectionHeader
=
{
sectionHeader
}
>
{
profile
.
achievement
s
.
map
((
achievement
,
i
)
=>
(
{
membership
s
.
map
((
achievement
,
i
)
=>
(
<
View
style
=
{[
styles
.
item
,
i
!==
0
&&
styles
.
borderTop
]}
key
=
{
achievement
.
name
}
>
<
Text
style
=
{
styles
.
description
}
>
{
achievement
.
name
}
...
...
@@ -278,7 +278,8 @@ class ProfileScreen extends Component {
<
View
style
=
{
styles
.
content
}
>
{
getDescription
(
this
.
props
.
profile
,
this
.
props
.
t
)}
{
getPersonalInfo
(
this
.
props
.
profile
,
this
.
props
.
t
)}
{
getAchievements
(
this
.
props
.
profile
,
this
.
props
.
t
)}
{
getMemberships
(
this
.
props
.
profile
.
achievements
,
this
.
props
.
t
(
'
Achievements for Thalia
'
),
this
.
props
.
t
)}
{
getMemberships
(
this
.
props
.
profile
.
societies
,
this
.
props
.
t
(
'
Societies
'
),
this
.
props
.
t
)}
<
/View
>
<
/ScrollView
>
{
this
.
getAppbar
()}
...
...
@@ -291,7 +292,6 @@ ProfileScreen.propTypes = {
profile
:
PropTypes
.
shape
({
pk
:
PropTypes
.
number
.
isRequired
,
display_name
:
PropTypes
.
string
.
isRequired
,
photo
:
PropTypes
.
string
.
isRequired
,
avatar
:
PropTypes
.
shape
({
full
:
PropTypes
.
string
.
isRequired
,
large
:
PropTypes
.
string
.
isRequired
,
...
...
@@ -314,6 +314,16 @@ ProfileScreen.propTypes = {
role
:
PropTypes
.
string
,
})),
})).
isRequired
,
societies
:
PropTypes
.
arrayOf
(
PropTypes
.
shape
({
name
:
PropTypes
.
string
.
isRequired
,
earliest
:
PropTypes
.
string
,
periods
:
PropTypes
.
arrayOf
(
PropTypes
.
shape
({
chair
:
PropTypes
.
bool
.
isRequired
,
until
:
PropTypes
.
string
,
since
:
PropTypes
.
string
.
isRequired
,
role
:
PropTypes
.
string
,
})),
})).
isRequired
,
}).
isRequired
,
success
:
PropTypes
.
bool
.
isRequired
,
hasLoaded
:
PropTypes
.
bool
.
isRequired
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment