Skip to content

Commit

Permalink
GH-11818 fix for quick-order feature lib
Browse files Browse the repository at this point in the history
  • Loading branch information
dydome committed Apr 13, 2021
1 parent 9e7f95f commit 5e8fece
Show file tree
Hide file tree
Showing 14 changed files with 89 additions and 56 deletions.
2 changes: 0 additions & 2 deletions feature-libs/cart/quick-order/components/list/index.ts

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion feature-libs/cart/quick-order/components/public_api.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from './list/index';
export * from './wrapper/index';
export * from './quick-order-components.module';
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { QuickOrderWrapperModule } from './wrapper/quick-order-wrapper.module';

@NgModule({
imports: [RouterModule],
imports: [RouterModule, QuickOrderWrapperModule],
})
export class QuickOrderComponentsModule {}
2 changes: 2 additions & 0 deletions feature-libs/cart/quick-order/components/wrapper/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './quick-order-wrapper.component';
export * from './quick-order-wrapper.module';
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Quick Order Wrapper Component
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { QuickOrderComponent } from './quick-order-wrapper.component';

describe('QuickOrderComponent', () => {
let component: QuickOrderComponent;
let fixture: ComponentFixture<QuickOrderComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [QuickOrderComponent],
}).compileComponents();
});

beforeEach(() => {
fixture = TestBed.createComponent(QuickOrderComponent);
component = fixture.componentInstance;
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ChangeDetectionStrategy, Component } from '@angular/core';

@Component({
selector: 'cx-quick-order-list',
templateUrl: './quick-order-list.component.html',
selector: 'cx-quick-order-wrapper',
templateUrl: './quick-order-wrapper.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class QuickOrderListComponent {}
export class QuickOrderComponent {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { CmsConfig, provideDefaultConfig } from '@spartacus/core';
import { QuickOrderComponent } from './quick-order-wrapper.component';

@NgModule({
imports: [CommonModule],
providers: [
provideDefaultConfig(<CmsConfig>{
cmsComponents: {
QuickOrderComponent: {
component: QuickOrderComponent,
},
},
}),
],
declarations: [QuickOrderComponent],
exports: [QuickOrderComponent],
entryComponents: [QuickOrderComponent],
})
export class QuickOrderWrapperModule {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { NgModule } from '@angular/core';
import {
quickOrderTranslationChunksConfig,
quickOrderTranslations,
} from '@spartacus/cart/quick-order/assets';
import { QuickOrderRootModule } from '@spartacus/cart/quick-order/root';
import { provideConfig } from '@spartacus/core';

@NgModule({
imports: [QuickOrderRootModule],
providers: [
provideConfig({
featureModules: {
cartQuickOrder: {
module: () =>
import('@spartacus/cart/quick-order').then(
(m) => m.QuickOrderModule
),
},
},
i18n: {
resources: quickOrderTranslations,
chunks: quickOrderTranslationChunksConfig,
fallbackLang: 'en',
},
}),
],
})
export class QuickOrderFeatureModule {}
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ import { CdcFeatureModule } from './features/cdc-feature.module';
import { CdsFeatureModule } from './features/cds-feature.module';
import { OrderApprovalFeatureModule } from './features/order-approval-feature.module';
import { QualtricsFeatureModule } from './features/qualtrics-feature.module';
import { QuickOrderFeatureModule } from './features/quick-order-feature.module';
import { SavedCartFeatureModule } from './features/saved-cart-feature.module';
import { SmartEditFeatureModule } from './features/smartedit-feature.module';
import { StorefinderFeatureModule } from './features/storefinder-feature.module';
Expand All @@ -88,9 +89,10 @@ const featureModules = [];
if (environment.b2b) {
featureModules.push(
AdministrationFeatureModule,
BulkPricingFeatureModule,
OrderApprovalFeatureModule,
SavedCartFeatureModule,
BulkPricingFeatureModule
QuickOrderFeatureModule,
SavedCartFeatureModule
);
}
if (environment.cdc) {
Expand Down
6 changes: 4 additions & 2 deletions projects/storefrontapp/src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ import { Environment } from './models/environment.model';

export const environment: Environment = {
production: false,
occBaseUrl: buildProcess.env.CX_BASE_URL,
occBaseUrl: 'https://spartacus-dev4.eastus.cloudapp.azure.com:9002/',
// occBaseUrl: buildProcess.env.CX_BASE_URL,
occApiPrefix: '/occ/v2/',
cds: buildProcess.env.CX_CDS ?? false,
b2b: buildProcess.env.CX_B2B ?? false,
// b2b: buildProcess.env.CX_B2B ?? false,
b2b: true,
cdc: buildProcess.env.CX_CDC ?? false,
};

0 comments on commit 5e8fece

Please sign in to comment.