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

UI can't render switch pane for projects with project_id > 10 #853

Closed
goredar opened this issue Sep 29, 2016 · 9 comments
Closed

UI can't render switch pane for projects with project_id > 10 #853

goredar opened this issue Sep 29, 2016 · 9 comments
Labels

Comments

@goredar
Copy link

goredar commented Sep 29, 2016

UI's request for project list to 'api/projects?is_public=1&project_name=' returns part of actual list due to default pagination:

const (
    defaultPageSize int64 = 10
    maxPageSize     int64 = 100
)

UI can't find current project in that incomplete list and fails:

current language:English
visited:/repository
list project projectName: , isPublic:1
retrieve repositories, project_id:17
list repositories:17, q:
TypeError: Cannot read property 'project_id' of undefined
    at getProjectSuccess (harbor.app.min.js:15)
    at angular.min.js:95
    at angular.min.js:128
    at m.$eval (angular.min.js:142)
    at m.$digest (angular.min.js:140)
    at m.$apply (angular.min.js:143)
    at g (angular.min.js:95)
    at x (angular.min.js:100)
    at XMLHttpRequest.v.onload (angular.min.js:101)
loading-progress, toggleInProgress:undefined, hideTarget:true
Total Count:5, Page Size:15, Display Count:5, Page:1
loading-progress, toggleInProgress:false, hideTarget:true

Built from 0.4.0 tag.

@reasonerjt
Copy link
Contributor

@goredar I don't reproduce the error. could you also show the reponse of the api call?

@goredar
Copy link
Author

goredar commented Sep 29, 2016

Reproduced on clean install after creating over 10 new projects.

curl 'http://localhost/api/projects?is_public=1&project_name='

[
{
"project_id": 10,
"owner_id": 1,
"name": "0001",
"creation_time": "2016-09-29T19:21:18Z",
"creation_time_str": "",
"deleted": 0,
"owner_name": "",
"public": 1,
"Togglable": false,
"update_time": "2016-09-29T19:21:18Z",
"current_user_role_id": 0,
"repo_count": 0
},
{
"project_id": 2,
"owner_id": 1,
"name": "0002",
"creation_time": "2016-09-29T19:20:00Z",
"creation_time_str": "",
"deleted": 0,
"owner_name": "",
"public": 1,
"Togglable": false,
"update_time": "2016-09-29T19:20:00Z",
"current_user_role_id": 0,
"repo_count": 0
},
{
"project_id": 3,
"owner_id": 1,
"name": "0003",
"creation_time": "2016-09-29T19:20:08Z",
"creation_time_str": "",
"deleted": 0,
"owner_name": "",
"public": 1,
"Togglable": false,
"update_time": "2016-09-29T19:20:08Z",
"current_user_role_id": 0,
"repo_count": 0
},
{
"project_id": 4,
"owner_id": 1,
"name": "0004",
"creation_time": "2016-09-29T19:20:17Z",
"creation_time_str": "",
"deleted": 0,
"owner_name": "",
"public": 1,
"Togglable": false,
"update_time": "2016-09-29T19:20:17Z",
"current_user_role_id": 0,
"repo_count": 0
},
{
"project_id": 5,
"owner_id": 1,
"name": "0005",
"creation_time": "2016-09-29T19:20:24Z",
"creation_time_str": "",
"deleted": 0,
"owner_name": "",
"public": 1,
"Togglable": false,
"update_time": "2016-09-29T19:20:24Z",
"current_user_role_id": 0,
"repo_count": 0
},
{
"project_id": 6,
"owner_id": 1,
"name": "0006",
"creation_time": "2016-09-29T19:20:29Z",
"creation_time_str": "",
"deleted": 0,
"owner_name": "",
"public": 1,
"Togglable": false,
"update_time": "2016-09-29T19:20:29Z",
"current_user_role_id": 0,
"repo_count": 0
},
{
"project_id": 7,
"owner_id": 1,
"name": "0007",
"creation_time": "2016-09-29T19:20:33Z",
"creation_time_str": "",
"deleted": 0,
"owner_name": "",
"public": 1,
"Togglable": false,
"update_time": "2016-09-29T19:20:33Z",
"current_user_role_id": 0,
"repo_count": 0
},
{
"project_id": 11,
"owner_id": 1,
"name": "0008",
"creation_time": "2016-09-29T19:21:23Z",
"creation_time_str": "",
"deleted": 0,
"owner_name": "",
"public": 1,
"Togglable": false,
"update_time": "2016-09-29T19:21:23Z",
"current_user_role_id": 0,
"repo_count": 0
},
{
"project_id": 8,
"owner_id": 1,
"name": "0009",
"creation_time": "2016-09-29T19:20:43Z",
"creation_time_str": "",
"deleted": 0,
"owner_name": "",
"public": 1,
"Togglable": false,
"update_time": "2016-09-29T19:20:43Z",
"current_user_role_id": 0,
"repo_count": 0
},
{
"project_id": 9,
"owner_id": 1,
"name": "0010",
"creation_time": "2016-09-29T19:21:00Z",
"creation_time_str": "",
"deleted": 0,
"owner_name": "",
"public": 1,
"Togglable": false,
"update_time": "2016-09-29T19:21:00Z",
"current_user_role_id": 0,
"repo_count": 0
}
]

![2016-09-29-223652_2560x1600_scrot](https://cloud.githubusercontent.com/assets/2493296/18969451/ea1e8784-8695-11e6-96da-973dc96449ad.png) ![2016-09-29-223641_2560x1600_scrot](https://cloud.githubusercontent.com/assets/2493296/18969452/ea20c760-8695-11e6-8fcf-cf594a9a1cee.png)

@reasonerjt
Copy link
Contributor

Thanks, this is a issue in UI will fix it

@reasonerjt
Copy link
Contributor

There's a quick fix applied, however it introduces restriction that the drop down list will only show the projects in the same page as the current I'll open another issue to track it.

@goredar
Copy link
Author

goredar commented Sep 30, 2016

Tanks a lot! However in my opinion API should not return parted result unless you explicitly request pagination.

@reasonerjt
Copy link
Contributor

Yes we'll revisit that, thanks for suggestion.

@bergtwvd
Copy link

bergtwvd commented Oct 2, 2016

I have 11 projects in v0.40. Probably due to this same bug, I cannot modify the user membership of the 11th project. The options are just not shown.

@reasonerjt
Copy link
Contributor

I'm closing this issue as the fix is applied, we'll revisit the api and it will be tracked by #856

@bergtwvd ,I created more than 10 projects and i didn't reproduce the issue you saw, I think it's not the same bug, if you are still seeing the issue please open a new issue.

@bergtwvd
Copy link

bergtwvd commented Oct 10, 2016

Did you test on v0.4.0? I will open a bug for 0.4.0.

See #865, and also steps to reproduce.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants