{"action":"created","comment":{"url":"https://api.github.com/repos/AlisProject/frontend-application/pulls/comments/199049301","pull_request_review_id":133093514,"id":199049301,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5OTA0OTMwMQ==","diff_hunk":"@@ -0,0 +1,346 @@\n+<template>\n+  <div class=\"search-page-container\" :class=\"showArticles ? 'article' : 'user'\" @scroll=\"infiniteScroll\">\n+    <app-header showDefaultHeaderNav showOnlySessionLinks class=\"logo-original\"/>\n+    <h1 class=\"area-title\">{{ title }}</h1>\n+    <form @submit.prevent=\"search\" class=\"area-search\">\n+      <input\n+        type=\"text\"\n+        class=\"form-input\"\n+        required\n+        v-model=\"inputText\"\n+        ref=\"searchInput\">\n+      <img\n+        @click=\"search\"\n+        class=\"search-icon\"\n+        src=\"~assets/images/pc/common/icon_search.png\">\n+    </form>\n+    <nav class=\"area-nav\" v-if=\"showNav\">\n+      <span\n+        class=\"area-article nav-link\"\n+        :class=\"{ 'selected': showArticles }\"\n+        @click=\"showArticleResult\">記事</span>\n+      <span\n+        class=\"area-user nav-link\"\n+        :class=\"{ 'selected': !showArticles }\"\n+        @click=\"showSearchResult\">ユーザー</span>\n+    </nav>\n+    <div class=\"area-search-result\">\n+      <search-article-card-list :articles=\"searchArticles\" v-if=\"showArticles\"/>\n+      <search-user-card-list :users=\"searchUsers\" v-else/>\n+    </div>\n+    <the-loader :lastEvaluatedKey=\"notificationsLastEvaluatedKey\"/>\n+    <app-footer/>\n+  </div>\n+</template>\n+\n+<script>\n+import { mapGetters, mapActions } from 'vuex'\n+import AppHeader from '../organisms/AppHeader'\n+import SearchArticleCardList from '../organisms/SearchArticleCardList'\n+import SearchUserCardList from '../organisms/SearchUserCardList'\n+import TheLoader from '../atoms/TheLoader'\n+import AppFooter from '../organisms/AppFooter'\n+\n+export default {\n+  components: {\n+    AppHeader,\n+    SearchArticleCardList,\n+    SearchUserCardList,\n+    TheLoader,\n+    AppFooter\n+  },\n+  computed: {\n+    title() {\n+      return 'SEARCH'\n+    },\n+    ...mapGetters('article', ['searchArticles']),\n+    ...mapGetters('user', [\n+      'searchUsers',\n+      'notificationsLastEvaluatedKey',\n+      'hasNotificationsLastEvaluatedKey'\n+    ]),\n+    ...mapGetters('presentation', ['notificationListScrollHeight'])\n+  },\n+  created() {\n+    this.query = this.$route.query.q\n+    this.showNav = !!this.query\n+  },\n+  mounted() {\n+    if (this.notificationListScrollHeight) {\n+      this.$el.scrollTop = this.notificationListScrollHeight\n+    }\n+    this.$el.querySelector('.area-search').focus()\n+    if (location.pathname.startsWith('/search/users')) {\n+      this.showArticles = false\n+    }\n+    this.inputText = this.$route.query.q\n+  },\n+  data() {\n+    return {\n+      canLoadNextData: true,\n+      isFetchingData: false,\n+      showArticles: true,\n+      query: null,\n+      showNav: false,\n+      inputText: ''\n+    }\n+  },\n+  beforeDestroy() {\n+    this.setNotificationListScrollHeight({ scrollHeight: this.$el.scrollTop })\n+  },\n+  methods: {\n+    async search() {\n+      this.query = this.$refs.searchInput.value\n+      if (!this.query) return\n+      this.showNav = true\n+      history.replaceState(","path":"app/components/pages/SearchPage.vue","position":96,"original_position":96,"commit_id":"4caa17dc7a3cc31cc28e77c0fbb77287d826de25","original_commit_id":"4caa17dc7a3cc31cc28e77c0fbb77287d826de25","user":{"login":"potato4d","id":6993514,"node_id":"MDQ6VXNlcjY5OTM1MTQ=","avatar_url":"https://avatars0.githubusercontent.com/u/6993514?v=4","gravatar_id":"","url":"https://api.github.com/users/potato4d","html_url":"https://github.com/potato4d","followers_url":"https://api.github.com/users/potato4d/followers","following_url":"https://api.github.com/users/potato4d/following{/other_user}","gists_url":"https://api.github.com/users/potato4d/gists{/gist_id}","starred_url":"https://api.github.com/users/potato4d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/potato4d/subscriptions","organizations_url":"https://api.github.com/users/potato4d/orgs","repos_url":"https://api.github.com/users/potato4d/repos","events_url":"https://api.github.com/users/potato4d/events{/privacy}","received_events_url":"https://api.github.com/users/potato4d/received_events","type":"User","site_admin":false},"body":"おそらくクエリパラメータが変化したところで実際のルーティングが変わらないために Vue コンポーネントが破棄されないため、 `$router.push()` や `$router.replace()` ではなく `history.replaceState()` を直で叩いたかと思いますが、こういう場合は Cookbook にもある `$route` を監視する方法を利用すると、 Vue の範囲を逸脱せずに簡潔に記述することができます。\r\n\r\nhttps://jp.vuejs.org/v2/cookbook/serverless-blog.html#%E6%8A%95%E7%A8%BF%E3%81%AE%E8%A1%A8%E7%A4%BA","created_at":"2018-06-29T04:17:21Z","updated_at":"2018-06-29T04:22:01Z","html_url":"https://github.com/AlisProject/frontend-application/pull/275#discussion_r199049301","pull_request_url":"https://api.github.com/repos/AlisProject/frontend-application/pulls/275","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/AlisProject/frontend-application/pulls/comments/199049301"},"html":{"href":"https://github.com/AlisProject/frontend-application/pull/275#discussion_r199049301"},"pull_request":{"href":"https://api.github.com/repos/AlisProject/frontend-application/pulls/275"}}},"pull_request":{"url":"https://api.github.com/repos/AlisProject/frontend-application/pulls/275","id":198210570,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk4MjEwNTcw","html_url":"https://github.com/AlisProject/frontend-application/pull/275","diff_url":"https://github.com/AlisProject/frontend-application/pull/275.diff","patch_url":"https://github.com/AlisProject/frontend-application/pull/275.patch","issue_url":"https://api.github.com/repos/AlisProject/frontend-application/issues/275","number":275,"state":"open","locked":false,"title":"[WIP] ALIS-1045: Add search feature","user":{"login":"y-temp4","id":13657589,"node_id":"MDQ6VXNlcjEzNjU3NTg5","avatar_url":"https://avatars0.githubusercontent.com/u/13657589?v=4","gravatar_id":"","url":"https://api.github.com/users/y-temp4","html_url":"https://github.com/y-temp4","followers_url":"https://api.github.com/users/y-temp4/followers","following_url":"https://api.github.com/users/y-temp4/following{/other_user}","gists_url":"https://api.github.com/users/y-temp4/gists{/gist_id}","starred_url":"https://api.github.com/users/y-temp4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/y-temp4/subscriptions","organizations_url":"https://api.github.com/users/y-temp4/orgs","repos_url":"https://api.github.com/users/y-temp4/repos","events_url":"https://api.github.com/users/y-temp4/events{/privacy}","received_events_url":"https://api.github.com/users/y-temp4/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-06-29T04:11:12Z","updated_at":"2018-06-29T04:22:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4d07939aedc44cace5320d2ae7482779591fb6ae","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/AlisProject/frontend-application/pulls/275/commits","review_comments_url":"https://api.github.com/repos/AlisProject/frontend-application/pulls/275/comments","review_comment_url":"https://api.github.com/repos/AlisProject/frontend-application/pulls/comments{/number}","comments_url":"https://api.github.com/repos/AlisProject/frontend-application/issues/275/comments","statuses_url":"https://api.github.com/repos/AlisProject/frontend-application/statuses/4caa17dc7a3cc31cc28e77c0fbb77287d826de25","head":{"label":"y-temp4:feature-search","ref":"feature-search","sha":"4caa17dc7a3cc31cc28e77c0fbb77287d826de25","user":{"login":"y-temp4","id":13657589,"node_id":"MDQ6VXNlcjEzNjU3NTg5","avatar_url":"https://avatars0.githubusercontent.com/u/13657589?v=4","gravatar_id":"","url":"https://api.github.com/users/y-temp4","html_url":"https://github.com/y-temp4","followers_url":"https://api.github.com/users/y-temp4/followers","following_url":"https://api.github.com/users/y-temp4/following{/other_user}","gists_url":"https://api.github.com/users/y-temp4/gists{/gist_id}","starred_url":"https://api.github.com/users/y-temp4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/y-temp4/subscriptions","organizations_url":"https://api.github.com/users/y-temp4/orgs","repos_url":"https://api.github.com/users/y-temp4/repos","events_url":"https://api.github.com/users/y-temp4/events{/privacy}","received_events_url":"https://api.github.com/users/y-temp4/received_events","type":"User","site_admin":false},"repo":{"id":124645842,"node_id":"MDEwOlJlcG9zaXRvcnkxMjQ2NDU4NDI=","name":"frontend-application","full_name":"y-temp4/frontend-application","owner":{"login":"y-temp4","id":13657589,"node_id":"MDQ6VXNlcjEzNjU3NTg5","avatar_url":"https://avatars0.githubusercontent.com/u/13657589?v=4","gravatar_id":"","url":"https://api.github.com/users/y-temp4","html_url":"https://github.com/y-temp4","followers_url":"https://api.github.com/users/y-temp4/followers","following_url":"https://api.github.com/users/y-temp4/following{/other_user}","gists_url":"https://api.github.com/users/y-temp4/gists{/gist_id}","starred_url":"https://api.github.com/users/y-temp4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/y-temp4/subscriptions","organizations_url":"https://api.github.com/users/y-temp4/orgs","repos_url":"https://api.github.com/users/y-temp4/repos","events_url":"https://api.github.com/users/y-temp4/events{/privacy}","received_events_url":"https://api.github.com/users/y-temp4/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/y-temp4/frontend-application","description":"💮 ALIS Media - Frontend Application","fork":true,"url":"https://api.github.com/repos/y-temp4/frontend-application","forks_url":"https://api.github.com/repos/y-temp4/frontend-application/forks","keys_url":"https://api.github.com/repos/y-temp4/frontend-application/keys{/key_id}","collaborators_url":"https://api.github.com/repos/y-temp4/frontend-application/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/y-temp4/frontend-application/teams","hooks_url":"https://api.github.com/repos/y-temp4/frontend-application/hooks","issue_events_url":"https://api.github.com/repos/y-temp4/frontend-application/issues/events{/number}","events_url":"https://api.github.com/repos/y-temp4/frontend-application/events","assignees_url":"https://api.github.com/repos/y-temp4/frontend-application/assignees{/user}","branches_url":"https://api.github.com/repos/y-temp4/frontend-application/branches{/branch}","tags_url":"https://api.github.com/repos/y-temp4/frontend-application/tags","blobs_url":"https://api.github.com/repos/y-temp4/frontend-application/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/y-temp4/frontend-application/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/y-temp4/frontend-application/git/refs{/sha}","trees_url":"https://api.github.com/repos/y-temp4/frontend-application/git/trees{/sha}","statuses_url":"https://api.github.com/repos/y-temp4/frontend-application/statuses/{sha}","languages_url":"https://api.github.com/repos/y-temp4/frontend-application/languages","stargazers_url":"https://api.github.com/repos/y-temp4/frontend-application/stargazers","contributors_url":"https://api.github.com/repos/y-temp4/frontend-application/contributors","subscribers_url":"https://api.github.com/repos/y-temp4/frontend-application/subscribers","subscription_url":"https://api.github.com/repos/y-temp4/frontend-application/subscription","commits_url":"https://api.github.com/repos/y-temp4/frontend-application/commits{/sha}","git_commits_url":"https://api.github.com/repos/y-temp4/frontend-application/git/commits{/sha}","comments_url":"https://api.github.com/repos/y-temp4/frontend-application/comments{/number}","issue_comment_url":"https://api.github.com/repos/y-temp4/frontend-application/issues/comments{/number}","contents_url":"https://api.github.com/repos/y-temp4/frontend-application/contents/{+path}","compare_url":"https://api.github.com/repos/y-temp4/frontend-application/compare/{base}...{head}","merges_url":"https://api.github.com/repos/y-temp4/frontend-application/merges","archive_url":"https://api.github.com/repos/y-temp4/frontend-application/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/y-temp4/frontend-application/downloads","issues_url":"https://api.github.com/repos/y-temp4/frontend-application/issues{/number}","pulls_url":"https://api.github.com/repos/y-temp4/frontend-application/pulls{/number}","milestones_url":"https://api.github.com/repos/y-temp4/frontend-application/milestones{/number}","notifications_url":"https://api.github.com/repos/y-temp4/frontend-application/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/y-temp4/frontend-application/labels{/name}","releases_url":"https://api.github.com/repos/y-temp4/frontend-application/releases{/id}","deployments_url":"https://api.github.com/repos/y-temp4/frontend-application/deployments","created_at":"2018-03-10T10:37:11Z","updated_at":"2018-05-11T13:08:42Z","pushed_at":"2018-06-29T04:10:28Z","git_url":"git://github.com/y-temp4/frontend-application.git","ssh_url":"git@github.com:y-temp4/frontend-application.git","clone_url":"https://github.com/y-temp4/frontend-application.git","svn_url":"https://github.com/y-temp4/frontend-application","homepage":"","size":3819,"stargazers_count":0,"watchers_count":0,"language":"Vue","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"AlisProject:develop","ref":"develop","sha":"119add6f880ac5252e87083cf5a397ba13fc975a","user":{"login":"AlisProject","id":29245117,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI5MjQ1MTE3","avatar_url":"https://avatars2.githubusercontent.com/u/29245117?v=4","gravatar_id":"","url":"https://api.github.com/users/AlisProject","html_url":"https://github.com/AlisProject","followers_url":"https://api.github.com/users/AlisProject/followers","following_url":"https://api.github.com/users/AlisProject/following{/other_user}","gists_url":"https://api.github.com/users/AlisProject/gists{/gist_id}","starred_url":"https://api.github.com/users/AlisProject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlisProject/subscriptions","organizations_url":"https://api.github.com/users/AlisProject/orgs","repos_url":"https://api.github.com/users/AlisProject/repos","events_url":"https://api.github.com/users/AlisProject/events{/privacy}","received_events_url":"https://api.github.com/users/AlisProject/received_events","type":"Organization","site_admin":false},"repo":{"id":117187953,"node_id":"MDEwOlJlcG9zaXRvcnkxMTcxODc5NTM=","name":"frontend-application","full_name":"AlisProject/frontend-application","owner":{"login":"AlisProject","id":29245117,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI5MjQ1MTE3","avatar_url":"https://avatars2.githubusercontent.com/u/29245117?v=4","gravatar_id":"","url":"https://api.github.com/users/AlisProject","html_url":"https://github.com/AlisProject","followers_url":"https://api.github.com/users/AlisProject/followers","following_url":"https://api.github.com/users/AlisProject/following{/other_user}","gists_url":"https://api.github.com/users/AlisProject/gists{/gist_id}","starred_url":"https://api.github.com/users/AlisProject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlisProject/subscriptions","organizations_url":"https://api.github.com/users/AlisProject/orgs","repos_url":"https://api.github.com/users/AlisProject/repos","events_url":"https://api.github.com/users/AlisProject/events{/privacy}","received_events_url":"https://api.github.com/users/AlisProject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/AlisProject/frontend-application","description":"💮 ALIS Media - Frontend Application","fork":false,"url":"https://api.github.com/repos/AlisProject/frontend-application","forks_url":"https://api.github.com/repos/AlisProject/frontend-application/forks","keys_url":"https://api.github.com/repos/AlisProject/frontend-application/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AlisProject/frontend-application/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AlisProject/frontend-application/teams","hooks_url":"https://api.github.com/repos/AlisProject/frontend-application/hooks","issue_events_url":"https://api.github.com/repos/AlisProject/frontend-application/issues/events{/number}","events_url":"https://api.github.com/repos/AlisProject/frontend-application/events","assignees_url":"https://api.github.com/repos/AlisProject/frontend-application/assignees{/user}","branches_url":"https://api.github.com/repos/AlisProject/frontend-application/branches{/branch}","tags_url":"https://api.github.com/repos/AlisProject/frontend-application/tags","blobs_url":"https://api.github.com/repos/AlisProject/frontend-application/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AlisProject/frontend-application/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AlisProject/frontend-application/git/refs{/sha}","trees_url":"https://api.github.com/repos/AlisProject/frontend-application/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AlisProject/frontend-application/statuses/{sha}","languages_url":"https://api.github.com/repos/AlisProject/frontend-application/languages","stargazers_url":"https://api.github.com/repos/AlisProject/frontend-application/stargazers","contributors_url":"https://api.github.com/repos/AlisProject/frontend-application/contributors","subscribers_url":"https://api.github.com/repos/AlisProject/frontend-application/subscribers","subscription_url":"https://api.github.com/repos/AlisProject/frontend-application/subscription","commits_url":"https://api.github.com/repos/AlisProject/frontend-application/commits{/sha}","git_commits_url":"https://api.github.com/repos/AlisProject/frontend-application/git/commits{/sha}","comments_url":"https://api.github.com/repos/AlisProject/frontend-application/comments{/number}","issue_comment_url":"https://api.github.com/repos/AlisProject/frontend-application/issues/comments{/number}","contents_url":"https://api.github.com/repos/AlisProject/frontend-application/contents/{+path}","compare_url":"https://api.github.com/repos/AlisProject/frontend-application/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AlisProject/frontend-application/merges","archive_url":"https://api.github.com/repos/AlisProject/frontend-application/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AlisProject/frontend-application/downloads","issues_url":"https://api.github.com/repos/AlisProject/frontend-application/issues{/number}","pulls_url":"https://api.github.com/repos/AlisProject/frontend-application/pulls{/number}","milestones_url":"https://api.github.com/repos/AlisProject/frontend-application/milestones{/number}","notifications_url":"https://api.github.com/repos/AlisProject/frontend-application/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AlisProject/frontend-application/labels{/name}","releases_url":"https://api.github.com/repos/AlisProject/frontend-application/releases{/id}","deployments_url":"https://api.github.com/repos/AlisProject/frontend-application/deployments","created_at":"2018-01-12T03:33:55Z","updated_at":"2018-06-28T11:19:16Z","pushed_at":"2018-06-29T04:11:13Z","git_url":"git://github.com/AlisProject/frontend-application.git","ssh_url":"git@github.com:AlisProject/frontend-application.git","clone_url":"https://github.com/AlisProject/frontend-application.git","svn_url":"https://github.com/AlisProject/frontend-application","homepage":"https://alis.to","size":3803,"stargazers_count":39,"watchers_count":39,"language":"Vue","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"archived":false,"open_issues_count":5,"license":null,"forks":7,"open_issues":5,"watchers":39,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/AlisProject/frontend-application/pulls/275"},"html":{"href":"https://github.com/AlisProject/frontend-application/pull/275"},"issue":{"href":"https://api.github.com/repos/AlisProject/frontend-application/issues/275"},"comments":{"href":"https://api.github.com/repos/AlisProject/frontend-application/issues/275/comments"},"review_comments":{"href":"https://api.github.com/repos/AlisProject/frontend-application/pulls/275/comments"},"review_comment":{"href":"https://api.github.com/repos/AlisProject/frontend-application/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/AlisProject/frontend-application/pulls/275/commits"},"statuses":{"href":"https://api.github.com/repos/AlisProject/frontend-application/statuses/4caa17dc7a3cc31cc28e77c0fbb77287d826de25"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"potato4d"}}