Merge pull request 'CR-6273 implemented.' (#6) from development_sikander into master

Reviewed-on: http://34.17.52.79/Haroon6138/mohemm-flutter-app/pulls/6
master
Sikander Saleem 1 year ago
commit e504bd13e1

@ -539,5 +539,6 @@
"allDocuments": "كافة المستندات",
"expiredDocuments": "المستندات منتهية الصلاحية",
"missingDocuments": "مستندات مفقودة",
"uploadedDocuments": "المستندات التي تم تحميلها"
"uploadedDocuments": "المستندات التي تم تحميلها",
"addAtLeastOneAttachment": "الرجاء إضافة مرفق واحد على الأقل."
}

@ -559,5 +559,6 @@
"searchByUserName": "Search By Username",
"userSearch": "User Search",
"userName": "User Name",
"userId": "UserID"
"userId": "UserID",
"addAtLeastOneAttachment": "Please add at least one attachment."
}

@ -3,8 +3,8 @@ import 'package:mohem_flutter_app/ui/marathon/widgets/question_card.dart';
class ApiConsts {
//static String baseUrl = "http://10.200.204.20:2801/"; // Local server
// static String baseUrl = "https://erptstapp.srca.org.sa"; // SRCA server
// static String baseUrl = "https://uat.hmgwebservices.com"; // UAT server
static String baseUrl = "https://hmgwebservices.com"; // Live server
static String baseUrl = "https://uat.hmgwebservices.com"; // UAT server
// static String baseUrl = "https://hmgwebservices.com"; // Live server
static String baseUrlServices = baseUrl + "/Services/"; // server
// static String baseUrlServices = "https://api.cssynapses.com/tangheem/"; // Live server
static String utilitiesRest = baseUrlServices + "Utilities.svc/REST/";

@ -546,4 +546,5 @@ abstract class LocaleKeys {
static const userSearch ='userSearch';
static const userName ='userName';
static const userId ='userId';
static const addAtLeastOneAttachment ='addAtLeastOneAttachment';
}

@ -2,28 +2,35 @@ class EmployeeDocumentsList {
String? dOCUMENTREQUIREDSTATUS;
String? dOCUMENTSTATUS;
String? dOCUMENTTYPE;
String? dOCUMENTTYPENAME;
String? eNTITLEDTOAPPLYFLAG;
String? fUNCTIONNAME;
EmployeeDocumentsList({
this.dOCUMENTREQUIREDSTATUS,
this.dOCUMENTSTATUS,
this.dOCUMENTTYPE,
this.fUNCTIONNAME,
});
EmployeeDocumentsList(
{this.dOCUMENTREQUIREDSTATUS,
this.dOCUMENTSTATUS,
this.dOCUMENTTYPE,
this.dOCUMENTTYPENAME,
this.eNTITLEDTOAPPLYFLAG,
this.fUNCTIONNAME});
EmployeeDocumentsList.fromJson(Map<String, dynamic> json) {
dOCUMENTREQUIREDSTATUS = json['DOCUMENT_REQUIRED_STATUS'];
dOCUMENTSTATUS = json['DOCUMENT_STATUS'];
dOCUMENTTYPE = json['DOCUMENT_TYPE'];
dOCUMENTTYPENAME = json['DOCUMENT_TYPE_NAME'];
eNTITLEDTOAPPLYFLAG = json['ENTITLED_TO_APPLY_FLAG'];
fUNCTIONNAME = json['FUNCTION_NAME'];
}
Map<String, dynamic> toJson() {
Map<String, dynamic> data = Map<String, dynamic>();
data['DOCUMENT_REQUIRED_STATUS'] = dOCUMENTREQUIREDSTATUS;
data['DOCUMENT_STATUS'] = dOCUMENTSTATUS;
data['DOCUMENT_TYPE'] = dOCUMENTTYPE;
data['FUNCTION_NAME'] = fUNCTIONNAME;
Map<String, dynamic> data = new Map<String, dynamic>();
data['DOCUMENT_REQUIRED_STATUS'] = this.dOCUMENTREQUIREDSTATUS;
data['DOCUMENT_STATUS'] = this.dOCUMENTSTATUS;
data['DOCUMENT_TYPE'] = this.dOCUMENTTYPE;
data['DOCUMENT_TYPE_NAME'] = this.dOCUMENTTYPENAME;
data['ENTITLED_TO_APPLY_FLAG'] = this.eNTITLEDTOAPPLYFLAG;
data['FUNCTION_NAME'] = this.fUNCTIONNAME;
return data;
}
}
}

@ -278,7 +278,6 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
getMenuEntriesList.add(activeDirectoryEntry);
list.add(GetMenuEntriesList(requestType: "ITG_FORMS", prompt: LocaleKeys.itgForms.tr(), menuName: 'ITG_FORMS'));
list.add(GetMenuEntriesList(requestType: "MY_DOCUMENTS", prompt: LocaleKeys.myDocuments.tr(), menuName: 'MY_DOCUMENTS'));
}
menus.add(Menus(getMenuEntriesList[i], list));

@ -207,7 +207,7 @@ class ServicesWidget extends StatelessWidget {
} else if (menuEntry.menuName == "MBL_PERINFO_SS") {
Navigator.of(context).pushNamed(AppRoutes.profile);
return;
} else if (menuEntry.menuName == "MY_DOCUMENTS") {
} else if (menuEntry.menuName!.substring(4, menuEntry.menuName!.length) == "MBL_EMPLOYEE_DOCUMENTS") {
Navigator.pushNamed(context, AppRoutes.myDocuments);
return;
}

@ -32,8 +32,9 @@ class RequestSubmitScreenParams {
String approvalFlag;
String? selectedEmployeeID;
String? popNavigateToSpecificRoute;
bool isAttachmentMandatory;
RequestSubmitScreenParams(this.title, this.transactionId, this.pItemId, this.approvalFlag, {this.selectedEmployeeID, this.popNavigateToSpecificRoute});
RequestSubmitScreenParams(this.title, this.transactionId, this.pItemId, this.approvalFlag, {this.selectedEmployeeID, this.popNavigateToSpecificRoute, this.isAttachmentMandatory = false});
}
class RequestSubmitScreen extends StatefulWidget {
@ -180,7 +181,7 @@ class _RequestSubmitScreenState extends State<RequestSubmitScreen> {
physics: const BouncingScrollPhysics(),
children: [
attachmentView(
LocaleKeys.attachments.tr(),
LocaleKeys.attachments.tr() + (params!.isAttachmentMandatory ? "*" : ""),
),
14.height,
InputWidget(
@ -210,6 +211,11 @@ class _RequestSubmitScreenState extends State<RequestSubmitScreen> {
DefaultButton(
LocaleKeys.submit.tr(),
() {
if (params!.isAttachmentMandatory && attachmentFiles.isEmpty) {
Utils.showToast(LocaleKeys.addAtLeastOneAttachment.tr());
return;
}
showDialog(
context: context,
builder: (cxt) => ConfirmDialog(

@ -95,7 +95,7 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
SubmitEITTransactionList submitEITTransactionList = await MyAttendanceApiClient().submitEitTransaction(dESCFLEXCONTEXTCODE, dynamicParams!.dynamicId, values, empID: dynamicParams!.selectedEmp);
Utils.hideLoading(context);
await Navigator.pushNamed(context, AppRoutes.requestSubmitScreen,
arguments: RequestSubmitScreenParams(LocaleKeys.submit.tr(), submitEITTransactionList.pTRANSACTIONID!, submitEITTransactionList.pITEMKEY!, 'eit'));
arguments: RequestSubmitScreenParams(LocaleKeys.submit.tr(), submitEITTransactionList.pTRANSACTIONID!, submitEITTransactionList.pITEMKEY!, 'eit',isAttachmentMandatory: dynamicParams!.isAttachmentMandatory));
if (!AppState().cancelRequestTrancsection) {
return;
}

@ -20,12 +20,23 @@ class DynamicListViewParams {
String colsURL;
bool isUpdate;
String? popUntilRoute;
bool isAttachmentMandatory;
List<CollectionNotificationEit>? collectionNotificationList;
final String? selectedEmp;
DynamicListViewParams(this.title, this.dynamicId,
{this.selectedEmp, this.uRL = 'GET_EIT_DFF_STRUCTURE', this.requestID = '', this.colsURL = '', this.isUpdate = false, this.collectionNotificationList, this.popUntilRoute});
DynamicListViewParams(
this.title,
this.dynamicId, {
this.selectedEmp,
this.uRL = 'GET_EIT_DFF_STRUCTURE',
this.requestID = '',
this.colsURL = '',
this.isUpdate = false,
this.collectionNotificationList,
this.popUntilRoute,
this.isAttachmentMandatory = false,
});
}
class DynamicListViewScreen extends StatefulWidget {

@ -78,7 +78,8 @@ class _MyDocumentsFragmentState extends State<MyDocumentsFragment> {
Navigator.pushNamed(
context,
AppRoutes.addDynamicInput,
arguments: DynamicListViewParams(documentfilteredList[index].dOCUMENTTYPE!, documentfilteredList[index].fUNCTIONNAME!, selectedEmp: AppState().getUserName),
arguments: DynamicListViewParams(documentfilteredList[index].dOCUMENTTYPE!, documentfilteredList[index].fUNCTIONNAME!,
selectedEmp: AppState().getUserName, isAttachmentMandatory: true),
);
});
},
@ -123,6 +124,9 @@ class _MyDocumentsFragmentState extends State<MyDocumentsFragment> {
Color getColorByDocumentStatus(String status) {
Color _color;
switch (status) {
case "Expired":
_color = MyColors.redA3Color;
break;
case "Exist":
_color = MyColors.greenColor;
break;
@ -143,7 +147,7 @@ class _MyDocumentsFragmentState extends State<MyDocumentsFragment> {
List<EmployeeDocumentsList> list = [];
switch (index) {
case 1:
list = documentsList?.where((element) => element.dOCUMENTSTATUS == "Not Exist").toList() ?? [];
list = documentsList?.where((element) => element.dOCUMENTSTATUS == "Expired").toList() ?? [];
break;
case 2:
list = documentsList?.where((element) => element.dOCUMENTSTATUS == "Missing").toList() ?? [];

@ -42,6 +42,7 @@ class _MyDocumentsScreenState extends State<MyDocumentsScreen> {
documentsList?.clear();
Utils.showLoading(context);
documentsList = await ProfileApiClient().getEmployeeDocuments();
documentsList?.removeWhere((element) => element.eNTITLEDTOAPPLYFLAG!="Y");
Utils.hideLoading(context);
setState(() {});
} catch (ex) {

@ -54,7 +54,7 @@ class MyDocumentItem extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
document.dOCUMENTTYPE!.toText16(),
document.dOCUMENTTYPENAME!.toText16(),
document.dOCUMENTSTATUS!.toText10(color: color),
],
).expanded,

Loading…
Cancel
Save