Skip to content

Commit

Permalink
Modified the dashboard UI and added app localization to dashboard scr…
Browse files Browse the repository at this point in the history
…een (#326)
  • Loading branch information
GSPrakashNaidu2662 authored Apr 26, 2024
1 parent 8a082af commit 4121bd4
Show file tree
Hide file tree
Showing 14 changed files with 279 additions and 60 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,25 @@ public void getPacketUploadedPendingDetails(@NonNull DashBoardPigeon.Result<Long
}
result.success((long)pendingValues);
}

@Override
public void getPacketCreatedDetails(@NonNull DashBoardPigeon.Result<Long> result) {
int createdPacketsCount = 0;
try{
createdPacketsCount = this.registrationRepository.getAllCreatedPacketStatus();
} catch (Exception e) {
Log.e(getClass().getSimpleName(), "Getting CreatedData failed!" + Arrays.toString(e.getStackTrace()));
}
result.success((long)createdPacketsCount);
}

public void getSyncedPacketDetails(@NonNull DashBoardPigeon.Result<Long> result) {
int syncedPacketsCount = 0;
try{
syncedPacketsCount = this.registrationRepository.findRegistrationCountBySyncedStatus(PacketClientStatus.SYNCED.name());
} catch (Exception e) {
Log.e(getClass().getSimpleName(), "Getting SyncedData failed!" + Arrays.toString(e.getStackTrace()));
}
result.success((long)syncedPacketsCount);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,11 @@ public interface RegistrationDao {
@Query("SELECT COUNT(*) FROM registration where client_status in (:syncedStatus, :approvedStatus)")
int findRegistrationCountBySyncedStatusAndApprovedStatus(String syncedStatus, String approvedStatus);


@Query("SELECT COUNT(*) FROM registration where client_status in (:syncedStatus)")
int findRegistrationCountBySyncedStatus(String syncedStatus);

@Query("SELECT COUNT(*) FROM registration where cr_dtimes < CURRENT_DATE")
int getAllCreatedPacketStatus();

}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ public int getAllRegistrationByPendingStatus(String syncedStatus, String approv
return this.registrationDao.findRegistrationCountBySyncedStatusAndApprovedStatus(syncedStatus, approvedStatus);
}

public int findRegistrationCountBySyncedStatus(String syncedStatus) {
return this.registrationDao.findRegistrationCountBySyncedStatus(syncedStatus);
}

public int getAllCreatedPacketStatus() {
return this.registrationDao.getAllCreatedPacketStatus();
}


public Registration getRegistration(String packetId) {
return this.registrationDao.findOneByPacketId(packetId);
}
Expand Down
10 changes: 10 additions & 0 deletions assets/l10n/app_ar.arb
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,16 @@
"packet_auth_page": "المصادقة",
"acknowledgement_page": "الاعتراف",
"share": "يشارك",
"packets_created": "تم إنشاء الحزم",
"packets_synced": "تمت مزامنة الحزم",
"packets_uploaded": "تم تحميل الحزم",
"users": "المستخدمين",
"user_id": "معرف المستخدم",
"user_name": "اسم المستخدم",
"status": "حالة",
"active_not_onboarded": "نشط - غير مسجل",
"user_inactive": "المستخدم غير نشط",
"onboarded": "على متن الطائرة",
"sync_alert_title": "المزامنة للمتابعة!",
"sync_alert_content": "الجهاز أو المركز غير نشط. قم بتنشيطه والمزامنة للمتابعة.",
"sync_alert_text": "مزامنة"
Expand Down
10 changes: 10 additions & 0 deletions assets/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,16 @@
"packet_auth_page": "Authentication",
"acknowledgement_page": "Acknowledgement",
"share": "SHARE",
"packets_created": "Packets Created",
"packets_synced": "Packets Synced",
"packets_uploaded": "Packets Uploaded",
"users": "Users",
"user_id": "User ID",
"user_name": "User Name",
"status": "Status",
"active_not_onboarded": "Active - Not Onboarded",
"user_inactive": "User Inactive",
"onboarded": "Onboarded",
"sync_alert_title": "Sync to continue!",
"sync_alert_content": "Machine or Center is not active. Activate and Sync to continue.",
"sync_alert_text": "Sync"
Expand Down
10 changes: 10 additions & 0 deletions assets/l10n/app_fr.arb
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,16 @@
"packet_auth_page": "Authentification",
"acknowledgement_page": "Accusé de réception",
"share": "PARTAGER",
"packets_created": "Paquets créés",
"packets_synced": "Paquets synchronisés",
"packets_uploaded": "Paquets téléchargés",
"users": "Utilisatrices",
"user_id": "ID de l'utilisateur",
"user_name": "Nom d'utilisateur",
"status": "Statut",
"active_not_onboarded": "Actif – Non intégré",
"user_inactive": "Utilisateur inactif",
"onboarded": "Intégré",
"sync_alert_title": "Synchronisation pour continuer!",
"sync_alert_content": "La machine ou le centre n'est pas actif. Activez et synchronisez pour continuer.",
"sync_alert_text": "Synchroniser"
Expand Down
10 changes: 10 additions & 0 deletions assets/l10n/app_hi.arb
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,16 @@
"packet_auth_page": "प्रमाणीकरण",
"acknowledgement_page": "पुनर्निर्देशन",
"share": "शेयर",
"packets_created": "पैकेट बनाए गए",
"packets_synced": "पैकेट सिंक किए गए",
"packets_uploaded": "पैकेट अपलोड किए गए",
"users": "उपयोगकर्ताओं",
"user_id": "उपयोगकर्ता पहचान",
"user_name": "उपयोगकर्ता नाम",
"status": "स्थिति",
"active_not_onboarded": "सक्रिय - ऑनबोर्ड नहीं किया गया",
"user_inactive": "उपयोगकर्ता निष्क्रिय",
"onboarded": "जहाज पर चढ़ाया गया",
"sync_alert_title": "जारी रखने के लिए सिंक करें!",
"sync_alert_content": "मशीन या केंद्र सक्रिय नहीं है। जारी रखने के लिए सक्रिय करें और सिंक करें।",
"sync_alert_text": "सिंक"
Expand Down
10 changes: 10 additions & 0 deletions assets/l10n/app_kn.arb
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,16 @@
"packet_auth_page": "ಪ್ರಮಾಣಿಕತೆ",
"acknowledgement_page": "ಅರ್ಹಿಚ್ಛೆ",
"share": "ಶೇರ್ ಮಾಡಿ",
"packets_created": "ಪ್ಯಾಕೆಟ್‌ಗಳನ್ನು ರಚಿಸಲಾಗಿದೆ",
"packets_synced": "ಪ್ಯಾಕೆಟ್‌ಗಳನ್ನು ಸಿಂಕ್ ಮಾಡಲಾಗಿದೆ",
"packets_uploaded": "ಪ್ಯಾಕೆಟ್‌ಗಳನ್ನು ಅಪ್‌ಲೋಡ್ ಮಾಡಲಾಗಿದೆ",
"users": "ಬಳಕೆದಾರರು",
"user_id": "ಬಳಕೆದಾರರ ಗುರುತು",
"user_name": "ಬಳಕೆದಾರ ಹೆಸರು",
"status": "ಸ್ಥಿತಿ",
"active_not_onboarded": "ಸಕ್ರಿಯ - ಆನ್‌ಬೋರ್ಡ್ ಮಾಡಲಾಗಿಲ್ಲ",
"user_inactive": "ಬಳಕೆದಾರ ನಿಷ್ಕ್ರಿಯ",
"onboarded": "ಆನ್‌ಬೋರ್ಡ್ ಮಾಡಲಾಗಿದೆ",
"sync_alert_title": "ಮುಂದುವರಿಸಲು ಸಿಂಕ್ ಮಾಡಿ!",
"sync_alert_content": "ಯಂತ್ರ ಅಥವಾ ಕೇಂದ್ರ ಸಕ್ರಿಯವಿಲ್ಲ. ಮುಂದುವರಿಸಲು ಸಕ್ರಿಯಗೊಳಿಸಿ ಮತ್ತು ಸಿಂಕ್ ಮಾಡಿ.",
"sync_alert_text": "ಸಿಂಕ್ ಮಾಡಿ"
Expand Down
10 changes: 10 additions & 0 deletions assets/l10n/app_ta.arb
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,16 @@
"packet_auth_page": "அங்கீகாரம்",
"acknowledgement_page": "அறிவுசெய்தல்",
"share": "பகிர்",
"packets_created": "தொகுப்புகள் உருவாக்கப்பட்டது",
"packets_synced": "பாக்கெட்டுகள் ஒத்திசைக்கப்பட்டது",
"packets_uploaded": "பாக்கெட்டுகள் பதிவேற்றப்பட்டன",
"users": "பயனர்கள்",
"user_id": "பயனர் ஐடி",
"user_name": "பயனர் பெயர்",
"status": "நிலை",
"active_not_onboarded": "செயலில் - ஆன்போர்டு இல்லை",
"user_inactive": "பயனர் செயலற்றவர்",
"onboarded": "ஏற்றப்பட்டது",
"sync_alert_title": "தொடர ஒத்திசை செய்க!",
"sync_alert_content": "இயந்திரம் அல்லது மையம் செயலில் இல்லை. தொடர செயல்படுத்த மற்றும் ஒத்திசை செய்க.",
"sync_alert_text": "ஒத்திசை"
Expand Down
26 changes: 26 additions & 0 deletions lib/platform_android/dash_board_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,30 @@ class DashBoardImpl implements DashBoard {
}
return packetUploadedPendingData;
}

@override
Future<int> getCreatedPacketDetails() async {
int createdPacketsData = 0;
try{
createdPacketsData = await DashBoardApi().getPacketCreatedDetails();
} on PlatformException {
debugPrint('DashBoardApi call failed');
} catch (e) {
debugPrint('get created packet data failed ${e.toString()}');
}
return createdPacketsData;
}

@override
Future<int> getSyncedPacketDetails() async {
int createdPacketsData = 0;
try{
createdPacketsData = await DashBoardApi().getSyncedPacketDetails();
} on PlatformException {
debugPrint('DashBoardApi call failed');
} catch (e) {
debugPrint('get Synced packet data failed ${e.toString()}');
}
return createdPacketsData;
}
}
4 changes: 4 additions & 0 deletions lib/platform_spi/dash_board.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,9 @@ abstract class DashBoard {

Future<int> getPacketUploadedPendingDetails();

Future<int> getCreatedPacketDetails();

Future<int> getSyncedPacketDetails();

factory DashBoard() => DashBoardImpl();
}
8 changes: 8 additions & 0 deletions lib/provider/registration_task_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,14 @@ class RegistrationTaskProvider with ChangeNotifier {
return await dashBoard.getPacketUploadedPendingDetails();
}

Future<int> getCreatedPacketDetails() async {
return await dashBoard.getCreatedPacketDetails();
}

Future<int> getSyncedPacketDetails() async {
return await dashBoard.getSyncedPacketDetails();
}

Future<List<DashBoardData?>> getDashBoardDetails() async {
return await dashBoard.getDashBoardDetails();
}
Expand Down
Loading

0 comments on commit 4121bd4

Please sign in to comment.