payload: {"action":"created","comment":{"url":"https://api.github.com/repos/botpress/botpress/pulls/comments/322731979","pull_request_review_id":286103358,"id":322731979,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMyMjczMTk3OQ==","diff_hunk":"@@ -16,7 +59,14 @@ export const importQuestions = async (questions: QnaItem[], storage, statusCallb\n   })\n }\n \n-export const prepareExport = async (storage: Storage) => {\n+export const prepareExport = async (storage: Storage, bp: typeof sdk) => {\n   const qnas = await storage.fetchQNAs()\n-  return JSON.stringify(qnas, undefined, 2)\n+  const contentElementIds = await storage.getAllContentElementIds()\n+\n+  const cms = await Promise.mapSeries(contentElementIds, async id => {","path":"modules/qna/src/backend/transfer.ts","position":65,"original_position":65,"commit_id":"3d0669cdb6a222e82cbcdb535eb0648c292efc08","original_commit_id":"3d0669cdb6a222e82cbcdb535eb0648c292efc08","user":{"login":"EFF","id":955524,"node_id":"MDQ6VXNlcjk1NTUyNA==","avatar_url":"https://avatars2.githubusercontent.com/u/955524?v=4","gravatar_id":"","url":"https://api.github.com/users/EFF","html_url":"https://github.com/EFF","followers_url":"https://api.github.com/users/EFF/followers","following_url":"https://api.github.com/users/EFF/following{/other_user}","gists_url":"https://api.github.com/users/EFF/gists{/gist_id}","starred_url":"https://api.github.com/users/EFF/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EFF/subscriptions","organizations_url":"https://api.github.com/users/EFF/orgs","repos_url":"https://api.github.com/users/EFF/repos","events_url":"https://api.github.com/users/EFF/events{/privacy}","received_events_url":"https://api.github.com/users/EFF/received_events","type":"User","site_admin":false},"body":"this is fine, I'm not just sure about the naming .. would cmsItems ? or contentElements? be more appropriate ?\r\n\r\ncms could feel like a cms export","created_at":"2019-09-10T13:09:11Z","updated_at":"2019-09-10T13:22:11Z","html_url":"https://github.com/botpress/botpress/pull/2341#discussion_r322731979","pull_request_url":"https://api.github.com/repos/botpress/botpress/pulls/2341","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/botpress/botpress/pulls/comments/322731979"},"html":{"href":"https://github.com/botpress/botpress/pull/2341#discussion_r322731979"},"pull_request":{"href":"https://api.github.com/repos/botpress/botpress/pulls/2341"}}},"pull_request":{"url":"https://api.github.com/repos/botpress/botpress/pulls/2341","id":314723772,"node_id":"MDExOlB1bGxSZXF1ZXN0MzE0NzIzNzcy","html_url":"https://github.com/botpress/botpress/pull/2341","diff_url":"https://github.com/botpress/botpress/pull/2341.diff","patch_url":"https://github.com/botpress/botpress/pull/2341.patch","issue_url":"https://api.github.com/repos/botpress/botpress/issues/2341","number":2341,"state":"open","locked":false,"title":"feat(qna): Added support for elements from the CMS","user":{"login":"allardy","id":42552874,"node_id":"MDQ6VXNlcjQyNTUyODc0","avatar_url":"https://avatars3.githubusercontent.com/u/42552874?v=4","gravatar_id":"","url":"https://api.github.com/users/allardy","html_url":"https://github.com/allardy","followers_url":"https://api.github.com/users/allardy/followers","following_url":"https://api.github.com/users/allardy/following{/other_user}","gists_url":"https://api.github.com/users/allardy/gists{/gist_id}","starred_url":"https://api.github.com/users/allardy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allardy/subscriptions","organizations_url":"https://api.github.com/users/allardy/orgs","repos_url":"https://api.github.com/users/allardy/repos","events_url":"https://api.github.com/users/allardy/events{/privacy}","received_events_url":"https://api.github.com/users/allardy/received_events","type":"User","site_admin":false},"body":"Small overhaul of the QNA module to support content elements. Took some inspirations from https://github.com/botpress/botpress/pull/1549, but it was implemented differently.\r\n\r\nContent elements are created in the CMS like any other element, only the ID is stored in the QNA entry. Deletion must be done manually. \r\n\r\nWhen exporting content, QNAs are exported as usual, plus we export content elements from the CMS.\r\n\r\nWhen importing a file, content elements are also created or updated depending on the case. Elements associated with the old QNAs (if choosing to clear old qna) are left untouched\r\n\r\n![image](https://user-images.githubusercontent.com/42552874/64386397-ffb5da80-d006-11e9-8f68-08c67863f1c6.png)\r\n\r\n\r\nThe import dialog was overhauled:\r\n![image](https://user-images.githubusercontent.com/42552874/64386452-2bd15b80-d007-11e9-8cda-1644ca2df079.png)\r\n\r\n\r\nSome improvements which could be nice:\r\n- Better synchronization of content between the CMS and QNA (deleted elements on the cms are not removed from qna)\r\n- Better way to handle categories when importing (the qna is labeled with it, but when you edit it it disappears)\r\n- Some way to identify if a specific element is used somewhere (in a flow ? in an action? in a qna?)\r\n- Better integration with multilang (a content element is multi-lang by default, but it still must be copied in each translation of the qna)\r\n\r\nFor the future \r\n- This could pave the way to force using the CMS for qna entries (eg: type some text and press enter, paf we create a text element on the fly)","created_at":"2019-09-05T22:15:55Z","updated_at":"2019-09-10T13:22:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ac2ae84313e46bdae82b40b66d2fb48d7a7861fd","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/botpress/botpress/pulls/2341/commits","review_comments_url":"https://api.github.com/repos/botpress/botpress/pulls/2341/comments","review_comment_url":"https://api.github.com/repos/botpress/botpress/pulls/comments{/number}","comments_url":"https://api.github.com/repos/botpress/botpress/issues/2341/comments","statuses_url":"https://api.github.com/repos/botpress/botpress/statuses/3d0669cdb6a222e82cbcdb535eb0648c292efc08","head":{"label":"botpress:ya-qna-content","ref":"ya-qna-content","sha":"3d0669cdb6a222e82cbcdb535eb0648c292efc08","user":{"login":"botpress","id":23510677,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzNTEwNjc3","avatar_url":"https://avatars3.githubusercontent.com/u/23510677?v=4","gravatar_id":"","url":"https://api.github.com/users/botpress","html_url":"https://github.com/botpress","followers_url":"https://api.github.com/users/botpress/followers","following_url":"https://api.github.com/users/botpress/following{/other_user}","gists_url":"https://api.github.com/users/botpress/gists{/gist_id}","starred_url":"https://api.github.com/users/botpress/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/botpress/subscriptions","organizations_url":"https://api.github.com/users/botpress/orgs","repos_url":"https://api.github.com/users/botpress/repos","events_url":"https://api.github.com/users/botpress/events{/privacy}","received_events_url":"https://api.github.com/users/botpress/received_events","type":"Organization","site_admin":false},"repo":{"id":73964895,"node_id":"MDEwOlJlcG9zaXRvcnk3Mzk2NDg5NQ==","name":"botpress","full_name":"botpress/botpress","private":false,"owner":{"login":"botpress","id":23510677,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzNTEwNjc3","avatar_url":"https://avatars3.githubusercontent.com/u/23510677?v=4","gravatar_id":"","url":"https://api.github.com/users/botpress","html_url":"https://github.com/botpress","followers_url":"https://api.github.com/users/botpress/followers","following_url":"https://api.github.com/users/botpress/following{/other_user}","gists_url":"https://api.github.com/users/botpress/gists{/gist_id}","starred_url":"https://api.github.com/users/botpress/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/botpress/subscriptions","organizations_url":"https://api.github.com/users/botpress/orgs","repos_url":"https://api.github.com/users/botpress/repos","events_url":"https://api.github.com/users/botpress/events{/privacy}","received_events_url":"https://api.github.com/users/botpress/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/botpress/botpress","description":"The open-source Conversational Platform with built-in language understanding (NLU), beautiful graphical interface and dialog manager. Easily create chatbots and AI-based virtual assistants.","fork":false,"url":"https://api.github.com/repos/botpress/botpress","forks_url":"https://api.github.com/repos/botpress/botpress/forks","keys_url":"https://api.github.com/repos/botpress/botpress/keys{/key_id}","collaborators_url":"https://api.github.com/repos/botpress/botpress/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/botpress/botpress/teams","hooks_url":"https://api.github.com/repos/botpress/botpress/hooks","issue_events_url":"https://api.github.com/repos/botpress/botpress/issues/events{/number}","events_url":"https://api.github.com/repos/botpress/botpress/events","assignees_url":"https://api.github.com/repos/botpress/botpress/assignees{/user}","branches_url":"https://api.github.com/repos/botpress/botpress/branches{/branch}","tags_url":"https://api.github.com/repos/botpress/botpress/tags","blobs_url":"https://api.github.com/repos/botpress/botpress/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/botpress/botpress/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/botpress/botpress/git/refs{/sha}","trees_url":"https://api.github.com/repos/botpress/botpress/git/trees{/sha}","statuses_url":"https://api.github.com/repos/botpress/botpress/statuses/{sha}","languages_url":"https://api.github.com/repos/botpress/botpress/languages","stargazers_url":"https://api.github.com/repos/botpress/botpress/stargazers","contributors_url":"https://api.github.com/repos/botpress/botpress/contributors","subscribers_url":"https://api.github.com/repos/botpress/botpress/subscribers","subscription_url":"https://api.github.com/repos/botpress/botpress/subscription","commits_url":"https://api.github.com/repos/botpress/botpress/commits{/sha}","git_commits_url":"https://api.github.com/repos/botpress/botpress/git/commits{/sha}","comments_url":"https://api.github.com/repos/botpress/botpress/comments{/number}","issue_comment_url":"https://api.github.com/repos/botpress/botpress/issues/comments{/number}","contents_url":"https://api.github.com/repos/botpress/botpress/contents/{+path}","compare_url":"https://api.github.com/repos/botpress/botpress/compare/{base}...{head}","merges_url":"https://api.github.com/repos/botpress/botpress/merges","archive_url":"https://api.github.com/repos/botpress/botpress/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/botpress/botpress/downloads","issues_url":"https://api.github.com/repos/botpress/botpress/issues{/number}","pulls_url":"https://api.github.com/repos/botpress/botpress/pulls{/number}","milestones_url":"https://api.github.com/repos/botpress/botpress/milestones{/number}","notifications_url":"https://api.github.com/repos/botpress/botpress/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/botpress/botpress/labels{/name}","releases_url":"https://api.github.com/repos/botpress/botpress/releases{/id}","deployments_url":"https://api.github.com/repos/botpress/botpress/deployments","created_at":"2016-11-16T21:57:59Z","updated_at":"2019-09-09T20:34:03Z","pushed_at":"2019-09-10T02:54:02Z","git_url":"git://github.com/botpress/botpress.git","ssh_url":"git@github.com:botpress/botpress.git","clone_url":"https://github.com/botpress/botpress.git","svn_url":"https://github.com/botpress/botpress","homepage":"https://botpress.io","size":187117,"stargazers_count":7640,"watchers_count":7640,"language":"TypeScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":846,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":152,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":846,"open_issues":152,"watchers":7640,"default_branch":"master"}},"base":{"label":"botpress:patch/12-1-4","ref":"patch/12-1-4","sha":"6d1270d9a6873963e35df76e1df0d1b1f380a208","user":{"login":"botpress","id":23510677,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzNTEwNjc3","avatar_url":"https://avatars3.githubusercontent.com/u/23510677?v=4","gravatar_id":"","url":"https://api.github.com/users/botpress","html_url":"https://github.com/botpress","followers_url":"https://api.github.com/users/botpress/followers","following_url":"https://api.github.com/users/botpress/following{/other_user}","gists_url":"https://api.github.com/users/botpress/gists{/gist_id}","starred_url":"https://api.github.com/users/botpress/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/botpress/subscriptions","organizations_url":"https://api.github.com/users/botpress/orgs","repos_url":"https://api.github.com/users/botpress/repos","events_url":"https://api.github.com/users/botpress/events{/privacy}","received_events_url":"https://api.github.com/users/botpress/received_events","type":"Organization","site_admin":false},"repo":{"id":73964895,"node_id":"MDEwOlJlcG9zaXRvcnk3Mzk2NDg5NQ==","name":"botpress","full_name":"botpress/botpress","private":false,"owner":{"login":"botpress","id":23510677,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzNTEwNjc3","avatar_url":"https://avatars3.githubusercontent.com/u/23510677?v=4","gravatar_id":"","url":"https://api.github.com/users/botpress","html_url":"https://github.com/botpress","followers_url":"https://api.github.com/users/botpress/followers","following_url":"https://api.github.com/users/botpress/following{/other_user}","gists_url":"https://api.github.com/users/botpress/gists{/gist_id}","starred_url":"https://api.github.com/users/botpress/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/botpress/subscriptions","organizations_url":"https://api.github.com/users/botpress/orgs","repos_url":"https://api.github.com/users/botpress/repos","events_url":"https://api.github.com/users/botpress/events{/privacy}","received_events_url":"https://api.github.com/users/botpress/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/botpress/botpress","description":"The open-source Conversational Platform with built-in language understanding (NLU), beautiful graphical interface and dialog manager. Easily create chatbots and AI-based virtual assistants.","fork":false,"url":"https://api.github.com/repos/botpress/botpress","forks_url":"https://api.github.com/repos/botpress/botpress/forks","keys_url":"https://api.github.com/repos/botpress/botpress/keys{/key_id}","collaborators_url":"https://api.github.com/repos/botpress/botpress/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/botpress/botpress/teams","hooks_url":"https://api.github.com/repos/botpress/botpress/hooks","issue_events_url":"https://api.github.com/repos/botpress/botpress/issues/events{/number}","events_url":"https://api.github.com/repos/botpress/botpress/events","assignees_url":"https://api.github.com/repos/botpress/botpress/assignees{/user}","branches_url":"https://api.github.com/repos/botpress/botpress/branches{/branch}","tags_url":"https://api.github.com/repos/botpress/botpress/tags","blobs_url":"https://api.github.com/repos/botpress/botpress/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/botpress/botpress/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/botpress/botpress/git/refs{/sha}","trees_url":"https://api.github.com/repos/botpress/botpress/git/trees{/sha}","statuses_url":"https://api.github.com/repos/botpress/botpress/statuses/{sha}","languages_url":"https://api.github.com/repos/botpress/botpress/languages","stargazers_url":"https://api.github.com/repos/botpress/botpress/stargazers","contributors_url":"https://api.github.com/repos/botpress/botpress/contributors","subscribers_url":"https://api.github.com/repos/botpress/botpress/subscribers","subscription_url":"https://api.github.com/repos/botpress/botpress/subscription","commits_url":"https://api.github.com/repos/botpress/botpress/commits{/sha}","git_commits_url":"https://api.github.com/repos/botpress/botpress/git/commits{/sha}","comments_url":"https://api.github.com/repos/botpress/botpress/comments{/number}","issue_comment_url":"https://api.github.com/repos/botpress/botpress/issues/comments{/number}","contents_url":"https://api.github.com/repos/botpress/botpress/contents/{+path}","compare_url":"https://api.github.com/repos/botpress/botpress/compare/{base}...{head}","merges_url":"https://api.github.com/repos/botpress/botpress/merges","archive_url":"https://api.github.com/repos/botpress/botpress/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/botpress/botpress/downloads","issues_url":"https://api.github.com/repos/botpress/botpress/issues{/number}","pulls_url":"https://api.github.com/repos/botpress/botpress/pulls{/number}","milestones_url":"https://api.github.com/repos/botpress/botpress/milestones{/number}","notifications_url":"https://api.github.com/repos/botpress/botpress/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/botpress/botpress/labels{/name}","releases_url":"https://api.github.com/repos/botpress/botpress/releases{/id}","deployments_url":"https://api.github.com/repos/botpress/botpress/deployments","created_at":"2016-11-16T21:57:59Z","updated_at":"2019-09-09T20:34:03Z","pushed_at":"2019-09-10T02:54:02Z","git_url":"git://github.com/botpress/botpress.git","ssh_url":"git@github.com:botpress/botpress.git","clone_url":"https://github.com/botpress/botpress.git","svn_url":"https://github.com/botpress/botpress","homepage":"https://botpress.io","size":187117,"stargazers_count":7640,"watchers_count":7640,"language":"TypeScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":846,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":152,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":846,"open_issues":152,"watchers":7640,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/botpress/botpress/pulls/2341"},"html":{"href":"https://github.com/botpress/botpress/pull/2341"},"issue":{"href":"https://api.github.com/repos/botpress/botpress/issues/2341"},"comments":{"href":"https://api.github.com/repos/botpress/botpress/issues/2341/comments"},"review_comments":{"href":"https://api.github.com/repos/botpress/botpress/pulls/2341/comments"},"review_comment":{"href":"https://api.github.com/repos/botpress/botpress/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/botpress/botpress/pulls/2341/commits"},"statuses":{"href":"https://api.github.com/repos/botpress/botpress/statuses/3d0669cdb6a222e82cbcdb535eb0648c292efc08"}},"author_association":"CONTRIBUTOR"}}
other: {"actor":{"display_login":"EFF"}}