From c09f3e26f45afe2d04d721716fd9e2e1f6eef134 Mon Sep 17 00:00:00 2001 From: Adrianne Alves Date: Mon, 30 Oct 2017 23:11:14 -0300 Subject: [PATCH 1/9] Creating GPA component Signed-off-by: matheussbernardo Signed-off-by: alaxalves Signed-off-by: pedrokelvin --- src/components/Gpa.vue | 86 +++++++++++++++++++++++++++++ src/components/Projects/Project.vue | 18 +++++- src/router/index.js | 8 ++- 3 files changed, 108 insertions(+), 4 deletions(-) create mode 100644 src/components/Gpa.vue diff --git a/src/components/Gpa.vue b/src/components/Gpa.vue new file mode 100644 index 00000000..7b522f10 --- /dev/null +++ b/src/components/Gpa.vue @@ -0,0 +1,86 @@ + + + + +> \ No newline at end of file diff --git a/src/components/Projects/Project.vue b/src/components/Projects/Project.vue index c569d0ac..cf58f318 100644 --- a/src/components/Projects/Project.vue +++ b/src/components/Projects/Project.vue @@ -18,7 +18,17 @@
- + +
+
+ + + +
+
+ @@ -32,12 +42,14 @@ import DeleteProject from '@/components/Projects/DeleteProject'; import EditProject from '@/components/Projects/EditProject'; import { HTTP } from '../../http-common.js'; +import Gpa from '@/components/Gpa' export default{ name: 'Project', components: { - 'delete-project': DeleteProject, - 'edit-project': EditProject, + DelProject: DeleteProject, + EditProject, + Gpa, }, data() { return { diff --git a/src/router/index.js b/src/router/index.js index e2e70535..eb657071 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -22,6 +22,7 @@ import UserProfile from '@/components/Users/UserProfile'; import EditUserProfile from '@/components/Users/EditUserProfile'; import DeleteUserProfile from '@/components/Users/DeleteUserProfile'; import NotFound from '@/components/NotFound'; +import Gpa from '@/components/Gpa'; Vue.use(Router); @@ -144,7 +145,12 @@ const router = new Router({ name: 'NotFound', component: NotFound, }, - ], + { + path: '/gpa', + name: 'Gpa', + component: Gpa, + }, + ] }); export default router; From cb75287797ecadc06d7d6b832808c2a4f90c9fcd Mon Sep 17 00:00:00 2001 From: Adrianne Alves Date: Fri, 3 Nov 2017 09:08:26 -0300 Subject: [PATCH 2/9] Adding get Gpa method Signed-off-by: pedrokelvin --- src/components/Gpa.vue | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/components/Gpa.vue b/src/components/Gpa.vue index 7b522f10..a366d1ad 100644 --- a/src/components/Gpa.vue +++ b/src/components/Gpa.vue @@ -30,19 +30,22 @@ export default { } }, methods: { - getGpa() { - var token = localStorage.getItem('token'); - var tokenSimple = token.replace(/"/, ""); - var tokenSimple2 = tokenSimple.replace(/"/, ""); - var header = { 'Authorization': tokenSimple2 }; + async getGpa() { + var token = localStorage.getItem('token'); + var tokenSimple = token.replace(/"/, ""); + var tokenSimple2 = tokenSimple.replace(/"/, ""); + var headers = { 'Authorization':tokenSimple2 }; - HTTP.get(`projects/${this.projectId}/gpa`, { headers: header }) - .then((response) => { - this.gpa = response.data; - }) - .catch((e) => { - this.errors.push(e); - }); + try { + let response = await HTTP.get(`projects/${ this.$route.params.id }`, { headers:headers }); + let id = response.data.id; + console.log(id); + const result2 = await HTTP.get(`projects/${id}/gpa`, { headers: headers }); + console.log(result2); + this.gpa = result2.data; + } catch(err) { + console.log(err) + } } }, mounted() { From bb67c40d307622426d85bb15704e4099c5cfed37 Mon Sep 17 00:00:00 2001 From: Adrianne Alves Date: Mon, 30 Oct 2017 23:11:14 -0300 Subject: [PATCH 3/9] Creating GPA component Signed-off-by: matheussbernardo Signed-off-by: alaxalves Signed-off-by: pedrokelvin --- src/components/Projects/Project.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/Projects/Project.vue b/src/components/Projects/Project.vue index cf58f318..773e66d9 100644 --- a/src/components/Projects/Project.vue +++ b/src/components/Projects/Project.vue @@ -18,7 +18,7 @@
- +
@@ -39,17 +39,17 @@ From 6ec3713ced78a80ae5a43337d89750c8619d5d57 Mon Sep 17 00:00:00 2001 From: Pedro Kelvin Date: Mon, 6 Nov 2017 15:50:45 -0200 Subject: [PATCH 6/9] Fixing codeclimate issue Signed-off-by: Pedro Kelvin --- package-lock.json | 2 +- src/router/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index ae623870..d767085f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5060,7 +5060,7 @@ "karma-sinon-chai": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/karma-sinon-chai/-/karma-sinon-chai-1.3.2.tgz", - "integrity": "sha1-6k2XsWQz5kgTqt3d3tf3u0M4IV4=", + "integrity": "sha512-JbV4xobGA4srGuR30YQszmgzv4YpKHpkQWSEBCBBj7OrCMSW4/9GIwtGLHMk/3sT94/b5zveVMR2CV5V2Y3dOg==", "dev": true, "requires": { "lolex": "1.6.0" diff --git a/src/router/index.js b/src/router/index.js index eb657071..171f9bd2 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -150,7 +150,7 @@ const router = new Router({ name: 'Gpa', component: Gpa, }, - ] + ], }); export default router; From a6e0bf29be704f78e72233549153f2af247b626f Mon Sep 17 00:00:00 2001 From: Pedro Kelvin Date: Wed, 8 Nov 2017 19:08:13 -0200 Subject: [PATCH 7/9] Changing Gpa component position and adding colors to the values. Signed-off-by: Adrianne Alves Signed-off-by: Matheus Roberto --- src/components/Gpa.vue | 51 ++++++++++++++++++++--------- src/components/Projects/Project.vue | 13 +++++--- 2 files changed, 44 insertions(+), 20 deletions(-) diff --git a/src/components/Gpa.vue b/src/components/Gpa.vue index a366d1ad..89d8a6ba 100644 --- a/src/components/Gpa.vue +++ b/src/components/Gpa.vue @@ -1,11 +1,17 @@ > \ No newline at end of file +> diff --git a/src/components/Projects/Project.vue b/src/components/Projects/Project.vue index 773e66d9..0d5b0ac7 100644 --- a/src/components/Projects/Project.vue +++ b/src/components/Projects/Project.vue @@ -3,8 +3,15 @@
-
-

{{project.name}}

+
+
+
+ +
+
+

{{project.name}}

+
+

{{project.description}}

@@ -18,7 +25,6 @@
-
@@ -95,5 +101,4 @@ export default{ #buttons { margin-top: 1em; } - From 47567d2d37a4dfad81e1ac7013c02cb3f2591d1c Mon Sep 17 00:00:00 2001 From: Pedro Kelvin Date: Fri, 10 Nov 2017 11:18:12 -0200 Subject: [PATCH 8/9] Fixing route inproject to project Signed-off-by: Adrianne Alves --- package-lock.json | 18 +++++++++--------- src/components/Projects/Project.vue | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index 821fca2e..d767085f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -568,7 +568,7 @@ "babel-loader": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-7.1.2.tgz", - "integrity": "sha512-jRwlFbINAeyDStqK6Dd5YuY0k5YuzQUvlz2ZamuXrXmxav3pNqe9vfJ402+2G+OmlJSXxCOpB6Uz0INM7RQe2A==", + "integrity": "sha1-9svhInEPGqKvTYgcbVtUNYyiQSY=", "dev": true, "requires": { "find-cache-dir": "1.0.0", @@ -2102,7 +2102,7 @@ "css-loader": { "version": "0.28.7", "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-0.28.7.tgz", - "integrity": "sha512-GxMpax8a/VgcfRrVy0gXD6yLd5ePYbXX/5zGgTVYp4wXtJklS8Z2VaUArJgc//f6/Dzil7BaJObdSv8eKKCPgg==", + "integrity": "sha1-Xy7pid0y7dkHcX+VMxdlYWCZnBs=", "dev": true, "requires": { "babel-code-frame": "6.26.0", @@ -3533,7 +3533,7 @@ "file-loader": { "version": "0.11.2", "resolved": "https://registry.npmjs.org/file-loader/-/file-loader-0.11.2.tgz", - "integrity": "sha512-N+uhF3mswIFeziHQjGScJ/yHXYt3DiLBeC+9vWW+WjUBiClMSOlV1YrXQi+7KM2aA3Rn4Bybgv+uXFQbfkzpvg==", + "integrity": "sha1-T/HfKK84cZpgmAk7iMgscdF5SjQ=", "dev": true, "requires": { "loader-utils": "1.1.0" @@ -4414,7 +4414,7 @@ "inject-loader": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/inject-loader/-/inject-loader-3.0.1.tgz", - "integrity": "sha512-0Kd4NqMJUhknG4ECiJ/mgyHJBpfBBWZ3IKHl2BLNQiFtMO7/xiv9mmHl7mGvE0iKrBeQAZdMcQP3sMXZN0cqeg==", + "integrity": "sha1-hEpFlhUM9rhkwveYBtQKLK7kwsc=", "dev": true, "requires": { "babel-core": "6.26.0" @@ -4951,7 +4951,7 @@ "karma": { "version": "1.7.1", "resolved": "https://registry.npmjs.org/karma/-/karma-1.7.1.tgz", - "integrity": "sha512-k5pBjHDhmkdaUccnC7gE3mBzZjcxyxYsYVaqiL2G5AqlfLyBO5nw2VdNK+O16cveEPd/gIOWULH7gkiYYwVNHg==", + "integrity": "sha1-hcwI6eCiLXzpzKN8ShvoJPaisa4=", "dev": true, "requires": { "bluebird": "3.5.0", @@ -6172,7 +6172,7 @@ "opn": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/opn/-/opn-5.1.0.tgz", - "integrity": "sha512-iPNl7SyM8L30Rm1sjGdLLheyHVw5YXVfi3SKWJzBI7efxRwHojfRFjwE/OLM6qp9xJYMgab8WicTU1cPoY+Hpg==", + "integrity": "sha1-cs4jBqF9vqWP8QQYUzUrSo/HdRk=", "dev": true, "requires": { "is-wsl": "1.1.0" @@ -9171,7 +9171,7 @@ "semver": { "version": "5.4.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", - "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==", + "integrity": "sha1-4FnAnYVx8FQII3M0M1BdOi8AsY4=", "dev": true }, "send": { @@ -10046,7 +10046,7 @@ "url-loader": { "version": "0.5.9", "resolved": "https://registry.npmjs.org/url-loader/-/url-loader-0.5.9.tgz", - "integrity": "sha512-B7QYFyvv+fOBqBVeefsxv6koWWtjmHaMFT6KZWti4KRw8YUD/hOU+3AECvXuzyVawIBx3z7zQRejXCDSO5kk1Q==", + "integrity": "sha1-zI/qgse5Bud3cBklCGnlaemVwpU=", "dev": true, "requires": { "loader-utils": "1.1.0", @@ -10258,7 +10258,7 @@ "webpack": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/webpack/-/webpack-2.7.0.tgz", - "integrity": "sha512-MjAA0ZqO1ba7ZQJRnoCdbM56mmFpipOPUv/vQpwwfSI42p5PVDdoiuK2AL2FwFUVgT859Jr43bFZXRg/LNsqvg==", + "integrity": "sha1-sqEiaAQ3P/09A+qca9UlBnA09rE=", "dev": true, "requires": { "acorn": "5.1.2", diff --git a/src/components/Projects/Project.vue b/src/components/Projects/Project.vue index 0d5b0ac7..454f23e0 100644 --- a/src/components/Projects/Project.vue +++ b/src/components/Projects/Project.vue @@ -27,14 +27,14 @@
- +
- + From 9a51b302ac6a456004d765523d9d6b71c530a673 Mon Sep 17 00:00:00 2001 From: Pedro Kelvin Date: Fri, 10 Nov 2017 11:49:57 -0200 Subject: [PATCH 9/9] Fixing CSS classes names --- src/components/Gpa.vue | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/Gpa.vue b/src/components/Gpa.vue index 89d8a6ba..916a4158 100644 --- a/src/components/Gpa.vue +++ b/src/components/Gpa.vue @@ -5,13 +5,13 @@

-
+
{{gpa}}
-
+
{{gpa}}
-
+
{{gpa}}

GPA

@@ -84,20 +84,20 @@ export default { left: 50%; } -.GpaFont { +.gpa-font { font-weight:bolder; font-size:1.2em; } -.Vred{ +.v-red{ color: red; } -.Vyellow{ +.v-yellow{ color: yellow; } -.Vgreen{ +.v-green{ color: green; }