From b5e581a7ec4d1c19e713c4c1d0cccda66d1747be Mon Sep 17 00:00:00 2001 From: Pedro Kelvin Date: Mon, 6 Nov 2017 21:39:41 -0200 Subject: [PATCH 01/10] Creating AddRevision component MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Vinícius Cantuária Signed-off-by: MateusO97 --- src/components/Revision/AddRevision.vue | 108 ++++++++++++++++++++++++ src/router/index.js | 6 ++ 2 files changed, 114 insertions(+) create mode 100644 src/components/Revision/AddRevision.vue diff --git a/src/components/Revision/AddRevision.vue b/src/components/Revision/AddRevision.vue new file mode 100644 index 00000000..9bbdbf8b --- /dev/null +++ b/src/components/Revision/AddRevision.vue @@ -0,0 +1,108 @@ + + + + + diff --git a/src/router/index.js b/src/router/index.js index e2e70535..a993e61d 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 AddRevision from '@/components/Revision/AddRevision'; Vue.use(Router); @@ -144,6 +145,11 @@ const router = new Router({ name: 'NotFound', component: NotFound, }, + { + path: '/revision', + name: 'AddRevision', + component: AddRevision, + }, ], }); From 4997a7721290d79c175728198df0aa229c0104fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Cantu=C3=A1ria?= Date: Mon, 6 Nov 2017 21:53:11 -0200 Subject: [PATCH 02/10] Creating ListRevision component Signed-off-by: MateusO97 Signed-off-by: Pedro Kelvin --- src/components/Revision/AddRevision.vue | 16 ++--- src/components/Revision/ListRevision.vue | 79 ++++++++++++++++++++++++ 2 files changed, 87 insertions(+), 8 deletions(-) create mode 100644 src/components/Revision/ListRevision.vue diff --git a/src/components/Revision/AddRevision.vue b/src/components/Revision/AddRevision.vue index 9bbdbf8b..c8121b07 100644 --- a/src/components/Revision/AddRevision.vue +++ b/src/components/Revision/AddRevision.vue @@ -19,8 +19,8 @@ -
-
    -
  • - -
  • -
  • - -
  • -
+
+
  • + + + + + +
  • +
  • + +
  • +
  • + +
  • @@ -37,7 +45,9 @@ import { EventBus } from '../../event-bus.js'; import { HTTP } from '../../http-common.js'; import EditSprint from '@/components/Sprints/EditSprint'; import DeleteSprint from '@/components/Sprints/DeleteSprint'; -import dateConvert from '@/mixins/dateConvert' +import dateConvert from '@/mixins/dateConvert'; +import AddRetrospective from '@/components/Retrospective/AddRetrospective'; +import Retrospective from '@/components/Retrospective/Retrospective'; export default{ name: 'Sprint', @@ -51,16 +61,16 @@ export default{ }; }, - mixins: [ dateConvert ], + mixins: [dateConvert], methods: { getSprint() { - var token = localStorage.getItem('token'); - var tokenSimple = token.replace(/"/, ""); - var tokenSimple2 = tokenSimple.replace(/"/, ""); - var headers = { 'Authorization':tokenSimple2 }; + const token = localStorage.getItem('token'); + const tokenSimple = token.replace(/"/, ''); + const tokenSimple2 = tokenSimple.replace(/"/, ''); + const headers = { Authorization: tokenSimple2 }; - HTTP.get(`sprints/${this.$route.params.id}`, { headers: headers }) + HTTP.get(`sprints/${this.$route.params.id}`, { headers }) .then((response) => { this.sprint = response.data; this.sprint.initial_date = this.dateConvert(this.sprint.initial_date); @@ -70,6 +80,41 @@ export default{ this.errors.push(e); }); }, + + getRetrospective() { + const token = localStorage.getItem('token'); + const tokenSimple = token.replace(/"/, ''); + const tokenSimple2 = tokenSimple.replace(/"/, ''); + const headers = { Authorization: tokenSimple2 }; + + HTTP.get(`sprints/${this.$route.params.id}/retrospectives`, { headers }) + .then((response) => { + this.sprintRetrospective = response.data; + + if (this.sprintRetrospective.length === 0) { + this.setRetrospectiveAsNotCreated(); + } else { + this.setRetrospectiveAsCreated(); + } + }) + .catch((e) => { + this.errors.push(e); + }); + }, + + setRetrospectiveAsCreated() { + localStorage.setItem('isRetrospectiveCreated', 'true'); + }, + + setRetrospectiveAsNotCreated() { + localStorage.setItem('isRetrospectiveCreated', 'false'); + }, + + isRetrospectiveCreated() { + const retrospective = localStorage.getItem('isRetrospectiveCreated'); + + return localStorage.getItem('isRetrospectiveCreated') === 'true'; + }, }, ready() { @@ -79,14 +124,14 @@ export default{ mounted() { const myThis = this; - var token = localStorage.getItem('token'); - var tokenSimple = token.replace(/"/, ""); - var tokenSimple2 = tokenSimple.replace(/"/, ""); - var headers = { 'Authorization': tokenSimple2 }; + const token = localStorage.getItem('token'); + const tokenSimple = token.replace(/"/, ''); + const tokenSimple2 = tokenSimple.replace(/"/, ''); + const headers = { Authorization: tokenSimple2 }; EventBus.$on('edited-sprint', () => { - HTTP.get(`sprints/${this.$route.params.id}`, { headers: headers }) + HTTP.get(`sprints/${this.$route.params.id}`, { headers }) .then((response) => { myThis.project = response.data; }) From 9628c08b443bdf431118f06de517116e6aea82da Mon Sep 17 00:00:00 2001 From: Matheus Roberto Date: Tue, 7 Nov 2017 15:23:23 -0200 Subject: [PATCH 09/10] Fixing delete button in Revision Signed-off-by: Matheus Roberto --- src/components/Revision/Revision.vue | 13 +--- src/components/Sprints/Sprint.vue | 103 ++++++++++++++------------- src/router/index.js | 8 +-- 3 files changed, 58 insertions(+), 66 deletions(-) diff --git a/src/components/Revision/Revision.vue b/src/components/Revision/Revision.vue index 73b853a3..d122b35f 100644 --- a/src/components/Revision/Revision.vue +++ b/src/components/Revision/Revision.vue @@ -8,18 +8,9 @@
    -

    -

      -
    • Sprint Report
    • -
    • - {{ sprintReport }} -
    • -
    -

    -
    -

    +

    • Done Reports
    • @@ -28,7 +19,7 @@

    -

    +

    • Undone Reports
    • diff --git a/src/components/Sprints/Sprint.vue b/src/components/Sprints/Sprint.vue index 5eba210d..e4c0c865 100644 --- a/src/components/Sprints/Sprint.vue +++ b/src/components/Sprints/Sprint.vue @@ -1,7 +1,7 @@