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

move contexts from openbeta-graphql to sandbag #321

Open
5 tasks
musoke opened this issue Jun 19, 2023 · 0 comments
Open
5 tasks

move contexts from openbeta-graphql to sandbag #321

musoke opened this issue Jun 19, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@musoke
Copy link
Contributor

musoke commented Jun 19, 2023

Comments in openbeta-graphql say that grade contexts should be defined in sandbag.

/**
* Grade systems have minor variations between countries. gradeContext is a
* short abbreviated string that identifies the context in which the grade was assigned
* and should signify a regional or national variation that may be considered within
* grade comparisons.
*
* Todo: move this to @openbeta/sandbag library
*/
export enum GradeContexts {
/** Alaska (United States) */
ALSK = 'ALSK',
/** Australia */
AU = 'AU',
BRZ = 'BRZ',
FIN = 'FIN',
FR = 'FR',
HK = 'HK',
NWG = 'NWG',
POL = 'POL',
SA = 'SA',
/** Sweden */
SWE = 'SWE',
SX = 'SX',
UIAA = 'UIAA',
/** United Kingdom */
UK = 'UK',
/** United States of Ameria */
US = 'US'
}
/**
* A conversion from grade context to corresponding grade type / scale
* Todo: move this to @openbeta/sandbag
*/
export const gradeContextToGradeScales: Partial<Record<GradeContexts, ClimbGradeContextType>> = {
[GradeContexts.AU]: {
trad: GradeScales.EWBANK,
sport: GradeScales.EWBANK,
bouldering: GradeScales.VSCALE,
tr: GradeScales.EWBANK,
alpine: GradeScales.YDS,
mixed: GradeScales.YDS,
aid: GradeScales.YDS,
snow: GradeScales.YDS, // is this the same as alpine?
ice: GradeScales.YDS // is this the same as alpine?
},
[GradeContexts.US]: {
trad: GradeScales.YDS,
sport: GradeScales.YDS,
bouldering: GradeScales.VSCALE,
tr: GradeScales.YDS,
alpine: GradeScales.YDS,
mixed: GradeScales.YDS,
aid: GradeScales.YDS,
snow: GradeScales.YDS, // is this the same as alpine?
ice: GradeScales.YDS // is this the same as alpine?
},
[GradeContexts.FR]: {
trad: GradeScales.FRENCH,
sport: GradeScales.FRENCH,
bouldering: GradeScales.FONT,
tr: GradeScales.FRENCH,
alpine: GradeScales.FRENCH,
mixed: GradeScales.FRENCH,
aid: GradeScales.FRENCH,
snow: GradeScales.FRENCH, // is this the same as alpine?
ice: GradeScales.FRENCH // is this the same as alpine?
},
[GradeContexts.SA]: {
trad: GradeScales.FRENCH,
sport: GradeScales.FRENCH,
bouldering: GradeScales.FONT,
tr: GradeScales.FRENCH,
alpine: GradeScales.FRENCH,
mixed: GradeScales.FRENCH,
aid: GradeScales.FRENCH,
snow: GradeScales.FRENCH, // SA does not have a whole lot of snow
ice: GradeScales.FRENCH // SA does not have a whole lot of ice
}
}

This is required for open-tacos to benefit from the those definitions.

Wait until in progress changes have settled and versions are synchronized.

Depends on:

@musoke musoke self-assigned this Jun 19, 2023
@musoke musoke added the enhancement New feature or request label Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant