diff --git a/lib/api/worklist/worklist_api_client.dart b/lib/api/worklist/worklist_api_client.dart index d999d18..75992e7 100644 --- a/lib/api/worklist/worklist_api_client.dart +++ b/lib/api/worklist/worklist_api_client.dart @@ -403,6 +403,24 @@ class WorkListApiClient { }, url, postParams); } + Future grantITGRequest(String requestType, int taskId, int itemId, String employeeNumber, String newUserEMPId, String comments) async { + String url = "${ApiConsts.cocRest}ITGGrantAccess"; + Map postParams = { + "RequestType": requestType, + "TaskID": taskId, + "ItemID": itemId, + "EmployeeNumber": employeeNumber, + "Comments": "", + "AdditionalFields": null, + "NewUserEMPId":newUserEMPId + }; + postParams.addAll(AppState().postParamsJson); + return await ApiClient().postJsonForObject((json) { + ItgFormsModel responseData = ItgFormsModel.fromJson(json); + return responseData.itgRequest; + }, url, postParams); + } + Future informationITGRequest(String requestType, int taskId, int itemId, String employeeNumber, String newUserEMPId, String comments) async { String url = "${ApiConsts.cocRest}ITGRequestInformation"; Map postParams = { diff --git a/lib/ui/attendance/monthly_attendance_screen.dart b/lib/ui/attendance/monthly_attendance_screen.dart index de35da0..8b62b7f 100644 --- a/lib/ui/attendance/monthly_attendance_screen.dart +++ b/lib/ui/attendance/monthly_attendance_screen.dart @@ -431,7 +431,7 @@ class _MonthlyAttendanceScreenState extends State { expand: false, builder: (_, controller) { dynamic dmyString = getScheduleShiftsDetailsList!.sCHEDULEDATE; - DateTime dateTime1 = DateFormat("MM/dd/yyyy hh:mm:ss a").parse(dmyString); + DateTime dateTime1 = DateFormat("MM/dd/yyyy hh:mm:ss").parse(dmyString); return Column( children: [ Container( diff --git a/lib/ui/landing/today_attendance_screen2.dart b/lib/ui/landing/today_attendance_screen2.dart index 17bb03a..ada652c 100644 --- a/lib/ui/landing/today_attendance_screen2.dart +++ b/lib/ui/landing/today_attendance_screen2.dart @@ -86,7 +86,7 @@ class _TodayAttendanceScreenState extends State { child: CircularStepProgressBar( totalSteps: 16 * 4, currentStep: (model.progress * 100).toInt(), - selectedColor: MyColors.gradiantEndColor, + selectedColor: MyColors.gradiantStartColor, unselectedColor: MyColors.grey70Color, child: Center( child: Padding( diff --git a/lib/ui/landing/widget/services_widget.dart b/lib/ui/landing/widget/services_widget.dart index ae24dde..2333c18 100644 --- a/lib/ui/landing/widget/services_widget.dart +++ b/lib/ui/landing/widget/services_widget.dart @@ -74,7 +74,7 @@ class ServicesWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.end, children: [ Expanded( - child: data.homeMenus![parentIndex].menuEntiesList[index].prompt!.toText10(isBold: true), + child: data.homeMenus![parentIndex].menuEntiesList[index].prompt!.toText11(isBold: true), ), RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg").paddingOnly(bottom: 4)), ], diff --git a/lib/ui/marathon/widgets/marathon_banner.dart b/lib/ui/marathon/widgets/marathon_banner.dart index 5da5ed2..55ff715 100644 --- a/lib/ui/marathon/widgets/marathon_banner.dart +++ b/lib/ui/marathon/widgets/marathon_banner.dart @@ -142,7 +142,7 @@ class MarathonBanner extends StatelessWidget { bottom: 0, child: RotatedBox( quarterTurns: 4, - child: SvgPicture.asset("assets/images/arrow_next.svg", color: MyColors.darkDigitColor), + child: SvgPicture.asset("assets/images/arrow_next.svg", color: MyColors.whiteColor), ).paddingAll(15), ) : Positioned( @@ -150,7 +150,7 @@ class MarathonBanner extends StatelessWidget { left: 0, child: RotatedBox( quarterTurns: 2, - child: SvgPicture.asset("assets/images/arrow_next.svg", color: MyColors.darkDigitColor), + child: SvgPicture.asset("assets/images/arrow_next.svg", color: MyColors.whiteColor), ).paddingAll(15), ), ], diff --git a/lib/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart b/lib/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart index 045b808..e602c21 100644 --- a/lib/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart +++ b/lib/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart @@ -68,7 +68,7 @@ class _DynamicInputScreenState extends State { } void validateTransaction() async { - // try { + try { Utils.showLoading(context); List> values = getEitDffStructureList!.map((e) { String tempVar = e.eSERVICESDV?.pIDCOLUMNNAME ?? ""; @@ -114,10 +114,10 @@ class _DynamicInputScreenState extends State { Utils.showLoading(context); await LeaveBalanceApiClient().cancelHrTransaction(submitEITTransactionList.pTRANSACTIONID!); Utils.hideLoading(context); - // } catch (ex) { - // Utils.hideLoading(context); - // Utils.handleException(ex, context, null); - // } + } catch (ex) { + Utils.hideLoading(context); + Utils.handleException(ex, context, null); + } } String dESCFLEXCONTEXTCODE = ""; diff --git a/lib/ui/my_team/view_attendance.dart b/lib/ui/my_team/view_attendance.dart index 90414d1..0896d5e 100644 --- a/lib/ui/my_team/view_attendance.dart +++ b/lib/ui/my_team/view_attendance.dart @@ -439,7 +439,7 @@ class _ViewAttendanceState extends State { expand: false, builder: (_, controller) { dynamic dmyString = getScheduleShiftsDetailsList!.sCHEDULEDATE; - DateTime dateTime1 = DateFormat("MM/dd/yyyy hh:mm:ss a").parse(dmyString); + DateTime dateTime1 = DateFormat("MM/dd/yyyy hh:mm:ss").parse(dmyString); return Column( children: [ Container( diff --git a/lib/ui/profile/add_update_family_member.dart b/lib/ui/profile/add_update_family_member.dart index 528e38d..36a8394 100644 --- a/lib/ui/profile/add_update_family_member.dart +++ b/lib/ui/profile/add_update_family_member.dart @@ -383,7 +383,7 @@ class _AddUpdateFamilyMemberState extends State { ), ); } else { - DateTime? picked = await showDatePicker(context: context, initialDate: selectedDate, initialEntryMode: DatePickerEntryMode.calendarOnly, firstDate: DateTime(2015, 8), lastDate: DateTime(2101)); + DateTime? picked = await showDatePicker(context: context, initialDate: selectedDate, initialEntryMode: DatePickerEntryMode.calendarOnly, firstDate: DateTime(1920, 1), lastDate: DateTime.now()); if (picked != null && picked != selectedDate) { time = picked; } diff --git a/lib/ui/profile/family_members.dart b/lib/ui/profile/family_members.dart index fd7bd13..25f62c0 100644 --- a/lib/ui/profile/family_members.dart +++ b/lib/ui/profile/family_members.dart @@ -128,7 +128,8 @@ class _FamilyMembersState extends State { ), DefaultButton(LocaleKeys.addNewFamilyMember.tr(), menuEntries.updateButton == 'Y' - ? () async { + ? + () async { Navigator.pushNamed(context, AppRoutes.addUpdateFamilyMember, arguments: {"relationID": relationId, "flag": 1, "actionType": "ADD"}); // ProfileScreen(); } : null).insideContainer, diff --git a/lib/ui/screens/my_requests/my_requests.dart b/lib/ui/screens/my_requests/my_requests.dart index f9d8d39..dd6147f 100644 --- a/lib/ui/screens/my_requests/my_requests.dart +++ b/lib/ui/screens/my_requests/my_requests.dart @@ -76,9 +76,7 @@ class _MyRequestsState extends State { }), ), 12.height, - Expanded( - // todo list don't have data, need to confirm later , because have issues, need fixes - + getCCPTransactionsList.isNotEmpty ? Expanded( child: ListView.separated( physics: const BouncingScrollPhysics(), shrinkWrap: true, @@ -141,7 +139,7 @@ class _MyRequestsState extends State { }, separatorBuilder: (BuildContext context, int index) => 12.height, itemCount: getCCPTransactionsList.length), - ), + ) : Container(), ], ).expanded, 1.divider, diff --git a/lib/ui/screens/offers_and_discounts/offers_and_discounts_details.dart b/lib/ui/screens/offers_and_discounts/offers_and_discounts_details.dart index 9a308ba..325f4f3 100644 --- a/lib/ui/screens/offers_and_discounts/offers_and_discounts_details.dart +++ b/lib/ui/screens/offers_and_discounts/offers_and_discounts_details.dart @@ -176,8 +176,8 @@ class _OffersAndDiscountsDetailsState extends State { // // launchUrl(Uri.parse(url!)); // // } // ), - getOffersList.description!.toText12(maxLine: 2, color: const Color(0xff535353)), - 16.height, + // getOffersList.description!.toText12(maxLine: 2, color: const Color(0xff535353)), + // 16.height, getOffersList.discount!.toText14(isBold: true, maxlines: 1), 8.height, Row( diff --git a/lib/ui/work_list/itg_detail_screen.dart b/lib/ui/work_list/itg_detail_screen.dart index bbb0267..cf33648 100644 --- a/lib/ui/work_list/itg_detail_screen.dart +++ b/lib/ui/work_list/itg_detail_screen.dart @@ -367,6 +367,12 @@ class _ItgDetailScreenState extends State { case "Answer": performAction("Answer"); break; + case "ReportGenerated": + performDataCorrectionORReportGeneratedAction(requestDetails!.requestType!, requestDetails!.iD!, requestDetails!.itemID!, AppState().memberInformationList?.eMPLOYEENUMBER ?? ""); + break; + case "DataCorrected": + performDataCorrectionORReportGeneratedAction(requestDetails!.requestType!, requestDetails!.iD!, requestDetails!.itemID!, AppState().memberInformationList?.eMPLOYEENUMBER ?? ""); + break; } setState(() { showFabOptions = false; @@ -525,6 +531,29 @@ class _ItgDetailScreenState extends State { } } + void performDataCorrectionORReportGeneratedAction(String requestType, int taskId, int itemId, String employeeNumber) async { + try { + Utils.showLoading(context); + ITGRequest? itgRequest = await WorkListApiClient().grantITGRequest(requestType, taskId, itemId, employeeNumber, "", ""); + Utils.hideLoading(context); + Utils.showToast(LocaleKeys.yourChangeHasBeenSavedSuccessfully.tr()); + AppState().requestAllList!.removeAt(AppState().itgWorkListIndex!); + if (AppState().requestAllList!.isEmpty) { + Navigator.pop(context, "delegate_reload"); + } else { + if (AppState().requestAllList!.length <= AppState().itgWorkListIndex!) { + Navigator.pop(context, "delegate_reload"); + } else { + requestDetails = null; + getDataFromState(); + } + } + } catch (ex) { + Utils.hideLoading(context); + Utils.handleException(ex, context, null); + } + } + void reloadITG() { AppState().requestAllList!.removeAt(AppState().itgWorkListIndex!); if (AppState().requestAllList!.isEmpty) { diff --git a/lib/ui/work_list/work_list_screen.dart b/lib/ui/work_list/work_list_screen.dart index 8efd789..f9f8d91 100644 --- a/lib/ui/work_list/work_list_screen.dart +++ b/lib/ui/work_list/work_list_screen.dart @@ -226,7 +226,6 @@ class _WorkListScreenState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container(width: double.infinity, height: 1, color: MyColors.lightGreyEFColor), SizedBox( height: 40, child: ListView.separated( diff --git a/lib/ui/work_list/worklist_detail_screen.dart b/lib/ui/work_list/worklist_detail_screen.dart index 3c05204..824edc3 100644 --- a/lib/ui/work_list/worklist_detail_screen.dart +++ b/lib/ui/work_list/worklist_detail_screen.dart @@ -476,6 +476,17 @@ class _WorkListDetailScreenState extends State { isUpdate: true, collectionNotificationList: getEitCollectionNotificationBodyList![0].collectionNotification)), ); break; + case "CONTINUE_ACTION": + showMyBottomSheet( + context, + callBackFunc: reloadWorkList, + child: UpdateContinueSheet( + workListData: workListData, + getEitCollectionNotificationBodyList: getEitCollectionNotificationBodyList, + dynamicParams: DynamicListViewParams(workListData!.sUBJECT!, workListData!.fUNCTIONNAME!, + isUpdate: true, collectionNotificationList: getEitCollectionNotificationBodyList![0].collectionNotification)), + ); + break; case "APPROVE_AND_FORWARD": showMyBottomSheet(context, callBackFunc: reloadWorkList, diff --git a/lib/ui/work_list/worklist_fragments/actions_fragment.dart b/lib/ui/work_list/worklist_fragments/actions_fragment.dart index 439888b..58e9ac7 100644 --- a/lib/ui/work_list/worklist_fragments/actions_fragment.dart +++ b/lib/ui/work_list/worklist_fragments/actions_fragment.dart @@ -140,8 +140,6 @@ class ActionsFragment extends StatelessWidget { DateTime dateTimeTo = DateUtil.convertSimpleStringDateToDate(actionHistoryList[index].nOTIFICATIONDATE!); DateTime dateTimeFrom = DateUtil.convertSimpleStringDateToDate(actionHistoryList[++index].nOTIFICATIONDATE!); Duration duration = dateTimeTo.difference(dateTimeFrom); - print(dateTimeTo); - print(dateTimeFrom); return "Action duration: " + DateUtil.formatDuration(duration); } } diff --git a/lib/widgets/app_bar_widget.dart b/lib/widgets/app_bar_widget.dart index 745dedf..35c93ba 100644 --- a/lib/widgets/app_bar_widget.dart +++ b/lib/widgets/app_bar_widget.dart @@ -6,65 +6,73 @@ import 'package:mohem_flutter_app/extensions/int_extensions.dart'; import 'package:mohem_flutter_app/extensions/string_extensions.dart'; import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; -AppBar AppBarWidget(BuildContext context, +PreferredSize AppBarWidget(BuildContext context, {required String title, bool showHomeButton = true, bool showNotificationButton = false, bool showMemberButton = false, String? image}) { - return AppBar( - leadingWidth: 0, - // leading: GestureDetector( - // behavior: HitTestBehavior.opaque, - // onTap: Feedback.wrapForTap(() => Navigator.maybePop(context), context), - // child: const Icon(Icons.arrow_back_ios, color: MyColors.darkIconColor), - // ), - //titleSpacing: -1.44, - title: Row( + return PreferredSize( + preferredSize: const Size.fromHeight(57.0), + child: Column( children: [ - GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: - Feedback.wrapForTap(() => Navigator.maybePop(context), context), - child: - const Icon(Icons.arrow_back_ios, color: MyColors.darkIconColor), + AppBar( + leadingWidth: 0, + // leading: GestureDetector( + // behavior: HitTestBehavior.opaque, + // onTap: Feedback.wrapForTap(() => Navigator.maybePop(context), context), + // child: const Icon(Icons.arrow_back_ios, color: MyColors.darkIconColor), + // ), + //titleSpacing: -1.44, + title: Row( + children: [ + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: + Feedback.wrapForTap(() => Navigator.maybePop(context), context), + child: + const Icon(Icons.arrow_back_ios, color: MyColors.darkIconColor), + ), + 4.width, + if (image != null) SvgPicture.asset( + image, + height: 40, + width: 40, + ), + if (image != null) 14.width, + title.toText24(color: MyColors.darkTextColor, isBold: true).expanded, + ], + ), + centerTitle: false, + elevation: 0, + backgroundColor: Colors.white, + actions: [ + if (showHomeButton) + IconButton( + onPressed: () { + Navigator.popUntil( + context, ModalRoute.withName(AppRoutes.dashboard)); + }, + icon: const Icon(Icons.home, color: MyColors.darkIconColor), + ), + if (showNotificationButton) + IconButton( + onPressed: () { + Navigator.pushNamed(context, AppRoutes.worklistSettings); + }, + icon: const Icon(Icons.notifications, color: MyColors.textMixColor), + ), + if (showMemberButton) + IconButton( + onPressed: () { + Navigator.pushNamed(context, AppRoutes.subordinateLeave); + }, + icon: const Icon(Icons.people, color: MyColors.textMixColor), + ), + ], ), - 4.width, - if (image != null) SvgPicture.asset( - image, - height: 40, - width: 40, - ), - if (image != null) 14.width, - title.toText24(color: MyColors.darkTextColor, isBold: true).expanded, + Container(width: double.infinity, height: 1, color: MyColors.lightGreyEFColor), ], ), - centerTitle: false, - elevation: 0, - backgroundColor: Colors.white, - actions: [ - if (showHomeButton) - IconButton( - onPressed: () { - Navigator.popUntil( - context, ModalRoute.withName(AppRoutes.dashboard)); - }, - icon: const Icon(Icons.home, color: MyColors.darkIconColor), - ), - if (showNotificationButton) - IconButton( - onPressed: () { - Navigator.pushNamed(context, AppRoutes.worklistSettings); - }, - icon: const Icon(Icons.notifications, color: MyColors.textMixColor), - ), - if (showMemberButton) - IconButton( - onPressed: () { - Navigator.pushNamed(context, AppRoutes.subordinateLeave); - }, - icon: const Icon(Icons.people, color: MyColors.textMixColor), - ), - ], ); }