asdfasf
This commit is contained in:
@@ -1,14 +1,9 @@
|
||||
import React from 'react';
|
||||
import { Navigate } from 'react-router-dom';
|
||||
|
||||
const ApplicationLog = () => {
|
||||
return (
|
||||
<div className="p-6">
|
||||
<h1 className="text-2xl font-bold text-gray-900 mb-6">Log Application</h1>
|
||||
<div className="card">
|
||||
<p className="text-gray-600">Application logging coming soon...</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
// Redirect legacy route to Applications with log workflow enabled
|
||||
return <Navigate to="/applications?action=log" replace />;
|
||||
};
|
||||
|
||||
export default ApplicationLog;
|
||||
export default ApplicationLog;
|
||||
|
||||
@@ -54,6 +54,7 @@ const Applications = () => {
|
||||
});
|
||||
const [sortBy, setSortBy] = useState('date');
|
||||
const [sortOrder, setSortOrder] = useState('desc');
|
||||
const [logHint, setLogHint] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
fetchApplications();
|
||||
@@ -72,6 +73,20 @@ const Applications = () => {
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [location.search]);
|
||||
|
||||
// Handle log flow from dashboard (?action=log)
|
||||
useEffect(() => {
|
||||
const params = new URLSearchParams(location.search);
|
||||
if (params.get('action') === 'log') {
|
||||
// Focus on planned items for execution
|
||||
setShowFilters(true);
|
||||
setFilters(prev => ({ ...prev, status: 'planned' }));
|
||||
setLogHint(true);
|
||||
// Remove query param to avoid re-triggering on refresh
|
||||
navigate('/applications', { replace: true });
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [location.search]);
|
||||
|
||||
const fetchApplications = async () => {
|
||||
try {
|
||||
const response = await applicationsAPI.getPlans();
|
||||
@@ -453,6 +468,11 @@ const Applications = () => {
|
||||
|
||||
return (
|
||||
<div className="p-6">
|
||||
{logHint && (
|
||||
<div className="mb-4 rounded-md border border-blue-200 bg-blue-50 p-3 text-sm text-blue-800">
|
||||
Select a planned application below and click the Play icon to log it.
|
||||
</div>
|
||||
)}
|
||||
<div className="flex justify-between items-center mb-6">
|
||||
<div>
|
||||
<h1 className="text-2xl font-bold text-gray-900">Applications</h1>
|
||||
|
||||
@@ -49,7 +49,7 @@ const Dashboard = () => {
|
||||
},
|
||||
{
|
||||
name: 'Log Application',
|
||||
href: '/applications/log',
|
||||
href: '/applications?action=log',
|
||||
icon: ClockIcon,
|
||||
description: 'Record completed work',
|
||||
color: 'bg-orange-500',
|
||||
|
||||
Reference in New Issue
Block a user