Skip to content

Commit

Permalink
trust score setup
Browse files Browse the repository at this point in the history
  • Loading branch information
daxaxelrod committed Oct 29, 2023
1 parent bdb760e commit 09c4595
Show file tree
Hide file tree
Showing 8 changed files with 789 additions and 611 deletions.
1,324 changes: 728 additions & 596 deletions frontend/package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
"@testing-library/user-event": "^14.2.1",
"@types/jest": "^27.5.2",
"@types/node": "^17.0.45",
"@types/react": "^18.0.14",
"@types/react-dom": "^18.0.5",
"@types/styled-components": "^5.1.26",
"@types/three": "^0.152.1",
"antd": "^5.0.0",
Expand Down Expand Up @@ -75,6 +73,8 @@
]
},
"devDependencies": {
"@types/react": "^18.2.33",
"@types/react-dom": "^18.2.14",
"babel-plugin-styled-components": "^2.0.7"
}
}
8 changes: 6 additions & 2 deletions frontend/src/app/components/users/profile/UserHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Typography } from "antd";
import { Flex, Typography } from "antd";
import React from "react";
import { User } from "../../../../redux/reducers/types/commonTypes";
import { MailOutlined } from "@ant-design/icons";
import { LinkedinOutlined, TwitterOutlined } from "@ant-design/icons";
import colors from "../../../constants/colors";
import moment from "moment-timezone";

Expand All @@ -13,6 +13,10 @@ export default function UserHeader({ user }: { user: User }) {
<Title>
{user?.first_name} {user?.last_name}
</Title>
<Flex gap={10}>
{user?.linkedin_url && <LinkedinOutlined />}
{user?.twitter_url && <TwitterOutlined />}
</Flex>
<Paragraph
style={{
color: colors.gray8,
Expand Down
30 changes: 20 additions & 10 deletions frontend/src/app/components/users/profile/UserOpenInsureRating.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
import React from "react";
import { Progress } from "antd";
import { Col, Flex, Progress, Row } from "antd";
import { User } from "../../../../redux/reducers/types/commonTypes";
import colors from "../../../constants/colors";
import { Typography } from "antd";

const { Title } = Typography;

export default function UserOpenInsureRating({ user }: { user: User }) {
return (
<div>
<Progress
type="dashboard"
percent={99}
strokeColor={{ "0%": colors.good, "100%": colors.lightGood }}
/>
const trustworthinessScore = 99;

<Title level={4}>trustworthy score</Title>
</div>
return (
<>
<Flex>
<Progress
type="dashboard"
percent={99}
strokeColor={{
"0%": colors.good,
"100%": colors.lightGood,
}}
/>
</Flex>
<Flex>
<Col>
<Title level={4}>trustworthy score</Title>
</Col>
</Flex>
</>
);
}
3 changes: 3 additions & 0 deletions frontend/src/redux/reducers/types/commonTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ export interface User {
created_at: string;
updated_at: string;
verified_email: boolean;

linkedin_url?: string;
twitter_url?: string;
}

export interface Premium {
Expand Down
6 changes: 5 additions & 1 deletion pods/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ class UserAdmin(UserAdmin):
model = User

fieldsets = UserAdmin.fieldsets + (
(None, {"fields": ("picture", "verified_email", "gender", "birthday")}),
(
"Custom Fields",
{"fields": ("picture", "verified_email", "gender", "birthday")},
),
("Socials", {"fields": ("linkedin_url", "twitter_url")}),
)


Expand Down
22 changes: 22 additions & 0 deletions pods/migrations/0022_user_linkedin_url_user_twitter_url.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Generated by Django 4.2.6 on 2023-10-29 19:31

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("pods", "0021_badge_userbadge_badge_owners"),
]

operations = [
migrations.AddField(
model_name="user",
name="linkedin_url",
field=models.URLField(blank=True, null=True),
),
migrations.AddField(
model_name="user",
name="twitter_url",
field=models.URLField(blank=True, null=True),
),
]
3 changes: 3 additions & 0 deletions pods/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ class User(AbstractUser):
max_length=1, null=True, blank=True, choices=GENDER_CHOICES
)

linkedin_url = models.URLField(null=True, blank=True)
twitter_url = models.URLField(null=True, blank=True)


class Pod(models.Model):
"""One pod per policy"""
Expand Down

0 comments on commit 09c4595

Please sign in to comment.