diff options
author | Chocobozzz <me@florianbigard.com> | 2020-08-20 16:18:16 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-08-21 15:39:51 +0200 |
commit | 7294aab0c879ef96c0fde15c389a2c4c1463d3c7 (patch) | |
tree | bad1176720ee04266eba5470e9956e3a7871e349 /shared/models/plugins | |
parent | f95628636b6ccdf3eae2449ca718e075b072f678 (diff) | |
download | PeerTube-7294aab0c879ef96c0fde15c389a2c4c1463d3c7.tar.gz PeerTube-7294aab0c879ef96c0fde15c389a2c4c1463d3c7.tar.zst PeerTube-7294aab0c879ef96c0fde15c389a2c4c1463d3c7.zip |
Add ability to set custom field to video form
Diffstat (limited to 'shared/models/plugins')
-rw-r--r-- | shared/models/plugins/client-hook.model.ts | 3 | ||||
-rw-r--r-- | shared/models/plugins/index.ts | 1 | ||||
-rw-r--r-- | shared/models/plugins/plugin-client-scope.type.ts | 2 | ||||
-rw-r--r-- | shared/models/plugins/register-client-form-field.model.ts | 12 | ||||
-rw-r--r-- | shared/models/plugins/register-server-setting.model.ts | 9 |
5 files changed, 19 insertions, 8 deletions
diff --git a/shared/models/plugins/client-hook.model.ts b/shared/models/plugins/client-hook.model.ts index 193a3f646..7b7144676 100644 --- a/shared/models/plugins/client-hook.model.ts +++ b/shared/models/plugins/client-hook.model.ts | |||
@@ -70,6 +70,9 @@ export const clientActionHookObject = { | |||
70 | // Fired when a user click on 'View x replies' and they're loaded | 70 | // Fired when a user click on 'View x replies' and they're loaded |
71 | 'action:video-watch.video-thread-replies.loaded': true, | 71 | 'action:video-watch.video-thread-replies.loaded': true, |
72 | 72 | ||
73 | // Fired when the video edit page (upload, URL/torrent import, update) is being initialized | ||
74 | 'action:video-edit.init': true, | ||
75 | |||
73 | // Fired when the login page is being initialized | 76 | // Fired when the login page is being initialized |
74 | 'action:login.init': true, | 77 | 'action:login.init': true, |
75 | 78 | ||
diff --git a/shared/models/plugins/index.ts b/shared/models/plugins/index.ts index 209fca791..83ed6f583 100644 --- a/shared/models/plugins/index.ts +++ b/shared/models/plugins/index.ts | |||
@@ -19,6 +19,7 @@ export * from './plugin-video-privacy-manager.model' | |||
19 | export * from './plugin.type' | 19 | export * from './plugin.type' |
20 | export * from './public-server.setting' | 20 | export * from './public-server.setting' |
21 | export * from './register-client-hook.model' | 21 | export * from './register-client-hook.model' |
22 | export * from './register-client-form-field.model' | ||
22 | export * from './register-server-hook.model' | 23 | export * from './register-server-hook.model' |
23 | export * from './register-server-setting.model' | 24 | export * from './register-server-setting.model' |
24 | export * from './server-hook.model' | 25 | export * from './server-hook.model' |
diff --git a/shared/models/plugins/plugin-client-scope.type.ts b/shared/models/plugins/plugin-client-scope.type.ts index a3c669fe7..e188ce100 100644 --- a/shared/models/plugins/plugin-client-scope.type.ts +++ b/shared/models/plugins/plugin-client-scope.type.ts | |||
@@ -1 +1 @@ | |||
export type PluginClientScope = 'common' | 'video-watch' | 'search' | 'signup' | 'login' | 'embed' | export type PluginClientScope = 'common' | 'video-watch' | 'search' | 'signup' | 'login' | 'embed' | 'video-edit' | ||
diff --git a/shared/models/plugins/register-client-form-field.model.ts b/shared/models/plugins/register-client-form-field.model.ts new file mode 100644 index 000000000..df24339c6 --- /dev/null +++ b/shared/models/plugins/register-client-form-field.model.ts | |||
@@ -0,0 +1,12 @@ | |||
1 | export interface RegisterClientFormFieldOptions { | ||
2 | name: string | ||
3 | label: string | ||
4 | type: 'input' | 'input-checkbox' | 'input-textarea' | 'markdown-text' | 'markdown-enhanced' | ||
5 | |||
6 | // Default setting value | ||
7 | default?: string | boolean | ||
8 | } | ||
9 | |||
10 | export interface RegisterClientVideoFieldOptions { | ||
11 | type: 'import-url' | 'import-torrent' | 'update' | 'upload' | ||
12 | } | ||
diff --git a/shared/models/plugins/register-server-setting.model.ts b/shared/models/plugins/register-server-setting.model.ts index 920c3480f..6872dc53e 100644 --- a/shared/models/plugins/register-server-setting.model.ts +++ b/shared/models/plugins/register-server-setting.model.ts | |||
@@ -1,15 +1,10 @@ | |||
1 | export interface RegisterServerSettingOptions { | 1 | import { RegisterClientFormFieldOptions } from './register-client-form-field.model' |
2 | name: string | ||
3 | label: string | ||
4 | type: 'input' | 'input-checkbox' | 'input-textarea' | 'markdown-text' | 'markdown-enhanced' | ||
5 | 2 | ||
3 | export interface RegisterServerSettingOptions extends RegisterClientFormFieldOptions { | ||
6 | // If the setting is not private, anyone can view its value (client code included) | 4 | // If the setting is not private, anyone can view its value (client code included) |
7 | // If the setting is private, only server-side hooks can access it | 5 | // If the setting is private, only server-side hooks can access it |
8 | // Mainly used by the PeerTube client to get admin config | 6 | // Mainly used by the PeerTube client to get admin config |
9 | private: boolean | 7 | private: boolean |
10 | |||
11 | // Default setting value | ||
12 | default?: string | boolean | ||
13 | } | 8 | } |
14 | 9 | ||
15 | export interface RegisteredServerSettings { | 10 | export interface RegisteredServerSettings { |