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

bug bash issue #659

Merged
merged 5 commits into from
May 22, 2024
Merged

bug bash issue #659

merged 5 commits into from
May 22, 2024

Conversation

nabeelmd-eGov
Copy link
Contributor

  • fixes-> cyclenumber issue, hover issue, dropdown height issue,
  • css
  • fixes

Copy link
Contributor

coderabbitai bot commented May 22, 2024

Walkthrough

Walkthrough

The recent updates in the micro-UI project mainly focus on upgrading dependencies, refining component imports, and enhancing CSS styles. Key changes include updating the @egovernments/digit-ui-css version in index.html, adjusting imports for the Dropdown component, adding new SCSS styles, and including an id parameter in the UploadData component and useResourceData hook. Minor formatting adjustments were also made for code consistency.

Changes

File Path Change Summary
.../example/public/index.html Updated @egovernments/digit-ui-css version from 1.0.41-campaign to 1.0.42-campaign.
.../packages/css/src/pages/employee/index.scss Added styling for a new class .digit-dropdown-employee-select-wrap--elipses.
.../packages/modules/campaign-manager/src/components/AddProductField.js Updated Dropdown import to use @egovernments/digit-ui-components instead of @egovernments/digit-ui-react-components.
.../packages/modules/campaign-manager/src/components/CampaignSummary.js Added spaces around CSS properties in a <div> element.
.../packages/modules/campaign-manager/src/components/UploadData.js Added id parameter retrieval from URL and passed it to a function call. Added condition for uploadedFile length.
.../packages/modules/campaign-manager/src/hooks/useResourceData.js Updated useResourceData to accept an additional id parameter and included logic for campaignId in additionalDetails.
.../packages/modules/campaign-manager/src/pages/employee/SetupCampaign.js Removed an empty line within the useEffect hook.
.../packages/modules/campaign-manager/src/pages/employee/deliveryRule/AddProductscontext.js Reordered imports and adjusted formatting in the incrementC function.
.../public/index.html Updated @egovernments/digit-ui-css version from 1.0.41 to 1.0.42.

In lines of code, we dance and play,
New styles and imports pave the way.
With Dropdown fixed and CSS tight,
Our micro-UI shines so bright.
🐇✨


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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@nabeelmd-eGov nabeelmd-eGov merged commit 5ed4a3e into campaign May 22, 2024
2 of 3 checks passed
@nabeelmd-eGov nabeelmd-eGov deleted the bug-bash-issue branch May 22, 2024 06:25
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 3d83609 and 8b2cd78.
Files ignored due to path filters (1)
  • micro-ui/web/micro-ui-internals/packages/css/package.json is excluded by !**/*.json
Files selected for processing (9)
  • micro-ui/web/micro-ui-internals/example/public/index.html (1 hunks)
  • micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/index.scss (1 hunks)
  • micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/AddProductField.js (1 hunks)
  • micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/CampaignSummary.js (1 hunks)
  • micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/UploadData.js (4 hunks)
  • micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/hooks/useResourceData.js (3 hunks)
  • micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/SetupCampaign.js (1 hunks)
  • micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/deliveryRule/AddProductscontext.js (2 hunks)
  • micro-ui/web/public/index.html (1 hunks)
Files skipped from review due to trivial changes (6)
  • micro-ui/web/micro-ui-internals/example/public/index.html
  • micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/index.scss
  • micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/CampaignSummary.js
  • micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/SetupCampaign.js
  • micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/deliveryRule/AddProductscontext.js
  • micro-ui/web/public/index.html
Additional Context Used
Path-based Instructions (3)
micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/hooks/useResourceData.js (1)

Pattern **/*.js: check

micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/AddProductField.js (1)

Pattern **/*.js: check

micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/UploadData.js (1)

Pattern **/*.js: check

Additional comments not posted (4)
micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/hooks/useResourceData.js (2)

25-27: Correctly added campaignId to additionalDetails. This aligns with the PR's objective to enhance data handling.


1-1: Ensure all calls to useResourceData are updated to pass the new id parameter.

micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/AddProductField.js (1)

8-8: Updated import of Dropdown from @egovernments/digit-ui-components is correct as per the PR's description.

micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/UploadData.js (1)

39-40: Correctly retrieves id from URL search parameters. This aligns with the PR's objective to enhance data handling.

@@ -37,7 +39,7 @@ export const useResourceData = async (data, hierarchyType, type, tenantId) => {
return Error;
} else {
Error = errorMessage;
Error.isError = true ;
Error.isError = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

Ensure consistent error handling. Here, Error is assigned a string directly, which might not be intended as Error.isError is set next line.

- Error = errorMessage;
+ Error.error = errorMessage;

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
Error.isError = true;
Error.error = errorMessage;
Error.isError = true;

Comment on lines +548 to +554
if (!errorsType[type] && uploadedFile?.length > 0) {
setShowToast({ key: "info", label: t("HCM_VALIDATION_IN_PROGRESS") });
setIsValidation(true);
setIsError(true);

try {
const temp = await Digit.Hooks.campaign.useResourceData(uploadedFile, params?.hierarchyType, type, tenantId);
const temp = await Digit.Hooks.campaign.useResourceData(uploadedFile, params?.hierarchyType, type, tenantId, id);
Copy link
Contributor

Choose a reason for hiding this comment

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

Ensure error handling is robust. The error message transformation might cause issues if temp.error is undefined or not a string.

- const errorMessage = temp?.error.replaceAll(":", "-");
+ const errorMessage = temp?.error ? temp.error.replaceAll(":", "-") : "Unknown error";

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
if (!errorsType[type] && uploadedFile?.length > 0) {
setShowToast({ key: "info", label: t("HCM_VALIDATION_IN_PROGRESS") });
setIsValidation(true);
setIsError(true);
try {
const temp = await Digit.Hooks.campaign.useResourceData(uploadedFile, params?.hierarchyType, type, tenantId);
const temp = await Digit.Hooks.campaign.useResourceData(uploadedFile, params?.hierarchyType, type, tenantId, id);
if (!errorsType[type] && uploadedFile?.length > 0) {
setShowToast({ key: "info", label: t("HCM_VALIDATION_IN_PROGRESS") });
setIsValidation(true);
setIsError(true);
try {
const temp = await Digit.Hooks.campaign.useResourceData(uploadedFile, params?.hierarchyType, type, tenantId, id);
const errorMessage = temp?.error ? temp.error.replaceAll(":", "-") : "Unknown error";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants