-
Notifications
You must be signed in to change notification settings - Fork 52
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
18469 Capitalize AGM in output titles #581
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -299,6 +299,8 @@ export default class EnumUtilities { | |
case FilingTypes.ADMIN_FREEZE: | ||
// FUTURE: add freeze/unfreeze checks here | ||
return FilingNames.ADMIN_FREEZE | ||
case FilingTypes.AGM_EXTENSION: return FilingNames.AGM_EXTENSION | ||
case FilingTypes.AGM_LOCATION_CHANGE: return FilingNames.AGM_LOCATION_CHANGE | ||
case FilingTypes.ALTERATION: return FilingNames.ALTERATION | ||
case FilingTypes.ANNUAL_REPORT: return FilingNames.ANNUAL_REPORT + (agmYear ? ` (${agmYear})` : '') | ||
case FilingTypes.CHANGE_OF_ADDRESS: return FilingNames.CHANGE_OF_ADDRESS | ||
|
@@ -332,13 +334,15 @@ export default class EnumUtilities { | |
} | ||
|
||
/** | ||
* Converts a string in "camelCase" (or "PascalCase") to separate, title-case words, | ||
* Converts a string in "camelCase" (or "PascalCase") to a string of separate, title-case words, | ||
* suitable for a title or proper name. | ||
* @param s the string to convert | ||
* @returns the converted string | ||
*/ | ||
static camelCaseToWords (s: string): string { | ||
return s?.split(/(?=[A-Z])/).join(' ').replace(/^\w/, c => c.toUpperCase()) || '' | ||
const words = s?.split(/(?=[A-Z])/).join(' ').replace(/^\w/, c => c.toUpperCase()) || '' | ||
// SPECIAL CASE: convert 'Agm' to uppercase | ||
return words.replace('Agm', 'AGM') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The alternative is a large effort to include the document name in the API response (requiring API work and possibly informing third parties/delays) and then use that. This is a special case, but it's a simple one, and we could add more here if needed, so I think it's not the best solution but it's a solution we can afford and it's functional and understandable and safe. Thoughts? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's OK for now Sev. If more and more arise in the future, then we can think about going the long and hard way. |
||
} | ||
|
||
/** | ||
|
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.
I think this method isn't currently used for the AGM filings, but it's better for this method to be complete anyway.