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

Feature/winter edition #238

Merged
merged 11 commits into from
Apr 18, 2018
Merged
Show file tree
Hide file tree
Changes from 6 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ 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-238](https://github.com/Cognifide/aet/pull/238) AET Winter Edition introduced
- [PR-233](https://github.com/Cognifide/aet/pull/233) Font Awesome introduced to AET
- [PR-228](https://github.com/Cognifide/aet/pull/228) Remove 'jump to' button from whole suite view.
- [PR-230](https://github.com/Cognifide/aet/pull/230) Bug Fixed: Side panel items not accessible when 'Save/Discard Changes' buttons are visible.
Expand Down
2 changes: 2 additions & 0 deletions report/src/main/webapp/app/app.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ require.config({
'angularAMD': '../assets/libs/angularAMD/angularAMD',
'lodash': '../assets/libs/lodash/dist/lodash',
'angular-bootstrap': '../assets/libs/angular-bootstrap/ui-bootstrap-tpls',
'snowfall': '../assets/libs/snowfall/snowfall.min',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe there's a better way to include this that I didn't think about?

// **************** AET custom ********************
//components
'testSearchFilter': 'components/testSearch.filter',
Expand All @@ -34,6 +35,7 @@ require.config({
'urlStatusFilter': 'components/urlStatus.filter',
'keyboardShortcutsDirective': 'components/keyboardShortcuts.directive',
'hidePopoversDirective': 'components/hidePopovers.directive',
'winterEdition': 'components/winterEdition.directive',
//services
'endpointConfiguration': 'services/endpointConfiguration.service',
'artifactsService': 'services/artifacts.service',
Expand Down
13 changes: 13 additions & 0 deletions report/src/main/webapp/app/app.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ define(['angularAMD',
'angular-ui-router',
'jquery',
'bootstrap',
'snowfall',
// components
'hidePopoversDirective',
'keyboardShortcutsDirective',
'testSearchFilter',
'testStatusFilter',
'urlSearchFilter',
'urlStatusFilter',
'winterEdition',
// services
'endpointConfiguration',
'artifactsService',
Expand Down Expand Up @@ -78,6 +80,17 @@ define(['angularAMD',
userSettingsService,
metadataLoaderService) {

$rootScope.theme = {
name: 'regular',
statusClasses: {
passed: 'fa-check',
failed: 'fa-times',
warning: 'fa-exclamation-triangle',
rebased: 'fa-cloud-upload-alt',
unrebased: 'fa-cloud-download-alt'
}
};

$rootScope.metadataSaveInProgress = false;
metadataLoaderService.setup();

Expand Down
61 changes: 61 additions & 0 deletions report/src/main/webapp/app/components/winterEdition.directive.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/*
Copy link
Contributor

Choose a reason for hiding this comment

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

the folder report/src/main/webapp/app/components is the old one and not realy in sync with John Papa guide about folders for code. let's move this directive to some folder with the functional-like name.

we can create new folder below .../app called themes.

* 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.
*/
define(['angularAMD'], function (angularAMD) {
'use strict';
// custom prefix for custom directive 'aet' see: http://bit.ly/29U2YFf
angularAMD.directive('aetWinterEdition', WinterEdition);

function WinterEdition() {
return {
restrict: 'AE',
link: linkFunc
};

function linkFunc($scope) {
var WINTER_THEME = {
name: 'winter',
statusClasses: {
passed: 'fa-tree',
failed: 'fa-gift',
warning: 'fa-bell',
rebased: 'fa-snowflake',
unrebased: 'fa-eraser'
}
};
var TODAY = new Date();
var CHRISTMAS_DATE = new Date(TODAY.getFullYear(), 11, 25);
var DAY_MARGIN = 14;
var isChristmas = isInDateRange(TODAY, CHRISTMAS_DATE, DAY_MARGIN);

if (isChristmas) {
_.merge($scope.theme, WINTER_THEME);
snowFall.snow(document.body, {flakeCount: 200, maxSpeed: 20});
}
}

function isInDateRange(today, eventDate, dayMargin) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I was thinking about renaming the function to contain word near instead of range.
Checking if date is in range would expect arguments such as: date and range.
We are doing it slightly different. ->Would it be easier to read after such change?

var eventStartDate = new Date(eventDate);
var eventEndDate = new Date(eventDate);

eventStartDate.setDate(eventStartDate.getDate()-dayMargin);
eventEndDate.setDate(eventEndDate.getDate()+dayMargin);

return today >= eventStartDate && today <= eventEndDate;
}
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,11 @@
<div class="inner">
<div ng-class="test.getStatus()">
<div class="test-count test-count-dashboard">
<div ng-if="test.getStatus() == 'failed'" class="failed">
<i class="fas fa-times"></i>
</div>
<div ng-if="test.getStatus() == 'passed'">
<i class="fas fa-check"></i>
</div>
<div ng-if="test.getStatus() == 'warning'">
<i class="fas fa-exclamation-triangle"></i>
<div ng-if="test.getStatus() != 'rebased'" class="failed">
<i class="fas {{theme.statusClasses[test.getStatus()]}}"></i>
</div>
<div ng-if="test.getStatus() == 'rebased'">
<i class="fas fa-cloud-upload-alt"></i>
<i class="fas {{theme.statusClasses[test.getStatus()]}}"></i>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Those elements are required, so that when a case gets accepted/rejected the icon is redrawn - simply adding an element with {{theme.statusClasses[test.getStatus()]}} won't work, since the italic tags are replaced with svg tags by fontawesome.

</div>
<span>{{test.name}}</span>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,11 @@
<div class="inner">
<div ng-class="url.getStatus()">
<div class="test-count test-count-dashboard">
<div ng-if="url.getStatus() == 'failed'">
<i class="fas fa-times"></i>
</div>
<div ng-if="url.getStatus() == 'passed'">
<i class="fas fa-check"></i>
</div>
<div ng-if="url.getStatus() == 'warning'">
<i class="fas fa-exclamation-triangle"></i>
<div ng-if="url.getStatus() != 'rebased'">
<i class="fas {{theme.statusClasses[url.getStatus()]}}"></i>
</div>
<div ng-if="url.getStatus() == 'rebased'">
<i class="fas fa-cloud-upload-alt"></i>
<i class="fas {{theme.statusClasses[url.getStatus()]}}"></i>
</div>
<div class="tile-stats">
<span class="statistics">Url cases statistics:</span>
Expand Down
18 changes: 6 additions & 12 deletions report/src/main/webapp/app/layout/sidepanel/sidepanel.view.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<div class="aside" ui-view="aside">
<div class="logo-holder">
<a ui-sref="suite">
<img class="logo" src="assets/img/logo.png" alt="">
<img class="logo" ng-src="assets/img/logo_{{theme.name}}.png" alt="">
</a>
</div>
<!--
Expand Down Expand Up @@ -135,17 +135,11 @@
<li ng-repeat="url in test.urls | filter: {name: $root.searchText} | aetUrlStatusFilter:$root.activeFilters | orderBy:'name' as filteredUrls"
ng-class="[url.getStatus()]" class="url-name">
<div aet-truncate-urls class="text-left nowrap">
<div ng-if="url.getStatus() == 'failed'" class="fontawesome">
<i class="fas fa-times"></i>
</div>
<div ng-if="url.getStatus() == 'passed'" class="fontawesome">
<i class="fas fa-check"></i>
</div>
<div ng-if="url.getStatus() == 'warning'" class="fontawesome">
<i class="fas fa-exclamation-triangle"></i>
<div ng-if="url.getStatus() != 'rebased'" class="fontawesome">
<i class="fas {{theme.statusClasses[url.getStatus()]}}"></i>
</div>
<div ng-if="url.getStatus() == 'rebased'" class="fontawesome">
<i class="fas fa-cloud-upload-alt"></i>
<i class="fas {{theme.statusClasses[url.getStatus()]}}"></i>
</div>
<a class="test-url" ui-sref-active="is-active"
ui-sref="url({'suite':$root.params.project,'test':test.name, 'url':url.name})">
Expand All @@ -164,13 +158,13 @@ <h4 class="no-results" ng-if="sidepanel.testsStats.total === 0">
<div class="aside-actions-wrapper" ng-if="sidepanel.thereAreChangesToSave()">
<div class="js-rebase-all" ng-click="sidepanel.saveAllChanges()">
<span class="button button-blue button-wide">
<i class="fas fa-cloud-upload-alt"></i>
<i class="fas {{theme.statusClasses['rebased']}}"></i>
Save all changes
</span>
</div>
<div class="js-cancel-all" ng-click="sidepanel.discardAllChanges()">
<span class="button button-darkred button-wide">
<i class="fas fa-cloud-download-alt"></i>
<i class="fas {{theme.statusClasses['unrebased']}}"></i>
Discard all changes
</span>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ <h5 ng-if="toolbarBottom.viewMode == 'url'">
<span class="button js-rebase-suite button-red"
data-ng-if="toolbarBottom.showRevertButton()"
data-ng-click="toolbarBottom.revertAcceptedPatterns()">
<i class="fas fa-cloud-download-alt"></i>
<i class="fas {{theme.statusClasses['unrebased']}}"></i>
Revert {{toolbarBottom.viewMode}}
</span>
</div>
Expand Down
34 changes: 17 additions & 17 deletions report/src/main/webapp/assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -3857,13 +3857,13 @@ table { border-collapse: collapse; border-spacing: 0; }
/* line 143, ../sass/_typography.scss */
.name { font-style: italic; }

/* line 61, ../../../../../../../../../../../Library/Ruby/Gems/2.3.0/gems/compass-core-1.0.3/stylesheets/compass/css3/_user-interface.scss */
/* line 61, C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/compass-core-1.0.3/stylesheets/compass/css3/_user-interface.scss */
input[type=text]:-moz-placeholder { color: #85898e; }
/* line 64, ../../../../../../../../../../../Library/Ruby/Gems/2.3.0/gems/compass-core-1.0.3/stylesheets/compass/css3/_user-interface.scss */
/* line 64, C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/compass-core-1.0.3/stylesheets/compass/css3/_user-interface.scss */
input[type=text]::-moz-placeholder { color: #85898e; }
/* line 67, ../../../../../../../../../../../Library/Ruby/Gems/2.3.0/gems/compass-core-1.0.3/stylesheets/compass/css3/_user-interface.scss */
/* line 67, C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/compass-core-1.0.3/stylesheets/compass/css3/_user-interface.scss */
input[type=text]:-ms-input-placeholder { color: #85898e; }
/* line 56, ../../../../../../../../../../../Library/Ruby/Gems/2.3.0/gems/compass-core-1.0.3/stylesheets/compass/css3/_user-interface.scss */
/* line 56, C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/compass-core-1.0.3/stylesheets/compass/css3/_user-interface.scss */
input[type=text]::-webkit-input-placeholder { color: #85898e; }

/* 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. */
Expand All @@ -3878,7 +3878,7 @@ input[type=text]::-webkit-input-placeholder { color: #85898e; }
/* line 43, ../sass/_toolbar.scss */
.toolbar-toggle span { display: block; width: 20px; background: #77777c; height: 3px; margin-bottom: 3px; }
/* line 52, ../sass/_toolbar.scss */
.toolbar-link { -webkit-transition: width, 0.3s; -o-transition: width, 0.3s; transition: width, 0.3s; width: calc(100% - 200px); background: #ffffff; }
.toolbar-link { -webkit-transition: width, 0.3s; -o-transition: width, 0.3s; transition: width, 0.3s; width: calc(100% - 400px); background: #ffffff; }
/* line 57, ../sass/_toolbar.scss */
.toolbar-link > { float: right; }
/* line 62, ../sass/_toolbar.scss */
Expand Down Expand Up @@ -3922,35 +3922,35 @@ input[type=text]::-webkit-input-placeholder { color: #85898e; }
/* line 173, ../sass/_toolbar.scss */
.toolbar-nav div svg { margin: 7px 2px; display: block; color: #85898e; }
/* line 180, ../sass/_toolbar.scss */
.toolbar-btns { border-left: solid 1px #ededed; padding-left: 30px; padding-top: 15px; height: 73px; display: flex; }
.toolbar-btns { border-left: solid 1px #ededed; padding-left: 20px; padding-top: 15px; height: 73px; display: flex; }
/* line 187, ../sass/_toolbar.scss */
.toolbar-btns .button { float: left; margin-left: 12px; }
.toolbar-btns .button { float: left; margin-left: 15px; }
/* line 192, ../sass/_toolbar.scss */
.tab-content-toolbar .toolbar-btns { padding-top: 3px; padding-right: 15px; height: 47px; }

/* line 200, ../sass/_toolbar.scss */
.comments-status { width: 45px; font-family: "montserratlight", sans-serif; font-size: 30px; display: block; line-height: 44px; cursor: pointer; }
/* line 208, ../sass/_toolbar.scss */
.comments-status { font-family: "montserratlight", sans-serif; font-size: 30px; display: block; line-height: 44px; cursor: pointer; }
/* line 207, ../sass/_toolbar.scss */
.comments-status.small { line-height: 37px; font-size: 11px; }
/* line 213, ../sass/_toolbar.scss */
/* line 212, ../sass/_toolbar.scss */
.comments-status.present { color: #6f9f00; }
/* line 217, ../sass/_toolbar.scss */
/* line 216, ../sass/_toolbar.scss */
.comments-status.absent { color: #3c4550; }

@media (max-width: 1300px) { /* line 222, ../sass/_toolbar.scss */
@media (max-width: 1300px) { /* line 221, ../sass/_toolbar.scss */
.tab-content-toolbar { height: 94px; } }
/* line 228, ../sass/_toolbar.scss */
/* line 227, ../sass/_toolbar.scss */
.tab-content-toolbar .toolbar-btns, .tab-content-toolbar .comments-status { width: auto; }
/* line 232, ../sass/_toolbar.scss */
/* line 231, ../sass/_toolbar.scss */
.tab-content-toolbar .toolbar-blocks { display: inline; }

/* line 237, ../sass/_toolbar.scss */
/* line 236, ../sass/_toolbar.scss */
.important-message { background: #fff085; }

/* line 241, ../sass/_toolbar.scss */
/* line 240, ../sass/_toolbar.scss */
.button-dark.js-trigger-modal { display: inline-block; }

/* line 245, ../sass/_toolbar.scss */
/* line 244, ../sass/_toolbar.scss */
.preformatted { font-family: monospace; }

/* 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. */
Expand Down
Binary file added report/src/main/webapp/assets/img/logo_winter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 3 additions & 4 deletions report/src/main/webapp/assets/sass/_toolbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

&-link {
@include transition(width, 0.3s);
width: calc(100% - 200px);
width: calc(100% - 400px);
background: $white;

> {
Expand Down Expand Up @@ -179,14 +179,14 @@
}
&-btns {
border-left: solid 1px $border-color;
padding-left: 30px;
padding-left: 20px;
padding-top: 15px;
height: 73px;
display: flex;

.button {
float: left;
margin-left: 12px;
margin-left: 15px;
}

.tab-content-toolbar & {
Expand All @@ -198,7 +198,6 @@
}

.comments-status {
width: 45px;
font-family: $font_light;
font-size: 30px;
display: block;
Expand Down
3 changes: 2 additions & 1 deletion report/src/main/webapp/bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"angular-ui-router": "^0.2.18",
"angular-bootstrap": "^1.1.0",
"angularAMD": "^0.2.1",
"lodash": "^4.11.0"
"lodash": "^4.11.0",
"jquery-snowfall": "^1.7.4"
},
"resolutions": {
"angular": "1.5.5"
Expand Down
2 changes: 1 addition & 1 deletion report/src/main/webapp/report.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<script defer src="assets/icons/fontawesome-all.js"></script>
</head>

<body aet-hide-popovers aet-keyboard-shortcuts aet-sidepanel ng-class="{ 'menu-expanded': sidebarExpanded }">
<body aet-hide-popovers aet-keyboard-shortcuts aet-sidepanel aet-winter-edition ng-class="{ 'menu-expanded': sidebarExpanded }">
Copy link
Contributor

Choose a reason for hiding this comment

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

is this CSS class needed? why? Maybe it should be only added in December ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

discussed


<div class="screen-cover js-loader-app" ng-if="metadataSaveInProgress"><h1>Saving data...</h1></div>
<div class="screen-cover data-loading-error" ng-if="metadataLoadingStatus == 'FAILED'"><h1>Failed to
Expand Down