makerspace-react-rails 0.4.3 → 0.4.4
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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a0ad7422a1dbfd6b6faab9e6975d3c49d9a4dabd18543311b7d3b5e22c82e91
|
4
|
+
data.tar.gz: 1ed061994d26fadda4d623263a49cb5c8478ecc17933e02c50c47ecce363863d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb38bcb277a104151ed3ea6fcb949a5eedc477783f5c435f30cb9a17718db19777f6d20157bbffb01c19fa3d70a2608b0f2e8ea6ae98e7886390d0a21676eed3
|
7
|
+
data.tar.gz: fa004c2dba1be981eb7995f36102ed7c6d1e9a311955f1712c7c5a8c3017497277c440de3cb41f5548b393e6638f825752ed676cd36863d73030213dffa4225d
|
@@ -176832,7 +176832,6 @@ var MemberDetail_1 = __webpack_require__(/*! ui/member/MemberDetail */ "./src/ui
|
|
176832
176832
|
var CheckoutPage_1 = __webpack_require__(/*! ui/checkout/CheckoutPage */ "./src/ui/checkout/CheckoutPage.tsx");
|
176833
176833
|
var BillingContainer_1 = __webpack_require__(/*! ui/billing/BillingContainer */ "./src/ui/billing/BillingContainer.tsx");
|
176834
176834
|
var Settings_1 = __webpack_require__(/*! ui/member/Settings */ "./src/ui/member/Settings.tsx");
|
176835
|
-
var BillingContextContainer_1 = __webpack_require__(/*! ui/billing/BillingContextContainer */ "./src/ui/billing/BillingContextContainer.tsx");
|
176836
176835
|
var Receipt_1 = __webpack_require__(/*! ui/checkout/Receipt */ "./src/ui/checkout/Receipt.tsx");
|
176837
176836
|
var SendRegistrationComponent_1 = __webpack_require__(/*! ui/auth/SendRegistrationComponent */ "./src/ui/auth/SendRegistrationComponent.tsx");
|
176838
176837
|
var SignDocuments_1 = __webpack_require__(/*! ui/documents/SignDocuments */ "./src/ui/documents/SignDocuments.tsx");
|
@@ -176840,20 +176839,19 @@ var PrivateRouting = function (_a) {
|
|
176840
176839
|
var currentUserId = _a.currentUserId, permissions = _a.permissions, isAdmin = _a.isAdmin;
|
176841
176840
|
var billingEnabled = permissions[constants_1.Whitelists.billing] || false;
|
176842
176841
|
var earnedMembershipEnabled = isAdmin && permissions[constants_1.Whitelists.earnedMembership];
|
176843
|
-
return (React.createElement(
|
176844
|
-
React.createElement(react_router_dom_1.
|
176845
|
-
|
176846
|
-
|
176847
|
-
|
176848
|
-
|
176849
|
-
|
176850
|
-
|
176851
|
-
|
176852
|
-
|
176853
|
-
|
176854
|
-
|
176855
|
-
|
176856
|
-
React.createElement(react_router_dom_1.Route, { component: NotFound_1.default }))));
|
176842
|
+
return (React.createElement(react_router_dom_1.Switch, null,
|
176843
|
+
React.createElement(react_router_dom_1.Route, { exact: true, path: constants_1.Routing.Members, component: MembersList_1.default }),
|
176844
|
+
React.createElement(react_router_dom_1.Route, { exact: true, path: constants_1.Routing.Documents, component: SignDocuments_1.default }),
|
176845
|
+
React.createElement(react_router_dom_1.Route, { exact: true, path: constants_1.Routing.Settings, component: Settings_1.default }),
|
176846
|
+
React.createElement(react_router_dom_1.Route, { exact: true, path: constants_1.Routing.Profile + "/" + constants_1.Routing.PathPlaceholder.Resource + constants_1.Routing.PathPlaceholder.Optional, component: MemberDetail_1.default }),
|
176847
|
+
React.createElement(react_router_dom_1.Route, { exact: true, path: constants_1.Routing.Rentals, component: RentalsList_1.default }),
|
176848
|
+
billingEnabled && React.createElement(react_router_dom_1.Route, { exact: true, path: constants_1.Routing.Billing + "/" + constants_1.Routing.PathPlaceholder.Resource + constants_1.Routing.PathPlaceholder.Optional, component: BillingContainer_1.default }),
|
176849
|
+
billingEnabled && React.createElement(react_router_dom_1.Route, { exact: true, path: constants_1.Routing.Receipt, component: Receipt_1.default }),
|
176850
|
+
billingEnabled && React.createElement(react_router_dom_1.Route, { path: constants_1.Routing.Checkout, component: CheckoutPage_1.default }),
|
176851
|
+
React.createElement(react_router_dom_1.Route, { exact: true, path: constants_1.Routing.SendRegistration, component: SendRegistrationComponent_1.default }),
|
176852
|
+
earnedMembershipEnabled && React.createElement(react_router_dom_1.Route, { exact: true, path: constants_1.Routing.EarnedMemberships, component: EarnedMembershipsList_1.default }),
|
176853
|
+
React.createElement(react_router_dom_1.Redirect, { to: constants_1.Routing.Members + "/" + currentUserId }),
|
176854
|
+
React.createElement(react_router_dom_1.Route, { component: NotFound_1.default })));
|
176857
176855
|
};
|
176858
176856
|
exports.default = PrivateRouting;
|
176859
176857
|
|
@@ -178324,6 +178322,7 @@ var DetailView_1 = __webpack_require__(/*! ui/common/DetailView */ "./src/ui/com
|
|
178324
178322
|
var SubscriptionsList_1 = __webpack_require__(/*! ui/subscriptions/SubscriptionsList */ "./src/ui/subscriptions/SubscriptionsList.tsx");
|
178325
178323
|
var TransactionsList_1 = __webpack_require__(/*! ui/transactions/TransactionsList */ "./src/ui/transactions/TransactionsList.tsx");
|
178326
178324
|
var OptionsList_1 = __webpack_require__(/*! ui/billing/OptionsList */ "./src/ui/billing/OptionsList.tsx");
|
178325
|
+
var BillingContextContainer_1 = __webpack_require__(/*! ./BillingContextContainer */ "./src/ui/billing/BillingContextContainer.tsx");
|
178327
178326
|
var BillingContainer = /** @class */ (function (_super) {
|
178328
178327
|
__extends(BillingContainer, _super);
|
178329
178328
|
function BillingContainer() {
|
@@ -178337,19 +178336,20 @@ var BillingContainer = /** @class */ (function (_super) {
|
|
178337
178336
|
// Fetch member stats
|
178338
178337
|
};
|
178339
178338
|
BillingContainer.prototype.render = function () {
|
178340
|
-
return (React.createElement(
|
178341
|
-
|
178342
|
-
|
178343
|
-
|
178344
|
-
|
178345
|
-
|
178346
|
-
|
178347
|
-
|
178348
|
-
|
178349
|
-
|
178350
|
-
|
178351
|
-
|
178352
|
-
|
178339
|
+
return (React.createElement(BillingContextContainer_1.default, null,
|
178340
|
+
React.createElement(DetailView_1.default, { title: "Billing Central", basePath: constants_1.Routing.Billing, information: this.renderBillingInfo(), actionButtons: [], resources: [
|
178341
|
+
{
|
178342
|
+
name: "subscriptions",
|
178343
|
+
content: (React.createElement(SubscriptionsList_1.default, null))
|
178344
|
+
}, {
|
178345
|
+
name: "transactions",
|
178346
|
+
content: (React.createElement(TransactionsList_1.default, null))
|
178347
|
+
}, {
|
178348
|
+
name: "options",
|
178349
|
+
displayName: "Billing Options",
|
178350
|
+
content: (React.createElement(OptionsList_1.default, null))
|
178351
|
+
}
|
178352
|
+
] })));
|
178353
178353
|
};
|
178354
178354
|
return BillingContainer;
|
178355
178355
|
}(React.Component));
|
@@ -179623,7 +179623,6 @@ var Table_1 = __webpack_require__(/*! ui/common/table/Table */ "./src/ui/common/
|
|
179623
179623
|
var numberAsCurrency_1 = __webpack_require__(/*! ui/utils/numberAsCurrency */ "./src/ui/utils/numberAsCurrency.ts");
|
179624
179624
|
var ErrorMessage_1 = __webpack_require__(/*! ui/common/ErrorMessage */ "./src/ui/common/ErrorMessage.tsx");
|
179625
179625
|
var LoadingOverlay_1 = __webpack_require__(/*! ui/common/LoadingOverlay */ "./src/ui/common/LoadingOverlay.tsx");
|
179626
|
-
var BillingContextContainer_1 = __webpack_require__(/*! ui/billing/BillingContextContainer */ "./src/ui/billing/BillingContextContainer.tsx");
|
179627
179626
|
var FormModal_1 = __webpack_require__(/*! ui/common/FormModal */ "./src/ui/common/FormModal.tsx");
|
179628
179627
|
var cart_1 = __webpack_require__(/*! ./cart */ "./src/ui/checkout/cart.ts");
|
179629
179628
|
var useModal_1 = __webpack_require__(/*! ../hooks/useModal */ "./src/ui/hooks/useModal.ts");
|
@@ -179644,10 +179643,13 @@ var CartList = function (_a) {
|
|
179644
179643
|
!item && history.push(utils_1.buildProfileRouting(currentUserId));
|
179645
179644
|
return emptyCart;
|
179646
179645
|
}, []);
|
179647
|
-
|
179646
|
+
// TODO: Update this when you update writeTransaction
|
179648
179647
|
var onSuccess = React.useCallback(function (_a) {
|
179649
|
-
var
|
179650
|
-
|
179648
|
+
var transaction = _a.response.data;
|
179649
|
+
var invoiceId = transaction && transaction.invoice.id;
|
179650
|
+
if (invoiceId) {
|
179651
|
+
history.push("" + constants_1.Routing.Receipt.replace(constants_1.Routing.PathPlaceholder.InvoiceId, invoiceId));
|
179652
|
+
}
|
179651
179653
|
}, [history]);
|
179652
179654
|
var _b = useWriteTransaction_1.default(makerspace_ts_api_client_1.createTransaction, onSuccess), call = _b.call, isRequesting = _b.isRequesting, error = _b.error, reset = _b.reset;
|
179653
179655
|
var _c = useModal_1.default(), errorIsOpen = _c.isOpen, openModal = _c.openModal, closeModal = _c.closeModal;
|
@@ -179669,18 +179671,21 @@ var CartList = function (_a) {
|
|
179669
179671
|
id: "description",
|
179670
179672
|
label: "Description",
|
179671
179673
|
cell: function (row) {
|
179672
|
-
var discount = discounts && (discounts.data || []).find(function (discount) { return discount.id === row.discountId; });
|
179673
179674
|
return (React.createElement(React.Fragment, null,
|
179674
|
-
React.createElement("div", null, row.description)
|
179675
|
-
discount && (React.createElement(React.Fragment, null,
|
179676
|
-
React.createElement("hr", null),
|
179677
|
-
React.createElement("div", { id: "discount" }, discount.description)))));
|
179675
|
+
React.createElement("div", null, row.description)));
|
179678
179676
|
},
|
179679
179677
|
}], [
|
179680
179678
|
{
|
179681
179679
|
id: "amount",
|
179682
179680
|
label: "Amount",
|
179683
|
-
cell: function (row) {
|
179681
|
+
cell: function (row) {
|
179682
|
+
var amount = Number(row.amount);
|
179683
|
+
// TODO: this should use discount
|
179684
|
+
if (row.discountId) {
|
179685
|
+
amount = amount * .90;
|
179686
|
+
}
|
179687
|
+
return numberAsCurrency_1.numberAsCurrency(amount);
|
179688
|
+
},
|
179684
179689
|
}
|
179685
179690
|
], withError ? [{
|
179686
179691
|
id: "error",
|
@@ -179700,6 +179705,8 @@ var CartList = function (_a) {
|
|
179700
179705
|
if (!item) {
|
179701
179706
|
return null;
|
179702
179707
|
}
|
179708
|
+
// TODO: this should use discount
|
179709
|
+
var totalAmount = item.discountId ? (Number(item.amount) * .90) : (item.amount);
|
179703
179710
|
return (React.createElement(React.Fragment, null,
|
179704
179711
|
React.createElement(Card_1.default, { style: { height: "100%" } },
|
179705
179712
|
React.createElement(CardContent_1.default, null,
|
@@ -179709,7 +179716,7 @@ var CartList = function (_a) {
|
|
179709
179716
|
React.createElement(Grid_1.default, { item: true, xs: 12, style: { textAlign: "right" } },
|
179710
179717
|
React.createElement(Typography_1.default, { id: "total", variant: "h6", color: "inherit" },
|
179711
179718
|
"Total ",
|
179712
|
-
numberAsCurrency_1.numberAsCurrency(
|
179719
|
+
numberAsCurrency_1.numberAsCurrency(totalAmount))),
|
179713
179720
|
React.createElement(Grid_1.default, { item: true, xs: 12, style: { textAlign: "left" } },
|
179714
179721
|
React.createElement(Button_1.default, { id: "submit-payment-button", variant: "contained", disabled: !paymentMethodId, onClick: submitPayment }, "Submit Payment"))),
|
179715
179722
|
isRequesting && React.createElement(LoadingOverlay_1.default, { id: "checkout-submitting-overlay" }))),
|
@@ -186542,7 +186549,7 @@ var NoSubscriptionDetails = function (_a) {
|
|
186542
186549
|
var resetCart = cart_1.useEmptyCart();
|
186543
186550
|
var addToCart = cart_1.useAddToCart();
|
186544
186551
|
var onSelect = React.useCallback(function (option, discountId) {
|
186545
|
-
setOption(__assign(__assign({}, option),
|
186552
|
+
setOption(__assign(__assign({}, option), { discountId: discountId }));
|
186546
186553
|
setError("");
|
186547
186554
|
}, [setOption]);
|
186548
186555
|
var onSubmit = React.useCallback(function () { return __awaiter(void 0, void 0, void 0, function () {
|