Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@skava/fixtures / src / TabbedFeaturedProductList.ts
Size: Mime:
/* eslint-disable max-lines */
/**
 * @todo fixture endpoint
 * @file use to setup some dummy data for widget testing
 * @todo need to this configure this more dynamically
 */
// import {
//   fixtureProductListData,
//   productListOne,
//   productListTwo,
//   productListThree,
// } from './server/endpoints/catalog/fixtures'

const productListOne = []
const productListTwo = []
const productListThree = []
const fixtureProductListData = {}

/**
 * @name TabSetup
 * tabs have a title, a data response from a url that contains the tab items
 * and a url that that the user to that category.  URL result injected here as
 * data
 */

const tab = (title, url, viewAll) => {
  return {
    title,
    url,
    viewAll,
  }
}

/**
 * @todo sirv cdn
 */
const tabMeta = {
  link: 'skava.com',
  type: 'productlist',
  image: '//d16rliti0tklvn.cloudfront.net/2495/1480411486472.1059639233.jpg',
  properties: {
    state: {
      sorting: [
        {
          options: [
            {
              label: 'NEW ARRIVALS',
              value: 'NEW ARRIVALS|desc',
            },
            {
              label: 'Price High - Low',
              value: 'Price|desc',
            },
            {
              label: 'Price Low - High',
              value: 'Price|asc',
            },
          ],
        },
      ],
      productcount: '17',
    },
  },
  facets: [
    {
      values: [
        {
          identifier: '0-50',
          navtype: 'identifier',
          name: '0-50',
          count: '5',
        },
        {
          identifier: '100-250',
          navtype: 'identifier',
          name: '100-250',
          count: '4',
        },
        {
          identifier: '250-500',
          navtype: 'identifier',
          name: '250-500',
          count: '4',
        },
        {
          identifier: '50-100',
          navtype: 'identifier',
          name: '50-100',
          count: '1',
        },
        {
          identifier: '500+%26+Above',
          navtype: 'identifier',
          name: '500 & Above',
          count: '3',
        },
      ],
      name: 'Price',
    },
  ],
}

const tabOne = {
  ...tabMeta,
  // products: productListOne,
  children: productListOne,
}
const tabTwo = {
  ...tabMeta,
  children: productListTwo,
}
const tabThree = {
  ...tabMeta,
  image:
    'http://d16rliti0tklvn.cloudfront.net/2495/1480411486472.1059639233.jpg',
  children: productListThree,
}
export default {
  tabs: [
    {
      meta: tab(
        "WHAT'S NEW",
        'http://demo2.skavaone.com/skavastream/core/v5/skavastore/productlist?url=1474521779826-8&campaignId=2495&offset=0&limit=6&sort=&selectedFacets=&timestamp=',
        'http://demo2.skavaone.com/skavastream/studio/reader/prod/skava_store/ska_category_list?navParam=1474521779826-8&categoryName=&sort=&filter=&locale=en_US'
      ),
      values: tabOne,
    },
    {
      meta: tab(
        'MOST POPULAR',
        'http://demo2.skavaone.com/skavastream/core/v5/skavastore/productlist?url=1474498086024-mbTPzWCxQu1&campaignId=2495&offset=0&limit=6&sort=&selectedFacets=&timestamp=',
        'http://demo2.skavaone.com/skavastream/studio/reader/prod/skava_store/ska_category_list?navParam=1474498086024-mbTPzWCxQu1&categoryName=&sort=&filter=&locale=en_US'
      ),
      values: tabTwo,
    },
    {
      meta: tab(
        'SALE',
        'http://demo2.skavaone.com/skavastream/core/v5/skavastore/productlist?url=1474498630605-y&campaignId=2495&offset=0&limit=6&sort=&selectedFacets=&timestamp=',
        'http://demo2.skavaone.com/skavastream/studio/reader/prod/skava_store/ska_category_list?navParam=1474498630605-y&categoryName=&sort=&filter=&locale=en_US'
      ),
      values: tabThree,
    },
  ],
}