Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#475 About tab inside top toolbar. #506

Merged
merged 5 commits into from
Jul 8, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

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()['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 = "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());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Other metadata are send as JSON properties. Has anyone any ideas/thoughts about this being sent as header?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's fine because this is some kind of "meta" information. But maybe we should prefix the custom header name with X- (X-Application-Version), WDYT?
CC @Skejven

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

X- prefix is a good idea. Sending it in the header is fine.

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;
}
}