{"action":"created","comment":{"url":"https://api.github.com/repos/enonic/xp/pulls/comments/93199507","pull_request_review_id":13720003,"id":93199507,"diff_hunk":"@@ -845,6 +863,49 @@ export class ContentWizardPanel extends api.app.wizard.WizardPanel<Content> {\n         }\n     }\n \n+    private doesFragmentContainId(fragmentPage: Page, id: ContentId): boolean {\n+        let containsId = false;\n+\n+        if (fragmentPage) {\n+            let fragmentCmp = fragmentPage.getFragment();\n+            if (!!fragmentCmp && ObjectHelper.iFrameSafeInstanceOf(fragmentCmp.getType(), ImageComponentType)) {\n+                containsId = (<ImageComponent>fragmentCmp).getImage().equals(id);\n+            }\n+        }\n+        return containsId;\n+    }\n+\n+    private doImageComponentsContainId(id: ContentId): wemQ.Promise<boolean> {\n+        let page = this.getPersistedItem().getPage();\n+        let fragments: ContentId[] = [];\n+        let containsId = this.doRegionsContainId(page.getRegions().getRegions(), id, fragments);\n+        if (!containsId && fragments.length > 0) {\n+            return wemQ.all(fragments.map(fragmentId => new GetContentByIdRequest(fragmentId).sendAndParse()))\n+                .then((fragmentContents: Content[]) => {\n+                    return fragmentContents.some((fragmentContent: Content) => {\n+                        return this.doesFragmentContainId(fragmentContent.getPage(), id);\n+                    })\n+                });\n+        } else {\n+            return wemQ(containsId);\n+        }\n+    }\n+\n+    private doRegionsContainId(regions: Region[], id: ContentId, fragments: ContentId[] = []): boolean {\n+        return regions.some((region: Region) => {\n+            return region.getComponents().some((component: Component) => {\n+                if (ObjectHelper.iFrameSafeInstanceOf(component.getType(), FragmentComponentType)) {\n+                    fragments.push((<FragmentComponent>component).getFragment());\n+                    return false;\n+                } else if (ObjectHelper.iFrameSafeInstanceOf(component.getType(), ImageComponentType)) {\n+                    return (<ImageComponent>component).getImage().equals(id);\n+                } else if (ObjectHelper.iFrameSafeInstanceOf(component.getType(), LayoutComponentType)) {\n+                    return this.doRegionsContainId((<LayoutComponent>component).getRegions().getRegions(), id, fragments);\n+                }\n+            })\n+        });\n+    }\n+","path":"modules/admin/admin-ui/src/main/resources/web/admin/apps/content-studio/js/app/wizard/ContentWizardPanel.ts","position":153,"original_position":153,"commit_id":"3324c01bfb1854075d370f91dd60d5961430f573","original_commit_id":"3324c01bfb1854075d370f91dd60d5961430f573","user":{"login":"alansemenov","id":11612490,"avatar_url":"https://avatars.githubusercontent.com/u/11612490?v=3","gravatar_id":"","url":"https://api.github.com/users/alansemenov","html_url":"https://github.com/alansemenov","followers_url":"https://api.github.com/users/alansemenov/followers","following_url":"https://api.github.com/users/alansemenov/following{/other_user}","gists_url":"https://api.github.com/users/alansemenov/gists{/gist_id}","starred_url":"https://api.github.com/users/alansemenov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alansemenov/subscriptions","organizations_url":"https://api.github.com/users/alansemenov/orgs","repos_url":"https://api.github.com/users/alansemenov/repos","events_url":"https://api.github.com/users/alansemenov/events{/privacy}","received_events_url":"https://api.github.com/users/alansemenov/received_events","type":"User","site_admin":false},"body":"Can you change this one so that it doesn't have ``else`` and has the last line with default ``return``?\r\n```Typescript\r\n{\r\n  if (condition1) {\r\n    do stuff;\r\n    return false;\r\n  }\r\n  if (condition2) {\r\n    return stuff;\r\n  }\r\n  return false;\r\n}\r\n```","created_at":"2016-12-20T09:34:28Z","updated_at":"2016-12-20T09:34:36Z","html_url":"https://github.com/enonic/xp/pull/4190#discussion_r93199507","pull_request_url":"https://api.github.com/repos/enonic/xp/pulls/4190","_links":{"self":{"href":"https://api.github.com/repos/enonic/xp/pulls/comments/93199507"},"html":{"href":"https://github.com/enonic/xp/pull/4190#discussion_r93199507"},"pull_request":{"href":"https://api.github.com/repos/enonic/xp/pulls/4190"}}},"pull_request":{"url":"https://api.github.com/repos/enonic/xp/pulls/4190","id":98585060,"html_url":"https://github.com/enonic/xp/pull/4190","diff_url":"https://github.com/enonic/xp/pull/4190.diff","patch_url":"https://github.com/enonic/xp/pull/4190.patch","issue_url":"https://api.github.com/repos/enonic/xp/issues/4190","number":4190,"state":"open","locked":false,"title":"XP-4700 Fragment-wizard won't get updated after the related image has…","user":{"login":"pmi","id":754221,"avatar_url":"https://avatars.githubusercontent.com/u/754221?v=3","gravatar_id":"","url":"https://api.github.com/users/pmi","html_url":"https://github.com/pmi","followers_url":"https://api.github.com/users/pmi/followers","following_url":"https://api.github.com/users/pmi/following{/other_user}","gists_url":"https://api.github.com/users/pmi/gists{/gist_id}","starred_url":"https://api.github.com/users/pmi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pmi/subscriptions","organizations_url":"https://api.github.com/users/pmi/orgs","repos_url":"https://api.github.com/users/pmi/repos","events_url":"https://api.github.com/users/pmi/events{/privacy}","received_events_url":"https://api.github.com/users/pmi/received_events","type":"User","site_admin":false},"body":"… been updated (zoomed, focused)\r\n\r\n- added refresh on content updated event for fragment -, content containing fragment -, and image wizards if updated content is present on page","created_at":"2016-12-19T15:29:30Z","updated_at":"2016-12-20T09:34:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d3bfc7ba5529c0019872c09acc62396a413328c0","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/enonic/xp/pulls/4190/commits","review_comments_url":"https://api.github.com/repos/enonic/xp/pulls/4190/comments","review_comment_url":"https://api.github.com/repos/enonic/xp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/enonic/xp/issues/4190/comments","statuses_url":"https://api.github.com/repos/enonic/xp/statuses/3324c01bfb1854075d370f91dd60d5961430f573","head":{"label":"enonic:XP-4700","ref":"XP-4700","sha":"3324c01bfb1854075d370f91dd60d5961430f573","user":{"login":"enonic","id":240273,"avatar_url":"https://avatars.githubusercontent.com/u/240273?v=3","gravatar_id":"","url":"https://api.github.com/users/enonic","html_url":"https://github.com/enonic","followers_url":"https://api.github.com/users/enonic/followers","following_url":"https://api.github.com/users/enonic/following{/other_user}","gists_url":"https://api.github.com/users/enonic/gists{/gist_id}","starred_url":"https://api.github.com/users/enonic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enonic/subscriptions","organizations_url":"https://api.github.com/users/enonic/orgs","repos_url":"https://api.github.com/users/enonic/repos","events_url":"https://api.github.com/users/enonic/events{/privacy}","received_events_url":"https://api.github.com/users/enonic/received_events","type":"Organization","site_admin":false},"repo":{"id":4147239,"name":"xp","full_name":"enonic/xp","owner":{"login":"enonic","id":240273,"avatar_url":"https://avatars.githubusercontent.com/u/240273?v=3","gravatar_id":"","url":"https://api.github.com/users/enonic","html_url":"https://github.com/enonic","followers_url":"https://api.github.com/users/enonic/followers","following_url":"https://api.github.com/users/enonic/following{/other_user}","gists_url":"https://api.github.com/users/enonic/gists{/gist_id}","starred_url":"https://api.github.com/users/enonic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enonic/subscriptions","organizations_url":"https://api.github.com/users/enonic/orgs","repos_url":"https://api.github.com/users/enonic/repos","events_url":"https://api.github.com/users/enonic/events{/privacy}","received_events_url":"https://api.github.com/users/enonic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/enonic/xp","description":"Enonic XP","fork":false,"url":"https://api.github.com/repos/enonic/xp","forks_url":"https://api.github.com/repos/enonic/xp/forks","keys_url":"https://api.github.com/repos/enonic/xp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/enonic/xp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/enonic/xp/teams","hooks_url":"https://api.github.com/repos/enonic/xp/hooks","issue_events_url":"https://api.github.com/repos/enonic/xp/issues/events{/number}","events_url":"https://api.github.com/repos/enonic/xp/events","assignees_url":"https://api.github.com/repos/enonic/xp/assignees{/user}","branches_url":"https://api.github.com/repos/enonic/xp/branches{/branch}","tags_url":"https://api.github.com/repos/enonic/xp/tags","blobs_url":"https://api.github.com/repos/enonic/xp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/enonic/xp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/enonic/xp/git/refs{/sha}","trees_url":"https://api.github.com/repos/enonic/xp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/enonic/xp/statuses/{sha}","languages_url":"https://api.github.com/repos/enonic/xp/languages","stargazers_url":"https://api.github.com/repos/enonic/xp/stargazers","contributors_url":"https://api.github.com/repos/enonic/xp/contributors","subscribers_url":"https://api.github.com/repos/enonic/xp/subscribers","subscription_url":"https://api.github.com/repos/enonic/xp/subscription","commits_url":"https://api.github.com/repos/enonic/xp/commits{/sha}","git_commits_url":"https://api.github.com/repos/enonic/xp/git/commits{/sha}","comments_url":"https://api.github.com/repos/enonic/xp/comments{/number}","issue_comment_url":"https://api.github.com/repos/enonic/xp/issues/comments{/number}","contents_url":"https://api.github.com/repos/enonic/xp/contents/{+path}","compare_url":"https://api.github.com/repos/enonic/xp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/enonic/xp/merges","archive_url":"https://api.github.com/repos/enonic/xp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/enonic/xp/downloads","issues_url":"https://api.github.com/repos/enonic/xp/issues{/number}","pulls_url":"https://api.github.com/repos/enonic/xp/pulls{/number}","milestones_url":"https://api.github.com/repos/enonic/xp/milestones{/number}","notifications_url":"https://api.github.com/repos/enonic/xp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/enonic/xp/labels{/name}","releases_url":"https://api.github.com/repos/enonic/xp/releases{/id}","deployments_url":"https://api.github.com/repos/enonic/xp/deployments","created_at":"2012-04-26T12:06:41Z","updated_at":"2016-12-14T04:10:46Z","pushed_at":"2016-12-20T08:48:01Z","git_url":"git://github.com/enonic/xp.git","ssh_url":"git@github.com:enonic/xp.git","clone_url":"https://github.com/enonic/xp.git","svn_url":"https://github.com/enonic/xp","homepage":"https://enonic.com","size":178811,"stargazers_count":115,"watchers_count":115,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":21,"forks":12,"open_issues":21,"watchers":115,"default_branch":"master"}},"base":{"label":"enonic:master","ref":"master","sha":"52178f0cc01d16cc8f66473e4a499399c9f4155b","user":{"login":"enonic","id":240273,"avatar_url":"https://avatars.githubusercontent.com/u/240273?v=3","gravatar_id":"","url":"https://api.github.com/users/enonic","html_url":"https://github.com/enonic","followers_url":"https://api.github.com/users/enonic/followers","following_url":"https://api.github.com/users/enonic/following{/other_user}","gists_url":"https://api.github.com/users/enonic/gists{/gist_id}","starred_url":"https://api.github.com/users/enonic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enonic/subscriptions","organizations_url":"https://api.github.com/users/enonic/orgs","repos_url":"https://api.github.com/users/enonic/repos","events_url":"https://api.github.com/users/enonic/events{/privacy}","received_events_url":"https://api.github.com/users/enonic/received_events","type":"Organization","site_admin":false},"repo":{"id":4147239,"name":"xp","full_name":"enonic/xp","owner":{"login":"enonic","id":240273,"avatar_url":"https://avatars.githubusercontent.com/u/240273?v=3","gravatar_id":"","url":"https://api.github.com/users/enonic","html_url":"https://github.com/enonic","followers_url":"https://api.github.com/users/enonic/followers","following_url":"https://api.github.com/users/enonic/following{/other_user}","gists_url":"https://api.github.com/users/enonic/gists{/gist_id}","starred_url":"https://api.github.com/users/enonic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enonic/subscriptions","organizations_url":"https://api.github.com/users/enonic/orgs","repos_url":"https://api.github.com/users/enonic/repos","events_url":"https://api.github.com/users/enonic/events{/privacy}","received_events_url":"https://api.github.com/users/enonic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/enonic/xp","description":"Enonic XP","fork":false,"url":"https://api.github.com/repos/enonic/xp","forks_url":"https://api.github.com/repos/enonic/xp/forks","keys_url":"https://api.github.com/repos/enonic/xp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/enonic/xp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/enonic/xp/teams","hooks_url":"https://api.github.com/repos/enonic/xp/hooks","issue_events_url":"https://api.github.com/repos/enonic/xp/issues/events{/number}","events_url":"https://api.github.com/repos/enonic/xp/events","assignees_url":"https://api.github.com/repos/enonic/xp/assignees{/user}","branches_url":"https://api.github.com/repos/enonic/xp/branches{/branch}","tags_url":"https://api.github.com/repos/enonic/xp/tags","blobs_url":"https://api.github.com/repos/enonic/xp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/enonic/xp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/enonic/xp/git/refs{/sha}","trees_url":"https://api.github.com/repos/enonic/xp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/enonic/xp/statuses/{sha}","languages_url":"https://api.github.com/repos/enonic/xp/languages","stargazers_url":"https://api.github.com/repos/enonic/xp/stargazers","contributors_url":"https://api.github.com/repos/enonic/xp/contributors","subscribers_url":"https://api.github.com/repos/enonic/xp/subscribers","subscription_url":"https://api.github.com/repos/enonic/xp/subscription","commits_url":"https://api.github.com/repos/enonic/xp/commits{/sha}","git_commits_url":"https://api.github.com/repos/enonic/xp/git/commits{/sha}","comments_url":"https://api.github.com/repos/enonic/xp/comments{/number}","issue_comment_url":"https://api.github.com/repos/enonic/xp/issues/comments{/number}","contents_url":"https://api.github.com/repos/enonic/xp/contents/{+path}","compare_url":"https://api.github.com/repos/enonic/xp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/enonic/xp/merges","archive_url":"https://api.github.com/repos/enonic/xp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/enonic/xp/downloads","issues_url":"https://api.github.com/repos/enonic/xp/issues{/number}","pulls_url":"https://api.github.com/repos/enonic/xp/pulls{/number}","milestones_url":"https://api.github.com/repos/enonic/xp/milestones{/number}","notifications_url":"https://api.github.com/repos/enonic/xp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/enonic/xp/labels{/name}","releases_url":"https://api.github.com/repos/enonic/xp/releases{/id}","deployments_url":"https://api.github.com/repos/enonic/xp/deployments","created_at":"2012-04-26T12:06:41Z","updated_at":"2016-12-14T04:10:46Z","pushed_at":"2016-12-20T08:48:01Z","git_url":"git://github.com/enonic/xp.git","ssh_url":"git@github.com:enonic/xp.git","clone_url":"https://github.com/enonic/xp.git","svn_url":"https://github.com/enonic/xp","homepage":"https://enonic.com","size":178811,"stargazers_count":115,"watchers_count":115,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":21,"forks":12,"open_issues":21,"watchers":115,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/enonic/xp/pulls/4190"},"html":{"href":"https://github.com/enonic/xp/pull/4190"},"issue":{"href":"https://api.github.com/repos/enonic/xp/issues/4190"},"comments":{"href":"https://api.github.com/repos/enonic/xp/issues/4190/comments"},"review_comments":{"href":"https://api.github.com/repos/enonic/xp/pulls/4190/comments"},"review_comment":{"href":"https://api.github.com/repos/enonic/xp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/enonic/xp/pulls/4190/commits"},"statuses":{"href":"https://api.github.com/repos/enonic/xp/statuses/3324c01bfb1854075d370f91dd60d5961430f573"}}}}
{"actor":{"display_login":"alansemenov"}}