phoenix-common-web
v0.0.12
Published
Utility for phoenix project in Bizzy Indonesia
Downloads
4
Readme
phoenix-common-web
Utility for phoenix project in Bizzy Indonesia
How to install
$ yarn add phoenix-common-web
# or
$ npm i phoenix-common-web
Sample Usage
import { __apiGet } from 'phoenix-common-web/utils/api-util'
Or used transpiled version:
import { __apiGet } from 'phoenix-common-web/dist/api-util'
For Test
We deliver untranspiled code, so you need to add ignore pattern like this:
transformIgnorePatterns: ['node_modules/(?!(phoenix-common-web)/)'],
Available Utils/Helpers
utils/api-util.js
| Method | Param |
|--------------------------|-------------------------------------|
| __apiGet
| $store
, URL
, params
|
| __apiGetNonAuth
| URL
, params
|
| __apiPost
| $store
, URL
, data
, onUploadProgress
|
| __apiPostNonAuth
| URL
, data
, onUploadProgress
|
| __apiPut
| $store
, URL
, data
|
| __apiPutNonAuth
| URL
, data
|
| __apiDelete
| $store
, URL
, data
|
| __apiDeleteNonAuth
| URL
, data
|
utils/auth-util.js
| Method | Param |
|---------------------------------|--------------------------------------|
| getToken
| $store
|
| getTokenDirectFromStore
| $store
|
| getAddons
| $store
|
| getUsername
| $store
|
| getUserFirstName
| $store
|
| getUserLastName
| $store
|
| getUserFullName
| $store
|
| getUserDefaultGroupId
| user
|
| getCustomerRoles
| $store
|
| getCustomerChannelType
| $store
|
| getCustomerTopDays
| $store
|
| getCustomerOrganizationID
| $store
|
| getCustomerPersonID
| $store
|
| getCustomerName
| $store
|
| getCustomerOrganizationName
| $store
|
| isCustomerSuperAdmin
| $store
|
| isPunchOutUser
| $store
|
| isPunchOut
| $store
|
| isContract
| $store
|
| getActiveGroupId
| $store
|
| getGroups
| $store
|
| getSelectedGroup
| $store
|
| isSalesAdmin
| $store
|
| getCustomerInformation
| $store
|
| getCustomerVendorInformation
| $store
|
| isVendor
| $store
|
| isLoggedIn
| $store
|
| loggedAsSellerOnly
| $store
|
| isCustomerHaveRole
| $store
|
utils/common-util.js
| Method | Notes |
|--------------------------|-------------------------------------|
| __isNotNull
| - |
| __isNotEmptyString
| - |
| __isNotEmptyArray
| - |
| __isFunction
| - |
| __slugify
| - |
utils/date-util.js
| Method | Notes |
|------------------------------|-------------------------------------|
| __isValidDate
| - |
| __toDatetime
| format: DD-MMM-YYYY, HH:mm:ss
|
| __toDatetimeToMinutes
| format: DD MMM YYYY, HH:mm
|
| __toDatetimeWithSeparator
| format: DD MMMM YYYY | HH:mm:ss
|
| __toDateEn
| format: YYYY-MM-DD
|
| __toCompleteDateFormat
| format: DD MMMM YYYY
|
| __checkDiff
| - |
utils/notification-util.js
| Method | Notes |
|--------------------------|-------------------------------------|
| __showNotification
| - |
| __showErrorNotif
| - |
| __showSuccessNotif
| - |
| __type
| - |
utils/price-util.js
| Method | Notes |
|--------------------------|-------------------------------------|
| __formatPrice
| - |
utils/product-util.js
| Method | Notes |
|--------------------------|-------------------------------------|
| __getProductUrl
| - |
utils/storage-util.js
| Method | Notes |
|--------------------------|-------------------------------------|
| __getData
| - |
| __setData
| - |
utils/window-util.js
| Method | Notes |
|--------------------------|-------------------------------------|
| __goToPage
| - |
| __hideModal
| - |
| __showModal
| - |
Configs
constants
|- COOKIES_KEY
|- METHOD
|- DATE_FORMAT
|- EVENT_CATEGORY
|- VALIDATION
Components
| Component | Path Access for import module | CSS Path |
|--------------------------|-----------------------------------------------| -------------------------------------------------------- |
| Pagination
| phoenix-common-web/dist/pagination
| phoenix-common-web/dist/pagination.css
|
Script for Development
# run eslint
$ yarn run lint
# run test
$ yarn run test
Copyright © 2018 by Bizzy Engineering Team