[Bug]: TypeError: Cannot read properties of undefined (reading 'value')
Sentry Issue: APPSMITH-490
TypeError: Cannot read properties of undefined (reading 'value')
at onClick (pages/Templates/ForkTemplate.tsx:58:70)
...
(13 additional frame(s) were not displayed)
@kocharrahul7 @ginilpg the app is crashing when users fork a template
Able to repro. When there are no organisations and we try to fork the app we see the error on the browser console. The app doesn't crash. Fork buttons needs to be disabled here.
Just checked the smartlook as well, No error message for the user, they just tried to fork without selecting an org. Nothing broke.
@kocharrahul7 @akash-codemonk we're seeing a lot of occurrences of this. Can we please validate whether this is really only for no org. It doesn't seem likely
I see a total of 52 events in the last month. The reason is the same it is zero orgs or there are no orgs where the user has permission to fork.
@akash-codemonk then maybe we;re showing the workspace in the dropdown but they don't face the permission to fork it there. So we should stop showing the workspace in the dropdown list
The workspace list is filtered. So the user isn't actually seeing any workspace in the modal dropdown, but they end up clicking the fork button which is when the error is thrown.
As a fix I am hiding the fork button if the user does not have any workspace to fork to. This can happen for two reasons
- There are no workspaces the user is part of
- The user is part of a workspace/s but user does not have permission to fork to any of the workspaces
Media
https://user-images.githubusercontent.com/67054171/209554970-7f71cfa5-308d-4775-a83e-38e1ffb2247f.mov