mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-02-25 18:55:32 -06:00
Translate plugin settings
This commit is contained in:
@@ -3,6 +3,7 @@ import { CONFIG, isEmailEnabled } from '@server/initializers/config'
|
||||
import { CONSTRAINTS_FIELDS, DEFAULT_THEME_NAME, PEERTUBE_VERSION } from '@server/initializers/constants'
|
||||
import { isSignupAllowed, isSignupAllowedForCurrentIP } from '@server/lib/signup'
|
||||
import { ActorCustomPageModel } from '@server/models/account/actor-custom-page'
|
||||
import { PluginModel } from '@server/models/server/plugin'
|
||||
import { HTMLServerConfig, RegisteredExternalAuthConfig, RegisteredIdAndPassAuthConfig, ServerConfig } from '@shared/models'
|
||||
import { Hooks } from './plugins/hooks'
|
||||
import { PluginManager } from './plugins/plugin-manager'
|
||||
@@ -269,6 +270,7 @@ class ServerConfigManager {
|
||||
getRegisteredThemes () {
|
||||
return PluginManager.Instance.getRegisteredThemes()
|
||||
.map(t => ({
|
||||
npmName: PluginModel.buildNpmName(t.name, t.type),
|
||||
name: t.name,
|
||||
version: t.version,
|
||||
description: t.description,
|
||||
@@ -280,6 +282,7 @@ class ServerConfigManager {
|
||||
getRegisteredPlugins () {
|
||||
return PluginManager.Instance.getRegisteredPlugins()
|
||||
.map(p => ({
|
||||
npmName: PluginModel.buildNpmName(p.name, p.type),
|
||||
name: p.name,
|
||||
version: p.version,
|
||||
description: p.description,
|
||||
|
||||
@@ -99,9 +99,11 @@ describe('Test plugins', function () {
|
||||
|
||||
const theme = config.theme.registered.find(r => r.name === 'background-red')
|
||||
expect(theme).to.not.be.undefined
|
||||
expect(theme.npmName).to.equal('peertube-theme-background-red')
|
||||
|
||||
const plugin = config.plugin.registered.find(r => r.name === 'hello-world')
|
||||
expect(plugin).to.not.be.undefined
|
||||
expect(plugin.npmName).to.equal('peertube-plugin-hello-world')
|
||||
})
|
||||
|
||||
it('Should update the default theme in the configuration', async function () {
|
||||
|
||||
Reference in New Issue
Block a user