{"action":"created","issue":{"url":"https://api.github.com/repos/ghiscoding/aurelia-slickgrid/issues/22","repository_url":"https://api.github.com/repos/ghiscoding/aurelia-slickgrid","labels_url":"https://api.github.com/repos/ghiscoding/aurelia-slickgrid/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/ghiscoding/aurelia-slickgrid/issues/22/comments","events_url":"https://api.github.com/repos/ghiscoding/aurelia-slickgrid/issues/22/events","html_url":"https://github.com/ghiscoding/aurelia-slickgrid/pull/22","id":302022796,"number":22,"title":"feat(selectEditors): add select grid editors","user":{"login":"jmzagorski","id":8404957,"avatar_url":"https://avatars2.githubusercontent.com/u/8404957?v=4","gravatar_id":"","url":"https://api.github.com/users/jmzagorski","html_url":"https://github.com/jmzagorski","followers_url":"https://api.github.com/users/jmzagorski/followers","following_url":"https://api.github.com/users/jmzagorski/following{/other_user}","gists_url":"https://api.github.com/users/jmzagorski/gists{/gist_id}","starred_url":"https://api.github.com/users/jmzagorski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmzagorski/subscriptions","organizations_url":"https://api.github.com/users/jmzagorski/orgs","repos_url":"https://api.github.com/users/jmzagorski/repos","events_url":"https://api.github.com/users/jmzagorski/events{/privacy}","received_events_url":"https://api.github.com/users/jmzagorski/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-03-03T18:54:03Z","updated_at":"2018-03-03T21:49:22Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/ghiscoding/aurelia-slickgrid/pulls/22","html_url":"https://github.com/ghiscoding/aurelia-slickgrid/pull/22","diff_url":"https://github.com/ghiscoding/aurelia-slickgrid/pull/22.diff","patch_url":"https://github.com/ghiscoding/aurelia-slickgrid/pull/22.patch"},"body":"This pull request brings two new editors and one small change and should close https://github.com/ghiscoding/aurelia-slickgrid/issues/18\r\n\r\n**Purpose**\r\nSelect editors are very common with data to ensure data integrity and we already provide these are header filters.\r\n\r\n**Features**\r\n1. SelectListEditor - this editor uses most of the logic from the `SelectListFilter`. If the developer does not use `multiple-select` library, this editor falls back to a bootstrap `form-control`. For this to render property in the grid a new css rules was added.\r\n2. MultipleSelectListEditor - this editor uses most of the logic from the `MultipleSelectListFilter`. If the developer does not use `multiple-select` library, this editor falls back to a bootstrap `form-control`\r\n3. CollectionFormatter - the formatter will lookup the `label` value in the `filter.collection` based on the value passed into the formatter. If it is an array, it will use the `arrayToCsvFormatter`\r\n4. arraysEqual- a utility function to compare all values in an array for the `MultipleSelectListEditor`\r\n5. Array.prototype.findOrDefault - An extension function to make code look cleaner especially when finding complex objects. If `find` returns undefined the consumer of this function can still safely try and access the property since by default the returned value is an empty object.\r\n\r\n**Changes**\r\n1. The arrayToCsvFormatter was changed to a span with a title in cases where the csv string is too long to show all values\r\n\r\n**Tests**\r\nI didn't start creating unit tests yet because `aurelia-pal-nodejs` needs to be updated because of this fix https://github.com/aurelia/pal-nodejs/issues/24 and another error i need to research about imports. Therefore, I manually tested with example 3 by changing the editor on the effort-driven column and adding/removing the multiple-select lib. \r\n\r\n**Comments**\r\n1. (Future) We could probably improve the logic `this.labelName = (this.columnDef.filter.customStructure) ? this.columnDef.filter.customStructure.label : 'label';` since it is referenced in 3 files now. We could have a default `columnDef.filter` object that ensures the `customStructure` is always there.\r\n2. (Future) We could refactor the logic to create the select DOM element since it is the same in the `Filter` and `Editor` or just wait to see if we can/want to suppose templates"},"comment":{"url":"https://api.github.com/repos/ghiscoding/aurelia-slickgrid/issues/comments/370182553","html_url":"https://github.com/ghiscoding/aurelia-slickgrid/pull/22#issuecomment-370182553","issue_url":"https://api.github.com/repos/ghiscoding/aurelia-slickgrid/issues/22","id":370182553,"user":{"login":"jmzagorski","id":8404957,"avatar_url":"https://avatars2.githubusercontent.com/u/8404957?v=4","gravatar_id":"","url":"https://api.github.com/users/jmzagorski","html_url":"https://github.com/jmzagorski","followers_url":"https://api.github.com/users/jmzagorski/followers","following_url":"https://api.github.com/users/jmzagorski/following{/other_user}","gists_url":"https://api.github.com/users/jmzagorski/gists{/gist_id}","starred_url":"https://api.github.com/users/jmzagorski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmzagorski/subscriptions","organizations_url":"https://api.github.com/users/jmzagorski/orgs","repos_url":"https://api.github.com/users/jmzagorski/repos","events_url":"https://api.github.com/users/jmzagorski/events{/privacy}","received_events_url":"https://api.github.com/users/jmzagorski/received_events","type":"User","site_admin":false},"created_at":"2018-03-03T21:49:22Z","updated_at":"2018-03-03T21:49:22Z","author_association":"COLLABORATOR","body":"added the `SingleSelectEditor` to the `% complete` and `MultipleSelectEditor` to a new `Prerequisites` column (it is the only new column I could think of that would have multiple values).\r\n\r\nFrom the looks of it, I do not think the `setValues` needs to be in these editors after something changes in the grid since the editor is only active when a user interacts with the cell. You should be able to move a column and the editor should work the same. I have no experience yet with presets so you might want to test that example."}}
{"actor":{"display_login":"jmzagorski"}}