mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-24 10:27:10 +02:00
Merge branch 'release-2.10' into dev
This commit is contained in:
commit
9e5b455065
@ -489,7 +489,6 @@ function useMenu(props: Props) {
|
||||
function _showAbout() {
|
||||
const v = versionInfo(packageInfo, PluginService.instance().plugins);
|
||||
|
||||
|
||||
const copyToClipboard = bridge().showMessageBox(v.message, {
|
||||
icon: `${bridge().electronApp().buildDir()}/icons/128x128.png`,
|
||||
buttons: [_('Copy'), _('OK')],
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@joplin/app-desktop",
|
||||
"version": "2.10.10",
|
||||
"version": "2.10.11",
|
||||
"description": "Joplin for Desktop",
|
||||
"main": "main.js",
|
||||
"private": true,
|
||||
|
@ -2,6 +2,8 @@ import versionInfo from './versionInfo';
|
||||
import { reg } from './registry';
|
||||
import { Plugins } from './services/plugins/PluginService';
|
||||
import Plugin from './services/plugins/Plugin';
|
||||
import Setting from './models/Setting';
|
||||
import { PluginSettings } from './services/plugins/PluginService';
|
||||
|
||||
jest.mock('./registry');
|
||||
|
||||
@ -64,6 +66,10 @@ describe('getPluginLists', () => {
|
||||
const plugins: Plugins = {};
|
||||
plugins[plugin.manifest.id] = plugin;
|
||||
|
||||
const pluginSettings: PluginSettings = {};
|
||||
pluginSettings[plugin.id] = { enabled: true, deleted: false, hasBeenUpdated: false };
|
||||
Setting.setValue('plugins.states', pluginSettings);
|
||||
|
||||
const v = versionInfo(packageInfo, plugins);
|
||||
expect(v.body).toMatch(/\n\nPlugin1: 1/);
|
||||
expect(v.message).toMatch(/\n\nPlugin1: 1/);
|
||||
@ -86,6 +92,13 @@ describe('getPluginLists', () => {
|
||||
);
|
||||
plugins[plugin.manifest.id] = plugin;
|
||||
}
|
||||
|
||||
const pluginSettings: PluginSettings = {};
|
||||
for (const key of Object.keys(plugins)) {
|
||||
pluginSettings[key] = { enabled: true, deleted: false, hasBeenUpdated: false };
|
||||
}
|
||||
Setting.setValue('plugins.states', pluginSettings);
|
||||
|
||||
const v = versionInfo(packageInfo, plugins);
|
||||
|
||||
expect(v.body).toMatch(/\n\nPlugin1: 1\nPlugin2: 1\nPlugin3: 1/);
|
||||
@ -110,6 +123,13 @@ describe('getPluginLists', () => {
|
||||
|
||||
plugins[plugin.manifest.id] = plugin;
|
||||
}
|
||||
|
||||
const pluginSettings: PluginSettings = {};
|
||||
for (const key of Object.keys(plugins)) {
|
||||
pluginSettings[key] = { enabled: true, deleted: false, hasBeenUpdated: false };
|
||||
}
|
||||
Setting.setValue('plugins.states', pluginSettings);
|
||||
|
||||
const v = versionInfo(packageInfo, plugins);
|
||||
|
||||
const body = '\n';
|
||||
|
@ -2,6 +2,7 @@ import { _ } from './locale';
|
||||
import Setting from './models/Setting';
|
||||
import { reg } from './registry';
|
||||
import { Plugins } from './services/plugins/PluginService';
|
||||
import PluginService from './services/plugins/PluginService';
|
||||
|
||||
interface PluginList {
|
||||
completeList: string;
|
||||
@ -10,12 +11,17 @@ interface PluginList {
|
||||
|
||||
function getPluginLists(plugins: Plugins): PluginList {
|
||||
const pluginList = [];
|
||||
if (Object.keys(plugins).length > 0) {
|
||||
for (const pluginId in plugins) {
|
||||
pluginList.push(`${plugins[pluginId].manifest.name}: ${plugins[pluginId].manifest.version}`);
|
||||
const pluginSettings = PluginService.instance().unserializePluginSettings(Setting.value('plugins.states'));
|
||||
const enabledPlugins = Object.fromEntries(Object.entries(plugins).filter((p) => pluginSettings[p[0]] && pluginSettings[p[0]].enabled === true));
|
||||
|
||||
if (Object.keys(enabledPlugins).length > 0) {
|
||||
for (const pluginId in enabledPlugins) {
|
||||
pluginList.push(`${enabledPlugins[pluginId].manifest.name}: ${enabledPlugins[pluginId].manifest.version}`);
|
||||
}
|
||||
}
|
||||
|
||||
pluginList.sort();
|
||||
|
||||
let completeList = '';
|
||||
let summary = '';
|
||||
if (pluginList.length > 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user