CHANGE_
This commit is contained in:
parent
ce018606ea
commit
4565440151
@ -1,3 +1,3 @@
|
|||||||
API_URL=https://dev.venbait.in/nhance/uat/employeeRest/
|
API_URL=https://venbait.in/nhance/dev/employeeRest/
|
||||||
BASE_HREF=/nhance/app/uat/
|
BASE_HREF=/nhance/app/dev/
|
||||||
ENV=production
|
ENV=development
|
||||||
@ -1,3 +1,3 @@
|
|||||||
API_URL=https://dev.venbait.in/nhance/uat/employeeRest/
|
API_URL=https://venbait.in/nhance/test/employeeRest/
|
||||||
BASE_HREF=/nhance/app/uat/
|
BASE_HREF=/nhance/app/test/
|
||||||
ENV=production
|
ENV=test
|
||||||
3
.env.uat
Normal file
3
.env.uat
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
API_URL=https://dev.venbait.in/nhance/uat/employeeRest/
|
||||||
|
BASE_HREF=/nhance/app/uat/
|
||||||
|
ENV=uat
|
||||||
@ -31,7 +31,7 @@ echo "Loaded BASE_HREF: $BASE_HREF"
|
|||||||
echo "Loaded API_URL: $API_URL"
|
echo "Loaded API_URL: $API_URL"
|
||||||
|
|
||||||
# Build the web app for development with base href
|
# Build the web app for development with base href
|
||||||
flutter build web --release --base-href "$BASE_HREF"
|
flutter build web --release --base-href "$BASE_HREF" --dart-define=ENV=development
|
||||||
|
|
||||||
# Check if the build was successful
|
# Check if the build was successful
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
|
|||||||
@ -31,12 +31,12 @@ echo "Loaded BASE_HREF: $BASE_HREF"
|
|||||||
echo "Loaded API_URL: $API_URL"
|
echo "Loaded API_URL: $API_URL"
|
||||||
|
|
||||||
# Build the web app for production with base href
|
# Build the web app for production with base href
|
||||||
flutter build web --release --base-href "$BASE_HREF"
|
flutter build web --release --base-href "$BASE_HREF" --dart-define=ENV=production
|
||||||
|
|
||||||
# Check if the build was successful
|
# Check if the build was successful
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "Flutter prod build failed"
|
echo "Flutter production build failed"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Flutter prod build succeeded"
|
echo "Flutter production build succeeded"
|
||||||
|
|||||||
@ -31,7 +31,7 @@ echo "Loaded BASE_HREF: $BASE_HREF"
|
|||||||
echo "Loaded API_URL: $API_URL"
|
echo "Loaded API_URL: $API_URL"
|
||||||
|
|
||||||
# Build the web app for the test environment with base href
|
# Build the web app for the test environment with base href
|
||||||
flutter build web --release --base-href "$BASE_HREF"
|
flutter build web --release --base-href "$BASE_HREF" --dart-define=ENV=test
|
||||||
|
|
||||||
# Check if the build was successful
|
# Check if the build was successful
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
|
|||||||
42
build_web_uat.sh
Executable file
42
build_web_uat.sh
Executable file
@ -0,0 +1,42 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Define the path to the .env.uat file
|
||||||
|
ENV_FILE_PATH=".env.uat"
|
||||||
|
|
||||||
|
# Check if the .env.uat file exists
|
||||||
|
if [ ! -f $ENV_FILE_PATH ]; then
|
||||||
|
echo "$ENV_FILE_PATH does not exist"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Copy the .env.uat file to .env
|
||||||
|
cp $ENV_FILE_PATH .env
|
||||||
|
echo "Copied $ENV_FILE_PATH to .env"
|
||||||
|
|
||||||
|
# Verify .env file contains correct values
|
||||||
|
source .env
|
||||||
|
|
||||||
|
if [ -z "$BASE_HREF" ]; then
|
||||||
|
echo "BASE_HREF value is empty"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$API_URL" ]; ]; then
|
||||||
|
echo "API_URL value is empty"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Print loaded values for verification
|
||||||
|
echo "Loaded BASE_HREF: $BASE_HREF"
|
||||||
|
echo "Loaded API_URL: $API_URL"
|
||||||
|
|
||||||
|
# Build the web app for UAT with base href
|
||||||
|
flutter build web --release --base-href "$BASE_HREF" --dart-define=ENV=uat
|
||||||
|
|
||||||
|
# Check if the build was successful
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "Flutter UAT build failed"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Flutter UAT build succeeded"
|
||||||
@ -1326,6 +1326,10 @@ class _addOnsDetailsState extends State<addOnsDetails> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> sendAddOnAPI() async {
|
Future<void> sendAddOnAPI() async {
|
||||||
|
setState(() {
|
||||||
|
isLoading = true;
|
||||||
|
});
|
||||||
|
|
||||||
print('sendAddOnAPI');
|
print('sendAddOnAPI');
|
||||||
if (gpaDataIsEmpty != 0) {
|
if (gpaDataIsEmpty != 0) {
|
||||||
iAgreeForAddOn.add(int.parse(gpaClintPolicyId));
|
iAgreeForAddOn.add(int.parse(gpaClintPolicyId));
|
||||||
@ -1357,14 +1361,25 @@ class _addOnsDetailsState extends State<addOnsDetails> {
|
|||||||
final response = await apiService.sendAddOnToAPI(apiParams);
|
final response = await apiService.sendAddOnToAPI(apiParams);
|
||||||
|
|
||||||
if (response['status'] == 'success') {
|
if (response['status'] == 'success') {
|
||||||
|
setState(() {
|
||||||
|
isLoading = false;
|
||||||
|
isChecked = false;
|
||||||
|
});
|
||||||
|
|
||||||
print('response.statusCode == 200');
|
print('response.statusCode == 200');
|
||||||
ToastHelper.showSuccessToast(context, 'Saved Successfully...');
|
ToastHelper.showSuccessToast(context, 'Saved Successfully...');
|
||||||
} else {
|
} else {
|
||||||
|
setState(() {
|
||||||
|
isLoading = false;
|
||||||
|
});
|
||||||
// Handle other status codes
|
// Handle other status codes
|
||||||
ToastHelper.showErrorToast(context, 'failed to save');
|
ToastHelper.showErrorToast(context, 'failed to save');
|
||||||
print('Request failed with status: ${response['code']}');
|
print('Request failed with status: ${response['code']}');
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
setState(() {
|
||||||
|
isLoading = false;
|
||||||
|
});
|
||||||
// Handle exceptions
|
// Handle exceptions
|
||||||
print('Exception occurred: $e');
|
print('Exception occurred: $e');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -626,6 +626,9 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> sendAddOnAPI() async {
|
Future<void> sendAddOnAPI() async {
|
||||||
|
setState(() {
|
||||||
|
isLoading = false;
|
||||||
|
});
|
||||||
if (addOnsDependentMappedFamilyFloatersArray != null) {
|
if (addOnsDependentMappedFamilyFloatersArray != null) {
|
||||||
dynamic getDependentTrueObjects = addOnsDependentMappedFamilyFloatersArray
|
dynamic getDependentTrueObjects = addOnsDependentMappedFamilyFloatersArray
|
||||||
.where((element) => element['is_value_exist'] == true)
|
.where((element) => element['is_value_exist'] == true)
|
||||||
@ -697,14 +700,24 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
|||||||
final response = await apiService.sendAddOnToAPI(apiParams);
|
final response = await apiService.sendAddOnToAPI(apiParams);
|
||||||
|
|
||||||
if (response['status'] == 'success') {
|
if (response['status'] == 'success') {
|
||||||
|
setState(() {
|
||||||
|
isLoading = false;
|
||||||
|
isChecked = false;
|
||||||
|
});
|
||||||
print('response.statusCode == 200');
|
print('response.statusCode == 200');
|
||||||
ToastHelper.showSuccessToast(context, 'Saved Successfully...');
|
ToastHelper.showSuccessToast(context, 'Saved Successfully...');
|
||||||
} else {
|
} else {
|
||||||
|
setState(() {
|
||||||
|
isLoading = false;
|
||||||
|
});
|
||||||
// Handle other status codes
|
// Handle other status codes
|
||||||
ToastHelper.showErrorToast(context, 'Failed to Save');
|
ToastHelper.showErrorToast(context, 'Failed to Save');
|
||||||
print('Request failed with status: ${response['code']}');
|
print('Request failed with status: ${response['code']}');
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
setState(() {
|
||||||
|
isLoading = false;
|
||||||
|
});
|
||||||
// Handle exceptions
|
// Handle exceptions
|
||||||
print('Exception occurred: $e');
|
print('Exception occurred: $e');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -139,7 +139,7 @@ class _HrPolicyDetailsState extends State<hrPolicyDetails>
|
|||||||
|
|
||||||
Future<void> getEmployeeAndDependence(clintID, getPolicyNo) async {
|
Future<void> getEmployeeAndDependence(clintID, getPolicyNo) async {
|
||||||
// setState(() {
|
// setState(() {
|
||||||
// _isLoading = true;
|
isLoading = true;
|
||||||
// });
|
// });
|
||||||
try {
|
try {
|
||||||
final response = await apiService.getEmployeeAndDependenceToApi(
|
final response = await apiService.getEmployeeAndDependenceToApi(
|
||||||
@ -338,8 +338,10 @@ class _HrPolicyDetailsState extends State<hrPolicyDetails>
|
|||||||
appBar: CustomAppBar(),
|
appBar: CustomAppBar(),
|
||||||
body: Stack(children: [
|
body: Stack(children: [
|
||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.all(20),
|
padding: const EdgeInsets.only(
|
||||||
|
top: 30, bottom: 70, left: 30, right: 30),
|
||||||
color: Color(0xFFEFF3F6),
|
color: Color(0xFFEFF3F6),
|
||||||
|
height: MediaQuery.of(context).size.height,
|
||||||
child: Card(
|
child: Card(
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
@ -714,7 +716,7 @@ class _HrPolicyDetailsState extends State<hrPolicyDetails>
|
|||||||
elevation: 0,
|
elevation: 0,
|
||||||
color: Colors.white, // Set elevation to 0 for no shadow
|
color: Colors.white, // Set elevation to 0 for no shadow
|
||||||
child: PaginatedDataTable(
|
child: PaginatedDataTable(
|
||||||
rowsPerPage: 25, // Adjust rows per page as needed
|
rowsPerPage: filteredData.length, // Adjust rows per page as needed
|
||||||
columns: [
|
columns: [
|
||||||
DataColumn(label: Text('Employee ID')),
|
DataColumn(label: Text('Employee ID')),
|
||||||
DataColumn(label: Text('Name')),
|
DataColumn(label: Text('Name')),
|
||||||
@ -722,6 +724,11 @@ class _HrPolicyDetailsState extends State<hrPolicyDetails>
|
|||||||
DataColumn(label: Text('Date of Birth')),
|
DataColumn(label: Text('Date of Birth')),
|
||||||
DataColumn(label: Text('Gender')),
|
DataColumn(label: Text('Gender')),
|
||||||
DataColumn(label: Text('Mobile No')),
|
DataColumn(label: Text('Mobile No')),
|
||||||
|
DataColumn(label: Text('Date of Joining')),
|
||||||
|
DataColumn(label: Text('Email')),
|
||||||
|
DataColumn(label: Text('SI')),
|
||||||
|
DataColumn(label: Text('Grade')),
|
||||||
|
DataColumn(label: Text('Basic Pay')),
|
||||||
],
|
],
|
||||||
source: _DependenceDataSource0(filteredData, context),
|
source: _DependenceDataSource0(filteredData, context),
|
||||||
),
|
),
|
||||||
@ -749,6 +756,7 @@ class _DependenceDataSource0 extends DataTableSource {
|
|||||||
}
|
}
|
||||||
// Format date of birth to "July 10, 1996"
|
// Format date of birth to "July 10, 1996"
|
||||||
String dob = row['dob'] != null ? formatDateString(row['dob']) : 'N/A';
|
String dob = row['dob'] != null ? formatDateString(row['dob']) : 'N/A';
|
||||||
|
String doj = row['doj'] != null ? formatDateString(row['doj']) : 'N/A';
|
||||||
|
|
||||||
return DataRow(
|
return DataRow(
|
||||||
color: MaterialStateColor.resolveWith(
|
color: MaterialStateColor.resolveWith(
|
||||||
@ -765,6 +773,11 @@ class _DependenceDataSource0 extends DataTableSource {
|
|||||||
DataCell(Text(dob, style: textStyle)),
|
DataCell(Text(dob, style: textStyle)),
|
||||||
DataCell(Text(row['gender'] ?? 'N/A', style: textStyle)),
|
DataCell(Text(row['gender'] ?? 'N/A', style: textStyle)),
|
||||||
DataCell(Text(row['mobile'] ?? 'N/A', style: textStyle)),
|
DataCell(Text(row['mobile'] ?? 'N/A', style: textStyle)),
|
||||||
|
DataCell(Text(doj, style: textStyle)),
|
||||||
|
DataCell(Text(row['email_corporate'] ?? 'N/A', style: textStyle)),
|
||||||
|
DataCell(Text(row['basic_cover_si'] ?? 'N/A', style: textStyle)),
|
||||||
|
DataCell(Text(row['grade'] ?? 'N/A', style: textStyle)),
|
||||||
|
DataCell(Text(row['basic_pay'] ?? 'N/A', style: textStyle)),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,21 +1,21 @@
|
|||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
|
||||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||||
|
|
||||||
import '../home.dart';
|
import '../home.dart';
|
||||||
|
|
||||||
class Environment {
|
class Environment {
|
||||||
static String get fileName {
|
static String get fileName {
|
||||||
const bool isProduction =
|
const String env =
|
||||||
bool.fromEnvironment('dart.vm.product', defaultValue: false);
|
String.fromEnvironment('ENV', defaultValue: 'development');
|
||||||
const bool isTest = bool.fromEnvironment('ENV', defaultValue: false);
|
switch (env) {
|
||||||
|
case 'test':
|
||||||
if (isProduction) {
|
return '.env.test';
|
||||||
return '.env.production';
|
case 'uat':
|
||||||
} else if (isTest) {
|
return '.env.uat';
|
||||||
return '.env.test';
|
case 'production':
|
||||||
} else {
|
return '.env.production';
|
||||||
return '.env.development';
|
default:
|
||||||
|
return '.env.development';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user