How to link to the project page? (OD-203)
Michael Weimann opened 5 years ago

This is a simple dev support request.

Background: I am working on improved error pages for issues and pull requests:

  • A simple explanation
  • Links to the project and home
  • Not displaying a Java exception to reduce annoyance

Anyway :)

For the pages above I need to link to the project page. So far I added this to the template:

<a wicket:id="project" class="btn btn-light-primary">Go To The Project</a>

and in the Code:

PageParameters params = new PageParameters();
		params.set(0, project.getName());
		container.add(new ViewStateAwarePageLink<Void>("project", ProjectPage.class, params));

But that leads to a weird URL like http://192.168.44.206:6610/wicket/bookmarkable/io.onedev.server.web.page.project.ProjectPage/test

I 've looked around in the code and read the Wicket docs but I could not find a solution to create a nice link like http://192.168.44.206:6610/projects/test.

  • Robin Shen commented 5 years ago

    ProjectPage is an abstract page, the ProjectBlobPage should be used instead. Also the error page is a general page and the params may not hold project information when error is thrown from other places, such as user page, etc.

  • Robin Shen changed state to 'Closed' 5 years ago
    Previous Value Current Value
    Open
    Closed
  • Robin Shen commented 5 years ago

    Sometimes error message is buried in java stack trace, and it is hard to extract. I will improve the page so that only administrator can show the error detail.

  • Robin Shen commented 5 years ago

    Also the error page is enhanced to now displaying stack trace if OneDev knows about the exception type (for instance EntityNotFoundException etc).

    Upon an error, one can always hit browser back button to go back to previous page.

  • Michael Weimann commented 5 years ago

    Upon an error, one can always hit browser back button to go back to previous page.

    That does not work if you click a link in an email. Then it would help to see something like:


    Issue 0815 could not be found

    Possible reasons may be:

    • It has been deleted
    • You might not have the permissions to display it (could that be?)

    [ Go to the project] [ Go to the home page ]

  • Robin Shen commented 5 years ago

    In case of issue being deleted, hibernate will throw a EntityNotFoundException, and the error page does not knows if it is issue related.

    In case of a permission issue, the UnauthorizedException will be thrown, and OneDev can show an appropriate message.

issue 1/1
Type
Question
Priority
Normal
Assignee
Issue Votes (0)
Watchers (3)
Reference
OD-203
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover