diff --git a/spring-cloud/spring-cloud-bootstrap/gateway/pom.xml b/spring-cloud/spring-cloud-bootstrap/gateway/pom.xml index 8169cf255d..5d1ec4288b 100644 --- a/spring-cloud/spring-cloud-bootstrap/gateway/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/gateway/pom.xml @@ -100,7 +100,7 @@ maven-antrun-plugin - compile + generate-resources diff --git a/spring-cloud/spring-cloud-bootstrap/gateway/src/main/angular/ui/src/app/app.component.html b/spring-cloud/spring-cloud-bootstrap/gateway/src/main/angular/ui/src/app/app.component.html index 39d7fe96c5..d574960164 100644 --- a/spring-cloud/spring-cloud-bootstrap/gateway/src/main/angular/ui/src/app/app.component.html +++ b/spring-cloud/spring-cloud-bootstrap/gateway/src/main/angular/ui/src/app/app.component.html @@ -20,14 +20,15 @@
Login Failed
-

Book Rater App

-

Keep track of all the latest books and their ratings.

+

Anyone can view the books.

+

Users can view and create ratings

+

Admins can do anything!

diff --git a/spring-cloud/spring-cloud-bootstrap/gateway/src/main/angular/ui/src/app/app.component.spec.ts b/spring-cloud/spring-cloud-bootstrap/gateway/src/main/angular/ui/src/app/app.component.spec.ts deleted file mode 100644 index 6c57e97e2f..0000000000 --- a/spring-cloud/spring-cloud-bootstrap/gateway/src/main/angular/ui/src/app/app.component.spec.ts +++ /dev/null @@ -1,31 +0,0 @@ -import {TestBed, async} from "@angular/core/testing"; -import {AppComponent} from "./app.component"; - -describe('AppComponent', () => { - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ - AppComponent - ], - }).compileComponents(); - })); - - it('should create the app', async(() => { - const fixture = TestBed.createComponent(AppComponent); - const app = fixture.debugElement.componentInstance; - expect(app).toBeTruthy(); - })); - - it(`should have as title 'app works!'`, async(() => { - const fixture = TestBed.createComponent(AppComponent); - const app = fixture.debugElement.componentInstance; - expect(app.title).toEqual('app works!'); - })); - - it('should render title in a h1 tag', async(() => { - const fixture = TestBed.createComponent(AppComponent); - fixture.detectChanges(); - const compiled = fixture.debugElement.nativeElement; - expect(compiled.querySelector('h1').textContent).toContain('app works!'); - })); -}); diff --git a/spring-cloud/spring-cloud-bootstrap/gateway/src/main/angular/ui/src/app/app.component.ts b/spring-cloud/spring-cloud-bootstrap/gateway/src/main/angular/ui/src/app/app.component.ts index 4e0b560acf..aad9b912dd 100644 --- a/spring-cloud/spring-cloud-bootstrap/gateway/src/main/angular/ui/src/app/app.component.ts +++ b/spring-cloud/spring-cloud-bootstrap/gateway/src/main/angular/ui/src/app/app.component.ts @@ -15,23 +15,13 @@ export class AppComponent { username: '', password: '' }; - selectedBook: Book = null; - - private username: String = ''; - private password: String = ''; - - principal: Principal = new Principal(false, [], null); - // principal: Principal = new Principal(true, [new Authority("ROLE_USER")], {username: 'user', password: 'password'}); - loginFailed: boolean = false; constructor(private httpService: HttpService){} - ngOnInit(): void { - - } + ngOnInit(): void {} onLogin(form: NgForm) { this.loginFailed = false; diff --git a/spring-cloud/spring-cloud-bootstrap/gateway/src/main/resources/public/inline.bundle.js.map b/spring-cloud/spring-cloud-bootstrap/gateway/src/main/resources/public/inline.bundle.js.map index 98240e97cb..fafa0130ad 100644 --- a/spring-cloud/spring-cloud-bootstrap/gateway/src/main/resources/public/inline.bundle.js.map +++ b/spring-cloud/spring-cloud-bootstrap/gateway/src/main/resources/public/inline.bundle.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/bootstrap 13cfa28616fb2804575b"],"names":[],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAQ,oBAAoB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAY,2BAA2B;AACvC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAI;AACJ;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,mDAA2C,cAAc;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA,kDAA0C,oBAAoB,WAAW","file":"inline.bundle.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tvar parentJsonpFunction = window[\"webpackJsonp\"];\n \twindow[\"webpackJsonp\"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [], result;\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId])\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);\n \t\twhile(resolves.length)\n \t\t\tresolves.shift()();\n \t\tif(executeModules) {\n \t\t\tfor(i=0; i < executeModules.length; i++) {\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = executeModules[i]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// objects to store loaded and loading chunks\n \tvar installedChunks = {\n \t\t4: 0\n \t};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n \t// This file contains only the entry chunk.\n \t// The chunk loading function for additional chunks\n \t__webpack_require__.e = function requireEnsure(chunkId) {\n \t\tif(installedChunks[chunkId] === 0)\n \t\t\treturn Promise.resolve();\n\n \t\t// an Promise means \"currently loading\".\n \t\tif(installedChunks[chunkId]) {\n \t\t\treturn installedChunks[chunkId][2];\n \t\t}\n \t\t// start chunk loading\n \t\tvar head = document.getElementsByTagName('head')[0];\n \t\tvar script = document.createElement('script');\n \t\tscript.type = 'text/javascript';\n \t\tscript.charset = 'utf-8';\n \t\tscript.async = true;\n \t\tscript.timeout = 120000;\n\n \t\tif (__webpack_require__.nc) {\n \t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n \t\t}\n \t\tscript.src = __webpack_require__.p + \"\" + chunkId + \".chunk.js\";\n \t\tvar timeout = setTimeout(onScriptComplete, 120000);\n \t\tscript.onerror = script.onload = onScriptComplete;\n \t\tfunction onScriptComplete() {\n \t\t\t// avoid mem leaks in IE.\n \t\t\tscript.onerror = script.onload = null;\n \t\t\tclearTimeout(timeout);\n \t\t\tvar chunk = installedChunks[chunkId];\n \t\t\tif(chunk !== 0) {\n \t\t\t\tif(chunk) chunk[1](new Error('Loading chunk ' + chunkId + ' failed.'));\n \t\t\t\tinstalledChunks[chunkId] = undefined;\n \t\t\t}\n \t\t};\n\n \t\tvar promise = new Promise(function(resolve, reject) {\n \t\t\tinstalledChunks[chunkId] = [resolve, reject];\n \t\t});\n \t\tinstalledChunks[chunkId][2] = promise;\n\n \t\thead.appendChild(script);\n \t\treturn promise;\n \t};\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 13cfa28616fb2804575b"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap 4d7916d2749f3dae9442"],"names":[],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAQ,oBAAoB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAY,2BAA2B;AACvC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAI;AACJ;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,mDAA2C,cAAc;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA,kDAA0C,oBAAoB,WAAW","file":"inline.bundle.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tvar parentJsonpFunction = window[\"webpackJsonp\"];\n \twindow[\"webpackJsonp\"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [], result;\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId])\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);\n \t\twhile(resolves.length)\n \t\t\tresolves.shift()();\n \t\tif(executeModules) {\n \t\t\tfor(i=0; i < executeModules.length; i++) {\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = executeModules[i]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// objects to store loaded and loading chunks\n \tvar installedChunks = {\n \t\t4: 0\n \t};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n \t// This file contains only the entry chunk.\n \t// The chunk loading function for additional chunks\n \t__webpack_require__.e = function requireEnsure(chunkId) {\n \t\tif(installedChunks[chunkId] === 0)\n \t\t\treturn Promise.resolve();\n\n \t\t// an Promise means \"currently loading\".\n \t\tif(installedChunks[chunkId]) {\n \t\t\treturn installedChunks[chunkId][2];\n \t\t}\n \t\t// start chunk loading\n \t\tvar head = document.getElementsByTagName('head')[0];\n \t\tvar script = document.createElement('script');\n \t\tscript.type = 'text/javascript';\n \t\tscript.charset = 'utf-8';\n \t\tscript.async = true;\n \t\tscript.timeout = 120000;\n\n \t\tif (__webpack_require__.nc) {\n \t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n \t\t}\n \t\tscript.src = __webpack_require__.p + \"\" + chunkId + \".chunk.js\";\n \t\tvar timeout = setTimeout(onScriptComplete, 120000);\n \t\tscript.onerror = script.onload = onScriptComplete;\n \t\tfunction onScriptComplete() {\n \t\t\t// avoid mem leaks in IE.\n \t\t\tscript.onerror = script.onload = null;\n \t\t\tclearTimeout(timeout);\n \t\t\tvar chunk = installedChunks[chunkId];\n \t\t\tif(chunk !== 0) {\n \t\t\t\tif(chunk) chunk[1](new Error('Loading chunk ' + chunkId + ' failed.'));\n \t\t\t\tinstalledChunks[chunkId] = undefined;\n \t\t\t}\n \t\t};\n\n \t\tvar promise = new Promise(function(resolve, reject) {\n \t\t\tinstalledChunks[chunkId] = [resolve, reject];\n \t\t});\n \t\tinstalledChunks[chunkId][2] = promise;\n\n \t\thead.appendChild(script);\n \t\treturn promise;\n \t};\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 4d7916d2749f3dae9442"],"sourceRoot":""} \ No newline at end of file diff --git a/spring-cloud/spring-cloud-bootstrap/gateway/src/main/resources/public/main.bundle.js b/spring-cloud/spring-cloud-bootstrap/gateway/src/main/resources/public/main.bundle.js index 8b912022f1..8cdc646406 100644 --- a/spring-cloud/spring-cloud-bootstrap/gateway/src/main/resources/public/main.bundle.js +++ b/spring-cloud/spring-cloud-bootstrap/gateway/src/main/resources/public/main.bundle.js @@ -75,7 +75,7 @@ module.exports = module.exports.toString(); /***/ 149: /***/ (function(module, exports) { -module.exports = "\n\n
\n
\n

Book Rater App

\n

Keep track of all the latest books and their ratings.

\n
\n
\n\n
\n
\n
\n
\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n
\n
\n" +module.exports = "\n\n
\n
\n

Book Rater App

\n

Anyone can view the books.

\n

Users can view and create ratings

\n

Admins can do anything!

\n
\n
\n\n
\n
\n
\n
\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n
\n
\n" /***/ }), @@ -308,14 +308,10 @@ var AppComponent = (function () { password: '' }; this.selectedBook = null; - this.username = ''; - this.password = ''; this.principal = new __WEBPACK_IMPORTED_MODULE_1__principal__["a" /* Principal */](false, [], null); - // principal: Principal = new Principal(true, [new Authority("ROLE_USER")], {username: 'user', password: 'password'}); this.loginFailed = false; } - AppComponent.prototype.ngOnInit = function () { - }; + AppComponent.prototype.ngOnInit = function () { }; AppComponent.prototype.onLogin = function (form) { var _this = this; this.loginFailed = false; diff --git a/spring-cloud/spring-cloud-bootstrap/gateway/src/main/resources/public/main.bundle.js.map b/spring-cloud/spring-cloud-bootstrap/gateway/src/main/resources/public/main.bundle.js.map index a9882067c3..56d3cccb45 100644 --- a/spring-cloud/spring-cloud-bootstrap/gateway/src/main/resources/public/main.bundle.js.map +++ b/spring-cloud/spring-cloud-bootstrap/gateway/src/main/resources/public/main.bundle.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///./src/app/app.component.css","webpack:///./src/app/book/book-detail/book-detail.component.css","webpack:///./src/app/book/book-list/book-list.component.css","webpack:///./src/app/rating/rating.component.css","webpack:///./src/app/app.component.html","webpack:///./src/app/book/book-detail/book-detail.component.html","webpack:///./src/app/book/book-list/book-list.component.html","webpack:///./src/app/rating/rating.component.html","webpack:///./src/app/http.service.ts","webpack:///./src/app/principal.ts","webpack:///./src/app/book.ts","webpack:///./src async","webpack:///./src/main.ts","webpack:///./src/app/app.component.ts","webpack:///./src/app/app.module.ts","webpack:///./src/app/book/book-detail/book-detail.component.ts","webpack:///./src/app/book/book-list/book-list.component.ts","webpack:///./src/app/click-stop-propagation.directive.ts","webpack:///./src/app/rating.ts","webpack:///./src/app/rating/rating.component.ts","webpack:///./src/environments/environment.ts"],"names":[],"mappings":";;;;;AAAA;AACA;;;AAGA;AACA,wCAAyC,kBAAkB,KAAK;;AAEhE;;;AAGA;AACA,2C;;;;;;;ACXA;AACA;;;AAGA;AACA;;AAEA;;;AAGA;AACA,2C;;;;;;;ACXA;AACA;;;AAGA;AACA,wCAAyC,kBAAkB,KAAK;;AAEhE;;;AAGA;AACA,2C;;;;;;;ACXA;AACA;;;AAGA;AACA,uCAAwC,sBAAsB,KAAK,uBAAuB,yBAAyB,KAAK,mBAAmB,yBAAyB,KAAK;;AAEzK;;;AAGA;AACA,2C;;;;;;;ACXA,ooBAAooB,4nD;;;;;;;ACApoB,+MAA+M,8DAA8D,oBAAoB,iEAAiE,qBAAqB,8M;;;;;;;ACAvX,sEAAsE,eAAe,4IAA4I,ubAAub,YAAY,qEAAqE,aAAa,6nCAA6nC,osC;;;;;;;ACAn3D,gEAAgE,eAAe,0FAA0F,uFAAuF,0bAA0b,0KAA0K,eAAe,sKAAsK,MAAM,4d;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAt/B;AAE6B;AAKtE,IAAa,WAAW;IAEtB,qBAAoB,IAAU;QAAV,SAAI,GAAJ,IAAI,CAAM;IAAI,CAAC;IAEnC,2BAAK,GAAL,UAAM,IAAS;QACb,IAAI,OAAO,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;QACzC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC;IACtC,CAAC;IAED,4BAAM,GAAN,UAAO,IAAS;QACd,IAAI,OAAO,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;QACzC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,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;;ACX5B;AAAA,mFAAmF;AACnF,8FAA8F;AAC9F,yEAAyE;AACzE,gFAAgF;AAEhF,mFALmF;AAK5E,IAAM,WAAW,GAAG;IACzB,UAAU,EAAE,KAAK;CAClB,CAAC","file":"main.bundle.js","sourcesContent":["exports = module.exports = require(\"../../node_modules/css-loader/lib/css-base.js\")();\n// imports\n\n\n// module\nexports.push([module.id, \".custom-close {\\r\\n float:right;\\r\\n}\\r\\n\", \"\"]);\n\n// exports\n\n\n/*** EXPORTS FROM exports-loader ***/\nmodule.exports = module.exports.toString();\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/app.component.css\n// module id = 144\n// module chunks = 1","exports = module.exports = require(\"../../../../node_modules/css-loader/lib/css-base.js\")();\n// imports\n\n\n// module\nexports.push([module.id, \"\", \"\"]);\n\n// exports\n\n\n/*** EXPORTS FROM exports-loader ***/\nmodule.exports = module.exports.toString();\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/book/book-detail/book-detail.component.css\n// module id = 145\n// module chunks = 1","exports = module.exports = require(\"../../../../node_modules/css-loader/lib/css-base.js\")();\n// imports\n\n\n// module\nexports.push([module.id, \".custom-close {\\r\\n float:right;\\r\\n}\\r\\n\", \"\"]);\n\n// exports\n\n\n/*** EXPORTS FROM exports-loader ***/\nmodule.exports = module.exports.toString();\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/book/book-list/book-list.component.css\n// module id = 146\n// module chunks = 1","exports = module.exports = require(\"../../../node_modules/css-loader/lib/css-base.js\")();\n// imports\n\n\n// module\nexports.push([module.id, \"div.progress {\\r\\n margin-top: 5px;\\r\\n}\\r\\n\\r\\n.rating:hover {\\r\\n border: solid blue;\\r\\n}\\r\\n\\r\\n.selected {\\r\\n border: solid blue;\\r\\n}\\r\\n\", \"\"]);\n\n// exports\n\n\n/*** EXPORTS FROM exports-loader ***/\nmodule.exports = module.exports.toString();\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/rating/rating.component.css\n// module id = 147\n// module chunks = 1","module.exports = \"\\n\\n
\\n
\\n

Book Rater App

\\n

Keep track of all the latest books and their ratings.

\\n
\\n
\\n\\n
\\n
\\n
\\n
\\n
\\n
\\n \\n
\\n
\\n
\\n
\\n \\n
\\n
\\n
\\n
\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/app.component.html\n// module id = 149\n// module chunks = 1","module.exports = \"
\\n
\\n \\n

Title: {{selectedBook.title}}

\\n
Author: {{selectedBook.author}}
\\n

A quick summary of the book

\\n \\n
\\n
\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/book/book-detail/book-detail.component.html\n// module id = 150\n// module chunks = 1","module.exports = \"
\\n
\\n
\\n
\\n \\n \\n \\n

Title: {{book.title}}

\\n
Author: {{book.author}}
\\n
\\n \\n \\n
\\n
\\n \\n \\n
\\n
\\n \\n \\n
\\n \\n
\\n
\\n\\n
\\n
\\n
\\n
\\n
\\n
\\n
\\n \\n

Add New Book

\\n
\\n \\n \\n
\\n
\\n \\n \\n
\\n
\\n \\n \\n
\\n \\n
\\n
\\n\\n
\\n
\\n\\n
\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/book/book-list/book-list.component.html\n// module id = 151\n// module chunks = 1","module.exports = \"Ratings:\\n
\\n
\\n
\\n
\\n
\\n
\\n
\\n \\n
\\n
\\n\\n
\\n
\\n \\n
\\n \\n \\n \\n
\\n\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/rating/rating.component.html\n// module id = 152\n// module chunks = 1","import {Injectable} from \"@angular/core\";\nimport {Observable} from \"rxjs\";\nimport {Response, Http, Headers, RequestOptions} from \"@angular/http\";\nimport {Book} from \"./book\";\nimport {Rating} from \"./rating\";\n\n@Injectable()\nexport class HttpService {\n\n constructor(private http: Http) { }\n\n login(user: any): Observable {\n let options = this.makeAuthOptions(user);\n return this.http.get(\"/me\", options)\n }\n\n logout(user: any): Observable {\n let options = this.makeAuthOptions(user);\n return this.http.post(\"/logout\", '', options)\n }\n\n getBooks(): Observable {\n let headers = new Headers({'Content-Type': 'application/json'});\n let options = new RequestOptions({headers: headers});\n return this.http.get(\"/book-service/books\", options)\n }\n\n updateBook(newBook: Book, user: any): Observable {\n let options = this.makeAuthOptions(user);\n return this.http.put(\"/book-service/books/\" + newBook.id, newBook, options)\n }\n\n deleteBook(book: Book, user: any): Observable {\n let options = this.makeAuthOptions(user);\n return this.http.delete(\"/book-service/books/\" + book.id, options)\n }\n\n createBook(newBook: Book, user: any): Observable {\n let options = this.makeAuthOptions(user);\n return this.http.post(\"/book-service/books\", newBook, options)\n }\n\n getRatings(bookId: number, user: any): Observable {\n let options = this.makeAuthOptions(user);\n return this.http.get(\"/rating-service/ratings?bookId=\" + bookId, options)\n }\n\n createRating(rating: Rating, user: any): Observable {\n let options = this.makeAuthOptions(user);\n return this.http.post(\"/rating-service/ratings\", rating, options)\n }\n\n deleteRating(ratingId: number, user: any) {\n let options = this.makeAuthOptions(user);\n return this.http.delete(\"/rating-service/ratings/\" + ratingId, options)\n }\n\n updateRating(rating: Rating, user: any) {\n let options = this.makeAuthOptions(user);\n return this.http.put(\"/rating-service/ratings/\" + rating.id, rating, options)\n }\n\n private makeAuthOptions(user: any): RequestOptions {\n let headers = new Headers({'Content-Type': 'application/json'});\n headers.append('Authorization','Basic ' + btoa(user.username + ':' + user.password));\n headers.append('X-Requested-With','XMLHttpRequest');\n return new RequestOptions({headers: headers});;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/app/http.service.ts","/**\r\n * Created by tschi on 4/16/2017.\r\n */\r\nexport class Principal {\r\n public authenticated: boolean;\r\n public authorities: Authority[] = [];\r\n public credentials: any;\r\n\r\n constructor(authenticated: boolean, authorities: any[], credentials: any) {\r\n this.authenticated = authenticated;\r\n authorities.map(auth => this.authorities.push(new Authority(auth.authority)))\r\n this.credentials = credentials;\r\n }\r\n\r\n isAdmin() {\r\n return this.authorities.some((auth: Authority) => auth.authority.indexOf('ADMIN') > -1)\r\n }\r\n}\r\n\r\nexport class Authority {\r\n public authority: String;\r\n\r\n constructor(authority: String) {\r\n this.authority = authority;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/app/principal.ts","/**\r\n * Created by tschi on 4/17/2017.\r\n */\r\nexport class Book {\r\n id: number;\r\n author: String;\r\n title: String;\r\n constructor(id: number, author: String, title: String){\r\n this.id = id;\r\n this.author = author;\r\n this.title = title;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/app/book.ts","function webpackEmptyContext(req) {\n\tthrow new Error(\"Cannot find module '\" + req + \"'.\");\n}\nwebpackEmptyContext.keys = function() { return []; };\nwebpackEmptyContext.resolve = webpackEmptyContext;\nmodule.exports = webpackEmptyContext;\nwebpackEmptyContext.id = 74;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src async\n// module id = 74\n// module chunks = 1","import {enableProdMode} from \"@angular/core\";\nimport {platformBrowserDynamic} from \"@angular/platform-browser-dynamic\";\nimport {AppModule} from \"./app/app.module\";\nimport {environment} from \"./environments/environment\";\n\nif (environment.production) {\n enableProdMode();\n}\n\nplatformBrowserDynamic().bootstrapModule(AppModule);\n\n\n\n// WEBPACK FOOTER //\n// ./src/main.ts","import {Component} from \"@angular/core\";\nimport {Principal} from \"./principal\";\nimport {Response} from \"@angular/http\";\nimport {NgForm} from \"@angular/forms\";\nimport {Book} from \"./book\";\nimport {HttpService} from \"./http.service\";\n\n@Component({\n selector: 'app-root',\n templateUrl: './app.component.html',\n styleUrls: ['./app.component.css']\n})\nexport class AppComponent {\n credentials = {\n username: '',\n password: ''\n };\n\n selectedBook: Book = null;\n\n private username: String = '';\n private password: String = '';\n\n\n principal: Principal = new Principal(false, [], null);\n // principal: Principal = new Principal(true, [new Authority(\"ROLE_USER\")], {username: 'user', password: 'password'});\n\n loginFailed: boolean = false;\n\n constructor(private httpService: HttpService){}\n\n ngOnInit(): void {\n\n }\n\n onLogin(form: NgForm) {\n this.loginFailed = false;\n this.credentials = {username: form.value.username, password: form.value.password};\n this.httpService.login(this.credentials)\n .subscribe((response: Response) => {\n let principalJson = response.json();\n this.principal = new Principal(principalJson.authenticated, principalJson.authorities, this.credentials);\n }, (error) => {\n console.log(error);\n });\n }\n\n onLogout() {\n this.httpService.logout(this.principal.credentials)\n .subscribe((response: Response) => {\n if (response.status === 204) {\n this.loginFailed = false;\n this.credentials.username = '';\n this.credentials.password = '';\n this.principal = new Principal(false, [], null);\n }\n }, (error) => {\n console.log(error);\n });\n }\n\n closeBookDetail() {\n this.selectedBook = null;\n }\n\n selectBook(book: Book) {\n this.selectedBook = book;\n }\n\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/app/app.component.ts","import {BrowserModule} from \"@angular/platform-browser\";\nimport {NgModule} from \"@angular/core\";\nimport {FormsModule} from \"@angular/forms\";\nimport {HttpModule} from \"@angular/http\";\nimport {AppComponent} from \"./app.component\";\nimport {RatingComponent} from \"./rating/rating.component\";\nimport {ClickStopPropagationDirective} from \"./click-stop-propagation.directive\";\nimport {BookDetailComponent} from \"./book/book-detail/book-detail.component\";\nimport {BookListComponent} from \"./book/book-list/book-list.component\";\nimport {HttpService} from \"./http.service\";\n\n@NgModule({\n declarations: [\n AppComponent,\n RatingComponent,\n ClickStopPropagationDirective,\n BookDetailComponent,\n BookListComponent\n ],\n imports: [\n BrowserModule,\n FormsModule,\n HttpModule\n ],\n providers: [HttpService],\n bootstrap: [AppComponent]\n})\nexport class AppModule { }\n\n\n\n// WEBPACK FOOTER //\n// ./src/app/app.module.ts","import {Component, OnInit, Input, Output, EventEmitter} from \"@angular/core\";\nimport {Book} from \"../../book\";\nimport {Principal} from \"../../principal\";\n\n@Component({\n selector: 'app-book-detail',\n templateUrl: './book-detail.component.html',\n styleUrls: ['./book-detail.component.css']\n})\nexport class BookDetailComponent implements OnInit {\n\n @Input() selectedBook: Book = null;\n @Input() principal: Principal = null;\n @Output() closeBook: EventEmitter = new EventEmitter();\n\n\n constructor() { }\n\n ngOnInit() {\n }\n\n closeBookDetail() {\n this.closeBook.emit(null);\n }\n\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/app/book/book-detail/book-detail.component.ts","import {Component, OnInit, Input, Output, EventEmitter} from \"@angular/core\";\nimport {Principal} from \"../../principal\";\nimport {Book} from \"../../book\";\nimport {Response} from \"@angular/http\";\nimport {HttpService} from \"../../http.service\";\n\n@Component({\n selector: 'app-book-list',\n templateUrl: './book-list.component.html',\n styleUrls: ['./book-list.component.css']\n})\nexport class BookListComponent implements OnInit {\n\n @Input() principal: Principal = null;\n @Output() onBookSelected: EventEmitter = new EventEmitter();\n\n books: Book[] = [];\n newBooks: Book[] = [];\n newBook: Book = new Book(Math.floor(Math.random() * 1000), '', '');\n booksToEdit: number[] = [];\n isAddNewBook: boolean = false;\n selectedBook: Book = null;\n\n constructor(private httpService: HttpService) { }\n\n ngOnInit() {\n this.loadBooks();\n }\n\n loadBooks() {\n this.httpService.getBooks()\n .subscribe((response: Response) => {\n let booksJson: any[] = response.json()\n booksJson.forEach(book => {\n this.books.push(new Book(book.id, book.author, book.title));\n this.newBooks.push(new Book(book.id, book.author, book.title));\n })\n }, (error) => {\n console.log(error);\n });\n }\n\n cancelEditBook(bookIndex: number) {\n if (this.booksToEdit.indexOf(bookIndex) !== -1) {\n this.booksToEdit.splice(this.booksToEdit.indexOf(bookIndex), 1); //remove the index of the book to edit\n //get the original book\n let bookCopy: Book = new Book(this.books[bookIndex].id, this.books[bookIndex].author, this.books[bookIndex].title);\n this.newBooks.splice(bookIndex,1,bookCopy); //replace the edited book with the old book\n }\n }\n\n editBook(bookIndex: number) {\n this.booksToEdit.push(bookIndex);\n }\n\n saveBook(bookIndex: number, newBook: Book) {\n console.log(newBook);\n //save the book to the database\n this.httpService.updateBook(newBook, this.principal.credentials)\n .subscribe((response: Response) => {\n let bookJson = response.json();\n let book: Book = new Book(bookJson.id, bookJson.author, bookJson.title);\n //update the current array of books\n let bookArr: Book = this.books.find(b => b.id === book.id);\n bookArr.title = book.title;\n bookArr.author = book.author;\n this.booksToEdit.splice(this.booksToEdit.indexOf(bookIndex), 1); //remove the index of the book to edit\n }, (error) => {\n console.log(error);\n });\n\n\n }\n\n delete(bookIndex: number) {\n let book: Book = this.books[bookIndex];\n this.httpService.deleteBook(book, this.principal.credentials)\n .subscribe(() => {\n if (this.selectedBook !== null && this.books[bookIndex].id === this.selectedBook.id) {this.selectedBook = null;}\n\n this.books.splice(bookIndex, 1); //remove the book at this index;\n this.newBooks.splice(bookIndex, 1); //remove the editing book at this index\n }, (error) => {\n console.log(error);\n });\n }\n\n activateAddNewBook() {\n this.isAddNewBook = true;\n this.newBook = new Book(null, '', '');\n }\n\n addNewBook(newBook: Book, element: any) {\n //write new book to db\n this.httpService.createBook(newBook, this.principal.credentials)\n .subscribe((response: Response) => {\n let bookJson = response.json();\n let book: Book = new Book(bookJson.id, bookJson.author, bookJson.title);\n console.log(book);\n this.books.push(book);\n this.newBooks.push(book);\n this.newBook = new Book(Math.floor(Math.random() * 1000), '', '');\n element.focus();\n }, (error) => {\n console.log(error);\n });\n }\n\n cancelAddBook() {\n this.isAddNewBook = false;\n }\n\n\n selectBook(book: Book) {\n this.selectedBook = book;\n this.onBookSelected.emit(book);\n }\n\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/app/book/book-list/book-list.component.ts","import {Directive, HostListener} from \"@angular/core\";\n\n@Directive({\n selector: '[appClickStopPropagation]'\n})\nexport class ClickStopPropagationDirective\n{\n @HostListener(\"click\", [\"$event\"])\n public onClick(event: any): void\n {\n event.stopPropagation();\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/app/click-stop-propagation.directive.ts","/**\r\n * Created by tschi on 4/17/2017.\r\n */\r\nexport class Rating{\r\n id: number;\r\n bookId: number;\r\n stars: number;\r\n\r\n constructor(id: number, bookId: number, stars: number) {\r\n this.id = id;\r\n this.bookId = bookId;\r\n this.stars = stars;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/app/rating.ts","import {Component, OnInit, Input, OnChanges} from \"@angular/core\";\nimport {Rating} from \"../rating\";\nimport {Principal} from \"../principal\";\nimport {HttpService} from \"../http.service\";\nimport {Response} from \"@angular/http\";\n\n@Component({\n selector: 'app-rating',\n templateUrl: './rating.component.html',\n styleUrls: ['./rating.component.css']\n})\nexport class RatingComponent implements OnInit, OnChanges {\n\n @Input() bookId: number;\n @Input() principal: Principal = null;\n ratings: Rating[] = [];\n stars: number[] = [1,2,3,4,5];\n newRating: Rating = null;\n\n constructor(private httpService: HttpService) { }\n\n ngOnInit() {}\n\n ngOnChanges() {\n this.newRating = new Rating(null, this.bookId, 1);\n this.ratings = [];\n this.loadRatings();\n }\n\n findWidth(rating: Rating): String {\n let percent: number = (rating.stars/5)*100;\n return percent.toString() + '%';\n }\n\n private loadRatings() {\n this.httpService.getRatings(this.bookId, this.principal.credentials)\n .subscribe((response: Response) => {\n let responseJson: any[] = response.json();\n responseJson.forEach(rating => this.ratings.push(new Rating(rating.id, rating.bookId, rating.stars)))\n }, (error) => {\n console.log(error);\n });\n }\n\n onSaveRating() {\n console.log(this.newRating);\n let ratingCopy: Rating = Object.assign({}, this.newRating);\n this.httpService.createRating(ratingCopy, this.principal.credentials)\n .subscribe((response: Response) => {\n let ratingJson = response.json()\n this.ratings.push(new Rating(ratingJson.id, ratingJson.bookId, ratingJson.stars))\n }, (error) => {\n console.log(error);\n });\n }\n\n updateRating() {\n this.httpService.updateRating(this.newRating, this.principal.credentials)\n .subscribe(() => {\n this.newRating = new Rating(null, this.bookId, 1);\n }, (error) => {\n console.log(error);\n });\n }\n\n selectRating(rating: Rating) {\n if (this.principal.isAdmin()) {\n this.newRating = rating;\n }\n }\n\n cancelSelection() {\n this.newRating = new Rating(null, this.bookId, 1);\n }\n\n deleteRating(index: number) {\n let rating = this.ratings[index];\n this.httpService.deleteRating(rating.id, this.principal.credentials)\n .subscribe(() => {\n if (this.ratings[index] === this.newRating) {\n this.newRating = new Rating(null, this.bookId, 1);\n }\n this.ratings.splice(index, 1);\n }, (error) => {\n console.log(error);\n });\n\n }\n\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/app/rating/rating.component.ts","// The file contents for the current environment will overwrite these during build.\n// The build system defaults to the dev environment which uses `environment.ts`, but if you do\n// `ng build --env=prod` then `environment.prod.ts` will be used instead.\n// The list of which env maps to which file can be found in `.angular-cli.json`.\n\nexport const environment = {\n production: false\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/environments/environment.ts"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///./src/app/app.component.css","webpack:///./src/app/book/book-detail/book-detail.component.css","webpack:///./src/app/book/book-list/book-list.component.css","webpack:///./src/app/rating/rating.component.css","webpack:///./src/app/app.component.html","webpack:///./src/app/book/book-detail/book-detail.component.html","webpack:///./src/app/book/book-list/book-list.component.html","webpack:///./src/app/rating/rating.component.html","webpack:///./src/app/http.service.ts","webpack:///./src/app/principal.ts","webpack:///./src/app/book.ts","webpack:///./src async","webpack:///./src/main.ts","webpack:///./src/app/app.component.ts","webpack:///./src/app/app.module.ts","webpack:///./src/app/book/book-detail/book-detail.component.ts","webpack:///./src/app/book/book-list/book-list.component.ts","webpack:///./src/app/click-stop-propagation.directive.ts","webpack:///./src/app/rating.ts","webpack:///./src/app/rating/rating.component.ts","webpack:///./src/environments/environment.ts"],"names":[],"mappings":";;;;;AAAA;AACA;;;AAGA;AACA,wCAAyC,kBAAkB,KAAK;;AAEhE;;;AAGA;AACA,2C;;;;;;;ACXA;AACA;;;AAGA;AACA;;AAEA;;;AAGA;AACA,2C;;;;;;;ACXA;AACA;;;AAGA;AACA,wCAAyC,kBAAkB,KAAK;;AAEhE;;;AAGA;AACA,2C;;;;;;;ACXA;AACA;;;AAGA;AACA,uCAAwC,sBAAsB,KAAK,uBAAuB,yBAAyB,KAAK,mBAAmB,yBAAyB,KAAK;;AAEzK;;;AAGA;AACA,2C;;;;;;;ACXA,ooBAAooB,20D;;;;;;;ACApoB,+MAA+M,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,CAAC;gBAC3C,KAAI,CAAC,SAAS,GAAG,IAAI,uDAAM,CAAC,IAAI,EAAE,KAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;YACpD,CAAC;YACD,KAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QAChC,CAAC,EAAE,UAAC,KAAK;YACP,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC,CAAC,CAAC;IAEP,CAAC;IAEH,sBAAC;AAAD,CAAC;AA5EU;IAAR,mFAAK,EAAE;;+CAAgB;AACf;IAAR,mFAAK,EAAE;kDAAY,6DAAS,oBAAT,6DAAS;kDAAQ;AAH1B,eAAe;IAL3B,wFAAS,CAAC;QACT,QAAQ,EAAE,YAAY;QACtB,kCAAsC;QACtC,kCAAqC;KACtC,CAAC;yDASiC,kEAAW,oBAAX,kEAAW;GARjC,eAAe,CA8E3B;AA9E2B;;;;;;;;;;ACX5B;AAAA,mFAAmF;AACnF,8FAA8F;AAC9F,yEAAyE;AACzE,gFAAgF;AAEhF,mFALmF;AAK5E,IAAM,WAAW,GAAG;IACzB,UAAU,EAAE,KAAK;CAClB,CAAC","file":"main.bundle.js","sourcesContent":["exports = module.exports = require(\"../../node_modules/css-loader/lib/css-base.js\")();\n// imports\n\n\n// module\nexports.push([module.id, \".custom-close {\\r\\n float:right;\\r\\n}\\r\\n\", \"\"]);\n\n// exports\n\n\n/*** EXPORTS FROM exports-loader ***/\nmodule.exports = module.exports.toString();\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/app.component.css\n// module id = 144\n// module chunks = 1","exports = module.exports = require(\"../../../../node_modules/css-loader/lib/css-base.js\")();\n// imports\n\n\n// module\nexports.push([module.id, \"\", \"\"]);\n\n// exports\n\n\n/*** EXPORTS FROM exports-loader ***/\nmodule.exports = module.exports.toString();\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/book/book-detail/book-detail.component.css\n// module id = 145\n// module chunks = 1","exports = module.exports = require(\"../../../../node_modules/css-loader/lib/css-base.js\")();\n// imports\n\n\n// module\nexports.push([module.id, \".custom-close {\\r\\n float:right;\\r\\n}\\r\\n\", \"\"]);\n\n// exports\n\n\n/*** EXPORTS FROM exports-loader ***/\nmodule.exports = module.exports.toString();\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/book/book-list/book-list.component.css\n// module id = 146\n// module chunks = 1","exports = module.exports = require(\"../../../node_modules/css-loader/lib/css-base.js\")();\n// imports\n\n\n// module\nexports.push([module.id, \"div.progress {\\r\\n margin-top: 5px;\\r\\n}\\r\\n\\r\\n.rating:hover {\\r\\n border: solid blue;\\r\\n}\\r\\n\\r\\n.selected {\\r\\n border: solid blue;\\r\\n}\\r\\n\", \"\"]);\n\n// exports\n\n\n/*** EXPORTS FROM exports-loader ***/\nmodule.exports = module.exports.toString();\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/rating/rating.component.css\n// module id = 147\n// module chunks = 1","module.exports = \"\\n\\n
\\n
\\n

Book Rater App

\\n

Anyone can view the books.

\\n

Users can view and create ratings

\\n

Admins can do anything!

\\n
\\n
\\n\\n
\\n
\\n
\\n
\\n
\\n
\\n \\n
\\n
\\n
\\n
\\n \\n
\\n
\\n
\\n
\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/app.component.html\n// module id = 149\n// module chunks = 1","module.exports = \"
\\n
\\n \\n

Title: {{selectedBook.title}}

\\n
Author: {{selectedBook.author}}
\\n

A quick summary of the book

\\n \\n
\\n
\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/book/book-detail/book-detail.component.html\n// module id = 150\n// module chunks = 1","module.exports = \"
\\n
\\n
\\n
\\n \\n \\n \\n

Title: {{book.title}}

\\n
Author: {{book.author}}
\\n
\\n \\n \\n
\\n
\\n \\n \\n
\\n
\\n \\n \\n
\\n \\n
\\n
\\n\\n
\\n
\\n
\\n
\\n
\\n
\\n
\\n \\n

Add New Book

\\n
\\n \\n \\n
\\n
\\n \\n \\n
\\n
\\n \\n \\n
\\n \\n
\\n
\\n\\n
\\n
\\n\\n
\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/book/book-list/book-list.component.html\n// module id = 151\n// module chunks = 1","module.exports = \"Ratings:\\n
\\n
\\n
\\n
\\n
\\n
\\n
\\n \\n
\\n
\\n\\n
\\n
\\n \\n
\\n \\n \\n \\n
\\n\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/rating/rating.component.html\n// module id = 152\n// module chunks = 1","import {Injectable} from \"@angular/core\";\nimport {Observable} from \"rxjs\";\nimport {Response, Http, Headers, RequestOptions} from \"@angular/http\";\nimport {Book} from \"./book\";\nimport {Rating} from \"./rating\";\n\n@Injectable()\nexport class HttpService {\n\n constructor(private http: Http) { }\n\n login(user: any): Observable {\n let options = this.makeAuthOptions(user);\n return this.http.get(\"/me\", options)\n }\n\n logout(user: any): Observable {\n let options = this.makeAuthOptions(user);\n return this.http.post(\"/logout\", '', options)\n }\n\n getBooks(): Observable {\n let headers = new Headers({'Content-Type': 'application/json'});\n let options = new RequestOptions({headers: headers});\n return this.http.get(\"/book-service/books\", options)\n }\n\n updateBook(newBook: Book, user: any): Observable {\n let options = this.makeAuthOptions(user);\n return this.http.put(\"/book-service/books/\" + newBook.id, newBook, options)\n }\n\n deleteBook(book: Book, user: any): Observable {\n let options = this.makeAuthOptions(user);\n return this.http.delete(\"/book-service/books/\" + book.id, options)\n }\n\n createBook(newBook: Book, user: any): Observable {\n let options = this.makeAuthOptions(user);\n return this.http.post(\"/book-service/books\", newBook, options)\n }\n\n getRatings(bookId: number, user: any): Observable {\n let options = this.makeAuthOptions(user);\n return this.http.get(\"/rating-service/ratings?bookId=\" + bookId, options)\n }\n\n createRating(rating: Rating, user: any): Observable {\n let options = this.makeAuthOptions(user);\n return this.http.post(\"/rating-service/ratings\", rating, options)\n }\n\n deleteRating(ratingId: number, user: any) {\n let options = this.makeAuthOptions(user);\n return this.http.delete(\"/rating-service/ratings/\" + ratingId, options)\n }\n\n updateRating(rating: Rating, user: any) {\n let options = this.makeAuthOptions(user);\n return this.http.put(\"/rating-service/ratings/\" + rating.id, rating, options)\n }\n\n private makeAuthOptions(user: any): RequestOptions {\n let headers = new Headers({'Content-Type': 'application/json'});\n headers.append('Authorization','Basic ' + btoa(user.username + ':' + user.password));\n headers.append('X-Requested-With','XMLHttpRequest');\n return new RequestOptions({headers: headers});;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/app/http.service.ts","/**\r\n * Created by tschi on 4/16/2017.\r\n */\r\nexport class Principal {\r\n public authenticated: boolean;\r\n public authorities: Authority[] = [];\r\n public credentials: any;\r\n\r\n constructor(authenticated: boolean, authorities: any[], credentials: any) {\r\n this.authenticated = authenticated;\r\n authorities.map(auth => this.authorities.push(new Authority(auth.authority)))\r\n this.credentials = credentials;\r\n }\r\n\r\n isAdmin() {\r\n return this.authorities.some((auth: Authority) => auth.authority.indexOf('ADMIN') > -1)\r\n }\r\n}\r\n\r\nexport class Authority {\r\n public authority: String;\r\n\r\n constructor(authority: String) {\r\n this.authority = authority;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/app/principal.ts","/**\r\n * Created by tschi on 4/17/2017.\r\n */\r\nexport class Book {\r\n id: number;\r\n author: String;\r\n title: String;\r\n constructor(id: number, author: String, title: String){\r\n this.id = id;\r\n this.author = author;\r\n this.title = title;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/app/book.ts","function webpackEmptyContext(req) {\n\tthrow new Error(\"Cannot find module '\" + req + \"'.\");\n}\nwebpackEmptyContext.keys = function() { return []; };\nwebpackEmptyContext.resolve = webpackEmptyContext;\nmodule.exports = webpackEmptyContext;\nwebpackEmptyContext.id = 74;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src async\n// module id = 74\n// module chunks = 1","import {enableProdMode} from \"@angular/core\";\nimport {platformBrowserDynamic} from \"@angular/platform-browser-dynamic\";\nimport {AppModule} from \"./app/app.module\";\nimport {environment} from \"./environments/environment\";\n\nif (environment.production) {\n enableProdMode();\n}\n\nplatformBrowserDynamic().bootstrapModule(AppModule);\n\n\n\n// WEBPACK FOOTER //\n// ./src/main.ts","import {Component} from \"@angular/core\";\nimport {Principal} from \"./principal\";\nimport {Response} from \"@angular/http\";\nimport {NgForm} from \"@angular/forms\";\nimport {Book} from \"./book\";\nimport {HttpService} from \"./http.service\";\n\n@Component({\n selector: 'app-root',\n templateUrl: './app.component.html',\n styleUrls: ['./app.component.css']\n})\nexport class AppComponent {\n credentials = {\n username: '',\n password: ''\n };\n selectedBook: Book = null;\n principal: Principal = new Principal(false, [], null);\n loginFailed: boolean = false;\n\n constructor(private httpService: HttpService){}\n\n ngOnInit(): void {}\n\n onLogin(form: NgForm) {\n this.loginFailed = false;\n this.credentials = {username: form.value.username, password: form.value.password};\n this.httpService.login(this.credentials)\n .subscribe((response: Response) => {\n let principalJson = response.json();\n this.principal = new Principal(principalJson.authenticated, principalJson.authorities, this.credentials);\n }, (error) => {\n console.log(error);\n });\n }\n\n onLogout() {\n this.httpService.logout(this.principal.credentials)\n .subscribe((response: Response) => {\n if (response.status === 204) {\n this.loginFailed = false;\n this.credentials.username = '';\n this.credentials.password = '';\n this.principal = new Principal(false, [], null);\n }\n }, (error) => {\n console.log(error);\n });\n }\n\n closeBookDetail() {\n this.selectedBook = null;\n }\n\n selectBook(book: Book) {\n this.selectedBook = book;\n }\n\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/app/app.component.ts","import {BrowserModule} from \"@angular/platform-browser\";\nimport {NgModule} from \"@angular/core\";\nimport {FormsModule} from \"@angular/forms\";\nimport {HttpModule} from \"@angular/http\";\nimport {AppComponent} from \"./app.component\";\nimport {RatingComponent} from \"./rating/rating.component\";\nimport {ClickStopPropagationDirective} from \"./click-stop-propagation.directive\";\nimport {BookDetailComponent} from \"./book/book-detail/book-detail.component\";\nimport {BookListComponent} from \"./book/book-list/book-list.component\";\nimport {HttpService} from \"./http.service\";\n\n@NgModule({\n declarations: [\n AppComponent,\n RatingComponent,\n ClickStopPropagationDirective,\n BookDetailComponent,\n BookListComponent\n ],\n imports: [\n BrowserModule,\n FormsModule,\n HttpModule\n ],\n providers: [HttpService],\n bootstrap: [AppComponent]\n})\nexport class AppModule { }\n\n\n\n// WEBPACK FOOTER //\n// ./src/app/app.module.ts","import {Component, OnInit, Input, Output, EventEmitter} from \"@angular/core\";\nimport {Book} from \"../../book\";\nimport {Principal} from \"../../principal\";\n\n@Component({\n selector: 'app-book-detail',\n templateUrl: './book-detail.component.html',\n styleUrls: ['./book-detail.component.css']\n})\nexport class BookDetailComponent implements OnInit {\n\n @Input() selectedBook: Book = null;\n @Input() principal: Principal = null;\n @Output() closeBook: EventEmitter = new EventEmitter();\n\n\n constructor() { }\n\n ngOnInit() {\n }\n\n closeBookDetail() {\n this.closeBook.emit(null);\n }\n\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/app/book/book-detail/book-detail.component.ts","import {Component, OnInit, Input, Output, EventEmitter} from \"@angular/core\";\nimport {Principal} from \"../../principal\";\nimport {Book} from \"../../book\";\nimport {Response} from \"@angular/http\";\nimport {HttpService} from \"../../http.service\";\n\n@Component({\n selector: 'app-book-list',\n templateUrl: './book-list.component.html',\n styleUrls: ['./book-list.component.css']\n})\nexport class BookListComponent implements OnInit {\n\n @Input() principal: Principal = null;\n @Output() onBookSelected: EventEmitter = new EventEmitter();\n\n books: Book[] = [];\n newBooks: Book[] = [];\n newBook: Book = new Book(Math.floor(Math.random() * 1000), '', '');\n booksToEdit: number[] = [];\n isAddNewBook: boolean = false;\n selectedBook: Book = null;\n\n constructor(private httpService: HttpService) { }\n\n ngOnInit() {\n this.loadBooks();\n }\n\n loadBooks() {\n this.httpService.getBooks()\n .subscribe((response: Response) => {\n let booksJson: any[] = response.json()\n booksJson.forEach(book => {\n this.books.push(new Book(book.id, book.author, book.title));\n this.newBooks.push(new Book(book.id, book.author, book.title));\n })\n }, (error) => {\n console.log(error);\n });\n }\n\n cancelEditBook(bookIndex: number) {\n if (this.booksToEdit.indexOf(bookIndex) !== -1) {\n this.booksToEdit.splice(this.booksToEdit.indexOf(bookIndex), 1); //remove the index of the book to edit\n //get the original book\n let bookCopy: Book = new Book(this.books[bookIndex].id, this.books[bookIndex].author, this.books[bookIndex].title);\n this.newBooks.splice(bookIndex,1,bookCopy); //replace the edited book with the old book\n }\n }\n\n editBook(bookIndex: number) {\n this.booksToEdit.push(bookIndex);\n }\n\n saveBook(bookIndex: number, newBook: Book) {\n console.log(newBook);\n //save the book to the database\n this.httpService.updateBook(newBook, this.principal.credentials)\n .subscribe((response: Response) => {\n let bookJson = response.json();\n let book: Book = new Book(bookJson.id, bookJson.author, bookJson.title);\n //update the current array of books\n let bookArr: Book = this.books.find(b => b.id === book.id);\n bookArr.title = book.title;\n bookArr.author = book.author;\n this.booksToEdit.splice(this.booksToEdit.indexOf(bookIndex), 1); //remove the index of the book to edit\n }, (error) => {\n console.log(error);\n });\n\n\n }\n\n delete(bookIndex: number) {\n let book: Book = this.books[bookIndex];\n this.httpService.deleteBook(book, this.principal.credentials)\n .subscribe(() => {\n if (this.selectedBook !== null && this.books[bookIndex].id === this.selectedBook.id) {this.selectedBook = null;}\n\n this.books.splice(bookIndex, 1); //remove the book at this index;\n this.newBooks.splice(bookIndex, 1); //remove the editing book at this index\n }, (error) => {\n console.log(error);\n });\n }\n\n activateAddNewBook() {\n this.isAddNewBook = true;\n this.newBook = new Book(null, '', '');\n }\n\n addNewBook(newBook: Book, element: any) {\n //write new book to db\n this.httpService.createBook(newBook, this.principal.credentials)\n .subscribe((response: Response) => {\n let bookJson = response.json();\n let book: Book = new Book(bookJson.id, bookJson.author, bookJson.title);\n console.log(book);\n this.books.push(book);\n this.newBooks.push(book);\n this.newBook = new Book(Math.floor(Math.random() * 1000), '', '');\n element.focus();\n }, (error) => {\n console.log(error);\n });\n }\n\n cancelAddBook() {\n this.isAddNewBook = false;\n }\n\n\n selectBook(book: Book) {\n this.selectedBook = book;\n this.onBookSelected.emit(book);\n }\n\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/app/book/book-list/book-list.component.ts","import {Directive, HostListener} from \"@angular/core\";\n\n@Directive({\n selector: '[appClickStopPropagation]'\n})\nexport class ClickStopPropagationDirective\n{\n @HostListener(\"click\", [\"$event\"])\n public onClick(event: any): void\n {\n event.stopPropagation();\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/app/click-stop-propagation.directive.ts","/**\r\n * Created by tschi on 4/17/2017.\r\n */\r\nexport class Rating{\r\n id: number;\r\n bookId: number;\r\n stars: number;\r\n\r\n constructor(id: number, bookId: number, stars: number) {\r\n this.id = id;\r\n this.bookId = bookId;\r\n this.stars = stars;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/app/rating.ts","import {Component, OnInit, Input, OnChanges} from \"@angular/core\";\nimport {Rating} from \"../rating\";\nimport {Principal} from \"../principal\";\nimport {HttpService} from \"../http.service\";\nimport {Response} from \"@angular/http\";\n\n@Component({\n selector: 'app-rating',\n templateUrl: './rating.component.html',\n styleUrls: ['./rating.component.css']\n})\nexport class RatingComponent implements OnInit, OnChanges {\n\n @Input() bookId: number;\n @Input() principal: Principal = null;\n ratings: Rating[] = [];\n stars: number[] = [1,2,3,4,5];\n newRating: Rating = null;\n\n constructor(private httpService: HttpService) { }\n\n ngOnInit() {}\n\n ngOnChanges() {\n this.newRating = new Rating(null, this.bookId, 1);\n this.ratings = [];\n this.loadRatings();\n }\n\n findWidth(rating: Rating): String {\n let percent: number = (rating.stars/5)*100;\n return percent.toString() + '%';\n }\n\n private loadRatings() {\n this.httpService.getRatings(this.bookId, this.principal.credentials)\n .subscribe((response: Response) => {\n let responseJson: any[] = response.json();\n responseJson.forEach(rating => this.ratings.push(new Rating(rating.id, rating.bookId, rating.stars)))\n }, (error) => {\n console.log(error);\n });\n }\n\n onSaveRating() {\n console.log(this.newRating);\n let ratingCopy: Rating = Object.assign({}, this.newRating);\n this.httpService.createRating(ratingCopy, this.principal.credentials)\n .subscribe((response: Response) => {\n let ratingJson = response.json()\n this.ratings.push(new Rating(ratingJson.id, ratingJson.bookId, ratingJson.stars))\n }, (error) => {\n console.log(error);\n });\n }\n\n updateRating() {\n this.httpService.updateRating(this.newRating, this.principal.credentials)\n .subscribe(() => {\n this.newRating = new Rating(null, this.bookId, 1);\n }, (error) => {\n console.log(error);\n });\n }\n\n selectRating(rating: Rating) {\n if (this.principal.isAdmin()) {\n this.newRating = rating;\n }\n }\n\n cancelSelection() {\n this.newRating = new Rating(null, this.bookId, 1);\n }\n\n deleteRating(index: number) {\n let rating = this.ratings[index];\n this.httpService.deleteRating(rating.id, this.principal.credentials)\n .subscribe(() => {\n if (this.ratings[index] === this.newRating) {\n this.newRating = new Rating(null, this.bookId, 1);\n }\n this.ratings.splice(index, 1);\n }, (error) => {\n console.log(error);\n });\n\n }\n\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/app/rating/rating.component.ts","// The file contents for the current environment will overwrite these during build.\n// The build system defaults to the dev environment which uses `environment.ts`, but if you do\n// `ng build --env=prod` then `environment.prod.ts` will be used instead.\n// The list of which env maps to which file can be found in `.angular-cli.json`.\n\nexport const environment = {\n production: false\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/environments/environment.ts"],"sourceRoot":""} \ No newline at end of file