cyclops-ui / cyclops

Developer Friendly Kubernetes 👁️

Home Page:https://cyclops-ui.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to edit or delete module if you use a bad repo path

skunklabz opened this issue · comments

Describe the bug
Unable to view the details of a module that was created using a bad repo path. You are just given a "Page not found :/" error and no option to edit or delete the module.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'http://localhost:3000/modules'
  2. Click on 'Add module'
  3. Under the "Module template" section type in a bad repo URL and/or path
  4. Give the module a name and click Save.
  5. In the Deploy Modules page click the Details button of the bad module
    image

Expected behavior
I'm expecting to be able to view the details of all modules, regardless of whether or not they have a bad repo URL, or path. Instead I'm given a simple 'Page not found :/' and no option to do anything else.

Screenshots
image

Desktop (please complete the following information):

  • OS: macOS (latest)
  • Browser Chrome
  • Version latest

@skunklabz sorry for the delayed response. We have revamped the flow and removed the details button, and now the whole module card is clickable and will show you the module details page.

However, if you create a module with a bad repo URL, if you click directly on it, it will still take you to the page not found. We should disable the link if its a valid address. Here is the code for the link rendering that needs fixing. The issue is not as severe is as it was, but we should still fix it.

hi @petar-cvit i would love to work on this issue, can you please assign this to me?

@petar-cvit here are the things i have noticed,

  1. will adding a new template reference, when we give a bad url or path it is showing an alert, so now we can't create module with bad url of module template.
    image
  2. when we create a new module, we will be displayed with a module card which shows repo, path links and version.
  • now when i click on path it eats the current page and redirects to the github page

  • this github page shows 404 page as shown below
    image

  • when we create a template without version and use it for a module then it shows card with path url which gives the below error.
    image

  • can you please clarify if I need to remove the version(version+resolvedVersion) from the url which makes it valid or disable the path link(in this case i think we should check beforehand where url is valid or not using this api /templates/store/ ig

  • I also think that as soon as user links on this links they should be opened on a new tab, it would be better!

Hey @s-vamshi

  • I agree it would be better if it opened a new window instead of opening in the same
  • And yeah, this seems like a bug. Currently, the getTemplateVersion function is used to calculate the version for the link. Unfortunatly, that function is used to format the version you see in the card so it doesn't work as a link.
    • Could you fix it by adding the templateResolvedVersion in the link? If it is not provided, you can use the version, and if not, you can fall back to "main"

hi @petar-cvit ,
as i see resolvedVersion is generated from the back end and even if we use it in the link it is going to break and same goes with the version ig. any thoughts on this?

So if the repo is valid and you have a resolvedVersion the link as follows should work:

<repo>/tree/<resolvedVersion>/path

You can check if the link is valid if it starts with https://github.com. If it doesn't, you can skip generating the link