All files / app/mods home.ts

100% Statements 3/3
100% Branches 0/0
100% Functions 0/0
100% Lines 3/3

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129117x       117x                                                                                                                                                                                                                                             117x          
import { DateTime } from 'luxon';
import { Mod } from '../model/tag';
import { Template } from '../model/template';
 
export const homeTemplate: Template = {
  tag: 'config/home',
  name: $localize`🏡️ Home Page`,
  config: {
    version: 1,
    type: 'config',
    default: true,
    generated: $localize`Generated by jasper-ui ${DateTime.now().toISO()}`,
    description: $localize`Customise this Ext to customise the home screen.`,
    overrideForm: true,
    form: [{
      key: 'pinned',
      type: 'refs',
      props: {
        label: $localize`Pinned:`,
        addText: $localize`+ Add another pinned link`,
      },
      fieldArray: {
        props: {
          label: $localize`📌️`,
        }
      },
    }, {
      key: 'submitText',
      type: 'select',
      defaultValue: false,
      props: {
        label: $localize`Submit:`,
        options: [
          { value: true, label: $localize`Text Posts` },
          { value: false, label: $localize`Link Posts` },
        ],
      }
    }, {
      key: 'addTags',
      type: 'tags',
      defaultValue: ['public'],
      props: {
        label: $localize`Add Tags:`
      },
    }, {
      key: 'queryFilters',
      type: 'list',
      props: {
        label: $localize`Query Filters:`,
        addText: $localize`+ Add another query filter`,
      },
      fieldArray: {
        fieldGroup: [{
          key: 'label',
          type: 'string',
          props: {
            label: $localize`Label:`
          }
        }, {
          key: 'query',
          type: 'query',
          props: {
            required: true,
          }
        }]
      }
    }],
    advancedForm: [{
      key: 'responseFilters',
      type: 'list',
      props: {
        label: $localize`Response Filters:`,
        addText: $localize`+ Add another response filter`,
      },
      fieldArray: {
        fieldGroup: [{
          key: 'label',
          type: 'string',
          props: {
            label: $localize`Label:`
          }
        }, {
          key: 'response',
          type: 'plugin',
          props: {
            required: true,
          }
        }]
      }
    }, {
      key: 'defaultCols',
      type: 'select',
      props: {
        label: $localize`Columns:`,
        options: [
          { label: $localize`Default` },
          { value: 1, label: $localize`1 Column` },
          { value: 2, label: $localize`2 Columns` },
          { value: 3, label: $localize`3 Columns` },
          { value: 4, label: $localize`4 Columns` },
          { value: 5, label: $localize`5 Columns` },
          { value: 6, label: $localize`6 Columns` },
        ],
      },
    }, {
      key: 'noFloatingSidebar',
      type: 'boolean',
      props: {
        label: $localize`No Floating Sidebar:`,
      },
    }, {
      key: 'defaults',
      type: 'boolean',
      props: {
        label: $localize`Defaults:`,
      },
    }],
  },
  defaults: {
    sidebar: $localize`[🏷️ Subscriptions](/tags?home)`,
  }
};
 
export const homeMod: Mod = {
  template: [
    homeTemplate,
  ]
};