Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work fe1 ljankoschek notification page #1829

Merged
merged 10 commits into from
May 12, 2024

Conversation

ljankoschek
Copy link
Contributor

@ljankoschek ljankoschek commented Apr 26, 2024

Screenshot_20240426_135831

Makes Witness Notification page more readable as described in #1773
Currently only roll_call#create messages are actively witnessed (according to https://github.com/dedis/popstellar/blob/master/fe1-web/src/features/witness/network/messages/WitnessRegistry.ts).
If this changes other notification types have to be considered when building this page.

@ljankoschek ljankoschek self-assigned this Apr 26, 2024
@ljankoschek ljankoschek requested a review from a team as a code owner April 26, 2024 12:02
Copy link

Pull reviewers stats

Stats of the last 30 days for popstellar:

User Total reviews Time to review Total comments
K1li4nL
🥇
6
▀▀▀
4d 1h 37m
24
▀▀▀▀▀▀
matteosz
🥈
3
1d 11h 55m
6
arnauds5
🥉
2
13h 26m
0
t1b00
2
7d 16h 20m
▀▀▀
4
simone-kalbermatter
2
1d 14h 29m
2
onsriahi14
2
5d 5h 47m
▀▀
1
Tyratox
1
4d 1h 48m
3
sgueissa
1
25m
0
MariemBaccari
1
16h 14m
0
DanielTavaresA
1
3d 22h 24m
2
⚡️ Pull request stats

@ljankoschek ljankoschek linked an issue Apr 26, 2024 that may be closed by this pull request
@ljankoschek ljankoschek removed the request for review from osm-alt April 26, 2024 12:13
@ljankoschek ljankoschek marked this pull request as draft April 30, 2024 14:59
@CLAassistant
Copy link

CLAassistant commented May 1, 2024

CLA assistant check
All committers have signed the CLA.

@Tyratox Tyratox force-pushed the work-fe1-ljankoschek-notification-page branch from f21e5cb to 9796d1f Compare May 1, 2024 07:40
@ljankoschek ljankoschek marked this pull request as ready for review May 1, 2024 07:43
@ljankoschek ljankoschek requested a review from 4xiom5 May 1, 2024 07:43
@Tyratox Tyratox force-pushed the work-fe1-ljankoschek-notification-page branch from 9796d1f to c033203 Compare May 1, 2024 07:55
Copy link

sonarcloud bot commented May 1, 2024

Quality Gate Passed Quality Gate passed for 'PoP - PoPCHA-Web-Client'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link

sonarcloud bot commented May 1, 2024

Quality Gate Passed Quality Gate passed for 'PoP - Be1-Go'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link

sonarcloud bot commented May 1, 2024

Quality Gate Passed Quality Gate passed for 'PoP - Be2-Scala'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link

sonarcloud bot commented May 1, 2024

Copy link

sonarcloud bot commented May 1, 2024

Quality Gate Passed Quality Gate passed for 'PoP - Fe2-Android'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link
Contributor

@4xiom5 4xiom5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@4xiom5 4xiom5 requested a review from Tyratox May 8, 2024 16:55
@ljankoschek ljankoschek requested review from Tyratox and removed request for Tyratox May 10, 2024 15:28
Copy link
Contributor

@Tyratox Tyratox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, nice work 😄

I added some small comments that you can address here, in a separate PR or not at all - depending how you feel about it :)

const WitnessNotification = ({ notification, navigateToNotificationScreen }: IPropTypes) => {
const messageSelector = useMemo(
() => makeMessageSelector(notification.messageId),
[notification.messageId],
);
const message = useSelector(messageSelector);
const decodedData = message && JSON.parse(message.data.decode());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not blocking for me to accept this PR but just as input for the future: I think this would be a great place to add an extra function that does the content checks, e.g. decodedData.object === 'roll_call' && decodedData.action === 'create', and then returns a typed object (or null if it is not supported). You could probably use MessageRegistry.buildMessageData for this :)

This way you would have type safety + could use toDateString() for all the dates

Comment on lines +36 to +42
marginBottom: 10,
},
marginB15: {
marginBottom: 15,
},
marginT10: {
marginTop: 10,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a particular reason you use this instead of Spacing.x1, Spacing.x2 etc?

Comment on lines +138 to +144
<Text style={[Typography.small, styles.boldText]}>Message Information:</Text>
<Text style={Typography.small}>Message ID: {notification.messageId}</Text>
<Text style={Typography.small}>Received from: {message.receivedFrom}</Text>
<Text style={Typography.small}>Channel: {message.channel}</Text>
<Text style={Typography.small}>Sender: {message.sender}</Text>
<Text style={Typography.small}>Signature: {message.signature}</Text>
<Text style={Typography.small}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you use the same style everywhere I think you can wrap the elements inside another elements like here: https://reactnative.dev/docs/text#nested-text. Saves you same duplication :)

@ljankoschek ljankoschek added this pull request to the merge queue May 12, 2024
Merged via the queue into master with commit 111d90f May 12, 2024
18 checks passed
@ljankoschek ljankoschek deleted the work-fe1-ljankoschek-notification-page branch May 12, 2024 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UI Notifications/Notification Page is not Human-Readable
4 participants