Skip to content

Commit

Permalink
Merge pull request #298 from ncosd/dev-1.16.0
Browse files Browse the repository at this point in the history
Release 1.16.0
  • Loading branch information
dherbst authored Feb 4, 2024
2 parents f28e78d + 8a62a2d commit 4629654
Show file tree
Hide file tree
Showing 31 changed files with 540 additions and 338 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,7 @@ firebase-config.js

# Do not force everyone to use the same .firebaserc
.firebaserc

# Do not commit the brand logos
web/admin/public/img/brand
web/app/public/img/brand
2 changes: 1 addition & 1 deletion web/admin/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en" data-bs-theme="auto">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<link rel="icon" href="%VITE_ORGANIZATION_FAVICON%" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Volunteer | %VITE_ORGANIZATION_NAME%</title>
</head>
Expand Down
1 change: 0 additions & 1 deletion web/admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"scripts": {
"dev": "vite -m dev --port 5174",
"build": "vite build",
"build:prod": "vite build",
"build:dev": "vite build -m dev",
"build:watch": "vite build -m dev --watch",
"preview": "vite preview --port 4173",
Expand Down
Binary file removed web/admin/public/favicon.ico
Binary file not shown.
Binary file removed web/admin/public/ncfb-logo.png
Binary file not shown.
22 changes: 22 additions & 0 deletions web/admin/src/components/reports/ReportsTab.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<script setup>
import { ref, onBeforeMount } from 'vue'
const props = defineProps({
activeTab: String,
})
</script>

<template>
<ul class="nav nav-tabs">
<li class="nav-item">
<router-link :class="['nav-link', { active: props.activeTab === 'Dashboard' }]" aria-current="page" :to="{ name: 'AdminReportPage' }">Dashboard</router-link>
</li>
<li class="nav-item">
<router-link :class="['nav-link', { active: props.activeTab === 'Volunteers' }]" :to="{ name: 'VolunteerReportPage' }">Volunteers</router-link>
</li>
<li class="nav-item">
<router-link :class="['nav-link', { active: props.activeTab === 'Guests' }]" :to="{ name: 'GuestReportPage' }">Guests</router-link>
</li>

</ul>
</template>
4 changes: 2 additions & 2 deletions web/admin/src/pages/ReleaseNotesPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<template>
<div class="container">
<h1>Release Notes</h1>
<h2 id="1.16.0">February 7, 2024 - 1.16.0</h2>
<h2 id="1.16.0">February 4, 2024 - 1.16.0</h2>
<ul>
<li>TBD</li>
<li>Added reports pages for Guests and Volunteers.</li>
</ul>
<h2 id="1.15.0">January 31, 2024 - 1.15.0</h2>
<ul>
Expand Down
11 changes: 11 additions & 0 deletions web/admin/src/pages/reports/GuestReportPage.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<script setup>
import { ref } from 'vue'
import ReportsTab from '@/components/reports/ReportsTab.vue'
</script>

<template>
<div class="container">
<ReportsTab activeTab="Guests" />
</div>
</template>
78 changes: 78 additions & 0 deletions web/admin/src/pages/reports/ReportsDashboardPage.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<script setup>
import { ref, onBeforeMount } from 'vue'
import ReportsTab from '@/components/reports/ReportsTab.vue'
import { collection, getCountFromServer, getFirestore, doc, addDoc, query, where, setDoc } from 'firebase/firestore'
const db = getFirestore()
const numTotalGuests = ref(0)
const numTotalVolunteers = ref(0)
const numTotalDrivers = ref(0)
onBeforeMount( async ()=>{
const guestSnap = await getCountFromServer(collection(db, 'guestprofile'))
numTotalGuests.value = guestSnap.data().count
const vSnap = await getCountFromServer(query(collection(db, 'volunteerprofilestate'),
where('status', '==', 'active')))
numTotalVolunteers.value = vSnap.data().count
const dSnap = await getCountFromServer(query(collection(db, 'volunteerprofilestate'),
where('status', '==', 'active'),
where('isDriver', '==', true),
where('isApprovedDriver', '==', true)
))
numTotalDrivers.value = dSnap.data().count
})
</script>

<template>
<div class="container">
<ReportsTab activeTab="Dashboard" />

<div class="row my-3">
<div class="col-4">
<div class="card h-100">
<div class="card-body">
<div class="row">
<div class="col"><h5 class="card-title">Total Guests</h5></div>
<div class="col-2"><i class="bi bi-person fs-3"></i></div>
</div >
<h1 class="text-center">{{ numTotalGuests }}</h1>
</div>
</div >
</div >

<div class="col-4">
<div class="card h-100">
<div class="card-body">
<div class="row">
<div class="col"><h5 class="card-title">Total Volunteers</h5></div>
<div class="col-2"><i class="bi bi-person-fill fs-3"></i></div>
</div >
<h1 class="text-center">{{ numTotalVolunteers }}</h1>
</div>
</div >
</div >

<div class="col-4">
<div class="card h-100">
<div class="card-body">
<div class="row">
<div class="col"><h5 class="card-title">Total Drivers</h5></div>
<div class="col-2"><i class="bi bi-car-front fs-3"></i></div>
</div >
<h1 class="text-center">{{ numTotalDrivers }}</h1>
</div>
</div >
</div >


</div>



</div>
</template>
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<script setup>
import ReportsTab from '@/components/reports/ReportsTab.vue'
</script>

<template>
<div class="container">
<ReportsTab activeTab="Volunteers" />

<h1>Reporting - Monthly Volunteer Hours</h1>
<h2>October 2023</h2>
<table class="table table-striped">
Expand Down
17 changes: 16 additions & 1 deletion web/admin/src/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,22 @@ const routes = [
{
path: '/admin/reports',
name: 'AdminReportPage',
component: () => import('@/pages/AdminReportPage.vue'),
props: true,
component: () => import('@/pages/reports/ReportsDashboardPage.vue'),
meta: { requiresLogin: true, admin: true },
},
{
path: '/admin/reports/guest',
name: 'GuestReportPage',
props: true,
component: () => import('@/pages/reports/GuestReportPage.vue'),
meta: { requiresLogin: true, admin: true },
},
{
path: '/admin/reports/volunteers',
name: 'VolunteerReportPage',
props: true,
component: () => import('@/pages/reports/VolunteersReportPage.vue'),
meta: { requiresLogin: true, admin: true },
},
{
Expand Down
12 changes: 10 additions & 2 deletions web/app/env.demo
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Specifies whether to run against the local firebase emulator
VITE_RUN_LOCAL=true
VITE_APP_NAV_NAME=DEMO

# Inserted into the index.html file for the organization
VITE_ORGANIZATION_NAME=Demo
VITE_ORGANIZATION_FAVICON="/favicon.ico"

VITE_APP_NAV_NAME=DEMO
VITE_PROJECT_LONG_NAME="Food Pantry App Demo"
VITE_DELIVERY_MESSAGE="Extended message here.<br>It can have HTML in it."
VITE_DELIVERY_AREA_NAMES="Your Township Name"
Expand All @@ -15,9 +20,12 @@ VITE_FB_APPID=""
VITE_FB_MEASUREMENTID=""
VITE_OFFICE_PHONE=555-555-5555
VITE_GUEST_PHONE=555-555-5555
VITE_ADMIN_APP_NAV_IMG="/ncfb-logo.png"
VITE_ADMIN_APP_NAV_NAME="FPA-Admin"
VITE_ADMIN_PROJECT_LONG_NAME="FPA-Admin"
VITE_ADMIN_FRONTLINE="Additional message here."

# Link to the volunteer portal, leave blank if you are not running one.
VITE_VOLUNTEER_PORTAL_URL="http://localhost:5174"

# Flag to allow guests to register/login
VITE_ENABLE_GUEST_LOGIN=false
2 changes: 1 addition & 1 deletion web/app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en" data-bs-theme="auto">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<link rel="icon" href="%VITE_ORGANIZATION_FAVICON%" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>%VITE_PROJECT_LONG_NAME%</title>
</head>
Expand Down
Binary file removed web/app/public/favicon.ico
Binary file not shown.
17 changes: 6 additions & 11 deletions web/app/src/components/AppNavigation.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script setup>
import ThemeChooser from '@/components/ThemeChooser.vue'
import { getAuth, signOut } from 'firebase/auth'
import { config } from '@/config'
import { useRouter } from 'vue-router'
Expand Down Expand Up @@ -32,23 +33,18 @@ const signOutClick = () => {
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mb-2 mb-lg-0">

<!--
<li class="nav-item">
<a class="nav-link" :href="config.DeliveryFormURL">Delivery</a>
</li>
-->
<li class="nav-item">
<li class="nav-item" v-if="!user.isLoggedIn">
<a class="nav-link" :href="config.VolunteerPortalURL">Volunteer Portal</a>
</li>
<li class="nav-item" v-if="user.isLoggedIn">
<router-link class="nav-link" :to="{name:'AboutPage'}">Profile</router-link>
</li>
<li class="nav-item">
<router-link class="nav-link" :to="{name:'AboutPage'}">About</router-link>
</li>


</ul>
<ul class="navbar-nav ms-auto mb-2 mb-lg-0">

<li><ThemeChooser></ThemeChooser></li>
<div class="d-flex" v-if="config.EnableGuestLogin === 'true'">
<template v-if="user && user.isLoggedIn === true">
<span class="nav-item py-2"><i class="bi bi-person-fill"></i> {{ user.data && user.data.displayName }}</span>
Expand All @@ -58,7 +54,6 @@ const signOutClick = () => {
<router-link class="btn btn-primary mx-2" :to="{name:'LoginPage'}" role="button">Login</router-link>
</template>
</div>

</ul>
</div>
</div>
Expand Down
56 changes: 23 additions & 33 deletions web/app/src/components/ForgotPasswordForm.vue
Original file line number Diff line number Diff line change
@@ -1,18 +1,38 @@
<script setup>
import { ref } from 'vue'
const props = defineProps({
showSuccess: Boolean,
successMessage: String,
showError: Boolean,
errorMessage: String,
})
const emit = defineEmits(['clicked'])
const valid = ref(false)
const email = ref("")
const submit = () => {
emit('clicked', email.value)
}
</script>

<template>
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">Forgot Password</div>
<h6 class="card-subtitle m-3 text-muted">Enter your email address and a link to reset your password will be emailed to you.</h6>
<div class="card-text">
<template v-if="showSuccess"><div class="text-bg-success">{{successMessage}}</div></template>
<template v-if="showError"><div class="text-bg-danger" >{{errorMessage}}</div></template>
<template v-if="showSuccess"><div class="text-bg-success p-3">{{successMessage}}</div></template>
<template v-if="showError"><div class="text-bg-danger p-3">{{errorMessage}}</div></template>
<div class="card-body">
<form @submit.prevent="submit">
<div class="row my-3">
<label class="form-label">Email</label>
<div class="col-sm-10">
<input type="email" class="form-control" v-model="email" :rules="[rules.required, rules.emailRule]" autocomplete="username" placeholder="name@example.com">
<input type="email" class="form-control" v-model="email" autocomplete="email" placeholder="name@example.com">
</div>
</div>
<div class="row my-3">
Expand All @@ -27,33 +47,3 @@
</div>
</div>
</template>

<script>
export default {
name: 'ForgotPasswordForm',
props: [
"showSuccess",
"successMessage",
"showError",
"errorMessage",
],
data() {
return {
valid: false,
email: "",
rules: {
required: value => !!value || 'Required.',
emailRule: v => !v || /.+@.+/.test(v) || 'Invalid Email Address'
}
}
},
methods: {
submit() {
this.$emit('clicked', this.email);
}
}
};
</script>

<style></style>
Loading

0 comments on commit 4629654

Please sign in to comment.