Skip to content

Commit

Permalink
Merge pull request #506 from hotowy/feature/about-toolbar-extension
Browse files Browse the repository at this point in the history
#475 About tab inside top toolbar.
  • Loading branch information
tkaik authored Jul 8, 2019
2 parents 45b85df + 208a547 commit 80bdc0f
Show file tree
Hide file tree
Showing 10 changed files with 104 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ All notable changes to AET will be documented in this file.

**List of changes that are finished but not yet released in any final version.**
- [PR-479](https://github.com/Cognifide/aet/pull/479) Added Secure and HttpOnly flags for cookies. ([#477](https://github.com/Cognifide/aet/issues/477))
- [PR-506](https://github.com/Cognifide/aet/pull/506) About tab ([#475](https://github.com/Cognifide/aet/issues/475))

## Version 3.2.2

Expand Down
11 changes: 9 additions & 2 deletions report/src/main/webapp/app/layout/toolbar/toolbarTop.view.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,15 @@
<div class="toolbar-block">
Execution time: {{toolbarTop.suiteInfo.duration | date: 'mm:ss'}}
</div>
<div class="toolbar-block fontawesome-link" data-toggle="modal" data-target="#helpModal">
<i class="fas fa-question-circle fa-lg"></i>
<div class="toolbar-block fontawesome-link slim-padding" data-toggle="modal" data-target="#helpModal">
<span data-toggle="popover" data-content="Help" data-trigger="hover" data-container="body">
<i class="fas fa-question-circle fa-lg"></i>
</span>
</div>
<div class="toolbar-block fontawesome-link slim-padding" data-toggle="modal" data-target="#aboutModal">
<span data-toggle="popover" data-content="About..." data-trigger="hover" data-container="body">
<i class="fas fa-info-circle fa-lg"></i>
</span>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -65,6 +65,7 @@ define(['angularAMD', 'endpointConfiguration', 'requestParametersService'],
}
}).then(function (data) {
deferred.resolve(data.data);
$rootScope.applicationVersion = data.headers()['x-application-version'];
return deferred.promise;
}).catch(function (exception) {
handleFailed('Failed to load report data!', exception);
Expand Down
Binary file added report/src/main/webapp/assets/img/cognifide.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions report/src/main/webapp/assets/sass/_report.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 4 additions & 0 deletions report/src/main/webapp/assets/sass/_toolbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@
display: flex;
justify-content: center;
}

.slim-padding {
padding: 6px;
}
}

&-generate-raport {
Expand Down
28 changes: 28 additions & 0 deletions report/src/main/webapp/report.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,34 @@ <h4 class="modal-title">Handful keyboard shortcuts</h4>
</div>
</div>
</div>


<!--
About modal
-->
<div class="modal fade" id="aboutModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true"><i class="fas fa-times"></i></span></button>
<h4 class="modal-title">About...</h4>
</div>
<div class="modal-body">
<p>Generated with
<a href="https://github.com/Cognifide/aet" target="_blank">AET</a> version: {{ applicationVersion }}
</p>
<p>If you have any questions or require technical support please contact us at
<a href="mailto:[email protected]">[email protected]</a>.
<a href="https://gitter.im/aet-tool/Lobby" target="_blank">Gitter Chat</a> is a way for users
to chat with the AET community. Feel free to leave a message, even if we’re not around,
we will definitely respond to you when available.</p>
<a href="https://www.cognifide.com/" target="_blank"><img class="logo cognifide-logo" src="assets/img/cognifide.png"></a>
<p class="copyright">Copyright © 2013 Cognifide Limited</p>
</div>
</div>
</div>
</div>
</body>
<script src='assets/libs/requirejs/require.js' data-main="app/app.config.js"></script>
</html>
4 changes: 4 additions & 0 deletions rest-endpoint/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@
<groupId>com.github.stefanbirkner</groupId>
<artifactId>system-rules</artifactId>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 = "X-Application-Version";
private static final Gson PRETTY_PRINT_GSON = new GsonBuilder().setPrettyPrinting().create();
private static final JsonParser JSON_PARSER = new JsonParser();

Expand All @@ -64,6 +66,9 @@ public class MetadataServlet extends BasicDataServlet {
@Reference
private LockService lockService;

@Reference
private BundleVersionProvider bundleVersionProvider;

@Reference
private transient HttpService httpService;

Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
}
}

0 comments on commit 80bdc0f

Please sign in to comment.