CurationStatus.ts 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /** This file is generated based on JSON schema. Do not modify. */
  2. import * as Yup from 'yup';
  3. import { EntityCodec } from '@joystream/types/versioned-store/EntityCodec';
  4. export const CurationStatusValidationSchema = Yup.object().shape({
  5. value: Yup.string()
  6. .required('This field is required')
  7. .max(255, 'Text is too long. Maximum length is 255 chars.')
  8. });
  9. export type CurationStatusFormValues = {
  10. value: string;
  11. };
  12. export type CurationStatusType = {
  13. classId: number;
  14. inClassSchemaIndexes: number[];
  15. id: number;
  16. value: string;
  17. };
  18. export class CurationStatusCodec extends EntityCodec<CurationStatusType> { }
  19. export function CurationStatusToFormValues (entity?: CurationStatusType): CurationStatusFormValues {
  20. return {
  21. value: (entity && entity.value) || ''
  22. };
  23. }
  24. export type CurationStatusPropId =
  25. 'value'
  26. ;
  27. export type CurationStatusGenericProp = {
  28. id: CurationStatusPropId;
  29. type: string;
  30. name: string;
  31. description?: string;
  32. required?: boolean;
  33. maxItems?: number;
  34. maxTextLength?: number;
  35. classId?: any;
  36. };
  37. type CurationStatusClassType = {
  38. [id in CurationStatusPropId]: CurationStatusGenericProp
  39. };
  40. export const CurationStatusClass: CurationStatusClassType = {
  41. value: {
  42. id: 'value',
  43. name: 'Value',
  44. description: 'The curator publication status of the content in the content directory.',
  45. required: true,
  46. type: 'Text',
  47. maxTextLength: 255
  48. }
  49. };