updates & fixes

fatima
haroon amjad 2 years ago
parent 4ff3a5093b
commit c436908d25

@ -403,6 +403,24 @@ class WorkListApiClient {
}, url, postParams); }, url, postParams);
} }
Future<ITGRequest?> grantITGRequest(String requestType, int taskId, int itemId, String employeeNumber, String newUserEMPId, String comments) async {
String url = "${ApiConsts.cocRest}ITGGrantAccess";
Map<String, dynamic> 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<ITGRequest?> informationITGRequest(String requestType, int taskId, int itemId, String employeeNumber, String newUserEMPId, String comments) async { Future<ITGRequest?> informationITGRequest(String requestType, int taskId, int itemId, String employeeNumber, String newUserEMPId, String comments) async {
String url = "${ApiConsts.cocRest}ITGRequestInformation"; String url = "${ApiConsts.cocRest}ITGRequestInformation";
Map<String, dynamic> postParams = { Map<String, dynamic> postParams = {

@ -431,7 +431,7 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
expand: false, expand: false,
builder: (_, controller) { builder: (_, controller) {
dynamic dmyString = getScheduleShiftsDetailsList!.sCHEDULEDATE; 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( return Column(
children: [ children: [
Container( Container(

@ -86,7 +86,7 @@ class _TodayAttendanceScreenState extends State<TodayAttendanceScreen2> {
child: CircularStepProgressBar( child: CircularStepProgressBar(
totalSteps: 16 * 4, totalSteps: 16 * 4,
currentStep: (model.progress * 100).toInt(), currentStep: (model.progress * 100).toInt(),
selectedColor: MyColors.gradiantEndColor, selectedColor: MyColors.gradiantStartColor,
unselectedColor: MyColors.grey70Color, unselectedColor: MyColors.grey70Color,
child: Center( child: Center(
child: Padding( child: Padding(

@ -74,7 +74,7 @@ class ServicesWidget extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
Expanded( 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)), RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg").paddingOnly(bottom: 4)),
], ],

@ -142,7 +142,7 @@ class MarathonBanner extends StatelessWidget {
bottom: 0, bottom: 0,
child: RotatedBox( child: RotatedBox(
quarterTurns: 4, 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), ).paddingAll(15),
) )
: Positioned( : Positioned(
@ -150,7 +150,7 @@ class MarathonBanner extends StatelessWidget {
left: 0, left: 0,
child: RotatedBox( child: RotatedBox(
quarterTurns: 2, 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), ).paddingAll(15),
), ),
], ],

@ -68,7 +68,7 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
} }
void validateTransaction() async { void validateTransaction() async {
// try { try {
Utils.showLoading(context); Utils.showLoading(context);
List<Map<String, dynamic>> values = getEitDffStructureList!.map((e) { List<Map<String, dynamic>> values = getEitDffStructureList!.map((e) {
String tempVar = e.eSERVICESDV?.pIDCOLUMNNAME ?? ""; String tempVar = e.eSERVICESDV?.pIDCOLUMNNAME ?? "";
@ -114,10 +114,10 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
Utils.showLoading(context); Utils.showLoading(context);
await LeaveBalanceApiClient().cancelHrTransaction(submitEITTransactionList.pTRANSACTIONID!); await LeaveBalanceApiClient().cancelHrTransaction(submitEITTransactionList.pTRANSACTIONID!);
Utils.hideLoading(context); Utils.hideLoading(context);
// } catch (ex) { } catch (ex) {
// Utils.hideLoading(context); Utils.hideLoading(context);
// Utils.handleException(ex, context, null); Utils.handleException(ex, context, null);
// } }
} }
String dESCFLEXCONTEXTCODE = ""; String dESCFLEXCONTEXTCODE = "";

@ -439,7 +439,7 @@ class _ViewAttendanceState extends State<ViewAttendance> {
expand: false, expand: false,
builder: (_, controller) { builder: (_, controller) {
dynamic dmyString = getScheduleShiftsDetailsList!.sCHEDULEDATE; 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( return Column(
children: [ children: [
Container( Container(

@ -383,7 +383,7 @@ class _AddUpdateFamilyMemberState extends State<AddUpdateFamilyMember> {
), ),
); );
} else { } 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) { if (picked != null && picked != selectedDate) {
time = picked; time = picked;
} }

@ -128,7 +128,8 @@ class _FamilyMembersState extends State<FamilyMembers> {
), ),
DefaultButton(LocaleKeys.addNewFamilyMember.tr(), DefaultButton(LocaleKeys.addNewFamilyMember.tr(),
menuEntries.updateButton == 'Y' menuEntries.updateButton == 'Y'
? () async { ?
() async {
Navigator.pushNamed(context, AppRoutes.addUpdateFamilyMember, arguments: {"relationID": relationId, "flag": 1, "actionType": "ADD"}); Navigator.pushNamed(context, AppRoutes.addUpdateFamilyMember, arguments: {"relationID": relationId, "flag": 1, "actionType": "ADD"});
// ProfileScreen(); // ProfileScreen();
} : null).insideContainer, } : null).insideContainer,

@ -76,9 +76,7 @@ class _MyRequestsState extends State<MyRequests> {
}), }),
), ),
12.height, 12.height,
Expanded( getCCPTransactionsList.isNotEmpty ? Expanded(
// todo list don't have data, need to confirm later , because have issues, need fixes
child: ListView.separated( child: ListView.separated(
physics: const BouncingScrollPhysics(), physics: const BouncingScrollPhysics(),
shrinkWrap: true, shrinkWrap: true,
@ -141,7 +139,7 @@ class _MyRequestsState extends State<MyRequests> {
}, },
separatorBuilder: (BuildContext context, int index) => 12.height, separatorBuilder: (BuildContext context, int index) => 12.height,
itemCount: getCCPTransactionsList.length), itemCount: getCCPTransactionsList.length),
), ) : Container(),
], ],
).expanded, ).expanded,
1.divider, 1.divider,

@ -176,8 +176,8 @@ class _OffersAndDiscountsDetailsState extends State<OffersAndDiscountsDetails> {
// // launchUrl(Uri.parse(url!)); // // launchUrl(Uri.parse(url!));
// // } // // }
// ), // ),
getOffersList.description!.toText12(maxLine: 2, color: const Color(0xff535353)), // getOffersList.description!.toText12(maxLine: 2, color: const Color(0xff535353)),
16.height, // 16.height,
getOffersList.discount!.toText14(isBold: true, maxlines: 1), getOffersList.discount!.toText14(isBold: true, maxlines: 1),
8.height, 8.height,
Row( Row(

@ -367,6 +367,12 @@ class _ItgDetailScreenState extends State<ItgDetailScreen> {
case "Answer": case "Answer":
performAction("Answer"); performAction("Answer");
break; 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(() { setState(() {
showFabOptions = false; showFabOptions = false;
@ -525,6 +531,29 @@ class _ItgDetailScreenState extends State<ItgDetailScreen> {
} }
} }
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() { void reloadITG() {
AppState().requestAllList!.removeAt(AppState().itgWorkListIndex!); AppState().requestAllList!.removeAt(AppState().itgWorkListIndex!);
if (AppState().requestAllList!.isEmpty) { if (AppState().requestAllList!.isEmpty) {

@ -226,7 +226,6 @@ class _WorkListScreenState extends State<WorkListScreen> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container(width: double.infinity, height: 1, color: MyColors.lightGreyEFColor),
SizedBox( SizedBox(
height: 40, height: 40,
child: ListView.separated( child: ListView.separated(

@ -476,6 +476,17 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
isUpdate: true, collectionNotificationList: getEitCollectionNotificationBodyList![0].collectionNotification)), isUpdate: true, collectionNotificationList: getEitCollectionNotificationBodyList![0].collectionNotification)),
); );
break; 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": case "APPROVE_AND_FORWARD":
showMyBottomSheet(context, showMyBottomSheet(context,
callBackFunc: reloadWorkList, callBackFunc: reloadWorkList,

@ -140,8 +140,6 @@ class ActionsFragment extends StatelessWidget {
DateTime dateTimeTo = DateUtil.convertSimpleStringDateToDate(actionHistoryList[index].nOTIFICATIONDATE!); DateTime dateTimeTo = DateUtil.convertSimpleStringDateToDate(actionHistoryList[index].nOTIFICATIONDATE!);
DateTime dateTimeFrom = DateUtil.convertSimpleStringDateToDate(actionHistoryList[++index].nOTIFICATIONDATE!); DateTime dateTimeFrom = DateUtil.convertSimpleStringDateToDate(actionHistoryList[++index].nOTIFICATIONDATE!);
Duration duration = dateTimeTo.difference(dateTimeFrom); Duration duration = dateTimeTo.difference(dateTimeFrom);
print(dateTimeTo);
print(dateTimeFrom);
return "Action duration: " + DateUtil.formatDuration(duration); return "Action duration: " + DateUtil.formatDuration(duration);
} }
} }

@ -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/string_extensions.dart';
import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
AppBar AppBarWidget(BuildContext context, PreferredSize AppBarWidget(BuildContext context,
{required String title, {required String title,
bool showHomeButton = true, bool showHomeButton = true,
bool showNotificationButton = false, bool showNotificationButton = false,
bool showMemberButton = false, bool showMemberButton = false,
String? image}) { String? image}) {
return AppBar( return PreferredSize(
leadingWidth: 0, preferredSize: const Size.fromHeight(57.0),
// leading: GestureDetector( child: Column(
// 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: [ children: [
GestureDetector( AppBar(
behavior: HitTestBehavior.opaque, leadingWidth: 0,
onTap: // leading: GestureDetector(
Feedback.wrapForTap(() => Navigator.maybePop(context), context), // behavior: HitTestBehavior.opaque,
child: // onTap: Feedback.wrapForTap(() => Navigator.maybePop(context), context),
const Icon(Icons.arrow_back_ios, color: MyColors.darkIconColor), // 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, Container(width: double.infinity, height: 1, color: MyColors.lightGreyEFColor),
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),
),
],
); );
} }

Loading…
Cancel
Save