diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 2b00a0a..5ad9fe9 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -31,7 +31,7 @@ import SideBar from "./components/SideBar.vue"; max-width: 1280px; min-width: 800px; margin: 10px auto; - height: 80vh; + min-height: 84vh; } #display-content { diff --git a/frontend/src/api.js b/frontend/src/api.js index b79d2a0..83f8c50 100644 --- a/frontend/src/api.js +++ b/frontend/src/api.js @@ -14,6 +14,16 @@ class Api { // } // console.log("DEBUG: API - Fetched Client Details: ", data); const data = DataUtils.dummyClientData; + console.log("DEBUG: API - getClientDetails result: ", data); + return data; + } + + static async getJobDetails() { + const data = DataUtils.dummyJobData.map((job) => ({ + ...job, + stepProgress: DataUtils.calculateStepProgress(job.steps), + })); + console.log("DEBUG: API - getJobDetails result: ", data); return data; } diff --git a/frontend/src/components/DataTable.vue b/frontend/src/components/DataTable.vue index 1a182b8..4243cd1 100644 --- a/frontend/src/components/DataTable.vue +++ b/frontend/src/components/DataTable.vue @@ -1,41 +1,52 @@ - + + diff --git a/frontend/src/components/pages/Jobs.vue b/frontend/src/components/pages/Jobs.vue index 04bf004..800f172 100644 --- a/frontend/src/components/pages/Jobs.vue +++ b/frontend/src/components/pages/Jobs.vue @@ -1,9 +1,29 @@ - diff --git a/frontend/src/globalSettings.js b/frontend/src/globalSettings.js new file mode 100644 index 0000000..f15fe39 --- /dev/null +++ b/frontend/src/globalSettings.js @@ -0,0 +1,5 @@ +import Aura from "@primeuix/themes/aura"; + +export const globalSettings = { + theme: Aura, +}; diff --git a/frontend/src/main.js b/frontend/src/main.js index 844fcbf..bcc052d 100644 --- a/frontend/src/main.js +++ b/frontend/src/main.js @@ -3,5 +3,16 @@ import "./style.css"; import App from "./App.vue"; import router from "./router"; import PrimeVue from "primevue/config"; +import { globalSettings } from "./globalSettings"; -createApp(App).use(router).use(PrimeVue).mount("#custom-ui-app"); +createApp(App) + .use(router) + .use(PrimeVue, { + theme: { + options: { + darkModeSelector: false, + }, + preset: globalSettings.theme, + }, + }) + .mount("#custom-ui-app"); diff --git a/frontend/src/stores/modal.js b/frontend/src/stores/modal.js new file mode 100644 index 0000000..e9ad720 --- /dev/null +++ b/frontend/src/stores/modal.js @@ -0,0 +1,36 @@ +import { defineStore } from "pinia"; + +export const useModalsStore = defineStore("modals", { + state: () => ({ + isCreateClientOpen: false, + isCreateInvoiceOpen: false, + isCreateJobOpen: false, + isCreateEstimateOpen: false, + }), + actions: { + openCreateClient() { + this.isCreateClientOpen = true; + }, + closeCreateClient() { + this.isCreateClientOpen = false; + }, + openCreateInvoice() { + this.isCreateInvoiceOpen = true; + }, + closeCreateInvoice() { + this.isCreateInvoiceOpen = false; + }, + openCreateJob() { + this.isCreateJobOpen = true; + }, + closeCreateJob() { + this.isCreateJobOpen = false; + }, + openCreateEstimate() { + this.isCreateEstimateOpen = true; + }, + closeCreateEstimate() { + this.isCreateEstimateOpen = false; + }, + }, +}); diff --git a/frontend/src/utils.js b/frontend/src/utils.js index 59c2338..ac18662 100644 --- a/frontend/src/utils.js +++ b/frontend/src/utils.js @@ -5,29 +5,39 @@ class DataUtils { // return clients.map((client) => [clientName, client.] // } + static calculateStepProgress(steps) { + if (!steps || steps.length === 0) return "0/0"; + const completedSteps = steps.filter((step) => step.status === "completed").length; + return `${completedSteps}/${steps.length}`; + } + static dummyClientData = [ { + id: 1, fullName: "John Doe 123 Lane Dr Cityville, MN", appointmentScheduled: "completed", - estimateSent: "pending", + estimateSent: "in progress", paymentReceived: "not started", jobStatus: "not started", }, { + id: 2, fullName: "Jane Smith 456 Oak St Townsville, CA", - appointmentScheduled: "pending", + appointmentScheduled: "in progress", estimateSent: "not started", paymentReceived: "not started", jobStatus: "not started", }, { + id: 3, fullName: "Mike Johnson 789 Pine Rd Villagetown, TX", appointmentScheduled: "completed", estimateSent: "completed", - paymentReceived: "pending", + paymentReceived: "in progress", jobStatus: "in progress", }, { + id: 4, fullName: "Emily Davis 321 Maple Ave Hamlet, FL", appointmentScheduled: "not started", estimateSent: "not started", @@ -35,12 +45,463 @@ class DataUtils { jobStatus: "not started", }, { + id: 5, fullName: "David Wilson 654 Cedar Blvd Borough, NY", appointmentScheduled: "completed", estimateSent: "completed", paymentReceived: "completed", jobStatus: "completed", }, + // create 30 more dummy entries + { + id: 6, + fullName: "Sarah Brown 987 Birch Ln Metropolis, IL", + appointmentScheduled: "in progress", + estimateSent: "not started", + paymentReceived: "not started", + jobStatus: "not started", + }, + { + id: 7, + fullName: "Chris Taylor 159 Spruce Ct Capital City, WA", + appointmentScheduled: "completed", + estimateSent: "completed", + paymentReceived: "in progress", + jobStatus: "in progress", + }, + { + id: 8, + fullName: "Amanda Martinez 753 Willow Dr Smalltown, OH", + appointmentScheduled: "not started", + estimateSent: "not started", + paymentReceived: "not started", + jobStatus: "not started", + }, + { + id: 9, + fullName: "Joshua Anderson 852 Aspen Rd Bigcity, NJ", + appointmentScheduled: "completed", + estimateSent: "in progress", + paymentReceived: "not started", + jobStatus: "not started", + }, + { + id: 10, + fullName: "Olivia Thomas 147 Cypress St Uptown, GA", + appointmentScheduled: "completed", + estimateSent: "completed", + paymentReceived: "completed", + jobStatus: "completed", + }, + { + id: 11, + fullName: "Daniel Jackson 369 Fir Ave Downtown, MI", + appointmentScheduled: "in progress", + estimateSent: "not started", + paymentReceived: "not started", + jobStatus: "not started", + }, + { + id: 12, + fullName: "Sophia White 258 Palm Blvd Riverside, AZ", + appointmentScheduled: "completed", + estimateSent: "completed", + paymentReceived: "in progress", + jobStatus: "in progress", + }, + { + id: 13, + fullName: "Matthew Harris 951 Olive Ln Seaside, OR", + appointmentScheduled: "not started", + estimateSent: "not started", + paymentReceived: "not started", + jobStatus: "not started", + }, + { + id: 14, + fullName: "Isabella Clark 753 Magnolia Ct Hilltown, SC", + appointmentScheduled: "completed", + estimateSent: "in progress", + paymentReceived: "not started", + jobStatus: "not started", + }, + { + id: 15, + fullName: "Andrew Lewis 357 Dogwood Dr Lakeview, VT", + appointmentScheduled: "completed", + estimateSent: "completed", + paymentReceived: "completed", + jobStatus: "completed", + }, + { + id: 16, + fullName: "Mia Robinson 159 Cherry St Forestville, KY", + appointmentScheduled: "in progress", + estimateSent: "not started", + paymentReceived: "not started", + jobStatus: "not started", + }, + { + id: 17, + fullName: "Ethan Walker 456 Walnut Rd Meadowbrook, ND", + appointmentScheduled: "completed", + estimateSent: "completed", + paymentReceived: "in progress", + jobStatus: "in progress", + }, + { + id: 18, + fullName: "Ava Hall 123 Poplar Ave Greenfield, MS", + appointmentScheduled: "not started", + estimateSent: "not started", + paymentReceived: "not started", + jobStatus: "not started", + }, + ]; + + static dummyJobData = [ + { + jobId: "JOB001", + foreman: "Mike Thompson", + crew: ["Worker A", "Worker B"], + address: "123 Lane Dr, Cityville, MN", + customer: "John Doe", + overAllStatus: "in progress", + completionDate: null, + steps: [ + { stepName: "Materials Ordered", status: "completed" }, + { stepName: "Materials Received", status: "completed" }, + { stepName: "Permits", status: "completed" }, + { stepName: "Locate Utilities", status: "in progress" }, + { stepName: "Foreman Assigned", status: "completed" }, + { stepName: "Crew Assigned", status: "completed" }, + { stepName: "Job Started", status: "not started" }, + { stepName: "Job Completed", status: "not started" }, + ], + }, + { + jobId: "JOB002", + foreman: null, + crew: [], + address: "456 Oak St, Townsville, CA", + customer: "Jane Smith", + overAllStatus: "not started", + completionDate: null, + steps: [ + { stepName: "Materials Ordered", status: "not started" }, + { stepName: "Materials Received", status: "not started" }, + { stepName: "Permits", status: "not started" }, + { stepName: "Locate Utilities", status: "not started" }, + { stepName: "Foreman Assigned", status: "not started" }, + { stepName: "Crew Assigned", status: "not started" }, + { stepName: "Job Started", status: "not started" }, + { stepName: "Job Completed", status: "not started" }, + ], + }, + { + jobId: "JOB003", + foreman: "Sarah Johnson", + crew: ["Worker C", "Worker D", "Worker E"], + address: "789 Pine Rd, Villagetown, TX", + customer: "Mike Johnson", + overAllStatus: "in progress", + completionDate: null, + steps: [ + { stepName: "Materials Ordered", status: "completed" }, + { stepName: "Materials Received", status: "completed" }, + { stepName: "Permits", status: "completed" }, + { stepName: "Locate Utilities", status: "completed" }, + { stepName: "Foreman Assigned", status: "completed" }, + { stepName: "Crew Assigned", status: "completed" }, + { stepName: "Job Started", status: "in progress" }, + { stepName: "Job Completed", status: "not started" }, + ], + }, + { + jobId: "JOB004", + foreman: null, + crew: [], + address: "321 Maple Ave, Hamlet, FL", + customer: "Emily Davis", + overAllStatus: "not started", + completionDate: null, + steps: [ + { stepName: "Materials Ordered", status: "not started" }, + { stepName: "Materials Received", status: "not started" }, + { stepName: "Permits", status: "not started" }, + { stepName: "Locate Utilities", status: "not started" }, + { stepName: "Foreman Assigned", status: "not started" }, + { stepName: "Crew Assigned", status: "not started" }, + { stepName: "Job Started", status: "not started" }, + { stepName: "Job Completed", status: "not started" }, + ], + }, + { + jobId: "JOB005", + foreman: "David Martinez", + crew: ["Worker F", "Worker G"], + address: "654 Cedar Blvd, Borough, NY", + customer: "David Wilson", + overAllStatus: "completed", + completionDate: "2024-10-15", + steps: [ + { stepName: "Materials Ordered", status: "completed" }, + { stepName: "Materials Received", status: "completed" }, + { stepName: "Permits", status: "completed" }, + { stepName: "Locate Utilities", status: "completed" }, + { stepName: "Foreman Assigned", status: "completed" }, + { stepName: "Crew Assigned", status: "completed" }, + { stepName: "Job Started", status: "completed" }, + { stepName: "Job Completed", status: "completed" }, + ], + }, + { + jobId: "JOB006", + foreman: null, + crew: [], + address: "987 Birch Ln, Metropolis, IL", + customer: "Sarah Brown", + overAllStatus: "not started", + completionDate: null, + steps: [ + { stepName: "Materials Ordered", status: "in progress" }, + { stepName: "Materials Received", status: "not started" }, + { stepName: "Permits", status: "not started" }, + { stepName: "Locate Utilities", status: "not started" }, + { stepName: "Foreman Assigned", status: "not started" }, + { stepName: "Crew Assigned", status: "not started" }, + { stepName: "Job Started", status: "not started" }, + { stepName: "Job Completed", status: "not started" }, + ], + }, + { + jobId: "JOB007", + foreman: "Chris Wilson", + crew: ["Worker H", "Worker I"], + address: "159 Spruce Ct, Capital City, WA", + customer: "Chris Taylor", + overAllStatus: "in progress", + completionDate: null, + steps: [ + { stepName: "Materials Ordered", status: "completed" }, + { stepName: "Materials Received", status: "completed" }, + { stepName: "Permits", status: "completed" }, + { stepName: "Locate Utilities", status: "completed" }, + { stepName: "Foreman Assigned", status: "completed" }, + { stepName: "Crew Assigned", status: "completed" }, + { stepName: "Job Started", status: "in progress" }, + { stepName: "Job Completed", status: "not started" }, + ], + }, + { + jobId: "JOB008", + foreman: null, + crew: [], + address: "753 Willow Dr, Smalltown, OH", + customer: "Amanda Martinez", + overAllStatus: "not started", + completionDate: null, + steps: [ + { stepName: "Materials Ordered", status: "not started" }, + { stepName: "Materials Received", status: "not started" }, + { stepName: "Permits", status: "not started" }, + { stepName: "Locate Utilities", status: "not started" }, + { stepName: "Foreman Assigned", status: "not started" }, + { stepName: "Crew Assigned", status: "not started" }, + { stepName: "Job Started", status: "not started" }, + { stepName: "Job Completed", status: "not started" }, + ], + }, + { + jobId: "JOB009", + foreman: "Lisa Anderson", + crew: ["Worker J"], + address: "852 Aspen Rd, Bigcity, NJ", + customer: "Joshua Anderson", + overAllStatus: "in progress", + completionDate: null, + steps: [ + { stepName: "Materials Ordered", status: "completed" }, + { stepName: "Materials Received", status: "completed" }, + { stepName: "Permits", status: "in progress" }, + { stepName: "Locate Utilities", status: "not started" }, + { stepName: "Foreman Assigned", status: "completed" }, + { stepName: "Crew Assigned", status: "completed" }, + { stepName: "Job Started", status: "not started" }, + { stepName: "Job Completed", status: "not started" }, + ], + }, + { + jobId: "JOB010", + foreman: "Robert Thomas", + crew: ["Worker K", "Worker L", "Worker M"], + address: "147 Cypress St, Uptown, GA", + customer: "Olivia Thomas", + overAllStatus: "completed", + completionDate: "2024-10-20", + steps: [ + { stepName: "Materials Ordered", status: "completed" }, + { stepName: "Materials Received", status: "completed" }, + { stepName: "Permits", status: "completed" }, + { stepName: "Locate Utilities", status: "completed" }, + { stepName: "Foreman Assigned", status: "completed" }, + { stepName: "Crew Assigned", status: "completed" }, + { stepName: "Job Started", status: "completed" }, + { stepName: "Job Completed", status: "completed" }, + ], + }, + { + jobId: "JOB011", + foreman: null, + crew: [], + address: "369 Fir Ave, Downtown, MI", + customer: "Daniel Jackson", + overAllStatus: "not started", + completionDate: null, + steps: [ + { stepName: "Materials Ordered", status: "in progress" }, + { stepName: "Materials Received", status: "not started" }, + { stepName: "Permits", status: "not started" }, + { stepName: "Locate Utilities", status: "not started" }, + { stepName: "Foreman Assigned", status: "not started" }, + { stepName: "Crew Assigned", status: "not started" }, + { stepName: "Job Started", status: "not started" }, + { stepName: "Job Completed", status: "not started" }, + ], + }, + { + jobId: "JOB012", + foreman: "Maria White", + crew: ["Worker N", "Worker O"], + address: "258 Palm Blvd, Riverside, AZ", + customer: "Sophia White", + overAllStatus: "in progress", + completionDate: null, + steps: [ + { stepName: "Materials Ordered", status: "completed" }, + { stepName: "Materials Received", status: "completed" }, + { stepName: "Permits", status: "completed" }, + { stepName: "Locate Utilities", status: "completed" }, + { stepName: "Foreman Assigned", status: "completed" }, + { stepName: "Crew Assigned", status: "completed" }, + { stepName: "Job Started", status: "in progress" }, + { stepName: "Job Completed", status: "not started" }, + ], + }, + { + jobId: "JOB013", + foreman: null, + crew: [], + address: "951 Olive Ln, Seaside, OR", + customer: "Matthew Harris", + overAllStatus: "not started", + completionDate: null, + steps: [ + { stepName: "Materials Ordered", status: "not started" }, + { stepName: "Materials Received", status: "not started" }, + { stepName: "Permits", status: "not started" }, + { stepName: "Locate Utilities", status: "not started" }, + { stepName: "Foreman Assigned", status: "not started" }, + { stepName: "Crew Assigned", status: "not started" }, + { stepName: "Job Started", status: "not started" }, + { stepName: "Job Completed", status: "not started" }, + ], + }, + { + jobId: "JOB014", + foreman: "James Clark", + crew: ["Worker P"], + address: "753 Magnolia Ct, Hilltown, SC", + customer: "Isabella Clark", + overAllStatus: "in progress", + completionDate: null, + steps: [ + { stepName: "Materials Ordered", status: "completed" }, + { stepName: "Materials Received", status: "completed" }, + { stepName: "Permits", status: "in progress" }, + { stepName: "Locate Utilities", status: "not started" }, + { stepName: "Foreman Assigned", status: "completed" }, + { stepName: "Crew Assigned", status: "completed" }, + { stepName: "Job Started", status: "not started" }, + { stepName: "Job Completed", status: "not started" }, + ], + }, + { + jobId: "JOB015", + foreman: "Patricia Lewis", + crew: ["Worker Q", "Worker R", "Worker S"], + address: "357 Dogwood Dr, Lakeview, VT", + customer: "Andrew Lewis", + overAllStatus: "completed", + completionDate: "2024-10-18", + steps: [ + { stepName: "Materials Ordered", status: "completed" }, + { stepName: "Materials Received", status: "completed" }, + { stepName: "Permits", status: "completed" }, + { stepName: "Locate Utilities", status: "completed" }, + { stepName: "Foreman Assigned", status: "completed" }, + { stepName: "Crew Assigned", status: "completed" }, + { stepName: "Job Started", status: "completed" }, + { stepName: "Job Completed", status: "completed" }, + ], + }, + { + jobId: "JOB016", + foreman: null, + crew: [], + address: "159 Cherry St, Forestville, KY", + customer: "Mia Robinson", + overAllStatus: "not started", + completionDate: null, + steps: [ + { stepName: "Materials Ordered", status: "in progress" }, + { stepName: "Materials Received", status: "not started" }, + { stepName: "Permits", status: "not started" }, + { stepName: "Locate Utilities", status: "not started" }, + { stepName: "Foreman Assigned", status: "not started" }, + { stepName: "Crew Assigned", status: "not started" }, + { stepName: "Job Started", status: "not started" }, + { stepName: "Job Completed", status: "not started" }, + ], + }, + { + jobId: "JOB017", + foreman: "Kevin Walker", + crew: ["Worker T", "Worker U"], + address: "456 Walnut Rd, Meadowbrook, ND", + customer: "Ethan Walker", + overAllStatus: "in progress", + completionDate: null, + steps: [ + { stepName: "Materials Ordered", status: "completed" }, + { stepName: "Materials Received", status: "completed" }, + { stepName: "Permits", status: "completed" }, + { stepName: "Locate Utilities", status: "completed" }, + { stepName: "Foreman Assigned", status: "completed" }, + { stepName: "Crew Assigned", status: "completed" }, + { stepName: "Job Started", status: "in progress" }, + { stepName: "Job Completed", status: "not started" }, + ], + }, + { + jobId: "JOB018", + foreman: null, + crew: [], + address: "123 Poplar Ave, Greenfield, MS", + customer: "Ava Hall", + overAllStatus: "not started", + completionDate: null, + steps: [ + { stepName: "Materials Ordered", status: "not started" }, + { stepName: "Materials Received", status: "not started" }, + { stepName: "Permits", status: "not started" }, + { stepName: "Locate Utilities", status: "not started" }, + { stepName: "Foreman Assigned", status: "not started" }, + { stepName: "Crew Assigned", status: "not started" }, + { stepName: "Job Started", status: "not started" }, + { stepName: "Job Completed", status: "not started" }, + ], + }, ]; }