diff --git a/packages/apps/hr/src/components/molecules/TimeDetailCard/TimeDetailCard.tsx b/packages/apps/hr/src/components/molecules/TimeDetailCard/TimeDetailCard.tsx index 7e54607131..402b99b15a 100644 --- a/packages/apps/hr/src/components/molecules/TimeDetailCard/TimeDetailCard.tsx +++ b/packages/apps/hr/src/components/molecules/TimeDetailCard/TimeDetailCard.tsx @@ -33,6 +33,7 @@ interface TimeDetailCardProps { durationUnit: string; isSmallCard?: boolean; isActions?: boolean; + showTrash?: boolean; style?: any; onEdit?: () => void; onDelete?: () => void; @@ -49,6 +50,7 @@ const TimeDetailCard = ({ duration, durationUnit, isSmallCard, + showTrash = true, isActions = true, style, onEdit = () => {}, @@ -79,12 +81,14 @@ const TimeDetailCard = ({ onPress={onEdit} style={styles.cardIconButton} /> - + {showTrash && ( + + )} )} diff --git a/packages/apps/hr/src/models/objectFields.ts b/packages/apps/hr/src/models/objectFields.ts index dd49f24d7d..9d98a542de 100644 --- a/packages/apps/hr/src/models/objectFields.ts +++ b/packages/apps/hr/src/models/objectFields.ts @@ -137,6 +137,7 @@ export const hr_modelAPI: ObjectFields = { date: schemaContructor.string(), duration: schemaContructor.number(), hoursDuration: schemaContructor.number(), + timer: schemaContructor.subObject(), }), auth_user: schemaContructor.object({ employee: schemaContructor.subObject().concat( diff --git a/packages/apps/hr/src/screens/timesheet/TimesheetDetailsScreen.js b/packages/apps/hr/src/screens/timesheet/TimesheetDetailsScreen.js index 7eb8564b82..f61ca237f6 100644 --- a/packages/apps/hr/src/screens/timesheet/TimesheetDetailsScreen.js +++ b/packages/apps/hr/src/screens/timesheet/TimesheetDetailsScreen.js @@ -100,6 +100,7 @@ const TimesheetDetailsScreen = ({navigation, route}) => { comments={item.comments} date={item.date} duration={item.duration} + showTrash={item.timer == null} durationUnit={timesheet.timeLoggingPreferenceSelect} isActions={_statusSelect === Timesheet.statusSelect.Draft} onEdit={() =>