Teamwork / vscode-projects

Teamwork Projects VSCode Extension
MIT License
16 stars 7 forks source link

List of Projects available to select is truncated at 200 #19

Open ghost opened 4 years ago

ghost commented 4 years ago

When setting up the plugin and clicking -> Select Project for Repository, there is no pagination or other function to view more than the 200 projects at a time.

I am using this as a site as an Administrator, so I have access to all projects in the Owner company - even those which I am not assigned to. Unfortunately this pushes many of the ones which are relevant to me beyond the first 200 in alphabetical order.

image

TheDavidJohnson commented 2 years ago

Ran into this same issue today. The limit is coming from this API call:

            const url = this.root + '/tasks/projects.json?type=canAddItem&pageSize=200';

Some sort of pagination is probably the ideal solution, but I successfully tested a temporary workaround by locating the js source for the installed extension on my system and changing that query to pageSize=4000

YMMV.

I'm using the vscodium project and installed this extension from a downloaded .vsix file, so the path to the relevant file on my system was ~/.vscode-oss/extensions/teamwork.twp-1.0.21/out/teamworkProjectsApi.js and the query was on line 81.

I had to close and reopen VS Code for it to take effect, but I was able to see all my projects and the query execution was surprisingly fast.