-
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): update OC data model and API specs #2399
Conversation
@vpchung I need to review this PR before it gets merged (even if it meets the one-approval check) |
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.
Impressive PR! I can appreciate how thorough you have been when updating the code base!
TODO to myself:
- Regenerate the API client for Angular and
push to this branch if successful
libs/openchallenges/api-description/src/components/schemas/ChallengeSlug.yaml
Show resolved
Hide resolved
libs/openchallenges/api-description/src/components/schemas/Challenge.yaml
Outdated
Show resolved
Hide resolved
@vpchung There are a few errors after updating the API client for Angular (
Error: libs/openchallenges/challenge/src/lib/challenge-overview/challenge-overview.component.html:33:60 - error TS2533: Object is possibly 'null' or 'undefined'.
33 <td [ngClass]="{ 'text-grey': challenge.platform.name === '' }">
~~~~
libs/openchallenges/challenge/src/lib/challenge-overview/challenge-overview.component.ts:14:16
14 templateUrl: './challenge-overview.component.html',
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error occurs in the template of component ChallengeOverviewComponent.
Error: libs/openchallenges/challenge/src/lib/challenge-overview/challenge-overview.component.html:34:49 - error TS2533: Object is possibly 'null' or 'undefined'.
34 {{ useNaIfFalsey(challenge.platform.name) }}
~~~~
libs/openchallenges/challenge/src/lib/challenge-overview/challenge-overview.component.ts:14:16
14 templateUrl: './challenge-overview.component.html',
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error occurs in the template of component ChallengeOverviewComponent.
Error: libs/openchallenges/challenge/src/lib/challenge-stats/challenge-stats.component.html:27:28 - error TS2533: Object is possibly 'null' or 'undefined'.
27 challenge.platform.name === 'Other' ? 'platform' : challenge.platform.name
~~~~
libs/openchallenges/challenge/src/lib/challenge-stats/challenge-stats.component.ts:10:16
10 templateUrl: './challenge-stats.component.html',
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error occurs in the template of component ChallengeStatsComponent.
Error: libs/openchallenges/challenge/src/lib/challenge-stats/challenge-stats.component.html:27:79 - error TS2533: Object is possibly 'null' or 'undefined'.
27 challenge.platform.name === 'Other' ? 'platform' : challenge.platform.name
~~~~
libs/openchallenges/challenge/src/lib/challenge-stats/challenge-stats.component.ts:10:16
10 templateUrl: './challenge-stats.component.html',
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error occurs in the template of component ChallengeStatsComponent.
Error: libs/openchallenges/org-profile/src/lib/org-profile-overview/org-profile-overview.component.html:5:27 - error TS2345: Argument of type 'string | null | undefined' is not assignable to parameter of type 'string | undefined'.
Type 'null' is not assignable to type 'string | undefined'.
5 <p>{{ useNaIfFalsey(org.description) }}</p>
~~~~~~~~~~~~~~~
libs/openchallenges/org-profile/src/lib/org-profile-overview/org-profile-overview.component.ts:14:16
14 templateUrl: './org-profile-overview.component.html',
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error occurs in the template of component OrgProfileOverviewComponent.
Error: libs/openchallenges/org-profile/src/lib/org-profile-overview/org-profile-overview.component.html:6:35 - error TS2533: Object is possibly 'null' or 'undefined'.
6 <div *ngIf="org.description.endsWith('...')">
~~~~~~~~
libs/openchallenges/org-profile/src/lib/org-profile-overview/org-profile-overview.component.ts:14:16
14 templateUrl: './org-profile-overview.component.html',
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error occurs in the template of component OrgProfileOverviewComponent.
✖ Failed to compile. |
Fixes #2064
Changelog
avatar_key
s to be NULL (not all platforms/organizations/challenges will have an image)website_url
andavatar_url
to 500 characters (ref)challenge.doi
to 120 characters - to be reasonably more generous with URLsorganization.acronym
to 10 characters (ref)challenge.slug
must be unique, in kebab-case, and at least 3 charactersorganization.login
must be unique, in kebab-case, and at least 2 characterschallenge.name
cannot be NULLchallenge_id
,organization_id
, androle
must be unique inchallenge_contribution
tablesorganization.challengeCount
to 0id
having to be unique - they are set as primary keys so they should already be uniquechallenge.difficulty
,organization.email
)Note
There were some updates made to the Java scripts as well, as not updating them prevented the challenges to display on the web app. This was done with the generator:
nx run openchallenges-*-service:generate
Preview
No changes to search pages e.g.
Organization profile no longer displays contact email:
API spec for challenges:
API spec for organizations: