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

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

Closed
skunklabz opened this issue Jun 16, 2024 · 7 comments · Fixed by #472
Closed

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

skunklabz opened this issue Jun 16, 2024 · 7 comments · Fixed by #472
Assignees
Labels
bug Something isn't working good first issue Good for newcomers UI Update on the UI

Comments

@skunklabz
Copy link

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
@petar-cvit
Copy link
Collaborator

@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.

@petar-cvit petar-cvit added bug Something isn't working good first issue Good for newcomers UI Update on the UI labels Jul 23, 2024
@s-vamshi
Copy link
Contributor

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

@petar-cvit
Copy link
Collaborator

Hey @s-vamshi, sure

@s-vamshi
Copy link
Contributor

s-vamshi commented Jul 27, 2024

@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!

@petar-cvit
Copy link
Collaborator

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"

@s-vamshi
Copy link
Contributor

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?

@petar-cvit
Copy link
Collaborator

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

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 UI Update on the UI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants