@gnar-engine/cli 1.0.0 → 1.0.1
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/assets/gnar-engine-logo-white.svg +9 -0
- package/bootstrap/deploy.localdev.yml +51 -0
- package/bootstrap/secrets.localdev.yml +27 -0
- package/bootstrap/services/agent/Dockerfile +23 -0
- package/bootstrap/services/agent/notes.md +28 -0
- package/bootstrap/services/agent/package.json +16 -0
- package/bootstrap/services/agent/src/app.js +52 -0
- package/bootstrap/services/agent/src/commands/agent.handler.js +104 -0
- package/bootstrap/services/agent/src/config.js +52 -0
- package/bootstrap/services/agent/src/controllers/http.controller.js +44 -0
- package/bootstrap/services/agent/src/controllers/message.controller.js +51 -0
- package/bootstrap/services/agent/src/db/migrations/01-init.js +50 -0
- package/bootstrap/services/agent/src/db/migrations/02-agent-service-init.js +36 -0
- package/bootstrap/services/agent/src/policies/agent.policy.js +13 -0
- package/bootstrap/services/agent/src/schema/Agent.schema.js +17 -0
- package/bootstrap/services/agent/src/services/agent.service.js +259 -0
- package/bootstrap/services/agent/src/services/chatgpt.service.js +46 -0
- package/bootstrap/services/agent/src/services/manifest.service.js +21 -0
- package/bootstrap/services/control/Dockerfile +23 -0
- package/bootstrap/services/control/Dockerfile.prod +37 -0
- package/bootstrap/services/control/README.md +25 -0
- package/bootstrap/services/control/package.json +16 -0
- package/bootstrap/services/control/src/app.js +45 -0
- package/bootstrap/services/control/src/commands/control.handler.js +231 -0
- package/bootstrap/services/control/src/commands/service.handler.js +81 -0
- package/bootstrap/services/control/src/commands/task.handler.js +247 -0
- package/bootstrap/services/control/src/config.js +55 -0
- package/bootstrap/services/control/src/controllers/http.controller.js +228 -0
- package/bootstrap/services/control/src/controllers/message.controller.js +40 -0
- package/bootstrap/services/control/src/db/migrations/01-init.js +50 -0
- package/bootstrap/services/control/src/db/migrations/02-control-service-init.js +60 -0
- package/bootstrap/services/control/src/db/migrations/03-alter-tasks.js +29 -0
- package/bootstrap/services/control/src/policies/task.policy.js +53 -0
- package/bootstrap/services/control/src/schema/control.schema.js +42 -0
- package/bootstrap/services/control/src/services/registry.service.js +83 -0
- package/bootstrap/services/control/src/services/reset.service.js +28 -0
- package/bootstrap/services/control/src/services/task.service.js +153 -0
- package/bootstrap/services/control/src/tests/control.test.js +50 -0
- package/bootstrap/services/notification/Dockerfile +23 -0
- package/bootstrap/services/notification/Dockerfile.prod +37 -0
- package/bootstrap/services/notification/README.md +3 -0
- package/bootstrap/services/notification/package.json +34 -0
- package/bootstrap/services/notification/src/app.js +51 -0
- package/bootstrap/services/notification/src/commands/command-bus.js +20 -0
- package/bootstrap/services/notification/src/commands/handlers/control.handler.js +18 -0
- package/bootstrap/services/notification/src/commands/handlers/notification.handler.js +157 -0
- package/bootstrap/services/notification/src/config.js +15 -0
- package/bootstrap/services/notification/src/controllers/message.controller.js +82 -0
- package/bootstrap/services/notification/src/services/logger.service.js +16 -0
- package/bootstrap/services/notification/src/services/ses.service.js +23 -0
- package/bootstrap/services/notification/src/templates/admin-order-recieved.hbs +136 -0
- package/bootstrap/services/notification/src/templates/admin-subscription-failed.hbs +87 -0
- package/bootstrap/services/notification/src/templates/customer-order-recieved.hbs +132 -0
- package/bootstrap/services/notification/src/templates/customer-subscription-failed.hbs +77 -0
- package/bootstrap/services/notification/src/tests/notification.test.js +0 -0
- package/bootstrap/services/portal/Dockerfile +23 -0
- package/bootstrap/services/portal/Dockerfile.remote +40 -0
- package/bootstrap/services/portal/README.md +22 -0
- package/bootstrap/services/portal/nginx.conf +12 -0
- package/bootstrap/services/portal/package.json +59 -0
- package/bootstrap/services/portal/public/favicon.ico +0 -0
- package/bootstrap/services/portal/public/gnar-white.png +0 -0
- package/bootstrap/services/portal/public/gnarengine-logo-black.png +0 -0
- package/bootstrap/services/portal/public/index.html +43 -0
- package/bootstrap/services/portal/public/logo192.png +0 -0
- package/bootstrap/services/portal/public/logo512.png +0 -0
- package/bootstrap/services/portal/public/manifest.json +25 -0
- package/bootstrap/services/portal/public/robots.txt +3 -0
- package/bootstrap/services/portal/src/App.js +56 -0
- package/bootstrap/services/portal/src/assets/Logo_Anchord_Black.svg +1 -0
- package/bootstrap/services/portal/src/assets/Logo_Anchord_Black_Green.svg +1 -0
- package/bootstrap/services/portal/src/assets/Logo_Anchord_White_Green.svg +1 -0
- package/bootstrap/services/portal/src/assets/activity.svg +3 -0
- package/bootstrap/services/portal/src/assets/arrow.svg +3 -0
- package/bootstrap/services/portal/src/assets/bin-white.svg +3 -0
- package/bootstrap/services/portal/src/assets/bin.svg +3 -0
- package/bootstrap/services/portal/src/assets/check.svg +3 -0
- package/bootstrap/services/portal/src/assets/chevron.svg +3 -0
- package/bootstrap/services/portal/src/assets/contact.svg +3 -0
- package/bootstrap/services/portal/src/assets/dots-vertical.svg +5 -0
- package/bootstrap/services/portal/src/assets/eye-off.svg +3 -0
- package/bootstrap/services/portal/src/assets/eye.svg +4 -0
- package/bootstrap/services/portal/src/assets/gnar-engine-black.svg +47 -0
- package/bootstrap/services/portal/src/assets/gnar-engine-white.svg +47 -0
- package/bootstrap/services/portal/src/assets/gnar_engine.svg +3 -0
- package/bootstrap/services/portal/src/assets/gnarengine-logo-black.png +0 -0
- package/bootstrap/services/portal/src/assets/home.svg +3 -0
- package/bootstrap/services/portal/src/assets/link.svg +3 -0
- package/bootstrap/services/portal/src/assets/lock.svg +3 -0
- package/bootstrap/services/portal/src/assets/package.svg +4 -0
- package/bootstrap/services/portal/src/assets/raffle.svg +3 -0
- package/bootstrap/services/portal/src/assets/settings.svg +4 -0
- package/bootstrap/services/portal/src/assets/shopping-bag.svg +3 -0
- package/bootstrap/services/portal/src/assets/user-black.svg +3 -0
- package/bootstrap/services/portal/src/assets/user.svg +3 -0
- package/bootstrap/services/portal/src/assets/users.svg +3 -0
- package/bootstrap/services/portal/src/assets/wallet.svg +3 -0
- package/bootstrap/services/portal/src/css/style.css +1007 -0
- package/bootstrap/services/portal/src/data/data.js +70 -0
- package/bootstrap/services/portal/src/features/attributeFormRow/AttributeFormRow.jsx +32 -0
- package/bootstrap/services/portal/src/features/billingShipping/BillingShipping.jsx +160 -0
- package/bootstrap/services/portal/src/features/crud/crudEdit.less +230 -0
- package/bootstrap/services/portal/src/features/crud/crudList.less +134 -0
- package/bootstrap/services/portal/src/features/crud/crudPage.less +31 -0
- package/bootstrap/services/portal/src/features/crudContact/CrudContactList.jsx +108 -0
- package/bootstrap/services/portal/src/features/crudContact/CrudContactSingle.jsx +243 -0
- package/bootstrap/services/portal/src/features/crudOrder/CrudOrderList.jsx +109 -0
- package/bootstrap/services/portal/src/features/crudOrder/CrudOrderSingle.jsx +315 -0
- package/bootstrap/services/portal/src/features/crudProducts/CrudProductList.jsx +104 -0
- package/bootstrap/services/portal/src/features/crudProducts/CrudProductSingle.jsx +388 -0
- package/bootstrap/services/portal/src/features/crudRaffles/CrudRafflesList.jsx +104 -0
- package/bootstrap/services/portal/src/features/crudRaffles/CrudRafflesSingle.jsx +208 -0
- package/bootstrap/services/portal/src/features/crudSubscription/CrudSubscriptionList.jsx +110 -0
- package/bootstrap/services/portal/src/features/crudSubscription/CrudSubscriptionSingle.jsx +261 -0
- package/bootstrap/services/portal/src/features/crudUser/CrudUserList.jsx +107 -0
- package/bootstrap/services/portal/src/features/crudUser/CrudUserSingle.jsx +402 -0
- package/bootstrap/services/portal/src/features/inventoryFormRow/InventoryFormRow.jsx +30 -0
- package/bootstrap/services/portal/src/features/lineItems/LineItems.jsx +113 -0
- package/bootstrap/services/portal/src/features/loginForm/LoginForm.jsx +56 -0
- package/bootstrap/services/portal/src/features/loginForm/loginForm.less +56 -0
- package/bootstrap/services/portal/src/features/notes/Notes.jsx +18 -0
- package/bootstrap/services/portal/src/features/passwordReset/PasswordResetForm.jsx +96 -0
- package/bootstrap/services/portal/src/features/passwordReset/PasswordResetRequestForm.jsx +74 -0
- package/bootstrap/services/portal/src/features/priceFormRow/PriceFormRow.jsx +102 -0
- package/bootstrap/services/portal/src/features/priceFormRow/priceFormRow.less +24 -0
- package/bootstrap/services/portal/src/features/raffleEntriesList/RaffleEntriesList.jsx +99 -0
- package/bootstrap/services/portal/src/features/raffleProductFormRow/RaffleProductFormRow.jsx +46 -0
- package/bootstrap/services/portal/src/features/sidebar/Sidebar.jsx +64 -0
- package/bootstrap/services/portal/src/features/sidebar/sidebar.less +49 -0
- package/bootstrap/services/portal/src/features/skus/Skus.jsx +109 -0
- package/bootstrap/services/portal/src/features/subscriptionSchedule/SubscriptionSchedule.jsx +44 -0
- package/bootstrap/services/portal/src/features/taxonomyFormRow/TaxonomyFormRow.jsx +32 -0
- package/bootstrap/services/portal/src/features/user/User.jsx +54 -0
- package/bootstrap/services/portal/src/features/user/user.less +57 -0
- package/bootstrap/services/portal/src/includes/utilities.js +259 -0
- package/bootstrap/services/portal/src/index.js +14 -0
- package/bootstrap/services/portal/src/layouts/CrudLayout.jsx +50 -0
- package/bootstrap/services/portal/src/layouts/LoginLayout.jsx +17 -0
- package/bootstrap/services/portal/src/layouts/PortalLayout.jsx +48 -0
- package/bootstrap/services/portal/src/layouts/loginLayout.less +33 -0
- package/bootstrap/services/portal/src/layouts/portalLayout.less +67 -0
- package/bootstrap/services/portal/src/pages/contacts/Contacts.jsx +199 -0
- package/bootstrap/services/portal/src/pages/dashboard/Dashboard.jsx +17 -0
- package/bootstrap/services/portal/src/pages/integrations/Integrations.jsx +10 -0
- package/bootstrap/services/portal/src/pages/login/Login.jsx +15 -0
- package/bootstrap/services/portal/src/pages/login/login.less +10 -0
- package/bootstrap/services/portal/src/pages/orders/Orders.jsx +199 -0
- package/bootstrap/services/portal/src/pages/passwordReset/PasswordResetPage.jsx +15 -0
- package/bootstrap/services/portal/src/pages/passwordResetRequest/PasswordResetRequestPage.jsx +15 -0
- package/bootstrap/services/portal/src/pages/payments/Payments.jsx +10 -0
- package/bootstrap/services/portal/src/pages/portal/Portal.jsx +43 -0
- package/bootstrap/services/portal/src/pages/products/Products.jsx +212 -0
- package/bootstrap/services/portal/src/pages/raffleEntries/RaffleEntries.jsx +124 -0
- package/bootstrap/services/portal/src/pages/raffles/Raffles.jsx +186 -0
- package/bootstrap/services/portal/src/pages/reports/Reports.jsx +10 -0
- package/bootstrap/services/portal/src/pages/settings/Settings.jsx +10 -0
- package/bootstrap/services/portal/src/pages/subscriptions/Subscriptions.jsx +199 -0
- package/bootstrap/services/portal/src/pages/users/Users.jsx +193 -0
- package/bootstrap/services/portal/src/pages/users/users.less +25 -0
- package/bootstrap/services/portal/src/slices/authSlice.js +71 -0
- package/bootstrap/services/portal/src/store/configureStore.js +12 -0
- package/bootstrap/services/portal/src/styles/global.less +159 -0
- package/bootstrap/services/portal/src/styles/inputs.less +157 -0
- package/bootstrap/services/portal/src/styles/main.less +26 -0
- package/bootstrap/services/portal/src/ui/collapsible/Collapsible.jsx +97 -0
- package/bootstrap/services/portal/src/ui/collapsible/collapsible.less +23 -0
- package/bootstrap/services/portal/src/ui/customCheckbox/CustomCheckbox.jsx +17 -0
- package/bootstrap/services/portal/src/ui/customCheckbox/customCheckbox.less +42 -0
- package/bootstrap/services/portal/src/ui/customMultiSelect/CustomMultiSelect.jsx +63 -0
- package/bootstrap/services/portal/src/ui/customMultiSelect/CustomMultiSelectPeriod.jsx +63 -0
- package/bootstrap/services/portal/src/ui/customSelect/CustomSelect.jsx +63 -0
- package/bootstrap/services/portal/src/ui/customSelect/customSelect.less +92 -0
- package/bootstrap/services/portal/src/ui/goBack/GoBack.jsx +19 -0
- package/bootstrap/services/portal/src/ui/loader/Loader.jsx +12 -0
- package/bootstrap/services/portal/src/ui/pagination/Pagination.jsx +23 -0
- package/bootstrap/services/portal/src/ui/repeater/Repeater.jsx +29 -0
- package/bootstrap/services/portal/src/ui/saveButton/SaveButton.jsx +69 -0
- package/bootstrap/services/portal/src/ui/saveButton/saveButton.less +0 -0
- package/bootstrap/services/rabbit-mq/Dockerfile.prod +9 -0
- package/bootstrap/services/user/Dockerfile +23 -0
- package/bootstrap/services/user/Dockerfile.prod +37 -0
- package/bootstrap/services/user/README.md +8 -0
- package/bootstrap/services/user/package.json +16 -0
- package/bootstrap/services/user/src/app.js +45 -0
- package/bootstrap/services/user/src/commands/session.handler.js +23 -0
- package/bootstrap/services/user/src/commands/user.handler.js +286 -0
- package/bootstrap/services/user/src/config.js +73 -0
- package/bootstrap/services/user/src/controllers/http.controller.js +156 -0
- package/bootstrap/services/user/src/controllers/message.controller.js +51 -0
- package/bootstrap/services/user/src/db/migrations/01-init.js +50 -0
- package/bootstrap/services/user/src/db/migrations/02-user-service-init.js +63 -0
- package/bootstrap/services/user/src/db/migrations/03-unauth-sessions.js +43 -0
- package/bootstrap/services/user/src/db/seeders/development/01-root-user.js +29 -0
- package/bootstrap/services/user/src/db/seeders/development/02-portal-admin-user.js +27 -0
- package/bootstrap/services/user/src/db/seeders/production/01-root-user.js +29 -0
- package/bootstrap/services/user/src/policies/user.policy.js +81 -0
- package/bootstrap/services/user/src/schema/user.schema.js +69 -0
- package/bootstrap/services/user/src/services/authentication.service.js +127 -0
- package/bootstrap/services/user/src/services/session.service.js +58 -0
- package/bootstrap/services/user/src/services/user.service.js +130 -0
- package/bootstrap/services/user/src/tests/user.test.js +126 -0
- package/package.json +3 -7
- package/src/agent/agent.client.js +28 -0
- package/src/agent/commands.js +48 -0
- package/src/cli.js +30 -0
- package/src/config.js +8 -0
- package/src/control/commands.js +156 -0
- package/src/control/control.client.js +127 -0
- package/src/dev/commands.js +71 -0
- package/src/dev/dev.service.js +320 -0
- package/src/engine/infra.js +142 -0
- package/src/helpers/helpers.js +63 -0
- package/src/profiles/command.js +170 -0
- package/src/profiles/profiles.client.js +101 -0
- package/src/scaffolder/commands.js +123 -0
- package/src/scaffolder/scaffolder.handler.js +252 -0
- package/src/services/client.js +174 -0
- package/templates/service/Dockerfile.hbs +20 -0
- package/templates/service/app.js.hbs +38 -0
- package/templates/service/commands/{{serviceName}}.handler.js.hbs +97 -0
- package/templates/service/config.js.hbs +48 -0
- package/templates/service/controllers/http.controller.js.hbs +87 -0
- package/templates/service/controllers/message.controller.js.hbs +51 -0
- package/templates/service/db/migrations/01-init.js.hbs +50 -0
- package/templates/service/db/migrations/02-{{lowerCase serviceName}}-service-init.js.hbs +23 -0
- package/templates/service/package.json.hbs +18 -0
- package/templates/service/policies/{{serviceName}}.policy.js.hbs +49 -0
- package/templates/service/schema/{{serviceName}}.schema.js.hbs +14 -0
- package/templates/service/services/{{serviceName}}.service.js.hbs +32 -0
- package/dist/cli.js +0 -18
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export const userRoles = [
|
|
2
|
+
{name: "Service Admin", role: 'service_admin'},
|
|
3
|
+
{name: "Admin", role: 'admin'},
|
|
4
|
+
{name: "Customer", role: 'customer'},
|
|
5
|
+
];
|
|
6
|
+
|
|
7
|
+
export const currencies = [
|
|
8
|
+
{ id: "USD", currency: "USD - US Dollar" },
|
|
9
|
+
{ id: "EUR", currency: "EUR - Euro" },
|
|
10
|
+
{ id: "GBP", currency: "GBP - British Pound" }
|
|
11
|
+
];
|
|
12
|
+
|
|
13
|
+
export const taxClasses = [
|
|
14
|
+
{ id: "standard", taxClass: "Standard Rate" },
|
|
15
|
+
{ id: "reduced", taxClass: "Reduced Rate" },
|
|
16
|
+
{ id: "zero", taxClass: "Zero Rate" }
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
export const productStatuses = [
|
|
20
|
+
{ id: "draft", status: "Draft" },
|
|
21
|
+
{ id: "published", status: "Published" },
|
|
22
|
+
{ id: "archived", status: "Archived" }
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
export const productCategories = [
|
|
26
|
+
{ id: "plugins", category: "Plugins" },
|
|
27
|
+
{ id: "hosting", category: "Hosting" },
|
|
28
|
+
{ id: "merchandise", category: "Merchandise" },
|
|
29
|
+
];
|
|
30
|
+
|
|
31
|
+
export const productPriceTypes = [
|
|
32
|
+
{ id: "recurring", type: "Recurring" },
|
|
33
|
+
{ id: "one-time", type: "One-time" },
|
|
34
|
+
];
|
|
35
|
+
|
|
36
|
+
export const productIntervals = [
|
|
37
|
+
{ id: "daily", interval: "Daily" },
|
|
38
|
+
{ id: "weekly", interval: "Weekly" },
|
|
39
|
+
{ id: "monthly", interval: "Monthly" },
|
|
40
|
+
{ id: "quarterly", interval: "Quarterly" },
|
|
41
|
+
{ id: "annually", interval: "Annually" },
|
|
42
|
+
];
|
|
43
|
+
|
|
44
|
+
export const orderTypes = [
|
|
45
|
+
{ id: "order", type: "Order" },
|
|
46
|
+
{ id: "subscription-payment", type: "Subscription" },
|
|
47
|
+
];
|
|
48
|
+
|
|
49
|
+
export const orderStatuses = [
|
|
50
|
+
{ id: "pending-payment", status: "Pending Payment" },
|
|
51
|
+
{ id: "processing", status: "Processing" },
|
|
52
|
+
{ id: "completed", status: "Completed" },
|
|
53
|
+
{ id: "cancelled", status: "Cancelled" },
|
|
54
|
+
{ id: "refunded", status: "Refunded" },
|
|
55
|
+
];
|
|
56
|
+
|
|
57
|
+
export const subscriptionStatuses = [
|
|
58
|
+
{ id: "active", status: "Active" },
|
|
59
|
+
{ id: "failed", status: "Failed" },
|
|
60
|
+
{ id: "paused", status: "Paused" },
|
|
61
|
+
{ id: "cancelled", status: "Cancelled" },
|
|
62
|
+
{ id: "expired", status: "Expired" },
|
|
63
|
+
{ id: "payment-due", status: "Payment Due" },
|
|
64
|
+
];
|
|
65
|
+
|
|
66
|
+
export const raffleStatuses = [
|
|
67
|
+
{ id: "draft", status: "Draft" },
|
|
68
|
+
{ id: "active", status: "Active" },
|
|
69
|
+
{ id: "closed", status: "Closed" }
|
|
70
|
+
];
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import bin from '../../assets/bin.svg';
|
|
2
|
+
import CustomSelect from '../../ui/customSelect/CustomSelect';
|
|
3
|
+
|
|
4
|
+
const AttributeFormRow = ({ item, onChange, remove }) => {
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
return (
|
|
8
|
+
<div className='form-row'>
|
|
9
|
+
<CustomSelect
|
|
10
|
+
name="attribute"
|
|
11
|
+
placeholder="Select attribute"
|
|
12
|
+
options="TBC"
|
|
13
|
+
labelKey="attribute"
|
|
14
|
+
setSelectedOption="TBC"
|
|
15
|
+
selectedOption="TBC"
|
|
16
|
+
/>
|
|
17
|
+
<CustomSelect
|
|
18
|
+
name="value"
|
|
19
|
+
placeholder="Select attribute value"
|
|
20
|
+
options="TBC"
|
|
21
|
+
labelKey="value"
|
|
22
|
+
setSelectedOption="TBC"
|
|
23
|
+
selectedOption="TBC"
|
|
24
|
+
/>
|
|
25
|
+
|
|
26
|
+
<button className='bin-icon' onClick={remove}><img src={bin} alt="" /></button>
|
|
27
|
+
</div>
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
export default AttributeFormRow;
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
|
|
3
|
+
const BillingShipping = ({ order }) => {
|
|
4
|
+
|
|
5
|
+
const [isEditingBilling, setIsEditingBilling] = useState(false);
|
|
6
|
+
const [isEditingShipping, setIsEditingShipping] = useState(false);
|
|
7
|
+
|
|
8
|
+
const [billingAddress, setBillingAddress] = useState(order?.billingAddress || {});
|
|
9
|
+
const [shippingAddress, setShippingAddress] = useState(order?.shippingAddress || {});
|
|
10
|
+
|
|
11
|
+
const handleInputChange = (e, addressType, field) => {
|
|
12
|
+
const value = e.target.value;
|
|
13
|
+
if (addressType === 'billing') {
|
|
14
|
+
setBillingAddress((prev) => ({ ...prev, [field]: value }));
|
|
15
|
+
} else {
|
|
16
|
+
setShippingAddress((prev) => ({ ...prev, [field]: value }));
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<div className="card">
|
|
22
|
+
<div className='card-header'>
|
|
23
|
+
<h2>Billing & Shipping</h2>
|
|
24
|
+
</div>
|
|
25
|
+
<div className='card-content'>
|
|
26
|
+
<div className="billing-shipping-cont">
|
|
27
|
+
<div className="billing-cont">
|
|
28
|
+
<div className="billing-header">
|
|
29
|
+
<h2>Billing Address</h2>
|
|
30
|
+
</div>
|
|
31
|
+
<div className="billing-body">
|
|
32
|
+
{isEditingBilling ? (
|
|
33
|
+
<div>
|
|
34
|
+
<input
|
|
35
|
+
type="text"
|
|
36
|
+
placeholder="First Name"
|
|
37
|
+
value={billingAddress.firstName || ''}
|
|
38
|
+
onChange={(e) => handleInputChange(e, 'billing', 'firstName')}
|
|
39
|
+
/>
|
|
40
|
+
<input
|
|
41
|
+
type="text"
|
|
42
|
+
placeholder="Last Name"
|
|
43
|
+
value={order?.billingAddress.lastName}
|
|
44
|
+
onChange={(e) => handleInputChange(e, 'billing', 'lastName')}
|
|
45
|
+
/>
|
|
46
|
+
<input
|
|
47
|
+
type="text"
|
|
48
|
+
placeholder="Address Line 1"
|
|
49
|
+
value={order?.billingAddress.addressLine1}
|
|
50
|
+
onChange={(e) => handleInputChange(e, 'billing', 'addressLine1')}
|
|
51
|
+
/>
|
|
52
|
+
<input
|
|
53
|
+
type="text"
|
|
54
|
+
placeholder="Address Line 2"
|
|
55
|
+
value={order?.billingAddress.addressLine2}
|
|
56
|
+
onChange={(e) => handleInputChange(e, 'billing', 'addressLine2')}
|
|
57
|
+
/>
|
|
58
|
+
<input
|
|
59
|
+
type="text"
|
|
60
|
+
placeholder="City"
|
|
61
|
+
value={order?.billingAddress.city}
|
|
62
|
+
onChange={(e) => handleInputChange(e, 'billing', 'city')}
|
|
63
|
+
/>
|
|
64
|
+
<input
|
|
65
|
+
type="text"
|
|
66
|
+
placeholder="Postcode"
|
|
67
|
+
value={order?.billingAddress.postcode}
|
|
68
|
+
onChange={(e) => handleInputChange(e, 'billing', 'postcode')}
|
|
69
|
+
/>
|
|
70
|
+
<br />
|
|
71
|
+
<p>{order?.billingAddress.email}</p>
|
|
72
|
+
<p>{order?.billingAddress.phone}</p>
|
|
73
|
+
</div>
|
|
74
|
+
) : (
|
|
75
|
+
<div>
|
|
76
|
+
<p>{order?.billingAddress.firstName} {order?.billingAddress.lastName}</p>
|
|
77
|
+
<p>{order?.billingAddress.addressLine1}</p>
|
|
78
|
+
<p>{order?.billingAddress.addressLine2}</p>
|
|
79
|
+
<p>{order?.billingAddress.city}</p>
|
|
80
|
+
<p>{order?.billingAddress.postcode}</p>
|
|
81
|
+
<br />
|
|
82
|
+
<p>{order?.billingAddress.email}</p>
|
|
83
|
+
<p>{order?.billingAddress.phone}</p>
|
|
84
|
+
</div>
|
|
85
|
+
)}
|
|
86
|
+
<button
|
|
87
|
+
onClick={() => setIsEditingBilling((prev) => !prev)}
|
|
88
|
+
>
|
|
89
|
+
{isEditingBilling ? 'Save' : 'Edit'}
|
|
90
|
+
</button>
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
|
|
94
|
+
<div className="shipping-cont">
|
|
95
|
+
<div className="shipping-header">
|
|
96
|
+
<h2>Shipping Address</h2>
|
|
97
|
+
</div>
|
|
98
|
+
<div className="shipping-body">
|
|
99
|
+
{isEditingShipping ? (
|
|
100
|
+
<div>
|
|
101
|
+
<input
|
|
102
|
+
type="text"
|
|
103
|
+
placeholder="First Name"
|
|
104
|
+
value={shippingAddress.firstName}
|
|
105
|
+
onChange={(e) => handleInputChange(e, 'shipping', 'firstName')}
|
|
106
|
+
/>
|
|
107
|
+
<input
|
|
108
|
+
type="text"
|
|
109
|
+
placeholder="Last Name"
|
|
110
|
+
value={shippingAddress.lastName}
|
|
111
|
+
onChange={(e) => handleInputChange(e, 'shipping', 'lastName')}
|
|
112
|
+
/>
|
|
113
|
+
<input
|
|
114
|
+
type="text"
|
|
115
|
+
placeholder="Address Line 1"
|
|
116
|
+
value={shippingAddress.addressLine1}
|
|
117
|
+
onChange={(e) => handleInputChange(e, 'shipping', 'addressLine1')}
|
|
118
|
+
/>
|
|
119
|
+
<input
|
|
120
|
+
type="text"
|
|
121
|
+
placeholder="Address Line 2"
|
|
122
|
+
value={shippingAddress.addressLine2}
|
|
123
|
+
onChange={(e) => handleInputChange(e, 'shipping', 'addressLine2')}
|
|
124
|
+
/>
|
|
125
|
+
<input
|
|
126
|
+
type="text"
|
|
127
|
+
placeholder="City"
|
|
128
|
+
value={shippingAddress.city}
|
|
129
|
+
onChange={(e) => handleInputChange(e, 'shipping', 'city')}
|
|
130
|
+
/>
|
|
131
|
+
<input
|
|
132
|
+
type="text"
|
|
133
|
+
placeholder="Postcode"
|
|
134
|
+
value={shippingAddress.postcode}
|
|
135
|
+
onChange={(e) => handleInputChange(e, 'shipping', 'postcode')}
|
|
136
|
+
/>
|
|
137
|
+
</div>
|
|
138
|
+
) : (
|
|
139
|
+
<div>
|
|
140
|
+
<p>{shippingAddress.firstName} {shippingAddress.lastName}</p>
|
|
141
|
+
<p>{shippingAddress.addressLine1}</p>
|
|
142
|
+
<p>{shippingAddress.addressLine2}</p>
|
|
143
|
+
<p>{shippingAddress.city}</p>
|
|
144
|
+
<p>{shippingAddress.postcode}</p>
|
|
145
|
+
</div>
|
|
146
|
+
)}
|
|
147
|
+
<button
|
|
148
|
+
onClick={() => setIsEditingShipping((prev) => !prev)}
|
|
149
|
+
>
|
|
150
|
+
{isEditingShipping ? 'Save' : 'Edit'}
|
|
151
|
+
</button>
|
|
152
|
+
</div>
|
|
153
|
+
</div>
|
|
154
|
+
</div>
|
|
155
|
+
</div>
|
|
156
|
+
</div>
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export default BillingShipping;
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
.crud-edit {
|
|
2
|
+
.edit-heading {
|
|
3
|
+
display: flex;
|
|
4
|
+
justify-content: space-between;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.single-edit {
|
|
9
|
+
.single-edit-header {
|
|
10
|
+
display: flex;
|
|
11
|
+
justify-content: space-between;
|
|
12
|
+
margin-bottom: 20px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
&.subscriptions {
|
|
16
|
+
.subscriptions-table {
|
|
17
|
+
width: 100%;
|
|
18
|
+
border-collapse: collapse;
|
|
19
|
+
|
|
20
|
+
thead {
|
|
21
|
+
border-bottom: 1px solid @dark-grey-1;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
th, td {
|
|
25
|
+
padding: 8px;
|
|
26
|
+
text-align: left;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&.order,
|
|
32
|
+
&.subscriptions {
|
|
33
|
+
.billing-shipping-cont {
|
|
34
|
+
display: flex;
|
|
35
|
+
justify-content: space-between;
|
|
36
|
+
margin-bottom: 20px;
|
|
37
|
+
|
|
38
|
+
.billing-cont,
|
|
39
|
+
.shipping-cont {
|
|
40
|
+
width: 50%;
|
|
41
|
+
padding-right: 20px;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
.line-items-totals-cont {
|
|
47
|
+
.line-items-cont {
|
|
48
|
+
margin-bottom: 40px;
|
|
49
|
+
|
|
50
|
+
.line-items-table,
|
|
51
|
+
.totals-table {
|
|
52
|
+
width: 100%;
|
|
53
|
+
border-collapse: collapse;
|
|
54
|
+
|
|
55
|
+
th {
|
|
56
|
+
border-bottom: 1px solid @dark-grey-1;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
th, td {
|
|
60
|
+
padding: 8px;
|
|
61
|
+
text-align: left;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.totals-cont {
|
|
68
|
+
display: flex;
|
|
69
|
+
justify-content: flex-end;
|
|
70
|
+
|
|
71
|
+
.totals-table {
|
|
72
|
+
tr {
|
|
73
|
+
td {
|
|
74
|
+
padding: 8px 0px 8px 15px;
|
|
75
|
+
text-align: right;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
.order-total {
|
|
79
|
+
font-weight: bold;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.subscription-details-cont {
|
|
85
|
+
display: flex;
|
|
86
|
+
justify-content: space-between;
|
|
87
|
+
margin-bottom: 20px;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.order-notes-cont {
|
|
91
|
+
.note-item {
|
|
92
|
+
display: flex;
|
|
93
|
+
margin-bottom: 20px;
|
|
94
|
+
width: 100%;
|
|
95
|
+
justify-content: space-between;
|
|
96
|
+
|
|
97
|
+
.note-item-body {
|
|
98
|
+
flex: 1;
|
|
99
|
+
display: flex;
|
|
100
|
+
|
|
101
|
+
textarea {
|
|
102
|
+
width: 100%;
|
|
103
|
+
flex-grow: 1;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.account,
|
|
113
|
+
.contacts {
|
|
114
|
+
form {
|
|
115
|
+
display: flex;
|
|
116
|
+
gap: 20px;
|
|
117
|
+
align-items: flex-end;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.user-form {
|
|
122
|
+
display: flex;
|
|
123
|
+
gap: 20px;
|
|
124
|
+
align-items: flex-end;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.api-key {
|
|
128
|
+
form {
|
|
129
|
+
width: 100%;
|
|
130
|
+
|
|
131
|
+
input {
|
|
132
|
+
width: 100%;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.single-inner-cont {
|
|
138
|
+
position: relative;
|
|
139
|
+
|
|
140
|
+
.repeater-cont {
|
|
141
|
+
width: 100%;
|
|
142
|
+
margin-top: 15px;
|
|
143
|
+
|
|
144
|
+
table {
|
|
145
|
+
width: 100%;
|
|
146
|
+
border-collapse: separate;
|
|
147
|
+
border-spacing: 10px;
|
|
148
|
+
|
|
149
|
+
th {
|
|
150
|
+
min-width: 100%;
|
|
151
|
+
color: @dark-1;
|
|
152
|
+
opacity: 0.5;
|
|
153
|
+
font-size: 10px;
|
|
154
|
+
line-height: 1.1em;
|
|
155
|
+
font-style: italic;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.contacts-bin-icon {
|
|
159
|
+
cursor: pointer;
|
|
160
|
+
margin-top: 15px;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
th, td {
|
|
164
|
+
text-align: left;
|
|
165
|
+
vertical-align: top;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
th input,
|
|
169
|
+
td input {
|
|
170
|
+
width: 100%;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.react-datepicker-wrapper {
|
|
174
|
+
width: 100%;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
td.period-name {
|
|
179
|
+
width: 100%;
|
|
180
|
+
display: block;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.react-datepicker-popper {
|
|
185
|
+
z-index: 99;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
.field-instruction {
|
|
191
|
+
min-width: 100%;
|
|
192
|
+
display: inline-block;
|
|
193
|
+
color: @dark-1;
|
|
194
|
+
opacity: 0.5;
|
|
195
|
+
font-size: 10px;
|
|
196
|
+
line-height: 1.1em;
|
|
197
|
+
font-style: italic;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.error-messages {
|
|
201
|
+
width: 100%;
|
|
202
|
+
background: @red-2;
|
|
203
|
+
border: 1px solid @red-1;
|
|
204
|
+
border-radius: 5px;
|
|
205
|
+
padding: 15px;
|
|
206
|
+
margin-bottom: 20px;
|
|
207
|
+
box-sizing: border-box;
|
|
208
|
+
|
|
209
|
+
p {
|
|
210
|
+
color: @red-1;
|
|
211
|
+
line-height: 1em;
|
|
212
|
+
margin-top: 3px;
|
|
213
|
+
margin-bottom: 3px;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
form {
|
|
218
|
+
label {
|
|
219
|
+
display: block;
|
|
220
|
+
}
|
|
221
|
+
input {
|
|
222
|
+
width: 300px;
|
|
223
|
+
|
|
224
|
+
&#marketingOptIn {
|
|
225
|
+
width: 15px;
|
|
226
|
+
height: 15px;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
.crud-list {
|
|
2
|
+
width: 100%; /* Adjust width as needed */
|
|
3
|
+
margin-bottom: 20px; /* Adjust margin as needed */
|
|
4
|
+
|
|
5
|
+
.custom-table {
|
|
6
|
+
width: 100%;
|
|
7
|
+
border-collapse: collapse;
|
|
8
|
+
border-spacing: 0px;
|
|
9
|
+
border: none;
|
|
10
|
+
|
|
11
|
+
.separator-row {
|
|
12
|
+
display: inline-block;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.checkbox {
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
th {
|
|
21
|
+
background-color: @dark-grey-1;
|
|
22
|
+
color: @white;
|
|
23
|
+
text-align: left;
|
|
24
|
+
padding: 10px;
|
|
25
|
+
text-transform: capitalize;
|
|
26
|
+
|
|
27
|
+
&:first-child {
|
|
28
|
+
border-top-left-radius: 10px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&:last-child {
|
|
32
|
+
border-top-right-radius: 10px;
|
|
33
|
+
width: 12%;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
td {
|
|
38
|
+
padding: 5px 10px;
|
|
39
|
+
border: none;
|
|
40
|
+
|
|
41
|
+
&:last-child {
|
|
42
|
+
border-bottom: none;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&.edit-dots {
|
|
46
|
+
text-align: start;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
tbody {
|
|
51
|
+
|
|
52
|
+
button {
|
|
53
|
+
width: 20px;
|
|
54
|
+
background: none;
|
|
55
|
+
border: none;
|
|
56
|
+
margin: 0;
|
|
57
|
+
}
|
|
58
|
+
tr {
|
|
59
|
+
border-top:1px solid transparent;
|
|
60
|
+
border-bottom:1px solid transparent;
|
|
61
|
+
|
|
62
|
+
td {
|
|
63
|
+
line-height: 1em;
|
|
64
|
+
&:first-child {
|
|
65
|
+
border-left: 1px solid @grey-mid-1;
|
|
66
|
+
}
|
|
67
|
+
&:last-child {
|
|
68
|
+
border-right: 1px solid @grey-mid-1;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
tr:first-of-type {
|
|
73
|
+
td {
|
|
74
|
+
border-top: 1px solid @grey-mid-1;
|
|
75
|
+
&:first-child {
|
|
76
|
+
border-left: 1px solid @grey-mid-1;
|
|
77
|
+
}
|
|
78
|
+
&:last-child {
|
|
79
|
+
border-right: 1px solid @grey-mid-1;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
tr:last-of-type {
|
|
84
|
+
td {
|
|
85
|
+
border-bottom: 1px solid @grey-mid-1;
|
|
86
|
+
&:first-child {
|
|
87
|
+
border-left: 1px solid @grey-mid-1;
|
|
88
|
+
border-bottom-left-radius: 10px;
|
|
89
|
+
}
|
|
90
|
+
&:last-child {
|
|
91
|
+
border-right: 1px solid @grey-mid-1;
|
|
92
|
+
border-bottom-right-radius: 10px;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
tr:nth-child(even) {
|
|
98
|
+
td {
|
|
99
|
+
background-color: #f1f1f1;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// HOVER EFFECT
|
|
104
|
+
tr:hover td {
|
|
105
|
+
border-top: 1px solid @green-1;
|
|
106
|
+
border-bottom: 1px solid @green-1;
|
|
107
|
+
cursor: pointer;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
tr:hover td:first-child {
|
|
111
|
+
border-left: 1px solid @green-1;
|
|
112
|
+
cursor: pointer;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
tr:hover td:last-child {
|
|
116
|
+
border-right: 1px solid @green-1;
|
|
117
|
+
cursor: pointer;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.pagination-labels-cont {
|
|
124
|
+
display: flex;
|
|
125
|
+
flex-direction: row;
|
|
126
|
+
justify-content: space-between;
|
|
127
|
+
align-items: center;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.pagination-count {
|
|
131
|
+
margin-bottom: 20px;
|
|
132
|
+
text-align: left;
|
|
133
|
+
font-size: 12px;
|
|
134
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
.crud-page,
|
|
2
|
+
.manage-students {
|
|
3
|
+
position: relative;
|
|
4
|
+
|
|
5
|
+
.flex-row-select-cont {
|
|
6
|
+
margin-top: 50px;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.clear-filters-btn {
|
|
10
|
+
position: absolute;
|
|
11
|
+
top: 65px;
|
|
12
|
+
right: 5px;
|
|
13
|
+
|
|
14
|
+
&:hover {
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
opacity: 0.8;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.password-reset-btn {
|
|
21
|
+
display: block;
|
|
22
|
+
position: relative;
|
|
23
|
+
color: @green-1;
|
|
24
|
+
text-decoration: underline;
|
|
25
|
+
|
|
26
|
+
&:hover {
|
|
27
|
+
cursor: pointer;
|
|
28
|
+
opacity: 0.8;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|