1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-08-30 20:39:46 +02:00

Compare commits

...

6 Commits

Author SHA1 Message Date
Laurent Cozic
dfd0c40982 Desktop release v2.10.14 2023-04-26 12:23:05 +01:00
Arun Kumar
b514ca7e7d Desktop: Resolves #8028: Compress installer to reduce size (#8068) 2023-04-26 12:19:34 +01:00
Laurent Cozic
9645414c17 Desktop release v2.10.13 2023-04-03 18:10:54 +02:00
Henry Heino
af0136ef39 All: Fixes #7986: Fix OneDrive sync attempting to call method on null variable (#7987) 2023-04-03 18:09:52 +02:00
Self Not Found
b76586c4fd All: Fixes #7851: Encode the non-ASCII characters in OneDrive URI (#7868) 2023-04-03 18:09:10 +02:00
Laurent Cozic
376e4ebde0 Desktop: Fixed display of installed plugins in About box 2023-04-03 18:01:06 +02:00
6 changed files with 25 additions and 32 deletions

View File

@@ -21,7 +21,7 @@ import checkForUpdates from '../checkForUpdates';
const { connect } = require('react-redux');
import { reg } from '@joplin/lib/registry';
import { ProfileConfig } from '@joplin/lib/services/profileConfig/types';
import PluginService from '@joplin/lib/services/plugins/PluginService';
import PluginService, { PluginSettings } from '@joplin/lib/services/plugins/PluginService';
const packageInfo = require('../packageInfo.js');
const { clipboard } = require('electron');
const Menu = bridge().Menu;
@@ -128,6 +128,7 @@ interface Props {
customCss: string;
locale: string;
profileConfig: ProfileConfig;
pluginSettings: PluginSettings;
}
const commandNames: string[] = menuCommandNames();
@@ -487,7 +488,7 @@ function useMenu(props: Props) {
}
function _showAbout() {
const v = versionInfo(packageInfo, PluginService.instance().plugins);
const v = versionInfo(packageInfo, PluginService.instance().enabledPlugins(props.pluginSettings));
const copyToClipboard = bridge().showMessageBox(v.message, {
icon: `${bridge().electronApp().buildDir()}/icons/128x128.png`,
@@ -930,6 +931,7 @@ function useMenu(props: Props) {
props['spellChecker.languages'],
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
props['spellChecker.enabled'],
props.pluginSettings,
props.customCss,
props.locale,
props.profileConfig,
@@ -985,6 +987,7 @@ const mapStateToProps = (state: AppState) => {
['folders.sortOrder.field']: state.settings['folders.sortOrder.field'],
['notes.sortOrder.reverse']: state.settings['notes.sortOrder.reverse'],
['folders.sortOrder.reverse']: state.settings['folders.sortOrder.reverse'],
pluginSettings: state.settings['plugins.states'],
showNoteCounts: state.settings.showNoteCounts,
uncompletedTodosOnTop: state.settings.uncompletedTodosOnTop,
showCompletedTodos: state.settings.showCompletedTodos,

View File

@@ -1,6 +1,6 @@
{
"name": "@joplin/app-desktop",
"version": "2.10.12",
"version": "2.10.14",
"description": "Joplin for Desktop",
"main": "main.js",
"private": true,
@@ -27,6 +27,7 @@
},
"build": {
"appId": "net.cozic.joplin-desktop",
"compression": "maximum",
"productName": "Joplin",
"npmRebuild": false,
"afterSign": "./tools/notarizeMacApp.js",

View File

@@ -96,14 +96,20 @@ export default class SyncTargetOneDrive extends BaseSyncTarget {
let context = Setting.value(`sync.${this.syncTargetId()}.context`);
context = context === '' ? null : JSON.parse(context);
let accountProperties = context ? context.accountProperties : null;
const api = this.api();
if (!accountProperties) {
accountProperties = await this.api_.execAccountPropertiesRequest();
accountProperties = await api.execAccountPropertiesRequest();
context ? context.accountProperties = accountProperties : context = { accountProperties: accountProperties };
Setting.setValue(`sync.${this.syncTargetId()}.context`, JSON.stringify(context));
}
this.api_.setAccountProperties(accountProperties);
api.setAccountProperties(accountProperties);
const appDir = await this.api().appDirectory();
const fileApi = new FileApi(appDir, new FileApiDriverOneDrive(this.api()));
// the appDir might contain non-ASCII characters
// /[^\u0021-\u00ff]/ is used in Node.js to detect the unescaped characters.
// See https://github.com/nodejs/node/blob/bbbf97b6dae63697371082475dc8651a6a220336/lib/_http_client.js#L176
const baseDir = RegExp(/[^\u0021-\u00ff]/).exec(appDir) !== null ? encodeURI(appDir) : appDir;
const fileApi = new FileApi(baseDir, new FileApiDriverOneDrive(this.api()));
fileApi.setSyncTargetId(this.syncTargetId());
fileApi.setLogger(this.logger());
return fileApi;

View File

@@ -100,6 +100,11 @@ export default class PluginService extends BaseService {
return this.plugins_;
}
public enabledPlugins(pluginSettings: PluginSettings): Plugins {
const enabledPlugins = Object.fromEntries(Object.entries(this.plugins_).filter((p) => this.pluginEnabled(pluginSettings, p[0])));
return enabledPlugins;
}
public get pluginIds(): string[] {
return Object.keys(this.plugins_);
}

View File

@@ -2,8 +2,6 @@ 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');
@@ -66,10 +64,6 @@ 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/);
@@ -93,12 +87,6 @@ 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/);
@@ -124,12 +112,6 @@ 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';

View File

@@ -2,7 +2,6 @@ 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;
@@ -11,16 +10,13 @@ interface PluginList {
function getPluginLists(plugins: Plugins): PluginList {
const pluginList = [];
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}`);
if (Object.keys(plugins).length > 0) {
for (const pluginId in plugins) {
pluginList.push(`${plugins[pluginId].manifest.name}: ${plugins[pluginId].manifest.version}`);
}
}
pluginList.sort();
pluginList.sort(Intl.Collator().compare);
let completeList = '';
let summary = '';