Fixed update modal linked user assignment
This commit is contained in:
@@ -270,8 +270,6 @@ export const GovernancePage: React.FC = () => {
|
||||
const linkedUserId =
|
||||
editingOrg?.userId ||
|
||||
editingOrg?.UserId ||
|
||||
editingOrg?.organisationUser ||
|
||||
editingOrg?.OrganisationUser ||
|
||||
'';
|
||||
|
||||
if (linkedUserId) {
|
||||
@@ -296,7 +294,7 @@ export const GovernancePage: React.FC = () => {
|
||||
}
|
||||
|
||||
return list;
|
||||
}, [executiveAndManagerUsers, usersDirectory, editingOrg?.id, editingOrg?.userId, editingOrg?.organisationUser]);
|
||||
}, [executiveAndManagerUsers, usersDirectory, editingOrg?.id, editingOrg?.userId]);
|
||||
|
||||
// Quick Add Executive User Subform state
|
||||
const [isQuickAddUserOpen, setIsQuickAddUserOpen] = useState(false);
|
||||
@@ -630,7 +628,6 @@ export const GovernancePage: React.FC = () => {
|
||||
registrationNo: data.registrationNo,
|
||||
email: data.email,
|
||||
organisationUser: data.organisationUser,
|
||||
userId: data.organisationUser,
|
||||
type: Number(data.type),
|
||||
status: data.status !== undefined ? Number(data.status) : ActivityStatus.Active,
|
||||
});
|
||||
@@ -770,9 +767,6 @@ export const GovernancePage: React.FC = () => {
|
||||
const targetUserId =
|
||||
org.userId ||
|
||||
org.UserId ||
|
||||
org.organisationUser ||
|
||||
org.OrganisationUser ||
|
||||
org.createdBy ||
|
||||
'';
|
||||
|
||||
let selectedUserId = '';
|
||||
@@ -1238,6 +1232,11 @@ export const GovernancePage: React.FC = () => {
|
||||
<Mail className="w-3.5 h-3.5 text-slate-500" />
|
||||
{org.email}
|
||||
</span>
|
||||
{org.userId && (
|
||||
<span className="text-[10px] text-blue-400/90 font-mono block mt-0.5" title={`Executive User: ${org.userId}`}>
|
||||
Exec: {getUserEmail(org.userId)}
|
||||
</span>
|
||||
)}
|
||||
</td>
|
||||
<td className="py-3.5 px-4">
|
||||
<span className={`inline-flex items-center px-2.5 py-0.5 rounded-full text-[10px] font-semibold border ${statusBadge.className}`}>
|
||||
@@ -1736,11 +1735,11 @@ export const GovernancePage: React.FC = () => {
|
||||
<div className="flex items-center justify-between mb-1">
|
||||
<div className="flex items-center gap-1">
|
||||
<label className="block text-xs font-semibold text-slate-300">
|
||||
Linked Executive / Manager User *
|
||||
Responsible Executive User *
|
||||
</label>
|
||||
<HelpTooltip
|
||||
title="Designated Organisation User"
|
||||
content="Only users with an Executive or Manager role can be assigned to an organisation."
|
||||
title="Executive / Organisation User"
|
||||
content="The Executive user responsible for this organisation. Stored as userId in the organisation record and submitted as organisationUser to the API."
|
||||
size="sm"
|
||||
placement="top"
|
||||
/>
|
||||
@@ -2585,11 +2584,17 @@ export const GovernancePage: React.FC = () => {
|
||||
<span className="text-slate-300">{getOrganisationTypeLabel(orgFreshDetail?.type ?? selectedOrgForDetail?.type ?? OrganisationType.Enterprise)}</span>
|
||||
</div>
|
||||
<div className="flex items-center gap-2 min-w-0">
|
||||
<span className="text-slate-400 font-semibold text-[11px] uppercase tracking-wider shrink-0">Linked User:</span>
|
||||
<span className="text-slate-400 font-semibold text-[11px] uppercase tracking-wider shrink-0">Executive User:</span>
|
||||
<span className="text-blue-400 font-mono text-[11px] truncate">
|
||||
{getUserEmail(orgFreshDetail?.userId || selectedOrgForDetail?.userId) || orgFreshDetail?.userId || selectedOrgForDetail?.userId || '—'}
|
||||
</span>
|
||||
</div>
|
||||
<div className="flex items-center gap-2 min-w-0">
|
||||
<span className="text-slate-400 font-semibold text-[11px] uppercase tracking-wider shrink-0">Created By:</span>
|
||||
<span className="text-slate-300 font-mono text-[11px] truncate">
|
||||
{getUserEmail(orgFreshDetail?.createdBy || selectedOrgForDetail?.createdBy) || orgFreshDetail?.createdBy || selectedOrgForDetail?.createdBy || '—'}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -247,7 +247,6 @@ export const createOrganisation = async (payload: CreateOrganisationRequest): Pr
|
||||
email: payload.email,
|
||||
idNumber: payload.idNumber || null,
|
||||
organisationUser: payload.organisationUser,
|
||||
userId: payload.userId || payload.organisationUser,
|
||||
type: payload.type !== undefined ? Number(payload.type) : 5,
|
||||
});
|
||||
return res.data;
|
||||
@@ -260,9 +259,8 @@ export const updateOrganisation = async (payload: UpdateOrganisationRequest): Pr
|
||||
name: payload.name,
|
||||
registrationNo: payload.registrationNo,
|
||||
email: payload.email,
|
||||
idNumber: payload.idNumber,
|
||||
idNumber: payload.idNumber || null,
|
||||
organisationUser: payload.organisationUser,
|
||||
userId: payload.userId || payload.organisationUser,
|
||||
type: Number(payload.type),
|
||||
status: orgStatus,
|
||||
});
|
||||
|
||||
@@ -388,7 +388,6 @@ export interface CreateOrganisationRequest {
|
||||
email: string;
|
||||
idNumber?: string | null;
|
||||
organisationUser: string;
|
||||
userId?: string | null;
|
||||
type: OrganisationType;
|
||||
}
|
||||
|
||||
@@ -399,7 +398,6 @@ export interface UpdateOrganisationRequest {
|
||||
email: string;
|
||||
idNumber?: string | null;
|
||||
organisationUser: string;
|
||||
userId?: string | null;
|
||||
type: OrganisationType;
|
||||
status?: ActivityStatus;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user