-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add a commondatabuilder tool. * Add a filterOut option to choice configs. * Add commondatabuilder.js smoke test. * ok apollo codegen reverted its regression or something * pwaaiejgpojeg * Don't use enums, they are super confusing * Um, upgrade apollo i guess? * Run querybuilder.js --force. * Tell users to pass --force to querybuilder on test failure. * Convert issue choices to use typescript files. * Migrate lease choices to typescript. * Move functions to commondatabuilder. * Rename enumName to typeName. * Appease codeclimate. * Add docs. * Add test to ensure common data is synced. * Add more docs.
- Loading branch information
Showing
32 changed files
with
1,060 additions
and
339 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// This file was auto-generated by commondatabuilder. | ||
// Please don't edit it. | ||
|
||
export type BoroughChoice = "BROOKLYN"|"QUEENS"|"BRONX"|"MANHATTAN"|"STATEN_ISLAND"; | ||
|
||
export const BoroughChoices: BoroughChoice[] = [ | ||
"BROOKLYN", | ||
"QUEENS", | ||
"BRONX", | ||
"MANHATTAN", | ||
"STATEN_ISLAND" | ||
]; | ||
|
||
const BoroughChoiceSet: Set<String> = new Set(BoroughChoices); | ||
|
||
export function isBoroughChoice(choice: string): choice is BoroughChoice { | ||
return BoroughChoiceSet.has(choice); | ||
} | ||
|
||
export type BoroughChoiceLabels = { | ||
[k in BoroughChoice]: string; | ||
}; | ||
|
||
export function getBoroughChoiceLabels(): BoroughChoiceLabels { | ||
return { | ||
BROOKLYN: "Brooklyn", | ||
QUEENS: "Queens", | ||
BRONX: "Bronx", | ||
MANHATTAN: "Manhattan", | ||
STATEN_ISLAND: "Staten Island", | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { DjangoChoicesTypescriptConfig } from '../frontend/commondatabuilder/commondatabuilder'; | ||
|
||
const config: DjangoChoicesTypescriptConfig = { | ||
rootDir: __dirname, | ||
files: [ | ||
{ | ||
jsonFilename: 'issue-choices.json', | ||
typeName: 'IssueChoice', | ||
exportLabels: true, | ||
filterOut: /^LANDLORD__/ | ||
}, | ||
{ | ||
jsonFilename: 'issue-area-choices.json', | ||
typeName: 'IssueAreaChoice', | ||
exportLabels: true, | ||
filterOut: ['LANDLORD'] | ||
}, | ||
{ | ||
jsonFilename: 'borough-choices.json', | ||
typeName: 'BoroughChoice', | ||
exportLabels: true, | ||
}, | ||
{ | ||
jsonFilename: 'lease-choices.json', | ||
typeName: 'LeaseChoice', | ||
exportLabels: true, | ||
filterOut: ['NOT_SURE'] | ||
} | ||
] | ||
}; | ||
|
||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// This file was auto-generated by commondatabuilder. | ||
// Please don't edit it. | ||
|
||
export type IssueAreaChoice = "HOME"|"BEDROOMS"|"KITCHEN"|"LIVING_ROOM"|"BATHROOMS"|"PUBLIC_AREAS"; | ||
|
||
export const IssueAreaChoices: IssueAreaChoice[] = [ | ||
"HOME", | ||
"BEDROOMS", | ||
"KITCHEN", | ||
"LIVING_ROOM", | ||
"BATHROOMS", | ||
"PUBLIC_AREAS" | ||
]; | ||
|
||
const IssueAreaChoiceSet: Set<String> = new Set(IssueAreaChoices); | ||
|
||
export function isIssueAreaChoice(choice: string): choice is IssueAreaChoice { | ||
return IssueAreaChoiceSet.has(choice); | ||
} | ||
|
||
export type IssueAreaChoiceLabels = { | ||
[k in IssueAreaChoice]: string; | ||
}; | ||
|
||
export function getIssueAreaChoiceLabels(): IssueAreaChoiceLabels { | ||
return { | ||
HOME: "Entire home and hallways", | ||
BEDROOMS: "Bedrooms", | ||
KITCHEN: "Kitchen", | ||
LIVING_ROOM: "Living room", | ||
BATHROOMS: "Bathrooms", | ||
PUBLIC_AREAS: "Public areas", | ||
}; | ||
} |
Oops, something went wrong.