-
Notifications
You must be signed in to change notification settings - Fork 169
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
Show fields for phone, email, address and groups by default #259
Conversation
Codecov Report
@@ Coverage Diff @@
## master #259 +/- ##
==========================================
+ Coverage 14.87% 15.16% +0.28%
==========================================
Files 55 52 -3
Lines 1217 1174 -43
==========================================
- Hits 181 178 -3
+ Misses 1036 996 -40
Continue to review full report at Codecov.
|
Hi @xh3n1 two little remarks:
|
See https://help.github.com/articles/closing-issues-using-keywords/ if you hate the word fixes ;) |
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.
This will add the three properties to any contact you view, not only to new ones.
Not sure that's the expected behavior.
Furthermore the pre-selected group issue is not fixed by this.
The expected behavior for the groups is that if you have selected a group in the left sidebar and click "New contact", the new contact is automatically added to the selected group.
50ca43c
to
a5c1c83
Compare
@georgehrke yes that is the expected behavior. :) As these are the 3 most common properties. It's also the behavior of Android and iOS to always have one empty field for those. |
@jancborchardt the field isn't saved empty. @xh3n1'commit will add empty ones in the vcard. |
Right, of course it shouldn’t be saved empty, just displayed empty. A virtual field if you wish. ;) |
@skjnldsv I'm not sure I understand what you are saying, However I think a solution to what I understand is the problem is that there should be no fields saved with empty values. What do you think about this? |
@xh3n1 when you click the new contact button, a new contact is created with the default REQUIRED fields according to the vcard rfc. That being said, if we create a temporary contact without any fields displayed BUT waiting to be synced as soon as the FN (name) field is filled, we could have something viable! :) |
So when I'm creating a contact now the behavior is that it is added to the list of contacts with empty fields and with the name of New contact. The expected behavior is that the new contact is not added until the name is changed from New contact to something else and no fields are saved in it unless they have a non empty string in them as values. Am I correct @skjnldsv ? |
You're correct! 😉 |
hey @skjnldsv can you review it now? |
js/services/contact_service.js
Outdated
@@ -12,6 +12,8 @@ angular.module('contactsApp') | |||
|
|||
var newContactJustAdded = false; | |||
|
|||
var createflag=true; |
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.
Add some space between the =
:)
js/services/contact_service.js
Outdated
notifyObservers('create', newUid); | ||
$('#details-fullName').select(); | ||
return newContact; | ||
if (_.isUndefined(newContact.fullName()) || newContact.fullName() === '') { |
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.
Why not use the condition directly in the if
line 218?
notifyObservers('create', newUid); | ||
$('#details-fullName').select(); | ||
return newContact; | ||
if (!(_.isUndefined(newContact.fullName()) || newContact.fullName() === '')) { |
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 contact will still have a valid fn set at this point. See line 202
if (_.isUndefined(newContact.fullName()) || newContact.fullName() === '') {
newContact.fullName(t('contacts', 'New contact'));
}
@@ -149,7 +156,25 @@ angular.module('contactsApp') | |||
}); | |||
return addressBook | |||
? DavClient.getContacts(addressBook, {}, [ contact.data.url ]).then( | |||
function (vcards) { return new Contact(addressBook, vcards[0]); } | |||
function (vcards) { | |||
|
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.
Do not add unnecessary empty spaces :)
@@ -10,6 +10,9 @@ angular.module('contactsApp') | |||
|
|||
var loadPromise = undefined; | |||
|
|||
var newContactJustAdded = false; | |||
|
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.
Do not add unnecessary empty spaces :)
Okay, I'll list the problem with the creation of a local contact only:
|
Edit: my bad, wrong click! :( |
Seems to not work at the moment? Any updates or known issues? :) |
Issue #253