Merge branch 'window-build' of http://git.hicglobalsolutions.in/BhawanSingh/va-tracker into window-build
This commit is contained in:
commit
882e8349c9
|
|
@ -11,6 +11,7 @@ node_modules
|
||||||
dist
|
dist
|
||||||
dist-react
|
dist-react
|
||||||
dist-electron
|
dist-electron
|
||||||
|
release
|
||||||
*.local
|
*.local
|
||||||
release
|
release
|
||||||
|
|
||||||
|
|
|
||||||
BIN
appIcon.png
BIN
appIcon.png
Binary file not shown.
|
Before Width: | Height: | Size: 1.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 435 KiB |
|
|
@ -1,16 +0,0 @@
|
||||||
{
|
|
||||||
"appId": "com.n-ziermann.electron-course",
|
|
||||||
"files": ["dist-electron", "dist-react"],
|
|
||||||
"extraResources": ["dist-electron/preload.cjs", "src/assets/**"],
|
|
||||||
"icon": "./desktopIcon.png",
|
|
||||||
"mac": {
|
|
||||||
"target": "dmg"
|
|
||||||
},
|
|
||||||
"linux": {
|
|
||||||
"target": "AppImage",
|
|
||||||
"category": "Utility"
|
|
||||||
},
|
|
||||||
"win": {
|
|
||||||
"target": ["portable", "msi"]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 171 KiB After Width: | Height: | Size: 435 KiB |
|
|
@ -340,6 +340,28 @@ ipcMain.handle("create-timesheet", async (event, data) => {
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
ipcMain.handle("create-leave-request", async (event, payload) => {
|
||||||
|
try {
|
||||||
|
console.log(" Leave Request Received:", payload);
|
||||||
|
|
||||||
|
const response = await api.post("/leave/request", payload);
|
||||||
|
|
||||||
|
console.log(" Leave Saved:", response.data);
|
||||||
|
|
||||||
|
return { success: true, data: response.data };
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
console.error("❌ Leave Save Failed:", error);
|
||||||
|
|
||||||
|
return {
|
||||||
|
success: false,
|
||||||
|
error: error || "Unknown error"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export const sendTokenExpired = () => {
|
export const sendTokenExpired = () => {
|
||||||
console.log("⚠️ Sending token-expired event to renderer");
|
console.log("⚠️ Sending token-expired event to renderer");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,28 @@
|
||||||
|
// import path from 'path';
|
||||||
|
// import { app } from 'electron';
|
||||||
|
// import { isDev } from './util.js';
|
||||||
|
|
||||||
|
// export function getPreloadPath() {
|
||||||
|
// return path.join(
|
||||||
|
// app.getAppPath(),
|
||||||
|
// isDev() ? '.' : '..',
|
||||||
|
// '/dist-electron/preload.cjs'
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
|
||||||
|
// export function getUIPath() {
|
||||||
|
// return path.join(app.getAppPath(), "dist-react", "index.html");
|
||||||
|
|
||||||
|
// // return "C:\\Users\\user\\OneDrive\\Desktop\\electron-main\\dist-react\\index.html";
|
||||||
|
// // return path.join(app.getAppPath(), '/dist-react/index.html');
|
||||||
|
// }
|
||||||
|
|
||||||
|
// export function getAssetPath() {
|
||||||
|
// return path.join(app.getAppPath(), isDev() ? '.' : '..', '/src/assets');
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import { app } from 'electron';
|
import { app } from 'electron';
|
||||||
import { isDev } from './util.js';
|
import { isDev } from './util.js';
|
||||||
|
|
@ -6,17 +31,22 @@ export function getPreloadPath() {
|
||||||
return path.join(
|
return path.join(
|
||||||
app.getAppPath(),
|
app.getAppPath(),
|
||||||
isDev() ? '.' : '..',
|
isDev() ? '.' : '..',
|
||||||
'/dist-electron/preload.cjs'
|
'/dist-electron/preload.cjs' // ✅ Changed to .js
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getUIPath() {
|
export function getUIPath() {
|
||||||
return path.join(app.getAppPath(), "dist-react", "index.html");
|
return path.join(app.getAppPath(), "dist-react", "index.html");
|
||||||
|
|
||||||
// return "C:\\Users\\user\\OneDrive\\Desktop\\electron-main\\dist-react\\index.html";
|
|
||||||
// return path.join(app.getAppPath(), '/dist-react/index.html');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getAssetPath() {
|
export function getAssetPath() {
|
||||||
return path.join(app.getAppPath(), isDev() ? '.' : '..', '/src/assets');
|
return path.join(app.getAppPath(), isDev() ? '.' : '..', '/assets');
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getIconPath() {
|
||||||
|
return path.join(getAssetPath(), 'icons', 'appIcon.ico');
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getSplashPath() {
|
||||||
|
return path.join(getAssetPath(), 'splash.html');
|
||||||
}
|
}
|
||||||
|
|
@ -50,6 +50,10 @@ contextBridge.exposeInMainWorld('electron', {
|
||||||
|
|
||||||
createTimesheet: (data: any) => ipcRenderer.invoke('create-timesheet', data),
|
createTimesheet: (data: any) => ipcRenderer.invoke('create-timesheet', data),
|
||||||
|
|
||||||
|
createPTOAndSickLeaveRequest: (data) =>
|
||||||
|
ipcRenderer.invoke("create-leave-request", data),
|
||||||
|
|
||||||
|
|
||||||
} satisfies Window['electron']);
|
} satisfies Window['electron']);
|
||||||
|
|
||||||
// function ipcInvoke<Key extends keyof EventPayloadMapping>(
|
// function ipcInvoke<Key extends keyof EventPayloadMapping>(
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,6 @@ export const handleLogin = async (credentials: { email: string, password: string
|
||||||
console.log("UIPATH", getUIPath());
|
console.log("UIPATH", getUIPath());
|
||||||
console.log("Doom 1");
|
console.log("Doom 1");
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
console.log("➡️ Calling API...");
|
console.log("➡️ Calling API...");
|
||||||
const response = await axios.post(
|
const response = await axios.post(
|
||||||
|
|
@ -191,3 +190,6 @@ export const captureSpecificApp = async (windowTitle: string): Promise<string> =
|
||||||
return 'Failed to capture screenshot.';
|
return 'Failed to capture screenshot.';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// timmer stop after 4-5 sec check it..
|
||||||
|
|
@ -107,7 +107,7 @@ const DashboardLayout = () => {
|
||||||
const menuItems = [
|
const menuItems = [
|
||||||
{ label: "Dashboard", path: "/dashboard", icon: <Home size={18} />, exact: true },
|
{ label: "Dashboard", path: "/dashboard", icon: <Home size={18} />, exact: true },
|
||||||
{ label: "Timesheet", path: "/dashboard/timesheet", icon: <TimerIcon size={18} /> },
|
{ label: "Timesheet", path: "/dashboard/timesheet", icon: <TimerIcon size={18} /> },
|
||||||
{ label: "PTO", path: "/dashboard/leave-adjustments", icon: <CalendarDays size={18} /> },
|
{ label: "Leave & Adjust", path: "/dashboard/leave-adjustments", icon: <CalendarDays size={18} /> },
|
||||||
{ label: "Settings", path: "/dashboard/settings", icon: <SettingsIcon size={18} /> },
|
{ label: "Settings", path: "/dashboard/settings", icon: <SettingsIcon size={18} /> },
|
||||||
{ label: "VPN", path: "/dashboard/vpn", icon: <GlobeLock size={18} /> },
|
{ label: "VPN", path: "/dashboard/vpn", icon: <GlobeLock size={18} /> },
|
||||||
{ label: "Help & Support", path: "/dashboard/help-support", icon: <HelpCircleIcon size={18} /> },
|
{ label: "Help & Support", path: "/dashboard/help-support", icon: <HelpCircleIcon size={18} /> },
|
||||||
|
|
@ -211,6 +211,54 @@ const DashboardLayout = () => {
|
||||||
|
|
||||||
// STEP 6: Clear active project log ID
|
// STEP 6: Clear active project log ID
|
||||||
setActiveProjectLogId("");
|
setActiveProjectLogId("");
|
||||||
|
|
||||||
|
// ✨ NEW STEP 7: Refresh project list to get updated work hours
|
||||||
|
try {
|
||||||
|
console.log("🔄 Refreshing project list...");
|
||||||
|
const res = await window.electron.getProjectList();
|
||||||
|
console.log("📊 Updated project list:", res);
|
||||||
|
|
||||||
|
if (res?.success && Array.isArray(res.data)) {
|
||||||
|
// Update projects data
|
||||||
|
dispatch(setProjectsDataSlice(res.data));
|
||||||
|
|
||||||
|
// Update project summary
|
||||||
|
dispatch(
|
||||||
|
setProjectSummarySlice({
|
||||||
|
totalProjects: res.totalProjects || 0,
|
||||||
|
activeProjects: res.activeProjects || 0,
|
||||||
|
awayProjects: res.awayProjects || 0,
|
||||||
|
totalWorkTime: res.totalWorkTime || "0h 0m 0s",
|
||||||
|
totalWorkMs: res.totalWorkMs || 0,
|
||||||
|
vaName: res.vaName || "",
|
||||||
|
vaId: res.vaId || "",
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
// Update selected project with fresh data
|
||||||
|
const updatedProject = res.data.find(
|
||||||
|
(p: Project) => p.projectId === projectId
|
||||||
|
);
|
||||||
|
|
||||||
|
if (updatedProject) {
|
||||||
|
dispatch(setSelectedProjectSlice(updatedProject));
|
||||||
|
|
||||||
|
// Update tracking map with new total work time
|
||||||
|
const initialElapsed = Math.floor((updatedProject.totalWorkMs || 0) / 1000);
|
||||||
|
dispatch(
|
||||||
|
initializeProjectTracking({
|
||||||
|
projectId: updatedProject.projectId,
|
||||||
|
initialTime: initialElapsed,
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
console.log("✅ Selected project updated with fresh data");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error("❌ Error refreshing project list:", error);
|
||||||
|
}
|
||||||
|
|
||||||
setLoadingStop(false);
|
setLoadingStop(false);
|
||||||
console.log("🧹 Active project log ID cleared");
|
console.log("🧹 Active project log ID cleared");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { useSelector } from 'react-redux';
|
import { useSelector } from 'react-redux';
|
||||||
import { RootState } from '../../store';
|
import { RootState } from '../../store';
|
||||||
|
|
@ -9,23 +10,46 @@ type TabType = 'pto' | 'sick' | 'adjustment';
|
||||||
|
|
||||||
const LeaveAndAdjustments: React.FC = () => {
|
const LeaveAndAdjustments: React.FC = () => {
|
||||||
const [activeTab, setActiveTab] = useState<TabType>('pto');
|
const [activeTab, setActiveTab] = useState<TabType>('pto');
|
||||||
|
const [isSubmitting, setIsSubmitting] = useState(false); // 🚀 NEW
|
||||||
const projects = useSelector((state: RootState) => state.projects.projectsData);
|
const projects = useSelector((state: RootState) => state.projects.projectsData);
|
||||||
|
|
||||||
console.log("LeaveAndAdjustments", projects);
|
// ------- COMMON API CALL FOR BOTH TABS -------
|
||||||
|
const submitLeave = async (payload: {
|
||||||
|
dateFrom: string;
|
||||||
|
dateTo: string;
|
||||||
|
leaveType: "PTO" | "SICK";
|
||||||
|
comment: string;
|
||||||
|
}) => {
|
||||||
|
try {
|
||||||
|
setIsSubmitting(true);
|
||||||
|
|
||||||
|
console.log("Leave Payload:", payload);
|
||||||
|
|
||||||
|
const response = await window.electron.createPTOAndSickLeaveRequest(payload)
|
||||||
|
console.log("Leave Payload:" ,response)
|
||||||
|
if (response.success) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
return false;
|
||||||
|
} finally {
|
||||||
|
setIsSubmitting(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="max-h-screen">
|
<div className="max-h-screen">
|
||||||
<div className="w-full mx-auto">
|
<div className="w-full mx-auto">
|
||||||
{/* Header */}
|
|
||||||
<div className="">
|
|
||||||
<h1 className="text-mb font-bold mb-2">Leave & Adjust Timesheet</h1>
|
<h1 className="text-mb font-bold mb-2">Leave & Adjust Timesheet</h1>
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Tabs Navigation */}
|
{/* Tabs — Disabled while submitting */}
|
||||||
<div role="tablist" className="tabs tabs-border w-full mb-1">
|
<div role="tablist" className="tabs tabs-border w-full mb-1 opacity-100">
|
||||||
<a
|
<a
|
||||||
role="tab"
|
role="tab"
|
||||||
className={`tab text-xs font-semibold ${activeTab === "pto" ? "tab-active text-primary" : ""}`}
|
className={`tab text-xs font-semibold ${
|
||||||
|
activeTab === "pto" ? "tab-active text-primary" : ""
|
||||||
|
} ${isSubmitting ? "pointer-events-none opacity-50" : ""}`}
|
||||||
onClick={() => setActiveTab("pto")}
|
onClick={() => setActiveTab("pto")}
|
||||||
>
|
>
|
||||||
PTO Leave
|
PTO Leave
|
||||||
|
|
@ -33,7 +57,9 @@ const LeaveAndAdjustments: React.FC = () => {
|
||||||
|
|
||||||
<a
|
<a
|
||||||
role="tab"
|
role="tab"
|
||||||
className={`tab text-xs font-semibold ${activeTab === "sick" ? "tab-active text-primary" : ""}`}
|
className={`tab text-xs font-semibold ${
|
||||||
|
activeTab === "sick" ? "tab-active text-primary" : ""
|
||||||
|
} ${isSubmitting ? "pointer-events-none opacity-50" : ""}`}
|
||||||
onClick={() => setActiveTab("sick")}
|
onClick={() => setActiveTab("sick")}
|
||||||
>
|
>
|
||||||
Sick Leave
|
Sick Leave
|
||||||
|
|
@ -41,7 +67,9 @@ const LeaveAndAdjustments: React.FC = () => {
|
||||||
|
|
||||||
<a
|
<a
|
||||||
role="tab"
|
role="tab"
|
||||||
className={`tab text-xs font-semibold ${activeTab === "adjustment" ? "tab-active text-primary" : ""}`}
|
className={`tab text-xs font-semibold ${
|
||||||
|
activeTab === "adjustment" ? "tab-active text-primary" : ""
|
||||||
|
} ${isSubmitting ? "pointer-events-none opacity-50" : ""}`}
|
||||||
onClick={() => setActiveTab("adjustment")}
|
onClick={() => setActiveTab("adjustment")}
|
||||||
>
|
>
|
||||||
Adjustment Submission
|
Adjustment Submission
|
||||||
|
|
@ -51,43 +79,22 @@ const LeaveAndAdjustments: React.FC = () => {
|
||||||
{/* Main Container */}
|
{/* Main Container */}
|
||||||
<div className="rounded-lg bg-base-100 overflow-hidden">
|
<div className="rounded-lg bg-base-100 overflow-hidden">
|
||||||
<div className="px-8 py-4 overflow-y-auto no-scrollbar max-h-[81vh]">
|
<div className="px-8 py-4 overflow-y-auto no-scrollbar max-h-[81vh]">
|
||||||
{activeTab === 'pto' && (
|
|
||||||
<div className="animate-fade-in">
|
{activeTab === "pto" && (
|
||||||
<PtoLeaveTab />
|
<PtoLeaveTab submitLeave={submitLeave} isSubmitting={isSubmitting} />
|
||||||
</div>
|
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{activeTab === 'sick' && (
|
{activeTab === "sick" && (
|
||||||
<div className="animate-fade-in">
|
<SickLeaveTab submitLeave={submitLeave} isSubmitting={isSubmitting} />
|
||||||
<SickLeaveTab />
|
|
||||||
</div>
|
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{activeTab === 'adjustment' && (
|
{activeTab === "adjustment" && (
|
||||||
<div className="animate-fade-in">
|
|
||||||
<AdjustmentTab projects={projects} />
|
<AdjustmentTab projects={projects} />
|
||||||
</div>
|
|
||||||
)}
|
)}
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<style>{`
|
</div>
|
||||||
@keyframes fade-in {
|
</div>
|
||||||
from {
|
</div>
|
||||||
opacity: 0;
|
|
||||||
transform: translateY(10px);
|
|
||||||
}
|
|
||||||
to {
|
|
||||||
opacity: 1;
|
|
||||||
transform: translateY(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.animate-fade-in {
|
|
||||||
animation: fade-in 0.3s ease-out;
|
|
||||||
}
|
|
||||||
`}</style>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import { DateTime } from 'luxon';
|
||||||
interface Project {
|
interface Project {
|
||||||
projectId: string;
|
projectId: string;
|
||||||
projectName: string;
|
projectName: string;
|
||||||
|
status?: string | boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ProjectSummaryResponse {
|
interface ProjectSummaryResponse {
|
||||||
|
|
@ -370,7 +371,7 @@ const AdjustmentTab: React.FC<AdjustmentTabProps> = ({ projects }) => {
|
||||||
Pick a project
|
Pick a project
|
||||||
</option>
|
</option>
|
||||||
{projects.map((item, index) => (
|
{projects.map((item, index) => (
|
||||||
<option key={item.projectId || index} value={item.projectId}>
|
<option key={item.projectId || index} value={item.projectId} className={`${item.status ? "" : ""}`}>
|
||||||
{item.projectName}
|
{item.projectName}
|
||||||
</option>
|
</option>
|
||||||
))}
|
))}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import React, { useState } from 'react';
|
// PtoLeaveTab.tsx
|
||||||
|
import React, { useState } from "react";
|
||||||
|
|
||||||
interface LeaveFormData {
|
interface LeaveFormData {
|
||||||
fromDate: string;
|
fromDate: string;
|
||||||
|
|
@ -6,68 +7,77 @@ interface LeaveFormData {
|
||||||
comment: string;
|
comment: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const PtoLeaveTab: React.FC = () => {
|
const PtoLeaveTab: React.FC<{
|
||||||
|
submitLeave: Function;
|
||||||
|
isSubmitting: boolean;
|
||||||
|
}> = ({ submitLeave, isSubmitting }) => {
|
||||||
|
|
||||||
const [ptoLeave, setPtoLeave] = useState<LeaveFormData>({
|
const [ptoLeave, setPtoLeave] = useState<LeaveFormData>({
|
||||||
fromDate: '',
|
fromDate: "",
|
||||||
toDate: '',
|
toDate: "",
|
||||||
comment: ''
|
comment: "",
|
||||||
});
|
});
|
||||||
const [ptoErrors, setPtoErrors] = useState<Partial<LeaveFormData>>({});
|
|
||||||
|
|
||||||
const validateLeaveForm = (data: LeaveFormData): Partial<LeaveFormData> => {
|
const [errors, setErrors] = useState<Partial<LeaveFormData>>({});
|
||||||
const errors: Partial<LeaveFormData> = {};
|
|
||||||
|
|
||||||
if (!data.fromDate) {
|
const validate = () => {
|
||||||
errors.fromDate = 'From date is required';
|
const e: Partial<LeaveFormData> = {};
|
||||||
|
|
||||||
|
const today = new Date();
|
||||||
|
today.setHours(0, 0, 0, 0);
|
||||||
|
|
||||||
|
const from = ptoLeave.fromDate ? new Date(ptoLeave.fromDate) : null;
|
||||||
|
const to = ptoLeave.toDate ? new Date(ptoLeave.toDate) : null;
|
||||||
|
|
||||||
|
// From date required
|
||||||
|
if (!from) {
|
||||||
|
e.fromDate = "From date is required";
|
||||||
|
} else if (from < today) {
|
||||||
|
e.fromDate = "From date cannot be in the past";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!data.toDate) {
|
// To date required
|
||||||
errors.toDate = 'To date is required';
|
if (!to) {
|
||||||
|
e.toDate = "To date is required";
|
||||||
|
} else if (to < today) {
|
||||||
|
e.toDate = "To date cannot be in the past";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!data.comment.trim()) {
|
// To date must be same or after From date
|
||||||
errors.comment = 'Comment is required';
|
if (from && to && to < from) {
|
||||||
|
e.toDate = "To date cannot be before From date";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.fromDate && data.toDate && new Date(data.fromDate) > new Date(data.toDate)) {
|
// Comment validation
|
||||||
errors.toDate = 'To date must be after from date';
|
if (!ptoLeave.comment.trim()) {
|
||||||
|
e.comment = "Comment required";
|
||||||
}
|
}
|
||||||
|
|
||||||
return errors;
|
return e;
|
||||||
};
|
};
|
||||||
|
|
||||||
const handlePtoChange = (field: keyof LeaveFormData, value: string) => {
|
const handleSubmit = async () => {
|
||||||
setPtoLeave(prev => ({ ...prev, [field]: value }));
|
const e = validate();
|
||||||
// Clear error for the field being changed
|
if (Object.keys(e).length) return setErrors(e);
|
||||||
if (ptoErrors[field]) {
|
|
||||||
setPtoErrors(prev => ({ ...prev, [field]: undefined }));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const handlePtoSubmit = async () => {
|
const success = await submitLeave({
|
||||||
const errors = validateLeaveForm(ptoLeave);
|
dateFrom: ptoLeave.fromDate,
|
||||||
|
dateTo: ptoLeave.toDate,
|
||||||
|
leaveType: "PTO",
|
||||||
|
comment: ptoLeave.comment,
|
||||||
|
});
|
||||||
|
|
||||||
if (Object.keys(errors).length > 0) {
|
if (success) {
|
||||||
setPtoErrors(errors);
|
setPtoLeave({ fromDate: "", toDate: "", comment: "" });
|
||||||
return;
|
setErrors({});
|
||||||
}
|
alert("PTO submitted!");
|
||||||
|
|
||||||
try {
|
|
||||||
console.log('Submitting PTO:', ptoLeave);
|
|
||||||
alert('PTO request submitted successfully!');
|
|
||||||
|
|
||||||
setPtoLeave({ fromDate: '', toDate: '', comment: "" });
|
|
||||||
setPtoErrors({});
|
|
||||||
} catch (error) {
|
|
||||||
alert('Failed to submit request. Please try again.');
|
|
||||||
console.error('Error:', error);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="max-w-4xl">
|
<div className="max-w-4xl space-y-3">
|
||||||
<div className="space-y-3">
|
|
||||||
<div className="grid grid-cols-2 gap-4">
|
<div className="grid grid-cols-2 gap-4">
|
||||||
|
|
||||||
{/* From Date */}
|
{/* From Date */}
|
||||||
<div className="form-control">
|
<div className="form-control">
|
||||||
<label className="label">
|
<label className="label">
|
||||||
|
|
@ -75,17 +85,14 @@ const PtoLeaveTab: React.FC = () => {
|
||||||
</label>
|
</label>
|
||||||
<input
|
<input
|
||||||
type="date"
|
type="date"
|
||||||
|
disabled={isSubmitting}
|
||||||
value={ptoLeave.fromDate}
|
value={ptoLeave.fromDate}
|
||||||
onChange={(e) => handlePtoChange('fromDate', e.target.value)}
|
min={new Date().toISOString().split("T")[0]}
|
||||||
className={`input input-bordered input-sm w-full focus:input-primary transition-all ${
|
onChange={(e) => setPtoLeave({ ...ptoLeave, fromDate: e.target.value })}
|
||||||
ptoErrors.fromDate ? 'input-error' : ''
|
className={`input input-bordered input-sm ${errors.fromDate ? "input-error" : ""
|
||||||
}`}
|
}`}
|
||||||
/>
|
/>
|
||||||
{ptoErrors.fromDate && (
|
{errors.fromDate && <p className="text-error text-xs">{errors.fromDate}</p>}
|
||||||
<label className="label">
|
|
||||||
<span className="label-text-alt text-xs text-error font-medium">{ptoErrors.fromDate}</span>
|
|
||||||
</label>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* To Date */}
|
{/* To Date */}
|
||||||
|
|
@ -95,54 +102,45 @@ const PtoLeaveTab: React.FC = () => {
|
||||||
</label>
|
</label>
|
||||||
<input
|
<input
|
||||||
type="date"
|
type="date"
|
||||||
|
disabled={isSubmitting}
|
||||||
value={ptoLeave.toDate}
|
value={ptoLeave.toDate}
|
||||||
onChange={(e) => handlePtoChange('toDate', e.target.value)}
|
min={new Date().toISOString().split("T")[0]}
|
||||||
className={`input input-bordered input-sm w-full focus:input-primary transition-all ${
|
onChange={(e) => setPtoLeave({ ...ptoLeave, toDate: e.target.value })}
|
||||||
ptoErrors.toDate ? 'input-error' : ''
|
className={`input input-bordered input-sm ${errors.toDate ? "input-error" : ""
|
||||||
}`}
|
}`}
|
||||||
/>
|
/>
|
||||||
{ptoErrors.toDate && (
|
{errors.toDate && <p className="text-error text-xs">{errors.toDate}</p>}
|
||||||
<label className="label">
|
|
||||||
<span className="label-text-alt text-xs text-error font-medium">{ptoErrors.toDate}</span>
|
|
||||||
</label>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Description/Comment Field */}
|
{/* Comment */}
|
||||||
<div className="form-control flex flex-col gap-1 col-span-2">
|
<div className="form-control col-span-2">
|
||||||
<label className="label">
|
<label className="label">
|
||||||
<span className="label-text font-semibold text-sm">Description / Reason</span>
|
<span className="label-text font-semibold text-sm">Description</span>
|
||||||
</label>
|
</label>
|
||||||
<textarea
|
<textarea
|
||||||
className={`textarea text-xs textarea-bordered h-40 w-full focus:textarea-primary transition-all ${
|
disabled={isSubmitting}
|
||||||
ptoErrors.comment ? 'textarea-error' : ''
|
|
||||||
}`}
|
|
||||||
placeholder="Please enter the reason for your PTO request to help us better understand your needs."
|
|
||||||
value={ptoLeave.comment}
|
value={ptoLeave.comment}
|
||||||
onChange={(e) => handlePtoChange('comment', e.target.value)}
|
placeholder="Please describe your symptoms or reason for sick leave to help us better understand your situation."
|
||||||
|
onChange={(e) => setPtoLeave({ ...ptoLeave, comment: e.target.value })}
|
||||||
|
className={`textarea textarea-bordered text-xs h-40 ${errors.comment ? "textarea-error" : ""
|
||||||
|
}`}
|
||||||
/>
|
/>
|
||||||
{ptoErrors.comment && (
|
{errors.comment && <p className="text-error text-xs">{errors.comment}</p>}
|
||||||
<label className="label">
|
|
||||||
<span className="label-text-alt text-xs text-error font-medium">{ptoErrors.comment}</span>
|
|
||||||
</label>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Submit Button */}
|
|
||||||
<div className="flex gap-3">
|
|
||||||
<button
|
<button
|
||||||
onClick={handlePtoSubmit}
|
onClick={handleSubmit}
|
||||||
className="btn btn-primary flex-1 hover:shadow-lg transition-all duration-300"
|
disabled={isSubmitting}
|
||||||
|
className="btn btn-primary flex-1"
|
||||||
>
|
>
|
||||||
<svg className="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
{isSubmitting ? (
|
||||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M5 13l4 4L19 7" />
|
<span className="loading loading-spinner loading-sm"></span>
|
||||||
</svg>
|
) : (
|
||||||
Submit PTO Request
|
"Submit PTO Request"
|
||||||
|
)}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,10 @@ interface LeaveFormData {
|
||||||
comment: string;
|
comment: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const SickLeaveTab: React.FC = () => {
|
const SickLeaveTab: React.FC<{
|
||||||
|
submitLeave: Function;
|
||||||
|
isSubmitting: boolean;
|
||||||
|
}> = ({ submitLeave, isSubmitting }) => {
|
||||||
const [sickLeave, setSickLeave] = useState<LeaveFormData>({
|
const [sickLeave, setSickLeave] = useState<LeaveFormData>({
|
||||||
fromDate: '',
|
fromDate: '',
|
||||||
toDate: '',
|
toDate: '',
|
||||||
|
|
@ -43,7 +46,7 @@ const SickLeaveTab: React.FC = () => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleSickSubmit = async () => {
|
const handleSubmit = async () => {
|
||||||
const errors = validateLeaveForm(sickLeave);
|
const errors = validateLeaveForm(sickLeave);
|
||||||
|
|
||||||
if (Object.keys(errors).length > 0) {
|
if (Object.keys(errors).length > 0) {
|
||||||
|
|
@ -51,18 +54,23 @@ const SickLeaveTab: React.FC = () => {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
const success = await submitLeave({
|
||||||
console.log('Submitting Sick Leave:', sickLeave);
|
dateFrom: sickLeave.fromDate,
|
||||||
alert('Sick Leave request submitted successfully!');
|
dateTo: sickLeave.toDate,
|
||||||
|
leaveType: "SICK",
|
||||||
|
comment: sickLeave.comment,
|
||||||
|
});
|
||||||
|
|
||||||
setSickLeave({ fromDate: '', toDate: '', comment: '' });
|
if (success) {
|
||||||
|
setSickLeave({ fromDate: "", toDate: "", comment: "" });
|
||||||
setSickErrors({});
|
setSickErrors({});
|
||||||
} catch (error) {
|
alert("SICK submitted!");
|
||||||
alert('Failed to submit request. Please try again.');
|
|
||||||
console.error('Error:', error);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="max-w-4xl">
|
<div className="max-w-4xl">
|
||||||
<div className="space-y-3">
|
<div className="space-y-3">
|
||||||
|
|
@ -75,9 +83,10 @@ const SickLeaveTab: React.FC = () => {
|
||||||
<input
|
<input
|
||||||
type="date"
|
type="date"
|
||||||
value={sickLeave.fromDate}
|
value={sickLeave.fromDate}
|
||||||
|
min={new Date().toISOString().split("T")[0]}
|
||||||
|
disabled={isSubmitting}
|
||||||
onChange={(e) => handleSickChange('fromDate', e.target.value)}
|
onChange={(e) => handleSickChange('fromDate', e.target.value)}
|
||||||
className={`input input-bordered input-sm w-full focus:input-primary transition-all ${
|
className={`input input-bordered input-sm w-full focus:input-primary transition-all ${sickErrors.fromDate ? 'input-error' : ''
|
||||||
sickErrors.fromDate ? 'input-error' : ''
|
|
||||||
}`}
|
}`}
|
||||||
/>
|
/>
|
||||||
{sickErrors.fromDate && (
|
{sickErrors.fromDate && (
|
||||||
|
|
@ -95,9 +104,10 @@ const SickLeaveTab: React.FC = () => {
|
||||||
<input
|
<input
|
||||||
type="date"
|
type="date"
|
||||||
value={sickLeave.toDate}
|
value={sickLeave.toDate}
|
||||||
|
min={new Date().toISOString().split("T")[0]}
|
||||||
|
disabled={isSubmitting}
|
||||||
onChange={(e) => handleSickChange('toDate', e.target.value)}
|
onChange={(e) => handleSickChange('toDate', e.target.value)}
|
||||||
className={`input input-bordered input-sm w-full focus:input-primary transition-all ${
|
className={`input input-bordered input-sm w-full focus:input-primary transition-all ${sickErrors.toDate ? 'input-error' : ''
|
||||||
sickErrors.toDate ? 'input-error' : ''
|
|
||||||
}`}
|
}`}
|
||||||
/>
|
/>
|
||||||
{sickErrors.toDate && (
|
{sickErrors.toDate && (
|
||||||
|
|
@ -110,14 +120,14 @@ const SickLeaveTab: React.FC = () => {
|
||||||
{/* Description/Comment Field */}
|
{/* Description/Comment Field */}
|
||||||
<div className="form-control flex flex-col gap-1 col-span-2">
|
<div className="form-control flex flex-col gap-1 col-span-2">
|
||||||
<label className="label">
|
<label className="label">
|
||||||
<span className="label-text font-semibold text-sm">Description / Reason</span>
|
<span className="label-text font-semibold text-sm">Description</span>
|
||||||
</label>
|
</label>
|
||||||
<textarea
|
<textarea
|
||||||
className={`textarea text-xs textarea-bordered h-40 w-full focus:textarea-primary transition-all ${
|
className={`textarea text-xs textarea-bordered h-40 w-full focus:textarea-primary transition-all ${sickErrors.comment ? 'textarea-error' : ''
|
||||||
sickErrors.comment ? 'textarea-error' : ''
|
|
||||||
}`}
|
}`}
|
||||||
placeholder="Please describe your symptoms or reason for sick leave to help us better understand your situation."
|
placeholder="Please describe your symptoms or reason for sick leave to help us better understand your situation."
|
||||||
value={sickLeave.comment}
|
value={sickLeave.comment}
|
||||||
|
disabled={isSubmitting}
|
||||||
onChange={(e) => handleSickChange('comment', e.target.value)}
|
onChange={(e) => handleSickChange('comment', e.target.value)}
|
||||||
/>
|
/>
|
||||||
{sickErrors.comment && (
|
{sickErrors.comment && (
|
||||||
|
|
@ -129,19 +139,19 @@ const SickLeaveTab: React.FC = () => {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Submit Button */}
|
{/* Submit Button */}
|
||||||
<div className="flex gap-3">
|
|
||||||
<button
|
<button
|
||||||
onClick={handleSickSubmit}
|
onClick={handleSubmit}
|
||||||
className="btn btn-primary flex-1 hover:shadow-lg transition-all duration-300"
|
disabled={isSubmitting}
|
||||||
|
className="btn btn-primary flex-1"
|
||||||
>
|
>
|
||||||
<svg className="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
{isSubmitting ? (
|
||||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M5 13l4 4L19 7" />
|
<span className="loading loading-spinner loading-sm"></span>
|
||||||
</svg>
|
) : (
|
||||||
Submit Sick Leave Request
|
"Submit Sick Request"
|
||||||
|
)}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import { setUserSlice } from '../store/userSlice';
|
||||||
import DocVaLogoLight from '../../assets/logo-colored-vertical.svg'
|
import DocVaLogoLight from '../../assets/logo-colored-vertical.svg'
|
||||||
import DocVaLogoDark from '../../assets/logo-white-vertical.svg'
|
import DocVaLogoDark from '../../assets/logo-white-vertical.svg'
|
||||||
import { useTheme } from '../helper/ThemeToggle';
|
import { useTheme } from '../helper/ThemeToggle';
|
||||||
import { KeyRound, Mail } from 'lucide-react';
|
import { Eye, EyeOff, KeyRound, Mail } from 'lucide-react';
|
||||||
|
|
||||||
const Login = () => {
|
const Login = () => {
|
||||||
const { theme, setTheme } = useTheme();
|
const { theme, setTheme } = useTheme();
|
||||||
|
|
@ -18,6 +18,7 @@ const Login = () => {
|
||||||
const [password, setPassword] = useState("");
|
const [password, setPassword] = useState("");
|
||||||
const [isForgotMode, setIsForgotMode] = useState(false);
|
const [isForgotMode, setIsForgotMode] = useState(false);
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
|
const [showPassword, setShowPassword] = useState(false);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
document.documentElement.setAttribute("data-theme", theme);
|
document.documentElement.setAttribute("data-theme", theme);
|
||||||
|
|
@ -116,7 +117,7 @@ const Login = () => {
|
||||||
<span className="label-text font-medium">Email Address</span>
|
<span className="label-text font-medium">Email Address</span>
|
||||||
</label>
|
</label>
|
||||||
<label className="input input-bordered flex items-center gap-2" tabIndex={0}>
|
<label className="input input-bordered flex items-center gap-2" tabIndex={0}>
|
||||||
<Mail size={18} />
|
{/* <Mail size={18} /> */}
|
||||||
<input
|
<input
|
||||||
type="email"
|
type="email"
|
||||||
name="email"
|
name="email"
|
||||||
|
|
@ -129,14 +130,17 @@ const Login = () => {
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{!isForgotMode && <div className="form-control w-90 px-5 mt-3">
|
{!isForgotMode && (
|
||||||
|
<div className="form-control w-90 px-5 mt-3">
|
||||||
<label className="label">
|
<label className="label">
|
||||||
<span className="label-text font-medium">Password</span>
|
<span className="label-text font-medium">Password</span>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<label className="input input-bordered flex items-center gap-2" tabIndex={0}>
|
<label className="input input-bordered flex items-center gap-2" tabIndex={0}>
|
||||||
<KeyRound size={18} />
|
{/* <KeyRound size={18} /> */}
|
||||||
|
|
||||||
<input
|
<input
|
||||||
type="password"
|
type={showPassword ? "text" : "password"}
|
||||||
name="password"
|
name="password"
|
||||||
placeholder="Enter your password"
|
placeholder="Enter your password"
|
||||||
className="grow"
|
className="grow"
|
||||||
|
|
@ -144,8 +148,23 @@ const Login = () => {
|
||||||
onChange={(e) => setPassword(e.target.value)}
|
onChange={(e) => setPassword(e.target.value)}
|
||||||
required
|
required
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
{/* Toggle Icon */}
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="cursor-pointer"
|
||||||
|
onClick={() => setShowPassword((prev) => !prev)}
|
||||||
|
>
|
||||||
|
{showPassword ? (
|
||||||
|
<EyeOff size={18} className="opacity-70" />
|
||||||
|
) : (
|
||||||
|
<Eye size={18} className="opacity-70" />
|
||||||
|
)}
|
||||||
|
</button>
|
||||||
</label>
|
</label>
|
||||||
</div>}
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
|
||||||
<div className="form-control w-90 px-5 mt-4">
|
<div className="form-control w-90 px-5 mt-4">
|
||||||
<button
|
<button
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ interface Project {
|
||||||
totalWorkTime: string;
|
totalWorkTime: string;
|
||||||
totalWorkMs: number;
|
totalWorkMs: number;
|
||||||
totalLogs: number;
|
totalLogs: number;
|
||||||
|
status:string
|
||||||
}
|
}
|
||||||
|
|
||||||
const Timesheets: React.FC = () => {
|
const Timesheets: React.FC = () => {
|
||||||
|
|
@ -161,7 +162,7 @@ const Timesheets: React.FC = () => {
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{projectsData.map((entry, index) => (
|
{projectsData.map((entry, index) => (
|
||||||
<tr key={entry.projectId}>
|
<tr key={entry.projectId} className={`${entry.status ==='INACTIVE' && 'hidden'}`}>
|
||||||
<td>{index + 1}</td>
|
<td>{index + 1}</td>
|
||||||
<td>{entry.projectName}</td>
|
<td>{entry.projectName}</td>
|
||||||
<td>{formatWorkTime(entry.totalWorkTime)}</td>
|
<td>{formatWorkTime(entry.totalWorkTime)}</td>
|
||||||
|
|
@ -181,10 +182,10 @@ const Timesheets: React.FC = () => {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Footer Summary */}
|
{/* Footer Summary */}
|
||||||
<div className="flex justify-between items-center text-xs mt-2">
|
<div className="flex justify-end items-center text-xs mt-2">
|
||||||
<span className="text-base-content/60">
|
{/* <span className="text-base-content/60">
|
||||||
Showing {timesheetData.length} entries
|
Showing {timesheetData.length} entries
|
||||||
</span>
|
</span> */}
|
||||||
<span className="text-base-content/60">
|
<span className="text-base-content/60">
|
||||||
Last updated: {new Date().toLocaleDateString()}
|
Last updated: {new Date().toLocaleDateString()}
|
||||||
</span>
|
</span>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
import ReactQuill from "react-quill-new";
|
||||||
|
import Quill from "quill";
|
||||||
|
// import ImageResize from "quill-image-resize-module-react";
|
||||||
|
|
||||||
|
// Quill.register("modules/imageResize", ImageResize);
|
||||||
|
|
||||||
|
export const quillModules = {
|
||||||
|
toolbar: [
|
||||||
|
[{ header: [1, 2, 3, false] }],
|
||||||
|
["bold", "italic", "underline"],
|
||||||
|
["image", "link"],
|
||||||
|
],
|
||||||
|
// imageResize: {},
|
||||||
|
};
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
// utils/timeDisplay.js
|
||||||
|
export const getDisplayTime = (project:any, trackingData:any) => {
|
||||||
|
if (!project) return "0h 0m 0s";
|
||||||
|
|
||||||
|
// If tracking is active, calculate current time based on server time + session time
|
||||||
|
if (trackingData?.isTracking && trackingData.startTime) {
|
||||||
|
const baseSeconds = parseTimeStringToSeconds(project.totalWorkTime);
|
||||||
|
const sessionSeconds = Math.floor((Date.now() - trackingData.startTime) / 1000);
|
||||||
|
const totalSeconds = baseSeconds + sessionSeconds;
|
||||||
|
return formatSecondsToTimeString(totalSeconds);
|
||||||
|
}
|
||||||
|
|
||||||
|
// If not tracking, just return the server's totalWorkTime
|
||||||
|
return project.totalWorkTime;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const parseTimeStringToSeconds = (timeString:any) => {
|
||||||
|
if (!timeString || typeof timeString !== 'string') return 0;
|
||||||
|
|
||||||
|
try {
|
||||||
|
const hourMatch = timeString.match(/(\d+)h/);
|
||||||
|
const minMatch = timeString.match(/(\d+)m/);
|
||||||
|
const secMatch = timeString.match(/(\d+)s/);
|
||||||
|
|
||||||
|
const hours = hourMatch ? parseInt(hourMatch[1]) : 0;
|
||||||
|
const minutes = minMatch ? parseInt(minMatch[1]) : 0;
|
||||||
|
const seconds = secMatch ? parseInt(secMatch[1]) : 0;
|
||||||
|
|
||||||
|
return hours * 3600 + minutes * 60 + seconds;
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error parsing time string:', timeString, error);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const formatSecondsToTimeString = (totalSeconds:any) => {
|
||||||
|
const hours = Math.floor(totalSeconds / 3600);
|
||||||
|
const minutes = Math.floor((totalSeconds % 3600) / 60);
|
||||||
|
const seconds = totalSeconds % 60;
|
||||||
|
return `${hours}h ${minutes}m ${seconds}s`;
|
||||||
|
};
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
// utils/timeParser.js
|
||||||
|
export const parseTimeStringToMs = (timeString:string) => {
|
||||||
|
if (!timeString) return 0;
|
||||||
|
|
||||||
|
const hourMatch = timeString.match(/(\d+)h/);
|
||||||
|
const minMatch = timeString.match(/(\d+)m/);
|
||||||
|
const secMatch = timeString.match(/(\d+)s/);
|
||||||
|
|
||||||
|
const hours = hourMatch ? parseInt(hourMatch[1]) : 0;
|
||||||
|
const minutes = minMatch ? parseInt(minMatch[1]) : 0;
|
||||||
|
const seconds = secMatch ? parseInt(secMatch[1]) : 0;
|
||||||
|
|
||||||
|
return (hours * 3600 + minutes * 60 + seconds) * 1000;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const parseTimeStringToSeconds = (timeString:string) => {
|
||||||
|
return Math.floor(parseTimeStringToMs(timeString) / 1000);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -86,6 +86,12 @@ interface ProfileData {
|
||||||
_id: string;
|
_id: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type LeaveRequestResponse = {
|
||||||
|
success: boolean;
|
||||||
|
data?: any;
|
||||||
|
message?: string;
|
||||||
|
};
|
||||||
|
|
||||||
interface Window {
|
interface Window {
|
||||||
electron: {
|
electron: {
|
||||||
login: (credentials: { email: string; password: string }) => Promise<any>;
|
login: (credentials: { email: string; password: string }) => Promise<any>;
|
||||||
|
|
@ -163,7 +169,14 @@ interface Window {
|
||||||
data?: any;
|
data?: any;
|
||||||
message?: string;
|
message?: string;
|
||||||
}>;
|
}>;
|
||||||
|
|
||||||
|
createPTOAndSickLeaveRequest: (
|
||||||
|
payload: LeaveRequestPayload
|
||||||
|
) => Promise<LeaveRequestResponse>;
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue