Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disabled employee id input #1429

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,6 @@ export const newConfig = [
withoutLabel: true,
},

{
type: "component",
component: "HRBanner",
key: "Banner1",
withoutLabel: true,
texts: {
headerCaption: "Info",
header: "HR_EMP_ID_MESSAGE",
},
},
],
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const SelectEmployeeEmailId = ({ t, config, onSelect, formData = {}, userType, r
const inputs = [
{
label: "HR_EMAIL_LABEL",
isMandatory: true,
type: "email",
name: "emailId",
validation: {
Expand All @@ -18,6 +19,7 @@ const SelectEmployeeEmailId = ({ t, config, onSelect, formData = {}, userType, r

function setValue(value, input) {
onSelect(config.key, { ...formData[config.key], [input]: value });
onSelect("SelectEmployeeId", { code: value });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Potential Impact of Using Email as Employee ID

The SelectEmployeeId is utilized across multiple modules, including:

  • Module.js
  • createEmployee.js
  • EditEmployee/EditForm.js
  • Configuration files in config.js

Changing the value to use the email as the employee ID may lead to inconsistencies and unexpected behaviors in these areas. Please verify that this change is intentional and assess its impact on the overall application functionality.

🔗 Analysis chain

Clarify the usage of email as employee ID

This change appears to use the email value for both email and employee ID selection. However, this seems to contradict the PR objective of disabling the employee ID input. Could you please clarify:

  1. Is it intentional to use the email as the employee ID?
  2. Are there any implications for other parts of the application that might expect an actual employee ID?
  3. Should we remove this line entirely if the employee ID is no longer needed?

To help understand the usage of SelectEmployeeId, let's check for its occurrences in the codebase:


To ensure that SelectEmployeeId is not used elsewhere in the codebase, let's perform a comprehensive search:

[/run_scripts]

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for usages of SelectEmployeeId
rg --type js 'SelectEmployeeId'

Length of output: 32


Script:

#!/bin/bash
# Search for any occurrences of SelectEmployeeId across all files
rg 'SelectEmployeeId'

Length of output: 2083

}

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ const SelectEmployeeId = ({ t, config, onSelect, formData = {}, userType, regist
{input.isMandatory ? " * " : null}
</CardLabel>
<div className="field">
<TextInput
<TextInput
key={input.name}
value={formData && formData[config.key] ? formData[config.key][input.name] : undefined}
value={formData && formData[config.key] ? formData[config.key][input.name] : formData?.SelectEmployeeId?.code || ""}
onChange={(e) => setValue(e.target.value, input.name)}
disable={isEdit}
disabled={isEdit}
disable={true}
defaultValue={undefined}
{...input.validation}
/>
Expand Down