From ab1d1b45b27c60a353e86b45abfa698de8cee8e8 Mon Sep 17 00:00:00 2001 From: pawel-twardziak Date: Fri, 15 Nov 2024 18:59:50 +0100 Subject: [PATCH] docs(example-app): remove data-example-app (#4594) Closes #4586 --- projects/data-example-app/.eslintrc.json | 41 -------- projects/data-example-app/README.md | 8 -- projects/data-example-app/jest.config.ts | 22 ----- projects/data-example-app/project.json | 93 ------------------ .../src/app/app-routing.module.ts | 19 ---- .../src/app/app.component.html | 1 - .../src/app/app.component.scss | 0 .../data-example-app/src/app/app.component.ts | 9 -- .../data-example-app/src/app/app.module.ts | 50 ---------- projects/data-example-app/src/assets/.gitkeep | 0 .../src/board/board-routing.module.ts | 15 --- .../src/board/board.component.html | 7 -- .../src/board/board.component.scss | 0 .../src/board/board.component.ts | 41 -------- .../src/board/board.module.ts | 12 --- .../src/board/ui/board-ui.component.html | 33 ------- .../src/board/ui/board-ui.component.scss | 55 ----------- .../src/board/ui/board-ui.component.ts | 49 --------- .../src/board/ui/board-ui.module.ts | 12 --- .../src/fake-backend-interceptor.service.ts | 91 ----------------- projects/data-example-app/src/favicon.ico | Bin 15086 -> 0 bytes projects/data-example-app/src/index.html | 13 --- projects/data-example-app/src/main.ts | 7 -- projects/data-example-app/src/polyfills.ts | 52 ---------- .../src/state/story-data.service.ts | 19 ---- .../src/state/story.metadata.ts | 13 --- .../src/state/story.selectors.ts | 17 ---- projects/data-example-app/src/state/story.ts | 18 ---- projects/data-example-app/src/styles.scss | 1 - projects/data-example-app/src/test-setup.ts | 15 --- projects/data-example-app/tsconfig.app.json | 16 --- projects/data-example-app/tsconfig.spec.json | 11 --- 32 files changed, 740 deletions(-) delete mode 100644 projects/data-example-app/.eslintrc.json delete mode 100644 projects/data-example-app/README.md delete mode 100644 projects/data-example-app/jest.config.ts delete mode 100644 projects/data-example-app/project.json delete mode 100644 projects/data-example-app/src/app/app-routing.module.ts delete mode 100644 projects/data-example-app/src/app/app.component.html delete mode 100644 projects/data-example-app/src/app/app.component.scss delete mode 100644 projects/data-example-app/src/app/app.component.ts delete mode 100644 projects/data-example-app/src/app/app.module.ts delete mode 100644 projects/data-example-app/src/assets/.gitkeep delete mode 100644 projects/data-example-app/src/board/board-routing.module.ts delete mode 100644 projects/data-example-app/src/board/board.component.html delete mode 100644 projects/data-example-app/src/board/board.component.scss delete mode 100644 projects/data-example-app/src/board/board.component.ts delete mode 100644 projects/data-example-app/src/board/board.module.ts delete mode 100644 projects/data-example-app/src/board/ui/board-ui.component.html delete mode 100644 projects/data-example-app/src/board/ui/board-ui.component.scss delete mode 100644 projects/data-example-app/src/board/ui/board-ui.component.ts delete mode 100644 projects/data-example-app/src/board/ui/board-ui.module.ts delete mode 100644 projects/data-example-app/src/fake-backend-interceptor.service.ts delete mode 100644 projects/data-example-app/src/favicon.ico delete mode 100644 projects/data-example-app/src/index.html delete mode 100644 projects/data-example-app/src/main.ts delete mode 100644 projects/data-example-app/src/polyfills.ts delete mode 100644 projects/data-example-app/src/state/story-data.service.ts delete mode 100644 projects/data-example-app/src/state/story.metadata.ts delete mode 100644 projects/data-example-app/src/state/story.selectors.ts delete mode 100644 projects/data-example-app/src/state/story.ts delete mode 100644 projects/data-example-app/src/styles.scss delete mode 100644 projects/data-example-app/src/test-setup.ts delete mode 100644 projects/data-example-app/tsconfig.app.json delete mode 100644 projects/data-example-app/tsconfig.spec.json diff --git a/projects/data-example-app/.eslintrc.json b/projects/data-example-app/.eslintrc.json deleted file mode 100644 index 26457c3b95..0000000000 --- a/projects/data-example-app/.eslintrc.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "extends": ["../../.eslintrc.json"], - "ignorePatterns": ["!**/*", "**/environment.prod.ts"], - "overrides": [ - { - "files": ["*.ts"], - "extends": [ - "plugin:@nx/angular", - "plugin:@angular-eslint/template/process-inline-templates" - ], - "parserOptions": { - "project": ["projects/data-example-app/tsconfig.*?.json"] - }, - "rules": { - "@angular-eslint/directive-selector": [ - "error", - { - "type": "attribute", - "prefix": "ngrx", - "style": "camelCase" - } - ], - "@angular-eslint/component-selector": [ - "error", - { - "type": "element", - "prefix": "ngrx", - "style": "kebab-case" - } - ], - "no-case-declarations": "off" - }, - "plugins": ["@angular-eslint/eslint-plugin", "@typescript-eslint"] - }, - { - "files": ["*.html"], - "extends": ["plugin:@nx/angular-template"], - "rules": {} - } - ] -} diff --git a/projects/data-example-app/README.md b/projects/data-example-app/README.md deleted file mode 100644 index a4e65a5733..0000000000 --- a/projects/data-example-app/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# Example NgRx Data App - -To serve the NgRx Data example app run `ng serve data-example-app` - -The example app will be available at `http://localhost:4200/` - -No backend is needed as the example app uses a fake backend implemented with an HTTP Interceptor (`fake-backened-interceptor.service.ts`) to -intercept requests and make the CRUD operations. diff --git a/projects/data-example-app/jest.config.ts b/projects/data-example-app/jest.config.ts deleted file mode 100644 index d9a98e1841..0000000000 --- a/projects/data-example-app/jest.config.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* eslint-disable */ -export default { - displayName: 'Data Example App', - preset: '../../jest.preset.js', - coverageDirectory: '../../coverage/projects/data-example-app', - setupFilesAfterEnv: ['/src/test-setup.ts'], - transform: { - '^.+\\.(ts|mjs|js|html)$': [ - 'jest-preset-angular', - { - tsconfig: '/tsconfig.spec.json', - stringifyContentPathRegex: '\\.(html|svg)$', - }, - ], - }, - transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'], - snapshotSerializers: [ - 'jest-preset-angular/build/serializers/no-ng-attributes', - 'jest-preset-angular/build/serializers/ng-snapshot', - 'jest-preset-angular/build/serializers/html-comment', - ], -}; diff --git a/projects/data-example-app/project.json b/projects/data-example-app/project.json deleted file mode 100644 index 3a17c50b5f..0000000000 --- a/projects/data-example-app/project.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "name": "data-example-app", - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "projectType": "application", - "generators": { - "@nx/angular:component": { - "style": "scss" - } - }, - "sourceRoot": "projects/data-example-app/src", - "prefix": "ngrx", - "targets": { - "build": { - "executor": "@angular-devkit/build-angular:browser", - "options": { - "outputPath": "dist/projects/data-example-app", - "index": "projects/data-example-app/src/index.html", - "main": "projects/data-example-app/src/main.ts", - "polyfills": "projects/data-example-app/src/polyfills.ts", - "tsConfig": "projects/data-example-app/tsconfig.app.json", - "assets": [ - "projects/data-example-app/src/favicon.ico", - "projects/data-example-app/src/assets" - ], - "styles": ["projects/data-example-app/src/styles.scss"], - "scripts": [] - }, - "configurations": { - "production": { - "budgets": [ - { - "type": "initial", - "maximumWarning": "2mb", - "maximumError": "5mb" - }, - { - "type": "anyComponentStyle", - "maximumWarning": "6kb", - "maximumError": "10kb" - } - ], - "outputHashing": "all" - }, - "development": { - "buildOptimizer": false, - "optimization": false, - "vendorChunk": true, - "extractLicenses": false, - "sourceMap": true, - "namedChunks": true - } - }, - "defaultConfiguration": "production", - "outputs": ["{options.outputPath}"] - }, - "serve": { - "executor": "@angular-devkit/build-angular:dev-server", - "configurations": { - "production": { - "buildTarget": "data-example-app:build:production" - }, - "development": { - "buildTarget": "data-example-app:build:development" - } - }, - "defaultConfiguration": "development" - }, - "extract-i18n": { - "executor": "@angular-devkit/build-angular:extract-i18n", - "options": { - "buildTarget": "data-example-app:build" - } - }, - "lint": { - "executor": "@nx/linter:eslint", - "options": { - "lintFilePatterns": [ - "projects/data-example-app/*/**/*.ts", - "projects/data-example-app/*/**/*.html" - ] - }, - "outputs": ["{options.outputFile}"] - }, - "test": { - "executor": "@nx/jest:jest", - "options": { - "jestConfig": "projects/data-example-app/jest.config.ts", - "runInBand": true - } - } - }, - "tags": [] -} diff --git a/projects/data-example-app/src/app/app-routing.module.ts b/projects/data-example-app/src/app/app-routing.module.ts deleted file mode 100644 index 77e12f220c..0000000000 --- a/projects/data-example-app/src/app/app-routing.module.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { NgModule } from '@angular/core'; -import { RouterModule } from '@angular/router'; - -@NgModule({ - imports: [ - RouterModule.forRoot( - [ - { - path: '', - loadChildren: () => - import('../board/board.module').then((m) => m.BoardModule), - }, - ], - { initialNavigation: 'enabledBlocking' } - ), - ], - exports: [RouterModule], -}) -export class AppRoutingModule {} diff --git a/projects/data-example-app/src/app/app.component.html b/projects/data-example-app/src/app/app.component.html deleted file mode 100644 index 0680b43f9c..0000000000 --- a/projects/data-example-app/src/app/app.component.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/projects/data-example-app/src/app/app.component.scss b/projects/data-example-app/src/app/app.component.scss deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/projects/data-example-app/src/app/app.component.ts b/projects/data-example-app/src/app/app.component.ts deleted file mode 100644 index a799419c32..0000000000 --- a/projects/data-example-app/src/app/app.component.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Component } from '@angular/core'; - -@Component({ - selector: 'ngrx-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.scss'], - standalone: false, -}) -export class AppComponent {} diff --git a/projects/data-example-app/src/app/app.module.ts b/projects/data-example-app/src/app/app.module.ts deleted file mode 100644 index 96d345c5ac..0000000000 --- a/projects/data-example-app/src/app/app.module.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { BrowserModule } from '@angular/platform-browser'; -import { NgModule } from '@angular/core'; - -import { AppComponent } from './app.component'; -import { AppRoutingModule } from './app-routing.module'; -import { StoreModule } from '@ngrx/store'; -import { EffectsModule } from '@ngrx/effects'; -import { EntityDataModule } from '@ngrx/data'; -import { storyEntityMetadata } from '../state/story.metadata'; -import { DragDropModule } from '@angular/cdk/drag-drop'; -import { - HTTP_INTERCEPTORS, - HttpClientJsonpModule, - HttpClientModule, -} from '@angular/common/http'; -import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { FakeBackendInterceptor } from '../fake-backend-interceptor.service'; -import { StoreDevtoolsModule } from '@ngrx/store-devtools'; - -@NgModule({ - declarations: [AppComponent], - imports: [ - BrowserModule, - AppRoutingModule, - StoreModule.forRoot({}), - EffectsModule.forRoot([]), - StoreDevtoolsModule.instrument(), - EntityDataModule.forRoot({ - entityMetadata: { - Story: storyEntityMetadata, - }, - pluralNames: { - Story: 'stories', - }, - }), - BrowserAnimationsModule, - DragDropModule, - HttpClientModule, - HttpClientJsonpModule, - ], - providers: [ - { - provide: HTTP_INTERCEPTORS, - multi: true, - useClass: FakeBackendInterceptor, - }, - ], - bootstrap: [AppComponent], -}) -export class AppModule {} diff --git a/projects/data-example-app/src/assets/.gitkeep b/projects/data-example-app/src/assets/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/projects/data-example-app/src/board/board-routing.module.ts b/projects/data-example-app/src/board/board-routing.module.ts deleted file mode 100644 index 228370d08a..0000000000 --- a/projects/data-example-app/src/board/board-routing.module.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { NgModule } from '@angular/core'; -import { RouterModule } from '@angular/router'; -import { BoardComponent } from './board.component'; - -@NgModule({ - imports: [ - RouterModule.forChild([ - { - path: '', - component: BoardComponent, - }, - ]), - ], -}) -export class BoardRoutingModule {} diff --git a/projects/data-example-app/src/board/board.component.html b/projects/data-example-app/src/board/board.component.html deleted file mode 100644 index c0c2758426..0000000000 --- a/projects/data-example-app/src/board/board.component.html +++ /dev/null @@ -1,7 +0,0 @@ - - diff --git a/projects/data-example-app/src/board/board.component.scss b/projects/data-example-app/src/board/board.component.scss deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/projects/data-example-app/src/board/board.component.ts b/projects/data-example-app/src/board/board.component.ts deleted file mode 100644 index b76e84194b..0000000000 --- a/projects/data-example-app/src/board/board.component.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { Observable } from 'rxjs'; -import { StoryDataService } from '../state/story-data.service'; -import { - CreateStoryDto, - DeleteStoryDto, - Stories, - UpdateStoryDto, -} from '../state/story'; - -@Component({ - selector: 'ngrx-board-component', - templateUrl: './board.component.html', - styleUrls: ['./board.component.scss'], - standalone: false, -}) -export class BoardComponent implements OnInit { - stories$: Observable = this.storyDataService.groupedStories$; - - constructor(private storyDataService: StoryDataService) {} - - ngOnInit(): void { - this.storyDataService.getAll(); - } - - add(story: CreateStoryDto): void { - this.storyDataService.add(story, { isOptimistic: false }); - } - - update(story: UpdateStoryDto): void { - this.storyDataService.update(story, { isOptimistic: true }); - } - - loadAll(): void { - this.storyDataService.getAll(); - } - - delete(id: DeleteStoryDto): void { - this.storyDataService.delete(id); - } -} diff --git a/projects/data-example-app/src/board/board.module.ts b/projects/data-example-app/src/board/board.module.ts deleted file mode 100644 index e665c1a8dc..0000000000 --- a/projects/data-example-app/src/board/board.module.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { BoardComponent } from './board.component'; -import { BoardUiModule } from './ui/board-ui.module'; -import { BoardRoutingModule } from './board-routing.module'; - -@NgModule({ - imports: [CommonModule, BoardUiModule, BoardRoutingModule], - declarations: [BoardComponent], - exports: [BoardComponent], -}) -export class BoardModule {} diff --git a/projects/data-example-app/src/board/ui/board-ui.component.html b/projects/data-example-app/src/board/ui/board-ui.component.html deleted file mode 100644 index 04d7dc2a9a..0000000000 --- a/projects/data-example-app/src/board/ui/board-ui.component.html +++ /dev/null @@ -1,33 +0,0 @@ -
-
-

Column {{ i }}

- - - -
-
- - - - -
-
-
-
diff --git a/projects/data-example-app/src/board/ui/board-ui.component.scss b/projects/data-example-app/src/board/ui/board-ui.component.scss deleted file mode 100644 index 2de4cc03ab..0000000000 --- a/projects/data-example-app/src/board/ui/board-ui.component.scss +++ /dev/null @@ -1,55 +0,0 @@ -.list-container { - width: 400px; - max-width: 100%; - margin: 0 25px 25px 0; - display: inline-block; - vertical-align: top; - border: black; -} - -.drag-list { - padding: 20px; - border: solid 1px #ccc; - min-height: 60px; - background: white; - border-radius: 4px; - overflow: hidden; - display: block; -} - -.drag-box { - padding: 20px 10px; - border: solid 1px #ccc; - color: rgba(0, 0, 0, 0.87); - display: flex; - flex-direction: row; - align-items: center; - justify-content: space-between; - box-sizing: border-box; - cursor: move; - background: white; - font-size: 14px; -} - -.cdk-drag-preview { - box-sizing: border-box; - border-radius: 4px; - box-shadow: 0 5px 5px -3px rgba(0, 0, 0, 0.2), - 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12); -} - -.cdk-drag-placeholder { - opacity: 0; -} - -.cdk-drag-animating { - transition: transform 250ms cubic-bezier(0, 0, 0.2, 1); -} - -.drag-box:last-child { - border: none; -} - -.drag.cdk-drop-list-dragging .drag-box:not(.cdk-drag-placeholder) { - transition: transform 250ms cubic-bezier(0, 0, 0.2, 1); -} diff --git a/projects/data-example-app/src/board/ui/board-ui.component.ts b/projects/data-example-app/src/board/ui/board-ui.component.ts deleted file mode 100644 index b4d44b34ed..0000000000 --- a/projects/data-example-app/src/board/ui/board-ui.component.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { CdkDragDrop } from '@angular/cdk/drag-drop'; -import { Component, EventEmitter, Input, Output } from '@angular/core'; -import { - CreateStoryDto, - DeleteStoryDto, - Stories, - Story, - UpdateStoryDto, -} from '../../state/story'; - -@Component({ - selector: 'ngrx-board-ui', - templateUrl: './board-ui.component.html', - styleUrls: ['./board-ui.component.scss'], - standalone: false, -}) -export class BoardUiComponent { - @Input() stories: Stories[] = []; - - @Output() add = new EventEmitter(); - - @Output() delete = new EventEmitter(); - - @Output() update = new EventEmitter(); - - addNew(column: number, stories: Stories): void { - this.add.emit({ - order: stories.length, - column, - title: `Order ${stories.length} Column ${column}`, - description: '', - }); - } - - dropStory(event: CdkDragDrop, column: number): void { - this.update.emit({ - column, - order: event.currentIndex, - storyId: event.item.data.storyId, - }); - } - - updateStory(story: Story, title: string): void { - this.update.emit({ - storyId: story.storyId, - title, - }); - } -} diff --git a/projects/data-example-app/src/board/ui/board-ui.module.ts b/projects/data-example-app/src/board/ui/board-ui.module.ts deleted file mode 100644 index 71bc809d7b..0000000000 --- a/projects/data-example-app/src/board/ui/board-ui.module.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { BoardUiComponent } from './board-ui.component'; -import { DragDropModule } from '@angular/cdk/drag-drop'; -import { FormsModule } from '@angular/forms'; - -@NgModule({ - imports: [CommonModule, DragDropModule, FormsModule], - declarations: [BoardUiComponent], - exports: [BoardUiComponent], -}) -export class BoardUiModule {} diff --git a/projects/data-example-app/src/fake-backend-interceptor.service.ts b/projects/data-example-app/src/fake-backend-interceptor.service.ts deleted file mode 100644 index b142f4a1bd..0000000000 --- a/projects/data-example-app/src/fake-backend-interceptor.service.ts +++ /dev/null @@ -1,91 +0,0 @@ -import { Injectable } from '@angular/core'; -import { - HttpErrorResponse, - HttpEvent, - HttpHandler, - HttpInterceptor, - HttpRequest, - HttpResponse, -} from '@angular/common/http'; -import { Observable, of, throwError } from 'rxjs'; -import { Story } from './state/story'; - -const data: Record = {}; - -@Injectable({ - providedIn: 'root', -}) -export class FakeBackendInterceptor implements HttpInterceptor { - intercept( - req: HttpRequest, - next: HttpHandler - ): Observable> { - const { url, body } = req; - - let storyId: string | undefined; - - if (req.method === 'GET' && req.url.includes('stories')) { - return of(new HttpResponse({ status: 200, body: Object.values(data) })); - } - - switch (req.method) { - case 'GET': - storyId = url.split('/').pop(); - - if (!storyId) { - return throwError(() => new HttpErrorResponse({ status: 400 })); - } - - const obj = data[storyId]; - if (obj) { - return of(new HttpResponse({ status: 200, body: obj })); - } - - return throwError(() => new HttpErrorResponse({ status: 404 })); - - case 'POST': - storyId = Date.now().toString(); - data[storyId] = { - ...body, - storyId, - createdAt: new Date(), - updatedAt: new Date(), - }; - - return of(new HttpResponse({ status: 201, body: data[storyId] })); - - case 'PUT': - storyId = url.split('/').pop(); - - if (!storyId) { - return throwError(() => new HttpErrorResponse({ status: 400 })); - } - - if (!data[storyId]) { - return throwError(() => new HttpErrorResponse({ status: 404 })); - } - - data[storyId] = { - ...data[storyId], - ...body, - updatedAt: new Date(), - }; - - return of(new HttpResponse({ status: 200, body: data[storyId] })); - - case 'DELETE': - storyId = url.split('/').pop(); - - if (!storyId) { - return throwError(() => new HttpErrorResponse({ status: 400 })); - } - - delete data[storyId]; - - return of(new HttpResponse({ status: 200, body: storyId })); - - default: - return throwError(() => new HttpErrorResponse({ status: 501 })); - } - } -} diff --git a/projects/data-example-app/src/favicon.ico b/projects/data-example-app/src/favicon.ico deleted file mode 100644 index 317ebcb2336e0833a22dddf0ab287849f26fda57..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15086 zcmeI332;U^%p|z7g|#(P)qFEA@4f!_@qOK2 z_lJl}!lhL!VT_U|uN7%8B2iKH??xhDa;*`g{yjTFWHvXn;2s{4R7kH|pKGdy(7z!K zgftM+Ku7~24TLlh(!g)gz|foI94G^t2^IO$uvX$3(OR0<_5L2sB)lMAMy|+`xodJ{ z_Uh_1m)~h?a;2W{dmhM;u!YGo=)OdmId_B<%^V^{ovI@y`7^g1_V9G}*f# zNzAtvou}I!W1#{M^@ROc(BZ! z+F!!_aR&Px3_reO(EW+TwlW~tv*2zr?iP7(d~a~yA|@*a89IUke+c472NXM0wiX{- zl`UrZC^1XYyf%1u)-Y)jj9;MZ!SLfd2Hl?o|80Su%Z?To_=^g_Jt0oa#CT*tjx>BI z16wec&AOWNK<#i0Qd=1O$fymLRoUR*%;h@*@v7}wApDl^w*h}!sYq%kw+DKDY)@&A z@9$ULEB3qkR#85`lb8#WZw=@})#kQig9oqy^I$dj&k4jU&^2(M3q{n1AKeGUKPFbr z1^<)aH;VsG@J|B&l>UtU#Ejv3GIqERzYgL@UOAWtW<{p#zy`WyJgpCy8$c_e%wYJL zyGHRRx38)HyjU3y{-4z6)pzb>&Q1pR)B&u01F-|&Gx4EZWK$nkUkOI|(D4UHOXg_- zw{OBf!oWQUn)Pe(=f=nt=zkmdjpO^o8ZZ9o_|4tW1ni+Un9iCW47*-ut$KQOww!;u z`0q)$s6IZO!~9$e_P9X!hqLxu`fpcL|2f^I5d4*a@Dq28;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ampleApp - - - - - - - - diff --git a/projects/data-example-app/src/main.ts b/projects/data-example-app/src/main.ts deleted file mode 100644 index 17a5cd4e0a..0000000000 --- a/projects/data-example-app/src/main.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; - -import { AppModule } from './app/app.module'; - -platformBrowserDynamic() - .bootstrapModule(AppModule) - .catch((err) => console.error(err)); diff --git a/projects/data-example-app/src/polyfills.ts b/projects/data-example-app/src/polyfills.ts deleted file mode 100644 index 4efb94c71b..0000000000 --- a/projects/data-example-app/src/polyfills.ts +++ /dev/null @@ -1,52 +0,0 @@ -/** - * This file includes polyfills needed by Angular and is loaded before the app. - * You can add your own extra polyfills to this file. - * - * This file is divided into 2 sections: - * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. - * 2. Application imports. Files imported after ZoneJS that should be loaded before your main - * file. - * - * The current setup is for so-called "evergreen" browsers; the last versions of browsers that - * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), - * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. - * - * Learn more in https://angular.io/guide/browser-support - */ - -/*************************************************************************************************** - * BROWSER POLYFILLS - */ - -/** - * By default, zone.js will patch all possible macroTask and DomEvents - * user can disable parts of macroTask/DomEvents patch by setting following flags - * because those flags need to be set before `zone.js` being loaded, and webpack - * will put import in the top of bundle, so user need to create a separate file - * in this directory (for example: zone-flags.ts), and put the following flags - * into that file, and then add the following code before importing zone.js. - * import './zone-flags'; - * - * The flags allowed in zone-flags.ts are listed here. - * - * The following flags will work for all browsers. - * - * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame - * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick - * (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames - * - * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js - * with the following flag, it will bypass `zone.js` patch for IE/Edge - * - * (window as any).__Zone_enable_cross_context_check = true; - * - */ - -/*************************************************************************************************** - * Zone JS is required by default for Angular itself. - */ -import 'zone.js'; // Included with Angular CLI. - -/*************************************************************************************************** - * APPLICATION IMPORTS - */ diff --git a/projects/data-example-app/src/state/story-data.service.ts b/projects/data-example-app/src/state/story-data.service.ts deleted file mode 100644 index b73a1f0a01..0000000000 --- a/projects/data-example-app/src/state/story-data.service.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { - EntityCollectionServiceBase, - EntityCollectionServiceElementsFactory, -} from '@ngrx/data'; -import { select } from '@ngrx/store'; -import { Injectable } from '@angular/core'; -import { selectStories } from './story.selectors'; -import { Story } from './story'; - -@Injectable({ - providedIn: 'root', -}) -export class StoryDataService extends EntityCollectionServiceBase { - groupedStories$ = this.entities$.pipe(select(selectStories)); - - constructor(serviceElementsFactory: EntityCollectionServiceElementsFactory) { - super('Story', serviceElementsFactory); - } -} diff --git a/projects/data-example-app/src/state/story.metadata.ts b/projects/data-example-app/src/state/story.metadata.ts deleted file mode 100644 index 8969f79214..0000000000 --- a/projects/data-example-app/src/state/story.metadata.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { EntityMetadata } from '@ngrx/data'; -import { Story } from './story'; - -export const storyEntityMetadata: EntityMetadata = { - entityName: 'Story', - selectId: (entity: Story): string => entity.storyId, - sortComparer: (a, b) => a.createdAt.getTime() - b.createdAt.getTime(), - filterFn: (entities, pattern) => - entities.filter( - (entity) => - entity.title?.includes(pattern) || entity.title?.includes(pattern) - ), -}; diff --git a/projects/data-example-app/src/state/story.selectors.ts b/projects/data-example-app/src/state/story.selectors.ts deleted file mode 100644 index 407a1587ba..0000000000 --- a/projects/data-example-app/src/state/story.selectors.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { createSelector } from '@ngrx/store'; -import { Stories, Story } from './story'; - -export const selectStories = createSelector( - (stories) => stories, - (stories: Stories) => - stories.reduce( - (prev, cur) => { - prev[cur.column].push(cur); - - prev[cur.column].sort((a, b) => a.order - b.order); - - return prev; - }, - [[], [], [], []] - ) -); diff --git a/projects/data-example-app/src/state/story.ts b/projects/data-example-app/src/state/story.ts deleted file mode 100644 index 502e51e584..0000000000 --- a/projects/data-example-app/src/state/story.ts +++ /dev/null @@ -1,18 +0,0 @@ -export interface Story { - storyId: string; - order: number; - column: number; - title: string; - description: string; - createdAt: Date; - updatedAt: Date; -} - -export type Stories = Story[]; - -export type CreateStoryDto = Partial; - -export type UpdateStoryDto = Required> & - Partial>; - -export type DeleteStoryDto = string; diff --git a/projects/data-example-app/src/styles.scss b/projects/data-example-app/src/styles.scss deleted file mode 100644 index 90d4ee0072..0000000000 --- a/projects/data-example-app/src/styles.scss +++ /dev/null @@ -1 +0,0 @@ -/* You can add global styles to this file, and also import other style files */ diff --git a/projects/data-example-app/src/test-setup.ts b/projects/data-example-app/src/test-setup.ts deleted file mode 100644 index e76c4ae5fa..0000000000 --- a/projects/data-example-app/src/test-setup.ts +++ /dev/null @@ -1,15 +0,0 @@ -import 'jest-preset-angular/setup-jest'; -(global as any)['CSS'] = null; - -/** - * ISSUE: https://github.com/angular/material2/issues/7101 - * Workaround for JSDOM missing transform property - */ -Object.defineProperty(document.body.style, 'transform', { - value: () => { - return { - enumerable: true, - configurable: true, - }; - }, -}); diff --git a/projects/data-example-app/tsconfig.app.json b/projects/data-example-app/tsconfig.app.json deleted file mode 100644 index c7ca81167c..0000000000 --- a/projects/data-example-app/tsconfig.app.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "../../dist/out-tsc", - "module": "commonjs", - "types": [] - }, - "angularCompilerOptions": { - "strictTemplates": true, - "strictInjectionParameters": true, - "strictInputAccessModifiers": true - }, - "files": ["src/main.ts", "src/polyfills.ts"], - "include": ["src/**/*.d.ts"], - "exclude": ["**/*.spec.ts", "**/*.test.ts"] -} diff --git a/projects/data-example-app/tsconfig.spec.json b/projects/data-example-app/tsconfig.spec.json deleted file mode 100644 index a8749b2d1d..0000000000 --- a/projects/data-example-app/tsconfig.spec.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "../../dist/out-tsc", - "module": "commonjs", - "types": ["jest", "node"], - "target": "es2016" - }, - "files": ["src/test-setup.ts"], - "include": ["jest.config.ts", "**/*.spec.ts", "**/*.test.ts", "**/*.d.ts"] -}