diff --git a/apps/drive-app/src/pages/PhotoCapturePage/PhotoCapturePage.tsx b/apps/drive-app/src/pages/PhotoCapturePage/PhotoCapturePage.tsx
index 0995e962d..48c5ebb5b 100644
--- a/apps/drive-app/src/pages/PhotoCapturePage/PhotoCapturePage.tsx
+++ b/apps/drive-app/src/pages/PhotoCapturePage/PhotoCapturePage.tsx
@@ -44,6 +44,7 @@ export function PhotoCapturePage() {
enforceOrientation={DeviceOrientation.LANDSCAPE}
allowSkipRetake={false}
useLiveCompliance={true}
+ disableAddDamage={true}
/>
);
diff --git a/packages/inspection-capture-web/src/PhotoCapture/PhotoCapture.tsx b/packages/inspection-capture-web/src/PhotoCapture/PhotoCapture.tsx
index 1e311cb13..c99e6c4c0 100644
--- a/packages/inspection-capture-web/src/PhotoCapture/PhotoCapture.tsx
+++ b/packages/inspection-capture-web/src/PhotoCapture/PhotoCapture.tsx
@@ -89,6 +89,12 @@ export interface PhotoCaptureProps
* @default false
*/
allowSkipRetake?: boolean;
+ /**
+ * Boolean indicating whether the Add Damage feature is disabled. If disabled, the `Add Damage` button will be hidden.
+ *
+ * @default false
+ */
+ disableAddDamage?: boolean;
}
enum PhotoCaptureScreen {
@@ -109,6 +115,7 @@ export function PhotoCapture({
enableCompliance = true,
useLiveCompliance = false,
allowSkipRetake = false,
+ disableAddDamage = false,
complianceIssues,
lang,
enforceOrientation,
@@ -204,6 +211,7 @@ export function PhotoCapture({
inspectionId,
showCloseButton,
images,
+ disableAddDamage,
};
return (
diff --git a/packages/inspection-capture-web/src/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUD.tsx b/packages/inspection-capture-web/src/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUD.tsx
index 155f3066d..b47572f18 100644
--- a/packages/inspection-capture-web/src/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUD.tsx
+++ b/packages/inspection-capture-web/src/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUD.tsx
@@ -77,6 +77,11 @@ export interface PhotoCaptureHUDProps extends CameraHUDProps {
* The current images taken by the user (ignoring retaken pictures etc.).
*/
images: Image[];
+ * Boolean indicating whether the Add Damage feature is disabled. If disabled, the `Add Damage` button will be hidden.
+ *
+ * @default false
+ */
+ disableAddDamage?: boolean;
}
/**
@@ -102,6 +107,7 @@ export function PhotoCaptureHUD({
handle,
cameraPreview,
images,
+ disableAddDamage,
}: PhotoCaptureHUDProps) {
const { t } = useTranslation();
const [showCloseModal, setShowCloseModal] = useState(false);
@@ -135,6 +141,7 @@ export function PhotoCaptureHUD({
error={loading.error ?? handle.error}
streamDimensions={handle.dimensions}
images={images}
+ disableAddDamage={disableAddDamage}
/>
);
}
diff --git a/packages/inspection-capture-web/src/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDPreviewSight/AddDamageButton/AddDamageButton.tsx b/packages/inspection-capture-web/src/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDPreviewSight/AddDamageButton/AddDamageButton.tsx
index c88e6d7ae..0b6221eb7 100644
--- a/packages/inspection-capture-web/src/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDPreviewSight/AddDamageButton/AddDamageButton.tsx
+++ b/packages/inspection-capture-web/src/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDPreviewSight/AddDamageButton/AddDamageButton.tsx
@@ -10,18 +10,26 @@ export interface AddDamageButtonProps {
* Callback called when the user presses the button.
*/
onAddDamage?: () => void;
+ /**
+ * Boolean indicating whether the Add Damage feature is disabled. If disabled, the `Add Damage` button will be hidden.
+ *
+ * @default false
+ */
+ disableAddDamage?: boolean;
}
/**
* Custom button displayed in the PhotoCapture Camera HUD that allows user to enter add damage mode.
*/
-export function AddDamageButton({ onAddDamage }: AddDamageButtonProps) {
+export function AddDamageButton({ onAddDamage, disableAddDamage }: AddDamageButtonProps) {
const { t } = useTranslation();
const primaryColor = usePhotoCaptureHUDButtonBackground();
return (
-
+
{
showCloseButton: props.showCloseButton,
onOpenGallery: expect.any(Function),
images,
+ disableAddDamage: props.disableAddDamage,
},
});
diff --git a/packages/inspection-capture-web/test/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDPreviewSight/AddDamageButton.test.tsx b/packages/inspection-capture-web/test/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDPreviewSight/AddDamageButton.test.tsx
index b6ca1585d..396378760 100644
--- a/packages/inspection-capture-web/test/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDPreviewSight/AddDamageButton.test.tsx
+++ b/packages/inspection-capture-web/test/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDPreviewSight/AddDamageButton.test.tsx
@@ -25,4 +25,15 @@ describe('AddDamageButton component', () => {
unmount();
});
+
+ it('should be disable and not visible when disableAddDamage is true', () => {
+ const onAddDamage = jest.fn();
+ const { unmount } = render(
+ ,
+ );
+
+ expectPropsOnChildMock(Button, { style: { visibility: 'hidden' }, disabled: true });
+
+ unmount();
+ });
});