{"action":"created","comment":{"url":"https://api.github.com/repos/netlify/netlify-cms/pulls/comments/213688517","pull_request_review_id":150574794,"id":213688517,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMzY4ODUxNw==","diff_hunk":"@@ -0,0 +1,91 @@\n+import { resolveBackend } from '../backend';\n+import registry from 'Lib/registry';\n+\n+jest.mock('Lib/registry');\n+\n+const configWrapper = inputObject => ({\n+  get: prop => inputObject[prop],\n+});\n+\n+describe('Backend', () => {\n+  describe('filterEntries', () => {\n+    let backend;\n+\n+    beforeEach(() => {\n+      registry.getBackend.mockReturnValue({\n+        init: jest.fn(),\n+      });\n+      backend = resolveBackend({\n+        getIn: jest.fn().mockReturnValue('git-gateway'),\n+      });\n+    });\n+\n+    it('filters string values', () => {\n+      const result = backend.filterEntries(\n+        {\n+          entries: [\n+            {\n+              data: {\n+                testField: 'testValue',\n+              },\n+            },\n+          ],\n+        },\n+        configWrapper({ field: 'testField', value: 'testValue' }),\n+      );\n+\n+      expect(result.length).toBe(1);\n+    });\n+\n+    it('filters number values', () => {\n+      const result = backend.filterEntries(\n+        {\n+          entries: [\n+            {\n+              data: {\n+                testField: 42,\n+              },\n+            },","path":"packages/netlify-cms-core/src/__tests__/backend.spec.js","position":48,"original_position":48,"commit_id":"ccefb77e3866bdae047b4c966698c4a627075848","original_commit_id":"ccefb77e3866bdae047b4c966698c4a627075848","user":{"login":"jbutz","id":736696,"node_id":"MDQ6VXNlcjczNjY5Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/736696?v=4","gravatar_id":"","url":"https://api.github.com/users/jbutz","html_url":"https://github.com/jbutz","followers_url":"https://api.github.com/users/jbutz/followers","following_url":"https://api.github.com/users/jbutz/following{/other_user}","gists_url":"https://api.github.com/users/jbutz/gists{/gist_id}","starred_url":"https://api.github.com/users/jbutz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbutz/subscriptions","organizations_url":"https://api.github.com/users/jbutz/orgs","repos_url":"https://api.github.com/users/jbutz/repos","events_url":"https://api.github.com/users/jbutz/events{/privacy}","received_events_url":"https://api.github.com/users/jbutz/received_events","type":"User","site_admin":false},"body":"Good point, I'll add that as soon as I get a chance","created_at":"2018-08-29T13:59:18Z","updated_at":"2018-08-29T13:59:18Z","html_url":"https://github.com/netlify/netlify-cms/pull/1578#discussion_r213688517","pull_request_url":"https://api.github.com/repos/netlify/netlify-cms/pulls/1578","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/netlify/netlify-cms/pulls/comments/213688517"},"html":{"href":"https://github.com/netlify/netlify-cms/pull/1578#discussion_r213688517"},"pull_request":{"href":"https://api.github.com/repos/netlify/netlify-cms/pulls/1578"}},"in_reply_to_id":213017174},"pull_request":{"url":"https://api.github.com/repos/netlify/netlify-cms/pulls/1578","id":206089595,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA2MDg5NTk1","html_url":"https://github.com/netlify/netlify-cms/pull/1578","diff_url":"https://github.com/netlify/netlify-cms/pull/1578.diff","patch_url":"https://github.com/netlify/netlify-cms/pull/1578.patch","issue_url":"https://api.github.com/repos/netlify/netlify-cms/issues/1578","number":1578,"state":"open","locked":false,"title":"Support Filtering Entries On List Fields","user":{"login":"jbutz","id":736696,"node_id":"MDQ6VXNlcjczNjY5Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/736696?v=4","gravatar_id":"","url":"https://api.github.com/users/jbutz","html_url":"https://github.com/jbutz","followers_url":"https://api.github.com/users/jbutz/followers","following_url":"https://api.github.com/users/jbutz/following{/other_user}","gists_url":"https://api.github.com/users/jbutz/gists{/gist_id}","starred_url":"https://api.github.com/users/jbutz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbutz/subscriptions","organizations_url":"https://api.github.com/users/jbutz/orgs","repos_url":"https://api.github.com/users/jbutz/repos","events_url":"https://api.github.com/users/jbutz/events{/privacy}","received_events_url":"https://api.github.com/users/jbutz/received_events","type":"User","site_admin":false},"body":"<!--\r\nThanks for submitting a pull request!\r\n\r\nPlease make sure you've read and understood our contributing guidelines;\r\nhttps://github.com/netlify/netlify-cms/blob/master/CONTRIBUTING.md\r\n\r\nIf this is a bug fix, make sure your description includes \"fixes #xxxx\", or\r\n\"closes #xxxx\", where #xxxx is the issue number.\r\n\r\nPlease provide enough information so that others can review your pull request.\r\nThe first three fields are mandatory:\r\n-->\r\n\r\n**- Summary**\r\n\r\n<!--\r\nExplain the **motivation** for making this change.\r\nWhat existing problem does the pull request solve?\r\n-->\r\n\r\nWhen setting up a collection for a specific group of files on my site I discovered the `filter` property for collections did not work for fields that are lists. This change will allow filtering on lists when the filter value is one of the values in the list.\r\n\r\n**- Test plan**\r\n\r\n<!--\r\nDemonstrate the code is solid.\r\nExample: The exact commands you ran and their output, screenshots / videos if the pull request changes UI.\r\n-->\r\n\r\nI modified the `dev-test/index.html` and `dev-test/config.yml` files to test this change. My modified files can be found here: https://gist.github.com/jbutz/79a6d2161102187b1fce59f47dd61d58\r\n\r\nI added a new collection titled `FAQ - FILTERED` that has a filter value based on a new field. I added the new field to two of the FAQ documents in `index.html` and I gave one of those documents the value that will match the filter. Below is a screenshot of the result.\r\n\r\n![test-plan-screenshot](https://user-images.githubusercontent.com/736696/43655798-0c0b3208-971e-11e8-98c2-feaf85f3daca.PNG)\r\n\r\n\r\n**- Description for the changelog**\r\n\r\n<!--\r\nWrite a short (one line) summary that describes the changes in this\r\npull request for inclusion in the changelog:\r\n-->\r\nAdd support for filtering collections on list fields\r\n\r\n**- A picture of a cute animal (not mandatory but encouraged)**\r\n\r\nSay hello to Eddy\r\n\r\n![animal](https://user-images.githubusercontent.com/736696/43656027-f6ab6080-971e-11e8-94b5-18ba6b7a6f32.png)\r\n","created_at":"2018-08-03T17:13:35Z","updated_at":"2018-08-29T13:59:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e821959f5b6dce19d12a13796ed5cb3503c606e1","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/netlify/netlify-cms/pulls/1578/commits","review_comments_url":"https://api.github.com/repos/netlify/netlify-cms/pulls/1578/comments","review_comment_url":"https://api.github.com/repos/netlify/netlify-cms/pulls/comments{/number}","comments_url":"https://api.github.com/repos/netlify/netlify-cms/issues/1578/comments","statuses_url":"https://api.github.com/repos/netlify/netlify-cms/statuses/ccefb77e3866bdae047b4c966698c4a627075848","head":{"label":"jbutz:feature/filter-entries-arrays","ref":"feature/filter-entries-arrays","sha":"ccefb77e3866bdae047b4c966698c4a627075848","user":{"login":"jbutz","id":736696,"node_id":"MDQ6VXNlcjczNjY5Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/736696?v=4","gravatar_id":"","url":"https://api.github.com/users/jbutz","html_url":"https://github.com/jbutz","followers_url":"https://api.github.com/users/jbutz/followers","following_url":"https://api.github.com/users/jbutz/following{/other_user}","gists_url":"https://api.github.com/users/jbutz/gists{/gist_id}","starred_url":"https://api.github.com/users/jbutz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbutz/subscriptions","organizations_url":"https://api.github.com/users/jbutz/orgs","repos_url":"https://api.github.com/users/jbutz/repos","events_url":"https://api.github.com/users/jbutz/events{/privacy}","received_events_url":"https://api.github.com/users/jbutz/received_events","type":"User","site_admin":false},"repo":{"id":143444771,"node_id":"MDEwOlJlcG9zaXRvcnkxNDM0NDQ3NzE=","name":"netlify-cms","full_name":"jbutz/netlify-cms","owner":{"login":"jbutz","id":736696,"node_id":"MDQ6VXNlcjczNjY5Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/736696?v=4","gravatar_id":"","url":"https://api.github.com/users/jbutz","html_url":"https://github.com/jbutz","followers_url":"https://api.github.com/users/jbutz/followers","following_url":"https://api.github.com/users/jbutz/following{/other_user}","gists_url":"https://api.github.com/users/jbutz/gists{/gist_id}","starred_url":"https://api.github.com/users/jbutz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbutz/subscriptions","organizations_url":"https://api.github.com/users/jbutz/orgs","repos_url":"https://api.github.com/users/jbutz/repos","events_url":"https://api.github.com/users/jbutz/events{/privacy}","received_events_url":"https://api.github.com/users/jbutz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jbutz/netlify-cms","description":"A CMS for Static Site Generators","fork":true,"url":"https://api.github.com/repos/jbutz/netlify-cms","forks_url":"https://api.github.com/repos/jbutz/netlify-cms/forks","keys_url":"https://api.github.com/repos/jbutz/netlify-cms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jbutz/netlify-cms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jbutz/netlify-cms/teams","hooks_url":"https://api.github.com/repos/jbutz/netlify-cms/hooks","issue_events_url":"https://api.github.com/repos/jbutz/netlify-cms/issues/events{/number}","events_url":"https://api.github.com/repos/jbutz/netlify-cms/events","assignees_url":"https://api.github.com/repos/jbutz/netlify-cms/assignees{/user}","branches_url":"https://api.github.com/repos/jbutz/netlify-cms/branches{/branch}","tags_url":"https://api.github.com/repos/jbutz/netlify-cms/tags","blobs_url":"https://api.github.com/repos/jbutz/netlify-cms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jbutz/netlify-cms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jbutz/netlify-cms/git/refs{/sha}","trees_url":"https://api.github.com/repos/jbutz/netlify-cms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jbutz/netlify-cms/statuses/{sha}","languages_url":"https://api.github.com/repos/jbutz/netlify-cms/languages","stargazers_url":"https://api.github.com/repos/jbutz/netlify-cms/stargazers","contributors_url":"https://api.github.com/repos/jbutz/netlify-cms/contributors","subscribers_url":"https://api.github.com/repos/jbutz/netlify-cms/subscribers","subscription_url":"https://api.github.com/repos/jbutz/netlify-cms/subscription","commits_url":"https://api.github.com/repos/jbutz/netlify-cms/commits{/sha}","git_commits_url":"https://api.github.com/repos/jbutz/netlify-cms/git/commits{/sha}","comments_url":"https://api.github.com/repos/jbutz/netlify-cms/comments{/number}","issue_comment_url":"https://api.github.com/repos/jbutz/netlify-cms/issues/comments{/number}","contents_url":"https://api.github.com/repos/jbutz/netlify-cms/contents/{+path}","compare_url":"https://api.github.com/repos/jbutz/netlify-cms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jbutz/netlify-cms/merges","archive_url":"https://api.github.com/repos/jbutz/netlify-cms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jbutz/netlify-cms/downloads","issues_url":"https://api.github.com/repos/jbutz/netlify-cms/issues{/number}","pulls_url":"https://api.github.com/repos/jbutz/netlify-cms/pulls{/number}","milestones_url":"https://api.github.com/repos/jbutz/netlify-cms/milestones{/number}","notifications_url":"https://api.github.com/repos/jbutz/netlify-cms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jbutz/netlify-cms/labels{/name}","releases_url":"https://api.github.com/repos/jbutz/netlify-cms/releases{/id}","deployments_url":"https://api.github.com/repos/jbutz/netlify-cms/deployments","created_at":"2018-08-03T15:36:36Z","updated_at":"2018-08-22T18:06:56Z","pushed_at":"2018-08-22T18:09:33Z","git_url":"git://github.com/jbutz/netlify-cms.git","ssh_url":"git@github.com:jbutz/netlify-cms.git","clone_url":"https://github.com/jbutz/netlify-cms.git","svn_url":"https://github.com/jbutz/netlify-cms","homepage":"https://www.netlifycms.org","size":20984,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"netlify:master","ref":"master","sha":"a4ba66e1a6ce52c808d2dcbbd676592ca6fe18e6","user":{"login":"netlify","id":7892489,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc4OTI0ODk=","avatar_url":"https://avatars1.githubusercontent.com/u/7892489?v=4","gravatar_id":"","url":"https://api.github.com/users/netlify","html_url":"https://github.com/netlify","followers_url":"https://api.github.com/users/netlify/followers","following_url":"https://api.github.com/users/netlify/following{/other_user}","gists_url":"https://api.github.com/users/netlify/gists{/gist_id}","starred_url":"https://api.github.com/users/netlify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/netlify/subscriptions","organizations_url":"https://api.github.com/users/netlify/orgs","repos_url":"https://api.github.com/users/netlify/repos","events_url":"https://api.github.com/users/netlify/events{/privacy}","received_events_url":"https://api.github.com/users/netlify/received_events","type":"Organization","site_admin":false},"repo":{"id":29514104,"node_id":"MDEwOlJlcG9zaXRvcnkyOTUxNDEwNA==","name":"netlify-cms","full_name":"netlify/netlify-cms","owner":{"login":"netlify","id":7892489,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc4OTI0ODk=","avatar_url":"https://avatars1.githubusercontent.com/u/7892489?v=4","gravatar_id":"","url":"https://api.github.com/users/netlify","html_url":"https://github.com/netlify","followers_url":"https://api.github.com/users/netlify/followers","following_url":"https://api.github.com/users/netlify/following{/other_user}","gists_url":"https://api.github.com/users/netlify/gists{/gist_id}","starred_url":"https://api.github.com/users/netlify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/netlify/subscriptions","organizations_url":"https://api.github.com/users/netlify/orgs","repos_url":"https://api.github.com/users/netlify/repos","events_url":"https://api.github.com/users/netlify/events{/privacy}","received_events_url":"https://api.github.com/users/netlify/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/netlify/netlify-cms","description":"A CMS for Static Site Generators","fork":false,"url":"https://api.github.com/repos/netlify/netlify-cms","forks_url":"https://api.github.com/repos/netlify/netlify-cms/forks","keys_url":"https://api.github.com/repos/netlify/netlify-cms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/netlify/netlify-cms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/netlify/netlify-cms/teams","hooks_url":"https://api.github.com/repos/netlify/netlify-cms/hooks","issue_events_url":"https://api.github.com/repos/netlify/netlify-cms/issues/events{/number}","events_url":"https://api.github.com/repos/netlify/netlify-cms/events","assignees_url":"https://api.github.com/repos/netlify/netlify-cms/assignees{/user}","branches_url":"https://api.github.com/repos/netlify/netlify-cms/branches{/branch}","tags_url":"https://api.github.com/repos/netlify/netlify-cms/tags","blobs_url":"https://api.github.com/repos/netlify/netlify-cms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/netlify/netlify-cms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/netlify/netlify-cms/git/refs{/sha}","trees_url":"https://api.github.com/repos/netlify/netlify-cms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/netlify/netlify-cms/statuses/{sha}","languages_url":"https://api.github.com/repos/netlify/netlify-cms/languages","stargazers_url":"https://api.github.com/repos/netlify/netlify-cms/stargazers","contributors_url":"https://api.github.com/repos/netlify/netlify-cms/contributors","subscribers_url":"https://api.github.com/repos/netlify/netlify-cms/subscribers","subscription_url":"https://api.github.com/repos/netlify/netlify-cms/subscription","commits_url":"https://api.github.com/repos/netlify/netlify-cms/commits{/sha}","git_commits_url":"https://api.github.com/repos/netlify/netlify-cms/git/commits{/sha}","comments_url":"https://api.github.com/repos/netlify/netlify-cms/comments{/number}","issue_comment_url":"https://api.github.com/repos/netlify/netlify-cms/issues/comments{/number}","contents_url":"https://api.github.com/repos/netlify/netlify-cms/contents/{+path}","compare_url":"https://api.github.com/repos/netlify/netlify-cms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/netlify/netlify-cms/merges","archive_url":"https://api.github.com/repos/netlify/netlify-cms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/netlify/netlify-cms/downloads","issues_url":"https://api.github.com/repos/netlify/netlify-cms/issues{/number}","pulls_url":"https://api.github.com/repos/netlify/netlify-cms/pulls{/number}","milestones_url":"https://api.github.com/repos/netlify/netlify-cms/milestones{/number}","notifications_url":"https://api.github.com/repos/netlify/netlify-cms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/netlify/netlify-cms/labels{/name}","releases_url":"https://api.github.com/repos/netlify/netlify-cms/releases{/id}","deployments_url":"https://api.github.com/repos/netlify/netlify-cms/deployments","created_at":"2015-01-20T05:47:47Z","updated_at":"2018-08-29T10:14:23Z","pushed_at":"2018-08-28T22:56:05Z","git_url":"git://github.com/netlify/netlify-cms.git","ssh_url":"git@github.com:netlify/netlify-cms.git","clone_url":"https://github.com/netlify/netlify-cms.git","svn_url":"https://github.com/netlify/netlify-cms","homepage":"https://www.netlifycms.org","size":21292,"stargazers_count":6141,"watchers_count":6141,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":883,"mirror_url":null,"archived":false,"open_issues_count":327,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":883,"open_issues":327,"watchers":6141,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/netlify/netlify-cms/pulls/1578"},"html":{"href":"https://github.com/netlify/netlify-cms/pull/1578"},"issue":{"href":"https://api.github.com/repos/netlify/netlify-cms/issues/1578"},"comments":{"href":"https://api.github.com/repos/netlify/netlify-cms/issues/1578/comments"},"review_comments":{"href":"https://api.github.com/repos/netlify/netlify-cms/pulls/1578/comments"},"review_comment":{"href":"https://api.github.com/repos/netlify/netlify-cms/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/netlify/netlify-cms/pulls/1578/commits"},"statuses":{"href":"https://api.github.com/repos/netlify/netlify-cms/statuses/ccefb77e3866bdae047b4c966698c4a627075848"}},"author_association":"NONE"}}
{"actor":{"display_login":"jbutz"}}