{"action":"created","issue":{"url":"https://api.github.com/repos/mvysny/vaadin-on-kotlin/issues/18","repository_url":"https://api.github.com/repos/mvysny/vaadin-on-kotlin","labels_url":"https://api.github.com/repos/mvysny/vaadin-on-kotlin/issues/18/labels{/name}","comments_url":"https://api.github.com/repos/mvysny/vaadin-on-kotlin/issues/18/comments","events_url":"https://api.github.com/repos/mvysny/vaadin-on-kotlin/issues/18/events","html_url":"https://github.com/mvysny/vaadin-on-kotlin/issues/18","id":304185924,"number":18,"title":"DataProvider and() is confusing since it produces a NEW DataProvider","user":{"login":"mvysny","id":254091,"avatar_url":"https://avatars3.githubusercontent.com/u/254091?v=4","gravatar_id":"","url":"https://api.github.com/users/mvysny","html_url":"https://github.com/mvysny","followers_url":"https://api.github.com/users/mvysny/followers","following_url":"https://api.github.com/users/mvysny/following{/other_user}","gists_url":"https://api.github.com/users/mvysny/gists{/gist_id}","starred_url":"https://api.github.com/users/mvysny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mvysny/subscriptions","organizations_url":"https://api.github.com/users/mvysny/orgs","repos_url":"https://api.github.com/users/mvysny/repos","events_url":"https://api.github.com/users/mvysny/events{/privacy}","received_events_url":"https://api.github.com/users/mvysny/received_events","type":"User","site_admin":false},"labels":[{"id":357587324,"url":"https://api.github.com/repos/mvysny/vaadin-on-kotlin/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"closed","locked":false,"assignee":{"login":"mvysny","id":254091,"avatar_url":"https://avatars3.githubusercontent.com/u/254091?v=4","gravatar_id":"","url":"https://api.github.com/users/mvysny","html_url":"https://github.com/mvysny","followers_url":"https://api.github.com/users/mvysny/followers","following_url":"https://api.github.com/users/mvysny/following{/other_user}","gists_url":"https://api.github.com/users/mvysny/gists{/gist_id}","starred_url":"https://api.github.com/users/mvysny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mvysny/subscriptions","organizations_url":"https://api.github.com/users/mvysny/orgs","repos_url":"https://api.github.com/users/mvysny/repos","events_url":"https://api.github.com/users/mvysny/events{/privacy}","received_events_url":"https://api.github.com/users/mvysny/received_events","type":"User","site_admin":false},"assignees":[{"login":"mvysny","id":254091,"avatar_url":"https://avatars3.githubusercontent.com/u/254091?v=4","gravatar_id":"","url":"https://api.github.com/users/mvysny","html_url":"https://github.com/mvysny","followers_url":"https://api.github.com/users/mvysny/followers","following_url":"https://api.github.com/users/mvysny/following{/other_user}","gists_url":"https://api.github.com/users/mvysny/gists{/gist_id}","starred_url":"https://api.github.com/users/mvysny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mvysny/subscriptions","organizations_url":"https://api.github.com/users/mvysny/orgs","repos_url":"https://api.github.com/users/mvysny/repos","events_url":"https://api.github.com/users/mvysny/events{/privacy}","received_events_url":"https://api.github.com/users/mvysny/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2018-03-11T19:26:32Z","updated_at":"2018-03-12T16:07:05Z","closed_at":"2018-03-12T16:05:37Z","author_association":"OWNER","body":"It's not clear from the `and()` method name that a new DP is produced by the call. That is also the case of `configurableFilter()`.\r\n\r\nPerhaps the data providers offered from the entities should be configurable right from the start. That makes sense since then filter components can directly set filters to those data providers, without having to call the confusing `configurableFilter()` method. That would also allow us to call `setFilter()` directly which makes sense.\r\n\r\nWhen a function creates a new instance, it is typically prefixed with `with`. Hence the `configurableFilter()` should be renamed to `withConfigurableFilter()`. Also, the `and()` should be renamed to `withFilter()`.\r\n\r\nWith these changes, current use-cases of creating a grid with filtered items are still valid, for example:\r\n\r\n```kotlin\r\npersonGrid = grid(Person::class, dataProvider = Person.dataProvider) {\r\n  // since dataProvider is configurable, the generateFilterComponents() function will work properly\r\n}\r\n```\r\n\r\nalso\r\n\r\n```kotlin\r\npersonGrid = grid(Person::class, dataProvider = Person.dataProvider.withFilter { Person::age between 20..60 })\r\n```\r\n\r\nor\r\n\r\n```kotlin\r\npersonGrid = grid(Person::class, dataProvider = Person.dataProvider.apply { setFilter { Person::age between 20..60 }})\r\n```\r\n\r\nHowever, there is now a problem that the generated filter bar will silently overwrite the initial filter set by the programmer ..."},"comment":{"url":"https://api.github.com/repos/mvysny/vaadin-on-kotlin/issues/comments/372364746","html_url":"https://github.com/mvysny/vaadin-on-kotlin/issues/18#issuecomment-372364746","issue_url":"https://api.github.com/repos/mvysny/vaadin-on-kotlin/issues/18","id":372364746,"user":{"login":"mvysny","id":254091,"avatar_url":"https://avatars3.githubusercontent.com/u/254091?v=4","gravatar_id":"","url":"https://api.github.com/users/mvysny","html_url":"https://github.com/mvysny","followers_url":"https://api.github.com/users/mvysny/followers","following_url":"https://api.github.com/users/mvysny/following{/other_user}","gists_url":"https://api.github.com/users/mvysny/gists{/gist_id}","starred_url":"https://api.github.com/users/mvysny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mvysny/subscriptions","organizations_url":"https://api.github.com/users/mvysny/orgs","repos_url":"https://api.github.com/users/mvysny/repos","events_url":"https://api.github.com/users/mvysny/events{/privacy}","received_events_url":"https://api.github.com/users/mvysny/received_events","type":"User","site_admin":false},"created_at":"2018-03-12T16:07:05Z","updated_at":"2018-03-12T16:07:05Z","author_association":"OWNER","body":"OK, removed `and` and introduced `withFilter` and `setFilter`; now generated filters won't overwrite the filter set in stone by the programmer using the `withFilter`. Much better :)\r\n\r\nFixed in VoK 0.4.3"}}
{"actor":{"display_login":"mvysny"}}