Skip to content

Commit c832910

Browse files
author
dmfarcas
committed
Minor fixes
1 parent daa306b commit c832910

8 files changed

Lines changed: 21 additions & 48 deletions

File tree

src/auth.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ const init = function init() {
4646

4747

4848
} else {
49-
// User is signed out.
50-
// console.log('signed out');
5149
user.displayName = '';
5250
user.email = '';
5351
user.emailVerified = false;

src/components/Admin/Admin.vue

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,10 @@
1717
</template>
1818

1919
<script>
20-
import firebase from 'firebase';
21-
import { database } from '../../firebaseInstance';
2220
import Books from '../Books'
2321
import Search from './Search';
24-
import Vuex from 'vuex';
2522
2623
export default {
2724
components: { Books, Search }
2825
};
2926
</script>
30-
31-
<style>
32-
33-
</style>

src/components/Admin/Search.vue

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@
5050
height: 100px;
5151
display: inline;
5252
}
53-
</style>
54-
55-
<style>
5653
.el-autocomplete-suggestion li {
5754
margin: 4px 0;
5855
}
@@ -100,15 +97,17 @@
10097
}
10198
});
10299
100+
101+
const apiKey = "AIzaSyBPhoh6CYEtQ2SQhhU5XzK-OwB9WIfteCE";
103102
function querySearchAsync (queryString, cb) {
104-
fetch(`https://www.googleapis.com/books/v1/volumes?q=${queryString}&key=AIzaSyBPhoh6CYEtQ2SQhhU5XzK-OwB9WIfteCE`)
103+
fetch(`https://www.googleapis.com/books/v1/volumes?q=${queryString}&key=${apiKey}`)
105104
.then(response => {
106105
return response.json()
107106
})
108107
.then(json => {
109108
cb(json.items.map(e => {
110109
return {
111-
value: e.volumeInfo.title, //TODO how to send title directly in the callback.
110+
value: e.volumeInfo.title,
112111
title: e.volumeInfo.title || '',
113112
subtitle: e.volumeInfo.subtitle || '',
114113
description: e.volumeInfo.description || '',
@@ -129,9 +128,6 @@
129128
export default Vue.extend({
130129
name: 'Search',
131130
props: ['Search'],
132-
ready () {
133-
var self = this;
134-
},
135131
data () {
136132
return {
137133
textfieldBook: '',
@@ -148,6 +144,11 @@
148144
if (this.selectedItem) {
149145
booksRef.push(this.selectedItem);
150146
}
147+
this.$notify({
148+
title: 'Added',
149+
message: 'Successfuly added book!',
150+
type: 'success'
151+
});
151152
},
152153
querySearchAsync,
153154
createFilter (queryString) {

src/components/BookDetails.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
},
5050
methods: {
5151
details (currentBook) {
52-
console.log(currentBook);
5352
this.currentBook = currentBook;
5453
this.dialogVisible = true;
5554
}

src/components/Books.vue

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,7 @@
44
<div class="product-list-container clearfix">
55
<article class="product-list-item clearfix" v-for="book in books">
66
<a @click="details(book['.key'])" class="product-list-item-image-container cursor-hover">
7-
8-
<div v-if="true === false">
9-
<el-badge value="borrowed" class="item">
10-
<img class="product-list-item-image" :src="book.image.thumbnail" alt="alternative-image">
11-
</el-badge>
12-
</div>
13-
<div v-else>
147
<img class="product-list-item-image" :src="book.image.thumbnail" alt="alternative-image">
15-
</div>
16-
178
</a>
189
<div class="product-list-item-price">
1910
<div class="price-container">
@@ -35,7 +26,6 @@
3526
<div class="product-list-item-share">
3627
<div>
3728
<el-button plain type="text" class="button" @click="details(book)">Details</el-button>
38-
<el-button plain type="text" class="button" :href="book.preview" target="_blank">Preview</el-button>
3929
<el-button plain type="text" class="button" @click="removeBook(book['.key'])">Delete</el-button>
4030
</div>
4131
</div>
@@ -74,16 +64,13 @@
7464
details(book) {
7565
eventHub.$emit('open-modal', book)
7666
},
77-
handleSelect(key, keyPath) {
78-
console.log(key, keyPath);
79-
},
8067
removeBook(key) {
8168
booksRef.child(key).remove();
82-
this.$notify({
83-
title: 'Deleted',
84-
message: 'Successfuly deleted book!',
85-
type: 'success'
86-
});
69+
this.$notify({
70+
title: 'Deleted',
71+
message: 'Successfuly deleted book!',
72+
type: 'success'
73+
});
8774
this.dialogVisible = false;
8875
}
8976
},

src/components/Resources.vue

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,7 @@
8888
info: 'https://red.assist.ro/projects/assist/wiki/Tutoriale'
8989
}]
9090
}
91-
},
92-
methods: {
93-
handleClick(e) {
94-
console.log('click', e);
95-
}
96-
},
91+
}
9792
});
9893
9994
</script>

src/main.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ import store from './vuex/store'
1111
import firebase from 'firebase'
1212
import lang from 'element-ui/lib/locale/lang/en'
1313
import locale from 'element-ui/lib/locale'
14+
import { init } from './auth';
1415

15-
locale.use(lang)
16+
locale.use(lang);
1617

1718

18-
Vue.use(VuexFire)
19-
Vue.use(ElementUI)
19+
Vue.use(VuexFire);
20+
Vue.use(ElementUI);
2021

21-
import { init } from './auth';
2222

2323
init();
2424

src/router/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ const router = new Router({
2424
{
2525
path: '/admin',
2626
name: 'Admin',
27-
meta: { //TODO this should require auth AND the admin role ICHIM
27+
meta: {
2828
requiresAuth: true,
2929
},
3030
component: Admin,
3131
},
32-
{
32+
{
3333
path: '/dashboard',
3434
name: 'Dashboard',
3535
meta: {

0 commit comments

Comments
 (0)