feat: Add isSystem property to profile sections and isSearchableOnly to profile fields, including UI updates for display and management.

This commit is contained in:
pradeepkumar
2026-01-24 12:49:34 +05:30
parent 82a8b334ba
commit ebbaaa84eb
4 changed files with 73 additions and 18 deletions

View File

@@ -284,15 +284,22 @@ export default function ProfileSectionsPage() {
</div>
</td>
<td className="px-6 py-4 whitespace-nowrap">
<span
className={`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${
section.isGlobal
? 'bg-purple-100 text-purple-800'
: 'bg-gray-100 text-gray-600'
}`}
>
{section.isGlobal ? 'Global' : 'Specific'}
</span>
<div className="flex items-center space-x-2">
{section.isSystem && (
<span className="inline-flex px-2 py-1 text-xs font-semibold rounded-full bg-amber-100 text-amber-800">
System
</span>
)}
<span
className={`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${
section.isGlobal
? 'bg-purple-100 text-purple-800'
: 'bg-gray-100 text-gray-600'
}`}
>
{section.isGlobal ? 'Global' : 'Specific'}
</span>
</div>
</td>
<td className="px-6 py-4 whitespace-nowrap">
<button
@@ -319,12 +326,21 @@ export default function ProfileSectionsPage() {
>
Edit
</button>
<button
onClick={() => openDeleteModal(section)}
className="text-red-600 hover:text-red-900"
>
Delete
</button>
{section.isSystem ? (
<span
className="text-gray-400 cursor-not-allowed"
title="System sections cannot be deleted"
>
Delete
</span>
) : (
<button
onClick={() => openDeleteModal(section)}
className="text-red-600 hover:text-red-900"
>
Delete
</button>
)}
</td>
</tr>
))}