From 96ea717ff96bea9189ab367718a665cd180f1289 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Wed, 18 Apr 2018 23:58:18 +0200 Subject: [PATCH] Products Re arranged --- .vs/AAWebPlatform/v15/.suo | Bin 79360 -> 80384 bytes Ecosystem.js | 11 ++++++++++ Panels/ProductsPanel.js | 2 +- ProductCard.js | 43 ++++++++++++++++++++++++++----------- server.js | 27 +++++++++++++++++++++++ 5 files changed, 70 insertions(+), 13 deletions(-) diff --git a/.vs/AAWebPlatform/v15/.suo b/.vs/AAWebPlatform/v15/.suo index 3c88494f1c28ac09082830372cade86c0a198b32..8897b443564b44d0750c00c920ddc49f7ec23516 100644 GIT binary patch delta 1559 zcmbVLTTBya6rM9}x!6`)C54rufkZQ|pi_$wcyWNX*#|d3qFkh2ieOxfr~$HE46V@^ zeK1Oorr9-Q-NB$n%S4urVbmll2=7CokgS#EtXt*j>|&nhu55qu2r5Y9s={`*9UM5v z9)-o&rs#k+oKuv-A+#zh;h@y5Oo!wHWZ6nEqED5o`IV$bf*cuNs!nPjPT$x`@hqg9 zC*BF1ODu(bXichwJ=mS}ufC29$v1R7avHnJmr2)>FGEHJFia((icn41MyMg!3EQz; zecG*QhF#dAal%fVqkV_eq8(qDpMHi{{Vun0%i)1Oi-y%5qg!pHrf_pcn+48G)y026 z-%qVstWztsH@weaJLo*os?lyFPEBMlpM_HBY_V4Rnyyr97>5zoZNcMW8ov8Yr;@b| z=o7YJRmgzmo~;U=;XOrWSTA{dHvAAD>`rmwf`Xy9M?l9=8hWP;m>MY2bCfr_ekNhP zv~Ri-#9kIN8&_g?K)~!;9aaqlSNWo5%=7-eBsUQ>1bK4gRU&VmE;anP^eR{idHOoc zR-4I`XDY}+@1P+5&5D14+NoujWn`MbT*QNc{gL>bUW{{cA!Kes_a&ob{O4t&I0@(s z?7+AFJh&?RxdW+apW@(xd`Y(MKG4+G)Lg&cb4Cqo@%qqGyx_N^{l$YN#4O0{%Ig>5 zi=2>vIv+2085e-nSh38>V{kwPF)1yUWL-m3wxfPSz9X-e@OoZi7Y;6v94uz^Ea84yyF6>J7Ofx*MCYpmjyW%tK^*! z0E%Iv`M|$zpi%!%J<{NTjtpxkaNnS;;bQ9rbbd7n@cfSzra)FH((U$cYXmxkR6#MGTJ{4G;=r0y>8h zv2@H7KAq1>3|w?Z$i)_sEuT$VSKkZ=`0#a_j?)daoW7e;?4S6v;!QzTr&RXpCWx<6 zuxm8k)4vEx7Lxu*thxEqpAu&P+1VAhS0unBxP#o+OTo$ivu|f>U|1o}ru41`C9<-D SgXL;`Y;45m#?8ICz+BFR;_wt_Sx#yhwocBEU^-ZXK z@6~=QdK<+=17k6aF%{)>I2 zP>GYO&EQ3sIv+~qR<#+#hv*WlZCc% z%#*{-4!!;(y>i2No7FC%-<41a z+R^&dhk?#VIjiWjNUS50MX96YKbFUL%wg+^*RXZW#oR1|9twoJxu`t0OKpPm8lsD$ z8H=N74U@2Gumtz?WMS^xSnwe%w@FU~=>_1)54*8{NW{7k3pS^xq0-~Pv0jbzOp8+; zYtcV=1N+{#Eg}nm+rZp{24iV4ueX`F^+UPxsIK zPZux3n;kB^bt?+@j9o$NaNGoiBv)(*1kHATL$d`lL+>oJzG4dXS~e7 z#f4Ca)|aOFwPn(V_Hhef*=T(HzLLUXi=m_9?1N-S&%hPWRQ8Hm^pCpctZA1t4$?$? z+iDQd^l%7meWq_h-p)kBZzBCe%Tei!rG|*07%*!g&p6w_)ENoX8M}FBjG*yC+MP55 gbg597B9;nWAbpCZvliS=2e*hV!PGn6Ebt3o0RSq9o&W#< diff --git a/Ecosystem.js b/Ecosystem.js index 793dfb2b8..459f8903d 100644 --- a/Ecosystem.js +++ b/Ecosystem.js @@ -73,6 +73,17 @@ function newEcosystem() { } } + function getPlotter(pTeam, pPlotterCodeName) { + + for (let i = 0; i < pTeam.plotters.length; i++) { + + if (pTeam.plotters[i].codeName === pPlotterCodeName) { + + return pTeam.plotters[i]; + } + } + } + function getProduct(pBot, pProductCodeName) { for (let i = 0; i < pBot.products.length; i++) { diff --git a/Panels/ProductsPanel.js b/Panels/ProductsPanel.js index 720da8957..a86ff3021 100644 --- a/Panels/ProductsPanel.js +++ b/Panels/ProductsPanel.js @@ -89,7 +89,7 @@ productCard.container.frame.position.x = position.x; productCard.container.frame.position.y = position.y + lastY; - lastY = lastY + productCard.container.frame.height * 1.25; + lastY = lastY + productCard.container.frame.height; /* Add to the Product Array */ diff --git a/ProductCard.js b/ProductCard.js index 57b3ebb8f..f323c90ba 100644 --- a/ProductCard.js +++ b/ProductCard.js @@ -80,7 +80,7 @@ this.container.frame.position = position; this.container.frame.width = 380; - this.container.frame.height = 80; + this.container.frame.height = 100; /* We retrieve the locally stored status of the Product */ @@ -286,12 +286,14 @@ /* - Put image on the card. + Put images on the card. */ - const devTeamImageSize = 45; - const botImageSize = 45; + const devTeamImageSize = 50; + const botImageSize = 50; + + /* First the Dev Team Profile Picture. */ let teamImagePoint = { x: 10, @@ -303,10 +305,12 @@ let teamImage = document.getElementById(thisObject.bot.devTeam + ".png"); browserCanvasContext.drawImage(teamImage, teamImagePoint.x, teamImagePoint.y, devTeamImageSize, devTeamImageSize); + /* Second the Bot's Profile Picture. */ + if (thisObject.bot.profilePicture !== undefined) { let botImagePoint = { - x: thisObject.container.frame.width - 10 - 50, + x: thisObject.container.frame.width - 10 - botImageSize - 5, y: thisObject.container.frame.height / 2 - botImageSize / 2 }; @@ -318,6 +322,11 @@ } + /* Third the Plotter's Profile Picture. */ + + + + /* Now the small circle */ centerPoint = { @@ -374,43 +383,53 @@ /* devTeam */ - label = "Dev Team: " + thisObject.devTeam.displayName; + label = thisObject.devTeam.displayName; labelPoint = { - x: 65, - y: thisObject.container.frame.height / 2 - 15 + x: 10 + devTeamImageSize / 2 - label.length / 2 * fontSize * 0.60, + y: thisObject.container.frame.height / 2 + devTeamImageSize / 2 + fontSize * 0.60 + 5 }; labelPoint = thisObject.container.frame.frameThisPoint(labelPoint); + browserCanvasContext.font = fontSize + 'px Courier New'; browserCanvasContext.fillStyle = 'rgba(60, 60, 60, 0.50)'; browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y); /* bot */ - label = "Bot: " + thisObject.bot.displayName; + label = thisObject.bot.displayName; labelPoint = { - x: 65, - y: thisObject.container.frame.height / 2 - 0 + x: thisObject.container.frame.width - 10 - botImageSize - 5 + botImageSize / 2 - label.length / 2 * fontSize * 0.60, + y: thisObject.container.frame.height / 2 + devTeamImageSize / 2 + fontSize * 0.60 + 5 }; labelPoint = thisObject.container.frame.frameThisPoint(labelPoint); + browserCanvasContext.font = fontSize + 'px Courier New'; browserCanvasContext.fillStyle = 'rgba(60, 60, 60, 0.50)'; browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y); /* product */ - label = "Product: " + thisObject.product.displayName; + fontSize = 12; + + label = thisObject.product.displayName; labelPoint = { x: 65, y: thisObject.container.frame.height / 2 + 15 }; + labelPoint = { + x: thisObject.container.frame.width / 2 - label.length / 2 * fontSize * 0.60, + y: thisObject.container.frame.height / 2 - devTeamImageSize / 2 - fontSize * 0.60 - 5 + }; + labelPoint = thisObject.container.frame.frameThisPoint(labelPoint); + browserCanvasContext.font = fontSize + 'px Courier New bold'; browserCanvasContext.fillStyle = 'rgba(60, 60, 60, 0.50)'; browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y); diff --git a/server.js b/server.js index 688473d01..a808359d5 100644 --- a/server.js +++ b/server.js @@ -814,6 +814,33 @@ function onBrowserRequest(request, response) { } } + + for (let j = 0; j < devTeam.plotters.length; j++) { + + let plotter = devTeam.plotters[j]; + + for (let k = 0; k < plotter.modules.length; k++) { + + let module = plotter.modules[k]; + + if (module.profilePicture !== undefined) { + + let htmlLineCopy = htmlLine; + + let stringToInsert; + stringToInsert = htmlLineCopy.replace('@devTeam@', devTeam.codeName); + stringToInsert = stringToInsert.replace('@repo@', plotter.repo); + stringToInsert = stringToInsert.replace('@image@', module.profilePicture); + stringToInsert = stringToInsert.replace('@id@', devTeam.codeName + "." + module.codeName + "." + module.profilePicture); + + let firstPart = fileContent.substring(0, fileContent.indexOf('') + 15); + let secondPart = fileContent.substring(fileContent.indexOf('') + 15); + + fileContent = firstPart + stringToInsert + secondPart; + + } + } + } } } }