Skip to content
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.

Commit

Permalink
Fixed #67 and #161 - Sign-In Page logo resizing and ORCID display in …
Browse files Browse the repository at this point in the history
…the user profile.
  • Loading branch information
root committed Sep 15, 2020
1 parent a8987d3 commit a48fd3e
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 51 deletions.
13 changes: 7 additions & 6 deletions bco_be/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated by Django 2.2 on 2020-01-22 20:45
# Generated by Django 2.2.10 on 2020-09-15 20:24

from django.conf import settings
import django.contrib.auth.models
Expand Down Expand Up @@ -48,11 +48,12 @@ class Migration(migrations.Migration):
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('first_name', models.CharField(max_length=255)),
('last_name', models.CharField(max_length=255)),
('phone_number', models.CharField(max_length=255)),
('address', models.CharField(max_length=255)),
('city', models.CharField(max_length=255)),
('state', models.CharField(max_length=255)),
('picture', models.CharField(max_length=255)),
('phone_number', models.CharField(blank=True, max_length=255, null=True)),
('address', models.CharField(blank=True, max_length=255, null=True)),
('city', models.CharField(blank=True, max_length=255, null=True)),
('state', models.CharField(blank=True, max_length=255, null=True)),
('picture', models.CharField(blank=True, max_length=255, null=True)),
('orcid', models.CharField(blank=True, max_length=255, null=True)),
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='profile', to=settings.AUTH_USER_MODEL)),
],
),
Expand Down
38 changes: 0 additions & 38 deletions bco_be/migrations/0002_auto_20200122_2113.py

This file was deleted.

Binary file modified bco_be/migrations/__pycache__/0001_initial.cpython-36.pyc
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion bco_be/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class UserProfile(models.Model):
city = models.CharField(max_length=255,blank=True, null=True,)
state = models.CharField(max_length=255,blank=True, null=True,)
picture = models.CharField(max_length=255,blank=True, null=True,)

orcid = models.CharField(max_length=255,blank=True, null=True,)

def __str__(self):
return "%s's profile" % self.user
Expand Down
3 changes: 2 additions & 1 deletion bco_be/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def update(self, instance, validated_data):
class UserProfileSerializer(origin_serializers.ModelSerializer):
class Meta:
model = UserProfile
fields = ('phone_number', 'address', 'city', 'state', 'picture')
fields = ('phone_number', 'address', 'city', 'state', 'picture', 'orcid')

class UserSerializer(origin_serializers.HyperlinkedModelSerializer):
profile = UserProfileSerializer(required=True)
Expand Down Expand Up @@ -100,6 +100,7 @@ def update(self, instance, validated_data):
profile.city = profile_data.get('city', profile.city)
profile.state = profile_data.get('state', profile.state)
profile.picture = profile_data.get('picture', profile.picture)
profile.orcid = profile_data.get('orcid', profile.orcid)
profile.save()

return instance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ const AccountDetails = props => {
city: '',
phone_number: '',
state: '',
country: 'USA'
country: 'USA',
orcid: ''
});

useEffect(() => {
Expand All @@ -45,7 +46,8 @@ const AccountDetails = props => {
city: data.profile.city,
phone_number: data.profile.phone_number,
state: data.profile.state,
country: 'USA'
country: 'USA',
orcid: data.profile.orcid
});
}
}, [props.data])
Expand All @@ -58,7 +60,7 @@ const AccountDetails = props => {
};

const onSave = () => {
let data = {...values, profile: { address: values.address, city: values.city, phone_number: values.phone_number, state: values.state }};
let data = {...values, profile: { address: values.address, city: values.city, phone_number: values.phone_number, state: values.state, orcid: values.orcid }};
props.update(data);
}

Expand Down Expand Up @@ -208,6 +210,21 @@ const AccountDetails = props => {
variant="outlined"
/>
</Grid>
<Grid
item
md={6}
xs={12}
>
<TextField
fullWidth
label="ORCID"
margin="dense"
name="orcid"
onChange={handleChange}
value={values.orcid}
variant="outlined"
/>
</Grid>
</Grid>
</CardContent>
<Divider />
Expand Down
Binary file removed frontend/src/views/Detail/.Detail.js.swp
Binary file not shown.
4 changes: 2 additions & 2 deletions frontend/src/views/SignIn/SignIn.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ const useStyles = makeStyles(theme => ({
justifyContent: 'center',
alignItems: 'center',
backgroundImage: 'url(https://biocomputeobject.org/images/landing.5.png)',
backgroundSize: 'cover',
backgroundSize: '700px',
backgroundRepeat: 'no-repeat',
backgroundPosition: 'center'
backgroundPosition: 'right center'
},
quoteInner: {
textAlign: 'center',
Expand Down

0 comments on commit a48fd3e

Please sign in to comment.