@itilite/iui-user-management 1.5.0-beta-4 → 1.5.0-beta-5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +16 -0
- package/dist/index.js +21 -7
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +24 -10
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -2,7 +2,7 @@ import { IUIAsyncSelect, IUIBox, IUILabel, IUIFileUpload, IUICheckboxButton, IUI
|
|
|
2
2
|
import React, { useState, useEffect, Fragment as Fragment$1, memo, useRef } from 'react';
|
|
3
3
|
import { configs, services, utilUrls } from '@itilite/utils';
|
|
4
4
|
import axios from 'axios';
|
|
5
|
-
import { IconButton, Menu, MenuItem, Popper, Grow, Paper, ClickAwayListener, MenuList, Typography, Box } from '@material-ui/core';
|
|
5
|
+
import { Tooltip, IconButton, Menu, MenuItem, Popper, Grow, Paper, ClickAwayListener, MenuList, Typography, Box } from '@material-ui/core';
|
|
6
6
|
import { useDispatch, useSelector, Provider } from 'react-redux';
|
|
7
7
|
import { combineReducers, createStore, applyMiddleware } from 'redux';
|
|
8
8
|
import thunk from 'redux-thunk';
|
|
@@ -10,7 +10,7 @@ import moment from 'moment';
|
|
|
10
10
|
import { composeWithDevTools } from 'redux-devtools-extension';
|
|
11
11
|
import { useParams, useHistory, useLocation } from 'react-router-dom';
|
|
12
12
|
import { withStyles, makeStyles } from '@material-ui/core/styles';
|
|
13
|
-
import Tooltip from '@material-ui/core/Tooltip';
|
|
13
|
+
import Tooltip$1 from '@material-ui/core/Tooltip';
|
|
14
14
|
import Switch from '@material-ui/core/Switch';
|
|
15
15
|
import MoreHorizIcon from '@material-ui/icons/MoreHoriz';
|
|
16
16
|
import Button from '@material-ui/core/Button';
|
|
@@ -842,7 +842,7 @@ var UserRole = function UserRole(_ref) {
|
|
|
842
842
|
|
|
843
843
|
var styles$1 = {"defaultLabel":"_smjc4","card":"_3_S9J","cardNumber":"_36E9M","cardDigit":"_2pm-T","expiryDate":"_2tBnF","cardImage":"_3QvZh","visa":"_1IpBm","mastercard":"_2x6IX","amex":"_2a38S","discover":"_2vksl","diners":"_2kQRs","jcb":"_2bO1f","unionpay":"_2_jfu","is_nothing":"_1Lrzs","addCard":"_3711U","cardDeleteBtn":"_7Da2t","cardLabel":"_PQTex","defaultBtn":"_1_ArA","cursonPointer":"_1L115","sectionWrapper":"_VpUCK","margin":"_1Fs_D","minGridWidth":"_1hl-Z","firstRowMargin":"_1WZZj","firstChildMargin":"_IT_O_","paddingTop":"_Mhnl7","dividerColor":"_3ltFd"};
|
|
844
844
|
|
|
845
|
-
var classes = {"disabledCard":"_3MVKj","expiredLabel":"_2_sgJ","expiresoonLabel":"_3G7La","sectionHeader":"_2d_OH","myCardsSection":"_3MNHj","companyCardsSection":"_34lN6","disabledNotice":"_1yV0j","cardsGrid":"_1oHGu","card":"_3ZTQc","moreIcon":"_3utA0","personal":"_duePd","corporate":"_3O33a","company":"_180_L","cardHeader":"_1eF61","cardTitleSection":"_2c40W","cardMaskedNumber":"_2Vlhq","cardName":"_bp-Mt","cardAlias":"_19m4v","cardType":"_3l4HZ","menuButton":"_3TTEn","lockIcon":"_1S27X","cardDetails":"_IP2rg","cardNumber":"_7FOPe","cardExpiry":"_CI_p2","cardCvv":"_3Gzqu","cardUnhide":"_ivgBf","cardFooter":"_1WgPL","brandLogo":"_EV0l8","addCardButton":"_1oaCc","plusIcon":"_w9L5L"};
|
|
845
|
+
var classes = {"disabledCard":"_3MVKj","expiredLabel":"_2_sgJ","invalidLabel":"_1Oqzs","expiresoonLabel":"_3G7La","sectionHeader":"_2d_OH","myCardsSection":"_3MNHj","companyCardsSection":"_34lN6","disabledNotice":"_1yV0j","cardsGrid":"_1oHGu","card":"_3ZTQc","moreIcon":"_3utA0","personal":"_duePd","corporate":"_3O33a","company":"_180_L","cardHeader":"_1eF61","cardTitleSection":"_2c40W","cardMaskedNumber":"_2Vlhq","cardName":"_bp-Mt","cardAlias":"_19m4v","cardType":"_3l4HZ","menuButton":"_3TTEn","lockIcon":"_1S27X","cardDetails":"_IP2rg","cardNumber":"_7FOPe","cardExpiry":"_CI_p2","cardCvv":"_3Gzqu","cardUnhide":"_ivgBf","cardFooter":"_1WgPL","brandLogo":"_EV0l8","addCardButton":"_1oaCc","plusIcon":"_w9L5L"};
|
|
846
846
|
|
|
847
847
|
var SHOW_LOADER = 'SHOW_LOADER';
|
|
848
848
|
var STOP_LOADER = 'STOP_LOADER';
|
|
@@ -2663,6 +2663,12 @@ var Visa = function Visa(props) {
|
|
|
2663
2663
|
}))));
|
|
2664
2664
|
};
|
|
2665
2665
|
|
|
2666
|
+
var CARDS_DISABLED = {
|
|
2667
|
+
DISABLED: '0',
|
|
2668
|
+
EXPIRED: '2',
|
|
2669
|
+
INVALID: '3'
|
|
2670
|
+
};
|
|
2671
|
+
|
|
2666
2672
|
var IUILocalStorageService$3 = services.IUILocalStorageService;
|
|
2667
2673
|
var env$3 = configs.env,
|
|
2668
2674
|
paymentApi$1 = configs.paymentApi;
|
|
@@ -2837,14 +2843,20 @@ var CardsManagement = function CardsManagement(_ref) {
|
|
|
2837
2843
|
var isCompanyCard = (card === null || card === void 0 ? void 0 : card.category) === 'Company';
|
|
2838
2844
|
var cardClass = getCardTypeClass(card === null || card === void 0 ? void 0 : card.category);
|
|
2839
2845
|
var isDefaultCard = !!+(card === null || card === void 0 ? void 0 : (_card$metadata = card.metadata) === null || _card$metadata === void 0 ? void 0 : _card$metadata.default_card);
|
|
2840
|
-
var isExpired = card.metadata.is_enabled ===
|
|
2841
|
-
var
|
|
2846
|
+
var isExpired = card.metadata.is_enabled === CARDS_DISABLED.EXPIRED;
|
|
2847
|
+
var isInvalid = card.metadata.is_enabled === CARDS_DISABLED.INVALID;
|
|
2848
|
+
var isDisabled = card.metadata.is_enabled === CARDS_DISABLED.DISABLED || isExpired || isInvalid;
|
|
2842
2849
|
var currentDate = new Date();
|
|
2843
2850
|
var cardExpDate = new Date(parseInt(card.card.exp_year, 10), parseInt(card.card.exp_month, 10) - 1);
|
|
2844
2851
|
var timeDiff = cardExpDate.getTime() - currentDate.getTime();
|
|
2845
2852
|
var daysToExpire = Math.ceil(timeDiff / (1000 * 3600 * 24));
|
|
2846
2853
|
var expiresSoon = daysToExpire <= 30 && !isExpired;
|
|
2847
|
-
return /*#__PURE__*/React.createElement(
|
|
2854
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
2855
|
+
title: isInvalid ? 'This card is invalid, because you have been issued a new card.' : null,
|
|
2856
|
+
disableHoverListener: !isInvalid,
|
|
2857
|
+
placement: "top",
|
|
2858
|
+
arrow: true
|
|
2859
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
2848
2860
|
key: card.id,
|
|
2849
2861
|
className: clsx(classes.card, classes[cardClass], (_clsx = {}, _clsx[classes.disabledCard] = isDisabled, _clsx))
|
|
2850
2862
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -2857,7 +2869,9 @@ var CardsManagement = function CardsManagement(_ref) {
|
|
|
2857
2869
|
className: classes.cardAlias
|
|
2858
2870
|
}, card === null || card === void 0 ? void 0 : card.alias), isExpired && /*#__PURE__*/React.createElement("span", {
|
|
2859
2871
|
className: classes.expiredLabel
|
|
2860
|
-
}, "Expired"),
|
|
2872
|
+
}, "Expired"), isInvalid && /*#__PURE__*/React.createElement("span", {
|
|
2873
|
+
className: classes.invalidLabel
|
|
2874
|
+
}, "Invalid"), expiresSoon && !isInvalid && /*#__PURE__*/React.createElement("span", {
|
|
2861
2875
|
className: clsx(classes.expiresoonLabel, classes.expiredLabel)
|
|
2862
2876
|
}, "Expires Soon")), /*#__PURE__*/React.createElement("span", {
|
|
2863
2877
|
className: classes.cardType
|
|
@@ -2884,7 +2898,7 @@ var CardsManagement = function CardsManagement(_ref) {
|
|
|
2884
2898
|
className: classes.cardCvv
|
|
2885
2899
|
}, "CVV \u2022\u2022\u2022")), /*#__PURE__*/React.createElement("div", {
|
|
2886
2900
|
className: classes.cardFooter
|
|
2887
|
-
}, /*#__PURE__*/React.createElement("div", null), getBrandLogo(card === null || card === void 0 ? void 0 : (_card$card4 = card.card) === null || _card$card4 === void 0 ? void 0 : _card$card4.brand)));
|
|
2901
|
+
}, /*#__PURE__*/React.createElement("div", null), getBrandLogo(card === null || card === void 0 ? void 0 : (_card$card4 = card.card) === null || _card$card4 === void 0 ? void 0 : _card$card4.brand))));
|
|
2888
2902
|
};
|
|
2889
2903
|
var _url = env$3.getPaymentUrl() + ("/api/v1/auth/" + IUILocalStorageService$3.getAccessToken() + "/1/" + pg.entity_id + "/0/" + pg.vendor_id + "/1");
|
|
2890
2904
|
var showMenuButton = cardsCount === 1 || cardsCount > 1 && !+(selectedCard === null || selectedCard === void 0 ? void 0 : (_selectedCard$metadat = selectedCard.metadata) === null || _selectedCard$metadat === void 0 ? void 0 : _selectedCard$metadat.default_card);
|
|
@@ -2969,7 +2983,7 @@ var CardsManagement = function CardsManagement(_ref) {
|
|
|
2969
2983
|
vertical: 'top',
|
|
2970
2984
|
horizontal: 'right'
|
|
2971
2985
|
}
|
|
2972
|
-
}, selectedCard && selectedCard.metadata.is_enabled !==
|
|
2986
|
+
}, selectedCard && selectedCard.metadata.is_enabled !== CARDS_DISABLED.DISABLED && selectedCard.metadata.is_enabled !== CARDS_DISABLED.EXPIRED && selectedCard.metadata.is_enabled !== CARDS_DISABLED.INVALID && !+selectedCard.metadata.default_card && /*#__PURE__*/React.createElement(MenuItem, {
|
|
2973
2987
|
onClick: handleMarkAsDefault
|
|
2974
2988
|
}, "Mark as default"), showMenuButton && /*#__PURE__*/React.createElement(MenuItem, {
|
|
2975
2989
|
onClick: handleDeleteCard,
|
|
@@ -10340,7 +10354,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
10340
10354
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
10341
10355
|
component: "div",
|
|
10342
10356
|
width: 80
|
|
10343
|
-
}, row && row.has_visited === 0 ? /*#__PURE__*/React.createElement(Tooltip, {
|
|
10357
|
+
}, row && row.has_visited === 0 ? /*#__PURE__*/React.createElement(Tooltip$1, {
|
|
10344
10358
|
title: "This user hasn't logged in to the platform yet",
|
|
10345
10359
|
arrow: true,
|
|
10346
10360
|
classes: {
|