-
Notifications
You must be signed in to change notification settings - Fork 19
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
added the Workbench module patches which was done as part of Mukta ro… #1967
base: develop
Are you sure you want to change the base?
Conversation
📝 Walkthrough📝 WalkthroughWalkthroughThe pull request introduces a series of enhancements across multiple components within the micro-ui application. Key updates include modifications to the Changes
Possibly related PRs
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (1)micro-ui/web/micro-ui-internals/packages/modules/workbench/src/hooks/index.js (1)Pattern 🔇 Additional comments (2)micro-ui/web/micro-ui-internals/packages/modules/workbench/src/hooks/index.js (2)
The import of
The new
✅ Verification successfulLet me check the actual implementation and usage of this hook to provide a more detailed verification. Integration verified and properly implemented The hook is correctly integrated and follows best practices:
While test coverage is missing, the implementation is sound and follows the established patterns for MDMS popup search functionality. 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Verify the hook's usage and test coverage
# Check for hook usage in MDMS popup related files
echo "Checking hook usage in MDMS popup components:"
rg -l "useMDMSPopupSearch" --type js
# Check for corresponding test files
echo -e "\nChecking for test coverage:"
fd -e test.js -e spec.js inbox
Length of output: 493 Script: #!/bin/bash
# Check the hook implementation
echo "Hook implementation in inbox.js:"
cat "micro-ui/web/micro-ui-internals/packages/modules/workbench/src/hooks/inbox.js"
echo -e "\nUsage in searchMDMSConfigPopup.js:"
cat "micro-ui/web/micro-ui-internals/packages/modules/workbench/src/configs/searchMDMSConfigPopup.js"
Length of output: 9250 Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 20
🧹 Outside diff range comments (4)
micro-ui/web/micro-ui-internals/packages/modules/workbench/src/pages/employee/MDMSSearchv2.js (2)
Line range hint
112-131
: Optimize dropdown options sorting logic and add safety checksThe current implementation has redundant conditional checks and potential runtime safety issues.
Consider refactoring to:
- dropDownOptions = - dropDownOptions?.length > 0 && - Digit?.Customizations?.["commonUiConfig"]?.["SearchMDMSv2Config"]?.[schemaCodeToValidate]?.sortValidDatesFirst(dropDownOptions) - ? Digit?.Customizations?.["commonUiConfig"]?.["SearchMDMSv2Config"]?.[schemaCodeToValidate]?.sortValidDatesFirst(dropDownOptions) - : dropDownOptions; + const sortFn = Digit?.Customizations?.["commonUiConfig"]?.["SearchMDMSv2Config"]?.[schemaCodeToValidate]?.sortValidDatesFirst; + dropDownOptions = dropDownOptions?.length > 0 && typeof sortFn === 'function' ? sortFn(dropDownOptions) : dropDownOptions;
Line range hint
200-204
: Improve conditional readability and function namingThe current condition chain is hard to read and the function name has grammatical issues.
Consider refactoring to:
- updatedConfig && Digit.Utils.didEmployeeHasAtleastOneRole(updatedConfig?.actionRoles) && Digit.Utils.didEmployeeisAllowed(master,modulee) + const hasRequiredRole = Digit.Utils.didEmployeeHasAtleastOneRole(updatedConfig?.actionRoles); + const isAllowedAccess = Digit.Utils.didEmployeeisAllowed(master, modulee); + updatedConfig && hasRequiredRole && isAllowedAccessAlso, consider renaming the function to
isEmployeeAllowed
for better grammar.🧰 Tools
🪛 Biome (1.9.4)
[error] 192-192: Template literals are preferred over string concatenation.
Unsafe fix: Use a template literal.
(lint/style/useTemplate)
[error] 198-198: Template literals are preferred over string concatenation.
Unsafe fix: Use a template literal.
(lint/style/useTemplate)
micro-ui/web/micro-ui-internals/packages/modules/workbench/src/pages/employee/index.js (1)
Line range hint
91-108
: Simplify session storage managementThe session storage clearing logic is complex and scattered. Consider consolidating this into a custom hook for better maintainability.
const useSessionStorageCleanup = (prefixes, dependencies) => { useEffect(() => { const clearSessionStorageWithPrefix = (prefix) => { Object.keys(sessionStorage) .filter(key => key.startsWith(`Digit.${prefix}`)) .forEach(key => sessionStorage.removeItem(key)); }; const currentUrl = window.location.href; const cleanupRules = { 'MDMS_add': !currentUrl.includes('mdms-add-v2') && !currentUrl.includes('mdms-add-v4') && !currentUrl.includes('mdms-view'), 'MDMS_view': !currentUrl.includes('mdms-view'), 'MDMS_edit': !currentUrl.includes('mdms-edit') }; prefixes.forEach(prefix => { if (cleanupRules[prefix]) { clearSessionStorageWithPrefix(prefix); } }); }, dependencies); };micro-ui/web/micro-ui-internals/packages/modules/workbench/src/utils/index.js (1)
Line range hint
194-279
: Add unit tests for date handling functionsThe date handling functions are critical components that should be thoroughly tested. Consider adding unit tests to cover:
- Different timezone scenarios
- Edge cases for start/end of day
- Various key parameter values
- Date format conversions
Would you like me to help create a test suite for these date handling functions?
🧰 Tools
🪛 Biome (1.9.4)
[error] 200-200: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.The declaration is defined in this switch clause:
Unsafe fix: Wrap the declaration in a block.
(lint/correctness/noSwitchDeclarations)
[error] 201-201: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.The declaration is defined in this switch clause:
Unsafe fix: Wrap the declaration in a block.
(lint/correctness/noSwitchDeclarations)
[error] 206-206: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.The declaration is defined in this switch clause:
Unsafe fix: Wrap the declaration in a block.
(lint/correctness/noSwitchDeclarations)
[error] 196-196: Reassigning a function parameter is confusing.
The parameter is declared here:
Use a local variable instead.
(lint/style/noParameterAssign)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
⛔ Files ignored due to path filters (10)
micro-ui/web/core/package.json
is excluded by!**/*.json
micro-ui/web/micro-ui-internals/example/package.json
is excluded by!**/*.json
micro-ui/web/micro-ui-internals/package.json
is excluded by!**/*.json
micro-ui/web/micro-ui-internals/packages/modules/core/package.json
is excluded by!**/*.json
micro-ui/web/micro-ui-internals/packages/modules/dss/package.json
is excluded by!**/*.json
micro-ui/web/micro-ui-internals/packages/modules/workbench/package.json
is excluded by!**/*.json
micro-ui/web/micro-ui-internals/packages/react-components/package.json
is excluded by!**/*.json
micro-ui/web/package.json
is excluded by!**/*.json
micro-ui/web/sandbox/package.json
is excluded by!**/*.json
micro-ui/web/workbench/package.json
is excluded by!**/*.json
📒 Files selected for processing (13)
micro-ui/web/micro-ui-internals/packages/modules/workbench/src/components/DigitJSONForm.js
(4 hunks)micro-ui/web/micro-ui-internals/packages/modules/workbench/src/components/MultiSelect.js
(5 hunks)micro-ui/web/micro-ui-internals/packages/modules/workbench/src/configs/UICustomizations.js
(4 hunks)micro-ui/web/micro-ui-internals/packages/modules/workbench/src/configs/searchMDMSConfigPopup.js
(1 hunks)micro-ui/web/micro-ui-internals/packages/modules/workbench/src/hooks/inbox.js
(1 hunks)micro-ui/web/micro-ui-internals/packages/modules/workbench/src/hooks/index.js
(2 hunks)micro-ui/web/micro-ui-internals/packages/modules/workbench/src/pages/employee/MDMSAddV2.js
(2 hunks)micro-ui/web/micro-ui-internals/packages/modules/workbench/src/pages/employee/MDMSEdit.js
(4 hunks)micro-ui/web/micro-ui-internals/packages/modules/workbench/src/pages/employee/MDMSSearchv2.js
(4 hunks)micro-ui/web/micro-ui-internals/packages/modules/workbench/src/pages/employee/MDMSView.js
(4 hunks)micro-ui/web/micro-ui-internals/packages/modules/workbench/src/pages/employee/index.js
(4 hunks)micro-ui/web/micro-ui-internals/packages/modules/workbench/src/utils/index.js
(4 hunks)micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/BreadCrumb.js
(2 hunks)
🧰 Additional context used
📓 Path-based instructions (13)
micro-ui/web/micro-ui-internals/packages/modules/workbench/src/configs/searchMDMSConfigPopup.js (1)
Pattern **/*.js
: check
micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/BreadCrumb.js (1)
Pattern **/*.js
: check
micro-ui/web/micro-ui-internals/packages/modules/workbench/src/hooks/index.js (1)
Pattern **/*.js
: check
micro-ui/web/micro-ui-internals/packages/modules/workbench/src/pages/employee/MDMSSearchv2.js (1)
Pattern **/*.js
: check
micro-ui/web/micro-ui-internals/packages/modules/workbench/src/pages/employee/MDMSEdit.js (1)
Pattern **/*.js
: check
micro-ui/web/micro-ui-internals/packages/modules/workbench/src/pages/employee/MDMSAddV2.js (1)
Pattern **/*.js
: check
micro-ui/web/micro-ui-internals/packages/modules/workbench/src/hooks/inbox.js (1)
Pattern **/*.js
: check
micro-ui/web/micro-ui-internals/packages/modules/workbench/src/pages/employee/index.js (1)
Pattern **/*.js
: check
micro-ui/web/micro-ui-internals/packages/modules/workbench/src/components/MultiSelect.js (1)
Pattern **/*.js
: check
micro-ui/web/micro-ui-internals/packages/modules/workbench/src/utils/index.js (1)
Pattern **/*.js
: check
micro-ui/web/micro-ui-internals/packages/modules/workbench/src/pages/employee/MDMSView.js (1)
Pattern **/*.js
: check
micro-ui/web/micro-ui-internals/packages/modules/workbench/src/components/DigitJSONForm.js (1)
Pattern **/*.js
: check
micro-ui/web/micro-ui-internals/packages/modules/workbench/src/configs/UICustomizations.js (1)
Pattern **/*.js
: check
🪛 Biome (1.9.4)
micro-ui/web/micro-ui-internals/packages/modules/workbench/src/hooks/index.js
[error] 2-2: Declarations inside of a import
declaration may not have duplicates
a second declaration of isSchemaCodeInMDMSAction
is not allowed
isSchemaCodeInMDMSAction
is first declared here
(parse)
micro-ui/web/micro-ui-internals/packages/modules/workbench/src/pages/employee/MDMSSearchv2.js
[error] 162-162: Unnecessary use of boolean literals in conditional expression.
Simplify your code by directly assigning the result without using a ternary operator.
If your goal is negation, you may use the logical NOT (!) or double NOT (!!) operator for clearer and concise code.
Check for more details about NOT operator.
Unsafe fix: Remove the conditional expression with
(lint/complexity/noUselessTernary)
[error] 192-192: Template literals are preferred over string concatenation.
Unsafe fix: Use a template literal.
(lint/style/useTemplate)
[error] 198-198: Template literals are preferred over string concatenation.
Unsafe fix: Use a template literal.
(lint/style/useTemplate)
micro-ui/web/micro-ui-internals/packages/modules/workbench/src/hooks/inbox.js
[error] 5-5: Unsafe usage of optional chaining.
If it short-circuits with 'undefined' the evaluation will throw TypeError here:
(lint/correctness/noUnsafeOptionalChaining)
[error] 83-83: This let declares a variable that is only assigned once.
'updatedPath' is never reassigned.
Safe fix: Use const instead.
(lint/style/useConst)
micro-ui/web/micro-ui-internals/packages/modules/workbench/src/pages/employee/index.js
[error] 24-24: Template literals are preferred over string concatenation.
Unsafe fix: Use a template literal.
(lint/style/useTemplate)
[error] 44-44: Unnecessary use of boolean literals in conditional expression.
Simplify your code by directly assigning the result without using a ternary operator.
If your goal is negation, you may use the logical NOT (!) or double NOT (!!) operator for clearer and concise code.
Check for more details about NOT operator.
Unsafe fix: Remove the conditional expression with
(lint/complexity/noUselessTernary)
micro-ui/web/micro-ui-internals/packages/modules/workbench/src/components/MultiSelect.js
[error] 157-157: This let declares a variable that is only assigned once.
'newFormattedOptions2' is never reassigned.
Safe fix: Use const instead.
(lint/style/useConst)
micro-ui/web/micro-ui-internals/packages/modules/workbench/src/utils/index.js
[error] 200-200: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.
The declaration is defined in this switch clause:
Unsafe fix: Wrap the declaration in a block.
(lint/correctness/noSwitchDeclarations)
[error] 201-201: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.
The declaration is defined in this switch clause:
Unsafe fix: Wrap the declaration in a block.
(lint/correctness/noSwitchDeclarations)
[error] 206-206: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.
The declaration is defined in this switch clause:
Unsafe fix: Wrap the declaration in a block.
(lint/correctness/noSwitchDeclarations)
[error] 196-196: Reassigning a function parameter is confusing.
The parameter is declared here:
Use a local variable instead.
(lint/style/noParameterAssign)
micro-ui/web/micro-ui-internals/packages/modules/workbench/src/pages/employee/MDMSView.js
[error] 68-68: Unnecessary use of boolean literals in conditional expression.
Simplify your code by directly assigning the result without using a ternary operator.
If your goal is negation, you may use the logical NOT (!) or double NOT (!!) operator for clearer and concise code.
Check for more details about NOT operator.
Unsafe fix: Remove the conditional expression with
(lint/complexity/noUselessTernary)
[error] 77-77: This let declares a variable that is only assigned once.
'propsToSendButtons' is never reassigned.
Safe fix: Use const instead.
(lint/style/useConst)
[error] 137-137: This let declares a variable that is only assigned once.
'propsToSend' is never reassigned.
Safe fix: Use const instead.
(lint/style/useConst)
micro-ui/web/micro-ui-internals/packages/modules/workbench/src/configs/UICustomizations.js
[error] 843-843: This let declares a variable that is only assigned once.
'hostname' is never reassigned.
Safe fix: Use const instead.
(lint/style/useConst)
[error] 845-845: This let declares a variable that is only assigned once.
'roleActions' is never reassigned.
Safe fix: Use const instead.
(lint/style/useConst)
🔇 Additional comments (13)
micro-ui/web/micro-ui-internals/packages/modules/workbench/src/pages/employee/MDMSSearchv2.js (1)
161-162
: LGTM! Good handling of EPOC date format
The conditional additionalCustomization based on format type is a good approach for handling EPOC dates.
🧰 Tools
🪛 Biome (1.9.4)
[error] 162-162: Unnecessary use of boolean literals in conditional expression.
Simplify your code by directly assigning the result without using a ternary operator.
If your goal is negation, you may use the logical NOT (!) or double NOT (!!) operator for clearer and concise code.
Check for more details about NOT operator.
Unsafe fix: Remove the conditional expression with
(lint/complexity/noUselessTernary)
micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/BreadCrumb.js (1)
30-32
: 🧹 Nitpick (assertive)
Consider using React Router's navigation for better UX
Full page reloads via window.location.href
can disrupt the user experience. Consider using React Router's navigation methods for smoother transitions.
- crumb?.externalPath ? (
- <Link onClick={() => handleRedirect(crumb?.path)}>{crumb.content} </Link>) :
- (<Link to={{ pathname:crumb.path, state: {count : crumb?.count }, search: crumb?.query }}>{crumb.content}</Link>)
+ crumb?.externalPath ? (
+ <Link to={crumb.path} target={crumb.openInNewTab ? "_blank" : "_self"}>{crumb.content}</Link>
+ ) : (
+ <Link to={{ pathname:crumb.path, state: {count : crumb?.count }, search: crumb?.query }}>{crumb.content}</Link>
+ )
Likely invalid or redundant comment.
micro-ui/web/micro-ui-internals/packages/modules/workbench/src/pages/employee/index.js (1)
83-83
: Consider implications of useRef for initialContextPath
Using useRef
for initialContextPath
means the value won't trigger re-renders if window.contextPath
changes. Verify if this is the intended behavior.
Also applies to: 125-125
✅ Verification successful
Based on the search results, I can see that window.contextPath
is a critical configuration value used extensively throughout the application for routing and navigation. The value is:
- Initially set at the application level from global configs:
window.contextPath = window?.globalConfigs?.getConfig("CONTEXT_PATH");
- In some cases, it's dynamically updated with tenant information:
window.contextPath = window?.globalConfigs?.getConfig("CONTEXT_PATH") + `${tenant ? `/${tenant}` : ""}` || "digit-ui";
Using useRef
for initialContextPath
is actually the correct approach here because:
- The initial context path needs to be preserved as a reference point, regardless of any subsequent changes to
window.contextPath
- The component doesn't need to re-render when this reference value changes since it's used as an initial snapshot
- This pattern helps compare the initial route context with any subsequent changes
Using useRef is the correct implementation here
The current implementation correctly captures the initial context path value that can be used as a reference point throughout the component lifecycle, without triggering unnecessary re-renders.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check if contextPath is used consistently across the codebase
rg "window\.contextPath" -A 2 -B 2
Length of output: 39359
micro-ui/web/micro-ui-internals/packages/modules/workbench/src/pages/employee/MDMSEdit.js (2)
35-35
: Ensure Proper Handling of URL Generation
The url
is constructed using Digit.Utils.workbench.getMDMSActionURL(moduleName, masterName, "update")
. Please verify that moduleName
and masterName
are always defined and valid strings to prevent potential runtime errors due to undefined or null values.
124-124
: Validate Structure of transformedData
Before Mutation
When passing transformedData
in the mutation's body, ensure that it matches the expected schema required by the backend API. An incorrect data structure may result in failed updates or unexpected behavior.
micro-ui/web/micro-ui-internals/packages/modules/workbench/src/configs/searchMDMSConfigPopup.js (1)
21-21
: LGTM: Custom hook integration looks good.
The addition of customHook
property to use useMDMSPopupSearch
is a clean way to integrate search functionality.
micro-ui/web/micro-ui-internals/packages/modules/workbench/src/pages/employee/MDMSAddV2.js (2)
96-104
: Good addition of validation logic.
The validation implementation is well-structured and handles error cases appropriately by:
- Validating form data before submission
- Showing translated error messages
- Preventing form submission on validation failure
120-120
: LGTM: Improved error message formatting.
The error message now includes both the generic error message and the specific error code, making it more informative for users.
micro-ui/web/micro-ui-internals/packages/modules/workbench/src/components/DigitJSONForm.js (3)
221-221
: LGTM: Improved tooltip readability.
Setting max-width for tooltips prevents them from becoming too wide and ensures better readability.
282-282
: LGTM: Better form disabled state management.
Centralizing the form disabled state logic into a single variable improves code maintainability and readability.
Also applies to: 317-317
336-336
: LGTM: Enhanced menu visibility check.
The additional check for viewActions length prevents rendering an empty menu container when there are no actions.
micro-ui/web/micro-ui-internals/packages/modules/workbench/src/utils/index.js (2)
Line range hint 233-242
: LGTM: Changes correctly propagate the key parameter
The changes to formatData
appropriately pass the key parameter to the formatDates
function.
🧰 Tools
🪛 Biome (1.9.4)
[error] 239-239: Duplicate case label.
The first similar label is here:
(lint/suspicious/noDuplicateCase)
[error] 238-238: Use Number.parseInt instead of the equivalent global.
ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.
(lint/style/useNumberNamespace)
257-257
: Verify the impact of key parameter changes
The changes correctly propagate the key parameter. However, let's verify all usages to ensure consistent behavior.
Also applies to: 279-279
✅ Verification successful
Key parameter changes are correctly implemented
The verification shows that the key parameter is properly implemented and serves a specific purpose:
- The
formatData
function correctly passes the key parameter toformatDates
- The
formatDates
function uses the key parameter to handle special cases for "validTo" and "effectiveTo" fields, setting appropriate time values (23:59:59.999 for end dates, 00:00:00.000 for others) - The changes are localized to the workbench module and don't require modifications elsewhere
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Find all calls to formatData to verify key parameter usage
# Search for formatData calls
echo "Searching for formatData calls..."
rg -A 2 "formatData\("
# Search for date-related fields in schema files
echo "Searching for date fields in schema files..."
rg -l '"type":\s*"(date|datetime|EPOC)"' --type json
Length of output: 944
Script:
#!/bin/bash
# Let's find the formatData function definition and its usages in a more comprehensive way
# Find the formatData function definition
echo "Searching for formatData function definition..."
ast-grep --pattern 'const formatData = $_'
# Search for any other files that might import and use formatData
echo "Searching for files importing formatData..."
rg "import.*formatData"
# Look for the schema structure to understand the formatType usage
echo "Searching for schema structure..."
rg -A 5 "formatType.*:"
Length of output: 2625
Script:
#!/bin/bash
# Let's examine the formatDates function since it's using the key parameter
# Find the formatDates function definition
echo "Searching for formatDates function definition..."
ast-grep --pattern 'const formatDates = $_'
# Look for any date-related schema configurations
echo "Searching for EPOC type configurations in the codebase..."
rg -B 2 -A 2 '"formatType":\s*"EPOC"'
# Search for any test files that might validate this functionality
echo "Searching for related test files..."
fd -e test.js -e spec.js -e test.jsx -e spec.jsx
Length of output: 2943
micro-ui/web/micro-ui-internals/packages/modules/workbench/src/pages/employee/MDMSSearchv2.js
Show resolved
Hide resolved
micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/BreadCrumb.js
Show resolved
Hide resolved
micro-ui/web/micro-ui-internals/packages/modules/workbench/src/pages/employee/index.js
Show resolved
Hide resolved
micro-ui/web/micro-ui-internals/packages/modules/workbench/src/pages/employee/index.js
Show resolved
Hide resolved
micro-ui/web/micro-ui-internals/packages/modules/workbench/src/pages/employee/MDMSEdit.js
Show resolved
Hide resolved
micro-ui/web/micro-ui-internals/packages/modules/workbench/src/configs/UICustomizations.js
Show resolved
Hide resolved
micro-ui/web/micro-ui-internals/packages/modules/workbench/src/hooks/index.js
Outdated
Show resolved
Hide resolved
micro-ui/web/micro-ui-internals/packages/modules/workbench/src/hooks/index.js
Show resolved
Hide resolved
micro-ui/web/micro-ui-internals/packages/modules/workbench/src/pages/employee/MDMSAddV2.js
Show resolved
Hide resolved
micro-ui/web/micro-ui-internals/packages/modules/workbench/src/utils/index.js
Show resolved
Hide resolved
@@ -279,6 +279,8 @@ const DigitJSONForm = ({ | |||
}; | |||
const person = { t: t }; | |||
|
|||
const formDisabled = screenType === "view" ? true : disabled; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is already done as part of view screen wrapper right @Swathi-eGov
@@ -49,14 +49,15 @@ const CustomSelectWidget = (props) => { | |||
/* | |||
logic added to fetch data of schemas in each component itself | |||
*/ | |||
const limit = schemaCode === "WORKS-SOR.SOR" ? 1000 : 100; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
even with 1000 data it didnt solve the issue right ?
const [limitedOptions, setLimitedOptions] = useState([]); | ||
const [selectedDetails, setSelectedDetails] = useState(null); | ||
const [showDetails, setShowDetails] = useState(null); | ||
const [isSelect, setIsSelect] = useState(false); | ||
const [showModal, setShowModal] = useState(false); | ||
const [isSeeAll, setIsSeeAll] = useState(false); | ||
|
||
const fetchDetailsForSelectedOption = async (value) => { | ||
const response = await fetch(`/${Digit.Hooks.workbench.getMDMSContextPath()}/v2/_search`, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use custom service instead of fetch
@@ -190,7 +224,8 @@ const CustomSelectWidget = (props) => { | |||
isSearchable={true} | |||
isMulti={multiple} | |||
styles={customStyles} | |||
components={isSeeAll ? { MenuList: SelectMenuButton, Option: OptionWithInfo } : { Option: OptionWithInfo }} | |||
// components={isSeeAll ? { MenuList: SelectMenuButton, Option: OptionWithInfo } : { Option: OptionWithInfo }} | |||
components={schema?.schemaCode ? { MenuList: SelectMenuButton, Option: OptionWithInfo } : { Option: OptionWithInfo }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can u check what was that seeall and from where it is calculated
const crumbs = [ | ||
{ | ||
path: `/${window?.contextPath}/employee`, | ||
path: getHomePath(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert this change
…llout.
Choose the appropriate template for your PR:
Summary by CodeRabbit
Release Notes
New Features
DigitJSONForm
component.CustomSelectWidget
component.UICustomizations
module.useMDMSPopupSearch
.MDMSSearchv2
.UICustomizations
module.Bug Fixes
Improvements
ActionBar
.