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

[Whatpulse] badge for a user and for a team #8466

Merged
merged 25 commits into from
Oct 11, 2022

Conversation

PaulaBarszcz
Copy link
Collaborator

@PaulaBarszcz PaulaBarszcz commented Sep 30, 2022

closes #8356

WhatPulse API docs: https://help.whatpulse.org/api/web-api/
user: https://api.whatpulse.org/user.php?user=jerone&format=json
team: https://api.whatpulse.org/team.php?team=dutch%20power%20cows&format=json


image

@shields-ci
Copy link

shields-ci commented Sep 30, 2022

Messages
📖 ✨ Thanks for your contribution to Shields, @PaulaBarszcz!

Generated by 🚫 dangerJS against ce3cbcd

@PaulaBarszcz PaulaBarszcz marked this pull request as ready for review October 1, 2022 22:13
@calebcartwright calebcartwright added the service-badge New or updated service badge label Oct 2, 2022
@PaulaBarszcz
Copy link
Collaborator Author

Thanks for the review @chris48s.

I will mark this PR as a WIP until I’m done with the corrections.

@PaulaBarszcz PaulaBarszcz changed the title [Whatpulse] badge for user and team WIP [Whatpulse] badge for user and team Oct 3, 2022
@PaulaBarszcz PaulaBarszcz changed the title WIP [Whatpulse] badge for user and team [Whatpulse] badge for a user and for a team Oct 4, 2022
@PaulaBarszcz PaulaBarszcz requested a review from chris48s October 4, 2022 16:48
@PaulaBarszcz PaulaBarszcz requested a review from chris48s October 7, 2022 18:58
Copy link
Member

@calebcartwright calebcartwright left a comment

Choose a reason for hiding this comment

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

I'm a little late to this party but left a few inline comments

)

const isHumanized = Joi.string().regex(
/\d* (second|seconds|minute|minutes|hour|hours|day|days|month|months|year|years)/
Copy link
Member

Choose a reason for hiding this comment

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

\d* will match zero digits. Think we want \d+ to require one or more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

https://day.js.org/docs/en/durations/humanize

In these examples they mention that the result of ‚humanize()’ can sometimes be for example ‚a day’.
I used an asterisk here on purpose :))

53EEFF2A-1B1F-4173-A137-0F64562795B8

Copy link
Member

Choose a reason for hiding this comment

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

OK - got it. Thanks 👍

Basically, we don't want ' second' to be valid. How about we make it [0-9a-z]+. rather than \d*. That should ensure there is some value there and I think that should catch all the cases we care about.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Suggested change
/\d* (second|seconds|minute|minutes|hour|hours|day|days|month|months|year|years)/
/[0-9a-z]+ (second|seconds|minute|minutes|hour|hours|day|days|month|months|year|years)/

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Regex modified

@PaulaBarszcz PaulaBarszcz requested review from calebcartwright and chris48s and removed request for calebcartwright and chris48s October 8, 2022 20:44
@PaulaBarszcz
Copy link
Collaborator Author

@chris48s I think that all that we discussed regarding this PR is already implemented :)

@repo-ranger repo-ranger bot merged commit a96c25a into badges:master Oct 11, 2022
@chris48s
Copy link
Member

nice one - cheers 👍

@PaulaBarszcz PaulaBarszcz deleted the whatpulse-badge branch October 13, 2022 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service-badge New or updated service badge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Badge request: WhatPulse
4 participants