diff --git a/.travis.yml b/.travis.yml index 19e7586..0538d95 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,3 +24,5 @@ deploy: skip_cleanup: true on: branch: development +after_deploy: + - curl -X POST $PINGOUT_URL/$PINGOUT_UUID/ping diff --git a/semantic-release.sh b/semantic-release.sh index 010ae11..164f7f8 100755 --- a/semantic-release.sh +++ b/semantic-release.sh @@ -1,6 +1,6 @@ #!/bin/bash -if [ "${TRAVIS_BRANCH}" == "development" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ]; then +if [ "${TRAVIS_BRANCH}" == "master" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ]; then echo "deploying it" npx semantic-release else diff --git a/src/components/Dashboards/createDashboard.vue b/src/components/Dashboards/createDashboard.vue index 167eca3..2a3d8c3 100644 --- a/src/components/Dashboards/createDashboard.vue +++ b/src/components/Dashboards/createDashboard.vue @@ -57,7 +57,7 @@ export default { components: { "sidebar": SideBar }, - data(){ + data () { return { project: { @@ -89,7 +89,6 @@ export default { beforeMount() { this.loadUserInfo() this.getProjectDetail() - }, methods: { loadUserInfo (){ diff --git a/src/components/Landing/Header.vue b/src/components/Landing/Header.vue index b880268..68fd6f5 100644 --- a/src/components/Landing/Header.vue +++ b/src/components/Landing/Header.vue @@ -1,32 +1,33 @@ - diff --git a/src/components/Projects/ProjectForm.vue b/src/components/Projects/ProjectForm.vue new file mode 100644 index 0000000..f2aff6e --- /dev/null +++ b/src/components/Projects/ProjectForm.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/components/Utils/Footer.vue b/src/components/Utils/Footer.vue index 9647762..80f5e7b 100644 --- a/src/components/Utils/Footer.vue +++ b/src/components/Utils/Footer.vue @@ -1,78 +1,123 @@ diff --git a/src/components/Utils/SideBar.vue b/src/components/Utils/SideBar.vue index 52c558c..9bc9aaf 100644 --- a/src/components/Utils/SideBar.vue +++ b/src/components/Utils/SideBar.vue @@ -6,12 +6,16 @@ {{ (user.username == '') ? 'username' : user.username }} {{ user.username }} - - - Sair +
+ + + + Sair + + +
@@ -34,7 +38,7 @@
    home @@ -55,12 +59,12 @@ Projetos Meus Projetos Novo Projeto diff --git a/src/store/Authentication/auth.js b/src/store/Authentication/auth.js index 1d54e8d..8732725 100644 --- a/src/store/Authentication/auth.js +++ b/src/store/Authentication/auth.js @@ -48,6 +48,7 @@ const actions = { return new Promise((resolve, reject) => { Vue.http.post("rest-auth/login/", user, { headers: { "content-type": "application/json" } }).then(response => { commit(LOGIN, response.data.token) + localStorage.token = response.data.token resolve() }, error => { diff --git a/src/store/Projects/Project.js b/src/store/Projects/Project.js index 99d8de0..61be439 100644 --- a/src/store/Projects/Project.js +++ b/src/store/Projects/Project.js @@ -2,11 +2,13 @@ /* eslint-disable */ import Vue from 'vue' const SET_PROJECTS = 'SET_PROJECTS' +const SET_MYPROJECTS = 'SET_MYPROJECTS' const UPDATE_CURRENT_PROJECT = 'UPDATE_CURRENT_PROJECT' const UPDATE_CURRENT_PROJECT_FIELDS = 'UPDATE_CURRENT_PROJECT_FIELDS' const state = { projects: [], + MyProjects: [], currentProject: null, currentProjectFields: [] } @@ -15,6 +17,9 @@ const getters = { getProjects: state =>{ return state.projects }, + getMyProjects: state =>{ + return state.MyProjects + }, getProjectsLength: state =>{ return state.projects.length }, @@ -31,6 +36,10 @@ const mutations = { // Vue.set(state, projects, payload) - EVENTO PARA GERAR REATIVIDADE MAYBE state.projects = payload }, + [SET_MYPROJECTS](state, payload){ + // Vue.set(state, projects, payload) - EVENTO PARA GERAR REATIVIDADE MAYBE + state.MyProjects = payload + }, [UPDATE_CURRENT_PROJECT](state, payload){ state.currentProject = payload }, @@ -44,6 +53,18 @@ const actions = { return new Promise((resolve, reject)=>{ Vue.http.get("projects/", { headers: { "content-type": "application/json" } }).then(response => { commit(SET_PROJECTS, response.data) + console.log(localStorage.token) + resolve() + }, + error => { + reject() + }) + }) + }, + loadMyProjects ({commit}){ + return new Promise((resolve, reject)=>{ + Vue.http.get("projects/user/", { headers: { "Authorization": "JWT " + localStorage.token, "content-type": "application/json"}}).then(response => { + commit(SET_MYPROJECTS, response.data) resolve() }, error => { @@ -64,7 +85,7 @@ const actions = { }, loadCurrentProjectFields({commit}, dashboardId){ return new Promise((resolve, reject)=>{ - Vue.http.get("metabase/" + dashboardId + "/fields", { headers: { "Authorization": localStorage.token}}).then(response=>{ + Vue.http.get("metabase/" + dashboardId + "/fields", { headers: { "Authorization": "JWT " + localStorage.token, "content-type": "application/json"}}).then(response=>{ commit(UPDATE_CURRENT_PROJECT_FIELDS, response.data.fields) resolve() }, diff --git a/src/store/Tags/Tags.js b/src/store/Tags/Tags.js new file mode 100644 index 0000000..62b3372 --- /dev/null +++ b/src/store/Tags/Tags.js @@ -0,0 +1,47 @@ +// import Project from "./Project.js" dedicir se vai ser usado +/* eslint-disable */ +import Vue from 'vue' +const SET_TAGS = 'SET_TAGS' + +const state = { + tags: [] +} + +const getters = { + getTags: state =>{ + return state.tags + }, + getTagsLength: state =>{ + return state.tags.length + } +} + +const mutations = { + [SET_TAGS](state, payload){ + // Vue.set(state, projects, payload) - EVENTO PARA GERAR REATIVIDADE MAYBE + state.tags = payload + } +} + +const actions = { + loadTags ({commit}){ + return new Promise((resolve, reject)=>{ + Vue.http.get("tags/", { headers: { "Content-type": "application/json" } }).then(response => { + commit(SET_TAGS, response.data) + resolve() + }, + error => { + reject() + }) + }) + } +} + +export default { + name: 'Tags', + state, + mutations, + getters, + actions +} + diff --git a/src/store/index.js b/src/store/index.js index a41e126..c49d708 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -5,6 +5,7 @@ import Vuex from 'vuex' import auth from './Authentication/auth' import projects from './Projects/Project' import dashboards from './Dashboards/Dashboards' +import tags from './Tags/Tags' Vue.use(Vuex) @@ -12,6 +13,7 @@ export default new Vuex.Store({ modules: { auth, projects, - dashboards + dashboards, + tags } }) diff --git a/test/unit/specs/CardsContent.spec.js b/test/unit/specs/CardsContent.spec.js deleted file mode 100644 index 5fc561a..0000000 --- a/test/unit/specs/CardsContent.spec.js +++ /dev/null @@ -1,10 +0,0 @@ -import { shallow } from "@vue/test-utils" -import CardsContent from "@/components/Utils/CardsContent" - -describe("CardsContent.vue", () => { - it("should render correct contents", () => { - const wrapper = shallow(CardsContent) - - expect(wrapper.find("#stats")).toBeTruthy() - }) -}) diff --git a/test/unit/specs/Footer.spec.js b/test/unit/specs/Footer.spec.js deleted file mode 100644 index c895d65..0000000 --- a/test/unit/specs/Footer.spec.js +++ /dev/null @@ -1,12 +0,0 @@ -import { shallow } from "@vue/test-utils" -import Footer from "@/components/Utils/Footer" - -describe("Footer.vue", () => { - it("should be a vue instance", () => { - const wrapper = shallow(Footer) - - expect(wrapper.isVueInstance()).toBeTruthy() - }) - - // TODO: test all links after refactoration -}) diff --git a/test/unit/specs/LandingPage.spec.js b/test/unit/specs/LandingPage.spec.js deleted file mode 100644 index 5901203..0000000 --- a/test/unit/specs/LandingPage.spec.js +++ /dev/null @@ -1,12 +0,0 @@ -import { shallow } from "@vue/test-utils" -import LandingPage from "@/components/Landing/LandingPage" - -describe("LandingPage.vue", () => { - it("should be a vue instance", () => { - const wrapper = shallow(LandingPage) - - expect(wrapper.isVueInstance()).toBeTruthy() - }) - - // TODO: test all links after refactoration -})