import defaultConfig, { seedViewConfig } from 'config/seedGeneral';

export const adminViewConfig = {
  ...seedViewConfig,
  headerColor: '',
  // Input props
  inputProps: {
    withValueBorder: true,
    small: true,
  },
  // button colors
  colorSubmit: 'green',
  colorBack: 'grey',
  // Switch shadow
  shadowSwitch: '0 3px 8px 0 rgba(0,0,48,.18)',
};

export const adminConfig = {
  ...defaultConfig,
  cmsBaseName: '__PAGE__',
  staging: __STAGING__ || __DEV__,
  // sizing
  widthIndex: 40,
  widthDetailColumn: 400,
  widthEditColumn: 500,
  // Camelize keys in the content or not
  camelizeContentKeys: false,
  noLogin: false,
  syncContent: false,
  // Upload Image CMS
  cmsUploadURL: null,
  cmsUploadS3: true,
  cmsUploadDisplayValue: null,
  // override seed config
  whitelistedContentKeys: [],

  // Max limit of filter form
  maxLimit: 5000,
  // PUT update or PATCH update
  putUpdate: false,
  // number of languages displayed
  maxNumLanguagesDisplayed: 3,
  reservedKeysCMS: ['label', 'position', 'content', '__PAGE__', '__TARGET__'],
  contentPath: 'content',
  resourcePath: 'resource',
  serverStorage: false,
  cookieStorage: false,
  // Key used to display img url in cms part
  cmsUploadImageKey: 'large',
  // Order by cms
  orderByCMS: 'position',
  orderByDirectionCMS: 'asc',
  // disable or not the fast data update from table cell
  noCellUpdate: false,
  // disable or not the fast data update on display view
  noFieldUpdate: false,
  // Reload time of the content to limit sync problems
  reloadContentTime: 10,
  accountOptions: {
    apollo: true,
    typeField: 'types',
    resource: 'me',
    allowedTypes: ['admin'],
    changePassword: {
      currentPassword: 'currentPassword',
      password: 'password',
      confirmPassword: 'confirmPassword',
    },
    nav: [
      {
        icon: 'user',
        link: '/account/profile',
        title: 'Profile',
      },

      {
        icon: 'key',
        link: '/account/change-password',
        title: 'Password',
      },
      // {
      //   title: 'Management',
      // },
      // {
      //   link: '/account/test',
      //   title: 'Permissions',
      // },
    ],
    profileFields: [
      {
        type: 'section',
        fields: {
          _id: {
            type: 'text',
            label: 'id',
          },
          firstName: { type: 'string', label: 'First name' },
          lastName: { type: 'string', label: 'Last name' },
          email: { type: 'string', label: 'Email' },
          phoneNumber: { type: 'string', label: 'Phone' },
        },
      },
      {
        type: 'section',
        title: 'Settings',
        fields: {
          types: {
            type: 'text',
            label: 'User type',
          },
        },
      },
    ],
  },
};

export const adminConstants = {
  promoType: [
    { value: 'fixed', label: 'Fixed' },
    { value: 'percentage', label: 'Percentage' },
  ],
};

export default adminConfig;
