-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Initials for phone numbers #4376
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
Merged
dzearing
merged 6 commits into
microsoft:master
from
naitsirk-zz:initials-for-phonenumbers
Mar 28, 2018
Merged
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
de9a4b0
Merge pull request #1 from OfficeDev/master
naitsirk d50184d
Adding option for calculating initials for phone numbers
naitsirk dd81993
Added change description
naitsirk 55ab31b
Name change and cleanup
naitsirk 1ca457a
Update initials-for-phonenumbers_2018-03-27-14-10.json
dzearing 1302945
Update initials-for-phonenumbers_2018-03-27-14-10.json
dzearing File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
common/changes/@uifabric/utilities/initials-for-phonenumbers_2018-03-27-14-10.json
This file contains hidden or 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,11 @@ | ||
| { | ||
| "changes": [ | ||
| { | ||
| "packageName": "@uifabric/utilities", | ||
| "comment": "Add new option to calculate initials for phone numbers: calculateInitialsForPhoneNumber", | ||
| "type": "minor" | ||
| } | ||
| ], | ||
| "packageName": "@uifabric/utilities", | ||
| "email": "[email protected]" | ||
| } |
11 changes: 11 additions & 0 deletions
11
common/changes/office-ui-fabric-react/initials-for-phonenumbers_2018-03-27-14-10.json
This file contains hidden or 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,11 @@ | ||
| { | ||
| "changes": [ | ||
| { | ||
| "packageName": "office-ui-fabric-react", | ||
| "comment": "Add new option for Persona control to calculate initials for phone numbers: calculateInitialsForPhoneNumber", | ||
| "type": "minor" | ||
| } | ||
| ], | ||
| "packageName": "office-ui-fabric-react", | ||
| "email": "[email protected]" | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
that's oddly specific to phone numbers. Would it be more straightforward to call it
allowNumberInitials?Also it might be a good idea to describe in the comments what special exception scenarios might be appropriate for allowing this. (Projects which start with a number, Personas which represent a phone number...)
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.
The code logic itself uses the concept of phone numbers, supporting the "ext" and "x" extension syntax in US numbers in the regular expression. The property can only consist of numbers, except for the optional "x" or "ext" at the end, after all special characters have been removed.
So without this change, "1234" will be seen as a phone number with empty initials. "1234A" will not be seen as a phone number, with initials "1", With this change, and setting calculateInitialsForPhoneNumber to true, "1234" would also get initials "1".
I agree that calculateInitialsForPhoneNumber is very specific. But allowNumberInitials doesn't quite capture the logic either, as without this fix, a contact with name "1 2A" would still get initials "12", so number only initials is already supported.
What we want to support is that values representing what we believe are phone numbers (only numbers with an optional "x" or "ext" at the end followed by more numbers) can either get empty initials or normal initials. The use case is values representing project names which are incorrectly interpreted as phone numbers (and given no initials).
I'm in no way married to the calculateInitialsForPhoneNumber name :-)
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.
ok gotcha. What about
allowPhoneInitials? A little shorter?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.
Renamed. Also added more context to the comments. Ok to use "numbers", or should I use the more correct term "numerals"?