feat: update team_lead role checks for wartosc_zlecenia display in ProjectViewPage and ProjectForm

This commit is contained in:
2025-11-14 09:33:27 +01:00
parent c2dbc9d777
commit be1bab103f
2 changed files with 35 additions and 29 deletions

View File

@@ -421,7 +421,9 @@ export default function ProjectViewPage() {
{project.investment_number || "N/A"}
</p>
</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
tableName="projects"
recordId={project.project_id}
@@ -433,7 +435,8 @@ export default function ProjectViewPage() {
})}
label="Wartość zlecenia"
/>
)}
);
})()}
</div>
{project.contact && (

View File

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