Browse Source

Muchas Cosas

pull/1/head
void 3 months ago
parent
commit
eef25363b0

+ 5
- 0
.prettierrc.json View File

@@ -0,0 +1,5 @@
1
+{
2
+  "semi": false,
3
+  "singleQuote": true,
4
+  "trailingComma": "all"
5
+}

+ 1
- 0
package.json View File

@@ -32,6 +32,7 @@
32 32
     "brotli-webpack-plugin": "^1.1.0",
33 33
     "compression-webpack-plugin": "^2.0.0",
34 34
     "glob-all": "^3.1.0",
35
+    "prettier": "1.17.1",
35 36
     "purgecss-webpack-plugin": "^1.5.0",
36 37
     "sass": "^1.18.0",
37 38
     "sass-loader": "^7.1.0",

+ 9
- 0
pnpm-lock.yaml View File

@@ -22,6 +22,7 @@ devDependencies:
22 22
   brotli-webpack-plugin: 1.1.0
23 23
   compression-webpack-plugin: 2.0.0
24 24
   glob-all: 3.1.0
25
+  prettier: 1.17.1
25 26
   purgecss-webpack-plugin: 1.5.0
26 27
   sass: 1.20.1
27 28
   sass-loader: 7.1.0
@@ -6068,6 +6069,13 @@ packages:
6068 6069
     hasBin: true
6069 6070
     resolution:
6070 6071
       integrity: sha512-kn/GU6SMRYPxUakNXhpP0EedT/KmaPzr0H5lIsDogrykbaxOpOfAFfk5XA7DZrJyMAv1wlMV3CPcZruGXVVUZw==
6072
+  /prettier/1.17.1:
6073
+    dev: true
6074
+    engines:
6075
+      node: '>=4'
6076
+    hasBin: true
6077
+    resolution:
6078
+      integrity: sha512-TzGRNvuUSmPgwivDqkZ9tM/qTGW9hqDKWOE9YHiyQdixlKbv7kvEqsmDPrcHJTKwthU774TQwZXVtaQ/mMsvjg==
6071 6079
   /pretty-error/2.1.1:
6072 6080
     dependencies:
6073 6081
       renderkid: 2.0.3
@@ -8124,6 +8132,7 @@ specifiers:
8124 8132
   glob-all: ^3.1.0
8125 8133
   graphql: ^14.2.1
8126 8134
   graphql-tag: ^2.10.1
8135
+  prettier: 1.17.1
8127 8136
   purgecss-webpack-plugin: ^1.5.0
8128 8137
   qrcode: ^1.3.3
8129 8138
   qrcode.vue: ^1.6.1

+ 29
- 16
src/App.vue View File

@@ -1,13 +1,17 @@
1 1
 <template>
2 2
   <div id="app">
3
-    <nav class="navbar has-text-centered" role="navigation" aria-label="main navigation">
3
+    <nav
4
+      class="navbar has-text-centered"
5
+      role="navigation"
6
+      aria-label="main navigation"
7
+    >
4 8
       <div class="nav">
5 9
         <BackIcon
6 10
           @click="$route.meta.backCb($router, $route)"
7 11
           class="back"
8 12
           v-if="$route.meta.backCb"
9 13
           role="button"
10
-          />
14
+        />
11 15
         <div class="navbar-brand">
12 16
           <router-link to="/" class="navbar-item">
13 17
             {{ $t('app.name') }}
@@ -35,7 +39,7 @@ export default {
35 39
 .back {
36 40
   float: left;
37 41
   height: 3em;
38
-  padding: .5em;
42
+  padding: 0.5em;
39 43
   cursor: pointer;
40 44
 }
41 45
 
@@ -53,12 +57,11 @@ nav {
53 57
   }
54 58
   border-bottom: 1px solid #ccc;
55 59
 }
56
-
57 60
 </style>
58 61
 
59 62
 <style lang="scss">
60
-@import "~bulma/css/bulma.min.css";
61
-@import "~vue-snotify/styles/dark";
63
+@import '~bulma/css/bulma.min.css';
64
+@import '~vue-snotify/styles/dark';
62 65
 
63 66
 :root {
64 67
   box-sizing: border-box;
@@ -67,7 +70,11 @@ nav {
67 70
   word-wrap: break-word;
68 71
 }
69 72
 
70
-*, *:before, *:after { box-sizing: inherit; }
73
+*,
74
+*:before,
75
+*:after {
76
+  box-sizing: inherit;
77
+}
71 78
 
72 79
 .text-view {
73 80
   margin: 0 1em;
@@ -78,13 +85,13 @@ nav {
78 85
   @media only screen and (max-width: 600px) {
79 86
     margin: auto;
80 87
   }
81
-  margin: .5em auto;
88
+  margin: 0.5em auto;
82 89
   //background: white;
83 90
   height: 100%;
84 91
 }
85 92
 
86 93
 .tech-info {
87
-  color: #BBB;
94
+  color: #bbb;
88 95
 }
89 96
 
90 97
 svg {
@@ -99,18 +106,18 @@ svg {
99 106
     height: 100%;
100 107
   }
101 108
   &.text {
102
-    margin-right: .4em;
109
+    margin-right: 0.4em;
103 110
   }
104 111
 }
105 112
 
106 113
 button .icon {
107 114
   &:first-child {
108
-    margin-left: -.2rem !important;
109
-    margin-right: .4em !important;
115
+    margin-left: -0.2rem !important;
116
+    margin-right: 0.4em !important;
110 117
   }
111 118
   &:last-child {
112
-    margin-right: -.2rem !important;
113
-    margin-left: .3em !important;
119
+    margin-right: -0.2rem !important;
120
+    margin-left: 0.3em !important;
114 121
   }
115 122
   width: 1.2em !important;
116 123
   height: 1.2em !important;
@@ -120,6 +127,12 @@ button .icon {
120 127
   margin: 0 auto;
121 128
 }
122 129
 
123
-.spin { animation: spin .5s linear infinite; }
124
-@keyframes spin { 100% { transform: rotate(360deg); } }
130
+.spin {
131
+  animation: spin 0.5s linear infinite;
132
+}
133
+@keyframes spin {
134
+  100% {
135
+    transform: rotate(360deg);
136
+  }
137
+}
125 138
 </style>

+ 5
- 1
src/components/Button.vue View File

@@ -1,5 +1,9 @@
1 1
 <template>
2
-  <button class="button" @click="$emit('click')" :class="{ 'is-loading': loading }">
2
+  <button
3
+    class="button"
4
+    @click="$emit('click')"
5
+    :class="{ 'is-loading': loading }"
6
+  >
3 7
     <slot></slot>
4 8
   </button>
5 9
 </template>

+ 52
- 49
src/components/EditarTareaModal.vue View File

@@ -6,22 +6,24 @@
6 6
         {{ error }}
7 7
       </p>
8 8
       <p v-if="changed" class="notification is-warning">
9
-        Esta tarea fue editada después de que empezaste a editarla.
10
-        Guardar los cambios van a sobreescribir los anteriores.
9
+        Esta tarea fue editada después de que empezaste a editarla. Guardar los
10
+        cambios van a sobreescribir los anteriores.
11 11
       </p>
12 12
       <div class="field">
13 13
         <label class="label">Descripción</label>
14 14
         <div class="control">
15
-          <textarea class="textarea"
16
-            v-model="text" name="text"
17
-            placeholder="Ejemplo: Matemática: prueba. Temas: ..."></textarea>
15
+          <textarea
16
+            class="textarea"
17
+            v-model="text"
18
+            name="text"
19
+            placeholder="Ejemplo: Matemática: prueba. Temas: ..."
20
+          ></textarea>
18 21
         </div>
19 22
       </div>
20 23
       <div class="field">
21 24
         <label class="label">Dia de entrega</label>
22 25
         <div class="control">
23
-          <input type="date" name="deadline" v-model="deadline"
24
-            :min="today">
26
+          <input type="date" name="deadline" v-model="deadline" :min="today" />
25 27
         </div>
26 28
       </div>
27 29
       <div class="field is-grouped">
@@ -53,11 +55,13 @@ export default {
53 55
   name: 'EditarTareaModal',
54 56
   props: ['homework', 'groupId'],
55 57
   components: { Modal, CustomButton },
56
-  data () {
58
+  data() {
57 59
     return {
58 60
       text: this.homework.text,
59 61
       deadline: this.homework.deadlineUnix
60
-        ? new Date(parseInt(this.homework.deadlineUnix)).toISOString().split('T')[0]
62
+        ? new Date(parseInt(this.homework.deadlineUnix))
63
+            .toISOString()
64
+            .split('T')[0]
61 65
         : null,
62 66
       changed: false,
63 67
       error: null,
@@ -68,67 +72,66 @@ export default {
68 72
     today: () => new Date().toISOString().split('T')[0],
69 73
   },
70 74
   methods: {
71
-    getAuth () {
75
+    getAuth() {
72 76
       return JSON.parse(localStorage.groups || '[]').find(
73
-        group => group.id == this.groupId
77
+        group => group.id == this.groupId,
74 78
       )
75 79
     },
76
-    editHomework () {
80
+    editHomework() {
77 81
       const homeworkInfo = {
78 82
         text: this.text,
79
-        deadlineUnix: this.deadline && `${+(new Date(this.deadline))}`,
83
+        deadlineUnix: this.deadline && `${+new Date(this.deadline)}`,
80 84
       }
81 85
 
82 86
       this.loading = true
83
-      this.$apollo.mutate({
84
-        mutation: gql`
85
-        mutation editHomework (
86
-          $groupAuth: GroupAuth!,
87
-          $info: HomeworkInput!,
88
-          $id: ID!,
89
-        ) {
90
-          editHomework (groupAuth: $groupAuth, info: $info, id: $id) {
91
-            ...HomeworkFragment
92
-          }
93
-        }
94
-        ${HomeworkFragment}
95
-        `,
96
-        variables: {
97
-          info: homeworkInfo,
98
-          groupAuth: this.getAuth(),
99
-          id: this.homework.id,
100
-        },
101
-        update: (store, { data: { editHomework } }) => {
102
-          const variables = { groupAuth: this.getAuth() }
103
-          const data = store.readQuery({ query: groupQuery, variables })
104
-          data.group.homeworks = data.group.homeworks.map(
105
-            homework => homework.id == editHomework.id
106
-              ? editHomework : homework
107
-          )
108
-          store.writeQuery({
109
-            query: groupQuery,
110
-            variables,
111
-            data,
112
-          })
113
-        },
114
-      })
87
+      this.$apollo
88
+        .mutate({
89
+          mutation: gql`
90
+            mutation editHomework(
91
+              $groupAuth: GroupAuth!
92
+              $info: HomeworkInput!
93
+              $id: ID!
94
+            ) {
95
+              editHomework(groupAuth: $groupAuth, info: $info, id: $id) {
96
+                ...HomeworkFragment
97
+              }
98
+            }
99
+            ${HomeworkFragment}
100
+          `,
101
+          variables: {
102
+            info: homeworkInfo,
103
+            groupAuth: this.getAuth(),
104
+            id: this.homework.id,
105
+          },
106
+          update: (store, { data: { editHomework } }) => {
107
+            const variables = { groupAuth: this.getAuth() }
108
+            const data = store.readQuery({ query: groupQuery, variables })
109
+            data.group.homeworks = data.group.homeworks.map(homework =>
110
+              homework.id == editHomework.id ? editHomework : homework,
111
+            )
112
+            store.writeQuery({
113
+              query: groupQuery,
114
+              variables,
115
+              data,
116
+            })
117
+          },
118
+        })
115 119
         .then(({ data: { editHomework: homework } }) => {
116 120
           this.$router.push(`#homework-${homework.id}`)
117 121
           this.$emit('close')
118 122
         })
119
-        .catch(error => this.error = error)
123
+        .catch(error => (this.error = error))
120 124
         .finally(() => {
121 125
           this.loading = false
122 126
         })
123 127
     },
124 128
   },
125 129
   watch: {
126
-    homework () {
130
+    homework() {
127 131
       this.changed = true
128 132
     },
129 133
   },
130 134
 }
131 135
 </script>
132 136
 
133
-<style scoped>
134
-</style>
137
+<style scoped></style>

+ 58
- 33
src/components/Grupo.vue View File

@@ -1,8 +1,9 @@
1 1
 <template>
2 2
   <div
3
-    class="card grupo" :id="id"
3
+    class="card grupo"
4
+    :id="id"
4 5
     :class="{ target: $route.hash === '#' + id }"
5
-    >
6
+  >
6 7
     <div class="card-content" v-if="error">
7 8
       <p v-if="error.graphQLErrors">
8 9
         {{ $t('components.group.graphqlError') }}
@@ -21,10 +22,15 @@
21 22
           <span
22 23
             class="icon"
23 24
             :class="{ spin: $apollo.loading }"
24
-            @click="$apollo.queries.group.refetch()">
25
+            @click="$apollo.queries.group.refetch()"
26
+          >
25 27
             <RefreshIcon />
26 28
           </span>
27
-          <router-link tag="span" class="icon" :to="`/grupos/${group.id}/crearTarea`">
29
+          <router-link
30
+            tag="span"
31
+            class="icon"
32
+            :to="`/grupos/${group.id}/crearTarea`"
33
+          >
28 34
             <PlusIcon />
29 35
           </router-link>
30 36
           <span class="icon" @click="modal = true">
@@ -35,14 +41,15 @@
35 41
       <div class="card-content">
36 42
         <Tarea
37 43
           v-for="homework in currentHomeworks"
38
-          :key="homework.id" :homework="homework"
44
+          :key="homework.id"
45
+          :homework="homework"
39 46
           :groupId="group.id"
40
-          />
47
+        />
41 48
         <i18n
42 49
           path="components.group.noHomeworks"
43 50
           tag="p"
44 51
           v-if="currentHomeworks.length < 1"
45
-          >
52
+        >
46 53
           <router-link :to="`/grupos/${group.id}/crearTarea`">
47 54
             {{ $t('components.group.createHomeworkQuestion') }}
48 55
           </router-link>
@@ -60,7 +67,9 @@
60 67
             <li>
61 68
               <router-link :to="`/grupos/${group.id}/tareasArchivadas`">
62 69
                 <span class="icon text"><ArchiveIcon /></span>
63
-                <span>{{ $t('components.group.seeArchivedHomeworksLink') }}</span>
70
+                <span>{{
71
+                  $t('components.group.seeArchivedHomeworksLink')
72
+                }}</span>
64 73
               </router-link>
65 74
             </li>
66 75
             <li>
@@ -94,33 +103,41 @@ export default {
94 103
   components: {
95 104
     Tarea,
96 105
     Modal,
97
-    PlusIcon, ArchiveIcon, PeopleAddIcon, RefreshIcon, MoreIcon, PersonRemoveIcon,
106
+    PlusIcon,
107
+    ArchiveIcon,
108
+    PeopleAddIcon,
109
+    RefreshIcon,
110
+    MoreIcon,
111
+    PersonRemoveIcon,
98 112
   },
99
-  data () {
113
+  data() {
100 114
     return { error: null, modal: false }
101 115
   },
102 116
   computed: {
103
-    currentHomeworks () {
104
-      return this.group.homeworks.filter(homework => !homework.archived)
117
+    currentHomeworks() {
118
+      return this.group.homeworks
119
+        .filter(homework => !homework.archived)
105 120
         .sort((h1, h2) => h1.deadlineUnix - h2.deadlineUnix)
106 121
     },
107
-    id () { return `group-${this.auth.id}` },
122
+    id() {
123
+      return `group-${this.auth.id}`
124
+    },
108 125
   },
109 126
   methods: {
110
-    salirDelGrupo () {
127
+    salirDelGrupo() {
111 128
       let groups = JSON.parse(localStorage.groups || '[]')
112
-      groups = groups.filter(
113
-        group => group.id != this.auth.id
114
-      )
129
+      groups = groups.filter(group => group.id != this.auth.id)
115 130
       localStorage.groups = JSON.stringify(groups)
116 131
 
117 132
       this.refreshFunc()
118 133
 
119
-      this.$snotify.confirm(`Saliste del grupo ${this.group.name}.`,
134
+      this.$snotify.confirm(
135
+        `Saliste del grupo ${this.group.name}.`,
120 136
         'Saliste de un grupo',
121 137
         {
122 138
           buttons: [
123
-            {text: 'Deshacer',
139
+            {
140
+              text: 'Deshacer',
124 141
               action: async toast => {
125 142
                 let groups = JSON.parse(localStorage.groups || '[]')
126 143
                 if (!groups.find(group => group.id == this.auth.id)) {
@@ -129,16 +146,16 @@ export default {
129 146
                 localStorage.groups = JSON.stringify(groups)
130 147
                 this.$snotify.remove(toast.id)
131 148
                 this.refreshFunc()
132
-            }},
133
-            {text: 'Cerrar',
134
-              action: toast => this.$snotify.remove(toast.id)},
135
-          ]
149
+              },
150
+            },
151
+            { text: 'Cerrar', action: toast => this.$snotify.remove(toast.id) },
152
+          ],
136 153
         },
137 154
       )
138 155
     },
139 156
   },
140 157
   watch: {
141
-    error (error) {
158
+    error(error) {
142 159
       if (error.networkError) {
143 160
         this.$emit('networkError', error.networkError)
144 161
       }
@@ -147,7 +164,9 @@ export default {
147 164
   apollo: {
148 165
     group: {
149 166
       query: groupQuery,
150
-      variables () { return { groupAuth: this.auth } },
167
+      variables() {
168
+        return { groupAuth: this.auth }
169
+      },
151 170
     },
152 171
   },
153 172
 }
@@ -157,30 +176,36 @@ export default {
157 176
 .grupo {
158 177
   header {
159 178
     span.icon {
160
-      padding: .3em .4em;
179
+      padding: 0.3em 0.4em;
161 180
       height: 100%;
162 181
       width: 2em;
163
-      margin-right: .5em;
182
+      margin-right: 0.5em;
164 183
       cursor: pointer;
165 184
     }
166
-    svg { width: 3em; }
185
+    svg {
186
+      width: 3em;
187
+    }
167 188
   }
168 189
   margin: 1.5rem 0;
169
-  &:first-of-type { margin-top: inherit; }
190
+  &:first-of-type {
191
+    margin-top: inherit;
192
+  }
170 193
 }
171 194
 
172 195
 .more-modal {
173
-  padding: .4rem 0;
196
+  padding: 0.4rem 0;
174 197
   li:last-of-type {
175
-    a { border-bottom: none; }
198
+    a {
199
+      border-bottom: none;
200
+    }
176 201
   }
177 202
   a {
178 203
     font-size: 1.25rem;
179 204
     display: flex;
180 205
     align-items: center;
181
-    padding: .15em;
206
+    padding: 0.15em;
182 207
     color: inherit;
183
-    padding: .4rem 1rem;
208
+    padding: 0.4rem 1rem;
184 209
     border-bottom: 1px solid #ccc;
185 210
   }
186 211
 }

+ 7
- 4
src/components/Modal.vue View File

@@ -1,15 +1,18 @@
1 1
 <template>
2 2
   <div
3
-    class="modal" :class="{ 'is-active': active, small }"
3
+    class="modal"
4
+    :class="{ 'is-active': active, small }"
4 5
     @click="$emit('close')"
5
-    >
6
+  >
6 7
     <div class="modal-background" @click="$emit('close')"></div>
7 8
     <div class="modal-content" @click.stop>
8 9
       <slot></slot>
9 10
     </div>
10 11
     <button
11
-      class="modal-close is-large" aria-label="close"
12
-      @click="$emit('close')"></button>
12
+      class="modal-close is-large"
13
+      aria-label="close"
14
+      @click="$emit('close')"
15
+    ></button>
13 16
   </div>
14 17
 </template>
15 18
 

+ 76
- 48
src/components/Tarea.vue View File

@@ -1,16 +1,20 @@
1 1
 <template>
2 2
   <div
3 3
     class="homework card"
4
-    :id="id" :class="{ target: $route.hash === '#' + id }"
5
-    >
4
+    :id="id"
5
+    :class="{ target: $route.hash === '#' + id }"
6
+  >
6 7
     <div class="card-content">
7 8
       <p>{{ homework.text }}</p>
8
-      <p v-if="homework.deadlineUnix"
9
-         :class="{
10
-           'has-text-danger': +now > (+deadline - (1000 * 60 * 60 * 16)),
11
-           'has-text-warning': +now < (+deadline - (1000 * 60 * 60 * 16)) && now > (+deadline - (1000 * 60 * 60 * 48)),
12
-           'has-text-success': +now < (+deadline - (1000 * 60 * 60 * 48)),
13
-         }"
9
+      <p
10
+        v-if="homework.deadlineUnix"
11
+        :class="{
12
+          'has-text-danger': +now > +deadline - 1000 * 60 * 60 * 16,
13
+          'has-text-warning':
14
+            +now < +deadline - 1000 * 60 * 60 * 16 &&
15
+            now > +deadline - 1000 * 60 * 60 * 48,
16
+          'has-text-success': +now < +deadline - 1000 * 60 * 60 * 48,
17
+        }"
14 18
       >
15 19
         Para el {{ deadline.toLocaleDateString() }}
16 20
       </p>
@@ -20,7 +24,7 @@
20 24
         class="card-footer-item"
21 25
         @click.prevent="archiveHomework(homework.archived)"
22 26
         :class="{ unarchive: homework.archived }"
23
-        >
27
+      >
24 28
         <span class="icon">
25 29
           <UndoIcon v-if="homework.archived" />
26 30
           <ArchiveIcon v-else />
@@ -29,8 +33,10 @@
29 33
       <a class="card-footer-item" @click.prevent="editing = true">
30 34
         <span class="icon"><EditIcon /></span>
31 35
       </a>
32
-      <EditarTareaModal v-if="editing"
33
-        :homework="homework" :groupId="groupId"
36
+      <EditarTareaModal
37
+        v-if="editing"
38
+        :homework="homework"
39
+        :groupId="groupId"
34 40
         @close="editing = false"
35 41
       />
36 42
     </footer>
@@ -57,54 +63,72 @@ export default {
57 63
     EditIcon,
58 64
     EditarTareaModal,
59 65
   },
60
-  data () {
66
+  data() {
61 67
     return {
62 68
       editing: false,
63 69
       now: new Date(),
64 70
     }
65 71
   },
66
-  created () {
67
-    setInterval(() => this.now = +new Date(), 1000 * 60 * 10)
72
+  created() {
73
+    setInterval(() => (this.now = +new Date()), 1000 * 60 * 10)
68 74
   },
69 75
   computed: {
70
-    id () { return `homework-${this.homework.id}` },
71
-    deadline () { return new Date(parseInt(this.homework.deadlineUnix)) },
76
+    id() {
77
+      return `homework-${this.homework.id}`
78
+    },
79
+    deadline() {
80
+      return new Date(parseInt(this.homework.deadlineUnix))
81
+    },
72 82
   },
73 83
   methods: {
74
-    archiveHomework (unarchive) {
75
-      return this.$apollo.mutate({
76
-        mutation: gql`
77
-        mutation archiveHomework ($groupAuth: GroupAuth!, $homeworkId: ID!, $revert: Boolean) {
78
-          archiveHomework (auth: $groupAuth, homeworkId: $homeworkId, revert: $revert) {
79
-            ...HomeworkFragment
80
-          }
81
-        }
82
-        ${HomeworkFragment}
83
-        `,
84
-        variables: {
85
-          homeworkId: this.homework.id,
86
-          groupAuth: JSON.parse(localStorage.groups || '[]').find(
87
-            group => group.id == this.groupId
88
-          ),
89
-          revert: unarchive,
90
-        },
91
-      })
84
+    archiveHomework(unarchive) {
85
+      return this.$apollo
86
+        .mutate({
87
+          mutation: gql`
88
+            mutation archiveHomework(
89
+              $groupAuth: GroupAuth!
90
+              $homeworkId: ID!
91
+              $revert: Boolean
92
+            ) {
93
+              archiveHomework(
94
+                auth: $groupAuth
95
+                homeworkId: $homeworkId
96
+                revert: $revert
97
+              ) {
98
+                ...HomeworkFragment
99
+              }
100
+            }
101
+            ${HomeworkFragment}
102
+          `,
103
+          variables: {
104
+            homeworkId: this.homework.id,
105
+            groupAuth: JSON.parse(localStorage.groups || '[]').find(
106
+              group => group.id == this.groupId,
107
+            ),
108
+            revert: unarchive,
109
+          },
110
+        })
92 111
         .then(homework => {
93
-          this.$snotify.confirm(unarchive
112
+          this.$snotify.confirm(
113
+            unarchive
94 114
               ? 'Esa tarea fue desarchivada.'
95 115
               : 'Esa tarea fue archivada.',
96 116
             unarchive ? 'Tarea desarchivada' : 'Tarea archivada',
97 117
             {
98 118
               buttons: [
99
-                {text: 'Deshacer',
100
-                action: async toast => {
101
-                  await this.archiveHomework(!unarchive)
102
-                  this.$snotify.remove(toast.id)
103
-                }},
104
-                {text: 'Cerrar',
105
-                  action: toast => this.$snotify.remove(toast.id)},
106
-              ]
107
-            }
119
+                {
120
+                  text: 'Deshacer',
121
+                  action: async toast => {
122
+                    await this.archiveHomework(!unarchive)
123
+                    this.$snotify.remove(toast.id)
124
+                  },
125
+                },
126
+                {
127
+                  text: 'Cerrar',
128
+                  action: toast => this.$snotify.remove(toast.id),
129
+                },
130
+              ],
131
+            },
108 132
           )
109 133
         })
110 134
     },
@@ -118,14 +142,16 @@ export default {
118 142
   a {
119 143
     --background: #00000022;
120 144
     --actual-background: transparent;
121
-    &:hover { --actual-background: var(--background); }
145
+    &:hover {
146
+      --actual-background: var(--background);
147
+    }
122 148
     .icon {
123 149
       width: 1.7em;
124 150
       height: 1.7em;
125
-      padding: .2em;
151
+      padding: 0.2em;
126 152
       cursor: pointer;
127 153
       border-radius: 999px;
128
-      transition: background .5s;
154
+      transition: background 0.5s;
129 155
       background: var(--actual-background);
130 156
     }
131 157
   }
@@ -138,7 +164,9 @@ export default {
138 164
     --background: #ee660022;
139 165
   }
140 166
   margin-bottom: 1.5rem;
141
-  &:last-of-type { margin-bottom: 0; }
167
+  &:last-of-type {
168
+    margin-bottom: 0;
169
+  }
142 170
 }
143 171
 
144 172
 a {

+ 14
- 8
src/fragments.js View File

@@ -1,15 +1,21 @@
1 1
 import gql from 'graphql-tag'
2 2
 
3 3
 export const HomeworkFragment = gql`
4
-fragment HomeworkFragment on Homework {
5
-  id text archived deadlineUnix
6
-}
4
+  fragment HomeworkFragment on Homework {
5
+    id
6
+    text
7
+    archived
8
+    deadlineUnix
9
+  }
7 10
 `
8 11
 
9 12
 export const GroupFragment = gql`
10
-fragment GroupFragment on Group {
11
-  id name
12
-  homeworks { ...HomeworkFragment }
13
-}
14
-${HomeworkFragment}
13
+  fragment GroupFragment on Group {
14
+    id
15
+    name
16
+    homeworks {
17
+      ...HomeworkFragment
18
+    }
19
+  }
20
+  ${HomeworkFragment}
15 21
 `

+ 2
- 2
src/i18n/index.js View File

@@ -1,9 +1,9 @@
1 1
 import en from './en.json'
2 2
 import es from './es.json'
3 3
 
4
-export function hawt (i18n) {
4
+export function hawt(i18n) {
5 5
   if (module.hot) {
6
-    module.hot.accept(['./en.json', './es.json'], function () {
6
+    module.hot.accept(['./en.json', './es.json'], function() {
7 7
       i18n.setLocaleMessage('en', require('./en.json'))
8 8
       i18n.setLocaleMessage('es', require('./es.json'))
9 9
     })

+ 4
- 1
src/main.js View File

@@ -28,7 +28,10 @@ const apolloProvider = new VueApollo({
28 28
   defaultClient: apolloClient,
29 29
   defaultOptions: {
30 30
     $query: {
31
-      error (error) { console.error(error); this.error = error },
31
+      error(error) {
32
+        console.error(error)
33
+        this.error = error
34
+      },
32 35
     },
33 36
   },
34 37
 })

+ 2
- 2
src/queries.js View File

@@ -2,8 +2,8 @@ import gql from 'graphql-tag'
2 2
 import { GroupFragment } from '@/fragments'
3 3
 
4 4
 export const groupQuery = gql`
5
-  query getGroupHomeworks ($groupAuth: GroupAuth!) {
6
-    group (auth: $groupAuth) {
5
+  query getGroupHomeworks($groupAuth: GroupAuth!) {
6
+    group(auth: $groupAuth) {
7 7
       ...GroupFragment
8 8
     }
9 9
   }

+ 13
- 4
src/router.js View File

@@ -32,19 +32,28 @@ export default new Router({
32 32
       path: '/grupos/:groupId/crearTarea',
33 33
       name: 'crear tarea',
34 34
       component: CrearTarea,
35
-      meta: { backCb: (router, route) => router.push(`/tareas#group-${route.params.groupId}`) },
35
+      meta: {
36
+        backCb: (router, route) =>
37
+          router.push(`/tareas#group-${route.params.groupId}`),
38
+      },
36 39
     },
37 40
     {
38 41
       path: '/grupos/:groupId/tareasArchivadas',
39 42
       name: 'tareas archivadas',
40 43
       component: TareasArchivadas,
41
-      meta: { backCb: (router, route) => router.push(`/tareas#group-${route.params.groupId}`) },
44
+      meta: {
45
+        backCb: (router, route) =>
46
+          router.push(`/tareas#group-${route.params.groupId}`),
47
+      },
42 48
     },
43 49
     {
44 50
       path: '/grupos/:groupId/anadirGente',
45 51
       name: 'añadir gente a grupo',
46 52
       component: AnadirGenteAGrupo,
47
-      meta: { backCb: (router, route) => router.push(`/tareas#group-${route.params.groupId}`) },
53
+      meta: {
54
+        backCb: (router, route) =>
55
+          router.push(`/tareas#group-${route.params.groupId}`),
56
+      },
48 57
     },
49 58
     //{
50 59
     //  path: '/grupos',
@@ -73,7 +82,7 @@ export default new Router({
73 82
       component: NotFound,
74 83
     },
75 84
   ],
76
-  scrollBehavior (to, from, savedPosition) {
85
+  scrollBehavior(to, from, savedPosition) {
77 86
     if (savedPosition) {
78 87
       return savedPosition
79 88
     } else if (to.hash) {

+ 34
- 17
src/views/AnadirGenteAGrupo.vue View File

@@ -3,19 +3,34 @@
3 3
     <div class="anadir-gente-a-grupo-view container">
4 4
       <h1 class="title has-text-centered">
5 5
         Añadir gente
6
-        <template v-if="!$apollo.loading">a {{ group.name }}</template>
6
+        <template v-if="!$apollo.loading"
7
+          >a {{ group.name }}</template
8
+        >
7 9
       </h1>
8 10
 
9 11
       <qrcode-vue
10
-        v-if="url" class="qr"
11
-        :value="url" :size="500"
12
-        aria-label="codigo QR para unirse al grupo" />
12
+        v-if="url"
13
+        class="qr"
14
+        :value="url"
15
+        :size="500"
16
+        aria-label="codigo QR para unirse al grupo"
17
+      />
13 18
 
14 19
       <div class="content has-text-centered">
15
-        <p>Pediles que escaneen este código QR con el celular para que se puedan usar al grupo.</p>
16
-        <p>¡También podés pasarle este link! lo podés pasar por WhatsApp, Instagram, o lo que sea que uses :)</p>
17
-        <input @click="e => e.target.select()"
18
-          class="input" readonly :value="url" />
20
+        <p>
21
+          Pediles que escaneen este código QR con el celular para que se puedan
22
+          usar al grupo.
23
+        </p>
24
+        <p>
25
+          ¡También podés pasarle este link! lo podés pasar por WhatsApp,
26
+          Instagram, o lo que sea que uses :)
27
+        </p>
28
+        <input
29
+          @click="e => e.target.select()"
30
+          class="input"
31
+          readonly
32
+          :value="url"
33
+        />
19 34
       </div>
20 35
     </div>
21 36
   </section>
@@ -34,7 +49,7 @@ export default {
34 49
     BackIcon,
35 50
   },
36 51
   computed: {
37
-    url () {
52
+    url() {
38 53
       const { id, secret } = this.auth()
39 54
       return location.origin + `/#/unirseAGrupo/${id},${secret}`
40 55
     },
@@ -42,21 +57,23 @@ export default {
42 57
   apollo: {
43 58
     group: {
44 59
       query: gql`
45
-      query getGroupInfo ($auth: GroupAuth!) {
46
-        group (auth: $auth) {
47
-          id name
60
+        query getGroupInfo($auth: GroupAuth!) {
61
+          group(auth: $auth) {
62
+            id
63
+            name
64
+          }
48 65
         }
49
-      }
50 66
       `,
51
-      variables () {
67
+      variables() {
52 68
         return { auth: this.auth() }
53 69
       },
54 70
     },
55 71
   },
56 72
   methods: {
57
-    auth () {
58
-      return JSON.parse(localStorage.groups || '[]')
59
-        .find(group => group.id == this.$route.params.groupId)
73
+    auth() {
74
+      return JSON.parse(localStorage.groups || '[]').find(
75
+        group => group.id == this.$route.params.groupId,
76
+      )
60 77
     },
61 78
   },
62 79
 }

+ 33
- 29
src/views/CrearGrupo.vue View File

@@ -10,9 +10,12 @@
10 10
         </label>
11 11
         <div class="control">
12 12
           <input
13
-            type="text" class="input"
14
-            name="name" v-model="name"
15
-            :placeholder="$t('views.createGroupView.namePlaceholder')" />
13
+            type="text"
14
+            class="input"
15
+            name="name"
16
+            v-model="name"
17
+            :placeholder="$t('views.createGroupView.namePlaceholder')"
18
+          />
16 19
         </div>
17 20
       </div>
18 21
       <div class="field is-centered">
@@ -39,7 +42,7 @@ export default {
39 42
   components: {
40 43
     CustomButton,
41 44
   },
42
-  data () {
45
+  data() {
43 46
     return {
44 47
       error: null,
45 48
       loading: false,
@@ -47,31 +50,32 @@ export default {
47 50
     }
48 51
   },
49 52
   methods: {
50
-    crearGrupo (e) {
53
+    crearGrupo(e) {
51 54
       this.loading = true
52
-      this.$apollo.mutate({
53
-        mutation: gql`
54
-        mutation createGroup ($name: String!) {
55
-          createGroup (name: $name) {
56
-            ...GroupFragment
57
-            secret
58
-          }
59
-        }
60
-        ${GroupFragment}
61
-        `,
62
-        variables: {
63
-          name: this.name,
64
-        },
65
-        update: (store, { data: { createGroup: group } }) => {
66
-          const auth = { id: group.id, secret: group.secret }
67
-          const variables = { groupAuth: auth }
68
-          store.writeQuery({
69
-            query: groupQuery,
70
-            variables,
71
-            data: { group },
72
-          })
73
-        },
74
-      })
55
+      this.$apollo
56
+        .mutate({
57
+          mutation: gql`
58
+            mutation createGroup($name: String!) {
59
+              createGroup(name: $name) {
60
+                ...GroupFragment
61
+                secret
62
+              }
63
+            }
64
+            ${GroupFragment}
65
+          `,
66
+          variables: {
67
+            name: this.name,
68
+          },
69
+          update: (store, { data: { createGroup: group } }) => {
70
+            const auth = { id: group.id, secret: group.secret }
71
+            const variables = { groupAuth: auth }
72
+            store.writeQuery({
73
+              query: groupQuery,
74
+              variables,
75
+              data: { group },
76
+            })
77
+          },
78
+        })
75 79
         .then(({ data: { createGroup: group } }) => {
76 80
           let groups = JSON.parse(localStorage.groups || '[]')
77 81
           const auth = { id: new Number(group.id), secret: group.secret }
@@ -79,7 +83,7 @@ export default {
79 83
           localStorage.groups = JSON.stringify(groups)
80 84
           this.$router.push(`/tareas#group-${group.id}`)
81 85
         })
82
-        .finally(() => this.loading = false)
86
+        .finally(() => (this.loading = false))
83 87
     },
84 88
   },
85 89
 }

+ 62
- 47
src/views/CrearTarea.vue View File

@@ -4,30 +4,39 @@
4 4
       <h1 class="title has-text-centered">
5 5
         {{ $t('views.createHomeworkView.title') }}
6 6
         <template v-if="group">
7
-          {{ $t('views.createHomeworkView.titleInGroup', { name: group.name }) }}
7
+          {{
8
+            $t('views.createHomeworkView.titleInGroup', { name: group.name })
9
+          }}
8 10
         </template>
9 11
       </h1>
10 12
       <div v-if="error" class="notification is-danger">
11 13
         {{ error }}
12 14
       </div>
13 15
       <div class="field">
14
-        <label class="label">{{ $t('views.createHomeworkView.textLabel') }}</label>
16
+        <label class="label">{{
17
+          $t('views.createHomeworkView.textLabel')
18
+        }}</label>
15 19
         <div class="control">
16
-          <textarea class="textarea"
20
+          <textarea
21
+            class="textarea"
17 22
             name="text"
18
-            :placeholder="$t('views.createHomeworkView.textPlaceholder')"></textarea>
23
+            :placeholder="$t('views.createHomeworkView.textPlaceholder')"
24
+          ></textarea>
19 25
         </div>
20 26
       </div>
21 27
       <div class="field">
22
-        <label class="label">{{ $t('views.createHomeworkView.deadlineLabel') }}</label>
28
+        <label class="label">{{
29
+          $t('views.createHomeworkView.deadlineLabel')
30
+        }}</label>
23 31
         <div class="control">
24
-          <input type="date" name="deadline"
25
-            v-model="deadline" :min="today">
32
+          <input type="date" name="deadline" v-model="deadline" :min="today" />
26 33
         </div>
27 34
       </div>
28 35
       <div class="field is-centered">
29 36
         <div class="control">
30
-          <custom-button :loading="loading">{{ $t('views.createHomeworkView.createButton') }}</custom-button>
37
+          <custom-button :loading="loading">{{
38
+            $t('views.createHomeworkView.createButton')
39
+          }}</custom-button>
31 40
         </div>
32 41
       </div>
33 42
     </form>
@@ -45,7 +54,7 @@ import CustomButton from '@/components/Button.vue'
45 54
 export default {
46 55
   name: 'CrearTareaView',
47 56
   components: { CustomButton },
48
-  data () {
57
+  data() {
49 58
     return {
50 59
       error: null,
51 60
       loading: false,
@@ -55,68 +64,74 @@ export default {
55 64
   apollo: {
56 65
     group: {
57 66
       query: gql`
58
-      query getGroupInfo ($auth: GroupAuth!) {
59
-        group (auth: $auth) {
60
-          id name
67
+        query getGroupInfo($auth: GroupAuth!) {
68
+          group(auth: $auth) {
69
+            id
70
+            name
71
+          }
61 72
         }
62
-      }
63 73
       `,
64
-      variables () {
74
+      variables() {
65 75
         return { auth: this.getAuth() }
66 76
       },
67 77
     },
68 78
   },
69 79
   methods: {
70
-    getAuth () {
80
+    getAuth() {
71 81
       return JSON.parse(localStorage.groups || '[]').find(
72
-        group => group.id == this.$route.params.groupId
82
+        group => group.id == this.$route.params.groupId,
73 83
       )
74 84
     },
75
-    crearTarea (event) {
85
+    crearTarea(event) {
76 86
       const homeworkInfo = {
77 87
         text: event.target.text.value,
78
-        deadlineUnix: this.deadline && `${+(new Date(this.deadline))}`,
88
+        deadlineUnix: this.deadline && `${+new Date(this.deadline)}`,
79 89
       }
80 90
 
81 91
       this.loading = true
82
-      this.$apollo.mutate({
83
-        mutation: gql`
84
-        mutation createHomework (
85
-          $groupAuth: GroupAuth!,
86
-          $info: HomeworkInput!,
87
-        ) {
88
-          createHomework (groupAuth: $groupAuth, info: $info) {
89
-            ...HomeworkFragment
90
-          }
91
-        }
92
-        ${HomeworkFragment}
93
-        `,
94
-        variables: { info: homeworkInfo, groupAuth: this.getAuth() },
95
-        update: (store, { data: { createHomework } }) => {
96
-          const variables = { groupAuth: this.getAuth() }
97
-          let data
98
-          try {
99
-            data = store.readQuery({ query: groupQuery, variables })
100
-          } catch (e) { return }
101
-          data.group.homeworks.push(createHomework)
102
-          store.writeQuery({
103
-            query: groupQuery,
104
-            variables,
105
-            data,
106
-          })
107
-        },
108
-      })
92
+      this.$apollo
93
+        .mutate({
94
+          mutation: gql`
95
+            mutation createHomework(
96
+              $groupAuth: GroupAuth!
97
+              $info: HomeworkInput!
98
+            ) {
99
+              createHomework(groupAuth: $groupAuth, info: $info) {
100
+                ...HomeworkFragment
101
+              }
102
+            }
103
+            ${HomeworkFragment}
104
+          `,
105
+          variables: { info: homeworkInfo, groupAuth: this.getAuth() },
106
+          update: (store, { data: { createHomework } }) => {
107
+            const variables = { groupAuth: this.getAuth() }
108
+            let data
109
+            try {
110
+              data = store.readQuery({ query: groupQuery, variables })
111
+            } catch (e) {
112
+              return
113
+            }
114
+            data.group.homeworks.push(createHomework)
115
+            store.writeQuery({
116
+              query: groupQuery,
117
+              variables,
118
+              data,
119
+            })
120
+          },
121
+        })
109 122
         .then(({ data: { createHomework: homework } }) => {
110 123
           this.$router.push(`/tareas#homework-${homework.id}`)
111 124
         })
112
-        .catch(error => this.error = error)
125
+        .catch(error => (this.error = error))
113 126
         .finally(() => {
114 127
           this.loading = false
115 128
         })
116 129
     },
117 130
   },
118 131
   computed: {
119
-    today () { return new Date().toISOString().split('T')[0] },
132
+    today() {
133
+      return new Date().toISOString().split('T')[0]
134
+    },
120 135
   },
121 136
 }
122 137
 </script>

+ 5
- 4
src/views/Home.vue View File

@@ -1,9 +1,11 @@
1 1
 <template>
2 2
   <div class="home text-view">
3
-    <img alt="logo de manejador de tareas" src="../assets/logo-no-circle.svg">
3
+    <img alt="logo de manejador de tareas" src="../assets/logo-no-circle.svg" />
4 4
     <h1>Manejador de Tareas</h1>
5 5
     <p>esloganjhbgweikrtlgktr</p>
6
-    <router-link to="/app/crearGrupo" tag="button" class="primary">Crear un grupo</router-link>
6
+    <router-link to="/app/crearGrupo" tag="button" class="primary"
7
+      >Crear un grupo</router-link
8
+    >
7 9
     <router-link to="/app/grupos" tag="button">Ver mis grupos</router-link>
8 10
   </div>
9 11
 </template>
@@ -11,8 +13,7 @@
11 13
 <script>
12 14
 export default {
13 15
   name: 'HomeView',
14
-  components: {
15
-  }
16
+  components: {},
16 17
 }
17 18
 </script>
18 19
 

+ 14
- 11
src/views/Tareas.vue View File

@@ -11,16 +11,17 @@
11 11
         <Grupo
12 12
           v-for="group in groups()"
13 13
           :data-group-id="group.id"
14
-          :auth="group" :key="group.id"
14
+          :auth="group"
15
+          :key="group.id"
15 16
           @networkError="networkError = true"
16 17
           :refreshFunc="() => refreshKey++"
17
-          />
18
+        />
18 19
       </div>
19 20
       <i18n
20 21
         v-if="groups().length < 1"
21 22
         path="views.homeworksView.noGroups"
22 23
         tag="p"
23
-        >
24
+      >
24 25
         <router-link to="/crearGrupo">
25 26
           {{ $t('views.homeworksView.createGroupQuestion') }}
26 27
         </router-link>
@@ -31,7 +32,7 @@
31 32
           class="fab"
32 33
           to="/crearGrupo"
33 34
           :aria-label="$t('views.homeworksView.createGroupButton')"
34
-          >
35
+        >
35 36
           <FolderAddIcon />
36 37
           <label>{{ $t('views.homeworksView.createGroupButton') }}</label>
37 38
         </router-link>
@@ -53,7 +54,7 @@ export default {
53 54
     Grupo,
54 55
     FolderAddIcon,
55 56
   },
56
-  data () {
57
+  data() {
57 58
     return { networkError: false, refreshKey: 0 }
58 59
   },
59 60
   methods: {
@@ -93,7 +94,7 @@ export default {
93 94
   line-height: 70px;
94 95
 
95 96
   margin: 25px 10px;
96
-  padding: .5em;
97
+  padding: 0.5em;
97 98
   pointer-events: auto;
98 99
 
99 100
   &:hover {
@@ -101,14 +102,16 @@ export default {
101 102
     //transform: scale(1.05);
102 103
   }
103 104
   > svg {
104
-    margin: .5em 0;
105
+    margin: 0.5em 0;
105 106
     width: 2em;
106
-    margin-right: .5em;
107
+    margin-right: 0.5em;
107 108
   }
108 109
 
109 110
   @media only screen and (max-width: 600px) {
110
-    label { display: none; }
111
-    padding: .5em;
111
+    label {
112
+      display: none;
113
+    }
114
+    padding: 0.5em;
112 115
     height: 3em;
113 116
     margin: 25px;
114 117
     > svg {
@@ -125,7 +128,7 @@ p {
125 128
 .tareas-section {
126 129
   padding-right: 0;
127 130
   padding-left: 0;
128
-  padding-top: .7rem;
131
+  padding-top: 0.7rem;
129 132
   @media only screen and (max-width: 600px) {
130 133
     padding-top: 0;
131 134
   }

+ 18
- 12
src/views/TareasArchivadas.vue View File

@@ -13,11 +13,14 @@
13 13
       <p v-else-if="archivedHomeworks.length < 1">
14 14
         No hay ninguna tarea archivada en {{ group.name }}.
15 15
       </p>
16
-      <Tarea v-else v-for="homework in archivedHomeworks"
16
+      <Tarea
17
+        v-else
18
+        v-for="homework in archivedHomeworks"
17 19
         class="is-centered"
18
-        :key="homework.id" :homework="homework"
20
+        :key="homework.id"
21
+        :homework="homework"
19 22
         :groupId="group.id"
20
-        />
23
+      />
21 24
       <!--<router-link
22 25
         tag="button"
23 26
         class="button back"
@@ -40,16 +43,15 @@ export default {
40 43
   name: 'TareasArchivadas',
41 44
   components: { Tarea, BackIcon },
42 45
   computed: {
43
-    archivedHomeworks () {
44
-      return this.group.homeworks.filter(
45
-        homework => homework.archived
46
-      )
46
+    archivedHomeworks() {
47
+      return this.group.homeworks.filter(homework => homework.archived)
47 48
     },
48 49
   },
49 50
   methods: {
50
-    groupAuth () {
51
-      return JSON.parse(localStorage.groups || '[]')
52
-        .find(group => group.id == this.$route.params.groupId)
51
+    groupAuth() {
52
+      return JSON.parse(localStorage.groups || '[]').find(
53
+        group => group.id == this.$route.params.groupId,
54
+      )
53 55
     },
54 56
   },
55 57
   //watch: {
@@ -62,7 +64,9 @@ export default {
62 64
   apollo: {
63 65
     group: {
64 66
       query: groupQuery,
65
-      variables () { return { groupAuth: this.groupAuth() } },
67
+      variables() {
68
+        return { groupAuth: this.groupAuth() }
69
+      },
66 70
     },
67 71
   },
68 72
 }
@@ -74,5 +78,7 @@ export default {
74 78
   flex-direction: column;
75 79
   align-items: center;
76 80
 }
77
-p { text-align: center; }
81
+p {
82
+  text-align: center;
83
+}
78 84
 </style>

+ 13
- 13
src/views/UnirseAGrupo.vue View File

@@ -4,13 +4,12 @@
4 4
       <h1 class="title has-text-centered">
5 5
         Te invitaron a
6 6
         <template v-if="group">{{ group.name }}</template>
7
-        <template v-else>un grupo</template>
7
+        <template v-else
8
+          >un grupo</template
9
+        >
8 10
       </h1>
9 11
       <div>
10
-        <button
11
-          @click="unirse"
12
-          class="button is-centered"
13
-          >
12
+        <button @click="unirse" class="button is-centered">
14 13
           <span>Unirse al grupo</span>
15 14
           <span class="icon"><ForwardIcon /></span>
16 15
         </button>
@@ -30,18 +29,19 @@ export default {
30 29
   apollo: {
31 30
     group: {
32 31
       query: gql`
33
-      query getGroupInfo ($auth: GroupAuth!) {
34
-        group (auth: $auth) {
35
-          id name
32
+        query getGroupInfo($auth: GroupAuth!) {
33
+          group(auth: $auth) {
34
+            id
35
+            name
36
+          }
36 37
         }
37
-      }
38 38
       `,
39
-      variables () {
39
+      variables() {
40 40
         return { auth: this.auth() }
41 41
       },
42 42
     },
43 43
   },
44
-  mounted () {
44
+  mounted() {
45 45
     const id = this.$route.params.id
46 46
     const groups = JSON.parse(localStorage.groups || '[]')
47 47
     if (groups.find(group => group.id == id)) {
@@ -49,13 +49,13 @@ export default {
49 49
     }
50 50
   },
51 51
   methods: {
52
-    auth () {
52
+    auth() {
53 53
       return {
54 54
         id: parseInt(this.$route.params.groupId),
55 55
         secret: this.$route.params.secret,
56 56
       }
57 57
     },
58
-    unirse (event) {
58
+    unirse(event) {
59 59
       let groups = JSON.parse(localStorage.groups || '[]')
60 60
       const auth = this.auth()
61 61
       if (!groups.find(group => group.id == auth.id)) {

Loading…
Cancel
Save