This commit is contained in:
Martin Donnelly 2017-09-28 13:04:16 +01:00
commit 76920442b1
2902 changed files with 3892490 additions and 0 deletions

13
.babelrc Normal file
View File

@ -0,0 +1,13 @@
{
"sourceMap": true,
"moduleIds": false,
"comments": false,
"compact": false,
"code": true,
"presets": [ ["es2015", {"loose": true}], "stage-1"],
"plugins": [
"syntax-flow",
"transform-decorators-legacy",
"transform-flow-strip-types"
]
}

20
.editorconfig Normal file
View File

@ -0,0 +1,20 @@
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
# 2 space indentation
[**.js]
indent_style = space
indent_size = 2
# 4 space indentation
[**.html]
indent_style = space
indent_size = 4

9
.eslintrc.json Normal file
View File

@ -0,0 +1,9 @@
{
"extends": "./node_modules/aurelia-tools/.eslintrc.json",
"rules": {
"dot-notation": ["warn"],
"no-unused-vars": ["error"],
"no-console": ["error"],
"no-debugger": ["error"]
}
}

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
node_modules
.idea
.DS_STORE

27
.jsbeautifyrc Normal file
View File

@ -0,0 +1,27 @@
{
"indent_size": 4,
"html": {
"end_with_newline": true,
"js": {
"indent_size": 2
},
"css": {
"indent_size": 4
}
},
"css": {
"preserve_newlines": true,
"end_with_newline": true,
"space_in_paren": true,
"newline_between_rules": true,
"space_around_selector_separator": true,
"space_around_combinator": true
},
"js": {
"indent_size": 2,
"end_with_newline": true,
"max_preserve_newlines": 2,
"keep_array_indentation": true,
"space_in_paren": true
}
}

10
.jsinspectrc Normal file
View File

@ -0,0 +1,10 @@
{
"threshold": 30,
"identifiers": true,
"literals": true,
"color": true,
"minInstances": 2,
"ignore": "test|spec.js|mock|.json",
"reporter": "default",
"truncate": 100
}

11
.project Normal file
View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>web-platform</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>

13
.stylelintrc Normal file
View File

@ -0,0 +1,13 @@
{
"extends": "stylelint-config-standard",
"rules": {
"indentation": 4,
"block-no-empty": null,
"at-rule-no-vendor-prefix": true,
"media-feature-name-no-vendor-prefix": true,
"property-no-vendor-prefix": true,
"selector-no-vendor-prefix": true,
"value-no-vendor-prefix": true,
"no-duplicate-selectors": true
}
}

0
188.json Normal file
View File

120
README.md Normal file
View File

@ -0,0 +1,120 @@
# Installation and set up
## prerequisites
1. Nodejs > 6.5
2. Git
## steps
1. npm install aurelia-cli -g
2. npm install
3. au run --watch
4. au test
## build details
The build creates web-platform.js in the assets/js folder
## commands
### `au run`
Runs the build process, then starts a local dev server on port 9000 i.e. http://localhost:9000/
* Add flag `--js` to only rebuild javascript and markup when developing. This speeds up the rebuild.
* Add flag `--dev` to only transpile js and process markup without linting when developing. This speeds up the rebuild. Run a full build before committing.
* Add flag `--docs` to only build the markdown files. This speeds up the documentation.
Run a full build before committing.
### `au run --watch`
Same as `au run`, but will rebuild when code changes
See `au run` task for `--js` and `--docs` and `--dev` flags
### `au run --watch --use-test-server`
Same as `au run --watch`, but will use test server data
Type `au help run` for more details
### `au build`
Runs the build process. This includes linting, processing, transpiling and bundling, but not tests
See `au run` task for `--js` and `--docs` and `--dev` flags
### `au test`
Runs ALL test suites (*.spec.js files).
Append a spec filename to --focused-test to run that suite only
`au test --focused-test ft-footnote`
to run
`src\components\products\common\elements\ft-footnote.spec.js`
### `au test --ui`
Runs test suites for UI components using Jasmine and Karma. This will open and close a browser window while running tests.
Append a spec filename to --focused-test to run that suite only
`au test --ui --focused-test ft-footnote`
to run
`src\components\products\common\elements\ft-footnote.spec.js`
NB: Doesn't run the Business Logic (reducer) test suites.
### `au test --bl`
Runs test suites for Business Logic JS files (reducers, value-converters etc) using Jest.
Append a spec filename to --focused-test to run that suite only
`au test --bl --focused-test distribution-rate`
to run
`src\components\products\distributions\ft-distributions\lib\en-us-retail\distribution-rate.spec.js`
NB: These tests run very fast, as they only use NodeJS.
### `au lint-css`
Lints all `scss` files within `src` folder using http://stylelint.io/
Configuration is based on [stylelint-config-standard](https://github.com/stylelint/stylelint-config-standard) with custom configuration in `.stylelintrc` file
### `au lint-js`
Uses [ESLint](http://eslint.org/) to lint all `.js` files within `src` and `test` folders.
Configuration is on '.eslintrc' and based on the Aurelia eslint configuration.
[Why we indent with spaces](https://stackoverflow.blog/2017/06/15/developers-use-spaces-make-money-use-tabs/)
### `au lint-markup`
Lints html files using [gulp-lintspaces](https://www.npmjs.com/package/gulp-lintspaces)
All this really lints is whitespace and indentation, but at the moment there aren't any suitable html snippet linters.
### `au process-assets`
At present, this just copies the bootstrap fonts from the `node_modules` folder to `assets`.
In future it will likely copy more font and image files as part of the build.
### `au process-css`
This applies the following to the scss files in the `src` folder:
* runs the `lint-css` task
* compiles the sass into css
* applies [autoprefixer](https://github.com/postcss/autoprefixer) via [postcss](https://github.com/postcss/postcss)
* minifies the css via [cssnano](http://cssnano.co/)
* generates css sourcemaps
* saves the css files and sourcemaps to the `assets` folder
### `au process-markup`
This just applies the `lint-markup` task, before passing the markup off to the bundler
### `au generate redux-component`
This is used to generate a redux component or sub-component. Tests, documentation, sass and (optionally) reducer files are also generated. See `lib/redux-component-base.md` for more details.
### `au proxy-server`
This is used to test the dev assets against the live or dev site.
Example proxying live site with dev css assets
au proxy-server --proxy-target http://rcovlnx0188:8202 --dev-css-assets-server http://pattern-library.corp.frk.com/
Example proxying dev site with dev css assets
au proxy-server --dev-css-assets-server http://pattern-library.corp.frk.com/
Example proxying live site with dev js assets, and aurelia etf config
au proxy-server --override-aurelia-config configuration/etf/main --dev-js-assets-server http://localhost:9000/

454
assets/docs.json Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,59 @@
function downloadPdfApplication(data , id, option, site) {
var j ;
var i ;
var val;
var fid;
var cid;
var ls;
var fs;
var fill;
var d;
var path;
var file;
var pdfNumtool;
for(j=0; j<=data.length; j++){
if(data[j].checked == true){
if(site == "OF"){
val = data[j].id;
i = j+1;
fid = document.getElementById('fid'+id+i).value;
cid = document.getElementById('cid'+id+i).value;
fs = document.getElementById('fs'+id+i).value;
ls = document.getElementById('ls'+id+i).value;
fill = document.getElementById('fill'+id+i).value;
d = document.getElementById('d'+id).value;
path = document.getElementById('path'+id+i).value;
} else{
val = data[j].id;
fid = document.getElementById('fid'+id).value;
cid = document.getElementById('cid'+id).value;
fs = document.getElementById('fs'+id).value;
ls = document.getElementById('ls'+id).value;
fill = document.getElementById('fill'+id).value;
d = document.getElementById('d'+id).value;
path = document.getElementById('path'+id).value;
}
file = d +".pdf";
//alert(val+fid+cid+fs+ls+fill+d+path);
pdfNumtool=document.getElementById('pdfNumtool').value;
if(option=="true"){
file = "1.pdf";
document.downloadAccApp.action = pdfNumtool+"?fid=" + fid + "&cid=" + cid + "&fs=" + fs + "&ls=" + ls + "&fill=1&d=1"+"&path="+path+file;
}else{
document.downloadAccApp.action = pdfNumtool+"?fid=" + fid + "&cid=" + cid + "&fs=" + fs + "&ls=" + ls + "&fill=" + fill + "&d="+d+"&path="+path+file;
}
document.downloadAccApp.submit();
break;
}
}
}
//fixes chrome browser issue with checked input values
$(document).ready(function () {
$('form input[type="radio"]').each(function () {
if ($(this).attr("data-hack") == 'checked') {
$(this).attr('checked', true);
}
});
});

View File

@ -0,0 +1,2 @@
// Empty Aurelia Polyfills, now done by babel-polyfills which are much more complete
define('aurelia-polyfills', [], function() {});

164
assets/js/bootstrap-sass-customtabs.js vendored Normal file
View File

@ -0,0 +1,164 @@
/* ========================================================================
* Bootstrap: tab.js v3.3.7
* http://getbootstrap.com/javascript/#tabs
* ========================================================================
* Copyright 2011-2016 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
+function ($) {
'use strict';
// TAB CLASS DEFINITION
// ====================
var Tab = function (element) {
// jscs:disable requireDollarBeforejQueryAssignment
this.element = $(element);
// jscs:enable requireDollarBeforejQueryAssignment
};
Tab.VERSION = '3.3.7';
Tab.TRANSITION_DURATION = 150;
Tab.prototype.show = function() {
var $this = this.element;
var $ul = $this.closest('ul:not(.dropdown-menu)');
var selector = $this.data('target');
if (!selector) {
selector = $this.attr('href');
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, ''); // strip for ie7
}
window.location.hash = selector;
if ($this.parent('li').hasClass('active')) return;
var $previous = $ul.find('.active:last a');
var hideEvent = $.Event('hide.bs.tab', {
relatedTarget: $this[0]
});
var showEvent = $.Event('show.bs.tab', {
relatedTarget: $previous[0]
});
$previous.trigger(hideEvent);
$this.trigger(showEvent);
if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) return;
var $target = $(selector);
this.activate($this.closest('li'), $ul);
this.activate($target, $target.parent(), function() {
$previous.trigger({
type: 'hidden.bs.tab',
relatedTarget: $this[0]
});
$this.trigger({
type: 'shown.bs.tab',
relatedTarget: $previous[0]
});
});
};//end show
Tab.prototype.showdeeplink = function(deeplink) {
//Change the link...
var button = $('a[href="' + deeplink + '"]').find().prevObject;
Plugin.call(button, 'show');
}
Tab.prototype.activate = function(element, container, callback) {
var $active = container.find('> .active');
var transition = callback
&& $.support.transition
&& ($active.length && $active.hasClass('fade') || !!container.find('> .fade').length)
function next() {
$active
.removeClass('active')
.find('> .dropdown-menu > .active')
.removeClass('active')
.end()
.find('[data-toggle="tab"]')
.attr('aria-expanded', false);
element
.addClass('active')
.find('[data-toggle="tab"]')
.attr('aria-expanded', true);
if (transition) {
element[0].offsetWidth; // reflow for transition
element.addClass('in');
} else {
element.removeClass('fade');
}
if (element.parent('.dropdown-menu').length) {
element
.closest('li.dropdown')
.addClass('active')
.end()
.find('[data-toggle="tab"]')
.attr('aria-expanded', true);
}
callback && callback();
}
$active.length && transition ?
$active
.one('bsTransitionEnd', next)
.emulateTransitionEnd(Tab.TRANSITION_DURATION) :
next();
$active.removeClass('in');
}
// TAB PLUGIN DEFINITION
// =====================
function Plugin(option, additionaldata) {
return this.each(function () {
var $this = $(this);
var data = $this.data('bs.tab');
if (!data) $this.data('bs.tab', (data = new Tab(this)));
if (typeof option == 'string') data[option](additionaldata);
});
}
var old = $.fn.tab;
$.fn.tab = Plugin;
$.fn.tab.Constructor = Tab;
// TAB NO CONFLICT
// ===============
$.fn.tab.noConflict = function () {
$.fn.tab = old;
return this;
};
// TAB DATA-API
// ============
var clickHandler = function (e) {
e.preventDefault();
Plugin.call($(this), 'show');
};
$(document)
.on('click.bs.tab.data-api', '[data-toggle="tab"]', clickHandler)
.on('click.bs.tab.data-api', '[data-toggle="pill"]', clickHandler);
setTimeout(function() {
this.hash = window.location.hash;
if (this.hash) {
Plugin.call($(this), 'showdeeplink', this.hash);
}
}, 1500);
}(jQuery);

2166
assets/js/jquery-ui.js vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,649 @@
'use strict';
function downloadPdfApplication(data, id, option, site) {
var j = void 0;
var i = void 0;
var fid = void 0;
var cid = void 0;
var ls = void 0;
var fs = void 0;
var fill = void 0;
var d = void 0;
var path = void 0;
var file = void 0;
var pdfNumtool = void 0;
for (j = 0; j <= data.length; j++) {
if (data[j].checked === true) {
if (site === 'OF') {
i = j + 1;
fid = document.getElementById('fid' + id + i).value;
cid = document.getElementById('cid' + id + i).value;
fs = document.getElementById('fs' + id + i).value;
ls = document.getElementById('ls' + id + i).value;
fill = document.getElementById('fill' + id + i).value;
d = document.getElementById('d' + id).value;
path = document.getElementById('path' + id + i).value;
} else {
fid = document.getElementById('fid' + id).value;
cid = document.getElementById('cid' + id).value;
fs = document.getElementById('fs' + id).value;
ls = document.getElementById('ls' + id).value;
fill = document.getElementById('fill' + id).value;
d = document.getElementById('d' + id).value;
path = document.getElementById('path' + id).value;
}
file = d + '.pdf';
pdfNumtool = document.getElementById('pdfNumtool').value;
if (option === 'true') {
file = '1.pdf';
document.downloadAccApp.action = pdfNumtool + '?fid=' + fid + '&cid=' + cid + '&fs=' + fs + '&ls=' + ls + '&fill=1&d=1' + '&path=' + path + file;
} else {
document.downloadAccApp.action = pdfNumtool + '?fid=' + fid + '&cid=' + cid + '&fs=' + fs + '&ls=' + ls + '&fill=' + fill + '&d=' + d + '&path=' + path + file;
}
document.downloadAccApp.submit();
break;
}
}
}
$(document).ready(function () {
$('form input[type="radio"]').each(function () {
if ($(this).attr('data-hack') === 'checked') {
$(this).attr('checked', true);
}
});
});
'use strict';
(function ($, document, window) {
var componentName = 'backToTop';
var defaults = {
offset: '300',
duration: '300' };
function Component(element, options) {
this.element = element;
this.options = $.extend({}, defaults, options);
this._defaults = defaults;
this._name = componentName;
this.btnTopScroll = $(this.element).find('.back-to-top');
this.init();
}
Component.prototype = {
init: function init() {
var _this = this;
this.btnTopScroll.click(function (event) {
event.preventDefault();
_this.scroll(_this._defaults.duration);
return false;
});
$(window).scroll(function () {
if ($(window).scrollTop() > _this._defaults.offset) {
$('.back-to-top').fadeIn(_this._defaults.duration);
} else {
$('.back-to-top').fadeOut(_this._defaults.duration);
}
});
},
scroll: function scroll(duration) {
$('html, body').animate({ scrollTop: 0 }, duration);
}
};
$.fn[componentName] = function (options) {
return this.each(function () {
if (!$.data(this, 'component_' + componentName)) {
$.data(this, 'component_' + componentName, new Component(this, options));
} else {
$.data(this, 'component_' + componentName).scroll();
}
});
};
})(jQuery, document, window);
'use strict';
(function ($) {
function _getActiveSlideTitle() {
var slideTitle = $('[data-fti-component="carousel"]').find($('#ft-carousel')).find($('.item.active'))[0].attributes['slide-title'].value;
return slideTitle;
}
function _getSlidesNames() {
var slides = $('[data-fti-component="carousel"]').find($('#ft-carousel')).find($('.item'));
var slideNames = [];
for (var i = 0; i < slides.length; i++) {
var slide = slides[i];
slideNames.push(slide.attributes['slide-title'].value);
}
return slideNames;
}
function _getActiveSlideNR(activeSlide, slidesNames) {
if (!activeSlide || !slidesNames) return;
var counter = 0;
var activeNR = 0;
for (var i = 0; i < slidesNames.length; i++) {
var slide = slidesNames[i];
if (slide === activeSlide) {
activeNR = counter;
}
counter++;
}
return activeNR;
}
$.fn.carouselNav = function (direction) {
if (!direction) return;
var activeSlide = _getActiveSlideTitle();
var slideNames = _getSlidesNames();
var activeSlideNR = _getActiveSlideNR(activeSlide, slideNames);
var newSlideNR = void 0;
if (direction === 'left') newSlideNR = activeSlideNR - 1;
if (direction === 'right') newSlideNR = activeSlideNR + 1;
$(this).setNewTitleAndNav(newSlideNR, slideNames);
};
$.fn.setNewTitleAndNav = function (slideNR, slideNames) {
if (!slideNames) slideNames = _getSlidesNames();
var newSlideNR = parseInt(slideNR, 10);
var nrOfSlides = slideNames.length - 1;
var nextSlide = parseInt(slideNR, 10) + 1;
var prevSlide = parseInt(slideNR, 10) - 1;
if (prevSlide < 0) prevSlide = nrOfSlides;
if (newSlideNR < 0) {
newSlideNR = nrOfSlides;
prevSlide--;
}
if (nextSlide > nrOfSlides) nextSlide = 0;
if (newSlideNR > nrOfSlides) {
newSlideNR = 0;
nextSlide++;
}
$('#ft-carousel-header').text(slideNames[newSlideNR]);
$('#carouselLeft').find('span').text(slideNames[prevSlide]);
$('#carouselRight').find('span').text(slideNames[nextSlide]);
};
})(jQuery);
(function ($) {
$.fn.removeActiveFromOWL = function () {
$('li.owl-item.active').removeClass('active');
return;
};
$.fn.removeActiveFromRole = function () {
var presentationTab = $('li.owl-item').find($('[role="presentation"]'));
presentationTab.removeClass('active');
return;
};
$.fn.tabDirectionMove = function (owlTabbedOBJ, direction) {
var activeTab = owlTabbedOBJ.find('.owl-tab.active');
var activeTabName = activeTab.find('a')[0].getAttribute('aria-controls');
var activeTabNR = activeTabName.substring(activeTabName.length - 1);
var tabOperator = 1;
if (direction === 'prev') tabOperator = -1;
var directTabName = activeTabName.substring(0, activeTabName.length - 1) + (parseInt(activeTabNR, 10) + parseInt(tabOperator, 10));
var directTab = owlTabbedOBJ.find('[aria-controls="' + directTabName + '"]');
return directTab;
};
})(jQuery);
$(function () {
$('#carouselLeft').click(function () {
$(this).carouselNav('left');
});
$('#carouselRight').click(function () {
$(this).carouselNav('right');
});
$('[data-target="#ft-carousel"]').click(function () {
if (typeof this.attributes['data-slide-to'] !== 'undefined') {
var card = this.attributes['data-slide-to'].value;
$(this).setNewTitleAndNav(card);
}
});
$('#carousel-announcements').owlCarousel({
loop: false,
margin: 0,
responsiveClass: true,
navElement: 'i class="ft-icon ft-icon-right-carrot"',
navText: '',
responsive: {
0: {
items: 1,
dots: true,
nav: false
},
768: {
items: 2,
dots: false,
nav: true
},
992: {
items: 3,
dots: false,
nav: true
},
1200: {
items: 4,
dots: false,
nav: true
}
}
});
$('[data-fti-component="carousel"]').setNewTitleAndNav('0');
});
$(function () {
$('#carousel-announcements-tabbed').owlCarousel({
loop: false,
margin: 0,
responsiveClass: true,
navElement: 'i class="tabbed ft-icon ft-icon-right-carrot"',
navText: ['', ''],
itemElement: 'li',
touchDrag: false,
mouseDrag: false,
responsive: {
0: {
items: 1,
dots: true,
nav: false
},
768: {
items: 2,
dots: false,
nav: true
},
992: {
items: 4,
dots: false,
nav: true
},
1200: {
items: 4,
dots: false,
nav: true
}
},
onInitialized: rmActive,
onResized: function onResized() {
rmActive;
$('#carousel-announcements-tabbed').trigger('to.owl.carousel', 0);
$('#carousel-announcements-tabbed').find('[aria-controls="tabs-content-1"]').trigger('click');
}
});
function rmActive() {
$('#carousel-announcements-tabbed').removeActiveFromOWL();
}
$('.owl-next').click(function () {
var owlTabbed = $('#carousel-announcements-tabbed');
owlTabbed.removeActiveFromOWL();
var nextTab = owlTabbed.tabDirectionMove(owlTabbed, 'next');
nextTab.trigger('click');
});
$('.owl-prev').click(function () {
var owlTabbed = $('#carousel-announcements-tabbed');
owlTabbed.removeActiveFromOWL();
var prevTab = owlTabbed.tabDirectionMove(owlTabbed, 'prev');
prevTab.trigger('click');
});
$('li.owl-item').find($('[role="presentation"]')).find($('a')).click(function () {
$(this).removeActiveFromRole();
});
$('#carousel-announcements-tabbed').find('.owl-dots').click(function () {
var owlTabbed = $('#carousel-announcements-tabbed');
var activatedTab = owlTabbed.find('.owl-item.active');
var activatedTabLink = activatedTab.find('a');
activatedTabLink.trigger('click');
});
});
'use strict';
(function ($, document) {
var componentName = 'leavingSite';
var defaults = {
leavingSiteText: 'Clicking OK below will take you to an independent site. Information and services provided on this independent site are not reviewed by, guaranteed by, or endorsed by Franklin Templeton or its affiliates. Please keep in mind that this independent site\'s terms and conditions, privacy and security policies, or other legal information may be different from those of Franklin Templeton\'s site. Franklin Templeton is not liable for any direct or indirect technical or system issues, consequences, or damages arising from your use of this independent website.',
leavingSiteOk: 'OK',
leavingSiteCancel: 'Cancel'
};
function Component(element, options) {
this.element = element;
this.options = $.extend({}, defaults, options);
this._defaults = defaults;
this._name = componentName;
this.btnaExternalLink = $(this.element);
this.init();
}
Component.prototype = {
init: function init() {
this.btnaExternalLink.click(function (e) {
e.preventDefault();
$('ft-modal')[0].au.controller.viewModel.externalopen(e.currentTarget.href, true);
});
}
};
$.fn[componentName] = function (options) {
return this.each(function () {
if (!$.data(this, 'component_' + componentName)) {
$.data(this, 'component_' + componentName, new Component(this, options));
}
});
};
})(jQuery, document);
'use strict';
(function ($) {
var componentName = 'header';
var defaults = {};
function Component(element, options) {
this.element = element;
this.options = $.extend({}, defaults, options);
this._defaults = defaults;
this._name = componentName;
this.navTitles = $('#mega').find('.title');
this.init();
}
function isMobile() {
return $('#navbar-hamburger').is(':visible');
}
Component.prototype = {
init: function init() {
var _self = this;
$('ul.nav li.dropdown').on('click touch', function () {
if (!$(this).hasClass('open') && !isMobile()) {
$(this).addClass('currentlyHovering');
if ($('#mega').find('li.open').length === 0) {
$(this).queue(function () {
if ($(this).hasClass('currentlyHovering') && !isMobile()) {
$(this).find('.dropdown-toggle').attr('aria-expanded', 'true');
$(this).addClass('open').dequeue();
if ($(this).hasClass('search')) {
$(this).find('input').focus();
}
} else {
$(this).dequeue();
}
});
} else {
if ($(this).hasClass('currentlyHovering') && !isMobile()) {
$(this).find('.dropdown-toggle').attr('aria-expanded', 'true');
$('#mega').find('li.open').removeClass('open');
$(this).addClass('open').dequeue();
if ($(this).hasClass('search')) {
$(this).find('input').focus();
}
}
}
}
}, function () {
$(this).removeClass('currentlyHovering');
$(this).delay(250).queue(function () {
if (!$(this).is(':hover') && !isMobile()) {
$(this).removeClass('open').dequeue();
$(this).find('.dropdown-toggle').attr('aria-expanded', 'false');
} else {
$(this).dequeue();
}
});
});
$('#slide-nav.navbar').after($('<div id="navbar-height-col"></div>'));
var toggler = '.navbar-toggle';
var pagewrapper = '#page-content';
var navigationwrapper = '.navbar-header';
var slidewidth = '85%';
var menuneg = '-100%';
var slideneg = '-85%';
$('#slide-nav').on('click', toggler, function () {
var selected = $(this).hasClass('offcanvas-active');
$('#navbar-close').toggleClass('hidden');
$('#navbar-hamburger').toggleClass('hidden');
$('#offcanvas-menu').stop().animate({
left: selected ? menuneg : '0px'
});
$('#navbar-height-col').stop().animate({
left: selected ? slideneg : '0px'
});
$(pagewrapper).stop().animate({
left: selected ? '0px' : slidewidth
});
$(navigationwrapper).stop().animate({
left: selected ? '0px' : slidewidth
});
$(this).toggleClass('offcanvas-active', !selected);
$('#offcanvas-menu').toggleClass('offcanvas-active');
$('#page-content, .navbar, body, .navbar-header').toggleClass('offcanvas-active');
});
$('form[data-fti-element=sign-in-form]').on('submit', function (e) {
var _form = this;
e.preventDefault();
var postData = $(_form).serialize();
$.ajax({
type: 'POST',
url: '/api/account/prelogin',
data: postData,
dataType: 'json'
}).done(function (e2, data) {
if (e2.location) {
window.location = e2.location;
} else {
$(_form).attr('action', e2.loginUrl);
$(_form).off('submit');
$(_form).find('input[name="rememberMe"]')[0].value = postData.indexOf('_rememberMe=on') > -1;
$(_form).submit();
}
});
});
var selected = '#slidemenu, #page-content, body, .navbar, .navbar-header';
_self.setToggleCollapse();
_self.resizeHandler(selected);
_self.initTooltip();
},
setToggleCollapse: function setToggleCollapse() {
var _self = this;
if (isMobile()) {
_self.navTitles.data('toggle', 'collapse');
_self.navTitles.on('click', function (e) {
var el = $(e.target);
while (!el.is('a')) {
el = el.parent();
}
el.next('.collapse').collapse('toggle');
el.attr('aria-expanded', function (i, attr) {
return attr === 'true' ? 'false' : 'true';
});
el.parent('.dropdown').toggleClass('open');
e.stopPropagation();
e.preventDefault();
});
} else {
_self.navTitles.data('toggle', 'disabled');
_self.navTitles.off('click');
}
},
resizeHandler: function resizeHandler(selected) {
var _self = this;
$(window).on('resize', function () {
if (!isMobile() && $('.navbar-toggle').is(':hidden')) {
$(selected).removeClass('offcanvas-active');
}
_self.setToggleCollapse();
});
},
initTooltip: function initTooltip() {
$('[data-toggle="tooltip"]').tooltip();
}
};
$.fn[componentName] = function (options) {
return this.each(function () {
if (!$.data(this, 'component_' + componentName)) {
$.data(this, 'component_' + componentName, new Component(this, options));
}
});
};
})(jQuery);
'use strict';
$(function () {
$('*[data-fti-module="header"]').header();
$('*[data-fti-module="back-to-top"]').backToTop();
$('*[data-fti-module="rich_text"]').rich_text();
$('*[data-fti-component="tabs"]').tabs();
$('*[data-fti-component="rich-text"][data-fti-module="tabs"]').tabs();
$('a.external-link').each(function () {
$(this).leavingSite();
});
$('[data-toggle="popover"]').popover();
$('[data-toggle="tooltip"]').tooltip();
$('body').on('click', '.popover .close', function () {
$(this).parents('.popover').popover('hide');
});
});
'use strict';
(function ($, window, document) {
var componentName = 'rich_text';
function Component(element, options) {
this.element = element;
this.options = options;
this._name = componentName;
this.init();
}
Component.prototype = {
init: function init() {
var _this = this;
$('.collapseAll', this.element).on('click', function () {
$('.panel-collapse.in', _this.element).collapse('hide');
});
$('.expandAll', this.element).on('click', function () {
$('.panel-collapse:not(".in")', _this.element).collapse('show');
});
}
};
$.fn[componentName] = function (options) {
return this.each(function () {
if (!$.data(this, 'component_' + componentName)) {
$.data(this, 'component_' + componentName, new Component(this, options));
} else {
$.data(this, 'component_' + componentName).init();
}
});
};
})(jQuery, window, document);
'use strict';
(function ($) {
var componentName = 'tabs';
var defaults = {};
function Component(element, options) {
this.element = element;
this.options = $.extend({}, defaults, options);
this._defaults = defaults;
this._name = componentName;
this.navCollapse = $(this.element).find('.navbar-collapse');
this.navTabLinks = $(this.element).find('.nav-tabs-top-level, .nav.nav-pills.nav-stacked').find('a');
this.tabContent = $(this.element).find('.tab-content');
this.headerTextContainer = $(this.element).find('.mobile-menu + span');
this.init();
}
Component.prototype = {
init: function init() {
var _this = this;
this.setHeaderText();
if (this.navCollapse.find('ul').hasClass('nav-stacked--no-panel')) {
this.adjustContentHeight();
$(window).on('resize', function () {
_this.adjustContentHeight();
});
}
},
setHeaderText: function setHeaderText() {
var _self = this;
this.navTabLinks.on('click', function (e) {
var elParent = $(this).parent('li');
var headerText = $(this).text();
_self.headerTextContainer.text(headerText);
elParent.siblings().removeClass('hidden-xs');
elParent.addClass('hidden-xs');
_self.navCollapse.collapse('hide');
});
},
adjustContentHeight: function adjustContentHeight() {
if (this.headerTextContainer.is(':visible')) {
$(this.tabContent).css('min-height', 'auto');
} else {
var navTabsHeight = this.navCollapse.height();
var bottomMargin = 5;
$(this.tabContent).css('min-height', navTabsHeight - bottomMargin);
}
}
};
$.fn[componentName] = function (options) {
return this.each(function () {
if (!$.data(this, 'component_' + componentName)) {
$.data(this, 'component_' + componentName, new Component(this, options));
}
});
};
})(jQuery);
//# sourceMappingURL=livesite-modules.js.map

File diff suppressed because one or more lines are too long

3464
assets/js/local-test.js Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

24557
assets/js/web-platform-app.js Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

105406
assets/js/web-platform-dist.js Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

6554
assets/js/web-platform-gw.js Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

69139
assets/js/web-platform.js Normal file

File diff suppressed because one or more lines are too long

9
assetsSymLink.bat Normal file
View File

@ -0,0 +1,9 @@
REM Symbolic links solution for web-platform/pattern-lab integration in the same branch
REM To create symbolic links as non admin:
REM 1. Bring up your run box, type “secpol.msc” and click OK.
REM 2. Navigate under the Security Settings \ Local Policies \ User Rights Assignment folder.
REM 3. Find “Create symbolic links” and add the Users group to it.
REM 4. Restart system.
mklink /D assets ..\pattern-library\public\assets
mklink /D ..\pattern-library\public\data ..\..\web-platform\test\data

View File

@ -0,0 +1,508 @@
{
"name": "web-platform",
"source": "cli",
"type": "project:application",
"transpiler": {
"id": "babel",
"displayName": "Babel",
"fileExtension": ".js",
"options": {
"plugins": [
"transform-es2015-modules-amd"
]
},
"source": [
"src/**/*.js",
"!src/**/*.spec.js"
]
},
"livesiteJS": {
"id": "babel",
"displayName": "Babel",
"fileExtension": ".js",
"options": {
"presets": [
"es2015"
]
},
"source": [
"src/livesite/**/*.js"
],
"output": "assets/js"
},
"jsLinter": {
"id": "eslint",
"displayName": "ESLint",
"fileExtension": ".js",
"source": [
"src/**/*.js",
"test/**/*.js",
"!src/**/*.spec.js",
"!test/aurelia-karma.js",
"!test/**/*.spec.js",
"!node_modules/**",
"!src/livesite/application_form_download.js"
],
"testSource": [
"aurelia_project/**/*.js",
"src/**/*.spec.js",
"test/**/*.spec.js",
"!node_modules/**"
]
},
"markupProcessor": {
"id": "none",
"displayName": "None",
"fileExtension": ".html",
"source": "src/**/*.html"
},
"cssProcessor": {
"id": "sass",
"displayName": "SASS",
"fileExtension": ".scss",
"source": [
"src/**/*.scss",
"!src/**/lib/*"
],
"output": "assets/css",
"browsers": {
"browsers": [
"last 1 version"
]
},
"sassIncludePaths": [
"./node_modules/bootstrap-sass/assets/stylesheets/"
]
},
"docsProcessor": {
"source": [
"README.md",
"src/**/*.md"
],
"outputDir": "assets/",
"jsonFile": "docs.json",
"index": {
"index": [
{
"section": "General",
"regex": "^README.md|developer-notes/general|lib"
},
{
"section": "Common Components",
"regex": "^components/common"
},
{
"section": "Marketing",
"regex": "^components/marketing"
},
{
"section": "Products",
"subs": [
{
"section": "General",
"regex": "^developer-notes/products"
},
{
"section": "Common components",
"regex": "^components/products/common/elements"
},
{
"section": "Value converters",
"regex": "^components/products/common/value-converters"
},
{
"section": "PPSS",
"regex": "^components/products/ppss"
},
{
"section": "Overview",
"regex": "^components/products/overview"
},
{
"section": "Portfolio",
"regex": "^components/products/portfolio"
},
{
"section": "Performance",
"regex": "^components/products/performance|components/products/historical"
},
{
"section": "Pricing & Distribution",
"regex": "^components/products/pricing-distribution"
},
{
"section": "Price",
"regex": "^components/products/pricing"
},
{
"section": "Distributions",
"regex": "^components/products/distributions"
},
{
"section": "Documents",
"regex": "^components/products/documents"
}
]
},
{
"section": "Uncategorized"
}
]
}
},
"assetsProcessor": {
"id": "assets",
"displayName": "Assets",
"clean": "assets",
"assets": [
{
"src": [
"./static-assets/js/**"
],
"dest": "assets/js"
}
]
},
"packager": {
"src": [
"assets/**/*",
"coverage/**/*",
"test/**/*",
"index.html",
"docs.html"
],
"zipfile": "web-platform.zip",
"outputDir": "."
},
"unitTestRunner": {
"id": "karma",
"displayName": "Karma",
"source": "src/**/*.js"
},
"testFramework": {
"id": "jasmine",
"displayName": "Jasmine"
},
"editor": {
"id": "atom",
"displayName": "Atom"
},
"platform": {
"id": "default",
"displayName": "Default",
"output": "assets/js"
},
"workflow": null,
"defaultOrCustom": "custom",
"paths": {
"root": "src"
},
"build": {
"targets": [
{
"id": "default",
"displayName": "Default",
"output": "assets/js",
"useAbsolutePath": true
}
],
"loader": {
"type": "require",
"configTarget": "web-platform.js",
"config": {
"waitSeconds": 60
},
"includeBundleMetadataInConfig": "auto",
"plugins": [
{
"name": "text",
"extensions": [
".html",
".css"
],
"stub": true
}
]
},
"options": {
"minify": "stage & prod",
"sourcemaps": "dev & stage",
"bundleReport": "dev & stage & prod"
},
"bundles": [
{
"name": "local-test.js",
"source": {
"include": [
"[**/test/**/*.js]",
"**/test/**/*.{css,html}"
]
},
"dependencies": [
"aurelia-route-recognizer",
"aurelia-router",
"aurelia-history",
"aurelia-history-browser",
{
"name": "aurelia-templating-router",
"path": "../node_modules/aurelia-templating-router/dist/amd",
"main": "aurelia-templating-router"
}
],
"options": {
"inject": true
}
},
{
"name": "web-platform-app.js",
"source": {
"include": [
"[**/*.js]",
"**/*.{css,html}"
],
"exclude": [
"**/*.spec.js",
"**/test/**/*.*",
"**/livesite/**/*.*",
"**/etf/**/*.*",
"**/gw/**/*.*",
"**/etf-gb/**/*.*",
"**/en-gb/**/*.*",
"**/en-us-retail/**/*.*"
]
},
"options": {
"inject": true
}
},
{
"name": "web-platform-etf.js",
"source": {
"include": [
"[**/*.js]",
"**/*.{css,html}"
],
"exclude": [
"**/*.spec.js",
"**/test/**/*.*",
"**/livesite/**/*.*",
"**/gw/**/*.*",
"**/en-gb/**/*.*",
"**/en-us-retail/**/*.*"
]
},
"options": {
"inject": true
}
},
{
"name": "web-platform-gw.js",
"source": {
"include": [
"[**/*.js]",
"**/*.{css,html}"
],
"exclude": [
"**/*.spec.js",
"**/test/**/*.*",
"**/livesite/**/*.*",
"**/etf/**/*.*",
"**/etf-gb/**/*.*",
"**/en-us-retail/**/*.*"
]
},
"options": {
"inject": true
}
},
{
"name": "web-platform-us-retail.js",
"source": {
"include": [
"[**/*.js]",
"**/*.{css,html}"
],
"exclude": [
"**/*.spec.js",
"**/test/**/*.*",
"**/livesite/**/*.*",
"**/etf/**/*.*",
"**/gw/**/*.*",
"**/etf-gb/**/*.*",
"**/en-gb/**/*.*"
]
},
"options": {
"inject": true
}
},
{
"name": "web-platform.js",
"prepend": [
"node_modules/babel-polyfill/dist/polyfill.js",
"node_modules/bluebird/js/browser/bluebird.core.js",
"node_modules/whatwg-fetch/fetch.js",
"node_modules/requirejs/require.js"
],
"dependencies": [
{
"name": "text",
"path": "../node_modules/requirejs-text/text",
"packageRoot": "../"
},
"aurelia-binding",
"aurelia-bootstrapper",
"aurelia-dependency-injection",
"aurelia-event-aggregator",
"aurelia-fetch-client",
"aurelia-framework",
"aurelia-loader",
"aurelia-loader-default",
"aurelia-logging",
"aurelia-logging-console",
"aurelia-metadata",
"aurelia-pal",
"aurelia-pal-browser",
"aurelia-path",
{
"name": "redux",
"path": "../node_modules/redux/dist/redux.min"
},
"aurelia-task-queue",
"aurelia-templating",
"aurelia-templating-binding",
{
"name": "aurelia-testing",
"path": "../node_modules/aurelia-testing/dist/amd",
"main": "aurelia-testing"
},
{
"name": "aurelia-templating-resources",
"path": "../node_modules/aurelia-templating-resources/dist/amd",
"main": "aurelia-templating-resources"
},
{
"name": "lodash",
"path": "../node_modules/lodash",
"main": "noop"
},
{
"name": "aurelia-polyfills",
"path": "../static-assets/js/",
"main": "aurelia-polyfills",
"packageRoot": "../static-assets"
},
"jquery",
{
"name": "jquery-ui",
"path": "../static-assets/js/",
"main": "jquery-ui",
"deps": ["jquery"],
"packageRoot": "../static-assets"
},
{
"name": "highcharts",
"path": "../node_modules/highcharts",
"main": "highcharts"
},
{
"name": "moment",
"path": "../node_modules/moment",
"main": "moment"
},
{
"name": "moment-parseformat",
"path": "../node_modules/moment-parseformat/dist/moment-parseformat"
},
{
"name": "moment-jdateformatparser",
"path": "../node_modules/moment-jdateformatparser/moment-jdateformatparser"
},
{
"name": "bootstrap-sass-affix",
"path": "../node_modules/bootstrap-sass/assets/javascripts/bootstrap",
"main": "affix"
},
{
"name": "bootstrap-sass-alert",
"path": "../node_modules/bootstrap-sass/assets/javascripts/bootstrap",
"main": "alert"
},
{
"name": "bootstrap-sass-button",
"path": "../node_modules/bootstrap-sass/assets/javascripts/bootstrap",
"main": "button"
},
{
"name": "bootstrap-sass-carousel",
"path": "../node_modules/bootstrap-sass/assets/javascripts/bootstrap",
"main": "carousel"
},
{
"name": "bootstrap-sass-collapse",
"path": "../node_modules/bootstrap-sass/assets/javascripts/bootstrap",
"main": "collapse"
},
{
"name": "bootstrap-sass-dropdown",
"path": "../node_modules/bootstrap-sass/assets/javascripts/bootstrap",
"main": "dropdown"
},
{
"name": "bootstrap-sass-modal",
"path": "../node_modules/bootstrap-sass/assets/javascripts/bootstrap",
"main": "modal"
},
{
"name": "bootstrap-sass-scrollspy",
"path": "../node_modules/bootstrap-sass/assets/javascripts/bootstrap",
"main": "scrollspy"
},
{
"name": "bootstrap-sass-tooltip",
"path": "../node_modules/bootstrap-sass/assets/javascripts/bootstrap",
"main": "tooltip"
},
{
"name": "bootstrap-sass-popover",
"path": "../node_modules/bootstrap-sass/assets/javascripts/bootstrap",
"main": "popover"
},
{
"name": "bootstrap-sass-transition",
"path": "../node_modules/bootstrap-sass/assets/javascripts/bootstrap",
"main": "transition"
},
{
"name": "bootstrap-sass-customtabs",
"path": "../static-assets/js/",
"main": "bootstrap-sass-customtabs",
"packageRoot": "../",
"deps": ["jquery"]
},
"bootstrap-tabcollapse",
"owl.carousel",
"responsive-toolkit",
{
"name": "aurelia-validation",
"path": "../node_modules/aurelia-validation/dist/amd",
"main": "aurelia-validation"
}
],
"options": {
"inject": true
}
}
]
},
"sonar": {
"id": "sonar-runner",
"sonarURL": "http://rcolnx89006:9005",
"sonarDB": "jdbc:mysql://rcolnx89006:3306/sonar?useUnicode=true&amp;characterEncoding=utf8",
"sonarUser": "sonar",
"sonarPasswd": "sonar",
"sources": "src/components,src/lib,src/livesite",
"exclusions": "**/*.md,**/*.spec.js,**/*.html,**/*.json",
"reportPath": "coverage/sonar_report/lcov.info"
}
}

View File

@ -0,0 +1,7 @@
export default {
debug: true,
testing: true,
cssRoot: 'http://pattern-library.corp.frk.com',
version: '<INJECTED_PROJECT_VERSION/>'
// cssRoot: 'http://localhost:3000'
};

View File

@ -0,0 +1,6 @@
export default {
debug: false,
testing: false,
cssRoot: '',
version: '<INJECTED_PROJECT_VERSION/>'
};

View File

@ -0,0 +1,6 @@
export default {
debug: true,
testing: false,
cssRoot: '',
version: '<INJECTED_PROJECT_VERSION/>'
};

View File

@ -0,0 +1,44 @@
import {inject} from 'aurelia-dependency-injection';
import {Project, ProjectItem, CLIOptions, UI} from 'aurelia-cli';
@inject(Project, CLIOptions, UI)
export default class AttributeGenerator {
constructor(project, options, ui) {
this.project = project;
this.options = options;
this.ui = ui;
}
execute() {
return this.ui
.ensureAnswer(this.options.args[0], 'What would you like to call the custom attribute?')
.then(name => {
let fileName = this.project.makeFileName(name);
let className = this.project.makeClassName(name);
this.project.attributes.add(
ProjectItem.text(`${fileName}.js`, this.generateSource(className))
);
return this.project.commitChanges()
.then(() => this.ui.log(`Created ${fileName}.`));
});
}
generateSource(className) {
return `import {inject} from 'aurelia-framework';
@inject(Element)
export class ${className}CustomAttribute {
constructor(element) {
this.element = element;
}
valueChanged(newValue, oldValue) {
}
}
`;
}
}

View File

@ -0,0 +1,4 @@
{
"name": "attribute",
"description": "Creates a custom attribute class and places it in the project resources."
}

View File

@ -0,0 +1,41 @@
import {inject} from 'aurelia-dependency-injection';
import {Project, ProjectItem, CLIOptions, UI} from 'aurelia-cli';
@inject(Project, CLIOptions, UI)
export default class BindingBehaviorGenerator {
constructor(project, options, ui) {
this.project = project;
this.options = options;
this.ui = ui;
}
execute() {
return this.ui
.ensureAnswer(this.options.args[0], 'What would you like to call the binding behavior?')
.then(name => {
let fileName = this.project.makeFileName(name);
let className = this.project.makeClassName(name);
this.project.bindingBehaviors.add(
ProjectItem.text(`${fileName}.js`, this.generateSource(className))
);
return this.project.commitChanges()
.then(() => this.ui.log(`Created ${fileName}.`));
});
}
generateSource(className) {
return `export class ${className}BindingBehavior {
bind(binding, source) {
}
unbind(binding, source) {
}
}
`;
}
}

View File

@ -0,0 +1,4 @@
{
"name": "binding-behavior",
"description": "Creates a binding behavior class and places it in the project resources."
}

View File

@ -0,0 +1,288 @@
import {inject} from 'aurelia-dependency-injection';
import {Project, ProjectItem, CLIOptions, UI} from 'aurelia-cli';
import mkdirp from 'mkdirp';
@inject(Project, CLIOptions, UI)
export default class ElementGenerator {
constructor(project, options, ui) {
this.project = project;
this.options = options;
this.ui = ui;
}
execute() {
return this.ui
.ensureAnswer(this.options.args[0], 'What is the name of the element? (in hyphen format. ft- will be prefixed automatically)')
.then(name => {
let area = 'common/';
let subarea = 'elements/';
let fileName = this.project.makeFileName(name);
let className = this.project.makeClassName(name);
let subDir = area + '/' + subarea;
let relDir = 'components/' + subDir + '/ft-' + fileName;
let dir = 'src/' + relDir;
mkdirp.sync(dir);// quick fix incase parent folder doesn't exist.
this.project.locations.push(this.project[dir] = ProjectItem.directory(dir));
this.project[dir].add(
ProjectItem.text(`ft-${fileName}.js`, this.generateComponentJsSource(className)),
ProjectItem.text(`ft-${fileName}.spec.js`, this.generateComponentTestJsSource(className, fileName, relDir)),
ProjectItem.text(`ft-${fileName}.html`, this.generateComponentHtmlSource(fileName)),
ProjectItem.text(`ft-${fileName}.md`, this.generateComponentMdSource('ft-' + fileName)),
);
return this.project.commitChanges()
.then(() => this.ui.log(`Created ${fileName}.`));
});
}
/**
* source for top level component js
* @param className
* @returns {string}
*/
generateComponentJsSource(className) {
return `import {bindable, inject} from 'aurelia-framework';
@inject(Element)
export class Ft${className} {
@bindable nameThisBindable;
constructor(element) {
this.element = element;
}
callBackFunction() {
this.element.innerHTML = this.nameThisBindable;
}
}`;
}
/**
* source for top level component js unit test
* @param className
* @param fileName
* @returns {string}
*/
generateComponentTestJsSource(className, fileName, relDir) {
return `import {StageComponent} from 'aurelia-testing';
import {LogManager} from 'aurelia-framework';
import {bootstrap} from 'aurelia-bootstrapper';
const logger = LogManager.getLogger('${fileName}');
describe('${className}', () => {
let component;
let mockStore = {
dispatch: function(action) {
expect(action.type).toBeDefined();
logger.info('actions should have a type: ' + action.type);
},
subscribe: function(callback) {
logger.info('subscription request to the store');
}
};
let beans = { // see configuration/en-us-retail/beans.js for example
component: {
${className}: []
},
bean: {
}
};
beforeEach(() => {
component = StageComponent
.withResources('${relDir}/ft-${fileName}')
.inView('<ft-${fileName} id="test1" fund-id="817"></ft-${fileName}>');
component.configure = (aurelia) => {
aurelia.container.registerInstance('Store', mockStore);
aurelia.container.registerInstance('Beans', beans);
aurelia.use.basicConfiguration()
.feature('components/common')
.feature('components/products/common');
};
});
it('should render something', done => {
component.create(bootstrap).then(() => {
const testElement = document.getElementById('test1');
expect(testElement.innerText).toMatch(/replace me/);
done();
});
});
afterEach(() => {
component.dispose();
});
});
`;
}
/**
* source for top level component html
* @returns {string}
*/
generateComponentHtmlSource(fileName) {
return `<template>
<div>ft-${fileName}: replace me</div>
</template>
`;
}
/**
* source for reducer
* @param funcName, fileName
*/
generateReducerJsSource(funcName, fileName) {
return `/**
* Data Reducer for ${funcName}
* Takes site specific json data and creates model for components
* after applying business and presentation logic and data mapping
*/
import {LogManager} from 'aurelia-framework';
const logger = LogManager.getLogger('${fileName}');
export function ${funcName}(state, action) {
let stateOBJ;
if (action.type === 'CHANGE_ME_TO_PROPER_ACTION_NAME_SUCCESS') {
logger.debug('Reducing: CHANGE_ME_TO_PROPER_ACTION_NAME_SUCCESS');
stateOBJ = Object.assign({}, state, {
${funcName}: action.data
});
} else {
stateOBJ = state;
}
return stateOBJ;
}
`;
}
/**
* source for reducer unit test
* @param funcName
*/
generateReducerTestJsSource(funcName, fileName) {
return `import {${funcName}} from './${fileName}.reducer';
describe('${funcName}', () => {
it('should return unchanged state if action does not apply', done => {
let action = {
type: 'ANOTHER_ACTION'
};
let oldState = {};
let newState = ${funcName}(oldState, action, {});
expect(newState).toBe(oldState);
done();
});
it('should return some stuff', done => {
let action = {
type: 'CHANGE_ME_TO_PROPER_ACTION_NAME_SUCCESS',
data: {
stuff: 'some stuff'
}
};
let newState = ${funcName}({}, action, {});
expect(newState.${funcName}.stuff).toBe('some stuff');
done();
});
});
`;
}
/**
* source for reducer
* @param funcName, fileName
*/
generateAppStateReducerJsSource(funcName, fileName) {
return `/**
* App State Reducer for ${funcName}
* Takes application state data and creates model for components
*/
import {LogManager} from 'aurelia-framework';
const logger = LogManager.getLogger('${fileName}');
export function ${funcName}(state, action) {
switch (action.type) {
case 'SOME_ACTION':
logger.debug('Reducing: SOME_ACTION');
return Object.assign({}, state, {
${funcName}: action.data
});
default:
return state;
}
}
`;
}
/**
* source for reducer unit test
* @param funcName
*/
generateAppStateReducerTestJsSource(funcName, fileName) {
return `import {${funcName}} from './${fileName}.reducer';
describe('${funcName}', () => {
it('should return unchanged state if action does not apply', done => {
let action = {
type: 'ANOTHER_ACTION'
};
let oldState = {};
let newState = ${funcName}(oldState, action, {});
expect(newState).toBe(oldState);
done();
});
it('should return some stuff', done => {
let action = {
type: 'SOME_ACTION',
data: {
stuff: 'some stuff'
}
};
let newState = ${funcName}({}, action, {});
expect(newState.${funcName}.stuff).toBe('some stuff');
done();
});
});
`;
}
/**
* generate markdown stub
* @param fileName
* @returns {string}
*/
generateComponentMdSource(fileName) {
return `# ${ fileName }
## Usage
${'```'}html
<${ fileName} fund-id="817" cid="uniqueId"></${ fileName}>
${'```'}
*The cid is guaranteed to be unique to this page even if multiple instances of the component are added to the same page.*
## Developer notes
`;
}
/**
* generate sass partial stub
* @param fileName
* @returns {string}
*/
generateComponentSassSource(fileName, name) {
return `
// CSS specific to the ${ fileName } component goes here
[data-fti-component="${ name }"] {
}
`;
}
}

View File

@ -0,0 +1,4 @@
{
"name": "element",
"description": "Creates a custom element class and template, placing them in the project resources."
}

View File

@ -0,0 +1,73 @@
import {inject} from 'aurelia-dependency-injection';
import {Project, ProjectItem, CLIOptions, UI} from 'aurelia-cli';
@inject(Project, CLIOptions, UI)
export default class GeneratorGenerator {
constructor(project, options, ui) {
this.project = project;
this.options = options;
this.ui = ui;
}
execute() {
return this.ui
.ensureAnswer(this.options.args[0], 'What would you like to call the generator?')
.then(name => {
let fileName = this.project.makeFileName(name);
let className = this.project.makeClassName(name);
this.project.generators.add(
ProjectItem.text(`${fileName}.js`, this.generateSource(className))
);
return this.project.commitChanges()
.then(() => this.ui.log(`Created ${fileName}.`));
});
}
generateSource(className) {
return `import {inject} from 'aurelia-dependency-injection';
import {Project, ProjectItem, CLIOptions, UI} from 'aurelia-cli';
@inject(Project, CLIOptions, UI)
export default class ${className}Generator {
constructor(project, options, ui) {
this.project = project;
this.options = options;
this.ui = ui;
}
execute() {
return this.ui
.ensureAnswer(this.options.args[0], 'What would you like to call the new item?')
.then(name => {
let fileName = this.project.makeFileName(name);
let className = this.project.makeClassName(name);
this.project.elements.add(
ProjectItem.text(\`\${fileName}.js\`, this.generateSource(className))
);
return this.project.commitChanges()
.then(() => this.ui.log(\`Created \${fileName}.\`));
});
}
generateSource(className) {
return \`import {bindable} from 'aurelia-framework';
export class \${className} {
@bindable value;
valueChanged(newValue, oldValue) {
}
}
\`
}
}
`;
}
}

View File

@ -0,0 +1,4 @@
{
"name": "generator",
"description": "Creates a generator class and places it in the project generators folder."
}

View File

@ -0,0 +1,355 @@
import {inject} from 'aurelia-dependency-injection';
import {Project, ProjectItem, CLIOptions, UI} from 'aurelia-cli';
import mkdirp from 'mkdirp';
@inject(Project, CLIOptions, UI)
export default class ReduxComponentGenerator {
constructor(project, options, ui) {
this.project = project;
this.options = options;
this.ui = ui;
}
execute() {
return this.ui
.ensureAnswer(this.options.args[0], 'What is the name of the redux component? (in hyphen format. ft- will be prefixed automatically)')
.then(name => {
let area = 'products';
this.ui.ensureAnswer(this.options.args[1], 'Which sub area? (blank sub area will add it at the area level)', 'portfolio')
.then(subarea => {
this.ui.ensureAnswer(this.options.args[2], 'Do you want a site specific data reducer? (Y/N)', 'Y')
.then(siteSpecificReducer => {
this.ui.ensureAnswer(this.options.args[3], 'Do you want an app state reducer? (Y/N)', 'N')
.then(appStateReducer => {
let fileName = this.project.makeFileName(name);
let className = this.project.makeClassName(name);
let funcName = this.project.makeFunctionName(name);
let makeSiteSpecificReducer = (siteSpecificReducer.toLowerCase() === 'y');
let makeAppStateReducer = (appStateReducer.toLowerCase() === 'y');
let subDir = (subarea) ? area + '/' + subarea : area;
let relDir = 'components/' + subDir + '/ft-' + fileName;
let dir = 'src/' + relDir;
mkdirp.sync(dir);// quick fix incase parent folder doesn't exist.
this.project.locations.push(this.project[dir] = ProjectItem.directory(dir));
this.project[dir].add(
ProjectItem.text(`ft-${fileName}.js`, this.generateComponentJsSource(className)),
ProjectItem.text(`ft-${fileName}.spec.js`, this.generateComponentTestJsSource(className, fileName, relDir, funcName)),
ProjectItem.text(`ft-${fileName}.html`, this.generateComponentHtmlSource(fileName)),
ProjectItem.text(`ft-${fileName}.md`, this.generateComponentMdSource('ft-' + fileName))
// ProjectItem.text(`_ft-${fileName}.scss`, this.generateComponentSassSource('ft-' + fileName, name))
);
if (makeSiteSpecificReducer) {
let reducerDir = dir + '/lib/gw';
mkdirp.sync(reducerDir);// quick fix incase parent folder doesn't exist.
this.project.locations.push(this.project[reducerDir] = ProjectItem.directory(reducerDir));
this.project[reducerDir].add(
ProjectItem.text(`${fileName}.reducer.js`, this.generateReducerJsSource(funcName, fileName)),
ProjectItem.text(`${fileName}.spec.js`, this.generateReducerTestJsSource(funcName, fileName))
);
}
if (makeAppStateReducer) {
let reducerDirAppState = dir + '/lib';
mkdirp.sync(reducerDirAppState);// quick fix incase parent folder doesn't exist.
this.project.locations.push(this.project[reducerDirAppState] = ProjectItem.directory(reducerDirAppState));
this.project[reducerDirAppState].add(
ProjectItem.text(`${fileName}.reducer.js`, this.generateAppStateReducerJsSource(funcName, fileName)),
ProjectItem.text(`${fileName}.spec.js`, this.generateAppStateReducerTestJsSource(funcName, fileName))
);
}
return this.project.commitChanges()
.then(() => this.ui.log(`Created ${fileName}.`));
});
});
});
});
}
/**
* source for top level component js
* @param className
* @returns {string}
*/
generateComponentJsSource(className) {
return `import {inject} from 'aurelia-framework';
import {ReduxComponentBase} from '../../../../lib/redux-component-base';
// import {getFundState} from '../../lib/map-state-utils';
// import get from 'lodash/get';
@inject('Store', 'Beans', Element)
export class Ft${className} extends ReduxComponentBase {
populated = false;
constructor(store, beans, element) {
// add logging and integration with the data store
super(store);
this.fundId = element.getAttribute('fund-id');
// This is a top level component so we need to initiate the population
this.dispatch({
type: 'POPULATE_CHANGE_ME_STATE',
// beans: beans..., // beans set in configuration for site e.g. configuration/en-us-retail/beans.js
fundId: this.fundId
});
}
/**
* Called when the state changes.
*/
mapState(newState) {
try {
this.logger.debug('mapState()');
// let fundState = getFundState(newState, this.fundId);
// set component properties from state as appropriate
// this.label = get(newState, 'products.label');
// if we get to here without erroring, data has been populated successfully
this.populated = true;
} catch (e) {
// state not populated yet
this.populated = false;
}
}
}
`;
}
/**
* source for top level component js unit test
* @param className
* @param fileName
* @returns {string}
*/
generateComponentTestJsSource(className, fileName, relDir, funcName) {
return `import {StageComponent} from 'aurelia-testing';
import {bootstrap} from 'aurelia-bootstrapper';
import {wait} from '../../../../lib/test-utils.js';
describe('${className}', () => {
let component;
let mockStore = {
dispatch: function(action) {
expect(action.type).toBeDefined();
},
subscribe: function(callback) {
}
};
let mockBeans = { // see configuration/en-us-retail/beans.js for example
component: {
${funcName}: []
},
bean: {
}
};
let mockAttributes;
let mockState;
beforeEach(() => {
spyOn(mockStore, 'dispatch');
mockAttributes = {};
mockState = {};
component = StageComponent
.withResources('${relDir}/ft-${fileName}')
.inView(\`<ft-${fileName} id="test1"></ft-${fileName}>\`);
component.configure = (aurelia) => {
aurelia.container.registerInstance('Store', mockStore);
aurelia.container.registerInstance('Beans', mockBeans);
aurelia.use.basicConfiguration();
};
});
it('should render something', done => {
component.boundTo(mockAttributes);
component.create(bootstrap)
.then(() => {
if (component.viewModel.mapState) {
component.viewModel.mapState(mockState);
}
})
.then(wait())
.then(() => {
const testElement = document.getElementById('test1');
expect(testElement.innerText.trim()).toBe('ft-${fileName}: replace me');
})
.then(done)
.catch((e) => {
expect(e).toBeNull();
done();
});
});
afterEach(() => {
component.dispose();
});
});
`;
}
/**
* source for top level component html
* @returns {string}
*/
generateComponentHtmlSource(fileName) {
return `<template>
<div>ft-${fileName}: replace me</div>
</template>
`;
}
/**
* source for reducer
* @param funcName, fileName
*/
generateReducerJsSource(funcName, fileName) {
return `/**
* Data Reducer for ${funcName}
* Takes site specific json data and creates model for components
* after applying business and presentation logic and data mapping
*/
import {LogManager} from 'aurelia-framework';
const logger = LogManager.getLogger('${fileName}');
export function ${funcName}(state, action) {
let stateOBJ;
if (action.type === 'CHANGE_ME_TO_PROPER_ACTION_NAME_SUCCESS') {
logger.debug('Reducing: CHANGE_ME_TO_PROPER_ACTION_NAME_SUCCESS');
stateOBJ = Object.assign({}, state, {
${funcName}: action.data
});
} else {
stateOBJ = state;
}
return stateOBJ;
}
`;
}
/**
* source for reducer unit test
* @param funcName
*/
generateReducerTestJsSource(funcName, fileName) {
return `import {${funcName}} from './${fileName}.reducer';
describe('${funcName}', () => {
it('should return unchanged state if action does not apply', () => {
let action = {
type: 'ANOTHER_ACTION'
};
let oldState = {};
let newState = ${funcName}(oldState, action, {});
expect(newState).toBe(oldState);
});
it('should return some stuff', () => {
let action = {
type: 'CHANGE_ME_TO_PROPER_ACTION_NAME_SUCCESS',
data: {
stuff: 'some stuff'
}
};
let newState = ${funcName}({}, action, {});
expect(newState.${funcName}.stuff).toBe('some stuff');
});
});
`;
}
/**
* source for reducer
* @param funcName, fileName
*/
generateAppStateReducerJsSource(funcName, fileName) {
return `/**
* App State Reducer for ${funcName}
* Takes application state data and creates model for components
*/
import {LogManager} from 'aurelia-framework';
const logger = LogManager.getLogger('${fileName}');
export function ${funcName}(state, action) {
switch (action.type) {
case 'SOME_ACTION':
logger.debug('Reducing: SOME_ACTION');
return Object.assign({}, state, {
${funcName}: action.data
});
default:
return state;
}
}
`;
}
/**
* source for reducer unit test
* @param funcName
*/
generateAppStateReducerTestJsSource(funcName, fileName) {
return `import {${funcName}} from './${fileName}.reducer';
describe('${funcName}', () => {
it('should return unchanged state if action does not apply', () => {
let action = {
type: 'ANOTHER_ACTION'
};
let oldState = {};
let newState = ${funcName}(oldState, action, {});
expect(newState).toBe(oldState);
});
it('should return some stuff', () => {
let action = {
type: 'SOME_ACTION',
data: {
stuff: 'some stuff'
}
};
let newState = ${funcName}({}, action, {});
expect(newState.${funcName}.stuff).toBe('some stuff');
});
});
`;
}
/**
* generate markdown stub
* @param fileName
* @returns {string}
*/
generateComponentMdSource(fileName) {
return `# ${ fileName }
## Usage
${'```'}html
<${ fileName} fund-id="817" cid="uniqueId"></${ fileName}>
${'```'}
*The cid is guaranteed to be unique to this page even if multiple instances of the component are added to the same page.*
## Developer notes
`;
}
/**
* generate sass partial stub
* @param fileName
* @returns {string}
*/
// generateComponentSassSource(fileName, name) {
// return `
// // CSS specific to the ${ fileName } component goes here
// [data-fti-component="${ name }"] {
// }
// `;
// }
}

View File

@ -0,0 +1,4 @@
{
"name": "redux-component",
"description": "Creates all the source files, and tests for a redux component."
}

View File

@ -0,0 +1,41 @@
import {inject} from 'aurelia-dependency-injection';
import {Project, ProjectItem, CLIOptions, UI} from 'aurelia-cli';
@inject(Project, CLIOptions, UI)
export default class TaskGenerator {
constructor(project, options, ui) {
this.project = project;
this.options = options;
this.ui = ui;
}
execute() {
return this.ui
.ensureAnswer(this.options.args[0], 'What would you like to call the task?')
.then(name => {
let fileName = this.project.makeFileName(name);
let functionName = this.project.makeFunctionName(name);
this.project.tasks.add(
ProjectItem.text(`${fileName}.js`, this.generateSource(functionName))
);
return this.project.commitChanges()
.then(() => this.ui.log(`Created ${fileName}.`));
});
}
generateSource(functionName) {
return `import gulp from 'gulp';
import changed from 'gulp-changed';
import project from '../aurelia.json';
export default function ${functionName}() {
return gulp.src(project.paths.???)
.pipe(changed(project.paths.output, {extension: '.???'}))
.pipe(gulp.dest(project.paths.output));
}
`;
}
}

View File

@ -0,0 +1,4 @@
{
"name": "task",
"description": "Creates a task and places it in the project tasks folder."
}

View File

@ -0,0 +1,41 @@
import {inject} from 'aurelia-dependency-injection';
import {Project, ProjectItem, CLIOptions, UI} from 'aurelia-cli';
@inject(Project, CLIOptions, UI)
export default class ValueConverterGenerator {
constructor(project, options, ui) {
this.project = project;
this.options = options;
this.ui = ui;
}
execute() {
return this.ui
.ensureAnswer(this.options.args[0], 'What would you like to call the value converter?')
.then(name => {
let fileName = this.project.makeFileName(name);
let className = this.project.makeClassName(name);
this.project.valueConverters.add(
ProjectItem.text(`${fileName}.js`, this.generateSource(className))
);
return this.project.commitChanges()
.then(() => this.ui.log(`Created ${fileName}.`));
});
}
generateSource(className) {
return `export class ${className}ValueConverter {
toView(value) {
}
fromView(value) {
}
}
`;
}
}

View File

@ -0,0 +1,4 @@
{
"name": "value-converter",
"description": "Creates a value converter class and places it in the project resources."
}

View File

@ -0,0 +1,101 @@
import gulp from 'gulp';
import transpile from './transpile';
import processMarkup from './process-markup';
import processAssets from './process-assets';
import lintJS from './lint-js';
import {build, CLIOptions} from 'aurelia-cli';
import project from '../aurelia.json';
import processDocs from './process-docs';
import livesiteJS from './livesite-js';
import cleanAssets from './clean';
import copyJsFilesToPL from './copy-js';
import copyDataToPL from './copy-data';
import concatWpJs from './concat-wp';
export function buildJs(done) {
// TODO : review if --dev still required, since au run --watch now works as expected
if (CLIOptions.hasFlag('dev')) {
return gulp.series(
readProjectConfiguration,
gulp.parallel(
transpile,
livesiteJS,
processMarkup
),
writeBundles,
concatWpJs,
copyJsFilesToPL
)(done);
}
return gulp.series(
readProjectConfiguration,
gulp.parallel(
lintJS,
transpile,
livesiteJS,
processMarkup,
processAssets
),
writeBundles,
concatWpJs,
copyJsFilesToPL
)(done);
}
export function buildDocs(done) {
return gulp.series(
readProjectConfiguration,
processDocs
)(done);
}
export function buildAll(done) {
// TODO : review if --dev still required, since au run --watch now works as expected
if (CLIOptions.hasFlag('js') || CLIOptions.hasFlag('dev')) {
return buildJs(done);
} else if (CLIOptions.hasFlag('docs')) {
return gulp.series(
readProjectConfiguration,
gulp.parallel(
processDocs,
transpile,
processMarkup,
processAssets
),
writeBundles
)(done);
} else if (CLIOptions.hasFlag('data')) {
return gulp.series(
readProjectConfiguration,
copyDataToPL
)(done);
}
return gulp.series(
cleanAssets,
readProjectConfiguration,
gulp.parallel(
processDocs,
lintJS,
transpile,
livesiteJS,
processMarkup,
processAssets
),
writeBundles,
concatWpJs,
copyJsFilesToPL,
copyDataToPL
)(done);
}
export default function buildDefault(done) {
return buildAll(done);
}
function readProjectConfiguration() {
return build.src(project);
}
function writeBundles() {
return build.dest();
}

View File

@ -0,0 +1,31 @@
{
"name": "build",
"description": "Builds and processes all application assets.",
"flags": [
{
"name": "env",
"description": "Sets the build environment.",
"type": "string"
},
{
"name": "js",
"description": "Only build JS assets.",
"type": "string"
},
{
"name": "docs",
"description": "Only build documentation.",
"type": "string"
},
{
"name": "dev",
"description": "Only transpile JS and process markup. Do not use prior to committing.",
"type": "string"
},
{
"name": "rename",
"description": "Rename web-platform-dist to web-platform. Required for some builds.",
"type": "string"
}
]
}

View File

@ -0,0 +1,14 @@
/**
* Created by bstjohn on 01/04/2017.
*/
import gulp from 'gulp';
import debug from 'gulp-debug';
import project from '../aurelia.json';
import clean from 'gulp-clean';
export default function cleanAssets(done) {
let assets = project.assetsProcessor.clean;
return gulp.src(['assets/js/*'], {read: false})
.pipe(debug({title: `cleaning ${assets}`}))
.pipe(clean());
}

View File

@ -0,0 +1,57 @@
import gulp from 'gulp';
import concat from 'gulp-concat';
import sourcemaps from 'gulp-sourcemaps';
import rename from 'gulp-rename';
import { CLIOptions } from 'aurelia-cli';
/**
* Builds LiveSite JS script
* @returns
*/
function concatWpJs() {
let environment = CLIOptions.getEnvironment();
let finaleFile = 'web-platform-dist.js';
let gulpSrc = [
'assets/js/web-platform.js',
'assets/js/web-platform-app.js',
'assets/js/web-platform-etf.js',
'assets/js/web-platform-gw.js'
];
if ( environment === 'dev' ) {
return gulp.src( gulpSrc )
.pipe( sourcemaps.init() )
.pipe( concat( finaleFile ) )
.pipe( sourcemaps.write( '.' ) )
.pipe( gulp.dest( 'assets/js' ) );
}
if ( environment === 'stage' ) {
return gulp.src( gulpSrc )
.pipe( sourcemaps.init() )
.pipe( concat( finaleFile ) )
.pipe( sourcemaps.write( '.' ) )
.pipe( gulp.dest( 'assets/js' ) );
}
if ( environment === 'prod' ) {
return gulp.src( gulpSrc )
.pipe( concat( finaleFile ) )
.pipe( gulp.dest( 'assets/js' ) );
}
}
function renameWpJs() {
let renameJs = false;
if (CLIOptions.hasFlag('rename')) renameJs = true;
let srcFile = 'assets/js/web-platform-dist.js';
let destFile = 'assets/js/web-platform.js';
if ( renameJs === true ) {
return gulp.src(srcFile)
.pipe(rename(destFile))
.pipe(gulp.dest('./'));
}
return gulp.src(srcFile);
}
export default gulp.series(
concatWpJs,
renameWpJs
);

View File

@ -0,0 +1,12 @@
import gulp from 'gulp';
function copyDataToPL() {
let sourceDataFiles = ['test/data/**'];
let destinationData = '../pattern-library/public/data/';
return gulp.src(sourceDataFiles)
.pipe(gulp.dest(destinationData));
}
export default gulp.series(
copyDataToPL
);

View File

@ -0,0 +1,12 @@
import gulp from 'gulp';
function copyJsFilesToPL() {
let sourceJsFiles = [ 'assets/js/*.js', 'assets/js/*.map' ];
let destinationJs = '../pattern-library/public/assets/js/';
return gulp.src(sourceJsFiles)
.pipe(gulp.dest(destinationJs));
}
export default gulp.series(
copyJsFilesToPL
);

View File

@ -0,0 +1,26 @@
// linting configuration in is .eslintrc.json file in project root folder
import gulp from 'gulp';
//import project from '../aurelia.json';
import download from 'gulp-download';
import rename from 'gulp-rename';
import jsonFormat from 'gulp-json-format';
export default function getStubData() {
//let pageUrl = 'https://www.franklintempleton.com/en-us-retail/advisor/';
let pageUrl = 'http://rcovlnx0191:6205/en-us-retail/advisor/';
let fundId = '817';
let beans = [
'us.historical-cumulative-total-returns-labels',
'us.historical-after-tax-average-annual-total-returns-labels'
];
beans.forEach(bean => {
let url = fundId ? `${pageUrl}?FundID=${fundId}&bid=${bean}` : `${pageUrl}?bid=${bean}`;
let path = fundId ? `test/data/${fundId}` : 'test/data';
download(url)
.pipe(jsonFormat(2))
.pipe(rename(`${bean}.json`))
.pipe(gulp.dest(path));
});
}

View File

@ -0,0 +1,14 @@
// linting configuration in is .stylelintrc file in project root folder
import gulp from 'gulp';
import project from '../aurelia.json';
import stylelint from 'gulp-stylelint';
export default function lintCSS() {
return gulp.src(project.cssProcessor.source)
.pipe(stylelint({
reporters: [
{formatter: 'string', console: true}
]
}));
}

View File

@ -0,0 +1,45 @@
import gulp from 'gulp';
import project from '../aurelia.json';
import eslint from 'gulp-eslint';
import {CLIOptions} from 'aurelia-cli';
// linting configuration in is .eslintrc.json file in project root folder
function lintJsSrc() {
if (CLIOptions.hasFlag('watch')) {
return gulp.src(project.jsLinter.source)
.pipe(eslint())
.pipe(eslint.format());
}
return gulp.src(project.jsLinter.source)
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
}
// linting tests is les strict - console.log and
function lintJsTests() {
if (CLIOptions.hasFlag('watch')) {
return gulp.src(project.jsLinter.testSource)
.pipe(eslint({
'rules': {
'no-console': ['warn'],
'no-unused-vars': ['warn'],
'quotes': ['off', 'single']
}
}))
.pipe(eslint.format());
}
return gulp.src(project.jsLinter.testSource)
.pipe(eslint({
'rules': {
'no-console': ['warn'],
'no-unused-vars': ['warn'],
'quotes': ['off', 'single']
}
}))
.pipe(eslint.format())
.pipe(eslint.failAfterError());
}
export default gulp.parallel(lintJsSrc, lintJsTests);

View File

@ -0,0 +1,42 @@
import gulp from 'gulp';
import project from '../aurelia.json';
import lintspaces from 'gulp-lintspaces';
import {CLIOptions} from 'aurelia-cli';
// linting configuration in is .eslintrc.json file in project root folder
export default function lintMarkup() {
if (CLIOptions.hasFlag('dev')) {
return gulp.src(project.markupProcessor.source)
.pipe(lintspaces({
'newline': true,
'newlineMaximum': 2,
'trailingspaces': true,
'indentation': 'spaces',
'spaces': 4,
'ignores': [
'html-comments'
]
}))
.pipe(lintspaces.reporter({
breakOnWarning: false,
prefixLogs: true
}));
}
return gulp.src(project.markupProcessor.source)
.pipe(lintspaces({
'newline': true,
'newlineMaximum': 2,
'trailingspaces': true,
'indentation': 'spaces',
'spaces': 4,
'ignores': [
'html-comments'
]
}))
.pipe(lintspaces.reporter({
breakOnWarning: true,
prefixLogs: true
}));
}

View File

@ -0,0 +1,49 @@
import gulp from 'gulp';
import concat from 'gulp-concat';
import sourcemaps from 'gulp-sourcemaps';
import { CLIOptions } from 'aurelia-cli';
import uglify from 'gulp-uglify';
// import rename from 'gulp-rename';
import project from '../aurelia.json';
import babel from 'gulp-babel';
/**
* Builds LiveSite JS script
* @returns
*/
function buildJavaScriptLS() {
let environment = CLIOptions.getEnvironment();
if ( environment === 'dev' ) {
return gulp.src( project.livesiteJS.source )
.pipe( sourcemaps.init() )
.pipe( babel( project.livesiteJS.options ) )
.pipe( concat( 'livesite-modules.js' ) )
.pipe( sourcemaps.write( '.' ) )
.pipe( gulp.dest( project.livesiteJS.output ) );
} else if ( environment === 'stage' ) {
return gulp.src( project.livesiteJS.source )
.pipe( sourcemaps.init() )
.pipe( babel( project.livesiteJS.options ) )
.pipe( concat( 'livesite-modules.js' ) )
.pipe( uglify() )
// .pipe( rename( {
// suffix: '.min'
// } ) )
.pipe( sourcemaps.write( '.' ) )
.pipe( gulp.dest( project.livesiteJS.output ) );
} else if ( environment === 'prod' ) {
return gulp.src( project.livesiteJS.source )
// .pipe( sourcemaps.init() )
.pipe( babel( project.livesiteJS.options ) )
.pipe( concat( 'livesite-modules.js' ) )
.pipe( uglify() )
// .pipe( rename( {
// suffix: '.min'
// } ) )
.pipe( gulp.dest( project.livesiteJS.output ) );
}
}
export default gulp.series(
buildJavaScriptLS
);

View File

@ -0,0 +1,17 @@
import gulp from 'gulp';
import jest from 'gulp-jest';
import {CLIOptions} from 'aurelia-cli';
export default function monitorFeeds() {
let focusedTest = CLIOptions.getFlagValue('focused-test');
let jestConfig = {
config: require('../../test/jest/jest-integration.json')
};
if (focusedTest) {
focusedTest = focusedTest.replace(/(.spec)?.js/g, '');
jestConfig.config.testRegex = `.*${focusedTest}.*.spec.js$`;
}
return gulp.src('src').pipe(jest({
config: require('../../test/jest/jest-integration.json')
}));
}

View File

@ -0,0 +1,11 @@
{
"name": "monitor-feeds",
"description": "Checks all QA feeds and page then reports the results.",
"flags": [
{
"name": "focused-test",
"description": "Test only the components with xxx in filename, eg --focused-test pricing-distribution.",
"type": "string"
}
]
}

View File

@ -0,0 +1,9 @@
import gulp from 'gulp';
import zip from 'gulp-zip';
import project from '../aurelia.json';
export default function() {
return gulp.src(project.packager.src, {base: '.'})
.pipe(zip(project.packager.zipfile))
.pipe(gulp.dest(project.packager.outputDir));
}

View File

@ -0,0 +1,17 @@
import gulp from 'gulp';
// import changedInPlace from 'gulp-changed-in-place';
import project from '../aurelia.json';
// import {build} from 'aurelia-cli';
import debug from 'gulp-debug';
export default function processAssets(done) {
let subtasks = project.assetsProcessor.assets.map(asset => {
return function() {
return gulp.src(asset.src)
.pipe(debug({title: `copy ${asset.src} >>> ${asset.dest}`}))
.pipe(gulp.dest(asset.dest));
};
});
return gulp.parallel(subtasks)(done);
}

View File

@ -0,0 +1,32 @@
// changed to SASS+autoprefixer using this blog post: http://ilikekillnerds.com/2016/07/adding-postcssautoprefixer-aurelia-cli/
import gulp from 'gulp';
import sourcemaps from 'gulp-sourcemaps';
import project from '../aurelia.json';
import sass from 'gulp-sass';
import postcss from 'gulp-postcss';
import cssnano from 'gulp-cssnano';
import autoprefixer from 'autoprefixer';
import lintCSS from './lint-css';
import rename from 'gulp-rename';
export default function processCSS() {
let processors = [
autoprefixer(project.cssProcessor.browsers)
];
return gulp.src(project.cssProcessor.source)
.pipe(lintCSS())
.pipe(sourcemaps.init())
.pipe(sass({
includePaths: project.cssProcessor.sassIncludePaths
}).on('error', sass.logError))
.pipe(postcss(processors))
.pipe(cssnano())
.pipe(sourcemaps.write('.'))
.pipe(rename(path => {
// this means the generated css files are placed directly in assets/css folder instead of a scss sub-folder
path.dirname = path.dirname.replace('scss', '');
}))
.pipe(gulp.dest(project.cssProcessor.output));
}

View File

@ -0,0 +1,123 @@
import gulp from 'gulp';
import {CLIOptions} from 'aurelia-cli';
import project from '../aurelia.json';
import debug from 'gulp-debug';
import gutil from 'gulp-util';
import through from 'through2';
import File from 'vinyl';
import marked from 'marked';
import hljs from 'highlight.js';
export default function processDocs(done) {
let docSrc;
if (CLIOptions.getEnvironment() !== 'prod') {
docSrc = project.docsProcessor.source;
} else {
docSrc = './';
}
return gulp.src(docSrc)
.pipe(debug({title: 'generate documentation:'}))
.pipe(mdToJson(project.docsProcessor.jsonFile))
.pipe(gulp.dest(project.docsProcessor.outputDir));
}
// set up document index - matches docs to sections based on regex match on their paths
let docs = project.docsProcessor.index;
docs.pages = {};
let regexes = new Map();
function getRegexes(section) {
if (section.regex !== undefined) {
section.pages = [];
regexes.set(new RegExp(section.regex), section.pages);
}
if (section.subs !== undefined) {
section.subs.forEach(getRegexes);
}
}
docs.index.forEach(getRegexes);
let uncategorizedPages = docs.index.find(section => section.section === 'Uncategorized');
uncategorizedPages = uncategorizedPages.pages = [];
// need a bespoke renderer for marked to put the hljs tag on the code element
// might get fixed in subsequent release
let myRenderer = new marked.Renderer();
if (typeof hljs !== 'undefined') {
myRenderer.code = function(code, lang, escaped) {
if (lang && hljs.getLanguage(lang)) {
try {
code = hljs.highlight(lang, code).value;
} catch (e) {
// fail silently
}
}
return '<pre><code'
+ (lang
? ' class="hljs ' + this.options.langPrefix + lang + '"'
: ' class="hljs"')
+ '>'
+ code
+ '\n</code></pre>\n';
};
}
marked.setOptions({
renderer: myRenderer,
highlight: function(code) {
return hljs.highlightAuto(code).value;
},
gfm: true,
tables: true,
breaks: false,
pedantic: false,
sanitize: false,
smartLists: true,
smartypants: false
});
function mdToJson(out) {
return through.obj(function(file, enc, cb) {
if (file.isNull()) {
cb(null, file);
return;
}
if (file.isStream()) {
cb(new gutil.PluginError('mdToJson', 'Streams not supported'));
return;
}
let fileid = file.relative.replace(/\\/g, '/');
docs.pages[fileid] = marked(file.contents.toString('utf8'));
// try and match to correct section
let uncategorized = true;
for (let [regex, pages] of regexes) {
if (regex.test(fileid)) {
if (! pages.some( id => id === fileid)) {
pages.push(fileid);
}
uncategorized = false;
break;
}
}
if (uncategorized) {
if (! uncategorizedPages.some( id => id === fileid)) {
uncategorizedPages.push(fileid);
}
}
cb();
}, function(cb) {
let buffer = new Buffer(JSON.stringify(docs, null, ' '));
let fileListFile = new File({
path: out,
contents: buffer
});
this.push(fileListFile);
cb();
});
}

View File

@ -0,0 +1,20 @@
import gulp from 'gulp';
import htmlmin from 'gulp-htmlmin';
import changedInPlace from 'gulp-changed-in-place';
import project from '../aurelia.json';
import {build} from 'aurelia-cli';
import lintMarkup from './lint-markup';
export default function processMarkup() {
return gulp.src(project.markupProcessor.source)
.pipe(lintMarkup())
.pipe(changedInPlace({firstPass: true}))
.pipe(htmlmin({
removeComments: true,
collapseWhitespace: true,
conservativeCollapse: true,
minifyCSS: true,
minifyJS: true
}))
.pipe(build.bundle());
}

View File

@ -0,0 +1,315 @@
import gutil from 'gulp-util';
import {CLIOptions} from 'aurelia-cli';
import fs from 'fs';
import isEmpty from 'lodash/isEmpty';
import isObjectLike from 'lodash/isObjectLike';
import some from 'lodash/some';
/**
* deep empty check, with fast forking if not empty
* @param {Array|Object} collection The collection to iterate over.
* @return {boolean} Returns true if any element passes the predicate check, else false.
*/
export function isEmptyDeep(collection) {
return !isNotEmptyDeep(collection);
}
/**
* deep not empty check, with fast forking if not empty
* @param {Array|Object} collection The collection to iterate over.
* @return {boolean} Returns true if any element has data, else false.
*/
export function isNotEmptyDeep(collection) {
if (isEmpty(collection)) {
return false;
}
return some(collection, (obj, key) => {
if (key === '__debug') {
return false;
}
if (isObjectLike(obj)) {
return isNotEmptyDeep(obj);
}
return !isEmpty(obj);
});
}
/**
* Example usage
* au proxy-server --static-cache --gzip --remove-tracking --override-aurelia-config configuration/etf/main --dev-js-assets-server http://localhost:9000/ --dev-css-assets-server http://pattern-library.corp.frk.com/
*/
const defaultUrl = CLIOptions.getFlagValue('proxy-target') ? CLIOptions.getFlagValue('proxy-target') : 'https://www.franklintempleton.com/';
// --proxy-target http://rcovlnx0188:8202
export function proxyServer(done) {
gutil.log('starting proxy server on http://localhost:2000 (proxying = ' + defaultUrl + ')');
if (CLIOptions.hasFlag('dev-js-assets-server')) {
gutil.log(' replace js assets with ' + CLIOptions.getFlagValue('dev-js-assets-server'));
}
if (CLIOptions.hasFlag('dev-css-assets-server')) {
gutil.log(' replace css assets with ' + CLIOptions.getFlagValue('dev-css-assets-server'));
}
let useBackupHDDCache = CLIOptions.hasFlag('use-backup-hdd-cache');
if (useBackupHDDCache) {
gutil.log(' using backup hdd cache test/integration/downloaded-data/');
}
let express = require('express');
let proxy = require('express-http-proxy');
let cache = require('express-cache-response');
let compression = require('compression');
let app = express();
if (CLIOptions.hasFlag('static-cache')) {
app.use(cache());
}
if (CLIOptions.hasFlag('gzip')) {
app.use(compression());
}
if (CLIOptions.hasFlag('dev-js-assets-server')) {
let devAssetsServer = CLIOptions.getFlagValue('dev-js-assets-server').replace(/\/$/, '');
app.use('/assets/js/', proxy(devAssetsServer + '/assets/js/', {
changeOrigin: true,
/**
* You can mutate the request options before sending the proxyRequest.
* proxyReqOpt represents the options argument passed to the (http|https).request module.
*
* @param proxyReqOpts
* @param srcReq
* @returns {*}
*/
proxyReqOptDecorator: function(proxyReqOpts, srcReq) {
proxyReqOpts.headers['X-UA-Compatible'] = 'IE=edge,chrome=1';
proxyReqOpts.headers['Cache-Control'] = 'no-cache';
proxyReqOpts.headers['Cache-Control'] = 'no-store';
proxyReqOpts.headers['Cache-Control'] = 'no-transform';
proxyReqOpts.headers['Cache-Control'] = 'only-if-cached';
proxyReqOpts.headers.ETag = 'ruin_the_etag' + Math.random();
return proxyReqOpts;
},
/**
* Provide a proxyReqPathResolver function if you'd like to operate on the path before issuing the proxy request.
* Use a Promise for async operations.
* @param req
*/
proxyReqPathResolver: function(req) {
return '/assets/js' + require('url').parse(req.url).path;
},
/**
* You can modify the proxy's response before sending it to the client.
* @param proxyRes
* @param proxyResData
* @param userReq
* @param userRes
*/
userResDecorator: function(proxyRes, proxyResData, userReq, userRes) {
let isJS = proxyRes.headers['content-type'] ? proxyRes.headers['content-type'].indexOf('text/javascript') !== -1 : false;
isJS = isJS || proxyRes.headers['content-type'] ? proxyRes.headers['content-type'].indexOf('application/javascript') !== -1 : false;
isJS = isJS || userReq.originalUrl.endsWith('.js');
gutil.log(' > proxying dev js (' + userReq.originalUrl + ') from : ' + devAssetsServer + userReq.originalUrl);
proxyRes.headers.etag = 'ruin_the_etag' + Math.random();
proxyResData = proxyResData.toString('utf8');
return proxyResData;
}
}));
}
app.use('/', proxy(defaultUrl, {
changeOrigin: true,
/**
* You can modify the proxy's response before sending it to the client.
* @param proxyRes
* @param proxyResData
* @param userReq
* @param userRes
*/
userResDecorator: function(proxyRes, proxyResData, userReq, userRes) {
let isHtml = proxyRes.headers['content-type'] ? proxyRes.headers['content-type'].indexOf('text/html') !== -1 : false;
let isJS = proxyRes.headers['content-type'] ? proxyRes.headers['content-type'].indexOf('text/javascript') !== -1 : false;
isJS = isJS || proxyRes.headers['content-type'] ? proxyRes.headers['content-type'].indexOf('application/javascript') !== -1 : false;
isJS = isJS || userReq.originalUrl.endsWith('.js');
let isJSON = proxyRes.headers['content-type'] ? proxyRes.headers['content-type'].indexOf('application/json') !== -1 : false;
isJSON = isJSON || userReq.originalUrl.endsWith('.json');
// DELIBRATELY LEFT CODE BLOCK FOR CUSTOM MOCKING OF FEED DELAYS
// if (userReq.originalUrl.endsWith('gw.labels') ||
// userReq.originalUrl.endsWith('etf.fund-labels')) {
// // 500 SERVER ERROR MOCKING
// // throw new Error('what this isnt json');
//
// // 20 second delay MOCKING
// return new Promise(function(resolve) {
// setTimeout(function() {
// resolve('what this isnt json');
// }, 20 * 1000);
// });
//
// // CUSTOM OUTPUT MOCKING
// // return 'what this isnt json';
// }
if (isJSON) {
let obj = JSON.parse(proxyResData);
if (obj) {
obj.__debug = {
injectedByNode: true,
sourceUrl: defaultUrl + userReq.originalUrl,
feedDate: new Date()
};
proxyResData = JSON.stringify(obj, null, 2);
}
}
if (isHtml) {
gutil.log(' > rewriting : ' + userReq.originalUrl);
proxyResData = proxyResData.toString('utf8');
if (CLIOptions.hasFlag('remove-tracking')) {
// remove Google Tag Manager
proxyResData = proxyResData.replace(/<!-- Google Tag Manager -->(.|[\r\n])*<!-- End Google Tag Manager -->/gm, function(replace) {
gutil.log(' >> removing string : ' + replace);
return '';
});
// remove s7
proxyResData = proxyResData.replace(/<script[^>]+src="https:\/\/s7.addthis.com\/.*"[^>]*><\/script>/gm, function(replace) {
gutil.log(' >> removing string : ' + replace);
return '';
});
}
if (CLIOptions.hasFlag('remove-tenant-libs')) {
proxyResData = proxyResData.replace(/<script[^>]+src=".*\/((main-home)|(handlebars.*))\.js"[^>]*><\/script>/gm, function(replace) {
gutil.log(' >> removing string tenant libraries: ' + replace);
return '';
});
}
if (CLIOptions.hasFlag('remove-images')) {
// kill images by redirecting to favicon
proxyResData = proxyResData.replace(/.*\.(jpeg|jpg|png)/gm, function(replace) {
gutil.log(' >> removing image: ' + replace);
return '/web-resources/ui/default/images/favicon.ico';
});
}
if (CLIOptions.hasFlag('dev-css-assets-server')) {
let devAssetsServer = CLIOptions.getFlagValue('dev-css-assets-server');
// redirect to other host
proxyResData = proxyResData.replace(/\/assets\/css\/core(\.min)?\.css/gm, function(replace) {
let cssUrl = devAssetsServer + '/assets/css/core.css';
gutil.log(' >> replacing ' + replace + ' for link to remote pattern-library (' + cssUrl + ')');
return cssUrl;
});
}
if (CLIOptions.getFlagValue('override-aurelia-config')) {
let aureliaApp = CLIOptions.getFlagValue('override-aurelia-config');
proxyResData = proxyResData.replace(/aurelia-app=['"].*['"]/gm, function(replace) {
gutil.log(' >> replacing aurelia app ' + replace + ' for : ' + aureliaApp);
return 'aurelia-app="' + aureliaApp + '"';
});
}
if (CLIOptions.getFlagValue('override-segment')) {
let overrideSegment = CLIOptions.getFlagValue('override-segment');
proxyResData = proxyResData.replace(/ segment=['"][a-zA-Z]*['"] /gm, function(replace) {
gutil.log(' >> replacing app segment ' + replace + ' for : ' + overrideSegment);
return ' overrideSegment="' + overrideSegment + '"';
});
}
// Inject Timing Code
// Use console.timeEnd("from-page-load"); to get time from page load
proxyResData = proxyResData.replace(/<\/head>/gm, function(replace) {
return '<script>console.time("from-page-load");</script></head>';
});
// Inject Debug Source
proxyResData = proxyResData.replace(
'</body',
`<div>injectedByNode: true, sourceUrl: ${defaultUrl + userReq.originalUrl}, feedDate: ${new Date()}</div></body`
);
}
if (isJS) {
proxyResData = proxyResData.toString('utf8');
}
if (useBackupHDDCache &&
(isJS || isHtml || isJSON)) {
let sourceUrl = defaultUrl + userReq.originalUrl;
let dir = 'test/integration/downloaded-data';
let cachedFile = `${dir}/${sourceUrl.replace(/[=?\/:\\]/g, '_')}`;
let isEmptyJSON = (isJSON && isEmptyDeep(JSON.parse(proxyResData)));
if (proxyRes.statusCode < 400 &&
!isEmptyJSON
) {
if (dir && !fs.existsSync(dir)) {
fs.mkdirSync(dir);
}
let writtenData = proxyResData;
fs.writeFileSync(cachedFile, writtenData);
} else {
let failureCode = proxyRes.statusCode;
gutil.log(`Failed getting '${sourceUrl}' : ${failureCode} retrieving from cache '${cachedFile}'`);
proxyRes.statusCode = 200;
userRes.status(200);
if (isJSON) {
// Redirect server errors to cache and get one downloaded earlier
let backupTestJson = require('../../' + cachedFile);
backupTestJson.__DebugFromCache = {
sourceData: {
url: sourceUrl,
code: failureCode
},
cacheData: {
file: cachedFile
}
};
return JSON.stringify(backupTestJson, null, 2);
}
let backupTestFile = fs.readFileSync(cachedFile).toString();
if (isHtml) {
// Inject Debug Source
backupTestFile = backupTestFile.replace(
'</body',
`<div>injectedByNode: true, DebugFromCache:true, sourceUrl: ${defaultUrl + userReq.originalUrl}, code: ${failureCode}, feedDate: ${new Date()}</div></body`
);
}
return backupTestFile;
}
}
return proxyResData;
},
/**
* You can mutate the body content before sending the proxyRequest.
* @param bodyContent
* @param srcReq
* @returns {*}
*/
proxyReqBodyDecorator: function(bodyContent, srcReq) {
return bodyContent;
},
/**
* You can mutate the request options before sending the proxyRequest.
* proxyReqOpt represents the options argument passed to the (http|https).request module.
*
* @param proxyReqOpts
* @param srcReq
* @returns {*}
*/
proxyReqOptDecorator: function(proxyReqOpts, srcReq) {
return proxyReqOpts;
}
}));
app.listen(2000);
}
export default function proxyDefault(done) {
proxyServer(done);
}

View File

@ -0,0 +1,63 @@
{
"name": "proxy-server",
"description": "Proxies main site with dev application assets.",
"flags": [
{
"name": "override-aurelia-config",
"description": "eg configuration/etf/main",
"type": "string"
},
{
"name": "override-segment",
"description": "eg adviser",
"type": "string"
},
{
"name": "proxy-target",
"description": "server to proxy eg http://rcovlnx0188:8202",
"type": "string"
},
{
"name": "dev-js-assets-server",
"description": "Use hosted JS files on another server eg http://localhost:9000",
"type": "string"
},
{
"name": "dev-css-assets-server",
"description": "Use hosted JS files on another server eg http://localhost:9000 (will default to unmin-ed version)",
"type": "string"
},
{
"name": "remove-tracking",
"description": "Remove all google and misc tracking code",
"type": "boolean"
},
{
"name": "remove-images",
"description": "Remove all images, replace them with 1 pixel equivilients",
"type": "boolean"
},
{
"name": "remove-tenant-libs",
"description": "Remove tenant libs",
"type": "boolean"
},
{
"name": "gzip",
"description": "gzip asset",
"type": "boolean"
},
{
"name": "static-cache",
"description": "cache asset, dumb cache never expires",
"type": "boolean"
},
{
"name": "use-backup-hdd-cache",
"description": "cache assets on hdd 'test/integration/downloaded-data/', will write to cache on read, read from cache on error",
"type": "boolean"
}
]
}

View File

@ -0,0 +1,233 @@
import gulp from 'gulp';
import gutil from 'gulp-util';
import browserSync from 'browser-sync';
import historyApiFallback from 'connect-history-api-fallback/lib';
import project from '../aurelia.json';
import {buildAll, buildJs, buildDocs} from './build';
import {CLIOptions} from 'aurelia-cli';
import request from 'request';
function onChange(path) {
gutil.log(`File Changed: ${path}`);
}
function reload(done) {
browserSync.reload();
done();
}
let serve = gulp.series(
buildAll,
done => {
browserSync({
online: false,
open: false,
port: 9000,
logLevel: 'info',
server: {
baseDir: ['.'],
middleware: [
relaxAllowOrigin,
proxyLocalPages,
proxyFixtures,
historyApiFallback()
]
}
}, function(err, bs) {
let urls = bs.options.get('urls').toJS();
gutil.log(`Application Available At: ${urls.local}`);
gutil.log(`BrowserSync Available At: ${urls.ui}`);
done();
});
}
);
let relaxAllowOrigin = function(req, res, next) {
res.setHeader('Access-Control-Allow-Origin', '*');
next();
};
let proxyFixtures = function(req, res, next) {
// rest api rewrites
let isLocalMode = !CLIOptions.hasFlag('use-test-server');
if (isLocalMode) {
proxyLocalFixtures(req, res, next);
} else {
proxyRemoteFixtures(req, res, next);
}
};
// TODO: not sure if this is needed. segment should be defined by tag on page eg:
// <div id="site-config" aurelia-app="configuration/gw/main" segment="investor" site="en-gb" locale="en-gb" long-date="dd MMMM yyyy" short-date="dd.MM.yyyy"></div>
/**
* allow us to test injected actor
* eg investor in /etf-gb/investor/products/price-and-distribution?FundID=21559
* @param req
* @param res
* @param next
*/
let proxyLocalPages = function(req, res, next) {
let matches = req.url.match(/^\/([^/]+)\/([^/]+)\/products\/([^?]*)/);
if (matches !== null) {
let fixturePage = `/test/pages/${matches[1]}/${matches[3]}.html`;
gutil.log(`${req.url} -> ${fixturePage}`);
req.url = fixturePage;
}
next();
};
/**
* proxies data feed into server
* eg
* http://localhost:9000/etf-gb/investor/data/21412/etf.fund-details
* proxied to
* http://rcovlnx0192:8322/etf-gb/investor/data/21412/etf.fund-details
*
* @param req
* @param res
* @param next
*/
let proxyRemoteFixtures = function(req, res, next) {
let testFundId = CLIOptions.getFlagValue('test-server-fund-id') || '21412';
let testServer = CLIOptions.getFlagValue('test-server') || 'http://rcovlnx0192:8322';
let testSite = CLIOptions.getFlagValue('test-site') || false;
let proxyUrl;
let matches = req.url.match(/^\/([^/]+)\/([^/]+)\/data\/([^/]+)\/(\d+)\/(.*)/);
if (matches !== null) {
// gutil.log(`site=${matches[1]}, segment=${matches[2]}, dslConf=${matches[3]}, fundId=${matches[4]}, beanId=${matches[5]}`);
let site = testSite ? testSite : matches[1];
proxyUrl = `${testServer}/${site}/${matches[2]}/data/${matches[3]}/${testFundId}/${matches[5]}`;
} else {
matches = req.url.match(/^\/([^/]+)\/([^/]+)\/data\/([^/]+)\/(.*)/);
if (matches !== null) {
// gutil.log(`site=${matches[1]}, segment=${matches[2]}, dslConf=${matches[3]}, beanId=${matches[4]}`);
let site = testSite ? testSite : matches[1];
proxyUrl = `${testServer}/${site}/${matches[2]}/data/${matches[3]}/${matches[4]}`;
}
}
if (proxyUrl) {
// any small bean changes add here
// eg
// proxyUrl = proxyUrl.replace('etf.fund-details', 'etf.fund-details');
// proxyUrl = proxyUrl.replace('etf.distribution-history', 'etf.distribution-history');
gutil.log(`${req.url} -> ${proxyUrl}`);
request.get(
proxyUrl, {},
function(error, response, contents) {
// gutil.log(error, response, body);
if (!error && response.statusCode === 200) {
try {
if (!contents.match(/^( |[\r\n])*$/)) {
let json = JSON.parse(contents);
json.__debug = {
injectedByNode: true,
sourceUrl: proxyUrl
};
contents = JSON.stringify(json, null, 2);
}
} catch (e) {
gutil.log(e);
}
res.end(contents);
} else {
gutil.log(error);
}
next();
}
);
} else {
gutil.log(req.url);
next();
}
};
/**
* @param req
* @param res
* @param next
*/
let proxyLocalFixtures = function(req, res, next) {
// /en-gb/investor/data/gw/4264/gw.price-history?ShareClass=I&toDate=2017-09-26&fromDate=2001-01-01
let matches = req.url.match(/^\/([^/]+)\/([^/]+)\/data\/[^/]+\/(\d+)\/([^?]*)\??(.*)/); // regex updated to ignore query params ie: '?' and anything after
if (matches !== null) {
// TODO: quick and messy way to get ShareClass param into data url as sub-folder
// clean this up later
let fixtureFile;
let ShareClass;
let params = {};
let hash;
gutil.log(`Query params -> ${matches[5]}`);
// quick hack reusing code from lib
if (matches[5]) {
let hashes = matches[5].split('&');
for (let i = 0; i < hashes.length; i++) {
if (!hashes[i]) {
continue;
}
hash = hashes[i].split('=');
params[decodeURIComponent(hash[0]).replace(/\+/g, ' ')] = decodeURIComponent(hash[1]).replace(/\+/g, ' ');
}
ShareClass = params.ShareClass;
}
if (ShareClass) {
fixtureFile = `/test/data/${matches[1]}/${matches[3]}/${ShareClass}/${matches[4]}.json`;
} else {
// gutil.log(`site=${matches[1]}, segment=${matches[2]}, fundId=${matches[3]}, beanId=${matches[4]}`);
fixtureFile = `/test/data/${matches[1]}/${matches[3]}/${matches[4]}.json`;
}
gutil.log(`${req.url} -> ${fixtureFile}`);
req.url = fixtureFile;
} else {
matches = req.url.match(/^\/([^/]+)\/([^/]+)\/data\/[^/]+\/(.*)/);
if (matches !== null) {
// gutil.log(`site=${matches[1]}, segment=${matches[2]}, beanId=${matches[3]}`);
let fixtureFile = `/test/data/${matches[1]}/${matches[3]}.json`;
gutil.log(`${req.url} -> ${fixtureFile}`);
req.url = fixtureFile;
} else {
gutil.log(req.url);
}
}
next();
};
let refresh = gulp.series(
buildAll,
reload
);
let refreshJs = gulp.series(
buildJs,
reload
);
let refreshDocs = gulp.series(
buildDocs,
reload
);
let watch = function() {
// aurelia bundles
gulp.watch(project.transpiler.source, refreshJs).on('change', onChange);
gulp.watch(project.markupProcessor.source, refreshJs).on('change', onChange);
// markdown pages
gulp.watch(project.docsProcessor.source, refreshDocs).on('change', onChange);
gulp.watch(project.cssProcessor.source, refresh).on('change', onChange);
};
let run;
if (CLIOptions.hasFlag('watch')) {
run = gulp.series(
serve,
watch
);
} else {
run = serve;
}
export default run;

View File

@ -0,0 +1,36 @@
{
"name": "run",
"description": "Builds the application and serves up the assets via a local web server, watching files for changes as you work.",
"flags": [
{
"name": "env",
"description": "Sets the build environment.",
"type": "string"
},
{
"name": "watch",
"description": "Watches source files for changes and refreshes the app automatically.",
"type": "boolean"
},
{
"name": "use-test-server",
"description": "Get Data from test server, default fund id 21412, default server http://rcovlnx0192:8322.",
"type": "boolean"
},
{
"name": "test-server",
"description": "Set Data from test server, requires --use-test-server.",
"type": "string"
},
{
"name": "test-server-fund-id",
"description": "Set Test Server to use, requires --use-test-server.",
"type": "string"
},
{
"name": "test-site",
"description": "Set Test Site to use eg etf-en or etf-us, requires --use-test-server.",
"type": "string"
}
]
}

View File

@ -0,0 +1,41 @@
import gulp from 'gulp';
import project from '../aurelia.json';
import sonar from 'gulp-sonar';
export default function sonarTest( done ) {
let version = '0.1.0';
let projectKey = 'sonar:' + project.name + ':' + version;
let options = {
sonar: {
host: {
url: project.sonar.sonarURL
},
jdbc: {
url: project.sonar.sonarDB,
username: project.sonar.sonarUser,
password: project.sonar.sonarPasswd
},
projectKey: projectKey,
projectName: project.name,
projectVersion: version,
// comma-delimited string of source directories
sources: project.sonar.sources,
exclusions: project.sonar.exclusions,
language: 'js',
sourceEncoding: 'UTF-8',
javascript: {
lcov: {
reportPath: project.sonar.reportPath
}
},
exec: {
// All these properties will be send to the child_process.exec method (see: https://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback )
// Increase the amount of data allowed on stdout or stderr (if this value is exceeded then the child process is killed, and the gulp-sonar will fail).
maxBuffer: 1024 * 1024
}
}
};
// gulp source doesn't matter, all files are referenced in options object above
return gulp.src( 'src/**/*.js', { read: false } )
.pipe( sonar( options ) );
}

View File

@ -0,0 +1,87 @@
import gulp from 'gulp';
import gutil from 'gulp-util';
import jest from 'gulp-jest';
import {Server as Karma} from 'karma';
import {CLIOptions} from 'aurelia-cli';
function testUIInKarma(done) {
let karamConfig = {
configFile: __dirname + '/../../karma.conf.js'
};
if (CLIOptions.hasFlag('watch')) {
karamConfig.singleRun = false;
karamConfig.specReporter = {
showSpecTiming: true,
suppressSkipped: true,
suppressErrorSummary: false
};
}
let focusedTest = CLIOptions.getFlagValue('focused-test');
if (focusedTest) {
focusedTest = focusedTest.replace(/(.spec)?.js/g, '');
// use args to pass information to aurelia-karma
karamConfig.client = {
captureConsole: true,
args: ['focused-test', focusedTest]
};
// use turn on debugging
karamConfig.browserConsoleLogOptions = {
level: 'debug',
format: '%b %T: %m',
terminal: true
};
}
let browser = CLIOptions.getFlagValue('browser');
if (browser) {
karamConfig.browsers = [browser];
}
new Karma(karamConfig, done).start();
}
function testUIInJest() {
gutil.log('UI Tests do not in JEST: Due to JSDOM incompatibility with StageComponent');
gutil.log('UI Tests do not in JEST: Currently Expected to fail solved by COREWEB-1242');
let focusedTest = CLIOptions.getFlagValue('focused-test');
let jestConfig = {
config: require('../../test/jest/jest-ui.json')
};
if (focusedTest) {
focusedTest = focusedTest.replace(/(.spec)?.js/g, '');
jestConfig.config.testRegex = `(?!util|lib|value-converters|configuration)[\\\/\\\\].*${focusedTest}.*.spec.js$`;
}
return gulp.src('src').pipe(jest(jestConfig));
}
function testBusinessLogic() {
let focusedTest = CLIOptions.getFlagValue('focused-test');
let jestConfig = {
config: require('../../test/jest/jest-bl.json')
};
if (focusedTest) {
focusedTest = focusedTest.replace(/(.spec)?.js/g, '');
jestConfig.config.testRegex = `(util|lib|value-converters|configuration).*${focusedTest}.*.spec.js$`;
}
gutil.log('UI Tests do not in JEST: Due to JSDOM incompatibility with StageComponent');
return gulp.src('src').pipe(jest({
config: require('../../test/jest/jest-bl.json')
}));
}
export default function test(done) {
if (CLIOptions.hasFlag('bl')) {
return testBusinessLogic();
} else if (CLIOptions.hasFlag('ui-dual-run')) {
return gulp.series(
testUIInJest,
testUIInKarma
)(done);
} else if (CLIOptions.hasFlag('ui') || CLIOptions.hasFlag('ui-karma')) {
return testUIInKarma(done);
} else if (CLIOptions.hasFlag('ui-jest')) {
return testUIInJest();
}
return gulp.series(
testBusinessLogic,
testUIInKarma
)();
}

View File

@ -0,0 +1,46 @@
{
"name": "test",
"description": "Runs all unit tests and reports the results.",
"flags": [
{
"name": "env",
"description": "Sets the build environment.",
"type": "string"
},
{
"name": "watch",
"description": "Watches test files for changes and re-runs the tests automatically.",
"type": "boolean"
},
{
"name": "bl",
"description": "Test only the Business Logic (non-UI e.g. reducers) code via Jest.",
"type": "boolean"
},
{
"name": "ui",
"description": "Test only the UI components via Karma.",
"type": "boolean"
},
{
"name": "ui-karma",
"description": "Alias of --ui",
"type": "boolean"
},
{
"name": "ui-jest",
"description": "Test only the UI components via Jest.",
"type": "boolean"
},
{
"name": "focused-test",
"description": "Test only the components with xxx in filename, eg --focused-test pricing-distribution.",
"type": "string"
},
{
"name": "browser",
"description": "Test UI tests in specific browser (default Chrome), eg --browser Firefox",
"type": "string"
}
]
}

View File

@ -0,0 +1,40 @@
import gulp from 'gulp';
import replace from 'gulp-replace';
import changedInPlace from 'gulp-changed-in-place';
import plumber from 'gulp-plumber';
import babel from 'gulp-babel';
import sourcemaps from 'gulp-sourcemaps';
import notify from 'gulp-notify';
import rename from 'gulp-rename';
import moment from 'moment';
import project from '../aurelia.json';
import {CLIOptions, build} from 'aurelia-cli';
function configureEnvironment() {
let env = CLIOptions.getEnvironment();
let timezone = moment().toString().match(/[A-Za-z0-9+-]+$/)[0];
let bambooBuildNumber = process.env.bamboo_buildNumber ? (process.env.bamboo_planKey + '-' + process.env.bamboo_buildNumber) : 'local';
let versionString = 'build: ' + bambooBuildNumber + ', ver: ' + require('../../package.json').version + ', bt: ' + moment().format('YYYY/MM/DD HH:mm ') + timezone;
return gulp.src(`aurelia_project/environments/${env}.js`)
.pipe(changedInPlace({firstPass: true}))
.pipe(rename('environment.js'))
.pipe(replace('<INJECTED_PROJECT_VERSION/>', versionString))
.pipe(gulp.dest(project.paths.root));
}
function buildJavaScript() {
// TODO: should lintJS run here instead of in the build task?
return gulp.src(project.transpiler.source)
// .pipe(debug({title: 'start transpile:'}))
.pipe(plumber({errorHandler: notify.onError('Error: <%= error.message %>')}))
.pipe(changedInPlace({firstPass: true}))
.pipe(sourcemaps.init())
.pipe(babel(project.transpiler.options))
.pipe(build.bundle());
}
export default gulp.series(
configureEnvironment,
buildJavaScript
);

212
coverage/base.css Normal file
View File

@ -0,0 +1,212 @@
body, html {
margin:0; padding: 0;
height: 100%;
}
body {
font-family: Helvetica Neue, Helvetica, Arial;
font-size: 14px;
color:#333;
}
.small { font-size: 12px; }
*, *:after, *:before {
-webkit-box-sizing:border-box;
-moz-box-sizing:border-box;
box-sizing:border-box;
}
h1 { font-size: 20px; margin: 0;}
h2 { font-size: 14px; }
pre {
font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace;
margin: 0;
padding: 0;
-moz-tab-size: 2;
-o-tab-size: 2;
tab-size: 2;
}
a { color:#0074D9; text-decoration:none; }
a:hover { text-decoration:underline; }
.strong { font-weight: bold; }
.space-top1 { padding: 10px 0 0 0; }
.pad2y { padding: 20px 0; }
.pad1y { padding: 10px 0; }
.pad2x { padding: 0 20px; }
.pad2 { padding: 20px; }
.pad1 { padding: 10px; }
.space-left2 { padding-left:55px; }
.space-right2 { padding-right:20px; }
.center { text-align:center; }
.clearfix { display:block; }
.clearfix:after {
content:'';
display:block;
height:0;
clear:both;
visibility:hidden;
}
.fl { float: left; }
@media only screen and (max-width:640px) {
.col3 { width:100%; max-width:100%; }
.hide-mobile { display:none!important; }
}
.quiet {
color: #7f7f7f;
color: rgba(0,0,0,0.5);
}
.quiet a { opacity: 0.7; }
.fraction {
font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;
font-size: 10px;
color: #555;
background: #E8E8E8;
padding: 4px 5px;
border-radius: 3px;
vertical-align: middle;
}
div.path a:link, div.path a:visited { color: #333; }
table.coverage {
border-collapse: collapse;
margin: 10px 0 0 0;
padding: 0;
}
table.coverage td {
margin: 0;
padding: 0;
vertical-align: top;
}
table.coverage td.line-count {
text-align: right;
padding: 0 5px 0 20px;
}
table.coverage td.line-coverage {
text-align: right;
padding-right: 10px;
min-width:20px;
}
table.coverage td span.cline-any {
display: inline-block;
padding: 0 5px;
width: 100%;
}
.missing-if-branch {
display: inline-block;
margin-right: 5px;
border-radius: 3px;
position: relative;
padding: 0 4px;
background: #333;
color: yellow;
}
.skip-if-branch {
display: none;
margin-right: 10px;
position: relative;
padding: 0 4px;
background: #ccc;
color: white;
}
.missing-if-branch .typ, .skip-if-branch .typ {
color: inherit !important;
}
.coverage-summary {
border-collapse: collapse;
width: 100%;
}
.coverage-summary tr { border-bottom: 1px solid #bbb; }
.keyline-all { border: 1px solid #ddd; }
.coverage-summary td, .coverage-summary th { padding: 10px; }
.coverage-summary tbody { border: 1px solid #bbb; }
.coverage-summary td { border-right: 1px solid #bbb; }
.coverage-summary td:last-child { border-right: none; }
.coverage-summary th {
text-align: left;
font-weight: normal;
white-space: nowrap;
}
.coverage-summary th.file { border-right: none !important; }
.coverage-summary th.pct { }
.coverage-summary th.pic,
.coverage-summary th.abs,
.coverage-summary td.pct,
.coverage-summary td.abs { text-align: right; }
.coverage-summary td.file { white-space: nowrap; }
.coverage-summary td.pic { min-width: 120px !important; }
.coverage-summary tfoot td { }
.coverage-summary .sorter {
height: 10px;
width: 7px;
display: inline-block;
margin-left: 0.5em;
background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent;
}
.coverage-summary .sorted .sorter {
background-position: 0 -20px;
}
.coverage-summary .sorted-desc .sorter {
background-position: 0 -10px;
}
.status-line { height: 10px; }
/* dark red */
.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 }
.low .chart { border:1px solid #C21F39 }
/* medium red */
.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE }
/* light red */
.low, .cline-no { background:#FCE1E5 }
/* light green */
.high, .cline-yes { background:rgb(230,245,208) }
/* medium green */
.cstat-yes { background:rgb(161,215,106) }
/* dark green */
.status-line.high, .high .cover-fill { background:rgb(77,146,33) }
.high .chart { border:1px solid rgb(77,146,33) }
.medium .chart { border:1px solid #666; }
.medium .cover-fill { background: #666; }
.cbranch-no { background: yellow !important; color: #111; }
.cstat-skip { background: #ddd; color: #111; }
.fstat-skip { background: #ddd; color: #111 !important; }
.cbranch-skip { background: #ddd !important; color: #111; }
span.cline-neutral { background: #eaeaea; }
.medium { background: #eaeaea; }
.cover-fill, .cover-empty {
display:inline-block;
height: 12px;
}
.chart {
line-height: 0;
}
.cover-empty {
background: white;
}
.cover-full {
border-right: none !important;
}
pre.prettyprint {
border: none !important;
padding: 0 !important;
margin: 0 !important;
}
.com { color: #999 !important; }
.ignore-none { color: #999; font-weight: normal; }
.wrapper {
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -48px;
}
.footer, .push {
height: 48px;
}

6464
coverage/clover.xml Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,213 @@
body, html {
margin:0; padding: 0;
height: 100%;
}
body {
font-family: Helvetica Neue, Helvetica, Arial;
font-size: 14px;
color:#333;
}
.small { font-size: 12px; }
*, *:after, *:before {
-webkit-box-sizing:border-box;
-moz-box-sizing:border-box;
box-sizing:border-box;
}
h1 { font-size: 20px; margin: 0;}
h2 { font-size: 14px; }
pre {
font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace;
margin: 0;
padding: 0;
-moz-tab-size: 2;
-o-tab-size: 2;
tab-size: 2;
}
a { color:#0074D9; text-decoration:none; }
a:hover { text-decoration:underline; }
.strong { font-weight: bold; }
.space-top1 { padding: 10px 0 0 0; }
.pad2y { padding: 20px 0; }
.pad1y { padding: 10px 0; }
.pad2x { padding: 0 20px; }
.pad2 { padding: 20px; }
.pad1 { padding: 10px; }
.space-left2 { padding-left:55px; }
.space-right2 { padding-right:20px; }
.center { text-align:center; }
.clearfix { display:block; }
.clearfix:after {
content:'';
display:block;
height:0;
clear:both;
visibility:hidden;
}
.fl { float: left; }
@media only screen and (max-width:640px) {
.col3 { width:100%; max-width:100%; }
.hide-mobile { display:none!important; }
}
.quiet {
color: #7f7f7f;
color: rgba(0,0,0,0.5);
}
.quiet a { opacity: 0.7; }
.fraction {
font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;
font-size: 10px;
color: #555;
background: #E8E8E8;
padding: 4px 5px;
border-radius: 3px;
vertical-align: middle;
}
div.path a:link, div.path a:visited { color: #333; }
table.coverage {
border-collapse: collapse;
margin: 10px 0 0 0;
padding: 0;
}
table.coverage td {
margin: 0;
padding: 0;
vertical-align: top;
}
table.coverage td.line-count {
text-align: right;
padding: 0 5px 0 20px;
}
table.coverage td.line-coverage {
text-align: right;
padding-right: 10px;
min-width:20px;
}
table.coverage td span.cline-any {
display: inline-block;
padding: 0 5px;
width: 100%;
}
.missing-if-branch {
display: inline-block;
margin-right: 5px;
border-radius: 3px;
position: relative;
padding: 0 4px;
background: #333;
color: yellow;
}
.skip-if-branch {
display: none;
margin-right: 10px;
position: relative;
padding: 0 4px;
background: #ccc;
color: white;
}
.missing-if-branch .typ, .skip-if-branch .typ {
color: inherit !important;
}
.coverage-summary {
border-collapse: collapse;
width: 100%;
}
.coverage-summary tr { border-bottom: 1px solid #bbb; }
.keyline-all { border: 1px solid #ddd; }
.coverage-summary td, .coverage-summary th { padding: 10px; }
.coverage-summary tbody { border: 1px solid #bbb; }
.coverage-summary td { border-right: 1px solid #bbb; }
.coverage-summary td:last-child { border-right: none; }
.coverage-summary th {
text-align: left;
font-weight: normal;
white-space: nowrap;
}
.coverage-summary th.file { border-right: none !important; }
.coverage-summary th.pct { }
.coverage-summary th.pic,
.coverage-summary th.abs,
.coverage-summary td.pct,
.coverage-summary td.abs { text-align: right; }
.coverage-summary td.file { white-space: nowrap; }
.coverage-summary td.pic { min-width: 120px !important; }
.coverage-summary tfoot td { }
.coverage-summary .sorter {
height: 10px;
width: 7px;
display: inline-block;
margin-left: 0.5em;
background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent;
}
.coverage-summary .sorted .sorter {
background-position: 0 -20px;
}
.coverage-summary .sorted-desc .sorter {
background-position: 0 -10px;
}
.status-line { height: 10px; }
/* dark red */
.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 }
.low .chart { border:1px solid #C21F39 }
/* medium red */
.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE }
/* light red */
.low, .cline-no { background:#FCE1E5 }
/* light green */
.high, .cline-yes { background:rgb(230,245,208) }
/* medium green */
.cstat-yes { background:rgb(161,215,106) }
/* dark green */
.status-line.high, .high .cover-fill { background:rgb(77,146,33) }
.high .chart { border:1px solid rgb(77,146,33) }
/* dark yellow (gold) */
.medium .chart { border:1px solid #f9cd0b; }
.status-line.medium, .medium .cover-fill { background: #f9cd0b; }
/* light yellow */
.medium { background: #fff4c2; }
/* light gray */
span.cline-neutral { background: #eaeaea; }
.cbranch-no { background: yellow !important; color: #111; }
.cstat-skip { background: #ddd; color: #111; }
.fstat-skip { background: #ddd; color: #111 !important; }
.cbranch-skip { background: #ddd !important; color: #111; }
.cover-fill, .cover-empty {
display:inline-block;
height: 12px;
}
.chart {
line-height: 0;
}
.cover-empty {
background: white;
}
.cover-full {
border-right: none !important;
}
pre.prettyprint {
border: none !important;
padding: 0 !important;
margin: 0 !important;
}
.com { color: #999 !important; }
.ignore-none { color: #999; font-weight: normal; }
.wrapper {
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -48px;
}
.footer, .push {
height: 48px;
}

View File

@ -0,0 +1,107 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for components/common/value-converters/ft-json.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="..\..\..\prettify.css" />
<link rel="stylesheet" href="..\..\..\base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(..\..\..\sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
<a href="..\..\..\index.html">All files</a> / <a href="index.html">components/common/value-converters</a> ft-json.js
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>1/1</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Branches</span>
<span class='fraction'>2/2</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>1/1</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>1/1</span>
</div>
</div>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15</td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">&nbsp;
/**
* Takes a Object, and returns it as string JSON
* &lt;p&gt;${ myVal | ftJson }&lt;/p&gt;
*
* do:
*
* &lt;p innerHTML.bind="myVal | ftJson"&gt;&lt;/p&gt;
*/
export class FtJsonValueConverter {
toView(value) {
return value ? JSON.stringify(value, null, 2) : '';
}
}
&nbsp;</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Thu Sep 28 2017 09:48:32 GMT+0100 (GMT Daylight Time)
</div>
</div>
<script src="..\..\..\prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="..\..\..\sorter.js"></script>
</body>
</html>

View File

@ -0,0 +1,93 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for components/common/value-converters</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="..\..\..\prettify.css" />
<link rel="stylesheet" href="..\..\..\base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(..\..\..\sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
<a href="..\..\..\index.html">All files</a> components/common/value-converters
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>1/1</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Branches</span>
<span class='fraction'>2/2</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>1/1</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>1/1</span>
</div>
</div>
</div>
<div class='status-line high'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file high" data-value="ft-json.js"><a href="ft-json.js.html">ft-json.js</a></td>
<td data-value="100" class="pic high"><div class="chart"><div class="cover-fill cover-full" style="width: 100%;"></div><div class="cover-empty" style="width:0%;"></div></div></td>
<td data-value="100" class="pct high">100%</td>
<td data-value="1" class="abs high">1/1</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="2" class="abs high">2/2</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="1" class="abs high">1/1</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="1" class="abs high">1/1</td>
</tr>
</tbody>
</table>
</div><div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Thu Sep 28 2017 09:48:32 GMT+0100 (GMT Daylight Time)
</div>
</div>
<script src="..\..\..\prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="..\..\..\sorter.js"></script>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,272 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for components/marketing/common/value-converters/ft-format-grid-cell.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="..\..\..\..\prettify.css" />
<link rel="stylesheet" href="..\..\..\..\base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(..\..\..\..\sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
<a href="..\..\..\..\index.html">All files</a> / <a href="index.html">components/marketing/common/value-converters</a> ft-format-grid-cell.js
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">53.85% </span>
<span class="quiet">Statements</span>
<span class='fraction'>14/26</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">51.61% </span>
<span class="quiet">Branches</span>
<span class='fraction'>16/31</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">66.67% </span>
<span class="quiet">Functions</span>
<span class='fraction'>2/3</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">47.83% </span>
<span class="quiet">Lines</span>
<span class='fraction'>11/23</span>
</div>
</div>
</div>
<div class='status-line medium'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70</td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">&nbsp;
/**
* TODO: Return value ....
*
* For use without date formatting
* &lt;p innerhtml.bind="myVal | ftFormatGridCell:myKey"&gt;&lt;/p&gt;
*
* For use with date formatting
* In this case we are looking at the date string values provided and converting
* the existing date to the date format specified by the site config
* mydateformat - either long or short (string constant literal) 'L' or 'S' long or short provided by site config
* &lt;p innerhtml.bind="myVal | ftFormatGridCell:myKey:mydateformat"&gt;&lt;/p&gt;
*/
import {inject} from 'aurelia-framework';
import get from 'lodash/get';
import DateFormatter from '../../../../lib/date-formatter';
&nbsp;
@inject(DateFormatter)
export class FtFormatGridCellValueConverter {
constructor(df) {
this.dateFormatter = df;
}
&nbsp;
toView(data, dataKey, dateformat) {
let val = get(data, dataKey);
&nbsp;
// look for url attribute - this indicates a link
let urlKey = dataKey.endsWith('.value') ? dataKey.replace(/\.value$/i, '.url') : '';
let url = get(data, urlKey);
//Format to either long or short date if additional filter is set
<span class="missing-if-branch" title="if path not taken" >I</span>if (dataKey === 'publishedDate' &amp;&amp; <span class="branch-1 cbranch-no" title="branch not covered" >dateformat)</span> {
<span class="cstat-no" title="statement not covered" > val = this.dateFormatter.convertDateFormat(val, dateformat);</span>
}
&nbsp;
//Translations, mapped here so we dont mess with filtering...
<span class="missing-if-branch" title="if path not taken" >I</span>if (data &amp;&amp; data.contentTypeLabels &amp;&amp; <span class="branch-2 cbranch-no" title="branch not covered" >data.contentTypeLabels.indexOf(']') === -1)</span> {
<span class="cstat-no" title="statement not covered" > if (val) {</span>
let originalval = <span class="cstat-no" title="statement not covered" >val.replace('-', ' ').toLowerCase();</span>
let contentlabelval = <span class="cstat-no" title="statement not covered" >data.contentTypeLabels.toLowerCase();</span>
<span class="cstat-no" title="statement not covered" > if (originalval === contentlabelval) {</span>
<span class="cstat-no" title="statement not covered" > val = data.contentTypeLabels;</span>
}
}
}
&nbsp;
<span class="missing-if-branch" title="if path not taken" >I</span>if (data &amp;&amp; data.contentCategoriesLabel) {
<span class="cstat-no" title="statement not covered" > if (val) {</span>
let cats = <span class="cstat-no" title="statement not covered" >val.split('|');</span>
<span class="cstat-no" title="statement not covered" > cats.forEach(<span class="fstat-no" title="function not covered" >fu</span>nction(cat, i) {</span>
<span class="cstat-no" title="statement not covered" > if (cat) {</span>
//If either of the cats matches the multiple category string has already been built by the reducer
<span class="cstat-no" title="statement not covered" > if (cat === data.contentCategoriesKey) {</span>
<span class="cstat-no" title="statement not covered" > val = data.contentCategoriesLabel;</span>
}
}
}, this);
}
}
&nbsp;
// look for | (pipes). this indicates multiple values, so split with &lt;br /&gt; tags
if (typeof val === 'string') val = val.replace(/\|/gi, '&lt;br /&gt;');
&nbsp;
// if no value, just display a em-dash
if (!val) val = '&amp;#8212;';
if (url) val = `&lt;a href="${url}"&gt;${val}&lt;/a&gt;`; // if url, render as a link
&nbsp;
return val;
}
}
&nbsp;</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Thu Sep 28 2017 09:48:32 GMT+0100 (GMT Daylight Time)
</div>
</div>
<script src="..\..\..\..\prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="..\..\..\..\sorter.js"></script>
</body>
</html>

View File

@ -0,0 +1,122 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for components/marketing/common/value-converters/ft-format-subscription-input-names.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="..\..\..\..\prettify.css" />
<link rel="stylesheet" href="..\..\..\..\base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(..\..\..\..\sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
<a href="..\..\..\..\index.html">All files</a> / <a href="index.html">components/marketing/common/value-converters</a> ft-format-subscription-input-names.js
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>2/2</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Branches</span>
<span class='fraction'>0/0</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>1/1</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>2/2</span>
</div>
</div>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20</td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">&nbsp;
/**
*
* For use with subscriptions chooser, specific rules applied for GuideText , OptionText arrays are mapped
* on the dynamicaly built form built by parsing of formData json
* These input fields require unique names that are based on their teamsite component labels along with a unique
* identifier and stripping out the space chars as input naming conventions shouldnt contain spaces.
* Rules were agreed by Ryan and Tameem
* &lt;input type="checkbox" name.bind="cb.name" | ftFormatSubscriptionInputNames:'OPTION_'"&gt;
* &lt;input type="text" name.bind="ot.name | ftFormatSubscriptionInputNames:'GUIDE_'" &gt;
*
*/
&nbsp;
export class FtFormatSubscriptionInputNamesValueConverter {
toView(value, fieldType) {
let val = fieldType + value.replace(/ /g, '');
return val;
}
}
&nbsp;</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Thu Sep 28 2017 09:48:32 GMT+0100 (GMT Daylight Time)
</div>
</div>
<script src="..\..\..\..\prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="..\..\..\..\sorter.js"></script>
</body>
</html>

View File

@ -0,0 +1,106 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for components/marketing/common/value-converters</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="..\..\..\..\prettify.css" />
<link rel="stylesheet" href="..\..\..\..\base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(..\..\..\..\sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
<a href="..\..\..\..\index.html">All files</a> components/marketing/common/value-converters
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">57.14% </span>
<span class="quiet">Statements</span>
<span class='fraction'>16/28</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">51.61% </span>
<span class="quiet">Branches</span>
<span class='fraction'>16/31</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">75% </span>
<span class="quiet">Functions</span>
<span class='fraction'>3/4</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">52% </span>
<span class="quiet">Lines</span>
<span class='fraction'>13/25</span>
</div>
</div>
</div>
<div class='status-line medium'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file medium" data-value="ft-format-grid-cell.js"><a href="ft-format-grid-cell.js.html">ft-format-grid-cell.js</a></td>
<td data-value="53.85" class="pic medium"><div class="chart"><div class="cover-fill" style="width: 53%;"></div><div class="cover-empty" style="width:47%;"></div></div></td>
<td data-value="53.85" class="pct medium">53.85%</td>
<td data-value="26" class="abs medium">14/26</td>
<td data-value="51.61" class="pct medium">51.61%</td>
<td data-value="31" class="abs medium">16/31</td>
<td data-value="66.67" class="pct medium">66.67%</td>
<td data-value="3" class="abs medium">2/3</td>
<td data-value="47.83" class="pct low">47.83%</td>
<td data-value="23" class="abs low">11/23</td>
</tr>
<tr>
<td class="file high" data-value="ft-format-subscription-input-names.js"><a href="ft-format-subscription-input-names.js.html">ft-format-subscription-input-names.js</a></td>
<td data-value="100" class="pic high"><div class="chart"><div class="cover-fill cover-full" style="width: 100%;"></div><div class="cover-empty" style="width:0%;"></div></div></td>
<td data-value="100" class="pct high">100%</td>
<td data-value="2" class="abs high">2/2</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="0" class="abs high">0/0</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="1" class="abs high">1/1</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="2" class="abs high">2/2</td>
</tr>
</tbody>
</table>
</div><div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Thu Sep 28 2017 09:48:32 GMT+0100 (GMT Daylight Time)
</div>
</div>
<script src="..\..\..\..\prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="..\..\..\..\sorter.js"></script>
</body>
</html>

View File

@ -0,0 +1,611 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for components/marketing/grids/ft-grid-filter/lib/grid-filter.reducer.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="..\..\..\..\..\prettify.css" />
<link rel="stylesheet" href="..\..\..\..\..\base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(..\..\..\..\..\sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
<a href="..\..\..\..\..\index.html">All files</a> / <a href="index.html">components/marketing/grids/ft-grid-filter/lib</a> grid-filter.reducer.js
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">74.77% </span>
<span class="quiet">Statements</span>
<span class='fraction'>80/107</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">64.62% </span>
<span class="quiet">Branches</span>
<span class='fraction'>42/65</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">70.59% </span>
<span class="quiet">Functions</span>
<span class='fraction'>12/17</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">73.74% </span>
<span class="quiet">Lines</span>
<span class='fraction'>73/99</span>
</div>
</div>
</div>
<div class='status-line medium'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183</td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">17x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-yes">48x</span>
<span class="cline-any cline-yes">12x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">12x</span>
<span class="cline-any cline-yes">210x</span>
<span class="cline-any cline-yes">198x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">13x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">16x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">/**
* App State Reducer for gridFilter
* Takes application state data and creates model for components
*/
import flatten from 'lodash/flatten';
import get from 'lodash/get';
import has from 'lodash/has';
import intersectionWith from 'lodash/intersectionWith';
import isEqual from 'lodash/isEqual';
import merge from 'lodash/merge';
import uniqBy from 'lodash/uniqBy';
import clone from 'lodash/clone';
import moment from 'moment';
// import {LogManager} from 'aurelia-framework';
// const logger = LogManager.getLogger('grid-filter');
&nbsp;
export function gridFilter(state = <span class="branch-0 cbranch-no" title="branch not covered" >{},</span> action) {
let newState;
let beanLabelData;
switch (action.type) {
<span class="branch-0 cbranch-no" title="branch not covered" > case 'LOAD_LABELS_MARKETING_SUCCESS':</span>
let [labelData] = <span class="cstat-no" title="statement not covered" >action.json;</span>
<span class="cstat-no" title="statement not covered" > action.json.forEach(<span class="fstat-no" title="function not covered" >fu</span>nction(bean) {</span>
<span class="cstat-no" title="statement not covered" > merge(labelData, bean);</span>
}, this);
<span class="cstat-no" title="statement not covered" > beanLabelData = get(labelData, 'labels');</span>
let loadMoreLink = <span class="cstat-no" title="statement not covered" >get(beanLabelData, 'load-more-link');</span>
let displayLabel = <span class="cstat-no" title="statement not covered" >get(beanLabelData, 'display-label');</span>
let gridLabel = <span class="cstat-no" title="statement not covered" >get(beanLabelData, 'grid-label');</span>
let listLabel = <span class="cstat-no" title="statement not covered" >get(beanLabelData, 'list-label');</span>
&nbsp;
<span class="cstat-no" title="statement not covered" > return Object.assign({}, state, {</span>
gridFilter: {
loadMoreLink: loadMoreLink,
displayLabel: displayLabel,
gridLabel: gridLabel,
listLabel: listLabel,
allLables: beanLabelData
}
});
case 'POPULATE_GRID_FILTER':
newState = Object.assign({}, state);
let cid = action.cid;
newState.app.grid.grids[cid] = Object.assign({}, newState.app.grid.defaults);
&nbsp;
//augment config data
let newConfig = action.data.configData;
&nbsp;
<span class="missing-if-branch" title="else path not taken" >E</span>if (newConfig.cardsPerPage &amp;&amp; typeof newConfig.cardsPerPage === 'number') {
newState.app.grid.grids[cid].cardsPerPage = newConfig.cardsPerPage;
}
<span class="missing-if-branch" title="else path not taken" >E</span>if (newConfig.currentView) {
newState.app.grid.grids[cid].currentView = newConfig.currentView === 'TABLE' ? 'TABLE' : <span class="branch-1 cbranch-no" title="branch not covered" >'GRID';</span>
}
<span class="missing-if-branch" title="else path not taken" >E</span>if (typeof newConfig.showViewToggle === 'boolean') {
newState.app.grid.grids[cid].showViewToggle = newConfig.showViewToggle;
}
&nbsp;
let gridFilters = clone(newState.app.grid.grids[cid].filters);
let gridColumns = clone(newState.app.grid.grids[cid].columns);
&nbsp;
newState.app.grid.grids[cid].filters = merge(gridFilters, newConfig.filters);
newState.app.grid.grids[cid].columns = merge(gridColumns, newConfig.columns);
&nbsp;
// add cards
let cards = action.data.cardData;
//Run through card data and convert the content types/ categories with respective labels
cards.forEach(function(card) {
<span class="missing-if-branch" title="if path not taken" >I</span>if (card.data &amp;&amp; card.data.contentType) {
<span class="cstat-no" title="statement not covered" > card.data.contentTypeLabels = get(state.gridFilter.allLables, card.data.contentType) ? get(state.gridFilter.allLables, card.data.contentType) : '[' + card.data.contentType + ']';</span>
}
<span class="missing-if-branch" title="if path not taken" >I</span>if (card.data &amp;&amp; card.data.contentCategories) {
let catStr = <span class="cstat-no" title="statement not covered" >'';</span>
let cats = <span class="cstat-no" title="statement not covered" >card.data.contentCategories.split('|');</span>
<span class="cstat-no" title="statement not covered" > cats.forEach(<span class="fstat-no" title="function not covered" >fu</span>nction(cat, i) {</span>
<span class="cstat-no" title="statement not covered" > if (cat) {</span>
<span class="cstat-no" title="statement not covered" > card.data.contentCategoriesKey = cat;</span>
}
let catCategory = <span class="cstat-no" title="statement not covered" >get(state.gridFilter.allLables, cat) ? get(state.gridFilter.allLables, cat) : '[' + cat + ']';</span>
<span class="cstat-no" title="statement not covered" > if (cat !== '' &amp;&amp; i &lt; cats.length) {</span>
<span class="cstat-no" title="statement not covered" > catStr += catCategory;</span>
<span class="cstat-no" title="statement not covered" > if ( i &lt; cats.length - 2) {</span>
<span class="cstat-no" title="statement not covered" > catStr += ', ';</span>
}
}
}, this);
<span class="cstat-no" title="statement not covered" > card.data.contentCategoriesLabel = catStr;</span>
}
}, this);
&nbsp;
Object.assign(newState.app.grid.grids[cid], {cards});
newState.app.grid.grids[cid].numVisibleCards = Math.min(cards.length, newState.app.grid.grids[cid].cardsPerPage);
&nbsp;
// add dropdown options (already has the default ALL option)
newState.app.grid.grids[cid].filters.forEach(filter =&gt; {
// get options present in card data
let optionsInData = [];
if (filter.type === 'DROPDOWN') {
optionsInData = cards.filter(card =&gt; has(card, `data.${filter.dataKey}`)).map(card =&gt; get(card, `data.${filter.dataKey}`).split('|')); // these are the options that actually exist on the cards
optionsInData = flatten(optionsInData);
// remove config options that don't have corresponding data on the cards
filter.options = intersectionWith(filter.options, optionsInData, (configOpt, dataOpt) =&gt; {
if (['ALL', '12_MONTHS'].includes(configOpt.value.toUpperCase())) return true;
return configOpt.value === dataOpt;
});
}
&nbsp;
if (filter.type === 'YEAR_DROPDOWN') {
optionsInData = cards
.filter(card =&gt; {
<span class="missing-if-branch" title="if path not taken" >I</span>if (!card) {<span class="cstat-no" title="statement not covered" >return;}</span>
if (!card.data) {return;}
return card.data.date;
})
.map(<span class="fstat-no" title="function not covered" >ca</span>rd =&gt; {
<span class="cstat-no" title="statement not covered" > return moment(get(card, `data.${filter.dataKey}`), filter.dateFormat).year();</span>
})
.sort(<span class="fstat-no" title="function not covered" >(a</span>, b) =&gt; <span class="cstat-no" title="statement not covered" >b - a)</span>
.map(<span class="fstat-no" title="function not covered" >ye</span>ar =&gt; (<span class="cstat-no" title="statement not covered" >{label: year, value: year})</span>);
&nbsp;
filter.options = uniqBy(filter.options.concat(optionsInData), 'value');
}
});
return newState;
case 'GRID_CHANGE_DROPDOWN':
let currentFilter = state.app.grid.grids[action.cid].filters.find(d =&gt; d.name === action.name);
<span class="missing-if-branch" title="else path not taken" >E</span>if (currentFilter &amp;&amp; !isEqual(currentFilter.selected, action.newValue)) {
newState = Object.assign({}, state);
//Reset em before...
newState.app.grid.grids[action.cid].filters.forEach((filter) =&gt; {
filter.selected = '';
});
newState.app.grid.grids[action.cid].filters.find(d =&gt; d.name === action.name).selected = action.newValue;
return newState;
}
<span class="cstat-no" title="statement not covered" > return state;</span>
case 'GRID_CHANGE_VIEW':
let currentView = state.app.grid.grids[action.cid].currentView;
if (currentView !== action.view) {
newState = Object.assign({}, state);
newState.app.grid.grids[action.cid].currentView = action.view;
return newState;
}
return state;
case 'GRID_LOAD_MORE':
let numVisibleCards = state.app.grid.grids[action.cid].numVisibleCards;
let totalCards = state.app.grid.grids[action.cid].cards.length;
if (numVisibleCards &lt; totalCards) {
let cardsPerPage = state.app.grid.grids[action.cid].cardsPerPage;
newState = Object.assign({}, state);
newState.app.grid.grids[action.cid].numVisibleCards = Math.min(totalCards, (numVisibleCards + cardsPerPage));
return newState;
}
return state;
case 'GRID_CHANGE_SORT':
let columns = state.app.grid.grids[action.cid].columns;
let newSortColumn = columns.find(col =&gt; action.columnName === col.name);
<span class="missing-if-branch" title="else path not taken" >E</span>if (newSortColumn) {
switch (newSortColumn.direction) {
case 'ASC':
newSortColumn.direction = 'DESC';
break;
case 'DESC':
newSortColumn.direction = 'ASC';
break;
default:
newSortColumn.direction = newSortColumn.isNumeric ? 'DESC' : 'ASC';
}
columns.forEach(col =&gt; {
if (col.name !== action.columnName) {
col.direction = null;
}
});
newState = Object.assign({}, state);
Object.assign(newState.app.grid.grids[action.cid], {columns});
return newState;
}
<span class="cstat-no" title="statement not covered" > return state;</span>
default:
return state;
}
}
&nbsp;</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Thu Sep 28 2017 09:48:32 GMT+0100 (GMT Daylight Time)
</div>
</div>
<script src="..\..\..\..\..\prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="..\..\..\..\..\sorter.js"></script>
</body>
</html>

View File

@ -0,0 +1,93 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for components/marketing/grids/ft-grid-filter/lib</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="..\..\..\..\..\prettify.css" />
<link rel="stylesheet" href="..\..\..\..\..\base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(..\..\..\..\..\sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
<a href="..\..\..\..\..\index.html">All files</a> components/marketing/grids/ft-grid-filter/lib
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">74.77% </span>
<span class="quiet">Statements</span>
<span class='fraction'>80/107</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">64.62% </span>
<span class="quiet">Branches</span>
<span class='fraction'>42/65</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">70.59% </span>
<span class="quiet">Functions</span>
<span class='fraction'>12/17</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">73.74% </span>
<span class="quiet">Lines</span>
<span class='fraction'>73/99</span>
</div>
</div>
</div>
<div class='status-line medium'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file medium" data-value="grid-filter.reducer.js"><a href="grid-filter.reducer.js.html">grid-filter.reducer.js</a></td>
<td data-value="74.77" class="pic medium"><div class="chart"><div class="cover-fill" style="width: 74%;"></div><div class="cover-empty" style="width:26%;"></div></div></td>
<td data-value="74.77" class="pct medium">74.77%</td>
<td data-value="107" class="abs medium">80/107</td>
<td data-value="64.62" class="pct medium">64.62%</td>
<td data-value="65" class="abs medium">42/65</td>
<td data-value="70.59" class="pct medium">70.59%</td>
<td data-value="17" class="abs medium">12/17</td>
<td data-value="73.74" class="pct medium">73.74%</td>
<td data-value="99" class="abs medium">73/99</td>
</tr>
</tbody>
</table>
</div><div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Thu Sep 28 2017 09:48:32 GMT+0100 (GMT Daylight Time)
</div>
</div>
<script src="..\..\..\..\..\prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="..\..\..\..\..\sorter.js"></script>
</body>
</html>

View File

@ -0,0 +1,93 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for components/marketing/lists/ft-report-archive-a/lib/en-us-retail</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="..\..\..\..\..\..\prettify.css" />
<link rel="stylesheet" href="..\..\..\..\..\..\base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(..\..\..\..\..\..\sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
<a href="..\..\..\..\..\..\index.html">All files</a> components/marketing/lists/ft-report-archive-a/lib/en-us-retail
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">96.15% </span>
<span class="quiet">Statements</span>
<span class='fraction'>25/26</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">80% </span>
<span class="quiet">Branches</span>
<span class='fraction'>8/10</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>4/4</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">96.15% </span>
<span class="quiet">Lines</span>
<span class='fraction'>25/26</span>
</div>
</div>
</div>
<div class='status-line high'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file high" data-value="report-archive-a.reducer.js"><a href="report-archive-a.reducer.js.html">report-archive-a.reducer.js</a></td>
<td data-value="96.15" class="pic high"><div class="chart"><div class="cover-fill" style="width: 96%;"></div><div class="cover-empty" style="width:4%;"></div></div></td>
<td data-value="96.15" class="pct high">96.15%</td>
<td data-value="26" class="abs high">25/26</td>
<td data-value="80" class="pct high">80%</td>
<td data-value="10" class="abs high">8/10</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="4" class="abs high">4/4</td>
<td data-value="96.15" class="pct high">96.15%</td>
<td data-value="26" class="abs high">25/26</td>
</tr>
</tbody>
</table>
</div><div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Wed Jun 21 2017 17:09:48 GMT+0100 (GMT Daylight Time)
</div>
</div>
<script src="..\..\..\..\..\..\prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="..\..\..\..\..\..\sorter.js"></script>
</body>
</html>

View File

@ -0,0 +1,290 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for components/marketing/lists/ft-report-archive-a/lib/en-us-retail/report-archive-a.reducer.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="..\..\..\..\..\..\prettify.css" />
<link rel="stylesheet" href="..\..\..\..\..\..\base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(..\..\..\..\..\..\sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
<a href="..\..\..\..\..\..\index.html">All files</a> / <a href="index.html">components/marketing/lists/ft-report-archive-a/lib/en-us-retail</a> report-archive-a.reducer.js
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">96.15% </span>
<span class="quiet">Statements</span>
<span class='fraction'>25/26</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">80% </span>
<span class="quiet">Branches</span>
<span class='fraction'>8/10</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>4/4</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">96.15% </span>
<span class="quiet">Lines</span>
<span class='fraction'>25/26</span>
</div>
</div>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76</td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import get from 'lodash/get';
import map from 'lodash/map';
import isArray from 'lodash/isArray';
import first from 'lodash/first';
import takeRight from 'lodash/takeRight';
/**
* Data Reducer for reportArchiveA
* Takes site specific json data and creates model for components
* after applying business and presentation logic and data mapping
*/
// import {LogManager} from 'aurelia-framework';
// const logger = LogManager.getLogger('report-archive-a');
&nbsp;
export function reportArchiveA(state, action) {
switch (action.type) {
case 'POPULATE_REPORT_ARCHIVE_A_SUCCESS':
let [data] = action.json;
&nbsp;
let beanData = get(data, 'config.providers.provider[reports-data]');
// logger.debug('data:', beanData);
&nbsp;
let cols = get(beanData, 'documents.header.column');
let rows = get(beanData, 'documents.row');
let noresults = get(beanData, 'message');
let footnote = get(beanData, 'caveat.footnote');
let fundtitle = get(beanData, 'fundtitle');
&nbsp;
&nbsp;
// convert to array if just single object
if (rows) {
rows = (isArray(rows) ? rows : <span class="branch-1 cbranch-no" title="branch not covered" >[rows])</span>;
rows = map(rows, (row) =&gt; {
let columns = get(row, 'column');
let label = first(columns).label;
let otherColumns = takeRight(columns, columns.length - 1);
let rowCols = map(otherColumns, (col) =&gt; {
let column = {};
<span class="missing-if-branch" title="if path not taken" >I</span>if (typeof col.document === 'string') {
<span class="cstat-no" title="statement not covered" > column.noresults = col.document;</span>
} else {
let documents = (isArray(col.document) ? col.document : [col.document]);
column.documents = map(documents, (doc) =&gt; {
return {
url: doc.path,
title: doc.title,
label: doc.title,
size: doc.size,
extension: doc.extension
};
});
}
return column;
});
return {
label,
cols: rowCols
};
});
} else {
rows = [];
}
&nbsp;
return Object.assign({}, state, {
reportArchiveA: {
title: fundtitle,
noresults,
footnote,
cols,
rows
}
});
default:
return state;
}
}
&nbsp;</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Wed Jun 21 2017 17:09:48 GMT+0100 (GMT Daylight Time)
</div>
</div>
<script src="..\..\..\..\..\..\prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="..\..\..\..\..\..\sorter.js"></script>
</body>
</html>

View File

@ -0,0 +1,93 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for components/marketing/lists/ft-report-archive-a/lib/gw</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="..\..\..\..\..\..\prettify.css" />
<link rel="stylesheet" href="..\..\..\..\..\..\base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(..\..\..\..\..\..\sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
<a href="..\..\..\..\..\..\index.html">All files</a> components/marketing/lists/ft-report-archive-a/lib/gw
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">75.76% </span>
<span class="quiet">Statements</span>
<span class='fraction'>25/33</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">72.73% </span>
<span class="quiet">Branches</span>
<span class='fraction'>8/11</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>4/4</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">75.76% </span>
<span class="quiet">Lines</span>
<span class='fraction'>25/33</span>
</div>
</div>
</div>
<div class='status-line medium'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file medium" data-value="report-archive-a.reducer.js"><a href="report-archive-a.reducer.js.html">report-archive-a.reducer.js</a></td>
<td data-value="75.76" class="pic medium"><div class="chart"><div class="cover-fill" style="width: 75%;"></div><div class="cover-empty" style="width:25%;"></div></div></td>
<td data-value="75.76" class="pct medium">75.76%</td>
<td data-value="33" class="abs medium">25/33</td>
<td data-value="72.73" class="pct medium">72.73%</td>
<td data-value="11" class="abs medium">8/11</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="4" class="abs high">4/4</td>
<td data-value="75.76" class="pct medium">75.76%</td>
<td data-value="33" class="abs medium">25/33</td>
</tr>
</tbody>
</table>
</div><div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Thu Sep 28 2017 09:48:32 GMT+0100 (GMT Daylight Time)
</div>
</div>
<script src="..\..\..\..\..\..\prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="..\..\..\..\..\..\sorter.js"></script>
</body>
</html>

View File

@ -0,0 +1,338 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for components/marketing/lists/ft-report-archive-a/lib/gw/report-archive-a.reducer.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="..\..\..\..\..\..\prettify.css" />
<link rel="stylesheet" href="..\..\..\..\..\..\base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(..\..\..\..\..\..\sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
<a href="..\..\..\..\..\..\index.html">All files</a> / <a href="index.html">components/marketing/lists/ft-report-archive-a/lib/gw</a> report-archive-a.reducer.js
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">75.76% </span>
<span class="quiet">Statements</span>
<span class='fraction'>25/33</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">72.73% </span>
<span class="quiet">Branches</span>
<span class='fraction'>8/11</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>4/4</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">75.76% </span>
<span class="quiet">Lines</span>
<span class='fraction'>25/33</span>
</div>
</div>
</div>
<div class='status-line medium'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92</td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import get from 'lodash/get';
import map from 'lodash/map';
import isArray from 'lodash/isArray';
import first from 'lodash/first';
import takeRight from 'lodash/takeRight';
/**
* Data Reducer for reportArchiveA
* Takes site specific json data and creates model for components
* after applying business and presentation logic and data mapping
*/
// import {LogManager} from 'aurelia-framework';
// const logger = LogManager.getLogger('report-archive-a');
&nbsp;
export function reportArchiveA(state, action) {
switch (action.type) {
<span class="branch-0 cbranch-no" title="branch not covered" > case 'LOAD_LABELS_MARKETING_SUCCESS':</span>
let [labelData] = <span class="cstat-no" title="statement not covered" >action.json;</span>
let beanLabelData = <span class="cstat-no" title="statement not covered" >get(labelData, 'labels');</span>
&nbsp;
let searchFundKeyword = <span class="cstat-no" title="statement not covered" >get(beanLabelData, 'search-fund-keyword');</span>
let onOffToggle = <span class="cstat-no" title="statement not covered" >get(beanLabelData, 'on-off-toggle');</span>
let onState = <span class="cstat-no" title="statement not covered" >get(beanLabelData, 'on-state');</span>
let offState = <span class="cstat-no" title="statement not covered" >get(beanLabelData, 'off-state');</span>
&nbsp;
<span class="cstat-no" title="statement not covered" > return Object.assign({}, state, {</span>
reportArchiveALabels: {
searchFundKeyword: searchFundKeyword,
onOffToggle: onOffToggle,
onState: onState,
offState: offState
}
});
case 'POPULATE_REPORT_ARCHIVE_A_SUCCESS':
let [data] = action.json;
&nbsp;
let beanData = get(data, 'config.providers.provider[reports-data]');
// logger.debug('data:', beanData);
&nbsp;
let cols = get(beanData, 'documents.header.column');
let rows = get(beanData, 'documents.row');
let noresults = get(beanData, 'message');
let footnote = get(beanData, 'caveat.footnote');
let fundtitle = get(beanData, 'fundtitle');
&nbsp;
// convert to array if just single object
if (rows) {
rows = (isArray(rows) ? rows : <span class="branch-1 cbranch-no" title="branch not covered" >[rows])</span>;
rows = map(rows, (row) =&gt; {
let columns = get(row, 'column');
let label = first(columns).label;
let otherColumns = takeRight(columns, columns.length - 1);
let rowCols = map(otherColumns, (col) =&gt; {
let column = {};
<span class="missing-if-branch" title="if path not taken" >I</span>if (typeof col.document === 'string') {
<span class="cstat-no" title="statement not covered" > column.noresults = col.document;</span>
} else {
let documents = (isArray(col.document) ? col.document : [col.document]);
column.documents = map(documents, (doc) =&gt; {
return {
url: doc.path,
title: doc.title,
label: doc.title,
size: doc.size,
extension: doc.extension
};
});
}
return column;
});
return {
label,
cols: rowCols
};
});
} else {
rows = [];
}
&nbsp;
return Object.assign({}, state, {
reportArchiveA: {
title: fundtitle,
noresults,
footnote,
cols,
rows
}
});
default:
return state;
}
}
&nbsp;</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Thu Sep 28 2017 09:48:32 GMT+0100 (GMT Daylight Time)
</div>
</div>
<script src="..\..\..\..\..\..\prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="..\..\..\..\..\..\sorter.js"></script>
</body>
</html>

View File

@ -0,0 +1,93 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for components/marketing/lists/ft-report-archive-b/lib/en-us-retail</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="..\..\..\..\..\..\prettify.css" />
<link rel="stylesheet" href="..\..\..\..\..\..\base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(..\..\..\..\..\..\sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
<a href="..\..\..\..\..\..\index.html">All files</a> components/marketing/lists/ft-report-archive-b/lib/en-us-retail
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">96.77% </span>
<span class="quiet">Statements</span>
<span class='fraction'>30/31</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">81.25% </span>
<span class="quiet">Branches</span>
<span class='fraction'>13/16</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>4/4</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">96.77% </span>
<span class="quiet">Lines</span>
<span class='fraction'>30/31</span>
</div>
</div>
</div>
<div class='status-line high'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file high" data-value="report-archive-b.reducer.js"><a href="report-archive-b.reducer.js.html">report-archive-b.reducer.js</a></td>
<td data-value="96.77" class="pic high"><div class="chart"><div class="cover-fill" style="width: 96%;"></div><div class="cover-empty" style="width:4%;"></div></div></td>
<td data-value="96.77" class="pct high">96.77%</td>
<td data-value="31" class="abs high">30/31</td>
<td data-value="81.25" class="pct high">81.25%</td>
<td data-value="16" class="abs high">13/16</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="4" class="abs high">4/4</td>
<td data-value="96.77" class="pct high">96.77%</td>
<td data-value="31" class="abs high">30/31</td>
</tr>
</tbody>
</table>
</div><div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Wed Jun 21 2017 17:09:48 GMT+0100 (GMT Daylight Time)
</div>
</div>
<script src="..\..\..\..\..\..\prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="..\..\..\..\..\..\sorter.js"></script>
</body>
</html>

View File

@ -0,0 +1,290 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for components/marketing/lists/ft-report-archive-b/lib/en-us-retail/report-archive-b.reducer.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="..\..\..\..\..\..\prettify.css" />
<link rel="stylesheet" href="..\..\..\..\..\..\base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(..\..\..\..\..\..\sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
<a href="..\..\..\..\..\..\index.html">All files</a> / <a href="index.html">components/marketing/lists/ft-report-archive-b/lib/en-us-retail</a> report-archive-b.reducer.js
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">96.77% </span>
<span class="quiet">Statements</span>
<span class='fraction'>30/31</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">81.25% </span>
<span class="quiet">Branches</span>
<span class='fraction'>13/16</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>4/4</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">96.77% </span>
<span class="quiet">Lines</span>
<span class='fraction'>30/31</span>
</div>
</div>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76</td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">9x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">9x</span>
<span class="cline-any cline-yes">9x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">9x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import get from 'lodash/get';
import map from 'lodash/map';
import isArray from 'lodash/isArray';
import first from 'lodash/first';
import takeRight from 'lodash/takeRight';
/**
* Data Reducer for reportArchiveA
* Takes site specific json data and creates model for components
* after applying business and presentation logic and data mapping
*/
// import {LogManager} from 'aurelia-framework';
// const logger = LogManager.getLogger('report-archive-b');
&nbsp;
export function reportArchiveB(state, action) {
switch (action.type) {
case 'POPULATE_REPORT_ARCHIVE_B_SUCCESS':
let [data] = action.json;
let reportArchiveBData = {};
&nbsp;
let beanData = get(data, 'config.providers.provider[archive-data]');
&nbsp;
let cols = get(beanData, 'documents.header.column');
if (cols) {
reportArchiveBData.cols = cols;
}
let footnote = get(beanData, 'caveat.footnote');
if (cols) {
reportArchiveBData.footnote = footnote;
}
let rows = get(beanData, 'documents.row');
&nbsp;
&nbsp;
// convert to array if just single object
if (rows) {
rows = (isArray(rows) ? <span class="branch-0 cbranch-no" title="branch not covered" >rows </span>: [rows]);
// rows = [rows[0], rows[0], rows[0], rows[0]];
&nbsp;
rows = map(rows, (row) =&gt; {
let columns = get(row, 'column');
let label = first(columns).label;
// let label = Math.random().toString(36).replace(/[^a-z]+/g, '');
let otherColumns = takeRight(columns, columns.length - 1);
&nbsp;
let rowCols = map(otherColumns, (col) =&gt; {
let column = {};
<span class="missing-if-branch" title="if path not taken" >I</span>if (typeof col.document === 'string') {
<span class="cstat-no" title="statement not covered" > column.noresults = col.document;</span>
} else {
column.documents = map((isArray(col.document) ? col.document : [col.document]), (doc) =&gt; {
let document = {
title: doc.title,
label: doc.title,
size: doc.size,
extension: doc.extension
};
<span class="missing-if-branch" title="else path not taken" >E</span>if (doc.path) {
document.url = `/downloadsServlet?docid=${doc.path}`;
}
return document;
});
}
return column;
});
return {
label,
cols: rowCols
};
});
reportArchiveBData.rows = rows;
}
return Object.assign({}, state, { reportArchiveB: reportArchiveBData });
default:
return state;
}
}
&nbsp;</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Wed Jun 21 2017 17:09:48 GMT+0100 (GMT Daylight Time)
</div>
</div>
<script src="..\..\..\..\..\..\prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="..\..\..\..\..\..\sorter.js"></script>
</body>
</html>

View File

@ -0,0 +1,93 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for components/marketing/lists/ft-report-archive-b/lib/gw</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="..\..\..\..\..\..\prettify.css" />
<link rel="stylesheet" href="..\..\..\..\..\..\base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(..\..\..\..\..\..\sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
<a href="..\..\..\..\..\..\index.html">All files</a> components/marketing/lists/ft-report-archive-b/lib/gw
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">79.49% </span>
<span class="quiet">Statements</span>
<span class='fraction'>31/39</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">73.68% </span>
<span class="quiet">Branches</span>
<span class='fraction'>14/19</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>4/4</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">79.49% </span>
<span class="quiet">Lines</span>
<span class='fraction'>31/39</span>
</div>
</div>
</div>
<div class='status-line medium'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file medium" data-value="report-archive-b.reducer.js"><a href="report-archive-b.reducer.js.html">report-archive-b.reducer.js</a></td>
<td data-value="79.49" class="pic medium"><div class="chart"><div class="cover-fill" style="width: 79%;"></div><div class="cover-empty" style="width:21%;"></div></div></td>
<td data-value="79.49" class="pct medium">79.49%</td>
<td data-value="39" class="abs medium">31/39</td>
<td data-value="73.68" class="pct medium">73.68%</td>
<td data-value="19" class="abs medium">14/19</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="4" class="abs high">4/4</td>
<td data-value="79.49" class="pct medium">79.49%</td>
<td data-value="39" class="abs medium">31/39</td>
</tr>
</tbody>
</table>
</div><div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Thu Sep 28 2017 09:48:32 GMT+0100 (GMT Daylight Time)
</div>
</div>
<script src="..\..\..\..\..\..\prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="..\..\..\..\..\..\sorter.js"></script>
</body>
</html>

View File

@ -0,0 +1,347 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for components/marketing/lists/ft-report-archive-b/lib/gw/report-archive-b.reducer.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="..\..\..\..\..\..\prettify.css" />
<link rel="stylesheet" href="..\..\..\..\..\..\base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(..\..\..\..\..\..\sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
<a href="..\..\..\..\..\..\index.html">All files</a> / <a href="index.html">components/marketing/lists/ft-report-archive-b/lib/gw</a> report-archive-b.reducer.js
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">79.49% </span>
<span class="quiet">Statements</span>
<span class='fraction'>31/39</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">73.68% </span>
<span class="quiet">Branches</span>
<span class='fraction'>14/19</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>4/4</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">79.49% </span>
<span class="quiet">Lines</span>
<span class='fraction'>31/39</span>
</div>
</div>
</div>
<div class='status-line medium'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95</td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">9x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">9x</span>
<span class="cline-any cline-yes">9x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">9x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import get from 'lodash/get';
import map from 'lodash/map';
import isArray from 'lodash/isArray';
import first from 'lodash/first';
import takeRight from 'lodash/takeRight';
/**
* Data Reducer for reportArchiveA
* Takes site specific json data and creates model for components
* after applying business and presentation logic and data mapping
*/
// import {LogManager} from 'aurelia-framework';
// const logger = LogManager.getLogger('report-archive-b');
&nbsp;
export function reportArchiveB(state, action) {
switch (action.type) {
<span class="branch-0 cbranch-no" title="branch not covered" > case 'LOAD_LABELS_MARKETING_SUCCESS':</span>
let [labelData] = <span class="cstat-no" title="statement not covered" >action.json;</span>
let beanLabelData = <span class="cstat-no" title="statement not covered" >get(labelData, 'labels');</span>
&nbsp;
let searchFundKeyword = <span class="cstat-no" title="statement not covered" >get(beanLabelData, 'search-fund-keyword');</span>
let onOffToggle = <span class="cstat-no" title="statement not covered" >get(beanLabelData, 'on-off-toggle');</span>
let onState = <span class="cstat-no" title="statement not covered" >get(beanLabelData, 'on-state');</span>
let offState = <span class="cstat-no" title="statement not covered" >get(beanLabelData, 'off-state');</span>
&nbsp;
<span class="cstat-no" title="statement not covered" > return Object.assign({}, state, {</span>
reportArchiveBLabels: {
searchFundKeyword: searchFundKeyword,
onOffToggle: onOffToggle,
onState: onState,
offState: offState
}
});
case 'POPULATE_REPORT_ARCHIVE_B_SUCCESS':
let [data] = action.json;
let reportArchiveBData = {};
&nbsp;
let beanData = get(data, 'config.providers.provider[archive-data]');
&nbsp;
let cols = get(beanData, 'documents.header.column');
if (cols) {
reportArchiveBData.cols = cols;
}
let footnote = get(beanData, 'caveat.footnote');
if (cols) {
reportArchiveBData.footnote = footnote;
}
let rows = get(beanData, 'documents.row');
&nbsp;
&nbsp;
// convert to array if just single object
if (rows) {
rows = (isArray(rows) ? <span class="branch-0 cbranch-no" title="branch not covered" >rows </span>: [rows]);
// rows = [rows[0], rows[0], rows[0], rows[0]];
&nbsp;
rows = map(rows, (row) =&gt; {
// logger.debug('xxxxxxxxxxxxxxxx', row);
let columns = get(row, 'column');
let label = first(columns).label;
// let label = Math.random().toString(36).replace(/[^a-z]+/g, '');
let otherColumns = takeRight(columns, columns.length - 1);
&nbsp;
let rowCols = map(otherColumns, (col) =&gt; {
let column = {};
<span class="missing-if-branch" title="else path not taken" >E</span>if (col.document) {
column.documents = map((isArray(col.document) ? col.document : [col.document]), (doc) =&gt; {
let document = {
title: get(doc, 'title'),
label: get(doc, 'title'),
size: get(doc, 'size'),
extension: get(doc, 'extension')
};
<span class="missing-if-branch" title="else path not taken" >E</span>if (doc.path) {
document.url = `${doc.path}`;
}
return document;
});
}
<span class="missing-if-branch" title="if path not taken" >I</span>if (typeof col.message === 'string') {
<span class="cstat-no" title="statement not covered" > column.noresults = col.message;</span>
}
return column;
});
return {
label,
cols: rowCols
};
});
reportArchiveBData.rows = rows;
}
return Object.assign({}, state, { reportArchiveB: reportArchiveBData });
default:
return state;
}
}
&nbsp;</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Thu Sep 28 2017 09:48:32 GMT+0100 (GMT Daylight Time)
</div>
</div>
<script src="..\..\..\..\..\..\prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="..\..\..\..\..\..\sorter.js"></script>
</body>
</html>

View File

@ -0,0 +1,93 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for components/marketing/lists/ft-report-archive-c/lib/intl</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="..\..\..\..\..\..\prettify.css" />
<link rel="stylesheet" href="..\..\..\..\..\..\base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(..\..\..\..\..\..\sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
<a href="..\..\..\..\..\..\index.html">All files</a> components/marketing/lists/ft-report-archive-c/lib/intl
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>0/0</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Branches</span>
<span class='fraction'>0/0</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Functions</span>
<span class='fraction'>0/1</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>0/0</span>
</div>
</div>
</div>
<div class='status-line high'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file high" data-value="report-archive-c.reducer.js"><a href="report-archive-c.reducer.js.html">report-archive-c.reducer.js</a></td>
<td data-value="100" class="pic high"><div class="chart"><div class="cover-fill cover-full" style="width: 100%;"></div><div class="cover-empty" style="width:0%;"></div></div></td>
<td data-value="100" class="pct high">100%</td>
<td data-value="0" class="abs high">0/0</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="0" class="abs high">0/0</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="1" class="abs low">0/1</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="0" class="abs high">0/0</td>
</tr>
</tbody>
</table>
</div><div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Thu Sep 28 2017 09:48:32 GMT+0100 (GMT Daylight Time)
</div>
</div>
<script src="..\..\..\..\..\..\prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="..\..\..\..\..\..\sorter.js"></script>
</body>
</html>

View File

@ -0,0 +1,275 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for components/marketing/lists/ft-report-archive-c/lib/intl/report-archive-c.reducer.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="..\..\..\..\..\..\prettify.css" />
<link rel="stylesheet" href="..\..\..\..\..\..\base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(..\..\..\..\..\..\sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
<a href="..\..\..\..\..\..\index.html">All files</a> / <a href="index.html">components/marketing/lists/ft-report-archive-c/lib/intl</a> report-archive-c.reducer.js
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>0/0</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Branches</span>
<span class='fraction'>0/0</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Functions</span>
<span class='fraction'>0/1</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>0/0</span>
</div>
</div>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71</td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">// import {get, map, isArray, first, takeRight} from 'lodash';
/**
* Data Reducer for reportArchiveA
* Takes site specific json data and creates model for components
* after applying business and presentation logic and data mapping
*/
// import {LogManager} from 'aurelia-framework';
// const logger = LogManager.getLogger('report-archive-b');
&nbsp;
export function <span class="fstat-no" title="function not covered" >reportArchiveC(</span>state, action) {
// switch (action.type) {
// case 'POPULATE_REPORT_ARCHIVE_C_SUCCESS':
// let [data] = action.json;
// let reportArchiveCData = {};
//
// let beanData = get(data, 'config.providers.provider[archive-data]');
//
// let cols = get(beanData, 'documents.header.column');
// if (cols) {
// reportArchiveCData.cols = cols;
// }
// let footnote = get(beanData, 'caveat.footnote');
// if (cols) {
// reportArchiveCData.footnote = footnote;
// }
// let rows = get(beanData, 'documents.row');
//
//
// // convert to array if just single object
// if (rows) {
// rows = (isArray(rows) ? rows : [rows]);
// // rows = [rows[0], rows[0], rows[0], rows[0]];
//
// rows = map(rows, (row) =&gt; {
// let columns = get(row, 'column');
// let label = first(columns).label;
// // let label = Math.random().toString(36).replace(/[^a-z]+/g, '');
// let otherColumns = takeRight(columns, columns.length - 1);
//
// let rowCols = map(otherColumns, (col) =&gt; {
// let column = {};
// if (typeof col.document === 'string') {
// column.noresults = col.document;
// } else {
// column.documents = map((isArray(col.document) ? col.document : [col.document]), (doc) =&gt; {
// let document = {
// title: doc.title,
// size: doc.size,
// extension: doc.extension
// };
// if (doc.path) {
// document.url = `/downloadsServlet?docid=${doc.path}`;
// }
// return document;
// });
// }
// return column;
// });
// return {
// label,
// cols: rowCols
// };
// });
// reportArchiveCData.rows = rows;
// }
// return Object.assign({}, state, { reportArchiveC: reportArchiveCData });
// default:
// return state;
// }
}
&nbsp;</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Thu Sep 28 2017 09:48:32 GMT+0100 (GMT Daylight Time)
</div>
</div>
<script src="..\..\..\..\..\..\prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="..\..\..\..\..\..\sorter.js"></script>
</body>
</html>

View File

@ -0,0 +1,93 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for components/marketing/lists/ft-report-archive-d/lib/intl</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="..\..\..\..\..\..\prettify.css" />
<link rel="stylesheet" href="..\..\..\..\..\..\base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(..\..\..\..\..\..\sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
<a href="..\..\..\..\..\..\index.html">All files</a> components/marketing/lists/ft-report-archive-d/lib/intl
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>0/0</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Branches</span>
<span class='fraction'>0/0</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Functions</span>
<span class='fraction'>0/1</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>0/0</span>
</div>
</div>
</div>
<div class='status-line high'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file high" data-value="report-archive-d.reducer.js"><a href="report-archive-d.reducer.js.html">report-archive-d.reducer.js</a></td>
<td data-value="100" class="pic high"><div class="chart"><div class="cover-fill cover-full" style="width: 100%;"></div><div class="cover-empty" style="width:0%;"></div></div></td>
<td data-value="100" class="pct high">100%</td>
<td data-value="0" class="abs high">0/0</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="0" class="abs high">0/0</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="1" class="abs low">0/1</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="0" class="abs high">0/0</td>
</tr>
</tbody>
</table>
</div><div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Wed Jun 21 2017 17:09:48 GMT+0100 (GMT Daylight Time)
</div>
</div>
<script src="..\..\..\..\..\..\prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="..\..\..\..\..\..\sorter.js"></script>
</body>
</html>

View File

@ -0,0 +1,275 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for components/marketing/lists/ft-report-archive-d/lib/intl/report-archive-d.reducer.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="..\..\..\..\..\..\prettify.css" />
<link rel="stylesheet" href="..\..\..\..\..\..\base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(..\..\..\..\..\..\sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
<a href="..\..\..\..\..\..\index.html">All files</a> / <a href="index.html">components/marketing/lists/ft-report-archive-d/lib/intl</a> report-archive-d.reducer.js
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>0/0</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Branches</span>
<span class='fraction'>0/0</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Functions</span>
<span class='fraction'>0/1</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>0/0</span>
</div>
</div>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71</td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">// import {get, map, isArray, first, takeRight} from 'lodash';
/**
* Data Reducer for reportArchiveA
* Takes site specific json data and creates model for components
* after applying business and presentation logic and data mapping
*/
// import {LogManager} from 'aurelia-framework';
// const logger = LogManager.getLogger('report-archive-b');
&nbsp;
export function <span class="fstat-no" title="function not covered" >reportArchiveD(</span>state, action) {
// switch (action.type) {
// case 'POPULATE_REPORT_ARCHIVE_C_SUCCESS':
// let [data] = action.json;
// let reportArchiveCData = {};
//
// let beanData = get(data, 'config.providers.provider[archive-data]');
//
// let cols = get(beanData, 'documents.header.column');
// if (cols) {
// reportArchiveCData.cols = cols;
// }
// let footnote = get(beanData, 'caveat.footnote');
// if (cols) {
// reportArchiveCData.footnote = footnote;
// }
// let rows = get(beanData, 'documents.row');
//
//
// // convert to array if just single object
// if (rows) {
// rows = (isArray(rows) ? rows : [rows]);
// // rows = [rows[0], rows[0], rows[0], rows[0]];
//
// rows = map(rows, (row) =&gt; {
// let columns = get(row, 'column');
// let label = first(columns).label;
// // let label = Math.random().toString(36).replace(/[^a-z]+/g, '');
// let otherColumns = takeRight(columns, columns.length - 1);
//
// let rowCols = map(otherColumns, (col) =&gt; {
// let column = {};
// if (typeof col.document === 'string') {
// column.noresults = col.document;
// } else {
// column.documents = map((isArray(col.document) ? col.document : [col.document]), (doc) =&gt; {
// let document = {
// title: doc.title,
// size: doc.size,
// extension: doc.extension
// };
// if (doc.path) {
// document.url = `/downloadsServlet?docid=${doc.path}`;
// }
// return document;
// });
// }
// return column;
// });
// return {
// label,
// cols: rowCols
// };
// });
// reportArchiveCData.rows = rows;
// }
// return Object.assign({}, state, { reportArchiveC: reportArchiveCData });
// default:
// return state;
// }
}
&nbsp;</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Wed Jun 21 2017 17:09:48 GMT+0100 (GMT Daylight Time)
</div>
</div>
<script src="..\..\..\..\..\..\prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="..\..\..\..\..\..\sorter.js"></script>
</body>
</html>

View File

@ -0,0 +1 @@
.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More