diff --git a/.angular-cli.json b/.angular-cli.json index 1290020..f7b4f9c 100644 --- a/.angular-cli.json +++ b/.angular-cli.json @@ -24,9 +24,10 @@ ], "environmentSource": "environments/environment.ts", "environments": { - "dev": "environments/environment.ts", + "dev": "environments/environment.dev.ts", "prod": "environments/environment.prod.ts", - "local": "environments/environment.local.ts" + "local": "environments/environment.local.ts", + "ci": "environments/environment.ci.ts" } } ], diff --git a/.gitignore b/.gitignore index f82ac9f..67d6c52 100644 --- a/.gitignore +++ b/.gitignore @@ -43,6 +43,9 @@ testem.log # local env variable /src/environments/environment.local.ts +/src/environments/environment.prod.ts +/src/environments/environment.dev.ts +/src/environments/environment.ci.ts # ========================= # Operating System Files diff --git a/.travis.yml b/.travis.yml index f262434..22ae810 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,8 @@ addons: language: node_js node_js: - 8 +before_install: + - openssl aes-256-cbc -K $encrypted_9d2af3734b6c_key -iv $encrypted_9d2af3734b6c_iv -in src/environments/environment.ci.ts.enc -out src/environments/environment.ci.ts -d before_script: - export DISPLAY=:99.0 - sh -e /etc/init.d/xvfb start diff --git a/CHANGELOG.md b/CHANGELOG.md index 1849098..7e6321b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,15 @@ # Next Release +# v0.0.2 + +* Supplier map added to organisation view +* Fix various linter errors +* Payroll Log Data added +* Fixed register box view on login page +* Made the form reset properly if adding a new one +* Added better error messages on register and account edit + # v0.0.1 * Added Travis Testing diff --git a/bin/build-releases b/bin/build-releases new file mode 100755 index 0000000..0a840d2 --- /dev/null +++ b/bin/build-releases @@ -0,0 +1,23 @@ +#! /bin/bash + +VERSION=`git describe --tags` + +echo "Building releases for $VERSION" + +echo "Building Prod Release..." + +ng build --prod + +tar -czf ../LocalLoop-Web-prod-$VERSION.tar.gz dist + +echo "Building Dev Release..." + +ng build --dev + +tar -cvzf ../LocalLoop-Web-dev-$VERSION.tar.gz dist + +echo "Cleaning up build artefacts..." + +rm -rf dist + +echo "Done" diff --git a/package-lock.json b/package-lock.json index 2c53884..b3325ee 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,9 +1,14 @@ { - "name": "coreui-angular", - "version": "1.0.0-alpha.5", + "name": "localloop-web", + "version": "0.0.1", "lockfileVersion": 1, "requires": true, "dependencies": { + "@agm/core": { + "version": "1.0.0-beta.1", + "resolved": "https://registry.npmjs.org/@agm/core/-/core-1.0.0-beta.1.tgz", + "integrity": "sha512-IVwQGmcaE42SmYY2e5QwqOC0vrSXZCW8BhATY0Vpy3NjbiydSXi9T81hVqKLvuKaB3ves1sv3W++SB1Wj+5B6A==" + }, "@angular-devkit/build-optimizer": { "version": "0.0.13", "resolved": "https://registry.npmjs.org/@angular-devkit/build-optimizer/-/build-optimizer-0.0.13.tgz", diff --git a/package.json b/package.json index 9c56d35..5560151 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "localloop-web", - "version": "0.0.1", + "version": "0.0.2", "description": "LocalLoop Web - Web interface for LocalLoop app", "author": "", "url": "http://www.peartrade.org", @@ -10,13 +10,15 @@ "start": "ng serve", "build": "ng build", "test": "ng test", - "test:once": "ng test --watch=false", + "test:ci": "ng test --watch=false --env=ci", "lint": "ng lint", "e2e": "ng e2e", - "ci": "npm run test:once && npm run e2e" + "e2e:ci": "ng e2e --env=ci", + "ci": "npm run test:ci && npm run e2e:ci" }, "private": true, "dependencies": { + "@agm/core": "^1.0.0-beta.1", "@angular/common": "4.0.3", "@angular/compiler": "4.0.3", "@angular/core": "4.0.3", diff --git a/src/app/_guards/auth.guard.ts b/src/app/_guards/auth.guard.ts index 3e7a9fc..d267cf4 100644 --- a/src/app/_guards/auth.guard.ts +++ b/src/app/_guards/auth.guard.ts @@ -8,13 +8,13 @@ export class AuthGuard implements CanActivate { canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) { if (localStorage.getItem('sessionKey')) { - console.log('session key found') + console.log('session key found'); // logged in so return true return true; } // not logged in so redirect to login page with the return url - console.log('no session key found') + console.log('no session key found'); this.router.navigate(['/login'], { queryParams: { returnUrl: state.url }}); return false; } diff --git a/src/app/auth/login.component.html b/src/app/auth/login.component.html index 41095ff..5c02b96 100644 --- a/src/app/auth/login.component.html +++ b/src/app/auth/login.component.html @@ -37,7 +37,7 @@ -
Create your account
- + - +Entry Period | +Gross Payroll | +Employees | +
---|---|---|
The page you are looking for was not found.
The page you are looking for is temporarily unavailable.
- - + + diff --git a/src/app/pages/500.component.ts b/src/app/pages/500.component.ts index fa459e6..a80ff31 100644 --- a/src/app/pages/500.component.ts +++ b/src/app/pages/500.component.ts @@ -7,11 +7,10 @@ import { Location } from '@angular/common'; export class P500Component { constructor( - private location: Location - ) { - } + private location: Location, + ) { } - goBack(): void { - this.location.back(); -} -} \ No newline at end of file + goBack(): void { + this.location.back(); + } +} diff --git a/src/app/providers/api-service.ts b/src/app/providers/api-service.ts index e0f27a2..378035b 100644 --- a/src/app/providers/api-service.ts +++ b/src/app/providers/api-service.ts @@ -136,12 +136,25 @@ export class ApiService { ).map( response => response.json() ); } + // gets payroll list for log + + public payrollList(data) { + const key = this.sessionKey; + return this.http.post( + this.apiUrl + '/v1/organisation/payroll', + { + session_key : key, + page : data + } + ).map( response => response.json() ); + } + // handles Org data added public orgPayroll(data) { data.session_key = this.sessionKey; return this.http.post( - this.apiUrl + '/org/payroll', + this.apiUrl + '/v1/organisation/payroll/add', data ).map( response => response.json() ); } @@ -149,7 +162,7 @@ export class ApiService { public orgSupplier(data) { data.session_key = this.sessionKey; return this.http.post( - this.apiUrl + '/org/supplier', + this.apiUrl + '/v1/organisation/supplier/add', data ).map( response => response.json() ); } @@ -157,7 +170,7 @@ export class ApiService { public orgEmployee(data) { data.session_key = this.sessionKey; return this.http.post( - this.apiUrl + '/org/employee', + this.apiUrl + '/v1/organisation/employee/add', data ).map( response => response.json() ); } @@ -251,6 +264,15 @@ export class ApiService { ).map( response => response.json() ); } + // Initial Map Data + public getMapData(data) { + data.session_key = this.sessionKey; + return this.http.post( + this.apiUrl + '/v1/supplier/location', + data + ).map( response => response.json() ); + } + // Basic Customer User stats API public basicStats() { const key = this.sessionKey; diff --git a/src/app/shared/org-result.component.ts b/src/app/shared/org-result.component.ts index d7c599f..f22fbea 100644 --- a/src/app/shared/org-result.component.ts +++ b/src/app/shared/org-result.component.ts @@ -9,6 +9,7 @@ interface OrgData { } @Component({ + // tslint:disable-next-line selector: '[org-result]', templateUrl: 'org-result.component.html', }) @@ -19,6 +20,6 @@ export class OrgResultComponent { public orgClick(): void { this.onClick.emit( this.org - ) + ); } } diff --git a/src/app/shared/org-table.component.ts b/src/app/shared/org-table.component.ts index 8e0979d..764385c 100644 --- a/src/app/shared/org-table.component.ts +++ b/src/app/shared/org-table.component.ts @@ -10,6 +10,7 @@ interface OrgData { } @Component({ + // tslint:disable-next-line selector: 'org-table', templateUrl: 'org-table.component.html', }) diff --git a/src/app/shared/payroll-result.component.html b/src/app/shared/payroll-result.component.html new file mode 100644 index 0000000..6d891c6 --- /dev/null +++ b/src/app/shared/payroll-result.component.html @@ -0,0 +1,3 @@ +