-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Desktop: Resolves #6143: Show installed plugins in Help - About Joplin #7711
Conversation
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nicely done. Test cases, the fact that ellipsis are shown when more than 20 plugins are enabled, it shows that you did your homework.
Thanks for this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks very good, thank you!
In general when modifying something under /lib or any shared package, you should also check how it's used across platforms. In that particular case, this function is also used on the CLI app (joplin version
command), so could you check please that it's still working?
They are not listed. I started I can see that Is this expected? Or is there a way to install plugins from the CLI application? |
Sorry what do you mean by this? What is not listed? And no, plugins are not supported on the CLI app at the moment Edit: Ok I guess you mean plugins are not listed and that's normal. But does the command work at all? I'm wondering because versionInfo now has a dependency to the plugin service, but plugins are not supported on CLI. (it's half supported because we use it for testing but that's it) |
I understand now. Yes it works. |
Hmm, ok it works by chance then because the plugin service is not setup on CLI, yet it's used in your updated function. Instead of having versionInfo.ts loads PluginService directly, would it be possible to pass the plugins as a dependency to versionInfo() (in the same way the packageInfo is currently passed)? And on CLI you'd pass an empty array for instance. In the context where versionInfo() is called there's |
I think that would work. |
Ok let's do that. That way we can pass an empty array on CLI |
I updated the code to pass a |
There's a TypeScript error in ErrorBoundary.tsx |
Fixed. |
Thanks! For info we removed the TypeScript build from the precommit hook because it's too slow. So it means before committing you need to check the output of |
That's great, thanks @julien-me for implementing this! |
@julien-me, since this change the tests now print the version information. Please could you remove these console statements? |
|
||
jest.mock('./registry'); | ||
|
||
const info = jest.spyOn(console, 'info').mockImplementation(() => {}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact I'm not sure why this is needed? In general we don't want code to print to the console, as that should only be used for debugging
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added that to remove console logs during the tests. There was no test for versionInfo()
until now but as soon as I added tests, the statement in versionInfo()
was polluting the test output.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense, but I guess now it can be removed? Or is versionInfo() still printing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it can be removed. versionInfo() doesn't print anything anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok great, if you could remove it then and create a pull request with it that would be perfect
@@ -32,9 +68,11 @@ export default function versionInfo(packageInfo: any) { | |||
console.info(gitInfo); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have now removed this statement as part of the "no-console" rule that was just added. I assume it was safe to remove?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not know the original intent of that line but it seems to me that it is safe to remove.
Resolves #6143
This PR lists in
Help > About Joplin
every installed plugin. If more than 20 plugins are installed then only the first 20 plugins are shown followed by...
. However when clicking onCopy
the full list is always copied.Here's some screenshots when there are 0, 1, 5, 21 plugins installed.
![plugin-list-no-plugin](https://user-images.githubusercontent.com/32807437/216603394-22003863-8494-44ac-b2b3-9ebae873d9f4.png)
![plugin-list-one-plugin](https://user-images.githubusercontent.com/32807437/216603498-14f4d12a-9e2c-4817-baea-abaeb934f7de.png)
![plugin-list-five-plugin](https://user-images.githubusercontent.com/32807437/216603518-e7d48d72-5cb2-4511-ac15-3c915fc139ad.png)
![plugin-list-twenty-one-plugin](https://user-images.githubusercontent.com/32807437/216603555-3eb04ec2-b681-4ea1-8e8b-62552893d055.png)