Skip to content

Commit

Permalink
Merge branch 'dev' into feat/refactor-bulk-order
Browse files Browse the repository at this point in the history
  • Loading branch information
asvishnyakov authored Nov 21, 2024
2 parents a60e8bd + 2cfee24 commit 29d50eb
Show file tree
Hide file tree
Showing 49 changed files with 1,346 additions and 751 deletions.
4 changes: 3 additions & 1 deletion .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { setup } from "@storybook/vue3";
import { merge } from "lodash";
import { vueRouter } from "storybook-vue3-router";
import { useFetch } from "../client-app/core/api/common";
import { setGlobals } from "../client-app/core/globals";
import { createI18n } from "../client-app/i18n";
import { uiKit } from "../client-app/ui-kit";
import UI_KIT_DEFAULT_MESSAGE from "../client-app/ui-kit/locales/en.json";
import DEFAULT_MESSAGE from "../locales/en.json";
import type { I18n } from "../client-app/i18n";
import type { Preview } from "@storybook/vue3";
Expand Down Expand Up @@ -33,7 +35,7 @@ async function configureThemeSettings() {
}

function configureI18N() {
i18n.global.setLocaleMessage(DEFAULT_LOCALE, DEFAULT_MESSAGE);
i18n.global.setLocaleMessage(DEFAULT_LOCALE, merge({}, DEFAULT_MESSAGE, UI_KIT_DEFAULT_MESSAGE));
}

setup(async (app) => {
Expand Down
9 changes: 9 additions & 0 deletions client-app/app-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { useUser } from "@/shared/account";
import ProductBlocks from "@/shared/catalog/components/product";
import { templateBlocks } from "@/shared/static-content";
import { uiKit } from "@/ui-kit";
import { getLocales as getUIKitLocales } from "@/ui-kit/utilities/getLocales";
import App from "./App.vue";
import type { StoreResponseType } from "./core/api/graphql/types";

Expand Down Expand Up @@ -61,6 +62,7 @@ export default async () => {
fetchLocaleMessages,
getLocaleFromUrl,
pinedLocale,
mergeLocales,
} = useLanguages();
const { currentCurrency } = useCurrency();
const { init: initializeGoogleAnalytics } = useGoogleAnalytics();
Expand Down Expand Up @@ -144,7 +146,14 @@ export default async () => {
app.use(permissionsPlugin);
app.use(contextPlugin, themeContext.value);
app.use(configPlugin, themeContext.value);

const UIKitMessages = await getUIKitLocales(FALLBACK_LOCALE, currentLanguage.value?.twoLetterLanguageName);
mergeLocales(i18n, currentLanguage.value?.twoLetterLanguageName, UIKitMessages.messages);
if (currentLanguage.value?.twoLetterLanguageName !== FALLBACK_LOCALE) {
mergeLocales(i18n, FALLBACK_LOCALE, UIKitMessages.fallbackMessages);
}
app.use(uiKit);

app.use(applicationInsightsPlugin);

const builderOrigin = getEpParam();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,8 @@ fragment fullLineItem on LineItemType {
validationErrors {
...validationError
}
configurationItems {
id
name
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,15 @@

mutation CreateConfiguredLineItem($command: InputCreateConfiguredLineItemCommand!) {
createConfiguredLineItem(command: $command) {
currency {
...currency
}
total {
...money
}
taxTotal {
...money
}
subTotal {
...money
}
subTotalWithTax {
...money
}
extendedPriceTotal {
...money
}
extendedPriceTotalWithTax {
id
quantity
listPrice {
...money
}
discountTotal {
salePrice {
...money
}
discountTotalWithTax {
extendedPrice {
...money
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@
#import "../../fragments/property.graphql"
#import "../../fragments/availabilityData.graphql"

query GetProductConfigurations($productId: String!, $storeId: String!, $currencyCode: String!, $cultureName: String) {
query GetProductConfigurations(
$configurableProductId: String!
$storeId: String!
$currencyCode: String!
$cultureName: String
) {
productConfiguration(
storeId: $storeId
productId: $productId
configurableProductId: $configurableProductId
currencyCode: $currencyCode
cultureName: $cultureName
) {
Expand All @@ -15,36 +20,33 @@ query GetProductConfigurations($productId: String!, $storeId: String!, $currency
description
type
isRequired
quantity
products {
name
options {
id
code
productType
slug
imgSrc
availabilityData {
...availabilityData
quantity
listPrice {
...money
}
price {
actual {
...money
}
discountAmount {
amount
formattedAmount
}
sale {
amount
formattedAmount
salePrice {
...money
}
extendedPrice {
...money
}
product {
name
id
code
productType
slug
imgSrc
hasVariations
availabilityData {
...availabilityData
}
list {
...money
properties {
...property
}
}
properties {
...property
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { GetProductConfigurationsQuery, GetProductConfigurationsQueryVariab
import type { ApolloQueryResult } from "@apollo/client/core";

export async function getProductConfiguration(
productId: string,
configurableProductId: string,
): Promise<GetProductConfigurationsQuery["productConfiguration"] | undefined> {
const { storeId, cultureName, currencyCode } = globals;

Expand All @@ -18,7 +18,7 @@ export async function getProductConfiguration(
storeId,
cultureName,
currencyCode,
productId,
configurableProductId,
},
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,8 @@ fragment orderLineItemFields on OrderLineItemType {
reviewCount
}
}
configurationItems {
id
name
}
}
Loading

0 comments on commit 29d50eb

Please sign in to comment.