mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-31 09:37:15 +01:00
Merged PR 1962: Reward Shopping Cart
Related work items: #5305, #5356, #5357, #5359
This commit is contained in:
committed by
Nino Righi
parent
9d57ebf376
commit
37840b1565
@@ -193,9 +193,24 @@ const routes: Routes = [
|
||||
children: [
|
||||
{
|
||||
path: 'reward',
|
||||
loadChildren: () =>
|
||||
import('@isa/checkout/feature/reward-catalog').then((m) => m.routes),
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
loadChildren: () =>
|
||||
import('@isa/checkout/feature/reward-catalog').then(
|
||||
(m) => m.routes,
|
||||
),
|
||||
},
|
||||
{
|
||||
path: 'cart',
|
||||
loadChildren: () =>
|
||||
import('@isa/checkout/feature/reward-shopping-cart').then(
|
||||
(m) => m.routes,
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
{
|
||||
path: 'return',
|
||||
loadChildren: () =>
|
||||
|
||||
@@ -44,9 +44,6 @@ export class PurchaseOptionsModalService {
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
|
||||
return this.#customerFacade.fetchCustomer(
|
||||
{ customerId },
|
||||
new AbortController().signal,
|
||||
);
|
||||
return this.#customerFacade.fetchCustomer({ customerId });
|
||||
}
|
||||
}
|
||||
|
||||
183
apps/isa-app/stories/shared/address/address.component.stories.ts
Normal file
183
apps/isa-app/stories/shared/address/address.component.stories.ts
Normal file
@@ -0,0 +1,183 @@
|
||||
import {
|
||||
type Meta,
|
||||
type StoryObj,
|
||||
applicationConfig,
|
||||
argsToTemplate,
|
||||
} from '@storybook/angular';
|
||||
|
||||
import { AddressComponent, Address } from '@isa/shared/address';
|
||||
import { CountryResource } from '@isa/crm/data-access';
|
||||
|
||||
const meta: Meta<AddressComponent> = {
|
||||
title: 'shared/address/AddressComponent',
|
||||
component: AddressComponent,
|
||||
decorators: [
|
||||
applicationConfig({
|
||||
providers: [
|
||||
{
|
||||
provide: CountryResource,
|
||||
useValue: {
|
||||
resource: {
|
||||
value: () => [
|
||||
{ isO3166_A_3: 'DEU', name: 'Germany' },
|
||||
{ isO3166_A_3: 'FRA', name: 'France' },
|
||||
{ isO3166_A_3: 'AUT', name: 'Austria' },
|
||||
{ isO3166_A_3: 'USA', name: 'United States' },
|
||||
{ isO3166_A_3: 'CHE', name: 'Switzerland' },
|
||||
{ isO3166_A_3: 'ITA', name: 'Italy' },
|
||||
{ isO3166_A_3: 'ESP', name: 'Spain' },
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
}),
|
||||
],
|
||||
argTypes: {
|
||||
address: {
|
||||
control: 'object',
|
||||
description: 'The address object to display',
|
||||
},
|
||||
},
|
||||
render: (args) => ({
|
||||
props: args,
|
||||
template: `<shared-address ${argsToTemplate(args)}></shared-address>`,
|
||||
}),
|
||||
};
|
||||
|
||||
export default meta;
|
||||
|
||||
type Story = StoryObj<AddressComponent>;
|
||||
|
||||
export const Default: Story = {
|
||||
args: {
|
||||
address: {
|
||||
careOf: 'John Doe',
|
||||
street: 'Hauptstraße',
|
||||
streetNumber: '42',
|
||||
apartment: 'Apt 3B',
|
||||
info: 'Building A, 3rd Floor',
|
||||
zipCode: '10115',
|
||||
city: 'Berlin',
|
||||
country: 'DEU',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const GermanAddress: Story = {
|
||||
args: {
|
||||
address: {
|
||||
street: 'Maximilianstraße',
|
||||
streetNumber: '15',
|
||||
zipCode: '80539',
|
||||
city: 'München',
|
||||
country: 'DEU',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const FrenchAddress: Story = {
|
||||
args: {
|
||||
address: {
|
||||
street: 'Rue de la Paix',
|
||||
streetNumber: '25',
|
||||
zipCode: '75002',
|
||||
city: 'Paris',
|
||||
country: 'FRA',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const AustrianAddress: Story = {
|
||||
args: {
|
||||
address: {
|
||||
street: 'Stephansplatz',
|
||||
streetNumber: '1',
|
||||
zipCode: '1010',
|
||||
city: 'Wien',
|
||||
country: 'AUT',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const SwissAddress: Story = {
|
||||
args: {
|
||||
address: {
|
||||
street: 'Bahnhofstrasse',
|
||||
streetNumber: '50',
|
||||
zipCode: '8001',
|
||||
city: 'Zürich',
|
||||
country: 'CHE',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const WithCareOf: Story = {
|
||||
args: {
|
||||
address: {
|
||||
careOf: 'Maria Schmidt',
|
||||
street: 'Berliner Straße',
|
||||
streetNumber: '100',
|
||||
zipCode: '60311',
|
||||
city: 'Frankfurt am Main',
|
||||
country: 'DEU',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const WithApartment: Story = {
|
||||
args: {
|
||||
address: {
|
||||
street: 'Lindenallee',
|
||||
streetNumber: '23',
|
||||
apartment: 'Wohnung 5A',
|
||||
zipCode: '50668',
|
||||
city: 'Köln',
|
||||
country: 'DEU',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const WithAdditionalInfo: Story = {
|
||||
args: {
|
||||
address: {
|
||||
street: 'Industriestraße',
|
||||
streetNumber: '7',
|
||||
info: 'Hintereingang, 2. Stock rechts',
|
||||
zipCode: '70565',
|
||||
city: 'Stuttgart',
|
||||
country: 'DEU',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const MinimalAddress: Story = {
|
||||
args: {
|
||||
address: {
|
||||
street: 'Dorfstraße',
|
||||
city: 'Neustadt',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const CompleteInternational: Story = {
|
||||
args: {
|
||||
address: {
|
||||
careOf: 'Jane Smith',
|
||||
street: 'Fifth Avenue',
|
||||
streetNumber: '350',
|
||||
apartment: 'Suite 2000',
|
||||
info: 'Empire State Building',
|
||||
zipCode: '10118',
|
||||
city: 'New York',
|
||||
state: 'NY',
|
||||
country: 'USA',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const EmptyAddress: Story = {
|
||||
args: {
|
||||
address: {},
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,191 @@
|
||||
import {
|
||||
type Meta,
|
||||
type StoryObj,
|
||||
applicationConfig,
|
||||
argsToTemplate,
|
||||
} from '@storybook/angular';
|
||||
|
||||
import { InlineAddressComponent, Address } from '@isa/shared/address';
|
||||
import { CountryResource } from '@isa/crm/data-access';
|
||||
|
||||
const meta: Meta<InlineAddressComponent> = {
|
||||
title: 'shared/address/InlineAddressComponent',
|
||||
component: InlineAddressComponent,
|
||||
decorators: [
|
||||
applicationConfig({
|
||||
providers: [
|
||||
{
|
||||
provide: CountryResource,
|
||||
useValue: {
|
||||
resource: {
|
||||
value: () => [
|
||||
{ isO3166_A_3: 'DEU', name: 'Germany' },
|
||||
{ isO3166_A_3: 'FRA', name: 'France' },
|
||||
{ isO3166_A_3: 'AUT', name: 'Austria' },
|
||||
{ isO3166_A_3: 'USA', name: 'United States' },
|
||||
{ isO3166_A_3: 'CHE', name: 'Switzerland' },
|
||||
{ isO3166_A_3: 'ITA', name: 'Italy' },
|
||||
{ isO3166_A_3: 'ESP', name: 'Spain' },
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
}),
|
||||
],
|
||||
argTypes: {
|
||||
address: {
|
||||
control: 'object',
|
||||
description: 'The address object to display in inline format',
|
||||
},
|
||||
},
|
||||
render: (args) => ({
|
||||
props: args,
|
||||
template: `<shared-inline-address ${argsToTemplate(args)}></shared-inline-address>`,
|
||||
}),
|
||||
};
|
||||
|
||||
export default meta;
|
||||
|
||||
type Story = StoryObj<InlineAddressComponent>;
|
||||
|
||||
export const Default: Story = {
|
||||
args: {
|
||||
address: {
|
||||
street: 'Hauptstraße',
|
||||
streetNumber: '42',
|
||||
zipCode: '10115',
|
||||
city: 'Berlin',
|
||||
country: 'DEU',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const GermanAddress: Story = {
|
||||
args: {
|
||||
address: {
|
||||
street: 'Maximilianstraße',
|
||||
streetNumber: '15',
|
||||
zipCode: '80539',
|
||||
city: 'München',
|
||||
country: 'DEU',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const FrenchAddress: Story = {
|
||||
args: {
|
||||
address: {
|
||||
street: 'Rue de la Paix',
|
||||
streetNumber: '25',
|
||||
zipCode: '75002',
|
||||
city: 'Paris',
|
||||
country: 'FRA',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const AustrianAddress: Story = {
|
||||
args: {
|
||||
address: {
|
||||
street: 'Stephansplatz',
|
||||
streetNumber: '1',
|
||||
zipCode: '1010',
|
||||
city: 'Wien',
|
||||
country: 'AUT',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const SwissAddress: Story = {
|
||||
args: {
|
||||
address: {
|
||||
street: 'Bahnhofstrasse',
|
||||
streetNumber: '50',
|
||||
zipCode: '8001',
|
||||
city: 'Zürich',
|
||||
country: 'CHE',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const USAddress: Story = {
|
||||
args: {
|
||||
address: {
|
||||
street: 'Fifth Avenue',
|
||||
streetNumber: '350',
|
||||
zipCode: '10118',
|
||||
city: 'New York',
|
||||
country: 'USA',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const ShortAddress: Story = {
|
||||
args: {
|
||||
address: {
|
||||
street: 'Dorfstraße',
|
||||
streetNumber: '5',
|
||||
city: 'Neustadt',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const StreetOnly: Story = {
|
||||
args: {
|
||||
address: {
|
||||
street: 'Hauptstraße',
|
||||
streetNumber: '10',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const CityOnly: Story = {
|
||||
args: {
|
||||
address: {
|
||||
zipCode: '12345',
|
||||
city: 'Beispielstadt',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const NoCountry: Story = {
|
||||
args: {
|
||||
address: {
|
||||
street: 'Teststraße',
|
||||
streetNumber: '99',
|
||||
zipCode: '54321',
|
||||
city: 'Musterstadt',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const WithCountryLookup: Story = {
|
||||
args: {
|
||||
address: {
|
||||
street: 'Via Roma',
|
||||
streetNumber: '10',
|
||||
zipCode: '00100',
|
||||
city: 'Roma',
|
||||
country: 'ITA',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const SpanishAddress: Story = {
|
||||
args: {
|
||||
address: {
|
||||
street: 'Calle Mayor',
|
||||
streetNumber: '1',
|
||||
zipCode: '28013',
|
||||
city: 'Madrid',
|
||||
country: 'ESP',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const EmptyAddress: Story = {
|
||||
args: {
|
||||
address: {},
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user