mirror of
https://github.com/laurent22/joplin.git
synced 2025-01-23 18:53:36 +02:00
Desktop: Plugin API - added support for settings.globalValue method
This commit is contained in:
parent
c01f533342
commit
ceb7a7303d
@ -69,6 +69,7 @@ CliClient/tests/services_CommandService.js
|
|||||||
CliClient/tests/services_InteropService.js
|
CliClient/tests/services_InteropService.js
|
||||||
CliClient/tests/services_PluginService.js
|
CliClient/tests/services_PluginService.js
|
||||||
CliClient/tests/services_rest_Api.js
|
CliClient/tests/services_rest_Api.js
|
||||||
|
CliClient/tests/services/plugins/api/JoplinSetting.js
|
||||||
CliClient/tests/services/plugins/sandboxProxy.js
|
CliClient/tests/services/plugins/sandboxProxy.js
|
||||||
CliClient/tests/synchronizer_LockHandler.js
|
CliClient/tests/synchronizer_LockHandler.js
|
||||||
CliClient/tests/synchronizer_MigrationHandler.js
|
CliClient/tests/synchronizer_MigrationHandler.js
|
||||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -63,6 +63,7 @@ CliClient/tests/services_CommandService.js
|
|||||||
CliClient/tests/services_InteropService.js
|
CliClient/tests/services_InteropService.js
|
||||||
CliClient/tests/services_PluginService.js
|
CliClient/tests/services_PluginService.js
|
||||||
CliClient/tests/services_rest_Api.js
|
CliClient/tests/services_rest_Api.js
|
||||||
|
CliClient/tests/services/plugins/api/JoplinSetting.js
|
||||||
CliClient/tests/services/plugins/sandboxProxy.js
|
CliClient/tests/services/plugins/sandboxProxy.js
|
||||||
CliClient/tests/synchronizer_LockHandler.js
|
CliClient/tests/synchronizer_LockHandler.js
|
||||||
CliClient/tests/synchronizer_MigrationHandler.js
|
CliClient/tests/synchronizer_MigrationHandler.js
|
||||||
|
16
CliClient/tests/services/plugins/api/JoplinSetting.ts
Normal file
16
CliClient/tests/services/plugins/api/JoplinSetting.ts
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
// import Setting from 'lib/models/Setting';
|
||||||
|
|
||||||
|
// const { asyncTest, setupDatabaseAndSynchronizer, switchClient, expectThrow, expectNotThrow } = require('../test-utils.js');
|
||||||
|
|
||||||
|
// describe('plugin_api_JoplinSetting', function() {
|
||||||
|
|
||||||
|
// beforeEach(async (done) => {
|
||||||
|
// await setupDatabaseAndSynchronizer(1);
|
||||||
|
// await switchClient(1);
|
||||||
|
// done();
|
||||||
|
// });
|
||||||
|
|
||||||
|
// it('should get and set plugin-specific values', asyncTest(async () => {
|
||||||
|
// await
|
||||||
|
// }));
|
||||||
|
// });
|
@ -3,6 +3,7 @@
|
|||||||
"spec_files": [
|
"spec_files": [
|
||||||
"*.js",
|
"*.js",
|
||||||
"services/plugins/*.js",
|
"services/plugins/*.js",
|
||||||
|
"services/plugins/api/*.js",
|
||||||
"!test-utils.js"
|
"!test-utils.js"
|
||||||
],
|
],
|
||||||
"stopSpecOnExpectationFailure": false,
|
"stopSpecOnExpectationFailure": false,
|
||||||
|
@ -73,4 +73,15 @@ export default class JoplinSettings {
|
|||||||
async setValue(key:string, value:any) {
|
async setValue(key:string, value:any) {
|
||||||
return Setting.setValue(this.namespacedKey(key), value);
|
return Setting.setValue(this.namespacedKey(key), value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets a global setting value, including app-specific settings and those set by other plugins.
|
||||||
|
*
|
||||||
|
* The list of available settings is not documented yet, but can be found by looking at the source code:
|
||||||
|
*
|
||||||
|
* https://github.com/laurent22/joplin/blob/3539a452a359162c461d2849829d2d42973eab50/ReactNativeClient/lib/models/Setting.ts#L142
|
||||||
|
*/
|
||||||
|
async globalValue(key:string):Promise<any> {
|
||||||
|
return Setting.value(key);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user