refactor: simplify role checks for wartosc_zlecenia display in ProjectViewPage and ProjectForm
This commit is contained in:
@@ -421,9 +421,7 @@ export default function ProjectViewPage() {
|
||||
{project.investment_number || "N/A"}
|
||||
</p>
|
||||
</div>
|
||||
{(() => {
|
||||
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 && (
|
||||
{session?.user?.role === 'team_lead' && project.wartosc_zlecenia && (
|
||||
<FieldWithHistory
|
||||
tableName="projects"
|
||||
recordId={project.project_id}
|
||||
@@ -435,8 +433,7 @@ export default function ProjectViewPage() {
|
||||
})}
|
||||
label="Wartość zlecenia"
|
||||
/>
|
||||
);
|
||||
})()}
|
||||
)}
|
||||
</div>
|
||||
|
||||
{project.contact && (
|
||||
|
||||
@@ -330,9 +330,7 @@ const ProjectForm = forwardRef(function ProjectForm({ initialData = null }, ref)
|
||||
/>
|
||||
</div>
|
||||
|
||||
{(() => {
|
||||
console.log('Session user role in ProjectForm:', session?.user?.role);
|
||||
return session?.user?.role === 'team_lead' && (
|
||||
{session?.user?.role === 'team_lead' && (
|
||||
<div>
|
||||
<label className="block text-sm font-medium text-gray-700 mb-2">
|
||||
Wartość zlecenia
|
||||
@@ -347,8 +345,7 @@ 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">
|
||||
|
||||
Reference in New Issue
Block a user