ispras / lingvodoc-react

Apache License 2.0
7 stars 11 forks source link

Connect/Remove link buttons should be disabled after first click #1014

Open vmonakhov opened 1 year ago

vmonakhov commented 1 year ago

While adding or deleting backref links between perspectives manually, the Connect/Remove button stay enabled after click. So several clicks on Connect button creates several identic links. Withal clicking twice on Remove button leads to error. Would be better to disable these buttons after first click.

Steps to reproduce:

  1. Create own dictionary to be able to add or remove links:
  1. Click any non-zero 'Paradigm and contexts' button 2023-08-11_14-02-53
  2. Follow the link in the opened dialog and try to click twice on Remove button 2023-08-11_14-09-04

! This leads to error

2023-08-11_14-11-51

  1. Go back to the previous dialog and choose 'Add link' there. Leave the appeared text in the string and click 'search' icon

2023-08-11_14-23-03

  1. Click several times 'Connect' button and note that it still enabled and clickable. Note that several links are created at once (look at the counter in the perspective table p.2).
vmonakhov commented 1 year ago

Partly resolved. Task is to refetch corresponding queries to run complex re-rendering. This was partly realized using data.refetch() functions for the queries themselves. But this has just not full effect within the present architecture. It's needed to transform components-classes to components-functions and use hooks instead of composes. Will be better to use local cache and not query db every time as well.