asdfasf
This commit is contained in:
@@ -1,14 +1,9 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import { Navigate } from 'react-router-dom';
|
||||||
|
|
||||||
const ApplicationLog = () => {
|
const ApplicationLog = () => {
|
||||||
return (
|
// Redirect legacy route to Applications with log workflow enabled
|
||||||
<div className="p-6">
|
return <Navigate to="/applications?action=log" replace />;
|
||||||
<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>
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default ApplicationLog;
|
export default ApplicationLog;
|
||||||
@@ -54,6 +54,7 @@ const Applications = () => {
|
|||||||
});
|
});
|
||||||
const [sortBy, setSortBy] = useState('date');
|
const [sortBy, setSortBy] = useState('date');
|
||||||
const [sortOrder, setSortOrder] = useState('desc');
|
const [sortOrder, setSortOrder] = useState('desc');
|
||||||
|
const [logHint, setLogHint] = useState(false);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
fetchApplications();
|
fetchApplications();
|
||||||
@@ -72,6 +73,20 @@ const Applications = () => {
|
|||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [location.search]);
|
}, [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 () => {
|
const fetchApplications = async () => {
|
||||||
try {
|
try {
|
||||||
const response = await applicationsAPI.getPlans();
|
const response = await applicationsAPI.getPlans();
|
||||||
@@ -453,6 +468,11 @@ const Applications = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="p-6">
|
<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 className="flex justify-between items-center mb-6">
|
||||||
<div>
|
<div>
|
||||||
<h1 className="text-2xl font-bold text-gray-900">Applications</h1>
|
<h1 className="text-2xl font-bold text-gray-900">Applications</h1>
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ const Dashboard = () => {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Log Application',
|
name: 'Log Application',
|
||||||
href: '/applications/log',
|
href: '/applications?action=log',
|
||||||
icon: ClockIcon,
|
icon: ClockIcon,
|
||||||
description: 'Record completed work',
|
description: 'Record completed work',
|
||||||
color: 'bg-orange-500',
|
color: 'bg-orange-500',
|
||||||
|
|||||||
Reference in New Issue
Block a user