Skip to content

Commit

Permalink
admin view fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rishabnayak committed Sep 22, 2020
1 parent c41fc56 commit 203c10c
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 19 deletions.
7 changes: 5 additions & 2 deletions firestore.rules
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,11 @@ service cloud.firestore {
}

match /admin/{docId} {
allow read: if true;
allow write: if hasRole("admin");
allow get: if true;
allow list: if true;
allow create: if hasRole("admin");
allow update: if hasRole("admin");
allow delete: if hasRole("admin");
}

}
Expand Down
9 changes: 6 additions & 3 deletions src/components/common/HackerTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,18 @@
<v-data-table
v-model="selected"
show-select
item-key="name"
item-key="phone"
:headers="headers"
:items="data"
:items-per-page="5"
class="elevation-1"
:search="search"
>
<template v-slot:item.firstName="{ item }">
{{ item.firstName + " " + item.lastName }}
</template>
<template v-slot:item.resume[0]="{ item }">
<button v-if="item.resume[0]">
<button v-if="item.resume">
<a :href="item.resume[0]" target="_blank" rel="noreferrer"
>Open</a
>
Expand Down Expand Up @@ -586,7 +589,7 @@ export default {
text: "Name",
align: "start",
sortable: false,
value: "name"
value: "firstName"
},
{
text: "Phone",
Expand Down
6 changes: 3 additions & 3 deletions src/components/common/Timeline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@ export default {
var deadlineDoc = await deadlineDb.get();
var out = deadlineDoc.data();
if (out.data["startTime"] != null && out.data["startTime"] != null) {
if (out["startTime"] != null && out["startTime"] != null) {
this.firstInput = false;
this.start = out.data["startTime"];
this.end = out.data["finishTime"];
this.start = out["startTime"];
this.end = out["finishTime"];
}
},
async saveDate() {
Expand Down
23 changes: 12 additions & 11 deletions src/views/Admin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -223,12 +223,7 @@ export default {
text: "Majors"
}
},
labels: [
"Computer Science",
"Electrical Engineering",
"Computer Engineering",
"Others"
],
labels: ["CS", "EE", "CE", "Others"],
datasets: [
{
label: "2020",
Expand Down Expand Up @@ -274,7 +269,13 @@ export default {
}
},
async getData() {
const applicantStatus = ["Accepted", "Confirmed", "Checked In"];
const applicantStatus = [
"Started",
"Submitted",
"Accepted",
"Confirmed",
"Checked In"
];
const statusList = [
"Started",
"Submitted",
Expand All @@ -294,7 +295,7 @@ export default {
appData.forEach(element => {
out.push(element.data());
});
const applicants = out.data;
const applicants = out;
this.data = applicants.filter(applicant =>
applicantStatus.includes(statusList[applicant.status])
);
Expand Down Expand Up @@ -386,9 +387,9 @@ export default {
volunteerOut.push(element.data());
});
this.hackerData = hackOut.data;
this.mentorData = mentorOut.data;
this.volunteerData = volunteerOut.data;
this.hackerData = hackOut;
this.mentorData = mentorOut;
this.volunteerData = volunteerOut;
this.hackerCurrentData = this.hackerData;
this.volunteerCurrentData = this.volunteerData;
this.mentorCurrentData = this.mentorData;
Expand Down

0 comments on commit 203c10c

Please sign in to comment.