Skip to content

Commit

Permalink
18469 Capitalize AGM in output titles (bcgov#581)
Browse files Browse the repository at this point in the history
- app version = 7.0.11
- added missing cases for AGM filings
- added special case to convert "Agm" to "AGM"
- fixed a lint warning
  • Loading branch information
severinbeauvais authored and JazzarKarim committed Jan 27, 2024
1 parent 039d828 commit 88a37fc
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "business-filings-ui",
"version": "7.0.10",
"version": "7.0.11",
"private": true,
"appName": "Filings UI",
"sbcName": "SBC Common Components",
Expand Down
8 changes: 6 additions & 2 deletions src/services/enum-utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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')
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/services/legal-services.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Libraries
import axios from '@/axios-auth'
import { AxiosResponse } from 'axios'
import { ApiBusinessIF, ApiFilingIF, CommentIF, DocumentIF, FetchDocumentsIF, NameRequestIF,
PresignedUrlIF } from '@/interfaces'
import { ApiBusinessIF, ApiFilingIF, CommentIF, DocumentIF, FetchDocumentsIF, PresignedUrlIF }
from '@/interfaces'
import { DigitalCredentialTypes, FilingStatus, Roles } from '@/enums'
import { StatusCodes } from 'http-status-codes'

Expand Down

0 comments on commit 88a37fc

Please sign in to comment.