Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/bbqs-bot-gsheet-to-kg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,16 @@ jobs:
python scripts/process_sheet_and_save.py \
--spreadsheet-id "${SHEET_ID}" \
--sheet-name "${SHEET_NAME}" \
--csv-out data/sheets/output_normalized.csv \
--json-out data/sheets/output_kg.jsonl \
--csv-out ui/public/output_normalized.csv \
--json-out ui/public/output_kg.jsonl \
--sa-key-file sa_key.json
# Mapping is ON by default; to disable add: --no-llm-mapping
# To choose a specific model add: --openrouter-model openai/gpt-4o-mini

- name: Verify outputs exist
run: |
test -f "data/sheets/output_normalized.csv" || (echo " CSV missing" && exit 1)
test -f "data/sheets/output_kg.jsonl" || (echo " NDJSON missing" && exit 1)
test -f "ui/public/output_normalized.csv" || (echo " CSV missing" && exit 1)
test -f "ui/public/output_kg.jsonl" || (echo " NDJSON missing" && exit 1)
echo " Outputs present"

- name: Commit generated files
Expand All @@ -81,7 +81,7 @@ jobs:
GIT_COMMITTER_NAME: github-actions[bot]
GIT_COMMITTER_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com
run: |
git add data/sheets/output_normalized.csv data/sheets/output_kg.jsonl
git add ui/public/output_normalized.csv ui/public/output_kg.jsonl
if ! git diff --cached --quiet; then
git commit -m "chore: update from Google Sheets → CSV (mapped) + NDJSON (KG)"
git push
Expand Down
65 changes: 16 additions & 49 deletions .github/workflows/deploy_ui.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
name: Deploy UI to GitHub Pages
name: Deploy to GitHub Pages

on:
push:
branches: [ master ]
branches: [ main, use-public-directory ]
pull_request:
branches: [ master ]
types: [closed]
branches: [ main ]

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Build job
build:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.merged == true)
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -30,67 +28,36 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
cache-dependency-path: 'ui/package-lock.json'

- name: Install dependencies
run: npm ci
working-directory: ./ui
- name: Set NEXT_PUBLIC_BASE_PATH
run: echo "NEXT_PUBLIC_BASE_PATH=/bbqs-kg/ui" >> $GITHUB_ENV

- name: Setup environment
run: |
# Create .env.local in the ui directory
cd ui
if [ ! -f .env.local ]; then
echo "DATA_PATH=../data/sheets/output_kg.jsonl" > .env.local
fi
- name: Install dependencies
run: npm install -f
working-directory: ui

- name: Copy data for static build
run: |
mkdir -p public
cp ../data/sheets/output_kg.jsonl public/data.jsonl
working-directory: ./ui
cp ../data/sheets/output_kg.jsonl public/output_kg.jsonl
working-directory: ui

- name: Build with Next.js
- name: Build static site with Next.js
run: npm run build
working-directory: ./ui
env:
NODE_ENV: production

- name: List build output
run: |
echo "Build output contents:"
ls -la out/
echo "Static files:"
find out/ -name "*.html" -o -name "*.css" -o -name "*.js" | head -10
working-directory: ./ui

- name: Copy data to build output
run: |
# Copy the data file to the build output directory
cp public/data.jsonl out/data.jsonl
echo "Data file copied to build output:"
ls -la out/data.jsonl
working-directory: ./ui

- name: Setup Pages
uses: actions/configure-pages@v4
working-directory: ui

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload the 'out' directory from the ui folder
path: './ui/out'
path: ui/out

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/master'
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
uses: actions/deploy-pages@v4
146 changes: 0 additions & 146 deletions ui/app/api/data/route.ts

This file was deleted.

5 changes: 1 addition & 4 deletions ui/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import type { Metadata } from 'next'
import { Inter } from 'next/font/google'
import './globals.css'

const inter = Inter({ subsets: ['latin'] })

export const metadata: Metadata = {
title: 'The People of BBQS - Knowledge Graph',
description: 'Explore the expertise and knowledge of BBQS community members',
Expand All @@ -16,7 +13,7 @@ export default function RootLayout({
}) {
return (
<html lang="en">
<body className={inter.className}>{children}</body>
<body className="font-sans">{children}</body>
</html>
)
}
17 changes: 3 additions & 14 deletions ui/components/CommunityManager.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';

import { useMemo, useState } from 'react';
import { BookOpen, Clock, ExternalLink, Eye, Edit, ChevronLeft, ChevronRight, X } from 'lucide-react';
import { BookOpen, Eye, ChevronLeft, ChevronRight, X } from 'lucide-react';
import { CommunityMember } from '@/lib/types';
import { useFilters } from '@/contexts/FilterContext';

Expand Down Expand Up @@ -51,26 +51,15 @@ export default function CommunityMembersList({ materials }: CommunityMembersList
// Reset to first page when filters change
useMemo(() => {
setCurrentPage(1);
}, [filters.searchTerm, filters.selectedQuadrants, filters.selectedCategories]);
}, [filters.searchTerm, filters.selectedCategories]);

// Calculate pagination
const totalPages = Math.ceil(filteredMaterials.length / itemsPerPage);
const startIndex = (currentPage - 1) * itemsPerPage;
const endIndex = startIndex + itemsPerPage;
const currentMaterials = filteredMaterials.slice(startIndex, endIndex);

const getTypeIcon = (type: string) => {
switch (type.toLowerCase()) {
case 'hands-on tutorial / notebooks':
return <BookOpen className="w-4 h-4" />;
case 'course':
return <BookOpen className="w-4 h-4" />;
case 'workshop':
return <BookOpen className="w-4 h-4" />;
default:
return <BookOpen className="w-4 h-4" />;
}
};


return (
<div>
Expand Down
9 changes: 1 addition & 8 deletions ui/contexts/FilterContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ import { createContext, useContext, useState, ReactNode } from 'react';

interface FilterState {
searchTerm: string;
selectedQuadrants: string[];
selectedCategories: string[];
}

interface FilterContextType {
filters: FilterState;
setSearchTerm: (term: string) => void;
setSelectedQuadrants: (quadrants: string[]) => void;
setSelectedCategories: (categories: string[]) => void;
clearAllFilters: () => void;
}
Expand All @@ -21,7 +19,6 @@ const FilterContext = createContext<FilterContextType | undefined>(undefined);
export function FilterProvider({ children }: { children: ReactNode }) {
const [filters, setFilters] = useState<FilterState>({
searchTerm: '',
selectedQuadrants: [],
selectedCategories: [],
});

Expand All @@ -31,9 +28,7 @@ export function FilterProvider({ children }: { children: ReactNode }) {



const setSelectedQuadrants = (quadrants: string[]) => {
setFilters(prev => ({ ...prev, selectedQuadrants: quadrants }));
};


const setSelectedCategories = (categories: string[]) => {
setFilters(prev => ({ ...prev, selectedCategories: categories }));
Expand All @@ -42,7 +37,6 @@ export function FilterProvider({ children }: { children: ReactNode }) {
const clearAllFilters = () => {
setFilters({
searchTerm: '',
selectedQuadrants: [],
selectedCategories: [],
});
};
Expand All @@ -52,7 +46,6 @@ export function FilterProvider({ children }: { children: ReactNode }) {
value={{
filters,
setSearchTerm,
setSelectedQuadrants,
setSelectedCategories,
clearAllFilters,
}}
Expand Down
Loading
Loading