refactor: simplify role checks for wartosc_zlecenia display in ProjectViewPage and ProjectForm

This commit is contained in:
2025-11-14 09:41:06 +01:00
parent be1bab103f
commit 6b205f36bb
2 changed files with 29 additions and 35 deletions

View File

@@ -421,9 +421,7 @@ export default function ProjectViewPage() {
{project.investment_number || "N/A"} {project.investment_number || "N/A"}
</p> </p>
</div> </div>
{(() => { {session?.user?.role === 'team_lead' && project.wartosc_zlecenia && (
console.log('Session user role in project view:', session?.user?.role, 'wartosc_zlecenia:', project.wartosc_zlecenia);
return session?.user?.role === 'team_lead' && project.wartosc_zlecenia && (
<FieldWithHistory <FieldWithHistory
tableName="projects" tableName="projects"
recordId={project.project_id} recordId={project.project_id}
@@ -435,8 +433,7 @@ export default function ProjectViewPage() {
})} })}
label="Wartość zlecenia" label="Wartość zlecenia"
/> />
); )}
})()}
</div> </div>
{project.contact && ( {project.contact && (

View File

@@ -330,9 +330,7 @@ const ProjectForm = forwardRef(function ProjectForm({ initialData = null }, ref)
/> />
</div> </div>
{(() => { {session?.user?.role === 'team_lead' && (
console.log('Session user role in ProjectForm:', session?.user?.role);
return session?.user?.role === 'team_lead' && (
<div> <div>
<label className="block text-sm font-medium text-gray-700 mb-2"> <label className="block text-sm font-medium text-gray-700 mb-2">
Wartość zlecenia Wartość zlecenia
@@ -347,8 +345,7 @@ const ProjectForm = forwardRef(function ProjectForm({ initialData = null }, ref)
min="0" min="0"
/> />
</div> </div>
); )}
})()}
<div className="md:col-span-2"> <div className="md:col-span-2">
<label className="block text-sm font-medium text-gray-700 mb-2"> <label className="block text-sm font-medium text-gray-700 mb-2">