First working version
This commit is contained in:
parent
f304cf5149
commit
0fe5cb166c
38
angular.json
38
angular.json
@ -20,7 +20,8 @@
|
|||||||
"tsConfig": "src/tsconfig.app.json",
|
"tsConfig": "src/tsconfig.app.json",
|
||||||
"assets": [
|
"assets": [
|
||||||
"src/favicon.ico",
|
"src/favicon.ico",
|
||||||
"src/assets"
|
"src/assets",
|
||||||
|
"src/configuration.json"
|
||||||
],
|
],
|
||||||
"styles": [
|
"styles": [
|
||||||
"src/styles.css"
|
"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": {
|
"common": {
|
||||||
"root": "projects/common",
|
"root": "projects/common",
|
||||||
"sourceRoot": "projects/common/src",
|
"sourceRoot": "projects/common/src",
|
||||||
|
43
package-lock.json
generated
43
package-lock.json
generated
@ -645,9 +645,33 @@
|
|||||||
"@farmmaps/common": {
|
"@farmmaps/common": {
|
||||||
"version": "file:dist/common",
|
"version": "file:dist/common",
|
||||||
"requires": {
|
"requires": {
|
||||||
|
"angular-oauth2-oidc": "^5.0.2",
|
||||||
"tslib": "^1.9.0"
|
"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": {
|
"@ngtools/json-schema": {
|
||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
"resolved": "https://repository.akkerweb.nl/repository/npm-group/@ngtools/json-schema/-/json-schema-1.1.0.tgz",
|
"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=",
|
"integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=",
|
||||||
"dev": true
|
"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": {
|
"ansi-align": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"resolved": "https://repository.akkerweb.nl/repository/npm-group/ansi-align/-/ansi-align-2.0.0.tgz",
|
"resolved": "https://repository.akkerweb.nl/repository/npm-group/ansi-align/-/ansi-align-2.0.0.tgz",
|
||||||
@ -5852,6 +5885,11 @@
|
|||||||
"verror": "1.10.0"
|
"verror": "1.10.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"jsrsasign": {
|
||||||
|
"version": "8.0.12",
|
||||||
|
"resolved": "https://registry.npmjs.org/jsrsasign/-/jsrsasign-8.0.12.tgz",
|
||||||
|
"integrity": "sha1-Iqu5ZW00owuVMENnIINeicLlwxY="
|
||||||
|
},
|
||||||
"jszip": {
|
"jszip": {
|
||||||
"version": "3.2.1",
|
"version": "3.2.1",
|
||||||
"resolved": "https://repository.akkerweb.nl/repository/npm-group/jszip/-/jszip-3.2.1.tgz",
|
"resolved": "https://repository.akkerweb.nl/repository/npm-group/jszip/-/jszip-3.2.1.tgz",
|
||||||
@ -8496,6 +8534,11 @@
|
|||||||
"signal-exit": "^3.0.2"
|
"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": {
|
"ret": {
|
||||||
"version": "0.1.15",
|
"version": "0.1.15",
|
||||||
"resolved": "https://repository.akkerweb.nl/repository/npm-group/ret/-/ret-0.1.15.tgz",
|
"resolved": "https://repository.akkerweb.nl/repository/npm-group/ret/-/ret-0.1.15.tgz",
|
||||||
|
@ -21,9 +21,14 @@
|
|||||||
"@angular/router": "~7.2.0",
|
"@angular/router": "~7.2.0",
|
||||||
"@aspnet/signalr": "^1.1.4",
|
"@aspnet/signalr": "^1.1.4",
|
||||||
"@farmmaps/common": "file:dist/common",
|
"@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",
|
"bootstrap": "^4.3.1",
|
||||||
"core-js": "^2.5.4",
|
"core-js": "^2.5.4",
|
||||||
"material": "file:dist/material",
|
"material": "file:dist/material",
|
||||||
|
"resumablejs": "^1.1.0",
|
||||||
"rxjs": "~6.3.3",
|
"rxjs": "~6.3.3",
|
||||||
"tassign": "^1.0.0",
|
"tassign": "^1.0.0",
|
||||||
"tslib": "^1.9.0",
|
"tslib": "^1.9.0",
|
||||||
|
@ -1,8 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@farmmaps/common",
|
"name": "@farmmaps/common",
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
|
"publishConfig":{
|
||||||
|
"registry":"https://repository.akkerweb.nl/repository/npm-hosted/"
|
||||||
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"angular-oauth2-oidc": "^5.0.2"
|
"angular-oauth2-oidc": "^5.0.2",
|
||||||
|
"resumablejs": "1.1.0"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@ng-bootstrap/ng-bootstrap": "^4.2.1",
|
"@ng-bootstrap/ng-bootstrap": "^4.2.1",
|
||||||
|
@ -42,6 +42,29 @@ import { SidePanelComponent } from './components/side-panel/side-panel.component
|
|||||||
import { TimespanComponent } from './components/timespan/timespan.component';
|
import { TimespanComponent } from './components/timespan/timespan.component';
|
||||||
import { TagInputComponent } from './components/tag-input/tag-input.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({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule,
|
CommonModule,
|
||||||
|
@ -1,370 +0,0 @@
|
|||||||
// Type definitions for Resumable.js
|
|
||||||
// Project: https://github.com/23/resumable.js
|
|
||||||
// Definitions by: Bazyli Brzóska <https://invent.life/>
|
|
||||||
// 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<string>;
|
|
||||||
/**
|
|
||||||
* 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<ResumableFile>;
|
|
||||||
|
|
||||||
events: Array<any>;
|
|
||||||
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<Element>, isDirectory: boolean): void;
|
|
||||||
/**
|
|
||||||
* Assign one or more DOM nodes as a drop target.
|
|
||||||
**/
|
|
||||||
assignDrop(domNode: Element): void;
|
|
||||||
assignDrop(domNodes: Array<Element>): void;
|
|
||||||
unAssignDrop(domNode: Element): void;
|
|
||||||
unAssignDrop(domNodes: Array<Element>): 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<File>): 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<ResumableFile>) => 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<ResumableChunk>;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 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;
|
|
||||||
}
|
|
@ -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).
|
|
@ -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
|
|
||||||
});
|
|
||||||
};
|
|
@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
|
|
||||||
"dest": "../../dist/material",
|
|
||||||
"lib": {
|
|
||||||
"entryFile": "src/public-api.ts"
|
|
||||||
}
|
|
||||||
}
|
|
5
projects/material/package-lock.json
generated
5
projects/material/package-lock.json
generated
@ -1,5 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "material",
|
|
||||||
"version": "0.0.1",
|
|
||||||
"lockfileVersion": 1
|
|
||||||
}
|
|
@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "material",
|
|
||||||
"version": "0.0.1",
|
|
||||||
"peerDependencies": {
|
|
||||||
"@angular/common": "^7.2.0",
|
|
||||||
"@angular/core": "^7.2.0"
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,3 +0,0 @@
|
|||||||
<p>
|
|
||||||
cropfield-selector works!
|
|
||||||
</p>
|
|
@ -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<CropfieldSelectorComponent>;
|
|
||||||
|
|
||||||
beforeEach(async(() => {
|
|
||||||
TestBed.configureTestingModule({
|
|
||||||
declarations: [ CropfieldSelectorComponent ]
|
|
||||||
})
|
|
||||||
.compileComponents();
|
|
||||||
}));
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
fixture = TestBed.createComponent(CropfieldSelectorComponent);
|
|
||||||
component = fixture.componentInstance;
|
|
||||||
fixture.detectChanges();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should create', () => {
|
|
||||||
expect(component).toBeTruthy();
|
|
||||||
});
|
|
||||||
});
|
|
@ -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() {
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -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<MaterialComponent>;
|
|
||||||
|
|
||||||
beforeEach(async(() => {
|
|
||||||
TestBed.configureTestingModule({
|
|
||||||
declarations: [ MaterialComponent ]
|
|
||||||
})
|
|
||||||
.compileComponents();
|
|
||||||
}));
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
fixture = TestBed.createComponent(MaterialComponent);
|
|
||||||
component = fixture.componentInstance;
|
|
||||||
fixture.detectChanges();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should create', () => {
|
|
||||||
expect(component).toBeTruthy();
|
|
||||||
});
|
|
||||||
});
|
|
@ -1,19 +0,0 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: 'farmmaps-material',
|
|
||||||
template: `
|
|
||||||
<p>
|
|
||||||
material works!
|
|
||||||
</p>
|
|
||||||
`,
|
|
||||||
styles: []
|
|
||||||
})
|
|
||||||
export class MaterialComponent implements OnInit {
|
|
||||||
|
|
||||||
constructor() { }
|
|
||||||
|
|
||||||
ngOnInit() {
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -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 { }
|
|
@ -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();
|
|
||||||
});
|
|
||||||
});
|
|
@ -1,9 +0,0 @@
|
|||||||
import { Injectable } from '@angular/core';
|
|
||||||
|
|
||||||
@Injectable({
|
|
||||||
providedIn: 'root'
|
|
||||||
})
|
|
||||||
export class MaterialService {
|
|
||||||
|
|
||||||
constructor() { }
|
|
||||||
}
|
|
@ -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';
|
|
@ -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);
|
|
@ -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"
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,17 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "../../tsconfig.json",
|
|
||||||
"compilerOptions": {
|
|
||||||
"outDir": "../../out-tsc/spec",
|
|
||||||
"types": [
|
|
||||||
"jasmine",
|
|
||||||
"node"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"files": [
|
|
||||||
"src/test.ts"
|
|
||||||
],
|
|
||||||
"include": [
|
|
||||||
"**/*.spec.ts",
|
|
||||||
"**/*.d.ts"
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,17 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "../../tslint.json",
|
|
||||||
"rules": {
|
|
||||||
"directive-selector": [
|
|
||||||
true,
|
|
||||||
"attribute",
|
|
||||||
"farmmaps",
|
|
||||||
"camelCase"
|
|
||||||
],
|
|
||||||
"component-selector": [
|
|
||||||
true,
|
|
||||||
"element",
|
|
||||||
"farmmaps",
|
|
||||||
"kebab-case"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
8
src/app/app-content.component.ts
Normal file
8
src/app/app-content.component.ts
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-content',
|
||||||
|
template: '<div>Hello daar</div>'
|
||||||
|
})
|
||||||
|
export class AppContentComponent {
|
||||||
|
}
|
16
src/app/app-routing.module.ts
Normal file
16
src/app/app-routing.module.ts
Normal file
@ -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 { }
|
@ -5,12 +5,8 @@
|
|||||||
</h1>
|
</h1>
|
||||||
<img width="300" alt="Angular Logo" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTAgMjUwIj4KICAgIDxwYXRoIGZpbGw9IiNERDAwMzEiIGQ9Ik0xMjUgMzBMMzEuOSA2My4ybDE0LjIgMTIzLjFMMTI1IDIzMGw3OC45LTQzLjcgMTQuMi0xMjMuMXoiIC8+CiAgICA8cGF0aCBmaWxsPSIjQzMwMDJGIiBkPSJNMTI1IDMwdjIyLjItLjFWMjMwbDc4LjktNDMuNyAxNC4yLTEyMy4xTDEyNSAzMHoiIC8+CiAgICA8cGF0aCAgZmlsbD0iI0ZGRkZGRiIgZD0iTTEyNSA1Mi4xTDY2LjggMTgyLjZoMjEuN2wxMS43LTI5LjJoNDkuNGwxMS43IDI5LjJIMTgzTDEyNSA1Mi4xem0xNyA4My4zaC0zNGwxNy00MC45IDE3IDQwLjl6IiAvPgogIDwvc3ZnPg==">
|
<img width="300" alt="Angular Logo" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTAgMjUwIj4KICAgIDxwYXRoIGZpbGw9IiNERDAwMzEiIGQ9Ik0xMjUgMzBMMzEuOSA2My4ybDE0LjIgMTIzLjFMMTI1IDIzMGw3OC45LTQzLjcgMTQuMi0xMjMuMXoiIC8+CiAgICA8cGF0aCBmaWxsPSIjQzMwMDJGIiBkPSJNMTI1IDMwdjIyLjItLjFWMjMwbDc4LjktNDMuNyAxNC4yLTEyMy4xTDEyNSAzMHoiIC8+CiAgICA8cGF0aCAgZmlsbD0iI0ZGRkZGRiIgZD0iTTEyNSA1Mi4xTDY2LjggMTgyLjZoMjEuN2wxMS43LTI5LjJoNDkuNGwxMS43IDI5LjJIMTgzTDEyNSA1Mi4xem0xNyA4My4zaC0zNGwxNy00MC45IDE3IDQwLjl6IiAvPgogIDwvc3ZnPg==">
|
||||||
</div>
|
</div>
|
||||||
<h2>Material Test</h2>
|
|
||||||
<farmmaps-material></farmmaps-material>
|
|
||||||
<h2>Material Test Cropfield Selector</h2>
|
|
||||||
<h2>Common Test</h2>
|
<h2>Common Test</h2>
|
||||||
<lib-common></lib-common>
|
<router-outlet></router-outlet>
|
||||||
<farmmaps-cropfield-selector></farmmaps-cropfield-selector>
|
|
||||||
<ul>
|
<ul>
|
||||||
<h2>Here are some links to help you start: </h2>
|
<h2>Here are some links to help you start: </h2>
|
||||||
<ul>
|
<ul>
|
||||||
|
@ -1,18 +1,57 @@
|
|||||||
|
import {
|
||||||
|
NgModule,
|
||||||
|
Inject,
|
||||||
|
APP_BOOTSTRAP_LISTENER,
|
||||||
|
InjectionToken, Type,
|
||||||
|
} from '@angular/core';
|
||||||
import { BrowserModule } from '@angular/platform-browser';
|
import { BrowserModule } from '@angular/platform-browser';
|
||||||
import { NgModule } from '@angular/core';
|
|
||||||
|
|
||||||
import { AppComponent } from './app.component';
|
import { AppComponent } from './app.component';
|
||||||
import { MaterialModule } from 'material';
|
import { AppContentComponent } from './app-content.component';
|
||||||
import { CommonModule } from '@farmmaps/common';
|
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<any>[], sources: EffectSources) {
|
||||||
|
return () => {
|
||||||
|
effects.forEach(effect => sources.addEffects(effect));
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function createInstances(...instances: any[]) {
|
||||||
|
return instances;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function provideBootstrapEffects(effects: Type<any>[]) {
|
||||||
|
return [
|
||||||
|
effects,
|
||||||
|
{provide: BOOTSTRAP_EFFECTS, deps: effects, useFactory: createInstances},
|
||||||
|
{
|
||||||
|
provide: APP_BOOTSTRAP_LISTENER,
|
||||||
|
multi: true,
|
||||||
|
useFactory: bootstrapEffects,
|
||||||
|
deps: [[new Inject(BOOTSTRAP_EFFECTS)], EffectSources],
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
AppComponent
|
AppComponent,
|
||||||
|
AppContentComponent
|
||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
|
AppRoutingModule,
|
||||||
|
AppCommonModule.forRoot() ,
|
||||||
BrowserModule,
|
BrowserModule,
|
||||||
MaterialModule,
|
StoreModule.forRoot({}),
|
||||||
CommonModule
|
EffectsModule.forRoot([])
|
||||||
],
|
],
|
||||||
providers: [],
|
providers: [],
|
||||||
bootstrap: [AppComponent]
|
bootstrap: [AppComponent]
|
||||||
|
8
src/configuration.json
Normal file
8
src/configuration.json
Normal file
@ -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"
|
||||||
|
}
|
||||||
|
|
@ -17,22 +17,6 @@
|
|||||||
"lib": [
|
"lib": [
|
||||||
"es2018",
|
"es2018",
|
||||||
"dom"
|
"dom"
|
||||||
],
|
|
||||||
"paths": {
|
|
||||||
"material": [
|
|
||||||
"dist/material"
|
|
||||||
],
|
|
||||||
"material/*": [
|
|
||||||
"dist/material/*"
|
|
||||||
],
|
|
||||||
"common": [
|
|
||||||
"dist/common",
|
|
||||||
"dist/common"
|
|
||||||
],
|
|
||||||
"common/*": [
|
|
||||||
"dist/common/*",
|
|
||||||
"dist/common/*"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user