Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
627 changes: 270 additions & 357 deletions packages/admin-ui/src/lib/core/src/common/introspection-result.ts

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import { ConfigurableOperationMultiSelector } from '@/vdb/components/shared/configurable-operation-multi-selector.js';
import { ConfigurableOperationInput as ConfigurableOperationInputType } from '@vendure/common/lib/generated-types';
import { getCollectionFiltersQueryOptions } from '../collections.graphql.js';
import { useLingui } from '@lingui/react/macro';

export interface CollectionFiltersSelectorProps {
value: ConfigurableOperationInputType[];
onChange: (filters: ConfigurableOperationInputType[]) => void;
}

export function CollectionFiltersSelector({ value, onChange }: Readonly<CollectionFiltersSelectorProps>) {
const { t } = useLingui();
return (
<div className="mt-4">
<ConfigurableOperationMultiSelector
Expand All @@ -16,7 +18,7 @@ export function CollectionFiltersSelector({ value, onChange }: Readonly<Collecti
queryOptions={getCollectionFiltersQueryOptions}
queryKey="getCollectionFilters"
dataPath="collectionFilters"
buttonText="Add collection filter"
buttonText={t`Add collection filter`}
showEnhancedDropdown={false}
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ConfigurableOperationSelector } from '@/vdb/components/shared/configurable-operation-selector.js';
import { configurableOperationDefFragment } from '@/vdb/graphql/fragments.js';
import { graphql } from '@/vdb/graphql/graphql.js';
import { useLingui } from '@lingui/react/macro';
import { ConfigurableOperationInput as ConfigurableOperationInputType } from '@vendure/common/lib/generated-types';

export const paymentEligibilityCheckersDocument = graphql(
Expand All @@ -23,15 +24,16 @@ export function PaymentEligibilityCheckerSelector({
value,
onChange,
}: PaymentEligibilityCheckerSelectorProps) {
const { t } = useLingui();
return (
<ConfigurableOperationSelector
value={value}
onChange={onChange}
queryDocument={paymentEligibilityCheckersDocument}
queryKey="paymentMethodEligibilityCheckers"
dataPath="paymentMethodEligibilityCheckers"
buttonText="Select Payment Eligibility Checker"
emptyText="No checkers found"
buttonText={t`Select Payment Eligibility Checker`}
emptyText={t`No checkers found`}
/>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { ConfigurableOperationSelector } from '@/vdb/components/shared/configura
import { configurableOperationDefFragment } from '@/vdb/graphql/fragments.js';
import { graphql } from '@/vdb/graphql/graphql.js';
import { ConfigurableOperationInput as ConfigurableOperationInputType } from '@vendure/common/lib/generated-types';
import { useLingui } from '@lingui/react/macro';

export const paymentHandlersDocument = graphql(
`
Expand All @@ -20,14 +21,15 @@ interface PaymentHandlerSelectorProps {
}

export function PaymentHandlerSelector({ value, onChange }: Readonly<PaymentHandlerSelectorProps>) {
const { t } = useLingui();
return (
<ConfigurableOperationSelector
value={value}
onChange={onChange}
queryDocument={paymentHandlersDocument}
queryKey="paymentMethodHandlers"
dataPath="paymentMethodHandlers"
buttonText="Select Payment Handler"
buttonText={t`Select Payment Handler`}
/>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
RemoveProductVariantsFromChannelBulkAction,
} from '../../_product-variants/components/product-variant-bulk-actions.js';
import { productVariantListDocument } from '../products.graphql.js';
import { useLingui } from '@lingui/react/macro';

interface ProductVariantsTableProps {
productId: string;
Expand All @@ -28,6 +29,7 @@ export function ProductVariantsTable({
fromProductDetailPage,
}: ProductVariantsTableProps) {
const { formatCurrencyName } = useLocalFormat();
const { t } = useLingui();
const [page, setPage] = useState(1);
const [pageSize, setPageSize] = useState(10);
const [sorting, setSorting] = useState<SortingState>([]);
Expand Down Expand Up @@ -69,7 +71,7 @@ export function ProductVariantsTable({
]}
customizeColumns={{
name: {
header: 'Variant name',
header: t`Variant name`,
cell: ({ row: { original } }) => (
<DetailPageButton
href={`../../product-variants/${original.id}`}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { api } from '@/vdb/graphql/api.js';
import { configurableOperationDefFragment } from '@/vdb/graphql/fragments.js';
import { graphql } from '@/vdb/graphql/graphql.js';
import { useQuery } from '@tanstack/react-query';
import { useLingui } from '@lingui/react/macro';

export const fulfillmentHandlersDocument = graphql(
`
Expand All @@ -21,6 +22,8 @@ interface FulfillmentHandlerSelectorProps {
}

export function FulfillmentHandlerSelector({ value, onChange }: Readonly<FulfillmentHandlerSelectorProps>) {
const { t } = useLingui();

const { data: fulfillmentHandlersData } = useQuery({
queryKey: ['fulfillmentHandlers'],
queryFn: () => api.query(fulfillmentHandlersDocument),
Expand All @@ -41,7 +44,7 @@ export function FulfillmentHandlerSelector({ value, onChange }: Readonly<Fulfill
<div>
<Select onValueChange={onFulfillmentHandlerSelected} value={value ?? undefined}>
<SelectTrigger>
<SelectValue placeholder="Select a fulfillment handler" />
<SelectValue placeholder={t`Select a fulfillment handler`} />
</SelectTrigger>
<SelectContent>
{fulfillmentHandlers?.map(fulfillmentHandler => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { ConfigurableOperationSelector } from '@/vdb/components/shared/configura
import { configurableOperationDefFragment } from '@/vdb/graphql/fragments.js';
import { graphql } from '@/vdb/graphql/graphql.js';
import { ConfigurableOperationInput as ConfigurableOperationInputType } from '@vendure/common/lib/generated-types';
import { useLingui } from '@lingui/react/macro';

export const shippingCalculatorsDocument = graphql(
`
Expand All @@ -20,14 +21,15 @@ interface ShippingCalculatorSelectorProps {
}

export function ShippingCalculatorSelector({ value, onChange }: Readonly<ShippingCalculatorSelectorProps>) {
const { t } = useLingui();
return (
<ConfigurableOperationSelector
value={value}
onChange={onChange}
queryDocument={shippingCalculatorsDocument}
queryKey="shippingCalculators"
dataPath="shippingCalculators"
buttonText="Select Shipping Calculator"
buttonText={t`Select Shipping Calculator`}
/>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { ConfigurableOperationSelector } from '@/vdb/components/shared/configura
import { configurableOperationDefFragment } from '@/vdb/graphql/fragments.js';
import { graphql } from '@/vdb/graphql/graphql.js';
import { ConfigurableOperationInput as ConfigurableOperationInputType } from '@vendure/common/lib/generated-types';
import { useLingui } from '@lingui/react/macro';

export const shippingEligibilityCheckersDocument = graphql(
`
Expand All @@ -23,14 +24,15 @@ export function ShippingEligibilityCheckerSelector({
value,
onChange,
}: ShippingEligibilityCheckerSelectorProps) {
const { t } = useLingui();
return (
<ConfigurableOperationSelector
value={value}
onChange={onChange}
queryDocument={shippingEligibilityCheckersDocument}
queryKey="shippingEligibilityCheckers"
dataPath="shippingEligibilityCheckers"
buttonText="Select Shipping Eligibility Checker"
buttonText={t`Select Shipping Eligibility Checker`}
/>
);
}
Loading
Loading