From 63c523edc6f305e32b1f46161d90ba0340be164b Mon Sep 17 00:00:00 2001 From: Hotowy Date: Tue, 23 Apr 2019 11:50:34 +0200 Subject: [PATCH 1/3] Add about tab. --- .../app/layout/toolbar/toolbarTop.view.html | 11 +++++- .../app/services/metadataEndpoint.service.js | 3 +- .../src/main/webapp/assets/img/cognifide.png | Bin 0 -> 4064 bytes .../src/main/webapp/assets/sass/_report.scss | 15 ++++++++ .../src/main/webapp/assets/sass/_toolbar.scss | 4 ++ report/src/main/webapp/report.html | 28 ++++++++++++++ rest-endpoint/pom.xml | 4 ++ .../cognifide/aet/rest/MetadataServlet.java | 6 +++ .../rest/helpers/BundleVersionProvider.java | 35 ++++++++++++++++++ 9 files changed, 103 insertions(+), 3 deletions(-) create mode 100644 report/src/main/webapp/assets/img/cognifide.png create mode 100644 rest-endpoint/src/main/java/com/cognifide/aet/rest/helpers/BundleVersionProvider.java diff --git a/report/src/main/webapp/app/layout/toolbar/toolbarTop.view.html b/report/src/main/webapp/app/layout/toolbar/toolbarTop.view.html index 8bebf429d..1c881d88c 100644 --- a/report/src/main/webapp/app/layout/toolbar/toolbarTop.view.html +++ b/report/src/main/webapp/app/layout/toolbar/toolbarTop.view.html @@ -98,8 +98,15 @@
Execution time: {{toolbarTop.suiteInfo.duration | date: 'mm:ss'}}
- diff --git a/report/src/main/webapp/app/services/metadataEndpoint.service.js b/report/src/main/webapp/app/services/metadataEndpoint.service.js index 187426e7c..d5317426b 100644 --- a/report/src/main/webapp/app/services/metadataEndpoint.service.js +++ b/report/src/main/webapp/app/services/metadataEndpoint.service.js @@ -23,7 +23,7 @@ define(['angularAMD', 'endpointConfiguration', 'requestParametersService'], /** * Service responsible for communication with AET metadata REST API endpoint. */ - function MetadataEndpointService($q, $http, endpointConfiguration, + function MetadataEndpointService($q, $rootScope, $http, endpointConfiguration, requestParametersService) { var service = { getMetadata: getMetadata, @@ -65,6 +65,7 @@ define(['angularAMD', 'endpointConfiguration', 'requestParametersService'], } }).then(function (data) { deferred.resolve(data.data); + $rootScope.applicationVersion = data.headers()['application-version']; return deferred.promise; }).catch(function (exception) { handleFailed('Failed to load report data!', exception); diff --git a/report/src/main/webapp/assets/img/cognifide.png b/report/src/main/webapp/assets/img/cognifide.png new file mode 100644 index 0000000000000000000000000000000000000000..04cfd0c87e20dbd4c0f05b55f55f4b0e186c2400 GIT binary patch literal 4064 zcmZu!Wl$VS5?;av3l^L}upmK#!vYH|4hsnuB)GfF!UDnVp}`3b!QEXGG`PFN;=T|h z5RP|M@2;-ux~r$_>mT3D^h|Yihbb${;$XeP0ssIwP&p~pCm--+${1)*>€sw%G z`4#=)V5s zzaZ@N~3J+$z~`hRm!3HlmrLKM?0N7#Sg?tZ-gm1%Yg zJFbwvDC%={IH>MLhP?o9VDC2cIP7Gd31+PgI#iF~DyP}jQ!L%8W-!ezNrUuUmdafy z?bnSjhb*F3@u)|&F&8u;xNlW_SAH${^bJo zZI@g@K!F(G*iPorXubY@J$5@FD2RxAT$$aEIJZZtomjPq9Fstr9-2g_u8qaa2xUg( z3C}nWa49GX?#9{JGbDV<%ZpQBuCF_=@$2iER&#k*KRXMzjKI-}I;429ay@R6oauRz zKevju&$Ag5D??>AJyDQlB!OaHkYbSnYe0|`*KNinYUrEI%pV6+?OKa!ADN`!!>|%mX%)@HjOXC(~Zqb@fd;U zaAvGg*Kjh7K17@Cb^)?6L316FtwE<@o*y_DvsFDTjt}rWH(tuw}tJNs0f@ zbbM&kxC82r@A+me;Z7Q99GJAf-g~oBw%ZJ%?Wz{IQXQ2|jFMlr2Vy(DD=5?CLlshJ z|3Wsw?H!1ULPMLg(RX#J0!EZPiZt;eMc^uWt zLZQ&LZ^12gS)1K-KD@>{RIo8zfFPguCl3vsr!6}#1pT&An@R-1QaoWkfI)3h;xgR! z6KB52e$ef_oFh3*+oK|_lBtF19Tcr36Rv42R@_|WNfQK91whF8vdTNSUWumNCyFCS zM|_RP@2%H-O~xakF#BCi^l$beH!yASd_*g*Mo;PBD{wunUBlG;8z*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BuR{=7d*Q7FL%!Em9vI0JC7{G2P3Ep0XP%C9VcvJYM9o zAv7ZEI%l%mGZJeapU(+a-BZR7)k&vp%Qva5cj@%M!69&*>usm*5~tMr=7olyjQiuI zd;zZAm^7*&DJfHZ+jm0W&IhU!!9V?8-LTXG%uh%R{AUtk7#JwDG(ewnuca3bBaTU|)>`KywK9915wz(BSt1$w(Xw{FG~Fvu-$G6O{8V>0 zs?aSfWWlkQQb>kR^Xty`#@xR-gZ%LSyTShejk2YJw0#F*xObt~BOPKms{Y<)(8J4p z3mJbrI+VZz(eInMYBV>%fC#^e)IVMW`>gGNb}wl}GpKrM6L^LitFMiyeEEQ~sQ;Y* zf9U@KWuHp_Xnh7jJYFK3{zZXASyTz4#rTXZK{p>s7Nubh-QWX-00sjIHM3+?n literal 0 HcmV?d00001 diff --git a/report/src/main/webapp/assets/sass/_report.scss b/report/src/main/webapp/assets/sass/_report.scss index 8af5d7957..ec4fbb712 100644 --- a/report/src/main/webapp/assets/sass/_report.scss +++ b/report/src/main/webapp/assets/sass/_report.scss @@ -306,6 +306,21 @@ ul { } } +p.copyright { + padding-top: 10px; + font-style: italic; + text-align: center; + font-size: 12px; +} + +img.cognifide-logo { + padding-top: 15px; + display: block; + margin: 0 auto; + height: 10%; + width: 10%; +} + // cookies report .failed { diff --git a/report/src/main/webapp/assets/sass/_toolbar.scss b/report/src/main/webapp/assets/sass/_toolbar.scss index aa2deb669..fc121b57f 100644 --- a/report/src/main/webapp/assets/sass/_toolbar.scss +++ b/report/src/main/webapp/assets/sass/_toolbar.scss @@ -106,6 +106,10 @@ display: flex; justify-content: center; } + + .slim-padding { + padding: 6px; + } } &-generate-raport { diff --git a/report/src/main/webapp/report.html b/report/src/main/webapp/report.html index 6fd9e9b5a..0f6d9036b 100644 --- a/report/src/main/webapp/report.html +++ b/report/src/main/webapp/report.html @@ -75,6 +75,34 @@ + + + + \ No newline at end of file diff --git a/rest-endpoint/pom.xml b/rest-endpoint/pom.xml index 4da3bcf80..43f17331d 100644 --- a/rest-endpoint/pom.xml +++ b/rest-endpoint/pom.xml @@ -111,6 +111,10 @@ com.github.stefanbirkner system-rules + + org.osgi + org.osgi.core + diff --git a/rest-endpoint/src/main/java/com/cognifide/aet/rest/MetadataServlet.java b/rest-endpoint/src/main/java/com/cognifide/aet/rest/MetadataServlet.java index 2cf90e5a1..084b1eac4 100644 --- a/rest-endpoint/src/main/java/com/cognifide/aet/rest/MetadataServlet.java +++ b/rest-endpoint/src/main/java/com/cognifide/aet/rest/MetadataServlet.java @@ -22,6 +22,7 @@ import com.cognifide.aet.communication.api.exceptions.AETException; import com.cognifide.aet.communication.api.metadata.Suite; import com.cognifide.aet.communication.api.metadata.ValidatorException; +import com.cognifide.aet.rest.helpers.BundleVersionProvider; import com.cognifide.aet.vs.DBKey; import com.cognifide.aet.vs.MetadataDAO; import com.cognifide.aet.vs.StorageException; @@ -55,6 +56,7 @@ public class MetadataServlet extends BasicDataServlet { private static final Logger LOGGER = LoggerFactory.getLogger(MetadataServlet.class); private static final String FORMATTED_PARAM = "formatted"; + private static final String APP_VERSION_HEADER = "Application-Version"; private static final Gson PRETTY_PRINT_GSON = new GsonBuilder().setPrettyPrinting().create(); private static final JsonParser JSON_PARSER = new JsonParser(); @@ -64,6 +66,9 @@ public class MetadataServlet extends BasicDataServlet { @Reference private LockService lockService; + @Reference + private BundleVersionProvider bundleVersionProvider; + @Reference private transient HttpService httpService; @@ -74,6 +79,7 @@ protected void process(DBKey dbKey, HttpServletRequest req, HttpServletResponse String suiteName = req.getParameter(Helper.SUITE_PARAM); String suiteVersion = req.getParameter(Helper.VERSION_PARAM); String formatted = req.getParameter(FORMATTED_PARAM); + resp.setHeader(APP_VERSION_HEADER, bundleVersionProvider.getBundleVersion()); resp.setCharacterEncoding("UTF-8"); Suite suite; diff --git a/rest-endpoint/src/main/java/com/cognifide/aet/rest/helpers/BundleVersionProvider.java b/rest-endpoint/src/main/java/com/cognifide/aet/rest/helpers/BundleVersionProvider.java new file mode 100644 index 000000000..34ae39cac --- /dev/null +++ b/rest-endpoint/src/main/java/com/cognifide/aet/rest/helpers/BundleVersionProvider.java @@ -0,0 +1,35 @@ +/** + * AET + * + * Copyright (C) 2013 Cognifide Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package com.cognifide.aet.rest.helpers; + +import org.osgi.framework.BundleContext; +import org.osgi.service.component.annotations.Activate; +import org.osgi.service.component.annotations.Component; + +@Component(service = BundleVersionProvider.class, immediate = true) +public class BundleVersionProvider { + + private String bundleVersion; + + @Activate + public void activate(BundleContext context) { + bundleVersion = context.getBundle().getVersion().toString(); + } + + public String getBundleVersion() { + return bundleVersion; + } +} From 914ef11af884a362e8452c664b4c6d1897a5c289 Mon Sep 17 00:00:00 2001 From: Hotowy Date: Tue, 23 Apr 2019 12:12:34 +0200 Subject: [PATCH 2/3] Update changelog. --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 35ef89cc4..04ad7a1ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ All notable changes to AET will be documented in this file. ## Unreleased **List of changes that are finished but not yet released in any final version.** +- [PR-506](https://github.com/Cognifide/aet/pull/506) About tab ([#475](https://github.com/Cognifide/aet/issues/475)) + ## Version 3.2.1 From 208a547dd6bf112fef7536c7a3db129259eec2bd Mon Sep 17 00:00:00 2001 From: Tomasz Kaik Date: Mon, 8 Jul 2019 09:46:20 +0200 Subject: [PATCH 3/3] "x-" perfix in application-version header --- report/src/main/webapp/app/services/metadataEndpoint.service.js | 2 +- .../src/main/java/com/cognifide/aet/rest/MetadataServlet.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/report/src/main/webapp/app/services/metadataEndpoint.service.js b/report/src/main/webapp/app/services/metadataEndpoint.service.js index d5317426b..135c4e3c0 100644 --- a/report/src/main/webapp/app/services/metadataEndpoint.service.js +++ b/report/src/main/webapp/app/services/metadataEndpoint.service.js @@ -65,7 +65,7 @@ define(['angularAMD', 'endpointConfiguration', 'requestParametersService'], } }).then(function (data) { deferred.resolve(data.data); - $rootScope.applicationVersion = data.headers()['application-version']; + $rootScope.applicationVersion = data.headers()['x-application-version']; return deferred.promise; }).catch(function (exception) { handleFailed('Failed to load report data!', exception); diff --git a/rest-endpoint/src/main/java/com/cognifide/aet/rest/MetadataServlet.java b/rest-endpoint/src/main/java/com/cognifide/aet/rest/MetadataServlet.java index 084b1eac4..df51852b7 100644 --- a/rest-endpoint/src/main/java/com/cognifide/aet/rest/MetadataServlet.java +++ b/rest-endpoint/src/main/java/com/cognifide/aet/rest/MetadataServlet.java @@ -56,7 +56,7 @@ public class MetadataServlet extends BasicDataServlet { private static final Logger LOGGER = LoggerFactory.getLogger(MetadataServlet.class); private static final String FORMATTED_PARAM = "formatted"; - private static final String APP_VERSION_HEADER = "Application-Version"; + private static final String APP_VERSION_HEADER = "X-Application-Version"; private static final Gson PRETTY_PRINT_GSON = new GsonBuilder().setPrettyPrinting().create(); private static final JsonParser JSON_PARSER = new JsonParser();