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]: Disable clicking on Next page button when Table record reached to last page #22477

Closed
1 task done
chandannkumar opened this issue Apr 17, 2023 · 16 comments · Fixed by #25119
Closed
1 task done
Assignees
Labels
Bug Something isn't working Good First Issue Good for newcomers Medium Issues that frustrate users due to poor UX Needs Triaging Needs attention from maintainers to triage Table Widget Verified When issue is retested post its fixed Widgets & Accelerators Pod Issues related to widgets & Accelerators Widgets Product This label groups issues related to widgets

Comments

@chandannkumar
Copy link

chandannkumar commented Apr 17, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Description

In Table widget, when pagination reach to it's last page the icon seems disabled but we can still Click on it and see rendering of data.

Steps To Reproduce

  1. Drag & drop a Table widget
  2. Run a server side pagination query SELECT * FROM users ORDER BY id LIMIT {{Table2.pageSize}} offset {{Table2.pageOffset}}
  3. Enable server side pagination and configure onPageChange & Total records
  4. Reach to last page of the table records
  5. Observe that Next page button is disabled but clickable

Public Sample App

No response

Environment

Production

Issue video log

https://www.loom.com/share/bad8d690647c4583b7e82d6092a1ccbe

Version

Cloud / Production

@chandannkumar chandannkumar added Bug Something isn't working Table Widget Needs Triaging Needs attention from maintainers to triage Medium Issues that frustrate users due to poor UX labels Apr 17, 2023
@github-actions github-actions bot added Widgets Product This label groups issues related to widgets labels Apr 17, 2023
@keyurparalkar keyurparalkar added the Good First Issue Good for newcomers label Apr 17, 2023
@chandannkumar chandannkumar changed the title [Bug]: Disable clicking on Next page button when button is reached to last page [Bug]: Disable clicking on Next page button when Table record reached to last page Apr 19, 2023
@avijeetpandey
Copy link

@chandannkumar @keyurparalkar @dilippitchika i wanted to contribute and work on this issue can you please assign this issue to me ?

@dilippitchika
Copy link
Contributor

Greetings @avijeetpandey thanks for showing interest 🎉 , This is all your. Assigning this to you now.

Please don't forget to read the Contribution Guidelines. Would appreciate if you can open a PR within the next 2 days. let us know here

@avijeetpandey
Copy link

Thanks @dilippitchika , will try my best to do that

@Ashmash100
Copy link

Ashmash100 commented Apr 19, 2023

Hi @dilippitchika @chandannkumar @keyurparalkar
In case the PR isn't raised, I would like to work on this issue.

@avijeetpandey
Copy link

@dilippitchika the client is taking so much time to compile, anything that can be done to speed this up , have setup the client and server as per the docs , but upon running yarn start its taking so much to complile .

System Info

Ubuntu 22.10
8GB RAM

@avijeetpandey
Copy link

@dilippitchika @chandannkumar After following the docs and setting up the server successfully got the following error on the client, need little help in making the client a successful connection to a staging/local environment.

Attaching the screenshot for a better understanding of the issue.

Thanks
Screenshot from 2023-04-20 22-35-57

Screenshot from 2023-04-20 22-41-26

@sharat87
Copy link
Member

Hey @avijeetpandey, I think you're opening http://dev.appsmith.com:3000 in your browser. Can you try https://dev.appsmith.com instead please? If that also shows the same error, please share the exact full command you've used to run the start-https.sh script for us to debug further. Thanks!

@avijeetpandey
Copy link

@sharat87 here are the set of commands i am running after setting up the repo as per the docs

// for backend
cd appsmith/app/server
docker-compose up -d

cd appsmith/app/client
./start-https.sh
yarn start

on accessing http://dev.appsmith.com I am getting the following
Screenshot from 2023-04-21 18-06-08
Screenshot from 2023-04-21 18-06-01

@Ashmash100
Copy link

Ashmash100 commented Apr 23, 2023

Hi @dilippitchika @sharat87 @chandannkumar
I know the solution for this. If this issue is still open can I work on it?

@sharat87
Copy link
Member

@avijeetpandey, that looks odd. Can you share the output of the start-https.sh command, as well as the generated NGINX configuration located at app/client/nginx/nginx.dev.conf here please?

@avijeetpandey avijeetpandey removed their assignment Apr 26, 2023
@harrybasra95
Copy link

harrybasra95 commented Apr 30, 2023

@chandannkumar @keyurparalkar @dilippitchika I was going through this issue and I have found the buggy code.

Code Location

The below image is from /app/client/src/widgets/TableWidgetV2/component/TableStyledWrappers.tsx

Screenshot 2023-04-30 at 11 55 18 AM

What's the issue

We are adding pointerEvents: none to the child elements of PaginationItemWrapper. But the onClick code is working on the PaginationItemWrapper element itself. Because of this on hover the button looks like disabled but still the onClick works.

Proposed solution

With CSS - We can add pointerEvents: none to the parent element but it will disable the cursor: not-allowed property. Thus it will start showing the move icon when hovered on the disabled button.

With JS - We can directly add the disable condition on the onClick event.

image

Please suggest to me how to proceed.

@keyurparalkar
Copy link
Contributor

Greetings @harrybasra95 thanks for showing interest 🎉 , This is all your. Assigning this to you now.

Please don't forget to read the Contribution Guidelines. Would appreciate if you can open a PR within the next 2 days. let us know here

@keyurparalkar
Copy link
Contributor

@harrybasra95 can you proceed with the JS solution where we add a disable condition to the onClick event

@harshitpandey0426
Copy link
Contributor

harshitpandey0426 commented May 14, 2023

@keyurparalkar Is this resolved, I can open a PR if required?

@keyurparalkar
Copy link
Contributor

@harshitpandey0426 thanks for showing interest but the PR has already been raised for it.

@Dvinod28
Copy link

Hi, is this issue still open, and it is client-side only?, I want to contribute

@keyurparalkar keyurparalkar self-assigned this Jun 23, 2023
keyurparalkar added a commit that referenced this issue Jul 7, 2023
…#25119)

## Description
This PR fixes the issue mentioned below by preventing the click event
when the next page button is disabled and when it is table's last page.

#### PR fixes following issue(s)
Fixes #22477

#### Type of change
- Bug fix (non-breaking change which fixes an issue)

## Testing
#### How Has This Been Tested?

- [x] Manual
- [ ] Jest
- [ ] Cypress
- should check whether the next page button is disabled and not
clickable when last page is reached

#### Test Plan
> Add Testsmith test cases links that relate to this PR
>
>
#### Issues raised during DP testing
> Link issues raised during DP testing for better visiblity and tracking
(copy link from comments dropped on this PR)
>
>
>
## Checklist:
#### Dev activity
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] PR is being merged under a feature flag


#### QA activity:
- [ ] [Speedbreak
features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-)
have been covered
- [ ] Test plan covers all impacted features and [areas of
interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-)
- [ ] Test plan has been peer reviewed by project stakeholders and other
QA members
- [ ] Manually tested functionality on DP
- [ ] We had an implementation alignment call with stakeholders post QA
Round 2
- [ ] Cypress test cases have been added and approved by SDET/manual QA
- [ ] Added `Test Plan Approved` label after Cypress tests were reviewed
- [ ] Added `Test Plan Approved` label after JUnit tests were reviewed
@appsmith-bot appsmith-bot added the QA Needs QA attention label Jul 7, 2023
@kamakshibhat-appsmith kamakshibhat-appsmith added Verified When issue is retested post its fixed and removed QA Needs QA attention labels Jul 10, 2023
@Nikhil-Nandagopal Nikhil-Nandagopal added the Widgets & Accelerators Pod Issues related to widgets & Accelerators label Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Good First Issue Good for newcomers Medium Issues that frustrate users due to poor UX Needs Triaging Needs attention from maintainers to triage Table Widget Verified When issue is retested post its fixed Widgets & Accelerators Pod Issues related to widgets & Accelerators Widgets Product This label groups issues related to widgets
Projects
None yet