Skip to content

Commit b897e68

Browse files
Ocrvs 3423 (#3467)
* Update primary contact mapping of status table * Add small padding to header and item content of TableView * Update field agent type mapping * Replace unnecessary useCallback with plain function * Remove unused import
1 parent 1dd0995 commit b897e68

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

packages/client/src/views/Performance/FieldAgentList.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ import {
5454
MobileWrapper,
5555
DesktopWrapper
5656
} from '@opencrvs/components/lib/styleForPagination'
57+
import { userMessages } from '@client/i18n/messages'
5758

5859
const ToolTipContainer = styled.span`
5960
text-align: center;
@@ -327,6 +328,10 @@ function FieldAgentListComponent(props: IProps) {
327328
]
328329
}
329330

331+
function getFieldAgentTypeLabel(type: string) {
332+
return userMessages[type] ? intl.formatMessage(userMessages[type]) : type
333+
}
334+
330335
function getContent(data?: GQLSearchFieldAgentResult) {
331336
const content =
332337
data &&
@@ -350,7 +355,7 @@ function FieldAgentListComponent(props: IProps) {
350355
return {
351356
name: getNameWithAvatar(row.fullName || '', row.avatar),
352357
rawName: row.fullName || '',
353-
type: row.type,
358+
type: (row.type && getFieldAgentTypeLabel(row.type)) || '',
354359
officeName: (office && office.displayLabel) || '',
355360
startMonth: row.creationDate,
356361
totalDeclarations: String(row.totalNumberOfDeclarationStarted),

packages/client/src/views/SysAdmin/Performance/WorkflowStatus.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,13 @@ const statusOptions = [
164164
const PrimaryContactLabelMapping = {
165165
MOTHER: formMessages.contactDetailsMother,
166166
FATHER: formMessages.contactDetailsFather,
167-
INFORMANT: formMessages.contactDetailsInformant
167+
INFORMANT: formMessages.contactDetailsInformant,
168+
OTHER_FAMILY_MEMBER: formMessages.otherFamilyMember,
169+
LEGAL_GUARDIAN: formMessages.legalGuardian,
170+
GRANDMOTHER: formMessages.grandmother,
171+
GRANDFATHER: formMessages.grandfather,
172+
BROTHER: formMessages.brother,
173+
SISTER: formMessages.sister
168174
}
169175

170176
type PrimaryContact = keyof typeof PrimaryContactLabelMapping

packages/components/src/components/interface/TableView.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ const ContentWrapper = styled.span<{
182182
text-align: ${({ alignment }) => (alignment ? alignment.toString() : 'left')};
183183
cursor: ${({ sortable }) => (sortable ? 'pointer' : 'default')};
184184
color: ${({ theme }) => theme.colors.tertiary};
185+
padding: 0 4px;
185186
`
186187
const ValueWrapper = styled.span<{
187188
width: number
@@ -195,7 +196,7 @@ const ValueWrapper = styled.span<{
195196
justify-content: ${({ alignment }) =>
196197
alignment === ColumnContentAlignment.RIGHT ? 'flex-end' : 'flex-start'};
197198
text-align: ${({ alignment }) => (alignment ? alignment.toString() : 'left')};
198-
padding-right: 8px;
199+
padding: 0 4px;
199200
align-self: center;
200201
${({ color }) => color && `color: ${color};`}
201202
`

0 commit comments

Comments
 (0)