{"action":"created","comment":{"url":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/pulls/comments/72172093","id":72172093,"diff_hunk":"@@ -0,0 +1,187 @@\n+﻿import {Component, ViewChild, AfterViewInit, Input, Output, EventEmitter} from '@angular/core';\n+import {FunctionsService} from '../services/functions.service';\n+import {BroadcastService} from '../services/broadcast.service';\n+import {UserService} from '../services/user.service';\n+import {BroadcastEvent} from '../models/broadcast-event'\n+import {BindingType} from '../models/binding';\n+import {FunctionTemplate} from '../models/function-template';\n+import {FunctionInfo} from '../models/function-info';\n+import {TutorialEvent, TutorialStep} from '../models/tutorial';\n+import {BindingManager} from '../models/binding-manager';\n+import {ErrorEvent} from '../models/error-event';\n+import {GlobalStateService} from '../services/global-state.service';\n+import {UIResource} from '../models/ui-resource';\n+import {FunctionContainer} from '../models/function-container';\n+import {BusyStateComponent} from './busy-state.component';\n+import {TranslateService, TranslatePipe} from 'ng2-translate/ng2-translate';\n+import {PortalResources} from '../models/portal-resources';\n+\n+@Component({\n+    selector: 'try-landing',\n+    templateUrl: 'templates/try-landing.component.html',\n+    styleUrls: ['styles/try-landing.style.css'],\n+    directives: [BusyStateComponent],\n+    pipes: [TranslatePipe]\n+})\n+\n+export class TryLandingComponent {\n+    @ViewChild(BusyStateComponent) busyState: BusyStateComponent;\n+    @Output() tryFunctionsContainer: EventEmitter<FunctionContainer>;\n+    public functionsInfo: FunctionInfo[] = new Array();\n+    bc: BindingManager = new BindingManager();\n+    loginOptions: boolean = false;\n+    selectedFunction: string;\n+    selectedLanguage: string;\n+\n+    constructor(private _functionsService: FunctionsService,\n+        private _broadcastService: BroadcastService,\n+        private _globalStateService: GlobalStateService,\n+        private _userService: UserService,\n+        private _translateService: TranslateService\n+    ) {\n+\n+        this.tryFunctionsContainer = new EventEmitter<FunctionContainer>();\n+        if (this._globalStateService.TryAppServiceToken) {\n+            this._globalStateService.setBusyState();\n+            this.selectedFunction = this._functionsService.selectedFunction;\n+            this.selectedLanguage = this._functionsService.selectedLanguage;\n+\n+            this._functionsService.getTemplates().subscribe((templates) => {\n+                var selectedTemplate: FunctionTemplate = templates.find((t) => {\n+                    return t.id === this._functionsService.selectedFunction + \"-\" + this._functionsService.selectedLanguage;\n+                });\n+\n+                if (selectedTemplate) {\n+                    this._functionsService.createTrialResource(selectedTemplate,\n+                        this._functionsService.selectedProvider, this._functionsService.selectedFunctionName)\n+                        .subscribe((resource) => {\n+                            this.createFunctioninResource(resource, selectedTemplate, this._functionsService.selectedFunctionName);\n+                        },\n+                        error => {\n+                            if (error.status === 400) {\n+                                // If there is already a free resource assigned ,\n+                                // we'll get a HTTP 400 ..so lets get it.\n+                                this._functionsService.getTrialResource(this._functionsService.selectedProvider)\n+                                    .subscribe((resource) => {\n+                                        this.createFunctioninResource(resource, selectedTemplate, this._functionsService.selectedFunctionName);\n+                                    });\n+                            }});\n+                }\n+            });\n+            this._globalStateService.clearBusyState();\n+        } else {\n+            this.selectedFunction = \"TimerTrigger\";\n+            this.selectedLanguage = \"CSharp\";\n+        }\n+        var result = this._functionsService.getNewFunctionNode();\n+        this.functionsInfo.push(result);","path":"AzureFunctions.Client/app/components/try-landing.component.ts","position":77,"original_position":77,"commit_id":"8db8f8fbcb102b7b64c90425b307eab8ee5fe6f5","original_commit_id":"8db8f8fbcb102b7b64c90425b307eab8ee5fe6f5","user":{"login":"ahmelsayed","id":645740,"avatar_url":"https://avatars.githubusercontent.com/u/645740?v=3","gravatar_id":"","url":"https://api.github.com/users/ahmelsayed","html_url":"https://github.com/ahmelsayed","followers_url":"https://api.github.com/users/ahmelsayed/followers","following_url":"https://api.github.com/users/ahmelsayed/following{/other_user}","gists_url":"https://api.github.com/users/ahmelsayed/gists{/gist_id}","starred_url":"https://api.github.com/users/ahmelsayed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahmelsayed/subscriptions","organizations_url":"https://api.github.com/users/ahmelsayed/orgs","repos_url":"https://api.github.com/users/ahmelsayed/repos","events_url":"https://api.github.com/users/ahmelsayed/events{/privacy}","received_events_url":"https://api.github.com/users/ahmelsayed/received_events","type":"User","site_admin":false},"body":"Ideally all that is the constructor should move to an `ngOnInit()` function.","created_at":"2016-07-26T00:54:40Z","updated_at":"2016-07-26T00:54:40Z","html_url":"https://github.com/projectkudu/AzureFunctionsPortal/pull/442#discussion_r72172093","pull_request_url":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/pulls/442","_links":{"self":{"href":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/pulls/comments/72172093"},"html":{"href":"https://github.com/projectkudu/AzureFunctionsPortal/pull/442#discussion_r72172093"},"pull_request":{"href":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/pulls/442"}}},"pull_request":{"url":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/pulls/442","id":77695479,"html_url":"https://github.com/projectkudu/AzureFunctionsPortal/pull/442","diff_url":"https://github.com/projectkudu/AzureFunctionsPortal/pull/442.diff","patch_url":"https://github.com/projectkudu/AzureFunctionsPortal/pull/442.patch","issue_url":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/issues/442","number":442,"state":"open","locked":false,"title":"Initial checkin for refactor feedback.  Still need to rebase with dev ","user":{"login":"fashaikh","id":2650941,"avatar_url":"https://avatars.githubusercontent.com/u/2650941?v=3","gravatar_id":"","url":"https://api.github.com/users/fashaikh","html_url":"https://github.com/fashaikh","followers_url":"https://api.github.com/users/fashaikh/followers","following_url":"https://api.github.com/users/fashaikh/following{/other_user}","gists_url":"https://api.github.com/users/fashaikh/gists{/gist_id}","starred_url":"https://api.github.com/users/fashaikh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fashaikh/subscriptions","organizations_url":"https://api.github.com/users/fashaikh/orgs","repos_url":"https://api.github.com/users/fashaikh/repos","events_url":"https://api.github.com/users/fashaikh/events{/privacy}","received_events_url":"https://api.github.com/users/fashaikh/received_events","type":"User","site_admin":false},"body":"Initial checkin for refactor feedback. Centralize try mode states ?  Open function right away after auth instead of showing quickstart .","created_at":"2016-07-16T00:46:02Z","updated_at":"2016-07-26T00:54:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1ee7485853db5275882a389a491f6ad6d4f9816e","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/pulls/442/commits","review_comments_url":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/pulls/442/comments","review_comment_url":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/pulls/comments{/number}","comments_url":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/issues/442/comments","statuses_url":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/statuses/8db8f8fbcb102b7b64c90425b307eab8ee5fe6f5","head":{"label":"fashaikh:dev","ref":"dev","sha":"8db8f8fbcb102b7b64c90425b307eab8ee5fe6f5","user":{"login":"fashaikh","id":2650941,"avatar_url":"https://avatars.githubusercontent.com/u/2650941?v=3","gravatar_id":"","url":"https://api.github.com/users/fashaikh","html_url":"https://github.com/fashaikh","followers_url":"https://api.github.com/users/fashaikh/followers","following_url":"https://api.github.com/users/fashaikh/following{/other_user}","gists_url":"https://api.github.com/users/fashaikh/gists{/gist_id}","starred_url":"https://api.github.com/users/fashaikh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fashaikh/subscriptions","organizations_url":"https://api.github.com/users/fashaikh/orgs","repos_url":"https://api.github.com/users/fashaikh/repos","events_url":"https://api.github.com/users/fashaikh/events{/privacy}","received_events_url":"https://api.github.com/users/fashaikh/received_events","type":"User","site_admin":false},"repo":{"id":61652403,"name":"AzureFunctionsPortal","full_name":"fashaikh/AzureFunctionsPortal","owner":{"login":"fashaikh","id":2650941,"avatar_url":"https://avatars.githubusercontent.com/u/2650941?v=3","gravatar_id":"","url":"https://api.github.com/users/fashaikh","html_url":"https://github.com/fashaikh","followers_url":"https://api.github.com/users/fashaikh/followers","following_url":"https://api.github.com/users/fashaikh/following{/other_user}","gists_url":"https://api.github.com/users/fashaikh/gists{/gist_id}","starred_url":"https://api.github.com/users/fashaikh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fashaikh/subscriptions","organizations_url":"https://api.github.com/users/fashaikh/orgs","repos_url":"https://api.github.com/users/fashaikh/repos","events_url":"https://api.github.com/users/fashaikh/events{/privacy}","received_events_url":"https://api.github.com/users/fashaikh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fashaikh/AzureFunctionsPortal","description":"Azure Functions UX","fork":true,"url":"https://api.github.com/repos/fashaikh/AzureFunctionsPortal","forks_url":"https://api.github.com/repos/fashaikh/AzureFunctionsPortal/forks","keys_url":"https://api.github.com/repos/fashaikh/AzureFunctionsPortal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fashaikh/AzureFunctionsPortal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fashaikh/AzureFunctionsPortal/teams","hooks_url":"https://api.github.com/repos/fashaikh/AzureFunctionsPortal/hooks","issue_events_url":"https://api.github.com/repos/fashaikh/AzureFunctionsPortal/issues/events{/number}","events_url":"https://api.github.com/repos/fashaikh/AzureFunctionsPortal/events","assignees_url":"https://api.github.com/repos/fashaikh/AzureFunctionsPortal/assignees{/user}","branches_url":"https://api.github.com/repos/fashaikh/AzureFunctionsPortal/branches{/branch}","tags_url":"https://api.github.com/repos/fashaikh/AzureFunctionsPortal/tags","blobs_url":"https://api.github.com/repos/fashaikh/AzureFunctionsPortal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fashaikh/AzureFunctionsPortal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fashaikh/AzureFunctionsPortal/git/refs{/sha}","trees_url":"https://api.github.com/repos/fashaikh/AzureFunctionsPortal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fashaikh/AzureFunctionsPortal/statuses/{sha}","languages_url":"https://api.github.com/repos/fashaikh/AzureFunctionsPortal/languages","stargazers_url":"https://api.github.com/repos/fashaikh/AzureFunctionsPortal/stargazers","contributors_url":"https://api.github.com/repos/fashaikh/AzureFunctionsPortal/contributors","subscribers_url":"https://api.github.com/repos/fashaikh/AzureFunctionsPortal/subscribers","subscription_url":"https://api.github.com/repos/fashaikh/AzureFunctionsPortal/subscription","commits_url":"https://api.github.com/repos/fashaikh/AzureFunctionsPortal/commits{/sha}","git_commits_url":"https://api.github.com/repos/fashaikh/AzureFunctionsPortal/git/commits{/sha}","comments_url":"https://api.github.com/repos/fashaikh/AzureFunctionsPortal/comments{/number}","issue_comment_url":"https://api.github.com/repos/fashaikh/AzureFunctionsPortal/issues/comments{/number}","contents_url":"https://api.github.com/repos/fashaikh/AzureFunctionsPortal/contents/{+path}","compare_url":"https://api.github.com/repos/fashaikh/AzureFunctionsPortal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fashaikh/AzureFunctionsPortal/merges","archive_url":"https://api.github.com/repos/fashaikh/AzureFunctionsPortal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fashaikh/AzureFunctionsPortal/downloads","issues_url":"https://api.github.com/repos/fashaikh/AzureFunctionsPortal/issues{/number}","pulls_url":"https://api.github.com/repos/fashaikh/AzureFunctionsPortal/pulls{/number}","milestones_url":"https://api.github.com/repos/fashaikh/AzureFunctionsPortal/milestones{/number}","notifications_url":"https://api.github.com/repos/fashaikh/AzureFunctionsPortal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fashaikh/AzureFunctionsPortal/labels{/name}","releases_url":"https://api.github.com/repos/fashaikh/AzureFunctionsPortal/releases{/id}","deployments_url":"https://api.github.com/repos/fashaikh/AzureFunctionsPortal/deployments","created_at":"2016-06-21T17:12:07Z","updated_at":"2016-06-21T17:12:08Z","pushed_at":"2016-07-25T22:30:35Z","git_url":"git://github.com/fashaikh/AzureFunctionsPortal.git","ssh_url":"git@github.com:fashaikh/AzureFunctionsPortal.git","clone_url":"https://github.com/fashaikh/AzureFunctionsPortal.git","svn_url":"https://github.com/fashaikh/AzureFunctionsPortal","homepage":"https://functions.azure.com","size":1552,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"dev"}},"base":{"label":"projectkudu:dev","ref":"dev","sha":"2be700e83461b6745e31566bf85bca1286d4a13b","user":{"login":"projectkudu","id":927131,"avatar_url":"https://avatars.githubusercontent.com/u/927131?v=3","gravatar_id":"","url":"https://api.github.com/users/projectkudu","html_url":"https://github.com/projectkudu","followers_url":"https://api.github.com/users/projectkudu/followers","following_url":"https://api.github.com/users/projectkudu/following{/other_user}","gists_url":"https://api.github.com/users/projectkudu/gists{/gist_id}","starred_url":"https://api.github.com/users/projectkudu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projectkudu/subscriptions","organizations_url":"https://api.github.com/users/projectkudu/orgs","repos_url":"https://api.github.com/users/projectkudu/repos","events_url":"https://api.github.com/users/projectkudu/events{/privacy}","received_events_url":"https://api.github.com/users/projectkudu/received_events","type":"Organization","site_admin":false},"repo":{"id":50877831,"name":"AzureFunctionsPortal","full_name":"projectkudu/AzureFunctionsPortal","owner":{"login":"projectkudu","id":927131,"avatar_url":"https://avatars.githubusercontent.com/u/927131?v=3","gravatar_id":"","url":"https://api.github.com/users/projectkudu","html_url":"https://github.com/projectkudu","followers_url":"https://api.github.com/users/projectkudu/followers","following_url":"https://api.github.com/users/projectkudu/following{/other_user}","gists_url":"https://api.github.com/users/projectkudu/gists{/gist_id}","starred_url":"https://api.github.com/users/projectkudu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projectkudu/subscriptions","organizations_url":"https://api.github.com/users/projectkudu/orgs","repos_url":"https://api.github.com/users/projectkudu/repos","events_url":"https://api.github.com/users/projectkudu/events{/privacy}","received_events_url":"https://api.github.com/users/projectkudu/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/projectkudu/AzureFunctionsPortal","description":"Azure Functions UX","fork":false,"url":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal","forks_url":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/forks","keys_url":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/teams","hooks_url":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/hooks","issue_events_url":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/issues/events{/number}","events_url":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/events","assignees_url":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/assignees{/user}","branches_url":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/branches{/branch}","tags_url":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/tags","blobs_url":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/git/refs{/sha}","trees_url":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/statuses/{sha}","languages_url":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/languages","stargazers_url":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/stargazers","contributors_url":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/contributors","subscribers_url":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/subscribers","subscription_url":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/subscription","commits_url":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/commits{/sha}","git_commits_url":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/git/commits{/sha}","comments_url":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/comments{/number}","issue_comment_url":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/issues/comments{/number}","contents_url":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/contents/{+path}","compare_url":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/merges","archive_url":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/downloads","issues_url":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/issues{/number}","pulls_url":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/pulls{/number}","milestones_url":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/milestones{/number}","notifications_url":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/labels{/name}","releases_url":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/releases{/id}","deployments_url":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/deployments","created_at":"2016-02-01T23:01:22Z","updated_at":"2016-07-16T11:15:09Z","pushed_at":"2016-07-25T22:30:35Z","git_url":"git://github.com/projectkudu/AzureFunctionsPortal.git","ssh_url":"git@github.com:projectkudu/AzureFunctionsPortal.git","clone_url":"https://github.com/projectkudu/AzureFunctionsPortal.git","svn_url":"https://github.com/projectkudu/AzureFunctionsPortal","homepage":"https://functions.azure.com","size":1614,"stargazers_count":59,"watchers_count":59,"language":"TypeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":59,"forks":13,"open_issues":59,"watchers":59,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/pulls/442"},"html":{"href":"https://github.com/projectkudu/AzureFunctionsPortal/pull/442"},"issue":{"href":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/issues/442"},"comments":{"href":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/issues/442/comments"},"review_comments":{"href":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/pulls/442/comments"},"review_comment":{"href":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/pulls/442/commits"},"statuses":{"href":"https://api.github.com/repos/projectkudu/AzureFunctionsPortal/statuses/8db8f8fbcb102b7b64c90425b307eab8ee5fe6f5"}}}}
{"actor":{"display_login":"ahmelsayed"}}