diff options
Diffstat (limited to 'server')
-rw-r--r-- | server/lib/server-config-manager.ts | 3 | ||||
-rw-r--r-- | server/tests/api/server/plugins.ts | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/server/lib/server-config-manager.ts b/server/lib/server-config-manager.ts index 18032ef86..d97f21eb7 100644 --- a/server/lib/server-config-manager.ts +++ b/server/lib/server-config-manager.ts | |||
@@ -3,6 +3,7 @@ import { CONFIG, isEmailEnabled } from '@server/initializers/config' | |||
3 | import { CONSTRAINTS_FIELDS, DEFAULT_THEME_NAME, PEERTUBE_VERSION } from '@server/initializers/constants' | 3 | import { CONSTRAINTS_FIELDS, DEFAULT_THEME_NAME, PEERTUBE_VERSION } from '@server/initializers/constants' |
4 | import { isSignupAllowed, isSignupAllowedForCurrentIP } from '@server/lib/signup' | 4 | import { isSignupAllowed, isSignupAllowedForCurrentIP } from '@server/lib/signup' |
5 | import { ActorCustomPageModel } from '@server/models/account/actor-custom-page' | 5 | import { ActorCustomPageModel } from '@server/models/account/actor-custom-page' |
6 | import { PluginModel } from '@server/models/server/plugin' | ||
6 | import { HTMLServerConfig, RegisteredExternalAuthConfig, RegisteredIdAndPassAuthConfig, ServerConfig } from '@shared/models' | 7 | import { HTMLServerConfig, RegisteredExternalAuthConfig, RegisteredIdAndPassAuthConfig, ServerConfig } from '@shared/models' |
7 | import { Hooks } from './plugins/hooks' | 8 | import { Hooks } from './plugins/hooks' |
8 | import { PluginManager } from './plugins/plugin-manager' | 9 | import { PluginManager } from './plugins/plugin-manager' |
@@ -269,6 +270,7 @@ class ServerConfigManager { | |||
269 | getRegisteredThemes () { | 270 | getRegisteredThemes () { |
270 | return PluginManager.Instance.getRegisteredThemes() | 271 | return PluginManager.Instance.getRegisteredThemes() |
271 | .map(t => ({ | 272 | .map(t => ({ |
273 | npmName: PluginModel.buildNpmName(t.name, t.type), | ||
272 | name: t.name, | 274 | name: t.name, |
273 | version: t.version, | 275 | version: t.version, |
274 | description: t.description, | 276 | description: t.description, |
@@ -280,6 +282,7 @@ class ServerConfigManager { | |||
280 | getRegisteredPlugins () { | 282 | getRegisteredPlugins () { |
281 | return PluginManager.Instance.getRegisteredPlugins() | 283 | return PluginManager.Instance.getRegisteredPlugins() |
282 | .map(p => ({ | 284 | .map(p => ({ |
285 | npmName: PluginModel.buildNpmName(p.name, p.type), | ||
283 | name: p.name, | 286 | name: p.name, |
284 | version: p.version, | 287 | version: p.version, |
285 | description: p.description, | 288 | description: p.description, |
diff --git a/server/tests/api/server/plugins.ts b/server/tests/api/server/plugins.ts index e82096c48..76d3e2481 100644 --- a/server/tests/api/server/plugins.ts +++ b/server/tests/api/server/plugins.ts | |||
@@ -99,9 +99,11 @@ describe('Test plugins', function () { | |||
99 | 99 | ||
100 | const theme = config.theme.registered.find(r => r.name === 'background-red') | 100 | const theme = config.theme.registered.find(r => r.name === 'background-red') |
101 | expect(theme).to.not.be.undefined | 101 | expect(theme).to.not.be.undefined |
102 | expect(theme.npmName).to.equal('peertube-theme-background-red') | ||
102 | 103 | ||
103 | const plugin = config.plugin.registered.find(r => r.name === 'hello-world') | 104 | const plugin = config.plugin.registered.find(r => r.name === 'hello-world') |
104 | expect(plugin).to.not.be.undefined | 105 | expect(plugin).to.not.be.undefined |
106 | expect(plugin.npmName).to.equal('peertube-plugin-hello-world') | ||
105 | }) | 107 | }) |
106 | 108 | ||
107 | it('Should update the default theme in the configuration', async function () { | 109 | it('Should update the default theme in the configuration', async function () { |