defaultView(applet) {
          let recycledPropKey = ctx.app.$model.recycledFlagPropertyKey;
          if (!applet || !recycledPropKey) return {};

          let view = {
            name: 'All Items',
            key: 'ALL',
            ord: 1,
            type: 'List',
            subType: 'Grid',
            filter: [{ propertyKey: recycledPropKey, operator: 'eq', value: 0 }],
            include: null,
            properties: []
          };

          // Get some info needed below to build the array of properties
          let sortKey = '';
          const model = this.model(applet);
          const modelProperties = ctx.app.$model.requiredProperties(model);
          const excludedProps = [ctx.app.$model.recycledFlagPropertyKey, ...ctx.store.state.app.modelPropKeys.defaultNonSearchable];
          const searchableModelPropKeys = ctx.app.$model.requiredStringPropertyKeys(model, excludedProps);

          _(modelProperties).forEach((val, index) => {
            let viewProp = {
              key: val.key,
              label: ctx.app.$helpers.toTitleCase(val.key)
            };
            if (!sortKey && val.required && val.type === 'string') {
              sortKey = val.key;
              viewProp.sort = 'ASC';
            }
            if (searchableModelPropKeys.includes(val.key)) viewProp.search = true;
            view.properties.push(viewProp);
          });

          return view;
        }
/**
         * Given an applet object, compose and return a default applet view based on the model properties (as a fallback to the applet configuration).
         * On error return an empty object
         * @param {object} applet Applet object
         */
Given an applet object, compose and return a default applet view based on the model properties (as a fallback to the applet configuration).
On error return an empty object
@param {object} applet Applet object
Given an applet object compose and return a default applet view based on the model properties ( as a fallback to the applet configuration ) . On error return an empty object @param { object } applet Applet object
defaultView(applet) {
          let recycledPropKey = ctx.app.$model.recycledFlagPropertyKey;
          if (!applet || !recycledPropKey) return {};
          let view = {
            name: 'All Items',
            key: 'ALL',
            ord: 1,
            type: 'List',
            subType: 'Grid',
            filter: [{ propertyKey: recycledPropKey, operator: 'eq', value: 0 }],
            include: null,
            properties: []
          };
          let sortKey = '';
          const model = this.model(applet);
          const modelProperties = ctx.app.$model.requiredProperties(model);
          const excludedProps = [ctx.app.$model.recycledFlagPropertyKey, ...ctx.store.state.app.modelPropKeys.defaultNonSearchable];
          const searchableModelPropKeys = ctx.app.$model.requiredStringPropertyKeys(model, excludedProps);
          _(modelProperties).forEach((val, index) => {
            let viewProp = {
              key: val.key,
              label: ctx.app.$helpers.toTitleCase(val.key)
            };
            if (!sortKey && val.required && val.type === 'string') {
              sortKey = val.key;
              viewProp.sort = 'ASC';
            }
            if (searchableModelPropKeys.includes(val.key)) viewProp.search = true;
            view.properties.push(viewProp);
          });
          return view;
        }
defaultView ( applet ) { let recycledPropKey = ctx . app . $model . recycledFlagPropertyKey ; if ( ! applet || ! recycledPropKey ) return { } ; let view = { name : 'All Items' , key : 'ALL' , ord : 1 , type : 'List' , subType : 'Grid' , filter : [ { propertyKey : recycledPropKey , operator : 'eq' , value : 0 } ] , include : null , properties : [ ] } ; let sortKey = '' ; const model = this . model ( applet ) ; const modelProperties = ctx . app . $model . requiredProperties ( model ) ; const excludedProps = [ ctx . app . $model . recycledFlagPropertyKey , ... ctx . store . state . app . modelPropKeys . defaultNonSearchable ] ; const searchableModelPropKeys = ctx . app . $model . requiredStringPropertyKeys ( model , excludedProps ) ; _ ( modelProperties ) . forEach ( ( val , index ) => { let viewProp = { key : val . key , label : ctx . app . $helpers . toTitleCase ( val . key ) } ; if ( ! sortKey && val . required && val . type === 'string' ) { sortKey = val . key ; viewProp . sort = 'ASC' ; } if ( searchableModelPropKeys . includes ( val . key ) ) viewProp . search = true ; view . properties . push ( viewProp ) ; } ) ; return view ; }
Given an applet object, compose and return a default applet view based on the model properties (as a fallback to the applet configuration).
Given an applet object compose and return a default applet view based on the model properties ( as a fallback to the applet configuration ) .
// Get some info needed below to build the array of properties