diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 97a1a1d..d11f459 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,19 +9,19 @@ jobs: build: permissions: id-token: write # This is required for requesting the JWT - runs-on: ubuntu-latest + runs-on: ubuntu-24.04-arm steps: - name: Checkout code uses: actions/checkout@v3 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + # - name: Set up Docker Buildx + # uses: docker/setup-buildx-action@v1 - name: configure aws credentials uses: aws-actions/configure-aws-credentials@v4 with: - role-to-assume: arn:aws:iam::654654236858:role/GithubActions + role-to-assume: ${{ secrets.ACTIONS_ROLE_ARN }} role-session-name: GitHub_to_AWS_via_FederatedOIDC aws-region: us-east-2 @@ -31,10 +31,10 @@ jobs: - name: Build and Push Docker image env: - ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry}} - REPOSITORY: abide-connect - IMAGE_TAG: ${{ github.sha}} - DATABASE_URL: "file:./prisma/dev.db" + ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} + REPOSITORY: ${{ vars.REPOSITORY }} + IMAGE_TAG: ${{ github.sha }} + DATABASE_URL: 'file:./dev.db' run: | - docker buildx build --output type=image,push=true --platform linux/arm64 -t $ECR_REGISTRY/$REPOSITORY:$IMAGE_TAG . - docker buildx build --output type=image,push=true --platform linux/arm64 -t $ECR_REGISTRY/$REPOSITORY:prod . + docker build --output type=image,push=true --platform linux/arm64 -t $ECR_REGISTRY/$REPOSITORY:$IMAGE_TAG . + docker build --output type=image,push=true --platform linux/arm64 -t $ECR_REGISTRY/$REPOSITORY:prod . diff --git a/app/app.config.ts b/app/app.config.ts index 62d3d39..5dfc651 100644 --- a/app/app.config.ts +++ b/app/app.config.ts @@ -1 +1 @@ -export default defineAppConfig({}); \ No newline at end of file +export default defineAppConfig({}) diff --git a/app/app.vue b/app/app.vue index 2bc0562..5acf3c1 100644 --- a/app/app.vue +++ b/app/app.vue @@ -4,4 +4,4 @@ - \ No newline at end of file + diff --git a/app/components/event/Editor.vue b/app/components/event/Editor.vue index 3b9daf5..e47ee29 100644 --- a/app/components/event/Editor.vue +++ b/app/components/event/Editor.vue @@ -1,20 +1,20 @@ \ No newline at end of file + diff --git a/app/components/event/Modal.vue b/app/components/event/Modal.vue index 0cd88d2..b658734 100644 --- a/app/components/event/Modal.vue +++ b/app/components/event/Modal.vue @@ -1,57 +1,40 @@ \ No newline at end of file + diff --git a/app/components/event/Tile.vue b/app/components/event/Tile.vue index 576600e..33b365f 100644 --- a/app/components/event/Tile.vue +++ b/app/components/event/Tile.vue @@ -5,22 +5,23 @@ defineProps<{ subtitle?: string }>() + \ No newline at end of file + diff --git a/app/components/map/Interactive.client.vue b/app/components/map/Interactive.client.vue index 7b1dbca..f2ae87d 100644 --- a/app/components/map/Interactive.client.vue +++ b/app/components/map/Interactive.client.vue @@ -4,19 +4,19 @@ :center="center" :zoom="zoom" :attribution-control="false" - > - + > + + /> diff --git a/app/components/nav/Bottom.vue b/app/components/nav/Bottom.vue index e4dab35..9cb1226 100644 --- a/app/components/nav/Bottom.vue +++ b/app/components/nav/Bottom.vue @@ -1,41 +1,42 @@ + diff --git a/app/components/nav/SecondaryTop.vue b/app/components/nav/SecondaryTop.vue index f36e207..fd60c29 100644 --- a/app/components/nav/SecondaryTop.vue +++ b/app/components/nav/SecondaryTop.vue @@ -3,21 +3,26 @@ const router = useRouter() diff --git a/app/layouts/default.vue b/app/layouts/default.vue index 3e9af13..d3f49d0 100644 --- a/app/layouts/default.vue +++ b/app/layouts/default.vue @@ -2,9 +2,9 @@ diff --git a/app/layouts/secondary.vue b/app/layouts/secondary.vue index 62c390b..eae5c8c 100644 --- a/app/layouts/secondary.vue +++ b/app/layouts/secondary.vue @@ -1,7 +1,7 @@ \ No newline at end of file +
+ + + +
+ diff --git a/app/lib/relativeFetch.ts b/app/lib/relativeFetch.ts index b6e556b..6eb5dfb 100644 --- a/app/lib/relativeFetch.ts +++ b/app/lib/relativeFetch.ts @@ -4,8 +4,9 @@ import { useFetch } from '#app' export const relativeFetch = ((url: string, opts?: any) => { try { if (url.startsWith('http')) url = new URL(url).pathname - } catch { + } + catch { // ignore invalid URLs } return useFetch(url, opts) -}) as any \ No newline at end of file +}) as any diff --git a/app/middleware/auth.ts b/app/middleware/auth.ts index 2997b5d..4aff9c2 100644 --- a/app/middleware/auth.ts +++ b/app/middleware/auth.ts @@ -4,16 +4,17 @@ export default defineNuxtRouteMiddleware(async (to) => { try { const data = await $fetch('/api/auth/get-session', { - cache: 'no-store', // ← forces fresh request every time + cache: 'no-store', // ← forces fresh request every time headers: { - 'Cache-Control': 'no-cache' - } + 'Cache-Control': 'no-cache', + }, }) - + if (!data?.session) { return navigateTo('/auth/login') } - } catch { + } + catch { return navigateTo('/auth/login') } -}) \ No newline at end of file +}) diff --git a/app/pages/admin/donations.vue b/app/pages/admin/donations.vue index 4a85211..fac075c 100644 --- a/app/pages/admin/donations.vue +++ b/app/pages/admin/donations.vue @@ -5,7 +5,7 @@ definePageMeta({ layout: 'secondary', }) -//Backend +// Backend interface DonationFund { id: string name: string @@ -17,30 +17,30 @@ interface DonationFund { } const { data: fundsData, refresh } = await useAsyncData( 'donations', - () => $fetch('/api/admin/donations') + () => $fetch('/api/admin/donations'), ) const funds = computed(() => fundsData.value ?? []) -//Make dates pretty +// Make dates pretty function formatShort(dateStr: string) { if (!dateStr) return '' const d = new Date(dateStr) if (isNaN(d.getTime())) return dateStr const mm = String(d.getMonth() + 1).padStart(2, '0') - const dd = String(d.getDate()+1).padStart(2, '0') + const dd = String(d.getDate() + 1).padStart(2, '0') const yy = String(d.getFullYear()).slice(-2) return `${mm}/${dd}/${yy}` } -//New Fund Modal States +// New Fund Modal States const open = ref(false) const fundName = ref('') const startDate = ref('') -const endDate = ref('') +const endDate = ref('') const image = ref(null) const link = ref('') -//Editing Fund Modal States +// Editing Fund Modal States const editOpen = ref(false) const editFundName = ref('') const editStartDate = ref('') @@ -50,39 +50,37 @@ const editLink = ref('') const editingFund = ref(null) const editImagePrevies = ref('') - -//New Fund Save +// New Fund Save async function saveFund(close: () => void) { - //create the new fund on the backend + // create the new fund on the backend const newDonation = await $fetch<{ id: string }>('/api/admin/donations', { - method: 'POST', - body: { - name: fundName.value, - link: link.value, - startDate: startDate.value, - endDate: endDate.value, - }, -}) - //add the image if it has one - if (image.value) { - const formData = new FormData() - formData.append('file', image.value) - await $fetch(`/api/admin/donations/${newDonation.id}/image`, { - method: 'POST', - body: formData, - }) - } - await refresh() - fundName.value = '' - startDate.value = '' - endDate.value = '' - image.value = null - link.value = '' - close() + method: 'POST', + body: { + name: fundName.value, + link: link.value, + startDate: startDate.value, + endDate: endDate.value, + }, + }) + // add the image if it has one + if (image.value) { + const formData = new FormData() + formData.append('file', image.value) + await $fetch(`/api/admin/donations/${newDonation.id}/image`, { + method: 'POST', + body: formData, + }) + } + await refresh() + fundName.value = '' + startDate.value = '' + endDate.value = '' + image.value = null + link.value = '' + close() } - -//Editing Fund Modal +// Editing Fund Modal async function openEdit(fund: DonationFund) { editingFund.value = fund editFundName.value = fund.name @@ -92,9 +90,8 @@ async function openEdit(fund: DonationFund) { editImagePrevies.value = fund.imageUrl ?? '' editImage.value = null editOpen.value = true - } -//Editing Fund Save +// Editing Fund Save async function saveEdit(close: () => void) { if (!editingFund.value) return await $fetch(`/api/admin/donations/${editingFund.value.id}`, { @@ -107,7 +104,7 @@ async function saveEdit(close: () => void) { imageUrl: editingFund.value?.imageUrl, }, }) - //add the image if it has one + // add the image if it has one if (editImage.value) { const formData = new FormData() formData.append('file', editImage.value) @@ -122,7 +119,7 @@ async function saveEdit(close: () => void) { close() } -//delete Fund +// delete Fund async function deleteFund(id: string) { await $fetch(`/api/admin/donations/${id}`, { method: 'DELETE', @@ -130,117 +127,218 @@ async function deleteFund(id: string) { await refresh() editOpen.value = false } - - + \ No newline at end of file + + + + + + + diff --git a/app/pages/admin/index.vue b/app/pages/admin/index.vue index df65126..5c63229 100644 --- a/app/pages/admin/index.vue +++ b/app/pages/admin/index.vue @@ -1,130 +1,143 @@ \ No newline at end of file +
+

+ {{ kpi.label }} +

+

+ {{ kpi.value }} +

+
+
+
+ + + +
+ +
+ +
+ + {{ feature.label }} + + + + {{ feature.description }} + +
+ + Manage → + +
+
+
+ + diff --git a/app/pages/admin/volunteer-logs/index.vue b/app/pages/admin/volunteer-logs/index.vue index 6b64035..16a1587 100644 --- a/app/pages/admin/volunteer-logs/index.vue +++ b/app/pages/admin/volunteer-logs/index.vue @@ -1,74 +1,72 @@ -