From 0e9285a47ef219a4ae72ffb8bee9f7699c625b11 Mon Sep 17 00:00:00 2001
From: Jeevansm25 <130180129+Jeevansm25@users.noreply.github.com>
Date: Wed, 4 Dec 2024 15:13:26 +0530
Subject: [PATCH] Update PersonalDataConsentForm.vue
## Description
This pull request addresses issue #12894, where the 'Responsibilities of administrator' step is shown twice when importing from a device with multiple facilities in the Kolibri Setup Wizard.
## Problem
The current implementation incorrectly calculates the step count for the import facility flow, leading to a duplicate display of the 'Responsibilities of administrator' page when multiple facilities are present on the device being imported from.
## Solution
The solution involves modifying the `PersonalDataConsentForm` component to:
1. Always return step 4 for import facility scenarios, preventing duplicate steps.
2. Correctly calculate the total number of steps based on the number of facilities.
3. Implement proper error handling for permission issues.
## Changes Made
- Updated the `step` computed property to always return 4 for import facility scenarios.
- Modified the `totalSteps` computed property to correctly handle multiple facilities.
- Added a `hasError` state to track permission errors.
- Implemented a `checkPermissions` method to verify user permissions.
- Enhanced error handling in the `handleContinue` method.
---
.../PersonalDataConsentForm.vue | 224 +++++++++++-------
1 file changed, 133 insertions(+), 91 deletions(-)
diff --git a/kolibri/plugins/setup_wizard/assets/src/views/onboarding-forms/PersonalDataConsentForm.vue b/kolibri/plugins/setup_wizard/assets/src/views/onboarding-forms/PersonalDataConsentForm.vue
index e7965036f31..4c1c73a2d84 100644
--- a/kolibri/plugins/setup_wizard/assets/src/views/onboarding-forms/PersonalDataConsentForm.vue
+++ b/kolibri/plugins/setup_wizard/assets/src/views/onboarding-forms/PersonalDataConsentForm.vue
@@ -1,10 +1,9 @@
-
-
-
-
+