-
Notifications
You must be signed in to change notification settings - Fork 2
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
change how we title-case #3
change how we title-case #3
Conversation
addon/services/frost-page-title.js
Outdated
@@ -44,7 +44,12 @@ export default Service.extend({ | |||
.filter(section => !/[^A-Za-z-]/.test(section)) | |||
.map(section => { | |||
return section.split('-') | |||
.map(word => EmberString.capitalize(word)) | |||
.map((word, idx) => { |
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.
If it's only Capitalizing the first word can we avoid the map, otherwise just looping through all the words for no reason?
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.
yup - thanks
docs/frost-page-title.md
Outdated
@@ -19,10 +19,12 @@ The simplest way to use the frost-page-title `addon` is to add __ember-frost-pag | |||
// config/environment.js | |||
... | |||
APP: { | |||
'frost-page-title-default': 'My App' | |||
'frost-page-title-delimiter': '🍺' | |||
frostPageTitle: { |
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.
My preference leans towards frost-page-title
which is the convention seen most often in the Ember ecosystem (ember-cli-mirage
, ember-cli-deploy
, ember-simple-auth
, etc, as well as our own https://github.com/ciena-frost/ember-frost-core/blob/master/docs/frost-icons.md#addon-icon-packs). Which do you prefer @juwara0 ?
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 like frost-page-title, but as its own namespace
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.
Oh sorry, yes, I agree. I just wasn't clear.
{
'frost-page-title': {
default: '',
delimiter: ''
}
my example doesn't use title-
as a preface which is cleaner, but not sure if default
makes sense then - maybe title
?
We're on the same page so whatever you roll with.
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.
Yeah - I think that stays defaultTitle
. I don't honestly care any which way - but it is nice to get it into a namespace, as we may have other options to add later.
|
Replace https://github.com/gkchestertron/ember-frost-page-title/blob/c09f505e9d9d333927655d775c83e328115cd022/addon/services/frost-page-title.js#L64 with |
Don't know if you'd want to replace https://github.com/gkchestertron/ember-frost-page-title/blob/c09f505e9d9d333927655d775c83e328115cd022/addon/services/frost-page-title.js#L62-L64 with
|
What are your thoughts on
I could go either way (though slightly prefer the ternary more) |
I like the ternary. I generally avoid them unless they actually seem clearer and are unlikely to be added to. They can get unreadable quick. But this seems like a fine case for it. |
@gkchestertron remember to coordinate with @juwara0 or myself before merging this PR (temporary requirement) |
Overview
Does this PR close an existing issue?
No PR should be opened without opening an issue first. Any change needs to be discussed before proceeding.
Summary
Provide a general summary of the issue addressed in the title above
Issue Number(s)
Which issue(s) does this PR address?
Put
Closes #XXXX
below to auto-close the issue that this PR addresses:Screenshots or recordings
Please provide screenshots or recordings if this PR is modifying the visual UI or UX.
Checklist
Semver
This project uses semver, please check the scope of this PR:
Examples:
ember-hook
selectorsember-hook
selectorsCHANGELOG