Fixes
This commit is contained in:
parent
64bf731a6c
commit
8fe8f9ef16
@ -14,8 +14,7 @@
|
||||
"imports": {
|
||||
"@deno/vite-plugin": "npm:@deno/vite-plugin@^1.0.0",
|
||||
"@ebay/nice-modal-react": "npm:@ebay/nice-modal-react@^1.2.13",
|
||||
"@preact-icons/bs": "jsr:@preact-icons/bs@^1.0.12",
|
||||
"@preact-icons/ri": "jsr:@preact-icons/ri@^1.0.12",
|
||||
"@heroicons/react": "npm:@heroicons/react@^2.2.0",
|
||||
"@rjsf/core": "npm:@rjsf/core@^5.23.2",
|
||||
"@rjsf/validator-ajv6": "npm:@rjsf/validator-ajv6@^5.23.2",
|
||||
"@types/react": "npm:@types/react@^18.3.12",
|
||||
|
||||
@ -1,13 +1,11 @@
|
||||
{
|
||||
"version": "4",
|
||||
"specifiers": {
|
||||
"jsr:@preact-icons/bs@^1.0.12": "1.0.12",
|
||||
"jsr:@preact-icons/common@^1.0.12": "1.0.12",
|
||||
"jsr:@preact-icons/ri@^1.0.12": "1.0.12",
|
||||
"jsr:@std/path@1": "1.0.8",
|
||||
"jsr:@udibo/esbuild-plugin-postcss@~0.1.3": "0.1.3",
|
||||
"npm:@deno/vite-plugin@1": "1.0.2_vite@6.0.5",
|
||||
"npm:@ebay/nice-modal-react@^1.2.13": "1.2.13_react@18.3.1_react-dom@19.0.0__react@19.0.0",
|
||||
"npm:@heroicons/react@^2.2.0": "2.2.0_react@18.3.1",
|
||||
"npm:@rjsf/core@^5.23.2": "5.23.2_@rjsf+utils@5.23.2__react@18.3.1_react@18.3.1",
|
||||
"npm:@rjsf/validator-ajv6@^5.23.2": "5.23.2_@rjsf+utils@5.23.2__react@18.3.1_react@18.3.1",
|
||||
"npm:@types/react-dom@^18.3.1": "18.3.5_@types+react@18.3.18",
|
||||
@ -36,28 +34,6 @@
|
||||
"npm:vite@^6.0.5": "6.0.5"
|
||||
},
|
||||
"jsr": {
|
||||
"@preact-icons/bs@1.0.12": {
|
||||
"integrity": "52282f0e2ffc73b2828f0bdb508dec14c4867f99f9f37fc4094b39f0467d9b1f",
|
||||
"dependencies": [
|
||||
"jsr:@preact-icons/common",
|
||||
"npm:preact@10.22.1"
|
||||
]
|
||||
},
|
||||
"@preact-icons/common@1.0.12": {
|
||||
"integrity": "f7d7329d55c2753b0162438b120b638e5058fa406f49fe6b422e3b0694f6e0c1",
|
||||
"dependencies": [
|
||||
"npm:@types/react",
|
||||
"npm:preact@^10.22.1",
|
||||
"npm:react"
|
||||
]
|
||||
},
|
||||
"@preact-icons/ri@1.0.12": {
|
||||
"integrity": "cd014a2a4bf9aea652d554d620365ea4695d4613aef1eb3833c71cad53415435",
|
||||
"dependencies": [
|
||||
"jsr:@preact-icons/common",
|
||||
"npm:preact@10.22.1"
|
||||
]
|
||||
},
|
||||
"@std/path@1.0.8": {
|
||||
"integrity": "548fa456bb6a04d3c1a1e7477986b6cffbce95102d0bb447c67c4ee70e0364be"
|
||||
},
|
||||
@ -349,6 +325,12 @@
|
||||
"@floating-ui/utils@0.2.8": {
|
||||
"integrity": "sha512-kym7SodPp8/wloecOpcmSnWJsK7M0E5Wg8UcFA+uO4B9s5d0ywXOEro/8HM9x0rW+TljRzul/14UYz3TleT3ig=="
|
||||
},
|
||||
"@heroicons/react@2.2.0_react@18.3.1": {
|
||||
"integrity": "sha512-LMcepvRaS9LYHJGsF0zzmgKCUim/X3N/DQKc4jepAXJ7l8QxJ1PmxJzqplF2Z3FE4PqBAIGyJAQ/w4B5dsqbtQ==",
|
||||
"dependencies": [
|
||||
"react@18.3.1"
|
||||
]
|
||||
},
|
||||
"@isaacs/cliui@8.0.2": {
|
||||
"integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==",
|
||||
"dependencies": [
|
||||
@ -1847,11 +1829,10 @@
|
||||
},
|
||||
"workspace": {
|
||||
"dependencies": [
|
||||
"jsr:@preact-icons/bs@^1.0.12",
|
||||
"jsr:@preact-icons/ri@^1.0.12",
|
||||
"jsr:@udibo/esbuild-plugin-postcss@~0.1.3",
|
||||
"npm:@deno/vite-plugin@1",
|
||||
"npm:@ebay/nice-modal-react@^1.2.13",
|
||||
"npm:@heroicons/react@^2.2.0",
|
||||
"npm:@rjsf/core@^5.23.2",
|
||||
"npm:@rjsf/validator-ajv6@^5.23.2",
|
||||
"npm:@types/react-dom@^18.3.1",
|
||||
|
||||
@ -1,16 +1,33 @@
|
||||
import { RiDeleteBin2Line, RiSaveFill } from "@preact-icons/ri"
|
||||
import { BsXCircle, BsPlus, BsPencil } from "@preact-icons/bs"
|
||||
import { Button as BaseButton } from "flowbite-react"
|
||||
import React from 'react'
|
||||
|
||||
const Button = ({ type , variant , onClick }) => {
|
||||
return (
|
||||
<BaseButton color={variant} pill onClick={onClick}>
|
||||
{ type == 1 && <BsPlus/> }
|
||||
{ type == 2 && <BsPencil/> }
|
||||
{ type == 3 && <RiSaveFill/> }
|
||||
{ type == 4 && <BsXCircle/> }
|
||||
{ type == 5 && <RiDeleteBin2Line/> }
|
||||
{ type == 1 &&
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true" data-slot="icon" class="size-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15"></path>
|
||||
</svg>
|
||||
}
|
||||
{ type == 2 &&
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true" data-slot="icon" class="size-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L6.832 19.82a4.5 4.5 0 0 1-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 0 1 1.13-1.897L16.863 4.487Zm0 0L19.5 7.125"></path>
|
||||
</svg>
|
||||
}
|
||||
{ type == 3 &&
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true" data-slot="icon" fill="none" class="size-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M6 20.25h12A2.25 2.25 0 0 0 20.25 18V7.5L16.5 3.75H6A2.25 2.25 0 0 0 3.75 6v12A2.25 2.25 0 0 0 6 20.25zm9.75-16.5v5h-9.5v-5zM13 5.5V7m-6.75 4.25h11.5v6.5H6.25Z"></path>
|
||||
</svg>
|
||||
}
|
||||
{ type == 4 &&
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true" data-slot="icon" class="size-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"></path>
|
||||
</svg>
|
||||
}
|
||||
{ type == 5 &&
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true" data-slot="icon" class="size-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"></path>
|
||||
</svg> }
|
||||
</BaseButton>
|
||||
);
|
||||
};
|
||||
|
||||
@ -4,7 +4,6 @@ import OrderService from '../../services/order'
|
||||
import { Component } from 'react'
|
||||
import {debounceTime} from "rxjs"
|
||||
import {Order} from "../../model/order"
|
||||
import { RiSaveFill, RiPrinterFill } from "@preact-icons/ri"
|
||||
import { Button } from "flowbite-react"
|
||||
import React from 'react'
|
||||
|
||||
@ -54,10 +53,14 @@ class ButtonComponent extends Component<{loadOrder},{disabled: boolean}> {
|
||||
return (
|
||||
<div className="flex gap-3">
|
||||
<Button size="xs" color="info" disabled={this.state.disabled} onClick={(e:any) => this.handleSave(e)}>
|
||||
<div className="mr-2 h-5 w-5"/> Speichern
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true" data-slot="icon" fill="none" class="mr-2 h-5 w-5">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M6 20.25h12A2.25 2.25 0 0 0 20.25 18V7.5L16.5 3.75H6A2.25 2.25 0 0 0 3.75 6v12A2.25 2.25 0 0 0 6 20.25zm9.75-16.5v5h-9.5v-5zM13 5.5V7m-6.75 4.25h11.5v6.5H6.25Z"></path>
|
||||
</svg> Speichern
|
||||
</Button>
|
||||
<Button size="xs" color="success" disabled={!this.orderState.getCurrentOrder().value.saved} onClick={(e:any) => this.handlePrint(e)}>
|
||||
<div className="mr-2 h-5 w-5"/> Drucken
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true" data-slot="icon" class="mr-2 h-5 w-5">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M6.72 13.829c-.24.03-.48.062-.72.096m.72-.096a42.415 42.415 0 0 1 10.56 0m-10.56 0L6.34 18m10.94-4.171c.24.03.48.062.72.096m-.72-.096L17.66 18m0 0 .229 2.523a1.125 1.125 0 0 1-1.12 1.227H7.231c-.662 0-1.18-.568-1.12-1.227L6.34 18m11.318 0h1.091A2.25 2.25 0 0 0 21 15.75V9.456c0-1.081-.768-2.015-1.837-2.175a48.055 48.055 0 0 0-1.913-.247M6.34 18H5.25A2.25 2.25 0 0 1 3 15.75V9.456c0-1.081.768-2.015 1.837-2.175a48.041 48.041 0 0 1 1.913-.247m10.5 0a48.536 48.536 0 0 0-10.5 0m10.5 0V3.375c0-.621-.504-1.125-1.125-1.125h-8.25c-.621 0-1.125.504-1.125 1.125v3.659M18 10.5h.008v.008H18V10.5Zm-3 0h.008v.008H15V10.5Z"></path>
|
||||
</svg> Drucken
|
||||
</Button>
|
||||
</div>
|
||||
)
|
||||
|
||||
@ -7,7 +7,7 @@ import {useEffect, useState} from "react"
|
||||
import {Pos} from "../../model/pos"
|
||||
import Order from "../../model/order"
|
||||
import OrderState from "../../state/order"
|
||||
|
||||
import {container} from "tsyringe-neo"
|
||||
const PositionsComponent = ({order, shop, updateOrder}) => {
|
||||
|
||||
const orderState = container.resolve(OrderState)
|
||||
|
||||
@ -10,11 +10,8 @@ const ShopSelectComponent = (props) => {
|
||||
const orderState = container.resolve(OrderState)
|
||||
|
||||
const shop_service = container.resolve(ShopService)
|
||||
const token_service = container.resolve(Token)
|
||||
|
||||
const loadOptions = async (searchQuery, loadedOptions) => {
|
||||
|
||||
console.log(token_service)
|
||||
const data = await shop_service.getShops()
|
||||
|
||||
return {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import {autoInjectable, singleton} from "tsyringe-neo";
|
||||
import { Token } from "./token";
|
||||
import {inject, autoInjectable, singleton} from "tsyringe-neo";
|
||||
import Token from "./token";
|
||||
import axios from 'axios';
|
||||
import { Account } from "../model/account";
|
||||
import { Shop } from "../model/shop";
|
||||
@ -7,7 +7,9 @@ import { Shop } from "../model/shop";
|
||||
@singleton()
|
||||
@autoInjectable()
|
||||
class AccountService {
|
||||
constructor(private token?: Token) {}
|
||||
constructor(@inject(Token) token?: Token) {
|
||||
this.token = token
|
||||
}
|
||||
|
||||
async getAccounts(shop: Shop): Promise<Account[]> {
|
||||
|
||||
|
||||
@ -1,12 +1,14 @@
|
||||
import {autoInjectable, singleton} from "tsyringe-neo"
|
||||
import { Token } from "./token"
|
||||
import {inject, autoInjectable, singleton} from "tsyringe-neo"
|
||||
import Token from "./token"
|
||||
import axios from 'axios'
|
||||
import { Address } from "../model/address"
|
||||
|
||||
@singleton()
|
||||
@autoInjectable()
|
||||
class AddressService {
|
||||
constructor(private token?: Token) {}
|
||||
constructor(@inject(Token) token?: Token) {
|
||||
this.token = token
|
||||
}
|
||||
|
||||
async create(address: Address): Promise<Address> {
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import {autoInjectable, singleton} from "tsyringe-neo";
|
||||
import { Token } from "./token";
|
||||
import {inject, autoInjectable, singleton} from "tsyringe-neo";
|
||||
import Token from "./token";
|
||||
import axios from 'axios';
|
||||
import { Contact } from "../model/contact";
|
||||
import { Address } from "../model/address";
|
||||
@ -8,7 +8,9 @@ import { Shop } from "../model/shop";
|
||||
@singleton()
|
||||
@autoInjectable()
|
||||
class ContactService {
|
||||
constructor(private token?: Token) {}
|
||||
constructor(@inject(Token) token?: Token) {
|
||||
this.token = token
|
||||
}
|
||||
|
||||
async createContact(contact: Contact): Promise<Contact> {
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import {autoInjectable, singleton} from "tsyringe-neo";
|
||||
import { Token } from "./token";
|
||||
import {inject, autoInjectable, singleton} from "tsyringe-neo";
|
||||
import Token from "./token";
|
||||
import axios from 'axios';
|
||||
import Order from "../model/order";
|
||||
|
||||
@ -7,7 +7,9 @@ import Order from "../model/order";
|
||||
@autoInjectable()
|
||||
class OrderService {
|
||||
|
||||
constructor(private token?: Token) {}
|
||||
constructor(@inject(Token) token?: Token) {
|
||||
this.token = token
|
||||
}
|
||||
|
||||
async getOrder(uuid: String): Promise<Order> {
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import {autoInjectable, singleton} from "tsyringe-neo"
|
||||
import { Token } from "./token"
|
||||
import {inject, autoInjectable, singleton} from "tsyringe-neo"
|
||||
import Token from "./token"
|
||||
import axios from 'axios'
|
||||
import { Shop } from "../model/shop"
|
||||
import {Payment} from "../model/payment"
|
||||
@ -7,7 +7,9 @@ import {Payment} from "../model/payment"
|
||||
@singleton()
|
||||
@autoInjectable()
|
||||
class PaymentService {
|
||||
constructor(private token?: Token) {}
|
||||
constructor(@inject(Token) token?: Token) {
|
||||
this.token = token
|
||||
}
|
||||
|
||||
async getPayments(shop: Shop): Promise<Payment[]> {
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import {autoInjectable, singleton} from "tsyringe-neo";
|
||||
import { Token } from "./token";
|
||||
import {inject, autoInjectable, singleton} from "tsyringe-neo";
|
||||
import Token from "./token";
|
||||
import axios from 'axios';
|
||||
import { Shop } from "../model/shop";
|
||||
import {ProductGroup} from "../model/productGroup";
|
||||
@ -9,7 +9,9 @@ import {JSONSchema7} from "json-schema";
|
||||
@singleton()
|
||||
@autoInjectable()
|
||||
class ProductService {
|
||||
constructor(private token?: Token) {}
|
||||
constructor(@inject(Token) token?: Token) {
|
||||
this.token = token
|
||||
}
|
||||
|
||||
async getProductsByTerm(term: string, shop: Shop): Promise<Product[]> {
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import {autoInjectable, singleton} from "tsyringe-neo";
|
||||
import { Token } from "./token";
|
||||
import {inject, autoInjectable, singleton} from "tsyringe-neo";
|
||||
import Token from "./token";
|
||||
import axios from 'axios';
|
||||
import { Shop } from "../model/shop";
|
||||
import {ProductGroup} from "../model/productGroup";
|
||||
@ -7,7 +7,9 @@ import {ProductGroup} from "../model/productGroup";
|
||||
@singleton()
|
||||
@autoInjectable()
|
||||
class ProductGroupService {
|
||||
constructor(private token?: Token) {}
|
||||
constructor(@inject(Token) token?: Token) {
|
||||
this.token = token
|
||||
}
|
||||
|
||||
async getProductGroups(searchQuery: String, shop: Shop): Promise<ProductGroup[]> {
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import {autoInjectable, singleton} from "tsyringe-neo"
|
||||
import { Token } from "./token"
|
||||
import {inject, autoInjectable, singleton} from "tsyringe-neo"
|
||||
import Token from "./token"
|
||||
import axios from 'axios'
|
||||
import { Shop } from "../model/shop"
|
||||
import {Shipping} from "../model/shipping"
|
||||
@ -7,8 +7,9 @@ import {Shipping} from "../model/shipping"
|
||||
@singleton()
|
||||
@autoInjectable()
|
||||
class ShippingService {
|
||||
constructor(private token?: Token) {}
|
||||
|
||||
constructor(@inject(Token) token?: Token) {
|
||||
this.token = token
|
||||
}
|
||||
async getShipping(shop: Shop): Promise<Shipping[]> {
|
||||
|
||||
return await axios.get('/apps/api/shipping/by/shop/' + shop.uuid, {
|
||||
|
||||
@ -1,13 +1,14 @@
|
||||
import {autoInjectable, singleton} from "tsyringe-neo"
|
||||
import { Token } from "./token"
|
||||
import {autoInjectable, inject, singleton} from "tsyringe-neo"
|
||||
import Token from "./token"
|
||||
import axios from 'axios'
|
||||
import { Shop } from "../model/shop"
|
||||
|
||||
@singleton()
|
||||
@autoInjectable()
|
||||
class ShopService {
|
||||
constructor(token?: Token) {
|
||||
console.log(token)
|
||||
|
||||
constructor(@inject(Token) token?: Token) {
|
||||
this.token = token
|
||||
}
|
||||
|
||||
async getShops(): Promise<Shop[]> {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import axios from "axios"
|
||||
import {singleton} from "tsyringe-neo"
|
||||
import {singleton, injectable} from "tsyringe-neo"
|
||||
|
||||
@singleton()
|
||||
class Token {
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2020",
|
||||
"experimentalDecorators": true,
|
||||
"emitDecoratorMetadata": true,
|
||||
"useDefineForClassFields": true,
|
||||
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
||||
"module": "ESNext",
|
||||
|
||||
@ -4,7 +4,8 @@
|
||||
"lib": ["ES2023"],
|
||||
"module": "ESNext",
|
||||
"skipLibCheck": true,
|
||||
|
||||
"experimentalDecorators": true,
|
||||
"emitDecoratorMetadata": true,
|
||||
/* Bundler mode */
|
||||
"moduleResolution": "bundler",
|
||||
"allowImportingTsExtensions": true,
|
||||
|
||||
@ -1251,6 +1251,10 @@ input[type="range"]::-ms-fill-lower {
|
||||
.hidden {
|
||||
display: none;
|
||||
}
|
||||
.size-6 {
|
||||
width: 1.5rem;
|
||||
height: 1.5rem;
|
||||
}
|
||||
.h-0\.5 {
|
||||
height: 0.125rem;
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user