fix: hide New agent and New flow buttons for unauthenticated users
Relates to issue #567560 (closed)
This MR was created by Duo in Session 1099138
Changes
- Hide "New agent" and "New flow" buttons when user is not signed in
- Hide create forms for agents and flows for unauthenticated users
- Improve user experience by preventing access to functionality that requires authentication
How to test
- Enable the feature flag:
echo "Feature.enable(:global_ai_catalog)" | rails c
- Visit http://gdk.test:3000/explore/ai-catalog/agents
- Visit http://gdk.test:3000/explore/ai-catalog/agents/new
- Create an agent, go back to the index page and click on the "..." dropdown to click on 'edit'. Save the ID or edit URL somewhere.
- Visit http://gdk.test:3000/explore/ai-catalog/flows
- Visit http://gdk.test:3000/explore/ai-catalog/flows/new
- Create a flow, go back to the index page and click on the "..." dropdown to click on 'edit'. Save the ID or edit URL somewhere.
- Now, open http://gdk.test:3000/explore/ai-catalog/ in an incognito tab, when being logged out
- The buttons 'new agent' and 'new flow' should not be visible anymore
- Visit http://gdk.test:3000/explore/ai-catalog/agents/new. It redirects back to index page
- Visit http://gdk.test:3000/explore/ai-catalog/flows/new. It redirects back to index page
- Visit http://gdk.test:3000/explore/ai-catalog/agents/ID/edit. It redirects back to index page
- Visit http://gdk.test:3000/explore/ai-catalog/flows/ID/edit. It redirects back to index page
Edited by Vanessa Otto