-
Notifications
You must be signed in to change notification settings - Fork 12
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
fix(openchallenges): remove usage of "Other" for platform #2393
Conversation
@vpchung What about representing missing values by an empty string in the OC Data sheet and settings the default value of the SQL property |
I don't think this will work, at least, not for the dump files to dump properly. If some rows contain less columns than other rows, then that row's data will be offset. But willing to try to see. |
The updates on API descriptions regarding of removing "Other" option of platform are pushed in this pr. Initially, I considered removing the To keep things simple, I've restricted the options to both the |
libs/openchallenges/api-description/src/components/schemas/ChallengePlatformName.yaml
Outdated
Show resolved
Hide resolved
What is the problem with the platform slug? Isn't it enough to set the |
It is enough with nullable challenge.platform. I thought we would like to limit options using these known platforms as a validation. If not restricting platform options using |
Because the platform data live in the DB, we shouldn't do any validation in the spec, which would require us to update the API description each time we add/update platform data in the DB. |
@vpchung Could you please resolve the conflict in |
@tschaffter done ✅ |
I updated the challenge service with the generator and weird things are happening like the challenge platform Java and TS object loosing some of its properties. Could this be a side effect of @rrchai using I also tried this solution described here (for OpenAPI 3.1) but this leads to the same behavior as when using Rong's solution (for OpenAPI 3.0 according to the SO post): platform:
anyOf:
- $ref: SimpleChallengePlatform.yaml
- type: 'null' Update: We are using OpenAPI |
@vpchung I fixed the styling issue visible on your screenshot where "Not Available" is not greyed out for platform. Now that platform is nullable AND optional, the property in TypeScript is: platform?: SimpleChallengePlatform | null; The styling check should check for these two values: <td [ngClass]="{ 'text-grey': challenge.platform?.name === (undefined || null) }"> which I propose to simplify to the following: <td [ngClass]="{ 'text-grey': !challenge.platform }"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works on my end! Thanks, @rrchai @tschaffter
Fixes #2385
Changelog
challenge.platform_id
for "Other" (14) with NULL (\N)Preview
Landscape now shows 13 platforms
"Other" no longer shows in platform facet
Platform info shows "Not available" in profiles for challenges hosted on non-OC platforms