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

Add sentence case function & rename capitalize #1029

Merged
merged 5 commits into from
May 16, 2024

Conversation

Cruikshanks
Copy link
Member

https://eaflood.atlassian.net/browse/WATER-4315

As part of our work to re-create the communications tab in the view licence page, we needed to display some text from the DB in Sentence case. At the same time, we also needed to capitalize the first character of a word. The superstar @jonathangoulding solved both of these problems in their change.

But wait! We already have a capitalize() method in the base presenter. We were ready to suggest the change when we realised it wouldn't solve the sentence case issue.

Eeek! We need to keep the sentence case solution, but it relies on the title case method @jonathangoulding added.

This change is to sort things out so we can solve the problems in that change. Our reasoning is that if we have a sentenceCase() solution, its ideal home is with similar functions in the base presenter. But it also highlighted that the world refers to what we are currently doing in capitalize() as 'title case'.

So, we rename it as part of this change.

https://eaflood.atlassian.net/browse/WATER-4315

As part of work to re-create the communications tab in the view licence page we needed to display some text from the DB in [Sentence case](https://titlecaseconverter.com/blog/sentence-case-vs-title-case/). At the same time we also needed to capitalize the first character of a word. The superstar @jonathangoulding solved both these problems in their change.

But wait! We already have a `capitalize()` method in the base presenter. We were ready to suggest the change when we realised it wouldn't solve the sentence case issue.

Eeek! We need to keep the sentence case solution but it relies on the title case method @jonathangoulding added.

This change is to sort things out so we can solve the problems in that change. Our reasoning is that if we have a `sentenceCase()` solution its ideal home is with similar functions in the base presenter. But it also highlighted the world refers to what we are currently doing in `capitalize()` as title case.

So, we rename it as part of the change.
Also rename the variable used in the tests.
@Cruikshanks Cruikshanks added the enhancement New feature or request label May 16, 2024
@Cruikshanks Cruikshanks self-assigned this May 16, 2024
@Cruikshanks Cruikshanks marked this pull request as ready for review May 16, 2024 19:25
@Cruikshanks Cruikshanks merged commit f233828 into main May 16, 2024
6 checks passed
@Cruikshanks Cruikshanks deleted the add-sentance-case-function branch May 16, 2024 19:25
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

Successfully merging this pull request may close these issues.

1 participant