{"action":"created","comment":{"url":"https://api.github.com/repos/upexcel/ionic_invision/pulls/comments/87341396","pull_request_review_id":7955919,"id":87341396,"diff_hunk":"@@ -0,0 +1,116 @@\n+import { Component, OnInit, Input } from '@angular/core';\n+import { NavParams } from 'ionic-angular';\n+import {ToastController} from 'ionic-angular';\n+import { ViewController } from 'ionic-angular';\n+import { SubmitReviewDataType } from '../../model/product/submitReview';\n+import { Product } from '../../model/product/getProduct';\n+import { Storage } from '@ionic/storage';\n+import forEach from 'lodash/forEach';\n+import { Events } from 'ionic-angular';\n+@Component({\n+    selector: 'submit-review',\n+    templateUrl: 'submitReview.html'\n+})\n+export class SubmitReview implements OnInit {\n+    skuValue: string;\n+    title: string;\n+    keys: string;\n+    option: any;\n+    reviewDataDetails: string = \"\";\n+    reviewDataTitle: string = \"\";\n+    reviewDataNickname: string = \"\";\n+    reviewData: Array<string> = [];\n+    selectedRating: Array<string> = [];\n+    submitReviewData: SubmitReviewDataType;\n+    hideByLogin: boolean = true;\n+    submitSuccessful: boolean = false;\n+    constructor(public _events: Events, public _viewCtrl: ViewController, _params: NavParams, private _local: Storage, private _getProduct: Product, private _toastCtrl: ToastController) {\n+        this.skuValue = _params.get('sku');\n+        this.title = _params.get('title');\n+        this.keys = _params.get('keys');\n+        this.option = _params.get('option');\n+    }\n+    ngOnInit() {\n+        this._local.get(\"access_token\").then((access_token) => {\n+            if (access_token != null) {\n+                this._local.get('firstname').then((firstname) => {\n+                    this.reviewDataNickname = firstname;\n+                    this.hideByLogin = false;\n+                })\n+            } else {\n+                this.reviewDataNickname = \"\";\n+            }\n+        })\n+    }\n+    close() {\n+        this._viewCtrl.dismiss();\n+    }\n+    onSelectRatting(rating, title) {\n+        this.selectedRating = rating;\n+    }\n+    submitReview() {\n+        let reviweDataJson = {};\n+        let selectedRating = {};\n+        let self = this;\n+        this.submitSuccessful = true;\n+        let ratingValueChangeAsApi = [];\n+        let finalSelectRating: Array<any> = [];\n+        for (let i = 0; i < this.keys.length; i++) {\n+            reviweDataJson[this.keys[i]] = this.selectedRating[i];\n+        };\n+        forEach(reviweDataJson, function(ratingValue, ratingKey) {\n+            forEach(self.option, function(optionValue, optionKey) {\n+                if (ratingKey == optionKey) {\n+                    forEach(optionValue, function(Value, key) {\n+                        if(key == ratingValue-1 ) {\n+                            finalSelectRating.push({\n+                                value: Value,\n+                                key: ratingKey\n+                            })\n+                        }\n+                    })\n+                }\n+            })\n+        })\n+        forEach(finalSelectRating, function(value, key) {\n+            ratingValueChangeAsApi.push(value.value);\n+        })\n+        for (let i = 0; i < this.keys.length; i++) {\n+            selectedRating[this.keys[i]] = ratingValueChangeAsApi[i];\n+        };\n+        this._local.get('store_id').then((store_id) => {\n+            let data = {\n+                sku: this.skuValue,\n+                \"store_id\": store_id,\n+                \"title\": this.reviewDataTitle,\n+                \"details\": this.reviewDataDetails,\n+                \"nickname\": this.reviewDataNickname,\n+                \"rating_options\": selectedRating\n+            };\n+            this._getProduct.getSubmitReview(data).then((res) => {\n+                this.submitSuccessful = false;\n+                this.submitReviewData = res;\n+                if (this.submitReviewData) {\n+                    this._viewCtrl.dismiss();\n+                    if (this.submitReviewData.data.review_status == \"1\") {\n+                        this.presentToast(\"Your Rating Is Approved\");","path":"src/components/submitReview/SubmitReview.ts","position":96,"original_position":96,"commit_id":"44c2ce8b0ed7c24cb7d06b0f149df62ccdb16f91","original_commit_id":"44c2ce8b0ed7c24cb7d06b0f149df62ccdb16f91","user":{"login":"reactexcel","id":19383571,"avatar_url":"https://avatars.githubusercontent.com/u/19383571?v=3","gravatar_id":"","url":"https://api.github.com/users/reactexcel","html_url":"https://github.com/reactexcel","followers_url":"https://api.github.com/users/reactexcel/followers","following_url":"https://api.github.com/users/reactexcel/following{/other_user}","gists_url":"https://api.github.com/users/reactexcel/gists{/gist_id}","starred_url":"https://api.github.com/users/reactexcel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reactexcel/subscriptions","organizations_url":"https://api.github.com/users/reactexcel/orgs","repos_url":"https://api.github.com/users/reactexcel/repos","events_url":"https://api.github.com/users/reactexcel/events{/privacy}","received_events_url":"https://api.github.com/users/reactexcel/received_events","type":"User","site_admin":false},"body":"Thanks for your review!","created_at":"2016-11-10T07:40:03Z","updated_at":"2016-11-10T07:42:47Z","html_url":"https://github.com/upexcel/ionic_invision/pull/102#discussion_r87341396","pull_request_url":"https://api.github.com/repos/upexcel/ionic_invision/pulls/102","_links":{"self":{"href":"https://api.github.com/repos/upexcel/ionic_invision/pulls/comments/87341396"},"html":{"href":"https://github.com/upexcel/ionic_invision/pull/102#discussion_r87341396"},"pull_request":{"href":"https://api.github.com/repos/upexcel/ionic_invision/pulls/102"}}},"pull_request":{"url":"https://api.github.com/repos/upexcel/ionic_invision/pulls/102","id":91977942,"html_url":"https://github.com/upexcel/ionic_invision/pull/102","diff_url":"https://github.com/upexcel/ionic_invision/pull/102.diff","patch_url":"https://github.com/upexcel/ionic_invision/pull/102.patch","issue_url":"https://api.github.com/repos/upexcel/ionic_invision/issues/102","number":102,"state":"open","locked":false,"title":"integrate apis review and create dynamic design","user":{"login":"upexcel","id":15088401,"avatar_url":"https://avatars.githubusercontent.com/u/15088401?v=3","gravatar_id":"","url":"https://api.github.com/users/upexcel","html_url":"https://github.com/upexcel","followers_url":"https://api.github.com/users/upexcel/followers","following_url":"https://api.github.com/users/upexcel/following{/other_user}","gists_url":"https://api.github.com/users/upexcel/gists{/gist_id}","starred_url":"https://api.github.com/users/upexcel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/upexcel/subscriptions","organizations_url":"https://api.github.com/users/upexcel/orgs","repos_url":"https://api.github.com/users/upexcel/repos","events_url":"https://api.github.com/users/upexcel/events{/privacy}","received_events_url":"https://api.github.com/users/upexcel/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-11-02T14:17:38Z","updated_at":"2016-11-10T07:42:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"424df05a13d45e4abbe32e5ec47ac0475894a703","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/upexcel/ionic_invision/pulls/102/commits","review_comments_url":"https://api.github.com/repos/upexcel/ionic_invision/pulls/102/comments","review_comment_url":"https://api.github.com/repos/upexcel/ionic_invision/pulls/comments{/number}","comments_url":"https://api.github.com/repos/upexcel/ionic_invision/issues/102/comments","statuses_url":"https://api.github.com/repos/upexcel/ionic_invision/statuses/44c2ce8b0ed7c24cb7d06b0f149df62ccdb16f91","head":{"label":"upexcel:review","ref":"review","sha":"44c2ce8b0ed7c24cb7d06b0f149df62ccdb16f91","user":{"login":"upexcel","id":15088401,"avatar_url":"https://avatars.githubusercontent.com/u/15088401?v=3","gravatar_id":"","url":"https://api.github.com/users/upexcel","html_url":"https://github.com/upexcel","followers_url":"https://api.github.com/users/upexcel/followers","following_url":"https://api.github.com/users/upexcel/following{/other_user}","gists_url":"https://api.github.com/users/upexcel/gists{/gist_id}","starred_url":"https://api.github.com/users/upexcel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/upexcel/subscriptions","organizations_url":"https://api.github.com/users/upexcel/orgs","repos_url":"https://api.github.com/users/upexcel/repos","events_url":"https://api.github.com/users/upexcel/events{/privacy}","received_events_url":"https://api.github.com/users/upexcel/received_events","type":"User","site_admin":false},"repo":{"id":67572050,"name":"ionic_invision","full_name":"upexcel/ionic_invision","owner":{"login":"upexcel","id":15088401,"avatar_url":"https://avatars.githubusercontent.com/u/15088401?v=3","gravatar_id":"","url":"https://api.github.com/users/upexcel","html_url":"https://github.com/upexcel","followers_url":"https://api.github.com/users/upexcel/followers","following_url":"https://api.github.com/users/upexcel/following{/other_user}","gists_url":"https://api.github.com/users/upexcel/gists{/gist_id}","starred_url":"https://api.github.com/users/upexcel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/upexcel/subscriptions","organizations_url":"https://api.github.com/users/upexcel/orgs","repos_url":"https://api.github.com/users/upexcel/repos","events_url":"https://api.github.com/users/upexcel/events{/privacy}","received_events_url":"https://api.github.com/users/upexcel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/upexcel/ionic_invision","description":null,"fork":false,"url":"https://api.github.com/repos/upexcel/ionic_invision","forks_url":"https://api.github.com/repos/upexcel/ionic_invision/forks","keys_url":"https://api.github.com/repos/upexcel/ionic_invision/keys{/key_id}","collaborators_url":"https://api.github.com/repos/upexcel/ionic_invision/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/upexcel/ionic_invision/teams","hooks_url":"https://api.github.com/repos/upexcel/ionic_invision/hooks","issue_events_url":"https://api.github.com/repos/upexcel/ionic_invision/issues/events{/number}","events_url":"https://api.github.com/repos/upexcel/ionic_invision/events","assignees_url":"https://api.github.com/repos/upexcel/ionic_invision/assignees{/user}","branches_url":"https://api.github.com/repos/upexcel/ionic_invision/branches{/branch}","tags_url":"https://api.github.com/repos/upexcel/ionic_invision/tags","blobs_url":"https://api.github.com/repos/upexcel/ionic_invision/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/upexcel/ionic_invision/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/upexcel/ionic_invision/git/refs{/sha}","trees_url":"https://api.github.com/repos/upexcel/ionic_invision/git/trees{/sha}","statuses_url":"https://api.github.com/repos/upexcel/ionic_invision/statuses/{sha}","languages_url":"https://api.github.com/repos/upexcel/ionic_invision/languages","stargazers_url":"https://api.github.com/repos/upexcel/ionic_invision/stargazers","contributors_url":"https://api.github.com/repos/upexcel/ionic_invision/contributors","subscribers_url":"https://api.github.com/repos/upexcel/ionic_invision/subscribers","subscription_url":"https://api.github.com/repos/upexcel/ionic_invision/subscription","commits_url":"https://api.github.com/repos/upexcel/ionic_invision/commits{/sha}","git_commits_url":"https://api.github.com/repos/upexcel/ionic_invision/git/commits{/sha}","comments_url":"https://api.github.com/repos/upexcel/ionic_invision/comments{/number}","issue_comment_url":"https://api.github.com/repos/upexcel/ionic_invision/issues/comments{/number}","contents_url":"https://api.github.com/repos/upexcel/ionic_invision/contents/{+path}","compare_url":"https://api.github.com/repos/upexcel/ionic_invision/compare/{base}...{head}","merges_url":"https://api.github.com/repos/upexcel/ionic_invision/merges","archive_url":"https://api.github.com/repos/upexcel/ionic_invision/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/upexcel/ionic_invision/downloads","issues_url":"https://api.github.com/repos/upexcel/ionic_invision/issues{/number}","pulls_url":"https://api.github.com/repos/upexcel/ionic_invision/pulls{/number}","milestones_url":"https://api.github.com/repos/upexcel/ionic_invision/milestones{/number}","notifications_url":"https://api.github.com/repos/upexcel/ionic_invision/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/upexcel/ionic_invision/labels{/name}","releases_url":"https://api.github.com/repos/upexcel/ionic_invision/releases{/id}","deployments_url":"https://api.github.com/repos/upexcel/ionic_invision/deployments","created_at":"2016-09-07T04:28:30Z","updated_at":"2016-10-13T06:55:07Z","pushed_at":"2016-11-10T07:00:54Z","git_url":"git://github.com/upexcel/ionic_invision.git","ssh_url":"git@github.com:upexcel/ionic_invision.git","clone_url":"https://github.com/upexcel/ionic_invision.git","svn_url":"https://github.com/upexcel/ionic_invision","homepage":null,"size":20110,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":19,"forks":0,"open_issues":19,"watchers":0,"default_branch":"master"}},"base":{"label":"upexcel:master","ref":"master","sha":"6d0b48d62ad8271666ca99f100efdf93067802f5","user":{"login":"upexcel","id":15088401,"avatar_url":"https://avatars.githubusercontent.com/u/15088401?v=3","gravatar_id":"","url":"https://api.github.com/users/upexcel","html_url":"https://github.com/upexcel","followers_url":"https://api.github.com/users/upexcel/followers","following_url":"https://api.github.com/users/upexcel/following{/other_user}","gists_url":"https://api.github.com/users/upexcel/gists{/gist_id}","starred_url":"https://api.github.com/users/upexcel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/upexcel/subscriptions","organizations_url":"https://api.github.com/users/upexcel/orgs","repos_url":"https://api.github.com/users/upexcel/repos","events_url":"https://api.github.com/users/upexcel/events{/privacy}","received_events_url":"https://api.github.com/users/upexcel/received_events","type":"User","site_admin":false},"repo":{"id":67572050,"name":"ionic_invision","full_name":"upexcel/ionic_invision","owner":{"login":"upexcel","id":15088401,"avatar_url":"https://avatars.githubusercontent.com/u/15088401?v=3","gravatar_id":"","url":"https://api.github.com/users/upexcel","html_url":"https://github.com/upexcel","followers_url":"https://api.github.com/users/upexcel/followers","following_url":"https://api.github.com/users/upexcel/following{/other_user}","gists_url":"https://api.github.com/users/upexcel/gists{/gist_id}","starred_url":"https://api.github.com/users/upexcel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/upexcel/subscriptions","organizations_url":"https://api.github.com/users/upexcel/orgs","repos_url":"https://api.github.com/users/upexcel/repos","events_url":"https://api.github.com/users/upexcel/events{/privacy}","received_events_url":"https://api.github.com/users/upexcel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/upexcel/ionic_invision","description":null,"fork":false,"url":"https://api.github.com/repos/upexcel/ionic_invision","forks_url":"https://api.github.com/repos/upexcel/ionic_invision/forks","keys_url":"https://api.github.com/repos/upexcel/ionic_invision/keys{/key_id}","collaborators_url":"https://api.github.com/repos/upexcel/ionic_invision/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/upexcel/ionic_invision/teams","hooks_url":"https://api.github.com/repos/upexcel/ionic_invision/hooks","issue_events_url":"https://api.github.com/repos/upexcel/ionic_invision/issues/events{/number}","events_url":"https://api.github.com/repos/upexcel/ionic_invision/events","assignees_url":"https://api.github.com/repos/upexcel/ionic_invision/assignees{/user}","branches_url":"https://api.github.com/repos/upexcel/ionic_invision/branches{/branch}","tags_url":"https://api.github.com/repos/upexcel/ionic_invision/tags","blobs_url":"https://api.github.com/repos/upexcel/ionic_invision/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/upexcel/ionic_invision/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/upexcel/ionic_invision/git/refs{/sha}","trees_url":"https://api.github.com/repos/upexcel/ionic_invision/git/trees{/sha}","statuses_url":"https://api.github.com/repos/upexcel/ionic_invision/statuses/{sha}","languages_url":"https://api.github.com/repos/upexcel/ionic_invision/languages","stargazers_url":"https://api.github.com/repos/upexcel/ionic_invision/stargazers","contributors_url":"https://api.github.com/repos/upexcel/ionic_invision/contributors","subscribers_url":"https://api.github.com/repos/upexcel/ionic_invision/subscribers","subscription_url":"https://api.github.com/repos/upexcel/ionic_invision/subscription","commits_url":"https://api.github.com/repos/upexcel/ionic_invision/commits{/sha}","git_commits_url":"https://api.github.com/repos/upexcel/ionic_invision/git/commits{/sha}","comments_url":"https://api.github.com/repos/upexcel/ionic_invision/comments{/number}","issue_comment_url":"https://api.github.com/repos/upexcel/ionic_invision/issues/comments{/number}","contents_url":"https://api.github.com/repos/upexcel/ionic_invision/contents/{+path}","compare_url":"https://api.github.com/repos/upexcel/ionic_invision/compare/{base}...{head}","merges_url":"https://api.github.com/repos/upexcel/ionic_invision/merges","archive_url":"https://api.github.com/repos/upexcel/ionic_invision/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/upexcel/ionic_invision/downloads","issues_url":"https://api.github.com/repos/upexcel/ionic_invision/issues{/number}","pulls_url":"https://api.github.com/repos/upexcel/ionic_invision/pulls{/number}","milestones_url":"https://api.github.com/repos/upexcel/ionic_invision/milestones{/number}","notifications_url":"https://api.github.com/repos/upexcel/ionic_invision/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/upexcel/ionic_invision/labels{/name}","releases_url":"https://api.github.com/repos/upexcel/ionic_invision/releases{/id}","deployments_url":"https://api.github.com/repos/upexcel/ionic_invision/deployments","created_at":"2016-09-07T04:28:30Z","updated_at":"2016-10-13T06:55:07Z","pushed_at":"2016-11-10T07:00:54Z","git_url":"git://github.com/upexcel/ionic_invision.git","ssh_url":"git@github.com:upexcel/ionic_invision.git","clone_url":"https://github.com/upexcel/ionic_invision.git","svn_url":"https://github.com/upexcel/ionic_invision","homepage":null,"size":20110,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":19,"forks":0,"open_issues":19,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/upexcel/ionic_invision/pulls/102"},"html":{"href":"https://github.com/upexcel/ionic_invision/pull/102"},"issue":{"href":"https://api.github.com/repos/upexcel/ionic_invision/issues/102"},"comments":{"href":"https://api.github.com/repos/upexcel/ionic_invision/issues/102/comments"},"review_comments":{"href":"https://api.github.com/repos/upexcel/ionic_invision/pulls/102/comments"},"review_comment":{"href":"https://api.github.com/repos/upexcel/ionic_invision/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/upexcel/ionic_invision/pulls/102/commits"},"statuses":{"href":"https://api.github.com/repos/upexcel/ionic_invision/statuses/44c2ce8b0ed7c24cb7d06b0f149df62ccdb16f91"}}}}
{"actor":{"display_login":"reactexcel"}}