{"action":"created","issue":{"url":"https://api.github.com/repos/WordPress/gutenberg/issues/7549","repository_url":"https://api.github.com/repos/WordPress/gutenberg","labels_url":"https://api.github.com/repos/WordPress/gutenberg/issues/7549/labels{/name}","comments_url":"https://api.github.com/repos/WordPress/gutenberg/issues/7549/comments","events_url":"https://api.github.com/repos/WordPress/gutenberg/issues/7549/events","html_url":"https://github.com/WordPress/gutenberg/issues/7549","id":335871705,"node_id":"MDU6SXNzdWUzMzU4NzE3MDU=","number":7549,"title":"How can I refresh the sidebar \"PostTaxonomies\" component panels ?","user":{"login":"manooweb","id":1003778,"node_id":"MDQ6VXNlcjEwMDM3Nzg=","avatar_url":"https://avatars3.githubusercontent.com/u/1003778?v=4","gravatar_id":"","url":"https://api.github.com/users/manooweb","html_url":"https://github.com/manooweb","followers_url":"https://api.github.com/users/manooweb/followers","following_url":"https://api.github.com/users/manooweb/following{/other_user}","gists_url":"https://api.github.com/users/manooweb/gists{/gist_id}","starred_url":"https://api.github.com/users/manooweb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manooweb/subscriptions","organizations_url":"https://api.github.com/users/manooweb/orgs","repos_url":"https://api.github.com/users/manooweb/repos","events_url":"https://api.github.com/users/manooweb/events{/privacy}","received_events_url":"https://api.github.com/users/manooweb/received_events","type":"User","site_admin":false},"labels":[{"id":567484057,"node_id":"MDU6TGFiZWw1Njc0ODQwNTc=","url":"https://api.github.com/repos/WordPress/gutenberg/labels/Documentation","name":"Documentation","color":"bfd4f2","default":false},{"id":1020812022,"node_id":"MDU6TGFiZWwxMDIwODEyMDIy","url":"https://api.github.com/repos/WordPress/gutenberg/labels/Needs%20Technical%20Feedback","name":"Needs Technical Feedback","color":"67dff7","default":false},{"id":610403961,"node_id":"MDU6TGFiZWw2MTA0MDM5NjE=","url":"https://api.github.com/repos/WordPress/gutenberg/labels/[Component]%20Post%20Settings","name":"[Component] Post Settings","color":"fbca04","default":false},{"id":808238501,"node_id":"MDU6TGFiZWw4MDgyMzg1MDE=","url":"https://api.github.com/repos/WordPress/gutenberg/labels/[Type]%20Help%20Request","name":"[Type] Help Request","color":"cc317c","default":false},{"id":681487500,"node_id":"MDU6TGFiZWw2ODE0ODc1MDA=","url":"https://api.github.com/repos/WordPress/gutenberg/labels/[Type]%20Plugin%20/%20Theme%20Interoperability","name":"[Type] Plugin / Theme Interoperability","color":"e99695","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-26T15:21:59Z","updated_at":"2018-11-08T16:54:57Z","closed_at":null,"author_association":"NONE","body":"Hello,\r\n\r\nWith Polylang, one of our features refreshes datas in the editor.\r\nWhen you change the language in the Polylang metabox, these datas are refreshed :\r\n* permalink root with the language selected\r\n* categories in the language selected\r\n* autocompletion for tags in the language selected\r\n\r\n# With Classic Editor\r\nSee screenshots below\r\n\r\nBefore changing the language\r\n\r\n![2018-06-26_1405-before-change-language](https://user-images.githubusercontent.com/1003778/41918918-9ba9ea82-795d-11e8-831c-d3ec0d04d6ba.png)\r\n\r\nAfter changing the language\r\n\r\n![2018-06-26_1444 -after-change-language](https://user-images.githubusercontent.com/1003778/41913266-a0c0cc28-7950-11e8-9f0e-c5c0743d37cb.png)\r\n\r\nA ajax call is made to :\r\n* store the new language ( a taxonomy with Polylang) for this post\r\n* get categories filtered by the new language\r\n* get the new permalink\r\n* get specific datas for the language metabox (translations, flags)\r\n\r\nAfter the ajax call, datas is refreshed in the UI.\r\n\r\n# With Gutenberg\r\nsee screenshots below\r\n\r\nBefore changing the language\r\n\r\n![2018-06-26_1550-gut-before-change-lang](https://user-images.githubusercontent.com/1003778/41917317-64ba7cba-795a-11e8-9994-db5c41803a31.png)\r\n\r\nAfter changing the language\r\n\r\n![2018-06-26_1550-gut-after-change-lang](https://user-images.githubusercontent.com/1003778/41920131-501ca07a-7960-11e8-83df-ea0be38aa5c0.png)\r\n\r\n# What we already found\r\n## Permalink\r\nIt is a little bit tricky because permalink is built on the fly based on the permalink template which is not editable like the slug. \r\nSo, as we had to store the language too, we decided to use the Gutenberg savePost() method when the language is changed. It does the job because savePost() is visible for an external use.\r\n\r\n`wp.data.dispatch('core/editor').savePost();`\r\n\r\n## Categories\r\nWe understood how this metabox is built but we did not found a way to refresh its datas.\r\nWhen we toggle twice the panel to close and reopen the metabox, the API request is sent again and datas are refreshed. We did not found how to do the same thing from our code.\r\n\r\n## Tags\r\nIt is almost the same behaviour than the categories. The autocompletion works fine with the new language but results always display tags in the language before the change.\r\nWe have to toggle twice the panel to reset results for the initial language.\r\nAs \"Tags\" uses the same component as \"Categories\", we did not found a way to well refresh its datas.\r\n\r\n# What we are looking for\r\nWe are looking for a way to interact with these components of Gutenberg.\r\nIs it already possible ? Is it possible to expose a method for this specific need ?\r\n\r\nThanks for your help.\r\n# Context\r\n* Gutenberg master branch from github\r\n* Polylang Pro is necessary because it implements a REST API compatibility to use well the language which is not exist in Polylang (free).\r\n* Polylang for Gutenberg a specific plugin that we decided to develop to not disturb the development on our plugin before we find all the solutions.\r\nhttps://github.com/polylang/polylang-gutenberg"},"comment":{"url":"https://api.github.com/repos/WordPress/gutenberg/issues/comments/437075061","html_url":"https://github.com/WordPress/gutenberg/issues/7549#issuecomment-437075061","issue_url":"https://api.github.com/repos/WordPress/gutenberg/issues/7549","id":437075061,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNzA3NTA2MQ==","user":{"login":"chrisvanpatten","id":1231306,"node_id":"MDQ6VXNlcjEyMzEzMDY=","avatar_url":"https://avatars0.githubusercontent.com/u/1231306?v=4","gravatar_id":"","url":"https://api.github.com/users/chrisvanpatten","html_url":"https://github.com/chrisvanpatten","followers_url":"https://api.github.com/users/chrisvanpatten/followers","following_url":"https://api.github.com/users/chrisvanpatten/following{/other_user}","gists_url":"https://api.github.com/users/chrisvanpatten/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisvanpatten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisvanpatten/subscriptions","organizations_url":"https://api.github.com/users/chrisvanpatten/orgs","repos_url":"https://api.github.com/users/chrisvanpatten/repos","events_url":"https://api.github.com/users/chrisvanpatten/events{/privacy}","received_events_url":"https://api.github.com/users/chrisvanpatten/received_events","type":"User","site_admin":false},"created_at":"2018-11-08T16:54:57Z","updated_at":"2018-11-08T16:54:57Z","author_association":"CONTRIBUTOR","body":"This has the documentation ticket but I think we need clarity on whether or not it is possible. Would love some technical feedback on this before we can move forward."}}
{"actor":{"display_login":"chrisvanpatten"}}