partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

OperatorStore.js (3616B)


      1 /**
      2  * Stores all supported query operators
      3  */
      4 Ext.define("PartKeepr.Data.store.OperatorStore", {
      5     extend: "Ext.data.Store",
      6 
      7     /**
      8      * The store ID to use
      9      */
     10     storeId: 'OperatorStore',
     11 
     12     fields: [
     13         /**
     14          * The operator to use for Ext.util.Filter
     15          */
     16         {
     17 
     18             name: 'operator',
     19             type: 'string'
     20         },
     21         /**
     22          * The symbol to display to the user
     23          */
     24         {
     25             name: 'symbol',
     26             type: 'string'
     27         },
     28         /**
     29          * The description, so that the user knows what the operator does
     30          */
     31         {
     32             name: 'description',
     33             type: 'string'
     34         },
     35         /**
     36          * The operator type. May be "scalar" or "list"
     37          */
     38         {
     39             name: 'type',
     40             type: 'string'
     41         },
     42         /**
     43          * Defines if the operator can be used for scalar comparisons
     44          */
     45         {
     46             name: 'scalar',
     47             type: 'boolean'
     48         },
     49         /**
     50          * Defines if the operator can be used for entity comparisons
     51          */
     52         {
     53             name: 'entity',
     54             type: 'boolean'
     55         },
     56         /**
     57          * Defines if the operator can be used for string values
     58          */
     59         {
     60             name: 'string',
     61             type: 'boolean'
     62         },
     63         /**
     64          * Defines if the operator can be used for numeric values
     65          */
     66         {
     67             name: 'numeric',
     68             type: 'boolean'
     69         }
     70     ],
     71     data: [
     72         {
     73             operator: "<",
     74             symbol: "<",
     75             description: i18n("Less than"),
     76             type: 'scalar',
     77             scalar: true,
     78             string: false,
     79             numeric: true,
     80             entity: false
     81         },
     82         {
     83             operator: ">",
     84             symbol: ">",
     85             description: i18n("Greater than"),
     86             type: 'scalar',
     87             scalar: true,
     88             string: false,
     89             numeric: true,
     90             entity: false
     91         },
     92         {
     93             operator: "=",
     94             symbol: "=",
     95             description: i18n("Equals"),
     96             type: 'scalar',
     97             scalar: true,
     98             string: true,
     99             numeric: true,
    100             entity: true
    101         },
    102         {
    103             operator: ">=",
    104             symbol: "≥",
    105             description: i18n("Greater than or equals"),
    106             type: 'scalar',
    107             scalar: true,
    108             string: false,
    109             numeric: true,
    110             entity: false
    111         },
    112         {
    113             operator: "<=",
    114             symbol: "≤",
    115             description: i18n("Less than or equals"),
    116             type: 'scalar',
    117             scalar: true,
    118             string: false,
    119             numeric: true,
    120             entity: false
    121         },
    122         {
    123             operator: "!=",
    124             symbol: "≠",
    125             description: i18n("Not equals"),
    126             type: 'scalar',
    127             scalar: true,
    128             string: true,
    129             numeric: true,
    130             entity: true
    131         }, {
    132             operator: "in",
    133             symbol: "IN",
    134             description: i18n("Matches a list"),
    135             type: 'list',
    136             scalar: true,
    137             string: true,
    138             numeric: true,
    139             entity: true
    140         },
    141         {
    142             operator: "like",
    143             symbol: "%%",
    144             description: i18n("Matches a subtext with wildcards (%)"),
    145             type: 'scalar',
    146             scalar: true,
    147             string: true,
    148             numeric: false,
    149             entity: false
    150         }
    151     ]
    152 });