From b8b0af6a7f9b906cc836af7d20a77035dc98bf11 Mon Sep 17 00:00:00 2001
From: Omar Junior <omarfariajr@gmail.com>
Date: Dec 10 2017 19:47:35 +0000
Subject: [PATCH 1/9] Create user profile layout


Signed-off-by: Eduardo Nunes <eduardonunes2525@gmail.com>
Signed-off-by: Omar Junior <omarfariajr@gmail.com>

---

diff --git a/src/components/profile/FavoritesTable.vue b/src/components/profile/FavoritesTable.vue
new file mode 100644
index 0000000..96b0d7b
--- /dev/null
+++ b/src/components/profile/FavoritesTable.vue
@@ -0,0 +1,20 @@
+<template>
+  <b-table striped hover :items="items"></b-table>
+</template>
+
+<script>
+const items = [
+  { Package: 'Fedora Package', version: 4.0, Icon: 'estrelinha', Upstream: 'www.fedorapackage.com' },
+  { Package: 'Fedora Package', version: 4.0, Icon: 'estrelinha', Upstream: 'www.fedorapackage.com' },
+  { Package: 'Fedora Package', version: 4.0, Icon: 'estrelinha', Upstream: 'www.fedorapackage.com' },
+  { Package: 'Fedora Package', version: 4.0, Icon: 'estrelinha', Upstream: 'www.fedorapackage.com' }
+]
+
+export default {
+  data () {
+    return {
+      items: items
+    }
+  }
+}
+</script>
\ No newline at end of file
diff --git a/src/components/profile/ProfileForm.vue b/src/components/profile/ProfileForm.vue
new file mode 100644
index 0000000..35556fd
--- /dev/null
+++ b/src/components/profile/ProfileForm.vue
@@ -0,0 +1,72 @@
+<template>
+  <div>
+    <b-card title="User Profile"
+          tag="article"
+          style="max-width: 20rem;"
+          class="mb-2">
+      <p class="card-text">
+        <div>
+          <b-form @submit="onSubmit">
+            <b-form-group id="exampleInputGroup1"
+                          label="Your Name:" label-for="exampleInput1">
+              <b-form-input id="exampleInput1"
+                            type="text" v-model="form.name" required
+                            placeholder="Enter name"
+              ></b-form-input>
+            </b-form-group>
+            <b-form-group id="exampleInputGroup2"
+                          label="Email address:" label-for="exampleInput2"
+                          description="We'll never share your email with anyone else.">
+              <b-form-input id="exampleInput2"
+                            type="email" v-model="form.email" required
+                            placeholder="Enter email"
+              ></b-form-input>
+            </b-form-group>
+            <b-form-group id="exampleInputGroup3"
+                          label="Password:" label-for="exampleInput3">
+              <b-form-input id="exampleInput3"
+                            type="text" v-model="form.password" required
+                            placeholder="Enter password"
+              ></b-form-input>
+            </b-form-group>
+            <b-form-group id="exampleGroup4">
+              <b-form-checkbox v-model="form.checked" id="exampleInput4">
+                Check me out
+              </b-form-checkbox>
+            </b-form-group>
+            <b-button type="submit" variant="primary">Submit</b-button>
+          </b-form>
+        </div>
+      </p>
+    </b-card>
+  </div>
+</template>
+
+<script>
+  export default {
+    data () {
+      return {
+        form: {
+          email: '',
+          name: '',
+          password: '',
+          checked: false,
+          secret: 'S3CR3T'
+        }
+      }
+    },
+    methods: {
+      onSubmit (evt) {
+        evt.preventDefault()
+        alert(JSON.stringify(this.form))
+      }
+    }
+  }
+</script>
+
+
+<style lang="scss" scoped>
+  div {
+    max-width: 300px;
+  }
+</style>
\ No newline at end of file
diff --git a/src/components/profile/ProfilePage.vue b/src/components/profile/ProfilePage.vue
new file mode 100644
index 0000000..c900685
--- /dev/null
+++ b/src/components/profile/ProfilePage.vue
@@ -0,0 +1,31 @@
+<template>
+  <b-container class="margin-top-row">
+    <b-row>
+        <b-col cols="4">
+          <profile-form></profile-form>
+        </b-col>
+        <b-col cols="8">
+          <favorites-table></favorites-table>
+        </b-col>
+    </b-row>
+  </b-container>
+</template>
+
+<script>
+import ProfileForm from '../profile/ProfileForm.vue'
+import FavoritesTable from '../profile/FavoritesTable.vue'
+
+export default {
+  name: 'profile-page',
+  components: {
+    'profile-form': ProfileForm,
+    'favorites-table': FavoritesTable
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.margin-top-row {
+  margin-top: 30px;
+}
+</style>
diff --git a/src/router/routes.js b/src/router/routes.js
index 6d317bb..25ea003 100644
--- a/src/router/routes.js
+++ b/src/router/routes.js
@@ -1,7 +1,9 @@
 import Home from '../components/home/Home.vue'
 import PackagePage from '../components/package/PackagePage.vue'
+import ProfilePage from '../components/profile/ProfilePage.vue'
 
 export const routes = [
   { name: 'home', path: '', component: Home },
-  { name: 'analysis', path: '/analysis/', component: PackagePage, props: route => ({package: route.params.package}) }
+  { name: 'analysis', path: '/analysis/', component: PackagePage, props: route => ({package: route.params.package}) },
+  { name: 'profile-page', path: '/profile', component: ProfilePage }
 ]

From 56708199b640123e3e96cfe6dc647aeb06ea23a1 Mon Sep 17 00:00:00 2001
From: MaxOliveira <maxwell_oliveira2@hotmail.com>
Date: Dec 10 2017 19:47:42 +0000
Subject: [PATCH 2/9] Create register page


Signed-off-by: MaxOliveira <maxwell_oliveira2@hotmail.com>
Signed-off-by: eduqg <eduardoqgomes@gmail.com>

---

diff --git a/src/components/register/RegisterForm.vue b/src/components/register/RegisterForm.vue
new file mode 100644
index 0000000..87582bd
--- /dev/null
+++ b/src/components/register/RegisterForm.vue
@@ -0,0 +1,79 @@
+<template>
+  <div>
+    <b-card title="Register User"
+          tag="article"
+          style="max-width: 50rem;"
+          class="mb-2">
+      <p class="card-text">
+        <div>
+          <b-form @submit="onSubmit">
+            <b-form-group id="name"
+                          label="Your Name:" label-for="exampleInput1">
+              <b-form-input id="name"
+                            type="text" v-model="form.name" required
+                            placeholder="Enter name"
+              ></b-form-input>
+            </b-form-group>
+            <b-form-group id="email"
+                          label="Email address:" label-for="exampleInput2"
+                          description="We'll never share your email with anyone else.">
+              <b-form-input id="exampleInput2"
+                            type="email" v-model="form.email" required
+                            placeholder="Enter email"
+              ></b-form-input>
+            </b-form-group>
+            <b-form-group id="exampleInputGroup3"
+                          label="Password:" label-for="exampleInput3">
+              <b-form-input id="exampleInput3"
+                            type="text" v-model="form.password" required
+                            placeholder="Enter password"
+              ></b-form-input>
+            </b-form-group>
+            <b-form-group id="exampleInputGroup3"
+                          label="Confirm Password:" label-for="exampleInput3">
+              <b-form-input id="exampleInput3"
+                            type="text" v-model="form.confirmPassword" required
+                            placeholder="Enter password"
+              ></b-form-input>
+            </b-form-group>
+            <b-form-group id="exampleGroup4">
+              <b-form-checkbox v-model="form.checked" required id="exampleInput4">
+                Check me out
+              </b-form-checkbox>
+            </b-form-group>
+            <b-button type="submit" variant="primary">Register</b-button>
+          </b-form>
+        </div>
+      </p>
+    </b-card>
+  </div>
+</template>
+
+<script>
+  export default {
+    data () {
+      return {
+        form: {
+          email: '',
+          name: '',
+          password: '',
+          confirmPassword: '',
+          checked: false,
+          secret: 'S3CR3T'
+        }
+      }
+    },
+    methods: {
+      onSubmit (evt) {
+        evt.preventDefault()
+        alert(JSON.stringify(this.form))
+      }
+    }
+  }
+</script>
+
+<style lang="scss" scoped>
+  div {
+    max-width: 700px;
+  }
+</style>
\ No newline at end of file
diff --git a/src/components/register/RegisterPage.vue b/src/components/register/RegisterPage.vue
new file mode 100644
index 0000000..3d6233d
--- /dev/null
+++ b/src/components/register/RegisterPage.vue
@@ -0,0 +1,34 @@
+<template>
+  <div class="center">
+  <b-container class="margin-top-row">
+    <b-row>
+        <b-col cols="4">
+          <register-form></register-form>
+        </b-col>
+    </b-row>
+  </b-container>
+  </div>
+</template>
+
+<script>
+import RegisterForm from '../register/RegisterForm.vue'
+
+export default {
+  name: 'register-page',
+  components: {
+    'register-form': RegisterForm
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.margin-top-row {
+  display: block;
+  margin-top: 30px;
+  margin-left: auto;
+  margin-right: auto;
+}
+</style>
+
+
+
diff --git a/src/router/routes.js b/src/router/routes.js
index 25ea003..9fa02c2 100644
--- a/src/router/routes.js
+++ b/src/router/routes.js
@@ -1,9 +1,11 @@
 import Home from '../components/home/Home.vue'
 import PackagePage from '../components/package/PackagePage.vue'
 import ProfilePage from '../components/profile/ProfilePage.vue'
+import RegisterPage from '../components/register/RegisterPage.vue'
 
 export const routes = [
   { name: 'home', path: '', component: Home },
   { name: 'analysis', path: '/analysis/', component: PackagePage, props: route => ({package: route.params.package}) },
-  { name: 'profile-page', path: '/profile', component: ProfilePage }
+  { name: 'profile-page', path: '/profile', component: ProfilePage },
+  { name: 'register-page', path: '/register', component: RegisterPage }
 ]

From 88b604ba2ee2c2f3363d789989fd57863918429e Mon Sep 17 00:00:00 2001
From: MaxOliveira <maxwell_oliveira2@hotmail.com>
Date: Dec 10 2017 19:47:50 +0000
Subject: [PATCH 3/9] Create login page.

- Integrating user data to login on backend

Signed-off-by: maxoliveira <maxwell_oliveira2@hotmail.com>
Signed-off-by: eduqg <eduardoqgomes@gmail.com>
Signed-off-by: Daniel Moura <danmoura17@gmail.com>
Signed-off-by: Fabio Teixeira <fabio1079@gmail.com>
Signed-off-by: Eduardo Gomes <eduardoqgomes@gmail.com>
Signed-off-by: Rafael Rabetti <rafael.rabetti@gmail.com>
Signed-off-by: Omar Junior <omarfariajr@gmail.com>

---

diff --git a/.gitignore b/.gitignore
index f14e4e1..85f0e51 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,6 +7,7 @@ yarn-error.log*
 test/unit/coverage
 *lock.json
 package-lock.json
+yarn.lock
 
 # Editor directories and files
 .idea
@@ -14,3 +15,4 @@ package-lock.json
 *.ntvs*
 *.njsproj
 *.sln
+
diff --git a/src/components/login/LoginForm.vue b/src/components/login/LoginForm.vue
new file mode 100644
index 0000000..dc281cc
--- /dev/null
+++ b/src/components/login/LoginForm.vue
@@ -0,0 +1,77 @@
+<template>
+  <div>
+    <b-card title="Login"
+          tag="article"
+          style="max-width: 50rem;"
+          class="mb-2">
+      <p class="card-text">
+        <div>
+          <b-form @submit="onSubmit">
+            <b-form-group id="email"
+                          label="Email address:" label-for="emailInput"
+              <b-form-input id="emailInput"
+                            type="email" v-model="form.email" required
+                            placeholder="Enter email"
+              ></b-form-input>
+            </b-form-group>
+            <b-form-group id="password"
+                          label="Password:" label-for="passwordInput">
+              <b-form-input id="passwordInput"
+                            type="text" v-model="form.password" required
+                            placeholder="Enter password"
+              ></b-form-input>
+            </b-form-group>
+            <b-form-group id="remember">
+              <b-form-checkbox v-model="form.checked" required id="rememberInput">
+                Remember me
+              </b-form-checkbox>
+            </b-form-group>
+            <b-button type="submit" variant="primary">Login</b-button>
+          </b-form>
+        </div>
+      </p>
+    </b-card>
+  </div>
+</template>
+
+<script>
+  import axios from 'axios'
+
+  export default {
+    data () {
+      return {
+        form: {
+          email: '',
+          password: '',
+          checked: false,
+          secret: 'S3CR3T'
+        }
+      }
+    },
+    methods: {
+      onSubmit (evt) {
+        evt.preventDefault()
+
+        axios.post('http://127.0.0.1:5000/login', {
+          email: this.form['email'],
+          password: this.form['password']
+        })
+        .then(r => {
+          let {token, user_id} = r.data
+
+          alert(token)
+          alert(user_id)
+        })
+        .catch(err => {
+          console.log(err)
+        })
+      }
+    }
+  }
+</script>
+
+<style lang="scss" scoped>
+  div {
+    max-width: 700px;
+  }
+</style>
\ No newline at end of file
diff --git a/src/components/login/LoginPage.vue b/src/components/login/LoginPage.vue
new file mode 100644
index 0000000..83ef2a7
--- /dev/null
+++ b/src/components/login/LoginPage.vue
@@ -0,0 +1,29 @@
+<template>
+  <div class="center">
+  <b-container class="margin-top-row">
+    <b-row>
+        <b-col cols="4">
+          <login-form></login-form>
+        </b-col>
+    </b-row>
+  </b-container>
+  </div>
+</template>
+
+<script>
+import LoginForm from '../login/LoginForm.vue'
+
+export default {
+  name: 'login-page',
+  components: {
+    'login-form': LoginForm
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.margin-top-row {
+  margin-top: 30px;
+}
+</style>
+
diff --git a/src/components/register/RegisterPage.vue b/src/components/register/RegisterPage.vue
index 3d6233d..6fb6b38 100644
--- a/src/components/register/RegisterPage.vue
+++ b/src/components/register/RegisterPage.vue
@@ -23,10 +23,7 @@ export default {
 
 <style lang="scss" scoped>
 .margin-top-row {
-  display: block;
   margin-top: 30px;
-  margin-left: auto;
-  margin-right: auto;
 }
 </style>
 
diff --git a/src/router/routes.js b/src/router/routes.js
index 9fa02c2..6cb99e1 100644
--- a/src/router/routes.js
+++ b/src/router/routes.js
@@ -2,10 +2,12 @@ import Home from '../components/home/Home.vue'
 import PackagePage from '../components/package/PackagePage.vue'
 import ProfilePage from '../components/profile/ProfilePage.vue'
 import RegisterPage from '../components/register/RegisterPage.vue'
+import LoginPage from '../components/login/LoginPage.vue'
 
 export const routes = [
   { name: 'home', path: '', component: Home },
   { name: 'analysis', path: '/analysis/', component: PackagePage, props: route => ({package: route.params.package}) },
   { name: 'profile-page', path: '/profile', component: ProfilePage },
-  { name: 'register-page', path: '/register', component: RegisterPage }
+  { name: 'register-page', path: '/register', component: RegisterPage },
+  { name: 'login-page', path: '/login', component: LoginPage }
 ]

From 402ff824b3b6a8edc205e58286c8c399009b99c2 Mon Sep 17 00:00:00 2001
From: Daniel <danmoura17@gmail.com>
Date: Dec 10 2017 19:48:10 +0000
Subject: [PATCH 4/9] Create user register


Signed-off-by: Daniel Moura <danmoura17@gmail.com>
Signed-off-by: Fabio Teixeira <fabio1079@gmail.com>
Signed-off-by: Eduardo Gomes <eduardoqgomes@gmail.com>
Signed-off-by: Rafael Rabetti <rafael.rabetti@gmail.com>
Signed-off-by: Omar Junior <omarfariajr@gmail.com>

---

diff --git a/src/components/register/RegisterForm.vue b/src/components/register/RegisterForm.vue
index 87582bd..c8c6ec7 100644
--- a/src/components/register/RegisterForm.vue
+++ b/src/components/register/RegisterForm.vue
@@ -50,6 +50,7 @@
 </template>
 
 <script>
+  import axios from 'axios'
   export default {
     data () {
       return {
@@ -66,7 +67,20 @@
     methods: {
       onSubmit (evt) {
         evt.preventDefault()
-        alert(JSON.stringify(this.form))
+        axios.post('http://127.0.0.1:5000/users', {
+          name: this.form['name'],
+          email: this.form['email'],
+          password: this.form['password']
+        })
+        .then(r => {
+          if (r.status === 201) {
+            alert('saporra foi')
+          }
+        })
+        .catch(err => {
+          console.error(err)
+          alert('Email already exists in our database')
+        })
       }
     }
   }

From fc3531be848e9e3a6b12f4138618f96d17e39cec Mon Sep 17 00:00:00 2001
From: eduardonunes <eduardonunes2525@gmail.com>
Date: Dec 10 2017 19:50:55 +0000
Subject: [PATCH 5/9] Create InformationPerFileTable dynamic

- Fix selection/links color
- Add bootstrap dependency
- Fix bootstrap error and style error in search
- Add tabs in package tables
- Fixing bug in package description page

Signed-off-by: thiagocmoreira <thiago.cmoreira@yahoo.com.br>
Signed-off-by: DaniloBarros <dan.b412@gmail.com>
Signed-off-by: Eduardo Nunes <eduardonunes2525@gmail.com>
Signed-off-by: Omar Junior <omarfariajr@gmail.com>
Signed-off-by: MatheusMello <mat.mello93@gmail.com>
Signed-off-by: RafaelRabetti <rafael.rabetti@gmail.com>

---

diff --git a/package.json b/package.json
index 5fbf849..2023db6 100644
--- a/package.json
+++ b/package.json
@@ -15,6 +15,8 @@
   "dependencies": {
     "ajv": "^5.2.3",
     "babel-polyfill": "^6.26.0",
+    "bootstrap": "^4.0.0-beta.2",
+    "bootstrap-vue": "^1.0.0-beta.9",
     "chart.js": "^2.7.0",
     "element-ui": "^1.4.3",
     "jquery": "^3.2.1",
@@ -27,7 +29,6 @@
     "vue-awesome": "^2.3.3",
     "vue-chartjs": "^2.8.7",
     "vue-data-tables": "^2.0.4",
-    "vue-material": "^0.7.4",
     "vue-router": "^2.6.0",
     "vue-table-component": "^1.3.0",
     "vuex": "^2.4.0"
@@ -42,7 +43,6 @@
     "babel-preset-env": "^1.3.2",
     "babel-preset-stage-2": "^6.22.0",
     "babel-register": "^6.22.0",
-    "bootstrap-vue": "^1.0.0-beta.7",
     "chai": "^3.5.0",
     "chalk": "^2.0.1",
     "connect-history-api-fallback": "^1.3.0",
diff --git a/src/App.vue b/src/App.vue
index 15a6666..5421ff5 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -7,12 +7,9 @@
 
 <script>
 import Vue from 'vue'
-import VueMaterial from 'vue-material'
-import 'vue-material/dist/vue-material.css'
 import Vuex from 'vuex'
 import HeaderK from './components/shared/HeaderK'
 
-Vue.use(VueMaterial)
 Vue.use(Vuex)
 
 export default {
@@ -23,5 +20,4 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-
 </style>
diff --git a/src/components/package/ErrorsTable.vue b/src/components/package/ErrorsTable.vue
index 7f0545a..1040ba6 100644
--- a/src/components/package/ErrorsTable.vue
+++ b/src/components/package/ErrorsTable.vue
@@ -1,28 +1,15 @@
 <template>
-<div>
-  <b-card header-tag="header" footer-tag="footer">
-    <em slot="footer">
-      <b-pagination align="center" :total-rows="totalRows" :per-page="perPage" v-model="currentPage"/>
-    </em>
-    <p class="card-text">
-      <b-table striped hover show-empty
-      :items="correctList"
-      :fields="fields"
-      :current-page="currentPage"
-      :per-page="perPage"
-      :sort-by.sync="sortBy"
-      :sort-desc.sync="sortDesc"
-      ></b-table>
-    </p>
-  </b-card>
-</div>
+  <default-table :bodyTable="correctList" :headerTable="fields" />
 </template>
-
 <script>
 import { mapGetters } from 'vuex'
 import * as getterNames from '../../store/getterNames.js'
+import DefaultTable from '../shared/DefaultTable.vue'
 
 export default {
+  components: {
+    DefaultTable
+  },
   data () {
     return {
       fields: {
@@ -41,21 +28,13 @@ export default {
         message: {
           label: 'Message'
         }
-      },
-      totalRows: this.total,
-      currentPage: 1,
-      perPage: 10,
-      sortBy: 'type',
-      sortDesc: false
+      }
     }
   },
   computed: {
     ...mapGetters([
       getterNames.errorsList
     ]),
-    total () {
-      return this.errorsList.length
-    },
     correctList () {
       return this.makeErrorsTable()
     }
@@ -76,10 +55,6 @@ export default {
         return returnError
       })
       return errorsList
-    },
-    onFiltered (filteredItems) {
-      this.totalRows = filteredItems.length
-      this.currentPage = 1
     }
   }
 }
diff --git a/src/components/package/InformationPerFileTable.vue b/src/components/package/InformationPerFileTable.vue
new file mode 100644
index 0000000..67393c3
--- /dev/null
+++ b/src/components/package/InformationPerFileTable.vue
@@ -0,0 +1,42 @@
+<template>
+  <default-table :bodyTable="correctList" :headerTable="headerTable" />
+</template>
+
+<script>
+import { mapGetters } from 'vuex'
+import * as getterNames from '../../store/getterNames.js'
+import DefaultTable from '../shared/DefaultTable.vue'
+
+export default {
+  components: {
+    DefaultTable
+  },
+  computed: {
+    ...mapGetters([
+      getterNames.errorsList,
+      getterNames.reports
+    ]),
+    correctList () {
+      return this.makeErrorsTable()
+    },
+    headerTable () {
+      let headerList = Object.keys(this.reports)
+      headerList.unshift('path')
+      return headerList
+    }
+  },
+  methods: {
+    makeErrorsTable () {
+      let errorsList = this.errorsList.map((errorsObject) => {
+        const returnError = {}
+        returnError.severity = errorsObject.severity
+        if (errorsObject.location) {
+          returnError.path = errorsObject.location.file.givenpath
+        }
+        return returnError
+      })
+      return errorsList
+    }
+  }
+}
+</script>
diff --git a/src/components/package/PackagePage.vue b/src/components/package/PackagePage.vue
index 276519a..c8dcc93 100644
--- a/src/components/package/PackagePage.vue
+++ b/src/components/package/PackagePage.vue
@@ -16,7 +16,14 @@
         </div>
       </div>
     </div>
-    <errors-table />
+    <b-tabs>
+      <b-tab title="Lista de Erros" active>
+        <errors-table />
+      </b-tab>
+      <b-tab title="Erros por Arquivo" >
+        <information-per-file-table />
+      </b-tab>
+    </b-tabs>
   </div>
 </template>
 
@@ -25,6 +32,7 @@ import { mapActions, mapGetters } from 'vuex'
 import * as actionTypes from '../../store/actionTypes.js'
 import * as getterNames from '../../store/getterNames.js'
 import SummaryPackage from './SummaryPackage'
+import InformationPerFileTable from './InformationPerFileTable'
 import ErrorsTable from './ErrorsTable'
 import PieChart from './PieChart'
 
@@ -32,7 +40,8 @@ export default {
   components: {
     SummaryPackage,
     ErrorsTable,
-    PieChart
+    PieChart,
+    InformationPerFileTable
   },
   props: {
     package: {
diff --git a/src/components/package/Search.vue b/src/components/package/Search.vue
index 37d55f5..cc89481 100644
--- a/src/components/package/Search.vue
+++ b/src/components/package/Search.vue
@@ -78,6 +78,11 @@ export default {
   }
 }
 
+.row {
+  margin-right: 0px!important;
+  margin-left: 0px!important;
+}
+
 .search-wrapper {
   /*background-image: url('/static/grey.jpg');*/
   background-size: cover;
diff --git a/src/components/package/SummaryPackage.vue b/src/components/package/SummaryPackage.vue
index a7e7394..103f592 100644
--- a/src/components/package/SummaryPackage.vue
+++ b/src/components/package/SummaryPackage.vue
@@ -1,7 +1,7 @@
 <template>
   <b-card class="summary-package"  bg-variant="dark" text-variant="white" :title="package.name">
-    <p class="card-text"> {{ package.version }} </p>
-    <p> {{ package.lastUpdate }} </p>
+    <p class="card-text"> Package version: {{ package.last_version }} </p>
+    <p>Last updated at: {{ package.last_updated }} </p>
   </b-card>
 </template>
 
diff --git a/src/components/packages/jsonItems.json b/src/components/packages/jsonItems.json
deleted file mode 100644
index cecb76a..0000000
--- a/src/components/packages/jsonItems.json
+++ /dev/null
@@ -1,291 +0,0 @@
-{
-  "analysis": {
-    "analyzer_id": 1,
-    "id": 1,
-    "raw": {
-      "customfields": null,
-      "metadata": {
-        "file_": null,
-        "generator": {
-          "name": "cppcheck",
-          "version": "1.80"
-        },
-        "stats": null,
-        "sut": null
-      },
-      "results": [
-        {
-          "customfields": null,
-          "cwe": null,
-          "location": {
-            "file": {
-              "abspath": null,
-              "givenpath": "source/active_children.c",
-              "hash_": null
-            },
-            "function": null,
-            "point": {
-              "column": 0,
-              "line": 42
-            },
-            "range_": null
-          },
-          "message": {
-            "text": "Unused variable: stdin_descriptor"
-          },
-          "notes": null,
-          "severity": "style",
-          "testid": "unusedVariable",
-          "trace": null,
-          "type": "Issue"
-        },
-        {
-          "customfields": null,
-          "cwe": null,
-          "location": {
-            "file": {
-              "abspath": null,
-              "givenpath": "source/father.c",
-              "hash_": null
-            },
-            "function": null,
-            "point": {
-              "column": 0,
-              "line": 43
-            },
-            "range_": null
-          },
-          "message": {
-            "text": "The scope of the variable 'times' can be reduced."
-          },
-          "notes": {
-            "text": "The scope of the variable 'times' can be reduced. Warning: Be careful when fixing this message, especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced:\\012void f(int x)\\012{\\012    int i = 0;\\012    if (x) {\\012        // it's safe to move 'int i = 0;' here\\012        for (int n = 0; n < 10; ++n) {\\012            // it is possible but not safe to move 'int i = 0;' here\\012            do_something(&i);\\012        }\\012    }\\012}\\012When you see this message it is always safe to reduce the variable scope 1 level."
-          },
-          "severity": "style",
-          "testid": "variableScope",
-          "trace": null,
-          "type": "Issue"
-        },
-        {
-          "customfields": null,
-          "cwe": null,
-          "location": {
-            "file": {
-              "abspath": null,
-              "givenpath": "source/father.c",
-              "hash_": null
-            },
-            "function": null,
-            "point": {
-              "column": 0,
-              "line": 45
-            },
-            "range_": null
-          },
-          "message": {
-            "text": "The scope of the variable 'complete_msg_sleepy' can be reduced."
-          },
-          "notes": {
-            "text": "The scope of the variable 'complete_msg_sleepy' can be reduced. Warning: Be careful when fixing this message, especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced:\\012void f(int x)\\012{\\012    int i = 0;\\012    if (x) {\\012        // it's safe to move 'int i = 0;' here\\012        for (int n = 0; n < 10; ++n) {\\012            // it is possible but not safe to move 'int i = 0;' here\\012            do_something(&i);\\012        }\\012    }\\012}\\012When you see this message it is always safe to reduce the variable scope 1 level."
-          },
-          "severity": "style",
-          "testid": "variableScope",
-          "trace": null,
-          "type": "Issue"
-        },
-        {
-          "customfields": null,
-          "cwe": null,
-          "location": {
-            "file": {
-              "abspath": null,
-              "givenpath": "source/father.c",
-              "hash_": null
-            },
-            "function": null,
-            "point": {
-              "column": 0,
-              "line": 46
-            },
-            "range_": null
-          },
-          "message": {
-            "text": "The scope of the variable 'complete_msg_active' can be reduced."
-          },
-          "notes": {
-            "text": "The scope of the variable 'complete_msg_active' can be reduced. Warning: Be careful when fixing this message, especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced:\\012void f(int x)\\012{\\012    int i = 0;\\012    if (x) {\\012        // it's safe to move 'int i = 0;' here\\012        for (int n = 0; n < 10; ++n) {\\012            // it is possible but not safe to move 'int i = 0;' here\\012            do_something(&i);\\012        }\\012    }\\012}\\012When you see this message it is always safe to reduce the variable scope 1 level."
-          },
-          "severity": "style",
-          "testid": "variableScope",
-          "trace": null,
-          "type": "Issue"
-        },
-        {
-          "customfields": null,
-          "cwe": null,
-          "location": {
-            "file": {
-              "abspath": null,
-              "givenpath": "source/father.c",
-              "hash_": null
-            },
-            "function": null,
-            "point": {
-              "column": 0,
-              "line": 77
-            },
-            "range_": null
-          },
-          "message": {
-            "text": "The scope of the variable 'seconds' can be reduced."
-          },
-          "notes": {
-            "text": "The scope of the variable 'seconds' can be reduced. Warning: Be careful when fixing this message, especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced:\\012void f(int x)\\012{\\012    int i = 0;\\012    if (x) {\\012        // it's safe to move 'int i = 0;' here\\012        for (int n = 0; n < 10; ++n) {\\012            // it is possible but not safe to move 'int i = 0;' here\\012            do_something(&i);\\012        }\\012    }\\012}\\012When you see this message it is always safe to reduce the variable scope 1 level."
-          },
-          "severity": "style",
-          "testid": "variableScope",
-          "trace": null,
-          "type": "Issue"
-        },
-        {
-          "customfields": null,
-          "cwe": null,
-          "location": {
-            "file": {
-              "abspath": null,
-              "givenpath": "source/father.c",
-              "hash_": null
-            },
-            "function": null,
-            "point": {
-              "column": 0,
-              "line": 114
-            },
-            "range_": null
-          },
-          "message": {
-            "text": "Uninitialized variable: readbuffer_active"
-          },
-          "notes": null,
-          "severity": "error",
-          "testid": "uninitvar",
-          "trace": null,
-          "type": "Issue"
-        },
-        {
-          "customfields": null,
-          "cwe": null,
-          "location": {
-            "file": {
-              "abspath": null,
-              "givenpath": "source/main.c",
-              "hash_": null
-            },
-            "function": null,
-            "point": {
-              "column": 0,
-              "line": 14
-            },
-            "range_": null
-          },
-          "message": {
-            "text": "Uninitialized variable: sleepy_children"
-          },
-          "notes": null,
-          "severity": "error",
-          "testid": "uninitvar",
-          "trace": null,
-          "type": "Issue"
-        },
-        {
-          "customfields": null,
-          "cwe": null,
-          "location": {
-            "file": {
-              "abspath": null,
-              "givenpath": "source/main.c",
-              "hash_": null
-            },
-            "function": null,
-            "point": {
-              "column": 0,
-              "line": 14
-            },
-            "range_": null
-          },
-          "message": {
-            "text": "Uninitialized variable: active_children"
-          },
-          "notes": null,
-          "severity": "error",
-          "testid": "uninitvar",
-          "trace": null,
-          "type": "Issue"
-        },
-        {
-          "customfields": null,
-          "cwe": null,
-          "location": {
-            "file": {
-              "abspath": null,
-              "givenpath": "source/sleepy_children.c",
-              "hash_": null
-            },
-            "function": null,
-            "point": {
-              "column": 0,
-              "line": 30
-            },
-            "range_": null
-          },
-          "message": {
-            "text": "The scope of the variable 'time_to_sleep' can be reduced."
-          },
-          "notes": {
-            "text": "The scope of the variable 'time_to_sleep' can be reduced. Warning: Be careful when fixing this message, especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced:\\012void f(int x)\\012{\\012    int i = 0;\\012    if (x) {\\012        // it's safe to move 'int i = 0;' here\\012        for (int n = 0; n < 10; ++n) {\\012            // it is possible but not safe to move 'int i = 0;' here\\012            do_something(&i);\\012        }\\012    }\\012}\\012When you see this message it is always safe to reduce the variable scope 1 level."
-          },
-          "severity": "style",
-          "testid": "variableScope",
-          "trace": null,
-          "type": "Issue"
-        },
-        {
-          "customfields": null,
-          "cwe": null,
-          "location": {
-            "file": {
-              "abspath": null,
-              "givenpath": "source/sleepy_children.c",
-              "hash_": null
-            },
-            "function": null,
-            "point": {
-              "column": 0,
-              "line": 28
-            },
-            "range_": null
-          },
-          "message": {
-            "text": "Unused variable: readbuffer_sleepy"
-          },
-          "notes": null,
-          "severity": "style",
-          "testid": "unusedVariable",
-          "trace": null,
-          "type": "Issue"
-        }
-
-      ]
-    },
-    "reports": [
-      {
-        "analysis_id": 1,
-        "errors": 3,
-        "id": 1,
-        "styles": 7,
-        "warnings": 0
-      }
-    ],
-    "version_id": 1
-  }
-}
diff --git a/src/components/shared/DefaultTable.vue b/src/components/shared/DefaultTable.vue
new file mode 100644
index 0000000..a21ee6a
--- /dev/null
+++ b/src/components/shared/DefaultTable.vue
@@ -0,0 +1,79 @@
+<template>
+  <div>
+    <b-card header-tag="header" footer-tag="footer">
+      <h6 slot="header" class="mb-0">
+        <div class="my-1 row">
+          <div class="col-md-6">
+            <b-form-fieldset horizontal label="Rows per page" :label-cols="6">
+              <b-form-select :options="pageOptions" v-model="perPage" />
+            </b-form-fieldset>
+          </div>
+          <div class="col-md-6">
+            <b-form-fieldset horizontal label="Filter" :label-cols="3">
+              <b-form-input v-model="filter" placeholder="Type to Search" />
+            </b-form-fieldset>
+          </div>
+        </div>
+      </h6>
+      <em slot="footer">
+        <b-pagination align="center" :total-rows="totalRows" :per-page="perPage" v-model="currentPage"/>
+      </em>
+      <p class="card-text">
+        <b-table striped hover show-empty responsive
+          :items="bodyTable"
+          :fields="headerTable"
+          :current-page="currentPage"
+          :per-page="perPage"
+          :sort-by.sync="sortBy"
+          :sort-desc.sync="sortDesc"
+          :filter="filter"
+          @filtered="onFiltered"
+        ></b-table>
+      </p>
+    </b-card>
+  </div>
+</template>
+<script>
+
+export default {
+  data () {
+    return {
+      currentPage: 1,
+      perPage: 10,
+      pageOptions: [{
+        text: 5,
+        value: 5
+      }, {
+        text: 10,
+        value: 10
+      }, {
+        text: 15,
+        value: 15
+      }],
+      sortBy: null,
+      sortDesc: false,
+      filter: null
+    }
+  },
+  props: {
+    headerTable: {
+      type: Array,
+      default () {
+        return []
+      }
+    },
+    bodyTable: {
+      type: Array,
+      default () {
+        return []
+      }
+    }
+  },
+  methods: {
+    onFiltered (filteredItems) {
+      this.totalRows = filteredItems.length
+      this.currentPage = 1
+    }
+  }
+}
+</script>
diff --git a/src/store/modules/analysis.js b/src/store/modules/analysis.js
index 81fdfb9..801f4f8 100644
--- a/src/store/modules/analysis.js
+++ b/src/store/modules/analysis.js
@@ -249,7 +249,7 @@ const state = {
             'notes': {
               'text': `The scope of the variable 'time_to_sleep' can be reduced. Warning: Be careful when fixing this message, especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced:\\012void f(int x)\\012{\\012    int i = 0;\\012    if (x) {\\012        // it's safe to move 'int i = 0;' here\\012        for (int n = 0; n < 10; ++n) {\\012            // it is possible but not safe to move 'int i = 0;' here\\012            do_something(&i);\\012        }\\012    }\\012}\\012When you see this message it is always safe to reduce the variable scope 1 level.`
             },
-            'severity': 'style',
+            'severity': 'warnings',
             'testid': 'variableScope',
             'trace': null,
             'type': 'Issue'
@@ -274,7 +274,7 @@ const state = {
               'text': 'Unused variable: readbuffer_sleepy'
             },
             'notes': null,
-            'severity': 'style',
+            'severity': 'warnings',
             'testid': 'unusedVariable',
             'trace': null,
             'type': 'Issue'
@@ -297,8 +297,8 @@ const state = {
         'id': 1,
         'results': {
           'errors': 3,
-          'styles': 7,
-          'warnings': 0
+          'styles': 5,
+          'warnings': 2
         }
       },
       'version_id': 1
@@ -323,9 +323,10 @@ const state = {
         'id': 2,
         'analyzer_id': 1,
         'results': {
-          'styles': 10,
+          'errors': 10,
           'warnings': 3,
-          'errors': 4
+          'style': 4,
+          'Other': 15
         }
       },
       'version_id': 2
diff --git a/src/store/modules/packages.js b/src/store/modules/packages.js
index 008592f..11bca3e 100644
--- a/src/store/modules/packages.js
+++ b/src/store/modules/packages.js
@@ -110,7 +110,7 @@ const mutations = {
       return {
         package_id: pkg.versions[0].package_id,
         name: pkg.name,
-
+        last_updated: pkg.lastUpdate,
         last_version: pkg.versions[0].number,
         fetcher_id: pkg.fetcher_id,
         analyzer_id: pkg.versions[0].analysis[0].analyzer_id

From 029cb7a892c97ea87bf763922bf132100404d26b Mon Sep 17 00:00:00 2001
From: MatheusMello <mat.mello93@gmail.com>
Date: Dec 10 2017 19:51:21 +0000
Subject: [PATCH 6/9] Header Anchors to Login and Register

- Login and Register validation and style

Signed-off-by: MatheusMello <mat.mello93@gmail.com>
Signed-off-by: RafaelRabetti <rafael.rabetti@gmail.com>
Signed-off-by EduardoQuintino <eduardoqgomes@gmail.com>
Signed-off-by MaxOliveira <maxwell_oliveira2@hotmail.com>

---

diff --git a/src/components/login/LoginForm.vue b/src/components/login/LoginForm.vue
index dc281cc..d6613fe 100644
--- a/src/components/login/LoginForm.vue
+++ b/src/components/login/LoginForm.vue
@@ -1,6 +1,10 @@
 <template>
   <div>
-    <b-card title="Login"
+    <div class="text-center">
+      <img src="../../assets/kiskadee-logo.png" width="100" height="100" class="d-inline-block align-top" alt="logo">
+      <h3>Sign in to Kiskadee</h3>
+    </div>
+    <b-card
           tag="article"
           style="max-width: 50rem;"
           class="mb-2">
@@ -8,32 +12,33 @@
         <div>
           <b-form @submit="onSubmit">
             <b-form-group id="email"
-                          label="Email address:" label-for="emailInput"
+                          label="Email address" label-for="emailInput">
               <b-form-input id="emailInput"
                             type="email" v-model="form.email" required
-                            placeholder="Enter email"
+                            placeholder=""
               ></b-form-input>
             </b-form-group>
             <b-form-group id="password"
-                          label="Password:" label-for="passwordInput">
+                          label="Password" label-for="passwordInput">
               <b-form-input id="passwordInput"
-                            type="text" v-model="form.password" required
-                            placeholder="Enter password"
+                            type="password" v-model="form.password" required
+                            placeholder=""
               ></b-form-input>
             </b-form-group>
             <b-form-group id="remember">
-              <b-form-checkbox v-model="form.checked" required id="rememberInput">
+              <b-form-checkbox v-model="form.checked" id="rememberInput">
                 Remember me
               </b-form-checkbox>
             </b-form-group>
-            <b-button type="submit" variant="primary">Login</b-button>
+            <div class="text-center center-block">
+              <b-button type="submit" variant="primary">Login</b-button>
+            </div>
           </b-form>
         </div>
       </p>
     </b-card>
   </div>
 </template>
-
 <script>
   import axios from 'axios'
 
@@ -74,4 +79,20 @@
   div {
     max-width: 700px;
   }
-</style>
\ No newline at end of file
+   button {
+    padding: 10px 40px;
+    background-color: rgb(10, 46, 96);
+    cursor: pointer;
+  }
+  img {
+    margin-bottom: 20px;
+  }
+  h3 {
+    font-weight: 300;
+    margin-bottom: 10px;
+    color: rgb(10, 46, 96);
+  }
+  .card-body {
+    padding: 0 1.25rem;
+  }
+</style>
diff --git a/src/components/login/LoginPage.vue b/src/components/login/LoginPage.vue
index 83ef2a7..d6c20ef 100644
--- a/src/components/login/LoginPage.vue
+++ b/src/components/login/LoginPage.vue
@@ -2,7 +2,7 @@
   <div class="center">
   <b-container class="margin-top-row">
     <b-row>
-        <b-col cols="4">
+        <b-col cols="4" class="login-form">
           <login-form></login-form>
         </b-col>
     </b-row>
@@ -25,5 +25,8 @@ export default {
 .margin-top-row {
   margin-top: 30px;
 }
-</style>
 
+.login-form {
+    margin: auto;
+  }
+</style>
diff --git a/src/components/register/RegisterForm.vue b/src/components/register/RegisterForm.vue
index c8c6ec7..016c3cc 100644
--- a/src/components/register/RegisterForm.vue
+++ b/src/components/register/RegisterForm.vue
@@ -23,25 +23,23 @@
               ></b-form-input>
             </b-form-group>
             <b-form-group id="exampleInputGroup3"
-                          label="Password:" label-for="exampleInput3">
-              <b-form-input id="exampleInput3"
-                            type="text" v-model="form.password" required
+                          label="Password:" label-for="password">
+              <b-form-input id="password"
+                            type="password" v-model="form.password" required
                             placeholder="Enter password"
               ></b-form-input>
+              <small id="help-password" class="text-muted help-block"></small>
             </b-form-group>
             <b-form-group id="exampleInputGroup3"
-                          label="Confirm Password:" label-for="exampleInput3">
-              <b-form-input id="exampleInput3"
-                            type="text" v-model="form.confirmPassword" required
+                          label="Confirm Password:" label-for="confirmPassword">
+              <b-form-input id="confirmPassword"
+                            type="password" v-model="form.confirmPassword" required
                             placeholder="Enter password"
               ></b-form-input>
             </b-form-group>
-            <b-form-group id="exampleGroup4">
-              <b-form-checkbox v-model="form.checked" required id="exampleInput4">
-                Check me out
-              </b-form-checkbox>
-            </b-form-group>
-            <b-button type="submit" variant="primary">Register</b-button>
+            <div class="center-block text-center">
+              <b-button type="submit" variant="primary">Register</b-button>
+            </div>
           </b-form>
         </div>
       </p>
@@ -65,8 +63,23 @@
       }
     },
     methods: {
+      clearFields () {
+        window.$('#password').removeClass('has-error')
+        window.$('#confirmPassword').removeClass('has-error')
+        window.$('#help-password').text('')
+      },
       onSubmit (evt) {
         evt.preventDefault()
+
+        this.clearFields()
+
+        if (this.form['password'] !== this.form['confirmPassword']) {
+          window.$('#password').addClass('has-error')
+          window.$('#confirmPassword').addClass('has-error')
+          window.$('#help-password').text('As senhas não conferem')
+          return false
+        }
+
         axios.post('http://127.0.0.1:5000/users', {
           name: this.form['name'],
           email: this.form['email'],
@@ -74,7 +87,7 @@
         })
         .then(r => {
           if (r.status === 201) {
-            alert('saporra foi')
+            console.log('success')
           }
         })
         .catch(err => {
@@ -90,4 +103,26 @@
   div {
     max-width: 700px;
   }
-</style>
\ No newline at end of file
+  .has-error {
+    border: 1px solid red;
+  }
+  .help-block {
+    color: red!important;
+  }
+  button {
+    padding: 10px 40px;
+    background-color: rgb(10, 46, 96);
+    cursor: pointer;
+  }
+  .card-body {
+    padding: 0 1.25rem;
+  }
+  img {
+    margin-bottom: 20px;
+  }
+  h3 {
+    font-weight: 300;
+    margin-bottom: 10px;
+    color: rgb(10, 46, 96);
+  }
+</style>
diff --git a/src/components/register/RegisterPage.vue b/src/components/register/RegisterPage.vue
index 6fb6b38..2abda56 100644
--- a/src/components/register/RegisterPage.vue
+++ b/src/components/register/RegisterPage.vue
@@ -2,7 +2,7 @@
   <div class="center">
   <b-container class="margin-top-row">
     <b-row>
-        <b-col cols="4">
+        <b-col cols="4" class="register-form">
           <register-form></register-form>
         </b-col>
     </b-row>
@@ -25,6 +25,11 @@ export default {
 .margin-top-row {
   margin-top: 30px;
 }
+
+.register-form {
+    margin: auto;
+    padding-top: 3%;
+  }
 </style>
 
 
diff --git a/src/components/shared/HeaderK.vue b/src/components/shared/HeaderK.vue
index 15fca79..c5e02cf 100644
--- a/src/components/shared/HeaderK.vue
+++ b/src/components/shared/HeaderK.vue
@@ -7,8 +7,14 @@
         <h2 class="name">{{ say_my_name }}</h2>
       </router-link>
     </b-navbar-brand>
+
     <b-collapse is-nav id="nav_text_collapse">
       <b-nav is-nav-bar>
+      <icon name="sign-in" scale="2.5"></icon>
+      <b-nav-item-dropdown right class="log-itens">
+        <router-link :to="{ name: 'login-page' }"><b-dropdown-item id="log-item" href="/login">Login</b-dropdown-item></router-link>
+        <router-link :to="{ name: 'register-page' }"><b-dropdown-item id="log-item" href="/register">Register</b-dropdown-item></router-link>
+      </b-nav-item-dropdown>
       </b-nav>
     </b-collapse>
   </b-navbar>
@@ -35,6 +41,10 @@ a:link, a:visited {
   text-decoration: none;
 }
 
+#nav_text_collapse {
+  color: white;
+}
+
 .navbar {
   background: #072c62 !important;
   height: 55px;
@@ -50,6 +60,16 @@ a:link, a:visited {
   color: #3e6eb3;
 }
 
+#log-item {
+  color: rgb(10, 46, 96)!important;
+}
+
+.navbar-nav {
+    float: right;
+    position: absolute;
+    right: 10px;
+}
+
 .logo {
   padding-top: 13px;
   text-decoration: none !important;

From ca5677f4457edfe4294024d2d5a3d1985248da17 Mon Sep 17 00:00:00 2001
From: MatheusMello <mat.mello93@gmail.com>
Date: Dec 10 2017 19:51:49 +0000
Subject: [PATCH 7/9] Styles and Anchors in Register and Login page

- Improve packade page layout and refactor errors table data fields

Signed-off-by: EduardoQuintino <eduardoqgomes@gmail.com>
Signed-off-by: MaxOliveira <maxwell_oliveira2@hotmail.com>
Signed-off-by: MatheusMello <mat.mello93@gmail.com>
Signed-off-by: Eduardo Nunes <eduardonunes2525@gmail.com>
Signed-off-by: Omar Junior <omarfariajr@gmail.com>
Signed-off-by: Vitor Bertulucci <vitorbertulucci@gmail.com>

---

diff --git a/src/components/login/LoginForm.vue b/src/components/login/LoginForm.vue
index d6613fe..9b6534c 100644
--- a/src/components/login/LoginForm.vue
+++ b/src/components/login/LoginForm.vue
@@ -37,6 +37,20 @@
         </div>
       </p>
     </b-card>
+    <b-card
+          tag="article"
+          style="max-width: 50rem;"
+          class="mb-2 route-card">
+          <div class="text-center text-muted">
+            <p>
+            New to Kiskadee? <br>
+            <router-link :to="{ name: 'register-page' }">
+              Create an account
+            </router-link>
+            </p>
+          </div>
+    </b-card>
+
   </div>
 </template>
 <script>
@@ -95,4 +109,9 @@
   .card-body {
     padding: 0 1.25rem;
   }
+  .route-card {
+    vertical-align: center;
+    padding-top: 1em;
+    // padding-bottom: 1em;
+  }
 </style>
diff --git a/src/components/package/ErrorsTable.vue b/src/components/package/ErrorsTable.vue
index 1040ba6..817b1a6 100644
--- a/src/components/package/ErrorsTable.vue
+++ b/src/components/package/ErrorsTable.vue
@@ -12,23 +12,31 @@ export default {
   },
   data () {
     return {
-      fields: {
-        type: {
-          label: 'Type',
-          sortable: true,
-          'class': 'text-center'
+      fields: [
+        {
+          type: {
+            label: 'Type',
+            sortable: true,
+            'class': 'text-center'
+          }
         },
-        path: {
-          label: 'Path',
-          sortable: true
+        {
+          path: {
+            label: 'Path',
+            sortable: true
+          }
         },
-        line: {
-          label: 'Line : Column'
+        {
+          line: {
+            label: 'Line : Column'
+          }
         },
-        message: {
-          label: 'Message'
+        {
+          message: {
+            label: 'Message'
+          }
         }
-      }
+      ]
     }
   },
   computed: {
diff --git a/src/components/package/PackagePage.vue b/src/components/package/PackagePage.vue
index c8dcc93..3e1ba03 100644
--- a/src/components/package/PackagePage.vue
+++ b/src/components/package/PackagePage.vue
@@ -1,21 +1,24 @@
 <template>
   <div class="package-page container">
-    <div class="card container">
+    <b-card :title="packageNameVersion" :sub-title="package.last_updated">
       <div class="row">
         <div class="col-sm-6 description-container">
-          <summary-package :package="package" class="summary" />
-          <p> Selecione um analizador para verificar os erros: </p>
-          <b-dropdown id="ddown1" :text= "analizers[selectedAnalizer].name" variant="primary" class="m-md-2">
-            <b-dropdown-item v-for="(analizer, index) in analizers" key="'dropdown' + index" @click="onSelectAnalizer(index)"> {{ analizer.name }} </b-dropdown-item>
-          </b-dropdown>
+          <p>
+            Selecione um analizador para verificar os erros: 
+            <b-dropdown id="ddown1" :text= "analizers[selectedAnalizer].name" variant="primary" class="m-md-2">
+              <b-dropdown-item v-for="(analizer, index) in analizers" key="'dropdown' + index" @click="onSelectAnalizer(index)"> {{ analizer.name }} </b-dropdown-item>
+            </b-dropdown>
+          </p>
+          <b-card>
+            <p> Total de erros do analizador {{ analizers[selectedAnalizer].name }}: </p>
+            <p id="total-value"> {{ total }} </p>
+          </b-card>
         </div>
         <div class="col-sm-6 graph-container">
-          <p> Erros do analizador {{ analizers[selectedAnalizer].name }}: </p>
-          <p> Total: {{ total }} </p>
           <pie-chart :data="datasets" class="graph" />
         </div>
       </div>
-    </div>
+    </b-card>
     <b-tabs>
       <b-tab title="Lista de Erros" active>
         <errors-table />
@@ -61,6 +64,12 @@ export default {
       getterNames.analizers,
       getterNames.reports
     ]),
+    pkg () {
+      return this.package
+    },
+    packageNameVersion () {
+      return this.pkg.name + ' - v' + this.pkg.last_version
+    },
     datasets () {
       const labels = Object.keys(this.reports)
       const data = labels.map((key) => {
@@ -97,39 +106,45 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-.package-page {
-  margin-top: 20px;
-}
+  .package-page {
+    margin-top: 20px;
+  }
+  .card {
+    margin-bottom: 20px;
+  }
 
-.card {
-  margin-bottom: 20px;
-}
+  .description-container {
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    p {
+      text-align: center;
+    }
+  }
 
-.description-container {
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-  p {
-    text-align: center;
+  .graph-container {
+    display: flex;
+    flex-direction: column;
+    justify-content: center;
+    p {
+      text-align: center;
+    }
   }
-}
 
-.graph-container {
-  padding-top: 2vh;
-  display: flex;
-  flex-direction: column;
-  justify-content: center;
-  p {
-    text-align: center;
+  .summary {
+    margin-top: 15px;
   }
-}
 
-.summary {
-  margin-top: 15px;
-}
+  .graph {
+    padding: 10px 0;
+    margin: 0 auto;
+  }
 
-.graph {
-  padding: 10px 0;
-  margin: 0 auto;
-}
+  @import url('https://fonts.googleapis.com/css?family=Comfortaa:700');
+
+  #total-value {
+    font-family: 'Comfortaa', cursive;
+    text-decoration: none;
+    font-size: 80px;
+  }
 </style>
diff --git a/src/components/register/RegisterForm.vue b/src/components/register/RegisterForm.vue
index 016c3cc..5164ab6 100644
--- a/src/components/register/RegisterForm.vue
+++ b/src/components/register/RegisterForm.vue
@@ -1,6 +1,10 @@
 <template>
   <div>
-    <b-card title="Register User"
+    <div class="text-center">
+      <img src="../../assets/kiskadee-logo.png" width="100" height="100" class="d-inline-block align-top" alt="logo">
+      <h3>Sign up to Kiskadee</h3>
+    </div>
+    <b-card title=""
           tag="article"
           style="max-width: 50rem;"
           class="mb-2">
@@ -44,6 +48,19 @@
         </div>
       </p>
     </b-card>
+     <b-card
+          tag="article"
+          style="max-width: 50rem;"
+          class="mb-2 route-card">
+          <div class="text-center text-muted">
+            <p>
+            Already registered? <br>
+            <router-link :to="{ name: 'login-page' }">
+              Go to login
+            </router-link>
+            </p>
+          </div>
+    </b-card>
   </div>
 </template>
 
@@ -125,4 +142,8 @@
     margin-bottom: 10px;
     color: rgb(10, 46, 96);
   }
+   .route-card {
+    vertical-align: center;
+    padding-top: 1em;
+  }
 </style>
diff --git a/src/components/register/RegisterPage.vue b/src/components/register/RegisterPage.vue
index 2abda56..3c0b0ef 100644
--- a/src/components/register/RegisterPage.vue
+++ b/src/components/register/RegisterPage.vue
@@ -28,9 +28,5 @@ export default {
 
 .register-form {
     margin: auto;
-    padding-top: 3%;
   }
 </style>
-
-
-
diff --git a/src/components/shared/DefaultTable.vue b/src/components/shared/DefaultTable.vue
index a21ee6a..5c5b65a 100644
--- a/src/components/shared/DefaultTable.vue
+++ b/src/components/shared/DefaultTable.vue
@@ -16,7 +16,7 @@
         </div>
       </h6>
       <em slot="footer">
-        <b-pagination align="center" :total-rows="totalRows" :per-page="perPage" v-model="currentPage"/>
+        <b-pagination align="center" :per-page="perPage" v-model="currentPage"/>
       </em>
       <p class="card-text">
         <b-table striped hover show-empty responsive
@@ -71,7 +71,6 @@ export default {
   },
   methods: {
     onFiltered (filteredItems) {
-      this.totalRows = filteredItems.length
       this.currentPage = 1
     }
   }
diff --git a/src/components/shared/HeaderK.vue b/src/components/shared/HeaderK.vue
index c5e02cf..4c58152 100644
--- a/src/components/shared/HeaderK.vue
+++ b/src/components/shared/HeaderK.vue
@@ -10,7 +10,7 @@
 
     <b-collapse is-nav id="nav_text_collapse">
       <b-nav is-nav-bar>
-      <icon name="sign-in" scale="2.5"></icon>
+      <icon name="user-circle" scale="2.5"></icon>
       <b-nav-item-dropdown right class="log-itens">
         <router-link :to="{ name: 'login-page' }"><b-dropdown-item id="log-item" href="/login">Login</b-dropdown-item></router-link>
         <router-link :to="{ name: 'register-page' }"><b-dropdown-item id="log-item" href="/register">Register</b-dropdown-item></router-link>

From 8702f90b7d6779bca1e3ab8fb252cfeebced3b78 Mon Sep 17 00:00:00 2001
From: Vitor Borges <vitorbertulucci@gmail.com>
Date: Dec 10 2017 19:53:20 +0000
Subject: [PATCH 8/9] [API] Add api endpoint for packages


Signed-off-by: MatheusGodinho <matheus.godinho@outlook.com>
Signed-off-by: Vitor Borges <vitorbertulucci@gmail.com>

---

diff --git a/src/api/analyzers.js b/src/api/analyzers.js
new file mode 100644
index 0000000..f5a33d4
--- /dev/null
+++ b/src/api/analyzers.js
@@ -0,0 +1,7 @@
+import axios from '.'
+
+export default {
+  get: (currentPackage) => {
+    return axios.get(`/analysis/${currentPackage.name}/${currentPackage.version}`)
+  }
+}
diff --git a/src/components/package/PackagePage.vue b/src/components/package/PackagePage.vue
index 3e1ba03..54c8d9a 100644
--- a/src/components/package/PackagePage.vue
+++ b/src/components/package/PackagePage.vue
@@ -4,18 +4,20 @@
       <div class="row">
         <div class="col-sm-6 description-container">
           <p>
-            Selecione um analizador para verificar os erros: 
-            <b-dropdown id="ddown1" :text= "analizers[selectedAnalizer].name" variant="primary" class="m-md-2">
-              <b-dropdown-item v-for="(analizer, index) in analizers" key="'dropdown' + index" @click="onSelectAnalizer(index)"> {{ analizer.name }} </b-dropdown-item>
+            Select an analyzer 
+            <b-dropdown id="ddown1" :text= "selectedAnalyzerName" variant="primary" class="m-md-2">
+              <b-dropdown-item v-for="(analyzer, index) in analyzers" key="'dropdown' + index" @click="onSelectAnalyzer(index)"> {{ analyzer.name }} </b-dropdown-item>
             </b-dropdown>
           </p>
           <b-card>
-            <p> Total de erros do analizador {{ analizers[selectedAnalizer].name }}: </p>
+            <p>Total complaints from <b><i>{{ selectedAnalyzerName }}</i></b></p>
             <p id="total-value"> {{ total }} </p>
           </b-card>
         </div>
-        <div class="col-sm-6 graph-container">
-          <pie-chart :data="datasets" class="graph" />
+        <div class="col-sm-6 graph-container"> 
+          <div class="col-sm-6 graph-container">
+            <pie-chart :data="datasets" class="graph" />
+          </div>
         </div>
       </div>
     </b-card>
@@ -26,7 +28,7 @@
       <b-tab title="Erros por Arquivo" >
         <information-per-file-table />
       </b-tab>
-    </b-tabs>
+    </b-tabs>int for packages
   </div>
 </template>
 
@@ -38,8 +40,19 @@ import SummaryPackage from './SummaryPackage'
 import InformationPerFileTable from './InformationPerFileTable'
 import ErrorsTable from './ErrorsTable'
 import PieChart from './PieChart'
+import store from '../../store'
 
 export default {
+  async beforeRouteEnter (to, from, next) {
+    try {
+      // await Do something before router PUSH
+      // next(vm => vm.foo = bar)
+      await store.dispatch('fetchAnalyzers', to.params.package)
+      next()
+    } catch (err) {
+      console.log(err)
+    }
+  },
   components: {
     SummaryPackage,
     ErrorsTable,
@@ -56,12 +69,12 @@ export default {
   },
   data () {
     return {
-      selectedAnalizer: 0
+      selectedAnalyzerId: 0
     }
   },
   computed: {
     ...mapGetters([
-      getterNames.analizers,
+      getterNames.analyzers,
       getterNames.reports
     ]),
     pkg () {
@@ -70,6 +83,16 @@ export default {
     packageNameVersion () {
       return this.pkg.name + ' - v' + this.pkg.last_version
     },
+    selectedAnalyzer () {
+      return (
+        this.analyzers
+        .filter(a => a.id === this.selectedAnalyzerId) ||
+        [{name: 'teste', id: 0}]
+      )[0]
+    },
+    selectedAnalyzerName () {
+      return (this.selectedAnalyzer || {name: 'error'}).name
+    },
     datasets () {
       const labels = Object.keys(this.reports)
       const data = labels.map((key) => {
@@ -92,15 +115,14 @@ export default {
   },
   methods: {
     ...mapActions([
-      actionTypes.SET_SELECTED
+      actionTypes.FETCH_ANALYZERS
     ]),
-    onSelectAnalizer (index) {
-      this.selectedAnalizer = index
-      this.setSelected(this.analizers[this.selectedAnalizer].id)
+    onSelectAnalyzer (index, analyzer) {
+      this.selectedAnalyzerId = analyzer.id
     }
   },
-  mounted () {
-    this.setSelected(this.analizers[this.selectedAnalizer].id)
+  async mounted () {
+    this.selectedAnalyzerId = this.analyzers[0].id
   }
 }
 </script>
diff --git a/src/store/actionTypes.js b/src/store/actionTypes.js
index 3cbf87c..1469345 100644
--- a/src/store/actionTypes.js
+++ b/src/store/actionTypes.js
@@ -1,4 +1,6 @@
 // Packages
 export const FETCH_PACKAGES = 'fetchPackages'
-export const SET_SELECTED = 'setSelected'
 export const FILTERED_PACKAGES = 'filteredPackages'
+
+// Analyzers
+export const FETCH_ANALYZERS = 'fetchAnalyzers'
diff --git a/src/store/getterNames.js b/src/store/getterNames.js
index 2ffb321..971ffe7 100644
--- a/src/store/getterNames.js
+++ b/src/store/getterNames.js
@@ -1,6 +1,6 @@
 // Packages
 export const allPackages = 'allPackages'
-export const analizers = 'analizers'
+export const analyzers = 'analyzers'
 export const reports = 'reports'
 export const errorsList = 'errorsList'
 export const filteredPackages = 'filteredPackages'
diff --git a/src/store/index.js b/src/store/index.js
index 2b4a4c9..3821c50 100644
--- a/src/store/index.js
+++ b/src/store/index.js
@@ -1,11 +1,11 @@
 import Vuex from 'vuex'
 
 import packages from './modules/packages'
-import analisys from './modules/analysis'
+import analyzers from './modules/analyzers'
 
 export default new Vuex.Store({
   modules: {
     packages,
-    analisys
+    analyzers
   }
 })
diff --git a/src/store/modules/analyzers.js b/src/store/modules/analyzers.js
new file mode 100644
index 0000000..06c340d
--- /dev/null
+++ b/src/store/modules/analyzers.js
@@ -0,0 +1,42 @@
+import * as actionTypes from '../actionTypes'
+import * as getterNames from '../getterNames'
+import * as mutationTypes from '../mutationsTypes'
+import api from '../../api/analyzers'
+
+const state = {
+  analyzers: []
+}
+
+const getters = {
+  [getterNames.analyzers]: (state) => {
+    return state.analyzers
+  },
+  [getterNames.reports]: (state) => {
+    return []
+  },
+  [getterNames.errorsList]: (state) => {
+    return []
+  }
+}
+
+const actions = {
+  async [actionTypes.FETCH_ANALYZERS] ({commit, getters, state}, currentPackage) {
+    console.log(currentPackage)
+    let { data } = await api.get(currentPackage)
+    console.log(data)
+    commit(mutationTypes.STORE_ANALYZERS, data)
+  }
+}
+
+const mutations = {
+  [mutationTypes.STORE_ANALYZERS] (state, data) {
+    state.analyzers = data
+  }
+}
+
+export default {
+  state,
+  getters,
+  actions,
+  mutations
+}
diff --git a/src/store/modules/packages.js b/src/store/modules/packages.js
index 11bca3e..cd9dd27 100644
--- a/src/store/modules/packages.js
+++ b/src/store/modules/packages.js
@@ -1,73 +1,10 @@
-// import api from '../../api/packages'
+import api from '../../api/packages'
 import * as actionTypes from '../actionTypes'
 import * as getterNames from '../getterNames'
 import * as mutationTypes from '../mutationsTypes'
 
-// const mockedPackages = [
-//   {
-//     name: 'example1',
-//     last_version: '0.1'
-//   },
-//   {
-//     name: 'foo1',
-//     last_version: '0.2'
-//   },
-//   {
-//     name: 'example2',
-//     last_version: '0.3'
-//   }
-// ]
-
-const mockedPackages = [
-  {
-    name: 'Fedora Package',
-    version: '0.3.8',
-    upstream: 'http://www.google.com',
-    lastUpdate: '17/09/2017',
-    last_version: '0.1',
-    versions: [
-      {analysis: [
-        {analyzer_id: '2'}
-      ],
-        number: '2',
-        package_id: '1'
-      }
-    ]
-  },
-  {
-    name: 'Pacote de Dados',
-    version: '0.3.8',
-    upstream: 'http://www.google.com',
-    lastUpdate: '17/09/2017',
-    last_version: '0.2',
-    versions: [
-      {analysis: [
-        {analyzer_id: '3'}
-      ],
-        number: '2',
-        package_id: '1'
-      }
-    ]
-  },
-  {
-    name: 'Teste',
-    version: '0.3.8',
-    upstream: 'http://www.google.com',
-    lastUpdate: '17/09/2017',
-    last_version: '0.3',
-    versions: [
-      {analysis: [
-        {analyzer_id: '1'}
-      ],
-        number: '2',
-        package_id: '1'
-      }
-    ]
-  }
-]
-
 const state = {
-  allPackages: mockedPackages,
+  allPackages: [],
   filteredPackages: {}
 }
 
@@ -83,21 +20,17 @@ const getters = {
 const actions = {
   async [actionTypes.FETCH_PACKAGES] ({commit, getters, state}, search) {
     // let { data } = await api.get()
-    let data = []
+    let { data } = await api.get()
+    let results = []
     if (!search) {
-      data = mockedPackages
+      results = data.packages
     } else {
-      data = mockedPackages.filter((pkg) => {
+      results = data.packages.filter((pkg) => {
         return pkg.name.includes(search)
       })
     }
-    commit(mutationTypes.STORE_PACKAGES, data)
-
-    if (data.length === 0) {
-      return false
-    } else {
-      return true
-    }
+    commit(mutationTypes.STORE_PACKAGES, results)
+    return true
   },
   async [actionTypes.FILTERED_PACKAGES] ({commit, getters, state}, search) {
     commit(mutationTypes.FILTER_PACKAGES, search)
@@ -106,16 +39,7 @@ const actions = {
 
 const mutations = {
   [mutationTypes.STORE_PACKAGES] (state, data) {
-    state.allPackages = data.map((pkg) => {
-      return {
-        package_id: pkg.versions[0].package_id,
-        name: pkg.name,
-        last_updated: pkg.lastUpdate,
-        last_version: pkg.versions[0].number,
-        fetcher_id: pkg.fetcher_id,
-        analyzer_id: pkg.versions[0].analysis[0].analyzer_id
-      }
-    })
+    state.allPackages = data
   },
   [mutationTypes.FILTER_PACKAGES] (state, search) {
     state.filtered = state.allPackages.map((pkg) => {
diff --git a/src/store/mutationsTypes.js b/src/store/mutationsTypes.js
index f2ba8b2..c34f0c0 100644
--- a/src/store/mutationsTypes.js
+++ b/src/store/mutationsTypes.js
@@ -2,3 +2,6 @@
 export const STORE_PACKAGES = 'STORE_PACKAGES'
 export const STORE_SELECTED = 'STORE_SELECTED'
 export const FILTER_PACKAGES = 'FILTER_PACKAGES'
+
+// Analyzers
+export const STORE_ANALYZERS = 'STORE_ANALYZERS'

From f9396960496797994e7f956029ca1ae45e1e8b32 Mon Sep 17 00:00:00 2001
From: Vitor Borges <vitorbertulucci@gmail.com>
Date: Dec 10 2017 20:37:41 +0000
Subject: [PATCH 9/9] Adding route recovery package logic

- Fix confusion between analyzers and analysis on store

---

diff --git a/src/api/analysis.js b/src/api/analysis.js
new file mode 100644
index 0000000..3801b1a
--- /dev/null
+++ b/src/api/analysis.js
@@ -0,0 +1,13 @@
+import axios from '.'
+
+export default {
+  get: (currentPackage) => {
+    return axios.get(`/analysis/${currentPackage.name}/${currentPackage.versions}`)
+  },
+  getReports: (currentPackage, id) => {
+    return axios.get(`/analysis/${currentPackage.name}/${currentPackage.version}/${id}/reports`)
+  },
+  getResults: (currentPackage, id) => {
+    return axios.get(`/analysis/${currentPackage.name}/${currentPackage.version}/${id}/results`)
+  }
+}
diff --git a/src/api/analyzers.js b/src/api/analyzers.js
deleted file mode 100644
index f5a33d4..0000000
--- a/src/api/analyzers.js
+++ /dev/null
@@ -1,7 +0,0 @@
-import axios from '.'
-
-export default {
-  get: (currentPackage) => {
-    return axios.get(`/analysis/${currentPackage.name}/${currentPackage.version}`)
-  }
-}
diff --git a/src/components/package/ErrorsTable.vue b/src/components/package/ErrorsTable.vue
index 817b1a6..632ef7a 100644
--- a/src/components/package/ErrorsTable.vue
+++ b/src/components/package/ErrorsTable.vue
@@ -1,5 +1,5 @@
 <template>
-  <default-table :bodyTable="correctList" :headerTable="fields" />
+  <default-table :bodyTable="correctList" :header-table="fields"/>
 </template>
 <script>
 import { mapGetters } from 'vuex'
diff --git a/src/components/package/List.vue b/src/components/package/List.vue
index 805bca2..6ce1605 100644
--- a/src/components/package/List.vue
+++ b/src/components/package/List.vue
@@ -33,7 +33,7 @@
         <span class="date text-muted">Last updated {{ this.updateData }}</span>
       </div>
     </div>
-    <b-table striped hover :items="allPackages" height="100" @row-clicked="showPackage"></b-table>
+    <b-table striped hover :items="formatPackages" height="100" @row-clicked="showPackage"></b-table>
   </div>
 </template>
 
@@ -62,7 +62,19 @@ export default {
   computed: {
     ...mapGetters([
       getterNames.allPackages
-    ])
+    ]),
+    formatPackages () {
+      return this.allPackages.map(p => {
+        return {
+          fetcherId: p.fetcher_id,
+          id: p.id,
+          name: p.name,
+          versions: p.versions.sort((a, b) => {
+            return a.number < b.number
+          })[0].number
+        }
+      })
+    }
   },
   methods: {
     ...mapActions([
@@ -73,6 +85,9 @@ export default {
         name: 'analysis',
         params: {
           package: item
+        },
+        query: {
+          package: item.id
         }
       })
     },
diff --git a/src/components/package/PackagePage.vue b/src/components/package/PackagePage.vue
index 54c8d9a..5fda2ac 100644
--- a/src/components/package/PackagePage.vue
+++ b/src/components/package/PackagePage.vue
@@ -6,7 +6,7 @@
           <p>
             Select an analyzer 
             <b-dropdown id="ddown1" :text= "selectedAnalyzerName" variant="primary" class="m-md-2">
-              <b-dropdown-item v-for="(analyzer, index) in analyzers" key="'dropdown' + index" @click="onSelectAnalyzer(index)"> {{ analyzer.name }} </b-dropdown-item>
+              <b-dropdown-item v-for="(a, index) in analysis" key="'dropdown' + index" @click="onSelectAnalyzer(index, a)"> {{ a.analyzers.name }} </b-dropdown-item>
             </b-dropdown>
           </p>
           <b-card>
@@ -22,13 +22,13 @@
       </div>
     </b-card>
     <b-tabs>
-      <b-tab title="Lista de Erros" active>
+      <b-tab title="Errors list" active>
         <errors-table />
       </b-tab>
-      <b-tab title="Erros por Arquivo" >
+      <b-tab title="Errors per file" >
         <information-per-file-table />
       </b-tab>
-    </b-tabs>int for packages
+    </b-tabs>
   </div>
 </template>
 
@@ -40,15 +40,27 @@ import SummaryPackage from './SummaryPackage'
 import InformationPerFileTable from './InformationPerFileTable'
 import ErrorsTable from './ErrorsTable'
 import PieChart from './PieChart'
-import store from '../../store'
+import store from '@/store'
 
 export default {
   async beforeRouteEnter (to, from, next) {
     try {
-      // await Do something before router PUSH
-      // next(vm => vm.foo = bar)
-      await store.dispatch('fetchAnalyzers', to.params.package)
-      next()
+      let filtered
+      if (to.params.package) {
+        await store.dispatch('fetchAnalysis', to.params.package)
+      } else {
+        const packageId = Number(to.query.package)
+        filtered = store.getters.allPackages.filter(p => {
+          return p.id === packageId
+        })[0]
+      }
+      next(
+        vm => {
+          if (filtered) {
+            vm.currentPackage = filtered
+          }
+        }
+      )
     } catch (err) {
       console.log(err)
     }
@@ -69,29 +81,30 @@ export default {
   },
   data () {
     return {
-      selectedAnalyzerId: 0
+      selectAnalysisId: 0,
+      currentPackage: {}
     }
   },
   computed: {
     ...mapGetters([
-      getterNames.analyzers,
+      getterNames.analysis,
       getterNames.reports
     ]),
     pkg () {
       return this.package
     },
     packageNameVersion () {
-      return this.pkg.name + ' - v' + this.pkg.last_version
+      // TODO: Add last_version on package
+      return 'Package: ' + this.pkg.name // + ' - v' + this.pkg.last_version
     },
     selectedAnalyzer () {
       return (
-        this.analyzers
-        .filter(a => a.id === this.selectedAnalyzerId) ||
-        [{name: 'teste', id: 0}]
-      )[0]
+        this.analysis ||
+        [{id: 0, analyzers: {name: 'teste', id: 0}}]
+      ).find(a => a.id === this.selectAnalysisId)
     },
     selectedAnalyzerName () {
-      return (this.selectedAnalyzer || {name: 'error'}).name
+      return (this.selectedAnalyzer || {analyzers: {name: 'error'}}).analyzers.name
     },
     datasets () {
       const labels = Object.keys(this.reports)
@@ -101,7 +114,7 @@ export default {
       const datasets = [{
         label: 'Errors',
         data: data,
-        backgroundColor: ['#CC0000', '#ffbb33', '#0099CC']
+        backgroundColor: ['#CC0000', '#ffbb33', '#0099CC', '#F2FaFb', '#fafafa']
       }]
       return { labels, datasets }
     },
@@ -115,14 +128,24 @@ export default {
   },
   methods: {
     ...mapActions([
-      actionTypes.FETCH_ANALYZERS
+      actionTypes.FETCH_ANALYSIS_DATA
     ]),
-    onSelectAnalyzer (index, analyzer) {
-      this.selectedAnalyzerId = analyzer.id
+    onSelectAnalyzer (index, analysis) {
+      this.selectAnalysisId = analysis.id
+      this.fetchData()
+    },
+    async fetchData () {
+      if (this.selectAnalysisId) {
+        await this.fetchAnalysisData({ currentPackage: this.package, id: this.selectAnalysisId })
+      }
     }
   },
-  async mounted () {
-    this.selectedAnalyzerId = this.analyzers[0].id
+  mounted () {
+    if (this.package) {
+      this.currentPackage = this.package
+    }
+    this.selectAnalysisId = (this.analysis || [{id: 0}])[0].id
+    this.fetchData()
   }
 }
 </script>
diff --git a/src/router/routes.js b/src/router/routes.js
index 6cb99e1..cb3d611 100644
--- a/src/router/routes.js
+++ b/src/router/routes.js
@@ -6,7 +6,7 @@ import LoginPage from '../components/login/LoginPage.vue'
 
 export const routes = [
   { name: 'home', path: '', component: Home },
-  { name: 'analysis', path: '/analysis/', component: PackagePage, props: route => ({package: route.params.package}) },
+  { name: 'analysis', path: '/analysis/', component: PackagePage, props: route => ({package: route.params.package}), query: { package: 'Test' } },
   { name: 'profile-page', path: '/profile', component: ProfilePage },
   { name: 'register-page', path: '/register', component: RegisterPage },
   { name: 'login-page', path: '/login', component: LoginPage }
diff --git a/src/store/actionTypes.js b/src/store/actionTypes.js
index 1469345..e90584a 100644
--- a/src/store/actionTypes.js
+++ b/src/store/actionTypes.js
@@ -3,4 +3,7 @@ export const FETCH_PACKAGES = 'fetchPackages'
 export const FILTERED_PACKAGES = 'filteredPackages'
 
 // Analyzers
-export const FETCH_ANALYZERS = 'fetchAnalyzers'
+export const FETCH_ANALYSIS = 'fetchAnalysis'
+
+// Analysis
+export const FETCH_ANALYSIS_DATA = 'fetchAnalysisData'
diff --git a/src/store/getterNames.js b/src/store/getterNames.js
index 971ffe7..a52326b 100644
--- a/src/store/getterNames.js
+++ b/src/store/getterNames.js
@@ -1,6 +1,6 @@
 // Packages
 export const allPackages = 'allPackages'
-export const analyzers = 'analyzers'
+export const analysis = 'analysis'
 export const reports = 'reports'
 export const errorsList = 'errorsList'
 export const filteredPackages = 'filteredPackages'
diff --git a/src/store/index.js b/src/store/index.js
index 3821c50..f3b9238 100644
--- a/src/store/index.js
+++ b/src/store/index.js
@@ -1,11 +1,13 @@
 import Vuex from 'vuex'
 
 import packages from './modules/packages'
-import analyzers from './modules/analyzers'
+import analysis from './modules/analysis'
+import analysisData from './modules/analysisData'
 
 export default new Vuex.Store({
   modules: {
     packages,
-    analyzers
+    analysisData,
+    analysis
   }
 })
diff --git a/src/store/modules/analysis.js b/src/store/modules/analysis.js
index 801f4f8..45ca73c 100644
--- a/src/store/modules/analysis.js
+++ b/src/store/modules/analysis.js
@@ -1,371 +1,28 @@
 import * as actionTypes from '../actionTypes'
 import * as getterNames from '../getterNames'
 import * as mutationTypes from '../mutationsTypes'
+import api from '../../api/analysis'
 
 const state = {
-  analysis: [
-    {
-      'analyzer_id': 1,
-      'id': 1,
-      'raw': {
-        'customfields': null,
-        'metadata': {
-          'file_': null,
-          'generator': {
-            'name': 'cppcheck',
-            'version': '1.80'
-          },
-          'stats': null,
-          'sut': null
-        },
-        'results': [
-          {
-            'customfields': null,
-            'cwe': null,
-            'location': {
-              'file': {
-                'abspath': null,
-                'givenpath': 'source/active_children.c',
-                'hash_': null
-              },
-              'function': null,
-              'point': {
-                'column': 0,
-                'line': 42
-              },
-              'range_': null
-            },
-            'message': {
-              'text': 'Unused variable: stdin_descriptor'
-            },
-            'notes': null,
-            'severity': 'style',
-            'testid': 'unusedVariable',
-            'trace': null,
-            'type': 'Issue'
-          },
-          {
-            'customfields': null,
-            'cwe': null,
-            'location': {
-              'file': {
-                'abspath': null,
-                'givenpath': 'source/father.c',
-                'hash_': null
-              },
-              'function': null,
-              'point': {
-                'column': 0,
-                'line': 43
-              },
-              'range_': null
-            },
-            'message': {
-              'text': 'The scope of the variable \'times\' can be reduced.'
-            },
-            'notes': {
-              'text': `The scope of the variable 'times' can be reduced. Warning: Be careful when fixing this message, especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced:\\012void f(int x)\\012{\\012    int i = 0;\\012    if (x) {\\012        // it's safe to move 'int i = 0;' here\\012        for (int n = 0; n < 10; ++n) {\\012            // it is possible but not safe to move 'int i = 0;' here\\012            do_something(&i);\\012        }\\012    }\\012}\\012When you see this message it is always safe to reduce the variable scope 1 level.`
-            },
-            'severity': 'style',
-            'testid': 'variableScope',
-            'trace': null,
-            'type': 'Issue'
-          },
-          {
-            'customfields': null,
-            'cwe': null,
-            'location': {
-              'file': {
-                'abspath': null,
-                'givenpath': 'source/father.c',
-                'hash_': null
-              },
-              'function': null,
-              'point': {
-                'column': 0,
-                'line': 45
-              },
-              'range_': null
-            },
-            'message': {
-              'text': `The scope of the variable 'complete_msg_sleepy' can be reduced.`
-            },
-            'notes': {
-              'text': `The scope of the variable 'complete_msg_sleepy' can be reduced. Warning: Be careful when fixing this message, especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced:\\012void f(int x)\\012{\\012    int i = 0;\\012    if (x) {\\012        // it's safe to move 'int i = 0;' here\\012        for (int n = 0; n < 10; ++n) {\\012            // it is possible but not safe to move 'int i = 0;' here\\012            do_something(&i);\\012        }\\012    }\\012}\\012When you see this message it is always safe to reduce the variable scope 1 level.`
-            },
-            'severity': 'style',
-            'testid': 'variableScope',
-            'trace': null,
-            'type': 'Issue'
-          },
-          {
-            'customfields': null,
-            'cwe': null,
-            'location': {
-              'file': {
-                'abspath': null,
-                'givenpath': 'source/father.c',
-                'hash_': null
-              },
-              'function': null,
-              'point': {
-                'column': 0,
-                'line': 46
-              },
-              'range_': null
-            },
-            'message': {
-              'text': `The scope of the variable 'complete_msg_active' can be reduced.`
-            },
-            'notes': {
-              'text': `The scope of the variable 'complete_msg_active' can be reduced. Warning: Be careful when fixing this message, especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced:\\012void f(int x)\\012{\\012    int i = 0;\\012    if (x) {\\012        // it's safe to move 'int i = 0;' here\\012        for (int n = 0; n < 10; ++n) {\\012            // it is possible but not safe to move 'int i = 0;' here\\012            do_something(&i);\\012        }\\012    }\\012}\\012When you see this message it is always safe to reduce the variable scope 1 level.`
-            },
-            'severity': 'style',
-            'testid': 'variableScope',
-            'trace': null,
-            'type': 'Issue'
-          },
-          {
-            'customfields': null,
-            'cwe': null,
-            'location': {
-              'file': {
-                'abspath': null,
-                'givenpath': 'source/father.c',
-                'hash_': null
-              },
-              'function': null,
-              'point': {
-                'column': 0,
-                'line': 77
-              },
-              'range_': null
-            },
-            'message': {
-              'text': `The scope of the variable 'seconds' can be reduced.`
-            },
-            'notes': {
-              'text': `The scope of the variable 'seconds' can be reduced. Warning: Be careful when fixing this message, especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced:\\012void f(int x)\\012{\\012    int i = 0;\\012    if (x) {\\012        // it's safe to move 'int i = 0;' here\\012        for (int n = 0; n < 10; ++n) {\\012            // it is possible but not safe to move 'int i = 0;' here\\012            do_something(&i);\\012        }\\012    }\\012}\\012When you see this message it is always safe to reduce the variable scope 1 level.`
-            },
-            'severity': 'style',
-            'testid': 'variableScope',
-            'trace': null,
-            'type': 'Issue'
-          },
-          {
-            'customfields': null,
-            'cwe': null,
-            'location': {
-              'file': {
-                'abspath': null,
-                'givenpath': 'source/father.c',
-                'hash_': null
-              },
-              'function': null,
-              'point': {
-                'column': 0,
-                'line': 114
-              },
-              'range_': null
-            },
-            'message': {
-              'text': 'Uninitialized variable: readbuffer_active'
-            },
-            'notes': null,
-            'severity': 'error',
-            'testid': 'uninitvar',
-            'trace': null,
-            'type': 'Issue'
-          },
-          {
-            'customfields': null,
-            'cwe': null,
-            'location': {
-              'file': {
-                'abspath': null,
-                'givenpath': 'source/main.c',
-                'hash_': null
-              },
-              'function': null,
-              'point': {
-                'column': 0,
-                'line': 14
-              },
-              'range_': null
-            },
-            'message': {
-              'text': 'Uninitialized variable: sleepy_children'
-            },
-            'notes': null,
-            'severity': 'error',
-            'testid': 'uninitvar',
-            'trace': null,
-            'type': 'Issue'
-          },
-          {
-            'customfields': null,
-            'cwe': null,
-            'location': {
-              'file': {
-                'abspath': null,
-                'givenpath': 'source/main.c',
-                'hash_': null
-              },
-              'function': null,
-              'point': {
-                'column': 0,
-                'line': 14
-              },
-              'range_': null
-            },
-            'message': {
-              'text': 'Uninitialized variable: active_children'
-            },
-            'notes': null,
-            'severity': 'error',
-            'testid': 'uninitvar',
-            'trace': null,
-            'type': 'Issue'
-          },
-          {
-            'customfields': null,
-            'cwe': null,
-            'location': {
-              'file': {
-                'abspath': null,
-                'givenpath': 'source/sleepy_children.c',
-                'hash_': null
-              },
-              'function': null,
-              'point': {
-                'column': 0,
-                'line': 30
-              },
-              'range_': null
-            },
-            'message': {
-              'text': `The scope of the variable 'time_to_sleep' can be reduced.`
-            },
-            'notes': {
-              'text': `The scope of the variable 'time_to_sleep' can be reduced. Warning: Be careful when fixing this message, especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced:\\012void f(int x)\\012{\\012    int i = 0;\\012    if (x) {\\012        // it's safe to move 'int i = 0;' here\\012        for (int n = 0; n < 10; ++n) {\\012            // it is possible but not safe to move 'int i = 0;' here\\012            do_something(&i);\\012        }\\012    }\\012}\\012When you see this message it is always safe to reduce the variable scope 1 level.`
-            },
-            'severity': 'warnings',
-            'testid': 'variableScope',
-            'trace': null,
-            'type': 'Issue'
-          },
-          {
-            'customfields': null,
-            'cwe': null,
-            'location': {
-              'file': {
-                'abspath': null,
-                'givenpath': 'source/sleepy_children.c',
-                'hash_': null
-              },
-              'function': null,
-              'point': {
-                'column': 0,
-                'line': 28
-              },
-              'range_': null
-            },
-            'message': {
-              'text': 'Unused variable: readbuffer_sleepy'
-            },
-            'notes': null,
-            'severity': 'warnings',
-            'testid': 'unusedVariable',
-            'trace': null,
-            'type': 'Issue'
-          },
-          {
-            'customfields': {
-              'verbose': `Cppcheck cannot find all the include files. Cppcheck can check the code without the include files found. But the results will probably be more accurate if all the include files are found. Please check your project's include directories and add all of them as include directories for Cppcheck. To see what files Cppcheck cannot find use --check-config.`
-            },
-            'failureid': 'missingIncludeSystem',
-            'location': null,
-            'message': {
-              'text': 'Cppcheck cannot find all the include files (use --check-config for details)'
-            },
-            'type': 'Failure'
-          }
-        ]
-      },
-      'report': {
-        'analysis_id': 1,
-        'id': 1,
-        'results': {
-          'errors': 3,
-          'styles': 5,
-          'warnings': 2
-        }
-      },
-      'version_id': 1
-    },
-    {
-      'analyzer_id': 2,
-      'id': 1,
-      'raw': {
-        'customfields': null,
-        'metadata': {
-          'file_': null,
-          'generator': {
-            'name': 'outro',
-            'version': '2.22'
-          },
-          'stats': null,
-          'sut': null
-        },
-        'results': []
-      },
-      'report': {
-        'id': 2,
-        'analyzer_id': 1,
-        'results': {
-          'errors': 10,
-          'warnings': 3,
-          'style': 4,
-          'Other': 15
-        }
-      },
-      'version_id': 2
-    }
-  ],
-  selectedAnalyzer: 1
+  analysis: []
 }
 
 const getters = {
-  [getterNames.analizers]: (state) => {
-    return state.analysis.map((analizer) => {
-      return {
-        id: analizer.analyzer_id,
-        name: analizer.raw.metadata.generator.name,
-        version: analizer.raw.metadata.generator.version
-      }
-    })
-  },
-  [getterNames.reports]: (state) => {
-    return state.analysis.filter((analyzer) => {
-      return analyzer.analyzer_id === state.selectedAnalyzer
-    }).map((analizer) => {
-      return analizer.report.results
-    })[0]
-  },
-  [getterNames.errorsList]: (state) => {
-    return state.analysis.filter((analyzer) => analyzer.analyzer_id === state.selectedAnalyzer).map((analyzer) => analyzer.raw.results)[0]
+  [getterNames.analysis]: (state) => {
+    return state.analysis
   }
 }
 
 const actions = {
-  async [actionTypes.SET_SELECTED] ({commit, getters, state}, id) {
-    commit(mutationTypes.STORE_SELECTED, id)
+  async [actionTypes.FETCH_ANALYSIS] ({commit, getters, state}, currentPackage) {
+    let { data } = await api.get(currentPackage)
+    commit(mutationTypes.STORE_ANALYSIS, data)
   }
 }
 
 const mutations = {
-  [mutationTypes.STORE_SELECTED] (state, id) {
-    state.selectedAnalyzer = id
+  [mutationTypes.STORE_ANALYSIS] (state, data) {
+    state.analysis = data
   }
 }
 
diff --git a/src/store/modules/analysisData.js b/src/store/modules/analysisData.js
new file mode 100644
index 0000000..39a0c9e
--- /dev/null
+++ b/src/store/modules/analysisData.js
@@ -0,0 +1,48 @@
+import * as actionTypes from '../actionTypes'
+import * as getterNames from '../getterNames'
+import * as mutationTypes from '../mutationsTypes'
+import api from '../../api/analysis'
+
+const state = {
+  analysis: {
+    results: [],
+    reports: []
+  }
+}
+
+const getters = {
+  [getterNames.reports]: (state) => {
+    return state.analysis.reports
+  },
+  [getterNames.errorsList]: (state) => {
+    return state.analysis.results
+  }
+}
+
+const actions = {
+  async [actionTypes.FETCH_ANALYSIS_DATA] ({commit, getters, state}, payload) {
+    let reports = (await api.getReports(payload.currentPackage, payload.id)).data
+    let results = (await api.getResults(payload.currentPackage, payload.id)).data
+    commit(mutationTypes.STORE_RESULTS, results)
+    commit(mutationTypes.STORE_REPORTS, reports)
+  }
+}
+
+const mutations = {
+  [mutationTypes.STORE_SELECTED_ANALYSIS] (state, id) {
+    state.selectedAnalyzer = id
+  },
+  [mutationTypes.STORE_RESULTS] (state, results) {
+    state.analysis.results = results.analysis_results
+  },
+  [mutationTypes.STORE_REPORTS] (state, reports) {
+    state.analysis.reports = reports.analysis_report.results
+  }
+}
+
+export default {
+  state,
+  getters,
+  actions,
+  mutations
+}
diff --git a/src/store/modules/analyzers.js b/src/store/modules/analyzers.js
deleted file mode 100644
index 06c340d..0000000
--- a/src/store/modules/analyzers.js
+++ /dev/null
@@ -1,42 +0,0 @@
-import * as actionTypes from '../actionTypes'
-import * as getterNames from '../getterNames'
-import * as mutationTypes from '../mutationsTypes'
-import api from '../../api/analyzers'
-
-const state = {
-  analyzers: []
-}
-
-const getters = {
-  [getterNames.analyzers]: (state) => {
-    return state.analyzers
-  },
-  [getterNames.reports]: (state) => {
-    return []
-  },
-  [getterNames.errorsList]: (state) => {
-    return []
-  }
-}
-
-const actions = {
-  async [actionTypes.FETCH_ANALYZERS] ({commit, getters, state}, currentPackage) {
-    console.log(currentPackage)
-    let { data } = await api.get(currentPackage)
-    console.log(data)
-    commit(mutationTypes.STORE_ANALYZERS, data)
-  }
-}
-
-const mutations = {
-  [mutationTypes.STORE_ANALYZERS] (state, data) {
-    state.analyzers = data
-  }
-}
-
-export default {
-  state,
-  getters,
-  actions,
-  mutations
-}
diff --git a/src/store/mutationsTypes.js b/src/store/mutationsTypes.js
index c34f0c0..d6723d9 100644
--- a/src/store/mutationsTypes.js
+++ b/src/store/mutationsTypes.js
@@ -4,4 +4,9 @@ export const STORE_SELECTED = 'STORE_SELECTED'
 export const FILTER_PACKAGES = 'FILTER_PACKAGES'
 
 // Analyzers
-export const STORE_ANALYZERS = 'STORE_ANALYZERS'
+export const STORE_ANALYSIS = 'STORE_ANALYSIS'
+
+// Analysis
+export const STORE_SELECTED_ANALYSIS = 'STORE_SELECTED_ANALYSIS'
+export const STORE_REPORTS = 'STORE_REPORTS'
+export const STORE_RESULTS = 'STORE_RESULTS'

