Conversation
4fd643c to
e9d4e82
Compare
| <div class="contacts-list" ng-class="{loading: ctrl.loading, 'mobile-show': ctrl.show}"> | ||
| <div class="app-content-list-item" | ||
| ng-repeat="contact in ctrl.filteredContacts = (ctrl.contactList | contactGroupFilter:ctrl.routeParams.gid | localeOrderBy:ctrl.sortBy | filter:query | limitTo:ctrl.limitTo ) as filtered track by contact.uid()" | ||
| ng-repeat="contact in ctrl.filteredContacts = (ctrl.contactList | filter:{'data':{'addressBook':{'enabled': true}}} | contactGroupFilter:ctrl.routeParams.gid | localeOrderBy:ctrl.sortBy | filter:query | limitTo:ctrl.limitTo) as filtered track by contact.uid()" |
There was a problem hiding this comment.
As far as I can see, you only store the state in localstorage and don't update it inside the addressbook itself.
This update is only applied on page reload (https://github.com/nextcloud/contacts/pull/412/files#diff-adfefcaa5c468a1b21ca840b249cadcfR14).
Why don't you store it on the server in the first place?
There was a problem hiding this comment.
Should be possible, calendar does it. But they use a property in the 'owncloud' namespace.
<d:propertyupdate xmlns:d="DAV:"><d:set><d:prop><o:calendar-enabled xmlns:o="http://owncloud.org/ns">0</o:calendar-enabled></d:prop></d:set></d:propertyupdate>
@irgendwie Is such a thing possible with our current dav lib?
There was a problem hiding this comment.
Oooh yeah, I remember this! I don't see where it's stored in the db though! :/
There was a problem hiding this comment.
Okay, I needed a patch for the dav lib.
Easy fix now! :)
All good :)
| .factory('AddressBook', function() | ||
| { | ||
| return function AddressBook(data) { | ||
| var storageKey = btoa(data.data.href.split('/').splice(-3, 2).join('_')); |
There was a problem hiding this comment.
This variable isn't used later on.
| readOnly: data.data.props.readOnly === '1', | ||
| // use only owner and url, convert ''/remote.php/dav/addressbooks/users/admin/Test1/'' to 'admin.Test' | ||
| key: data.data.href.split('/').splice(-3, 2).join('_'), | ||
| enabled: window.localStorage.getItem('contacts_ab_'+this.key) !== false, |
There was a problem hiding this comment.
this doesn't work, as localstorage only stores Strings.
=> this statement always evaluates to true.
There was a problem hiding this comment.
Hum, it's strange since it actually remembers the state, so It seems to work :)
| } | ||
| } | ||
| }; | ||
| }); |
There was a problem hiding this comment.
this file shouldn't be in here ;)
| <h2>{{ctrl.t.emptySearch}}</h2> | ||
| </div> | ||
| </div> | ||
| </div> |
|
|
||
| ctrl.toggleState = function() { | ||
| ctrl.enabled = AddressBookService.toggleState(ctrl.addressBook); | ||
| ContactService.fillCache(); |
There was a problem hiding this comment.
It was to force a full refresh of the cache. This pr is still wip, I'm not convinced yet! :)
21bc0b8 to
aa592eb
Compare
Codecov Report
@@ Coverage Diff @@
## master #412 +/- ##
==========================================
- Coverage 16.62% 15.78% -0.85%
==========================================
Files 61 61
Lines 1311 1381 +70
==========================================
Hits 218 218
- Misses 1093 1163 +70
Continue to review full report at Codecov.
|
cd84f74 to
7e80a41
Compare
|
Bump! :) |
|
Works mostly fine. Also moving contacts seems to have a few issues at the moment:
Both of these issues are fixed after reloading the page. @skjnldsv Can you reproduce this? |
|
Let me fix this, and then publish a new version! :) |
cb04df0 to
bb3aef0
Compare
|
@Henni Should be fixed :) Edit: still an issue left:
|
…ot synced Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Add notify on contact import from addressbook Fix Groups update on enabling/disabling Changed default ab to first that is writtable instead of first of the list Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
fixup! Fix contact check add/remove to ab
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
e15dfde to
cbb2864
Compare
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
cbb2864 to
3b03a70
Compare
|
Pfiouuu! Rebased and ready to merge! |
|
Bump? |
irgendwie
left a comment
There was a problem hiding this comment.
Seems to work fine, changes make sense.
|
I just noticed, that i can't disable a shared adressbook. The adressbook is shared to me, disabling the originating adressbook works. Since I'm a newbie can you just give me an advice how to open an issue the right way. Or is just writing this comment enough? |
|
I have also just noticed the same problem as @private-nc-user . It goes like this:
|
|
Yes, you can't disable a shared addressbook as the disabled permission is for the owner of this addressbook :/ |
|
Thanks for the explanation John @skjnldsv. It's just not what we wanted to hear )-: Look at it from the user pov, not the core hacker pov: The address book shared with me by someone else is more likely the one I want to be able to blend out the most, as it does not contain the contacts which I myself have gathered. |
|
I also think that it would benice that if you "disable" a specific address book then the contacts from that address books are simply not shown. I'm currently maintaining about 30 address books that are shared with different groups of users, so it would be nice to "enable" just a single address book to see only the contacts in that address book to maintain those contacts. This is how e.g. the "cardbook" addon for Thunderbird Also, a contact search should only be done in address books that are "enabled". If you disable the address books on the server then other clients will also be unable to sync the contacts from the disabled address books. There may be cases where this is also desired, but usually you can even configure in Android's contact app which address books to synchronize, and addresses from which address books to be displayed in the contacts list. |
|
Very lucid comment from @mburnicki - he says it better than I did. Seconded! What we need is a clear distinction between disabling an address book completely (I never imagined I might not be able to sync it from my Thunderbird if it is disabled in NC GUI display - igitt); and simply removing its data from the current GUI display settings. I would personally not even mind if it were not displayed (or even prefer) but still searchable when I type in part of a name or email, e.g. in the Mail app. What we need to remember is that for some users this hiding of address books in the NC GUI only ever came up as an issue because of the way the app is designed - to always fetch ALL the contacts data to the browser and then implement user display choices in JS. This gives you nifty features for privaze-size address books, but breaks down at around 1000 contacts, becomes too slow to use. So it is not workable for professional-size / team / company address books. Thus I still advocate a choice of "front-end" OR "backend with real infinite scrolling" solutions to display and manage the contacts, see this issue. Quoting from that: What I really miss is the option to select WHICH of those three books are to be displayed in the GUI: I would only really need one in everyday use, the other two are my archive and my girlfriends book, both of which I only seldom need. So imho it was never about disabling an address book completely (although that is also a nice feature), but rather about choosing which to display in the GUI. But a seldom-used address book, which I do not want shown in the GUI, should still be available in the background for syncing or more intensive use by others. Put simply, I just want to choose for myself not to see my girlfriends contacts - I could never tell her to disable her address book. The very minimum we need here is a clear notice in the GUI that disabling an address book will also prevent it from being synced (if I have understood that right). Anyway, thanks to all involved, as ever! |
|
I'll see what I can do, it's maybe doable, I don't know. Can one of you guys open an issue about this? :) |
|
@timreeves @mburnicki thanks for the constructive comments. as @skjnldsv said, please open an issue about this and we see what we can do :) |
Yes, it's always a pleasure to have people like you being so nice and friendly about issues issues! :) |
|
To make sure we don't open two: I'm starting on the new issue now. |
|
@timreeves Thanks. Yesterday I was too busy to do it. |


Fix #36