aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/models
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-08-20 16:18:16 +0200
committerChocobozzz <chocobozzz@cpy.re>2020-08-21 15:39:51 +0200
commit7294aab0c879ef96c0fde15c389a2c4c1463d3c7 (patch)
treebad1176720ee04266eba5470e9956e3a7871e349 /shared/models
parentf95628636b6ccdf3eae2449ca718e075b072f678 (diff)
downloadPeerTube-7294aab0c879ef96c0fde15c389a2c4c1463d3c7.tar.gz
PeerTube-7294aab0c879ef96c0fde15c389a2c4c1463d3c7.tar.zst
PeerTube-7294aab0c879ef96c0fde15c389a2c4c1463d3c7.zip
Add ability to set custom field to video form
Diffstat (limited to 'shared/models')
-rw-r--r--shared/models/plugins/client-hook.model.ts3
-rw-r--r--shared/models/plugins/index.ts1
-rw-r--r--shared/models/plugins/plugin-client-scope.type.ts2
-rw-r--r--shared/models/plugins/register-client-form-field.model.ts12
-rw-r--r--shared/models/plugins/register-server-setting.model.ts9
-rw-r--r--shared/models/videos/video-update.model.ts2
-rw-r--r--shared/models/videos/video.model.ts2
7 files changed, 23 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'
19export * from './plugin.type' 19export * from './plugin.type'
20export * from './public-server.setting' 20export * from './public-server.setting'
21export * from './register-client-hook.model' 21export * from './register-client-hook.model'
22export * from './register-client-form-field.model'
22export * from './register-server-hook.model' 23export * from './register-server-hook.model'
23export * from './register-server-setting.model' 24export * from './register-server-setting.model'
24export * from './server-hook.model' 25export * 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 @@
1export 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
10export 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 @@
1export interface RegisterServerSettingOptions { 1import { 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
3export 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
15export interface RegisteredServerSettings { 10export interface RegisteredServerSettings {
diff --git a/shared/models/videos/video-update.model.ts b/shared/models/videos/video-update.model.ts
index 4ef904156..86653b959 100644
--- a/shared/models/videos/video-update.model.ts
+++ b/shared/models/videos/video-update.model.ts
@@ -19,4 +19,6 @@ export interface VideoUpdate {
19 previewfile?: Blob 19 previewfile?: Blob
20 scheduleUpdate?: VideoScheduleUpdate 20 scheduleUpdate?: VideoScheduleUpdate
21 originallyPublishedAt?: Date | string 21 originallyPublishedAt?: Date | string
22
23 pluginData?: any
22} 24}
diff --git a/shared/models/videos/video.model.ts b/shared/models/videos/video.model.ts
index 557e66e09..158ee8f05 100644
--- a/shared/models/videos/video.model.ts
+++ b/shared/models/videos/video.model.ts
@@ -53,6 +53,8 @@ export interface Video {
53 userHistory?: { 53 userHistory?: {
54 currentTime: number 54 currentTime: number
55 } 55 }
56
57 pluginData?: any
56} 58}
57 59
58export interface VideoDetails extends Video { 60export interface VideoDetails extends Video {