diff --git a/angular.json b/angular.json index 78eda97..fbeae8e 100644 --- a/angular.json +++ b/angular.json @@ -20,7 +20,8 @@ "tsConfig": "src/tsconfig.app.json", "assets": [ "src/favicon.ico", - "src/assets" + "src/assets", + "src/configuration.json" ], "styles": [ "src/styles.css" @@ -131,41 +132,6 @@ } } }, - "material": { - "root": "projects/material", - "sourceRoot": "projects/material/src", - "projectType": "library", - "prefix": "farmmaps", - "architect": { - "build": { - "builder": "@angular-devkit/build-ng-packagr:build", - "options": { - "tsConfig": "projects/material/tsconfig.lib.json", - "project": "projects/material/ng-package.json" - } - }, - "test": { - "builder": "@angular-devkit/build-angular:karma", - "options": { - "main": "projects/material/src/test.ts", - "tsConfig": "projects/material/tsconfig.spec.json", - "karmaConfig": "projects/material/karma.conf.js" - } - }, - "lint": { - "builder": "@angular-devkit/build-angular:tslint", - "options": { - "tsConfig": [ - "projects/material/tsconfig.lib.json", - "projects/material/tsconfig.spec.json" - ], - "exclude": [ - "**/node_modules/**" - ] - } - } - } - }, "common": { "root": "projects/common", "sourceRoot": "projects/common/src", diff --git a/package-lock.json b/package-lock.json index 5741082..62f4b8b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -645,9 +645,33 @@ "@farmmaps/common": { "version": "file:dist/common", "requires": { + "angular-oauth2-oidc": "^5.0.2", "tslib": "^1.9.0" } }, + "@ng-bootstrap/ng-bootstrap": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@ng-bootstrap/ng-bootstrap/-/ng-bootstrap-4.2.1.tgz", + "integrity": "sha512-7etP9X9jKIkbuDzU3ngI2jQhHQDZxIu0ErvlkHb7u7YH9akIOLVkXvz2mTMvcFABWZhze64UjFuEgR46b6WGSw==", + "requires": { + "tslib": "^1.9.0" + } + }, + "@ngrx/effects": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@ngrx/effects/-/effects-7.2.0.tgz", + "integrity": "sha512-vymKSoubYlUWGbiclPK0N/LwB409sB9atjSTQRy2EisZfFtQ2tCDqmk4JGgDy/gV9SqZWrwPSy1xXsLqYnyN3g==" + }, + "@ngrx/router-store": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@ngrx/router-store/-/router-store-7.2.0.tgz", + "integrity": "sha512-deXDZg4FffuqxlFXqAaR8+lEy4yCJgTmKn2avKHltF3GP+8bxIRiD6GDCYjYJVhLFiBK8U3AFhgfoEuUUpFCag==" + }, + "@ngrx/store": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@ngrx/store/-/store-7.2.0.tgz", + "integrity": "sha512-E9c0cDot0HeE0mXyeqw18SwmJ2+eKnA5mMMfwvoskpMInCYGI2pq1i6/lCVQ2wrEHSH+KvObK4PQbepcA9vP+w==" + }, "@ngtools/json-schema": { "version": "1.1.0", "resolved": "https://repository.akkerweb.nl/repository/npm-group/@ngtools/json-schema/-/json-schema-1.1.0.tgz", @@ -1054,6 +1078,15 @@ "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", "dev": true }, + "angular-oauth2-oidc": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/angular-oauth2-oidc/-/angular-oauth2-oidc-5.0.2.tgz", + "integrity": "sha512-jtOv4IWEjSFfBHVE4seWGWT/ZfWJ95QJ1JaFhVVGJEF64ibGuPwV3ztwTOUl98QHi/Yg4PXXDAisb31JnIbxBw==", + "requires": { + "jsrsasign": "^8.0.12", + "tslib": "^1.9.0" + } + }, "ansi-align": { "version": "2.0.0", "resolved": "https://repository.akkerweb.nl/repository/npm-group/ansi-align/-/ansi-align-2.0.0.tgz", @@ -5852,6 +5885,11 @@ "verror": "1.10.0" } }, + "jsrsasign": { + "version": "8.0.12", + "resolved": "https://registry.npmjs.org/jsrsasign/-/jsrsasign-8.0.12.tgz", + "integrity": "sha1-Iqu5ZW00owuVMENnIINeicLlwxY=" + }, "jszip": { "version": "3.2.1", "resolved": "https://repository.akkerweb.nl/repository/npm-group/jszip/-/jszip-3.2.1.tgz", @@ -8496,6 +8534,11 @@ "signal-exit": "^3.0.2" } }, + "resumablejs": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/resumablejs/-/resumablejs-1.1.0.tgz", + "integrity": "sha512-gUTWTtJ2aheRb5svHDGHMtQsBkGxTILpZApT11ODoxEe5D75GhYL7Nc/WYgCcJXY+5RVmm2BEsp2qriCkKWRRg==" + }, "ret": { "version": "0.1.15", "resolved": "https://repository.akkerweb.nl/repository/npm-group/ret/-/ret-0.1.15.tgz", diff --git a/package.json b/package.json index ce7b768..838bba4 100644 --- a/package.json +++ b/package.json @@ -21,9 +21,14 @@ "@angular/router": "~7.2.0", "@aspnet/signalr": "^1.1.4", "@farmmaps/common": "file:dist/common", + "@ng-bootstrap/ng-bootstrap": "^4.2.1", + "@ngrx/effects": "^7.2.0", + "@ngrx/router-store": "^7.2.0", + "@ngrx/store": "^7.2.0", "bootstrap": "^4.3.1", "core-js": "^2.5.4", "material": "file:dist/material", + "resumablejs": "^1.1.0", "rxjs": "~6.3.3", "tassign": "^1.0.0", "tslib": "^1.9.0", diff --git a/projects/common/package.json b/projects/common/package.json index acc1daf..95f4892 100644 --- a/projects/common/package.json +++ b/projects/common/package.json @@ -1,8 +1,12 @@ { "name": "@farmmaps/common", "version": "0.0.1", + "publishConfig":{ + "registry":"https://repository.akkerweb.nl/repository/npm-hosted/" + }, "dependencies": { - "angular-oauth2-oidc": "^5.0.2" + "angular-oauth2-oidc": "^5.0.2", + "resumablejs": "1.1.0" }, "peerDependencies": { "@ng-bootstrap/ng-bootstrap": "^4.2.1", diff --git a/projects/common/src/lib/components/resumable-file-upload/resumable.js b/projects/common/src/assets/resumable.js similarity index 100% rename from projects/common/src/lib/components/resumable-file-upload/resumable.js rename to projects/common/src/assets/resumable.js diff --git a/projects/common/src/lib/common.module.ts b/projects/common/src/lib/common.module.ts index 6ebcad4..9e30423 100644 --- a/projects/common/src/lib/common.module.ts +++ b/projects/common/src/lib/common.module.ts @@ -42,6 +42,29 @@ import { SidePanelComponent } from './components/side-panel/side-panel.component import { TimespanComponent } from './components/timespan/timespan.component'; import { TagInputComponent } from './components/tag-input/tag-input.component'; +export {FolderService, + TimespanService, + ItemService, + EventService, + TypeaheadService, + UserService, + AppConfig, + AccessTokenInterceptor, + AuthGuard, + NavBarGuard, + FullScreenGuard, + SafePipe, + AuthCallbackComponent, + AuthCallbackGuard, + SessionClearedComponent, + ResumableFileUploadService, + ResumableFileUploadComponent, + NotFoundComponent, + SidePanelComponent, + TimespanComponent, + TagInputComponent +}; + @NgModule({ imports: [ CommonModule, diff --git a/projects/common/src/lib/components/resumable-file-upload/resumable.d.ts b/projects/common/src/lib/components/resumable-file-upload/resumable.d.ts deleted file mode 100644 index 6d6965d..0000000 --- a/projects/common/src/lib/components/resumable-file-upload/resumable.d.ts +++ /dev/null @@ -1,370 +0,0 @@ -// Type definitions for Resumable.js -// Project: https://github.com/23/resumable.js -// Definitions by: Bazyli Brzóska -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare module Resumable { - export interface ConfigurationHash { - /** - * The target URL for the multipart POST request. This can be a string or a function that allows you you to construct and return a value, based on supplied params. (Default: /) - **/ - target?: string; - /** - * The size in bytes of each uploaded chunk of data. The last uploaded chunk will be at least this size and up to two the size, see Issue #51 for details and reasons. (Default: 1*1024*1024) - **/ - chunkSize?: number; - /** - * Force all chunks to be less or equal than chunkSize. Otherwise, the last chunk will be greater than or equal to chunkSize. (Default: false) - **/ - forceChunkSize?: boolean; - /** - * Number of simultaneous uploads (Default: 3) - **/ - simultaneousUploads?: number; - /** - * The name of the multipart POST parameter to use for the file chunk (Default: file) - **/ - fileParameterName?: string; - /** - * The name of the chunk index (base-1) in the current upload POST parameter to use for the file chunk (Default: resumableChunkNumber) - */ - chunkNumberParameterName?: string; - /** - * The name of the total number of chunks POST parameter to use for the file chunk (Default: resumableTotalChunks) - */ - totalChunksParameterName?: string; - /** - * The name of the general chunk size POST parameter to use for the file chunk (Default: resumableChunkSize) - */ - chunkSizeParameterName?: string; - /** - * The name of the total file size number POST parameter to use for the file chunk (Default: resumableTotalSize) - */ - totalSizeParameterName?: string; - /** - * The name of the unique identifier POST parameter to use for the file chunk (Default: resumableIdentifier) - */ - identifierParameterName?: string; - /** - * The name of the original file name POST parameter to use for the file chunk (Default: resumableFilename) - */ - fileNameParameterName?: string; - /** - * The name of the file's relative path POST parameter to use for the file chunk (Default: resumableRelativePath) - */ - relativePathParameterName?: string; - /** - * The name of the current chunk size POST parameter to use for the file chunk (Default: resumableCurrentChunkSize) - */ - currentChunkSizeParameterName?: string; - /** - * The name of the file type POST parameter to use for the file chunk (Default: resumableType) - */ - typeParameterName?: string; - /** - * Extra parameters to include in the multipart POST with data. This can be an object or a function. If a function, it will be passed a ResumableFile and a ResumableChunk object (Default: {}) - **/ - query?: Object; - /** - * Method for chunk test request. (Default: 'GET') - **/ - testMethod?: 'GET'|'POST'|'OPTIONS'|'PUT'|'DELETE'; - /** - * Method for chunk upload request. (Default: 'POST') - **/ - uploadMethod?: 'GET'|'POST'|'OPTIONS'|'PUT'|'DELETE'; - /** - * Extra prefix added before the name of each parameter included in the multipart POST or in the test GET. (Default: '') - **/ - parameterNamespace?: string; - /** - * Extra headers to include in the multipart POST with data. This can be an object or a function that allows you to construct and return a value, based on supplied file (Default: {}) - **/ - headers?: Object | ((file) => Object); - /** - * Method to use when POSTing chunks to the server (multipart or octet) (Default: multipart) - **/ - method?: 'multipart' | 'octet'; - /** - * Prioritize first and last chunks of all files. This can be handy if you can determine if a file is valid for your service from only the first or last chunk. For example, photo or video meta data is usually located in the first part of a file, making it easy to test support from only the first chunk. (Default: false) - **/ - prioritizeFirstAndLastChunk?: boolean; - /** - * Make a GET request to the server for each chunks to see if it already exists. If implemented on the server-side, this will allow for upload resumes even after a browser crash or even a computer restart. (Default: true) - **/ - testChunks?: boolean; - /** - * Optional function to process each chunk before testing & sending. Function is passed the chunk as parameter, and should call the preprocessFinished method on the chunk when finished. (Default: null) - **/ - preprocess?: (chunk:ResumableChunk) => ResumableChunk; - /** - * Override the function that generates unique identifiers for each file. (Default: null) - **/ - generateUniqueIdentifier?: () => string; - /** - * Indicates how many files can be uploaded in a single session. Valid values are any positive integer and undefined for no limit. (Default: undefined) - **/ - maxFiles?: number; - /** - * A function which displays the please upload n file(s) at a time message. (Default: displays an alert box with the message Please n one file(s) at a time.) - **/ - maxFilesErrorCallback?: (files, errorCount) => void; - /** - * The minimum allowed file size. (Default: undefined) - **/ - minFileSize?: boolean; - /** - * A function which displays an error a selected file is smaller than allowed. (Default: displays an alert for every bad file.) - **/ - minFileSizeErrorCallback?:(file, errorCount) => void; - /** - * The maximum allowed file size. (Default: undefined) - **/ - maxFileSize?: boolean; - /** - * A function which displays an error a selected file is larger than allowed. (Default: displays an alert for every bad file.) - **/ - maxFileSizeErrorCallback?: (file, errorCount) => void; - /** - * The file types allowed to upload. An empty array allow any file type. (Default: []) - **/ - fileType?: Array; - /** - * A function which displays an error a selected file has type not allowed. (Default: displays an alert for every bad file.) - **/ - fileTypeErrorCallback?: (file, errorCount) => void; - /** - * The maximum number of retries for a chunk before the upload is failed. Valid values are any positive integer and undefined for no limit. (Default: undefined) - **/ - maxChunkRetries?: number; - /** - * The number of milliseconds to wait before retrying a chunk on a non-permanent error. Valid values are any positive integer and undefined for immediate retry. (Default: undefined) - **/ - chunkRetryInterval?: number; - /** - * Standard CORS requests do not send or set any cookies by default. In order to include cookies as part of the request, you need to set the withCredentials property to true. (Default: false) - **/ - withCredentials?: boolean; - /** - * setChunkTypeFromFile` Set chunk content-type from original file.type. (Default: false, if false default Content-Type: application/octet-stream) - **/ - setChunkTypeFromFile?: boolean; - } - - export class Resumable { - constructor(options:ConfigurationHash); - - /** - * A boolean value indicator whether or not Resumable.js is supported by the current browser. - **/ - support: boolean; - /** - * A hash object of the configuration of the Resumable.js instance. - **/ - opts: ConfigurationHash; - /** - * An array of ResumableFile file objects added by the user (see full docs for this object type below). - **/ - files: Array; - - events: Array; - version: number; - - /** - * Assign a browse action to one or more DOM nodes. Pass in true to allow directories to be selected (Chrome only). - **/ - assignBrowse(domNode: Element, isDirectory: boolean): void; - assignBrowse(domNodes: Array, isDirectory: boolean): void; - /** - * Assign one or more DOM nodes as a drop target. - **/ - assignDrop(domNode: Element): void; - assignDrop(domNodes: Array): void; - unAssignDrop(domNode: Element): void; - unAssignDrop(domNodes: Array): void; - /** - * Start or resume uploading. - **/ - upload(): void; - uploadNextChunk(): void; - /** - * Pause uploading. - **/ - pause(): void; - /** - * Cancel upload of all ResumableFile objects and remove them from the list. - **/ - cancel(): void; - fire(): void; - /** - * Returns a float between 0 and 1 indicating the current upload progress of all files. - **/ - progress(): number; - /** - * Returns a boolean indicating whether or not the instance is currently uploading anything. - **/ - isUploading(): boolean; - /** - * Add a HTML5 File object to the list of files. - **/ - addFile(file: File): void; - /** - * Add an Array of HTML5 File objects to the list of files. - **/ - addFiles(files: Array): void; - /** - * Cancel upload of a specific ResumableFile object on the list from the list. - **/ - removeFile(file: ResumableFile): void; - /** - * Look up a ResumableFile object by its unique identifier. - **/ - getFromUniqueIdentifier(uniqueIdentifier: string): void; - /** - * Returns the total size of the upload in bytes. - **/ - getSize(): void; - getOpt(o: string): any; - - // Events - /** - * Listen for event from Resumable.js (see below) - **/ - on(event: string, callback: Function): void; - /** - * A specific file was completed. - **/ - on(event: 'fileSuccess', callback: (file: ResumableFile) => void); void; - /** - * Uploading progressed for a specific file. - **/ - on(event: 'fileProgress', callback: (file: ResumableFile) => void): void; - /** - * A new file was added. Optionally, you can use the browser event object from when the file was added. - **/ - on(event: 'fileAdded', callback: (file: ResumableFile, event: DragEvent) => void): void; - /** - * New files were added. - **/ - on(event: 'filesAdded', callback: (files: Array) => void): void; - /** - * Something went wrong during upload of a specific file, uploading is being retried. - **/ - on(event: 'fileRetry', callback: (file: ResumableFile) => void): void; - /** - * An error occurred during upload of a specific file. - **/ - on(event: 'fileError', callback: (file: ResumableFile, message: string) => void): void; - /** - * Upload has been started on the Resumable object. - **/ - on(event: 'uploadStart', callback: () => void): void; - /** - * Uploading completed. - **/ - on(event: 'complete', callback: () => void): void; - /** - * Uploading progress. - **/ - on(event: 'progress', callback: () => void): void; - /** - * An error, including fileError, occurred. - **/ - on(event: 'error', callback: (message: string, file: ResumableFile) => void): void; - /** - * Uploading was paused. - **/ - on(event: 'pause', callback: () => void): void; - /** - * Triggers before the items are cancelled allowing to do any processing on uploading files. - **/ - on(event: 'beforeCancel', callback: () => void): void; - /** - * Uploading was canceled. - **/ - on(event: 'cancel', callback: () => void): void; - /** - * Started preparing file for upload - **/ - on(event: 'chunkingStart', callback: (file: ResumableFile) => void): void; - /** - * Show progress in file preparation - **/ - on(event: 'chunkingProgress', callback: (file: ResumableFile, ratio) => void): void; - /** - * File is ready for upload - **/ - on(event: 'chunkingComplete', callback: (file: ResumableFile) => void): void; - /** - * Listen to all the events listed above with the same callback function. - **/ - on(event: 'catchAll', callback: () => void); - } - - export interface ResumableFile { - /** - * A back-reference to the parent Resumable object. - **/ - resumableObj: Resumable; - /** - * The correlating HTML5 File object. - **/ - file: File; - /** - * The name of the file. - **/ - fileName: string; - /** - * The relative path to the file (defaults to file name if relative path doesn't exist) - **/ - relativePath: string; - /** - * Size in bytes of the file. - **/ - size: number; - /** - * A unique identifier assigned to this file object. This value is included in uploads to the server for reference, but can also be used in CSS classes etc when building your upload UI. - **/ - uniqueIdentifier: string; - /** - * An array of ResumableChunk items. You shouldn't need to dig into these. - **/ - chunks: Array; - - - /** - * Returns a float between 0 and 1 indicating the current upload progress of the file. If relative is true, the value is returned relative to all files in the Resumable.js instance. - **/ - progress: (relative: boolean) => number; - /** - * Abort uploading the file. - **/ - abort: () => void; - /** - * Abort uploading the file and delete it from the list of files to upload. - **/ - cancel: () => void; - /** - * Retry uploading the file. - **/ - retry: () => void; - /** - * Rebuild the state of a ResumableFile object, including reassigning chunks and XMLHttpRequest instances. - **/ - bootstrap: () => void; - /** - * Returns a boolean indicating whether file chunks is uploading. - **/ - isUploading: () => boolean; - /** - * Returns a boolean indicating whether the file has completed uploading and received a server response. - **/ - isComplete: () => boolean; - } - - class ResumableChunk {} -} - -declare module 'resumablejs' { - export = Resumable.Resumable; -} diff --git a/projects/common/tsconfig.lib.json b/projects/common/tsconfig.lib.json index de024ef..7d312cd 100644 --- a/projects/common/tsconfig.lib.json +++ b/projects/common/tsconfig.lib.json @@ -30,7 +30,7 @@ "strictMetadataEmit": true, "fullTemplateTypeCheck": true, "strictInjectionParameters": true, - "enableResourceInlining": true + "enableResourceInlining": true }, "exclude": [ "src/test.ts", diff --git a/projects/material/README.md b/projects/material/README.md deleted file mode 100644 index 9d53f24..0000000 --- a/projects/material/README.md +++ /dev/null @@ -1,24 +0,0 @@ -# Material - -This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 7.2.0. - -## Code scaffolding - -Run `ng generate component component-name --project material` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project material`. -> Note: Don't forget to add `--project material` or else it will be added to the default project in your `angular.json` file. - -## Build - -Run `ng build material` to build the project. The build artifacts will be stored in the `dist/` directory. - -## Publishing - -After building your library with `ng build material`, go to the dist folder `cd dist/material` and run `npm publish`. - -## Running unit tests - -Run `ng test material` to execute the unit tests via [Karma](https://karma-runner.github.io). - -## Further help - -To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). diff --git a/projects/material/karma.conf.js b/projects/material/karma.conf.js deleted file mode 100644 index cda7929..0000000 --- a/projects/material/karma.conf.js +++ /dev/null @@ -1,32 +0,0 @@ -// Karma configuration file, see link for more information -// https://karma-runner.github.io/1.0/config/configuration-file.html - -module.exports = function (config) { - config.set({ - basePath: '', - frameworks: ['jasmine', '@angular-devkit/build-angular'], - plugins: [ - require('karma-jasmine'), - require('karma-chrome-launcher'), - require('karma-jasmine-html-reporter'), - require('karma-coverage-istanbul-reporter'), - require('@angular-devkit/build-angular/plugins/karma') - ], - client: { - clearContext: false // leave Jasmine Spec Runner output visible in browser - }, - coverageIstanbulReporter: { - dir: require('path').join(__dirname, '../../coverage/material'), - reports: ['html', 'lcovonly'], - fixWebpackSourcePaths: true - }, - reporters: ['progress', 'kjhtml'], - port: 9876, - colors: true, - logLevel: config.LOG_INFO, - autoWatch: true, - browsers: ['Chrome'], - singleRun: false, - restartOnFileChange: true - }); -}; diff --git a/projects/material/ng-package.json b/projects/material/ng-package.json deleted file mode 100644 index d7e2240..0000000 --- a/projects/material/ng-package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "$schema": "../../node_modules/ng-packagr/ng-package.schema.json", - "dest": "../../dist/material", - "lib": { - "entryFile": "src/public-api.ts" - } -} \ No newline at end of file diff --git a/projects/material/package-lock.json b/projects/material/package-lock.json deleted file mode 100644 index 6a234c4..0000000 --- a/projects/material/package-lock.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "material", - "version": "0.0.1", - "lockfileVersion": 1 -} diff --git a/projects/material/package.json b/projects/material/package.json deleted file mode 100644 index 8b74a3b..0000000 --- a/projects/material/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "material", - "version": "0.0.1", - "peerDependencies": { - "@angular/common": "^7.2.0", - "@angular/core": "^7.2.0" - } -} diff --git a/projects/material/src/lib/cropfield-selector/cropfield-selector.component.css b/projects/material/src/lib/cropfield-selector/cropfield-selector.component.css deleted file mode 100644 index e69de29..0000000 diff --git a/projects/material/src/lib/cropfield-selector/cropfield-selector.component.html b/projects/material/src/lib/cropfield-selector/cropfield-selector.component.html deleted file mode 100644 index adbc828..0000000 --- a/projects/material/src/lib/cropfield-selector/cropfield-selector.component.html +++ /dev/null @@ -1,3 +0,0 @@ -

- cropfield-selector works! -

diff --git a/projects/material/src/lib/cropfield-selector/cropfield-selector.component.spec.ts b/projects/material/src/lib/cropfield-selector/cropfield-selector.component.spec.ts deleted file mode 100644 index 464332d..0000000 --- a/projects/material/src/lib/cropfield-selector/cropfield-selector.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { CropfieldSelectorComponent } from './cropfield-selector.component'; - -describe('CropfieldSelectorComponent', () => { - let component: CropfieldSelectorComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ CropfieldSelectorComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(CropfieldSelectorComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/projects/material/src/lib/cropfield-selector/cropfield-selector.component.ts b/projects/material/src/lib/cropfield-selector/cropfield-selector.component.ts deleted file mode 100644 index 71ff8ff..0000000 --- a/projects/material/src/lib/cropfield-selector/cropfield-selector.component.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Component, OnInit } from '@angular/core'; - -@Component({ - selector: 'farmmaps-cropfield-selector', - templateUrl: './cropfield-selector.component.html', - styleUrls: ['./cropfield-selector.component.css'] -}) -export class CropfieldSelectorComponent implements OnInit { - - constructor() { } - - ngOnInit() { - } - -} diff --git a/projects/material/src/lib/material.component.spec.ts b/projects/material/src/lib/material.component.spec.ts deleted file mode 100644 index 7293b78..0000000 --- a/projects/material/src/lib/material.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { MaterialComponent } from './material.component'; - -describe('MaterialComponent', () => { - let component: MaterialComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ MaterialComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(MaterialComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/projects/material/src/lib/material.component.ts b/projects/material/src/lib/material.component.ts deleted file mode 100644 index db22201..0000000 --- a/projects/material/src/lib/material.component.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Component, OnInit } from '@angular/core'; - -@Component({ - selector: 'farmmaps-material', - template: ` -

- material works! -

- `, - styles: [] -}) -export class MaterialComponent implements OnInit { - - constructor() { } - - ngOnInit() { - } - -} diff --git a/projects/material/src/lib/material.module.ts b/projects/material/src/lib/material.module.ts deleted file mode 100644 index b08dc99..0000000 --- a/projects/material/src/lib/material.module.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { NgModule } from '@angular/core'; -import { MaterialComponent } from './material.component'; -import { CropfieldSelectorComponent } from './cropfield-selector/cropfield-selector.component'; - -@NgModule({ - declarations: [ - MaterialComponent, - CropfieldSelectorComponent - ], - imports: [ - ], - exports: [ - MaterialComponent, - CropfieldSelectorComponent - ] -}) -export class MaterialModule { } diff --git a/projects/material/src/lib/material.service.spec.ts b/projects/material/src/lib/material.service.spec.ts deleted file mode 100644 index e010574..0000000 --- a/projects/material/src/lib/material.service.spec.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { TestBed } from '@angular/core/testing'; - -import { MaterialService } from './material.service'; - -describe('MaterialService', () => { - beforeEach(() => TestBed.configureTestingModule({})); - - it('should be created', () => { - const service: MaterialService = TestBed.get(MaterialService); - expect(service).toBeTruthy(); - }); -}); diff --git a/projects/material/src/lib/material.service.ts b/projects/material/src/lib/material.service.ts deleted file mode 100644 index a39cce5..0000000 --- a/projects/material/src/lib/material.service.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Injectable } from '@angular/core'; - -@Injectable({ - providedIn: 'root' -}) -export class MaterialService { - - constructor() { } -} diff --git a/projects/material/src/public-api.ts b/projects/material/src/public-api.ts deleted file mode 100644 index da67cf1..0000000 --- a/projects/material/src/public-api.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Public API Surface of material - */ - -export * from './lib/material.service'; -export * from './lib/material.component'; -export * from './lib/material.module'; - -export * from './lib/cropfield-selector/cropfield-selector.component'; \ No newline at end of file diff --git a/projects/material/src/test.ts b/projects/material/src/test.ts deleted file mode 100644 index e11ff1c..0000000 --- a/projects/material/src/test.ts +++ /dev/null @@ -1,22 +0,0 @@ -// This file is required by karma.conf.js and loads recursively all the .spec and framework files - -import 'core-js/es7/reflect'; -import 'zone.js/dist/zone'; -import 'zone.js/dist/zone-testing'; -import { getTestBed } from '@angular/core/testing'; -import { - BrowserDynamicTestingModule, - platformBrowserDynamicTesting -} from '@angular/platform-browser-dynamic/testing'; - -declare const require: any; - -// First, initialize the Angular testing environment. -getTestBed().initTestEnvironment( - BrowserDynamicTestingModule, - platformBrowserDynamicTesting() -); -// Then we find all the tests. -const context = require.context('./', true, /\.spec\.ts$/); -// And load the modules. -context.keys().map(context); diff --git a/projects/material/tsconfig.lib.json b/projects/material/tsconfig.lib.json deleted file mode 100644 index 3fe337f..0000000 --- a/projects/material/tsconfig.lib.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "../../out-tsc/lib", - "target": "es2015", - "module": "es2015", - "moduleResolution": "node", - "declaration": true, - "sourceMap": true, - "inlineSources": true, - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "importHelpers": true, - "types": [], - "lib": [ - "dom", - "es2018" - ] - }, - "angularCompilerOptions": { - "annotateForClosureCompiler": true, - "skipTemplateCodegen": true, - "strictMetadataEmit": true, - "fullTemplateTypeCheck": true, - "strictInjectionParameters": true, - "enableResourceInlining": true - }, - "exclude": [ - "src/test.ts", - "**/*.spec.ts" - ] -} diff --git a/projects/material/tsconfig.spec.json b/projects/material/tsconfig.spec.json deleted file mode 100644 index 16da33d..0000000 --- a/projects/material/tsconfig.spec.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "../../out-tsc/spec", - "types": [ - "jasmine", - "node" - ] - }, - "files": [ - "src/test.ts" - ], - "include": [ - "**/*.spec.ts", - "**/*.d.ts" - ] -} diff --git a/projects/material/tslint.json b/projects/material/tslint.json deleted file mode 100644 index fe96d6c..0000000 --- a/projects/material/tslint.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "extends": "../../tslint.json", - "rules": { - "directive-selector": [ - true, - "attribute", - "farmmaps", - "camelCase" - ], - "component-selector": [ - true, - "element", - "farmmaps", - "kebab-case" - ] - } -} diff --git a/src/app/app-content.component.ts b/src/app/app-content.component.ts new file mode 100644 index 0000000..9feb023 --- /dev/null +++ b/src/app/app-content.component.ts @@ -0,0 +1,8 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-content', + template: '
Hello daar
' +}) +export class AppContentComponent { +} \ No newline at end of file diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts new file mode 100644 index 0000000..7e6a518 --- /dev/null +++ b/src/app/app-routing.module.ts @@ -0,0 +1,16 @@ +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; + +import { AuthGuard } from '@farmmaps/common'; +import { AppContentComponent} from './app-content.component'; + +const routes = [ + { path: '', canLoad: [AuthGuard], component: AppContentComponent} +]; + +@NgModule({ + imports: [RouterModule.forRoot(routes, + { initialNavigation: false })], // , enableTracing: true + exports: [RouterModule] +}) +export class AppRoutingModule { } diff --git a/src/app/app.component.html b/src/app/app.component.html index e5d31c2..676801c 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -5,12 +5,8 @@ Angular Logo -

Material Test

- -

Material Test Cropfield Selector

Common Test

- - +

    Here are some links to help you start:

      diff --git a/src/app/app.module.ts b/src/app/app.module.ts index c791fd9..e261d13 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -1,18 +1,57 @@ +import { + NgModule, + Inject, + APP_BOOTSTRAP_LISTENER, + InjectionToken, Type, +} from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; -import { NgModule } from '@angular/core'; import { AppComponent } from './app.component'; -import { MaterialModule } from 'material'; -import { CommonModule } from '@farmmaps/common'; +import { AppContentComponent } from './app-content.component'; +import { AppCommonModule } from '@farmmaps/common'; + +import {StoreModule, Store} from '@ngrx/store'; +import {EffectsModule, EffectSources} from '@ngrx/effects'; +import { StoreRouterConnectingModule} from '@ngrx/router-store'; + +import {AppRoutingModule} from './app-routing.module'; + +export const BOOTSTRAP_EFFECTS = new InjectionToken('Bootstrap Effects'); + +export function bootstrapEffects(effects: Type[], sources: EffectSources) { + return () => { + effects.forEach(effect => sources.addEffects(effect)); + }; +} + +export function createInstances(...instances: any[]) { + return instances; +} + +export function provideBootstrapEffects(effects: Type[]) { + return [ + effects, + {provide: BOOTSTRAP_EFFECTS, deps: effects, useFactory: createInstances}, + { + provide: APP_BOOTSTRAP_LISTENER, + multi: true, + useFactory: bootstrapEffects, + deps: [[new Inject(BOOTSTRAP_EFFECTS)], EffectSources], + }, + ]; +} @NgModule({ declarations: [ - AppComponent + AppComponent, + AppContentComponent ], imports: [ + AppRoutingModule, + AppCommonModule.forRoot() , BrowserModule, - MaterialModule, - CommonModule + StoreModule.forRoot({}), + EffectsModule.forRoot([]) ], providers: [], bootstrap: [AppComponent] diff --git a/src/configuration.json b/src/configuration.json new file mode 100644 index 0000000..3c074a5 --- /dev/null +++ b/src/configuration.json @@ -0,0 +1,8 @@ +{ + "issuer": "http://accounts.awtest.nl", + "clientId": "v1t", + "audience": "http://localhost:8082/,http://awtest.nl/,http://aan.awtest.nl", + "requireHttps": false, + "apiEndPoint": "http://localhost:8082" + } + \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 36df828..1f5e7c6 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -17,22 +17,6 @@ "lib": [ "es2018", "dom" - ], - "paths": { - "material": [ - "dist/material" - ], - "material/*": [ - "dist/material/*" - ], - "common": [ - "dist/common", - "dist/common" - ], - "common/*": [ - "dist/common/*", - "dist/common/*" - ] - } + ] } } \ No newline at end of file