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
10 changes: 9 additions & 1 deletion apps/demo/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import {
DaffProductPageUrlResolver,
} from '@daffodil/product/routing';

import { provideDemoImageGalleryState } from './core/image-gallery/image-gallery-state.provider';
import { provideDemoSidebarState } from './core/sidebar/sidebar-state.provider';
import { TemplateComponent } from './core/template/template/template.component';
import { NotFoundComponent } from './misc/not-found/not-found.component';
import { ProductGridViewComponent } from './product/pages/product-grid-view/product-grid-view.component';
Expand All @@ -23,7 +25,13 @@ export const appRoutes: Routes = [
pathMatch: 'full',
},
{
path: '', component: TemplateComponent, children: [
path: '',
component: TemplateComponent,
providers: [
provideDemoSidebarState(),
provideDemoImageGalleryState(),
],
children: [
{ path: 'product-grid', component: ProductGridViewComponent },
{ path: 'cart', loadChildren: () => import('./cart/cart.module').then(m => m.DemoCartModule) },
{
Expand Down
2 changes: 0 additions & 2 deletions apps/demo/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { DemoCartRootModule } from './cart/cart-root.module';
import { DemoCheckoutStepActionTypes } from './checkout/actions/checkout-step.actions';
import { TemplateModule } from './core/template/template/template.module';
import { DemoDriverModule } from './drivers/driver.module';
import { NotFoundModule } from './misc/not-found/not-found.module';
import { ProductModule } from './product/product.module';
Expand Down Expand Up @@ -52,7 +51,6 @@ import { DemoIndicatorComponent } from './routing/indicator/indicator.component'
DemoIndicatorComponent,
DemoCartRootModule,
ProductModule,
TemplateModule,
NotFoundModule,
DaffAuthorizeNetPaymentStateModule,
DaffAuthorizeNetStateModule,
Expand Down
15 changes: 4 additions & 11 deletions apps/demo/src/app/core/footer/footer.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@ import {
TestBed,
} from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { RouterTestingModule } from '@angular/router/testing';
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';

import { DaffContainerModule } from '@daffodil/design/container';
import { DaffListModule } from '@daffodil/design/list';
import { provideRouter } from '@angular/router';

import { FooterComponent } from './footer.component';

Expand All @@ -18,14 +14,11 @@ describe('FooterComponent', () => {

beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [
imports: [
FooterComponent,
],
imports: [
RouterTestingModule,
DaffContainerModule,
DaffListModule,
FontAwesomeModule,
providers: [
provideRouter([]),
],
})
.compileComponents();
Expand Down
14 changes: 13 additions & 1 deletion apps/demo/src/app/core/footer/footer.component.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,27 @@
import { Component } from '@angular/core';
import { RouterModule } from '@angular/router';
import { FaIconComponent } from '@fortawesome/angular-fontawesome';
import {
faTwitter,
faFacebookF,
faInstagram,
} from '@fortawesome/free-brands-svg-icons';

import { DAFF_ICON_BUTTON_COMPONENTS } from '@daffodil/design/button';
import { DaffContainerComponent } from '@daffodil/design/container';
import { DAFF_LIST_COMPONENTS } from '@daffodil/design/list';

@Component({
selector: 'demo-footer',
templateUrl: './footer.component.html',
styleUrls: ['./footer.component.scss'],
standalone: false,
imports: [
RouterModule,
DAFF_LIST_COMPONENTS,
DAFF_ICON_BUTTON_COMPONENTS,
DaffContainerComponent,
FaIconComponent,
],
})
export class FooterComponent {
faTwitter = faTwitter;
Expand Down
29 changes: 0 additions & 29 deletions apps/demo/src/app/core/footer/footer.module.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import {
TestBed,
} from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { Router } from '@angular/router';
import { RouterTestingModule } from '@angular/router/testing';

import { DaffNavbarModule } from '@daffodil/design/navbar';
import {
Router,
provideRouter,
} from '@angular/router';

import { DemoHeaderComponent } from './header.component';

Expand All @@ -19,12 +19,11 @@ describe('DemoHeaderComponent', () => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [
DaffNavbarModule,
RouterTestingModule,
],
declarations: [
DemoHeaderComponent,
],
providers: [
provideRouter([]),
],
})
.compileComponents();
}));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import { Component } from '@angular/core';
import { Router } from '@angular/router';

import { DaffNavbarComponent } from '@daffodil/design/navbar';

@Component({
selector: 'demo-header',
templateUrl: './header.component.html',
styleUrls: ['./header.component.scss'],
standalone: false,
imports: [
DaffNavbarComponent,
],
})
export class DemoHeaderComponent {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import {
waitForAsync,
ComponentFixture,
TestBed,
} from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { RouterTestingModule } from '@angular/router/testing';
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
import { provideRouter } from '@angular/router';
import {
StoreModule,
Store,
} from '@ngrx/store';

import { DemoHeaderContainer } from './header.component';
import { LogoModule } from '../../../logo/logo.module';
import { ToggleSidebar } from '../../../sidebar/actions/sidebar.actions';
import * as fromSidebar from '../../../sidebar/reducers/index';
import { DemoHeaderComponent } from '../../components/header/header.component';

describe('DemoHeaderContainer', () => {
let component: DemoHeaderContainer;
Expand All @@ -28,16 +24,10 @@ describe('DemoHeaderContainer', () => {
TestBed.configureTestingModule({
imports: [
StoreModule.forRoot({}),
RouterTestingModule,
LogoModule,
FontAwesomeModule,
],
declarations: [
DemoHeaderContainer,
DemoHeaderComponent,
],
schemas: [
CUSTOM_ELEMENTS_SCHEMA,
providers: [
provideRouter([]),
],
})
.compileComponents();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,29 @@
import { Component } from '@angular/core';
import { RouterModule } from '@angular/router';
import { FaIconComponent } from '@fortawesome/angular-fontawesome';
import {
faBars,
faShoppingCart,
} from '@fortawesome/free-solid-svg-icons';
import { Store } from '@ngrx/store';

import { DaffIconButtonComponent } from '@daffodil/design/button';

import { LogoComponent } from '../../../logo/logo.component';
import { ToggleSidebar } from '../../../sidebar/actions/sidebar.actions';
import { DemoHeaderComponent } from '../../components/header/header.component';


@Component({
selector: 'demo-header-container',
templateUrl: './header.component.html',
standalone: false,
imports: [
RouterModule,
FaIconComponent,
DaffIconButtonComponent,
DemoHeaderComponent,
LogoComponent,
],
})
export class DemoHeaderContainer {
faBars = faBars;
Expand Down
33 changes: 0 additions & 33 deletions apps/demo/src/app/core/header/header.module.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ import {
MockStore,
} from '@ngrx/store/testing';

import { DAFF_IMAGE_COMPONENTS } from '@daffodil/design/image';
import { DAFF_MEDIA_GALLERY_COMPONENTS } from '@daffodil/design/media-gallery';

import { ImageGalleryComponent } from './image-gallery.component';

const stubImages = [
Expand All @@ -22,7 +19,9 @@ const stubImages = [

@Component({
template: '<demo-image-gallery-container [images]="imagesValue"></demo-image-gallery-container>',
standalone: false,
imports: [
ImageGalleryComponent,
],
})
class WrapperComponent {
imagesValue: Record<string, any>[] = stubImages;
Expand All @@ -38,12 +37,7 @@ describe('ImageGalleryComponent', () => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [
DAFF_MEDIA_GALLERY_COMPONENTS,
DAFF_IMAGE_COMPONENTS,
],
declarations: [
WrapperComponent,
ImageGalleryComponent,
],
providers: [
provideMockStore({}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import {
} from '@angular/core';
import { Store } from '@ngrx/store';

import { DaffImageComponent } from '@daffodil/design/image';
import { DAFF_MEDIA_GALLERY_COMPONENTS } from '@daffodil/design/media-gallery';

import { SetSelectedImageState } from '../actions/image-gallery.actions';
import * as fromDemoImageGallery from '../reducers/index';
Expand All @@ -14,7 +16,10 @@ import * as fromDemoImageGallery from '../reducers/index';
selector: 'demo-image-gallery-container',
templateUrl: './image-gallery.component.html',
encapsulation: ViewEncapsulation.None,
standalone: false,
imports: [
DaffImageComponent,
DAFF_MEDIA_GALLERY_COMPONENTS,
],
})
export class ImageGalleryComponent implements OnInit {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { NgModule } from '@angular/core';
import { importProvidersFrom } from '@angular/core';
import { StoreModule } from '@ngrx/store';

import { reducers } from './reducers/index';

@NgModule({
imports: [
export const provideDemoImageGalleryState = () =>
importProvidersFrom(
StoreModule.forFeature('demoImageGallery', reducers),
],
})
export class DemoImageGalleryStateModule { }
);
24 changes: 0 additions & 24 deletions apps/demo/src/app/core/image-gallery/image-gallery.module.ts

This file was deleted.

4 changes: 3 additions & 1 deletion apps/demo/src/app/core/logo/logo.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ describe('LogoComponent', () => {

beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ LogoComponent ],
imports: [
LogoComponent,
],
})
.compileComponents();
}));
Expand Down
Loading