Produced by Araxis Merge on 5/14/2018 1:31:40 PM Eastern Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | MCCF_EDI_TAS_Infrastructure.zip\MCCF_EDI_TAS_WebUI\src\app\core\config | config.service.ts | Wed Mar 28 00:02:00 2018 UTC |
| 2 | MCCF_EDI_TAS_Infrastructure.zip\MCCF_EDI_TAS_WebUI\src\app\core\config | config.service.ts | Fri May 11 14:38:40 2018 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 4 | 232 |
| Changed | 3 | 6 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| Whitespace | |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
| 1 | import { H eaders, Ht tp, Respon se } from '@angular/ http' | |
| 2 | ||
| 3 | import { I njectable } from '@a ngular/cor e' | |
| 4 | import { O bservable } from 'rx js/Observa ble' | |
| 5 | ||
| 6 | import { E nvironment Service } from '../. ./core/env /environme nt.service ' | |
| 7 | ||
| 8 | import { L ogLevel } from '../l ogger/log- level' | |
| 9 | // import { Config } from './c onfig' | |
| 10 | ||
| 11 | @Injectabl e() | |
| 12 | export cla ss ConfigS ervice { | |
| 13 | privat e config = {} | |
| 14 | privat e url: str ing | |
| 15 | privat e headers = new Head ers({ 'Aut horization ': 'Bearer ABCD' }) | |
| 16 | ||
| 17 | constr uctor(priv ate http: Http, priv ate env: E nvironment Service) { | |
| 18 | } | |
| 19 | ||
| 20 | public update(na me: string , value: a ny): Obser vable<Resp onse> { | |
| 21 | re turn Obser vable.crea te(observe r => { | |
| 22 | const en vironment = this.env .getEnv() | |
| 23 | this.env .getEnv() | |
| 24 | .sub scribe(env ironment = > { | |
| 25 | this.http. put('/api/ core/v2/co nfig/' + n ame, { val ue: JSON.s tringify(v alue) }, { headers: this.heade rs }) | |
| 26 | .catch (this.hand leError) | |
| 27 | .subsc ribe(resul t => { | |
| 28 | ob server.nex t() | |
| 29 | ob server.com plete() | |
| 30 | }) | |
| 31 | }) | |
| 32 | }) | |
| 33 | } | |
| 34 | ||
| 35 | public load(requ ested: Arr ay<string> ): Observa ble<any> { | |
| 36 | co nst cherry Pick = (co nfig, arra y) => { | |
| 37 | let obj = {} | |
| 38 | array.ma p(p => { | |
| 39 | if ( p in confi g) { | |
| 40 | obj[p] = c onfig[p] | |
| 41 | } | |
| 42 | }) | |
| 43 | return o bj | |
| 44 | } | |
| 45 | re turn Obser vable.crea te(observe r => { | |
| 46 | const ca ched = che rryPick(th is.config, requested ) | |
| 47 | console. log('Confi gService-> cherryPick ~cached', cached) | |
| 48 | if (Obje ct.keys(ca ched).leng th === req uested.len gth) { | |
| 49 | cons ole.log('C onfigServi ce', 'ALRE ADY CACHED ') | |
| 50 | obse rver.next( cached) | |
| 51 | obse rver.compl ete() | |
| 52 | retu rn | |
| 53 | } | |
| 54 | this.env .getEnv() | |
| 55 | .sub scribe(env ironment = > { | |
| 56 | console.lo g('ConfigS ervice->en vironment' , environm ent) | |
| 57 | const miss ing = requ ested.filt er(p => ty peof cache d[p] === ' undefined' ) | |
| 58 | console.lo g('ConfigS ervice->mi ssing', mi ssing) | |
| 59 | const para meter = mi ssing.join (',') | |
| 60 | if (enviro nment.enab le_api === true) { | |
| 61 | this.h ttp | |
| 62 | .g et('/api/c ore/v2/con fig/' + pa rameter, { headers: this.heade rs }) | |
| 63 | .m ap(respons e => { | |
| 64 | return r esponse.js on() | |
| 65 | }) | |
| 66 | .c atch(this. handleErro r) | |
| 67 | .s ubscribe(r esults => { | |
| 68 | this.con fig = Obje ct.assign( {}, this.c onfig, res ults) | |
| 69 | const re sult = che rryPick(th is.config, requested ) | |
| 70 | console. log('Confi gService-> result', r esult) | |
| 71 | observer .next(resu lt) | |
| 72 | observer .complete( ) | |
| 73 | }) | |
| 74 | } else { | |
| 75 | this.c onfig = { | |
| 76 | "m enus": [{ "title": " eInsurance ", "uri": "einsuranc e/home" }, { "title" : "ePharma cy", "uri" : "epharma cy/home" } , { "title ": "eBilli ng", "uri" : "ebillin g/home" }, { "title" : "ePaymen ts", "uri" : "epaymen ts/home" } , { "title ": "Non-MC CF", "uri" : "non-mcc f/home" }, { "title" : "NPI", " uri": "npi /home" }, { "title": "eAdmin", "uri": "e admin/home " }], | |
| 77 | "t ooltips": { "search" : "Enter s earch term .", "conta ct-search" : "Click t o search c ontacts.", "site-wid e-search": "Click to search si te.", "pho ne": "Ente r a phone number.", "rte": "Ri ch text ed itor", "em ailtitle": "Enter em ail title. ", "email" : "Enter e mail addre ss.", "ere venueurl": "Enter eR evenue URL .", "cance l": "Click cancel to discard c hanges.", "save": "C lick to sa ve changes ." }, | |
| 78 | "s econdsForE xternalRed irect": 20 , | |
| 79 | "localDoma ins": "['h ttp:// DNS /']", | |
| 80 | "l ogLevel": "Info", | |
| 81 | "products" : [{ "name ": "home", "erevenue Url": "htt ps:// DNS . URL /sites/eBu sinessSolu tions/Site Pages/Home .aspx" }, { "name": "eBilling" , "erevenu eUrl": "ht tps:// DNS . URL /sites/eBu sinessSolu tions/Site Pages/Home .aspx" }, { "name": "eInsuranc e", "ereve nueUrl": " https:// DNS . URL /sites/eBu sinessSolu tions/Site Pages/Home .aspx" }, { "name": "ePharmacy ", "ereven ueUrl": "h ttps:// DNS . URL /sites/eBu sinessSolu tions/Site Pages/Home .aspx" }, { "name": "ePayments ", "ereven ueUrl": "h ttps:// DNS . URL /sites/eBu sinessSolu tions/Site Pages/Home .aspx" }, { "name": "NPI", "er evenueUrl" : "https:/ / DNS . URL /sites/eBu sinessSolu tions/Site Pages/Home .aspx" }, { "name": "Non-MCCF" , "erevenu eUrl": "ht tps:// DNS . URL /sites/eBu sinessSolu tions/Site Pages/Home .aspx" }], | |
| 82 | "s ite-wide:h elp": "hel p line 1<b r> help li ne2<br> <p >dial <b>9 -1-1</b> f or an emer gency</p>< br><I>Than k you!</I> ", | |
| 83 | "e billing:he lp": "eBil ling!!! !! !! !!!!", | |
| 84 | "e pharmacy:h elp": "ePh armacy !!! !!!! !!!! ", | |
| 85 | "n on-mccf:he lp": " Non -MCCF !!! !!!! !!!!" , | |
| 86 | "e payments:h elp": " eP ayment !! ! !!!! !!! !", | |
| 87 | "n pi:help": " NPI !!! !!!! !!!!" , | |
| 88 | "e insurance: help": " e Insurance !!! !!!! ! !!!", | |
| 89 | "contact": { "phone" : "( PII ", "emailT ext": " PII ", "emailV alue": " PII " }, | |
| 90 | "a ccessRoles ": ["SBTES T_WRITER"] | |
| 91 | } | |
| 92 | const result = c herryPick( this.confi g, request ed) | |
| 93 | observ er.next(re sult) | |
| 94 | observ er.complet e() | |
| 95 | } | |
| 96 | }) | |
| 97 | }) | |
| 98 | } | |
| 99 | ||
| 100 | handle Error(err: any) { | |
| 101 | co nsole.log( 'sever err or:', err) // debug | |
| 102 | if (err inst anceof Res ponse) { | |
| 103 | return O bservable. throw(this .getErrorM essage(err )) | |
| 104 | } | |
| 105 | re turn Obser vable.thro w(err || ' backend se rver error ') | |
| 106 | } | |
| 107 | ||
| 108 | getErr orMessage( err) { | |
| 109 | le t error = err.json() | |
| 110 | if (typeof e rror === ' object' && error.res ourceType === 'Opera tionOutcom e' && erro r.issue && error.iss ue[0]) { | |
| 111 | return { | |
| 112 | erro rCode: 504 , // VA-FH IR-Server error | |
| 113 | mess age: error .issue[0]. diagnostic s || 'VA-F HIR-Server Error - u nknown' | |
| 114 | } | |
| 115 | } else { | |
| 116 | return e rr.error | | 'unknown server er ror' | |
| 117 | } | |
| 118 | } | |
| 119 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.