diff --git a/apps/ui/src/views/Editor.vue b/apps/ui/src/views/Editor.vue index 01e4a07ce..d397d20a1 100644 --- a/apps/ui/src/views/Editor.vue +++ b/apps/ui/src/views/Editor.vue @@ -18,30 +18,31 @@ type StrategyWithTreasury = SelectedStrategy & { treasury: RequiredProperty; }; +const MAX_BODY_LENGTH = { + default: 10000, + turbo: 40000 +} as const; + const TITLE_DEFINITION = { type: 'string', title: 'Title', - minLength: 1 + minLength: 1, + maxLength: 256 }; const DISCUSSION_DEFINITION = { type: 'string', format: 'uri', title: 'Discussion', + maxLength: 256, examples: ['e.g. https://forum.balancer.fi/t/proposal…'] }; -const BODY_DEFINITION = { - type: 'string', - format: 'long', - title: 'Body', - maxLength: 9600 -}; - const CHOICES_DEFINITION = { type: 'array', title: 'Choices', minItems: 1, + maxItems: 500, items: [{ type: 'string', minLength: 1, maxLength: 32 }], additionalItems: { type: 'string', maxLength: 32 } }; @@ -192,6 +193,12 @@ const extraContacts = computed(() => { return space.value.treasuries as Contact[]; }); +const bodyDefinition = computed(() => ({ + type: 'string', + format: 'long', + title: 'Body', + maxLength: MAX_BODY_LENGTH[space.value?.turbo ? 'turbo' : 'default'] +})); const formErrors = computed(() => { if (!proposal.value) return {}; @@ -203,7 +210,7 @@ const formErrors = computed(() => { required: ['title', 'choices'], properties: { title: TITLE_DEFINITION, - body: BODY_DEFINITION, + body: bodyDefinition.value, discussion: DISCUSSION_DEFINITION, choices: CHOICES_DEFINITION } @@ -470,7 +477,7 @@ export default defineComponent({