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
48 changes: 48 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: CI Pipeline

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
backend:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install dependencies
run: |
cd backend
pip install -r requirements.txt

- name: Run Django checks
run: |
cd backend
python manage.py check

frontend:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18

- name: Install and Build
run: |
cd frontend
npm install
npm run build
12 changes: 5 additions & 7 deletions frontend/src/App.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getTickets, updateTicket, getStats } from "./services/api";
import { useEffect, useState } from "react";
import { useEffect, useState, useCallback } from "react";
import TicketForm from "./components/TicketForm";


Expand All @@ -18,7 +18,7 @@ function App() {


// Load tickets from backend with filters + search
const loadTickets = async () => {
const loadTickets = useCallback(async () => {
let query = "?";

// Add filters if selected
Expand All @@ -29,8 +29,7 @@ function App() {

const data = await getTickets(query);
setTickets(data);
};

}, [categoryFilter, priorityFilter, statusFilter, searchTerm]);
/**
* Load dashboard stats from backend
*/
Expand All @@ -48,9 +47,8 @@ function App() {
// Reload tickets whenever filter changes
useEffect(() => {
loadTickets();
loadStats();
}, [categoryFilter, priorityFilter, statusFilter, searchTerm]);

}, [loadTickets]);

return (
<div style={{
maxWidth: "800px",
Expand Down