Skip to content

Commit d34df98

Browse files
committed
finish dashboard
1 parent 1bfe2e0 commit d34df98

40 files changed

+1629
-22
lines changed

backend/vuejs_brasil_feedbacker.json

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"info": {
3-
"_postman_id": "bd1ee685-5d10-4e07-941a-39d1954ba426",
3+
"_postman_id": "03caccb8-c176-4e3f-ae31-751901560b3c",
44
"name": "Vue.js Brasil - Feedbacker",
55
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
66
},
@@ -93,7 +93,7 @@
9393
}
9494
},
9595
"url": {
96-
"raw": "http://localhost:3000/auth/login?",
96+
"raw": "http://localhost:3000/auth/login",
9797
"protocol": "http",
9898
"host": [
9999
"localhost"
@@ -102,25 +102,15 @@
102102
"path": [
103103
"auth",
104104
"login"
105-
],
106-
"query": [
107-
{
108-
"key": "Authorization",
109-
"value": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImVhYjc1OWY4LWYyMzgtNGZmOS1hZTkxLWVlMTU1ODk4MjMyOSIsImVtYWlsIjoiaWd1aW5AaWd1aW4ubWUiLCJuYW1lIjoiSWdvciBIYWxmZWxkIiwiaWF0IjoxNjA4NTA2ODAwfQ.AXBHWYY1hioeBXQfhxpI9uBGDH3shKqGgWE2JuTOsh4",
110-
"disabled": true
111-
}
112105
]
113106
}
114107
},
115108
"response": []
116109
},
117110
{
118111
"name": "Criar um novo usuário",
119-
"protocolProfileBehavior": {
120-
"disableBodyPruning": true
121-
},
122112
"request": {
123-
"method": "GET",
113+
"method": "POST",
124114
"header": [
125115
{
126116
"key": "Authorization",
@@ -130,23 +120,23 @@
130120
],
131121
"body": {
132122
"mode": "raw",
133-
"raw": "{\n \"email\": \"[email protected]\",\n \"password\": \"1234\"\n}",
123+
"raw": "{\n\t\"name\": \"Evan You\",\n \"email\": \"[email protected]\",\n \"password\": \"1234\"\n}",
134124
"options": {
135125
"raw": {
136126
"language": "json"
137127
}
138128
}
139129
},
140130
"url": {
141-
"raw": "http://localhost:3000/users/me",
131+
"raw": "http://localhost:3000/auth/register",
142132
"protocol": "http",
143133
"host": [
144134
"localhost"
145135
],
146136
"port": "3000",
147137
"path": [
148-
"users",
149-
"me"
138+
"auth",
139+
"register"
150140
]
151141
}
152142
},

dashboard/package-lock.json

Lines changed: 24 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dashboard/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,15 @@
1313
"@tailwindcss/postcss7-compat": "^2.0.2",
1414
"animate.css": "^4.1.1",
1515
"autoprefixer": "^9.8.6",
16+
"axios": "^0.21.1",
1617
"core-js": "^3.6.5",
1718
"postcss": "^7.0.35",
1819
"tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.0.2",
20+
"tiny-emitter": "^2.1.0",
21+
"vee-validate": "^4.1.9",
1922
"vue": "^3.0.0",
20-
"vue-router": "^4.0.0-0"
23+
"vue-router": "^4.0.0-0",
24+
"vue-toastification": "^2.0.0-beta.9"
2125
},
2226
"devDependencies": {
2327
"@vue/cli-plugin-babel": "~4.5.0",

dashboard/public/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<meta http-equiv="X-UA-Compatible" content="IE=edge">
66
<meta name="viewport" content="width=device-width,initial-scale=1.0">
77
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
8-
<title><%= htmlWebpackPlugin.options.title %></title>
8+
<title>Feedbacker</title>
99
</head>
1010
<body>
1111
<noscript>

dashboard/src/App.vue

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,33 @@
11
<template>
2+
<modal-factory />
23
<router-view />
34
</template>
5+
6+
<script>
7+
import { watch } from 'vue'
8+
import ModalFactory from './components/ModalFactory'
9+
import { useRouter, useRoute } from 'vue-router'
10+
import services from './services'
11+
import { setCurrentUser } from './store/user'
12+
13+
export default {
14+
components: { ModalFactory },
15+
setup () {
16+
const router = useRouter()
17+
const route = useRoute()
18+
19+
watch(() => route.path, async () => {
20+
if (route.meta.hasAuth) {
21+
const token = window.localStorage.getItem('token')
22+
if (!token) {
23+
router.push({ name: 'Home' })
24+
return
25+
}
26+
27+
const { data } = await services.users.getMe()
28+
setCurrentUser(data)
29+
}
30+
})
31+
}
32+
}
33+
</script>
Lines changed: 3 additions & 0 deletions
Loading

dashboard/src/assets/icons/copy.svg

Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<template>
2+
<div
3+
:style="{
4+
width: computedWidth,
5+
height
6+
}"
7+
class="opacity-75 content-loader"
8+
>
9+
<span :style="{ animationDuration }" class="content-loader--fx"/>
10+
<slot />
11+
</div>
12+
</template>
13+
14+
<script>
15+
import { computed } from 'vue'
16+
17+
export default {
18+
props: {
19+
maxWidth: {
20+
default: 100,
21+
type: Number
22+
},
23+
minWidth: {
24+
default: 80,
25+
type: Number
26+
},
27+
animationDuration: {
28+
type: String,
29+
default: '1.6s'
30+
},
31+
height: {
32+
default: '1rem',
33+
type: String
34+
},
35+
width: {
36+
default: '1rem',
37+
type: String
38+
}
39+
},
40+
setup (props) {
41+
const computedWidth = computed(() => {
42+
const value = Math.random() * (props.width - props.minWidth)
43+
return props.width ?? `${Math.floor(value + props.minWidth)}%`
44+
})
45+
46+
return { computedWidth }
47+
}
48+
}
49+
</script>
50+
51+
<style lang="postcss" scoped>
52+
@keyframes shimmer {
53+
100% {
54+
transform: translateX(100%);
55+
}
56+
}
57+
58+
.content-loader {
59+
position: relative;
60+
vertical-align: middle;
61+
overflow: hidden;
62+
background: #f6f7f8;
63+
}
64+
.content-loader--fx {
65+
position: absolute;
66+
top: 0;
67+
right: 0;
68+
bottom: 0;
69+
left: 0;
70+
transform: translateX(-100%);
71+
background-image: linear-gradient(to right, #eeeeee 8%, #dddddd 18%, #eeeeee 33%);
72+
background-position: 0 0;
73+
background-size: 1000 100;
74+
animation: shimmer infinite alternate ease-in-out;
75+
}
76+
</style>
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<template>
2+
<span
3+
:class="`bg-${classColor}`"
4+
class="p-2 text-xs font-black text-white uppercase rounded-full">
5+
{{ label }}
6+
</span>
7+
</template>
8+
9+
<script>
10+
import { computed } from 'vue'
11+
export default {
12+
props: {
13+
type: { type: String, required: true }
14+
},
15+
setup (props) {
16+
const label = computed(() => {
17+
if (props.type === 'ISSUE') {
18+
return 'problema'
19+
}
20+
21+
if (props.type === 'IDEA') {
22+
return 'ideia'
23+
}
24+
25+
return 'outros'
26+
})
27+
28+
const classColor = computed(() => {
29+
if (props.type === 'ISSUE') {
30+
return 'brand-danger'
31+
}
32+
33+
if (props.type === 'IDEA') {
34+
return 'brand-warning'
35+
}
36+
37+
return 'brand-graydark'
38+
})
39+
40+
return {
41+
label,
42+
classColor
43+
}
44+
}
45+
}
46+
</script>

0 commit comments

Comments
 (0)