Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Commit

Permalink
Merge branch 'develop' into pay-gov-merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Hari-egov authored Jul 1, 2024
2 parents 498b79b + 80149e1 commit 093e8c4
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -593,8 +593,8 @@ class _ExpenseDetailsState extends State<ExpenseDetails> {
fontSize: 19,
color: expensesDetailsProvider
.expenditureDetails
.allowEdit ==
true && expensesDetailsProvider.expenditureDetails.isBillPaid == false
.allowEdit ==
true && expensesDetailsProvider.expenditureDetails.isBillPaid == false
? Colors.black
: Colors.grey,
fontWeight:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
.employee-card-input-only {
}
.employee-card-input-only .employee-card-input {
border: none;
@apply mb-lg pl-sm outline-none block border w-full h-12 border-input-border border-solid bg-white leading-10 text-form-field text-text-primary;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ const MultiSelectDropdown = ({

useEffect(()=>{
if (alreadyQueuedSelectedState?.length === filteredOptions?.length){
if(alreadyQueuedSelectedState?.length != 0 && filteredOptions?.length != 0){
setIsSelected(true)
}
}else{
setIsSelected(false)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,25 @@ const EditForm = ({ tenantId, data }) => {
return validEmail && name.match(Digit.Utils.getPattern("Name"));
};


function hasUniqueTenantIds(items) {
// Create a Set to efficiently store unique tenantIds
const uniqueTenantIds = new Set();
// Iterate through each item
for (const item of items) {
const tenantId = item.tenantId;
// Check if tenantId already exists in the Set
if (uniqueTenantIds.has(tenantId)) {
// Duplicate found, return false
return false;
}
// Add unique tenantId to the Set
uniqueTenantIds.add(tenantId);
}
// No duplicates found, all tenantIds are unique
return true;
}

const onFormValueChange = (setValue = true, formData) => {
if (formData?.SelectEmployeePhoneNumber?.mobileNumber) {
setMobileNumber(formData?.SelectEmployeePhoneNumber?.mobileNumber);
Expand All @@ -132,6 +151,7 @@ const EditForm = ({ tenantId, data }) => {
}
}
}

if (
formData?.SelectEmployeeGender?.gender.code &&
formData?.SelectEmployeeName?.employeeName &&
Expand All @@ -142,7 +162,8 @@ const EditForm = ({ tenantId, data }) => {
&&
checkfield &&
phonecheck &&
checkMailNameNum(formData)
checkMailNameNum(formData)&&
hasUniqueTenantIds(formData?.Jurisdictions)
) {
setSubmitValve(true);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,24 @@ const CreateEmployee = () => {
const employeeCreateSession = Digit.Hooks.useSessionStorage("NEW_EMPLOYEE_CREATE", {});
const [sessionFormData, setSessionFormData, clearSessionFormData] = employeeCreateSession;

function hasUniqueTenantIds(items) {
// Create a Set to efficiently store unique tenantIds
const uniqueTenantIds = new Set();
// Iterate through each item
for (const item of items) {
const tenantId = item.tenantId;
// Check if tenantId already exists in the Set
if (uniqueTenantIds.has(tenantId)) {
// Duplicate found, return false
return false;
}
// Add unique tenantId to the Set
uniqueTenantIds.add(tenantId);
}
// No duplicates found, all tenantIds are unique
return true;
}

const onFormValueChange = (setValue = true, formData) => {
if (!_.isEqual(sessionFormData, formData)) {
setSessionFormData({ ...sessionFormData, ...formData });
Expand Down Expand Up @@ -120,7 +138,8 @@ const CreateEmployee = () => {
&&
checkfield &&
phonecheck &&
checkMailNameNum(formData)
checkMailNameNum(formData) &&
hasUniqueTenantIds(formData?.Jurisdictions)
) {
setSubmitValve(true);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ const EmployeeApp = ({ path, url, userType }) => {
/ <span>{location.pathname === `/${window?.contextPath}/employee/hrms/inbox` ? t("HR_COMMON_HEADER") : t("HR_COMMON_HEADER")}</span>
</p>
<div class="back-btn2 " onClick={() => history.goBack()}><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="black" width="19px"><path d="M24 0v24H0V0h24z" fill="none" opacity=".87"></path><path d="M14 7l-5 5 5 5V7z"></path></svg><p>Back</p></div>

<PrivateRoute
path={`${path}/inbox`}
component={() => (
Expand Down

0 comments on commit 093e8c4

Please sign in to comment.