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

Fixes #1380 by simplifying the modal closure mechanism in the 'Manage Features' modal. #1393

Merged

Conversation

harshpreet14
Copy link

@harshpreet14 harshpreet14 commented Jan 6, 2024

What kind of change does this PR introduce?

This PR addresses issue #1380 by simplifying the modal closure mechanism in the 'Manage Features' modal in OrgList.tsx.

Changes Made:

  • Replaced the title div of the Modal with 'Modal Header', aligning it with other modals in the application for consistency.
  • Removed the 'Cancel' button and retained the 'X' icon for closing the modal.
  • Updated the OrgList.test.tsx file to reflect these changes by removing tests related to the 'CloseOrganizationModal' button.

Issue Number:
Fixes #1380

Did you add tests for your changes?
-Verified that - On clicking cross button the modal should close, on clicking outside the modal the modal should close, on pressing escape key on keyboard the modal should close.

  • No, there was no need for redundant tests for Modal Header.
  • Executed individual file tests using npm run test --watchAll=false /src/screens/OrgList/OrgList.test.tsx.
  • Measured code coverage for changes with npm run test -- --collectCoverageFrom="src/screens/OrgList/*" /src/screens/OrgList/OrgList.test.tsx.

Snapshots/Videos:
Before-
Screenshot 2024-01-06 013241
After-
Screenshot 2024-01-06 184946
OrgList.test.tsx -
Screenshot 2024-01-06 235928
Code coverage-
Screenshot 2024-01-07 003019

If relevant, did you update the documentation?
NA

Summary
Simplifies the modal interface, enhancing the overall user experience and reducing potential confusion.

Does this PR introduce a breaking change?

NA

Other information
If further tests are required for the specific modal in OrgList.tsx, please let me know, and I'll be more than happy to add them. Thank you for considering my contribution!

Have you read the contributing guide?

Yes

Addressed the issue of UI redundancy as discussed in Issue PalisadoesFoundation#1380.

What:
- Removed the 'Cancel' button, and added the 'Manage Features' header for the Modal leaving the 'X' icon as the sole close option.

Impact:
- Simplifies the modal interface, enhancing the overall user experience and reducing potential confusion.

Tests:
- Tested the individual file by running this command: `npm run test --watchAll=false /path/to/test/file`
- Tested code coverage for this file with : `npm run test -- --collectCoverageFrom="src/screens/OrgList/*" /src/screens/OrgList/OrgList.test.tsx`
Copy link

github-actions bot commented Jan 6, 2024

Our Pull Request Approval Process

We have these basic policies to make the approval process smoother for our volunteer team.

Testing Your Code

Please make sure your code passes all tests. Our test code coverage system will fail if these conditions occur:

  1. The overall code coverage drops below the target threshold of the repository
  2. Any file in the pull request has code coverage levels below the repository threshold
  3. Merge conflicts

The process helps maintain the overall reliability of the code base and is a prerequisite for getting your PR approved. Assigned reviewers regularly review the PR queue and tend to focus on PRs that are passing.

Reviewers

When your PR has been assigned reviewers contact them to get your code reviewed and approved via:

  1. comments in this PR or
  2. our slack channel

Reviewing Your Code

Your reviewer(s) will have the following roles:

  1. arbitrators of future discussions with other contributors about the validity of your changes
  2. point of contact for evaluating the validity of your work
  3. person who verifies matching issues by others that should be closed.
  4. person who gives general guidance in fixing your tests

CONTRIBUTING.md

Read our CONTRIBUTING.md file. Most importantly:

  1. PRs with issues not assigned to you will be closed by the reviewer
  2. Fix the first comment in the PR so that each issue listed automatically closes

Other

  1. 🎯 Please be considerate of our volunteers' time. Contacting the person who assigned the reviewers is not advised unless they ask for your input. Do not @ the person who did the assignment otherwise.
  2. Read the CONTRIBUTING.md file make

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Congratulations on making your first PR! 🎊 If you haven't already, check out our Contributing Guidelines and PR Reporting Guidelines to ensure that you are following our guidelines for contributing and creating PR.

@palisadoes palisadoes changed the title Fix: issue #1380 by simplifying the modal closure mechanism in the 'Manage Features' modal. Fixes #1380 by simplifying the modal closure mechanism in the 'Manage Features' modal. Jan 6, 2024
Copy link

codecov bot commented Jan 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e04e50a) 97.44% compared to head (9b7b3c2) 97.20%.
Report is 35 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1393      +/-   ##
===========================================
- Coverage    97.44%   97.20%   -0.25%     
===========================================
  Files          138      133       -5     
  Lines         3683     3396     -287     
  Branches      1076     1038      -38     
===========================================
- Hits          3589     3301     -288     
- Misses          89       90       +1     
  Partials         5        5              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

package-lock.json Outdated Show resolved Hide resolved
@rishav-jha-mech
Copy link
Contributor

@harshpreet14 Remove the custom CSS from the modal buttons and make them look like the other buttons we are using (Bootstrap buttons)

Also remove all the changes made to Orglist.module.css in this PR
https://github.com/PalisadoesFoundation/talawa-admin/pull/951/files#diff-6d92acde99b887d1558bf07492bfac03d6fdffcab0f3f9b4a52a14df094dbe6c

Changes Made:
-Replaced existing buttons in the OrgList component with Bootstrap buttons for a more consistent and modern UI.
-Removed unused CSS classes (greenredbtn, cancel, secondbtn) from OrgList.module.css.
-Added new CSS classes enableEverythingBtn and pluginStoreBtn for specific button styling.
-Implemented a new test to verify the functionality of the 'Go to Plugin Store' button.

Tests:
- Tested the individual file by running this command: `npm run test --watchAll=false  /src/screens/OrgList/OrgList.test.tsx`
- Tested code coverage for this file with : `npm run test -- --collectCoverageFrom="src/screens/OrgList/*" /src/screens/OrgList/OrgList.test.tsx`
@harshpreet14
Copy link
Author

Hi Rishav, I have implemented the changes as suggested. The modifications include updating the buttons to Bootstrap versions, cleaning up unused CSS classes, adding new classes for specific buttons, and implementing an additional test for the 'Go to Plugin Store' button.

@rishav-jha-mech
Copy link
Contributor

@harshpreet14 share the updated Screenshot

@harshpreet14
Copy link
Author

Here's the screenshot @rishav-jha-mech
image

Copy link
Member

@beingnoble03 beingnoble03 left a comment

Choose a reason for hiding this comment

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

@harshpreet14 please address the comment. Rest lgtm.

@noman2002
Copy link
Member

@harshpreet14 Any update on this ?

replaced with pluginNotificationHeader
accodrdingly fixed tests
@harshpreet14
Copy link
Author

@noman2002 fixed the redundant test-id.
Screenshot 2024-01-22 014256

Copy link
Member

@beingnoble03 beingnoble03 left a comment

Choose a reason for hiding this comment

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

lgtm, thanks @harshpreet14!

@noman2002
Copy link
Member

@beingnoble03 Should this be merged ?

@beingnoble03
Copy link
Member

@beingnoble03 Should this be merged ?

Yes

@palisadoes palisadoes merged commit e8be2da into PalisadoesFoundation:develop Jan 22, 2024
8 of 10 checks passed
Devesh326 pushed a commit to Devesh326/talawa-admin that referenced this pull request Jan 25, 2024
…anism in the 'Manage Features' modal. (PalisadoesFoundation#1393)

* Fix:
Addressed the issue of UI redundancy as discussed in Issue PalisadoesFoundation#1380.

What:
- Removed the 'Cancel' button, and added the 'Manage Features' header for the Modal leaving the 'X' icon as the sole close option.

Impact:
- Simplifies the modal interface, enhancing the overall user experience and reducing potential confusion.

Tests:
- Tested the individual file by running this command: `npm run test --watchAll=false /path/to/test/file`
- Tested code coverage for this file with : `npm run test -- --collectCoverageFrom="src/screens/OrgList/*" /src/screens/OrgList/OrgList.test.tsx`

* reverted changes made to package-lock.json file

* Fix:Replacing Modal Buttons with Bootstrap buttons.

Changes Made:
-Replaced existing buttons in the OrgList component with Bootstrap buttons for a more consistent and modern UI.
-Removed unused CSS classes (greenredbtn, cancel, secondbtn) from OrgList.module.css.
-Added new CSS classes enableEverythingBtn and pluginStoreBtn for specific button styling.
-Implemented a new test to verify the functionality of the 'Go to Plugin Store' button.

Tests:
- Tested the individual file by running this command: `npm run test --watchAll=false  /src/screens/OrgList/OrgList.test.tsx`
- Tested code coverage for this file with : `npm run test -- --collectCoverageFrom="src/screens/OrgList/*" /src/screens/OrgList/OrgList.test.tsx`

* fixed redundant test id- modalOrganisationHeader
replaced with pluginNotificationHeader
accodrdingly fixed tests

* Update OrgList.test.tsx
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.

5 participants