Mercurial > hg > thermostat-ng > web-client
changeset 157:bf297ee94d9d
Rename inconsistentthermostat directive directory
Reviewed-by: aazores
Review-thread: http://icedtea.classpath.org/pipermail/thermostat/2017-August/024497.html
author | Chris Lessard <clessard@redhat.com> |
---|---|
date | Wed, 16 Aug 2017 12:47:29 -0400 |
parents | ed60038d7827 |
children | 72e3837815d3 |
files | src/app/shared/directives/customizable-error-message/customizable-error-message.directive.js src/app/shared/directives/customizable-error-message/customizable-error-message.directive.spec.js src/app/shared/directives/customizable-error-message/customizable-error-message.html src/app/shared/directives/customizable-error-message/customizable-error-message.module.js src/app/shared/directives/customizableErrorMessageDirective/customizable-error-message.directive.js src/app/shared/directives/customizableErrorMessageDirective/customizable-error-message.directive.spec.js src/app/shared/directives/customizableErrorMessageDirective/customizable-error-message.html src/app/shared/directives/customizableErrorMessageDirective/customizable-error-message.module.js |
diffstat | 8 files changed, 178 insertions(+), 178 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/app/shared/directives/customizable-error-message/customizable-error-message.directive.js Wed Aug 16 12:47:29 2017 -0400 @@ -0,0 +1,45 @@ +/** + * Copyright 2012-2017 Red Hat, Inc. + * + * Thermostat is distributed under the GNU General Public License, + * version 2 or any later version (with a special exception described + * below, commonly known as the "Classpath Exception"). + * + * A copy of GNU General Public License (GPL) is included in this + * distribution, in the file COPYING. + * + * Linking Thermostat code with other modules is making a combined work + * based on Thermostat. Thus, the terms and conditions of the GPL + * cover the whole combination. + * + * As a special exception, the copyright holders of Thermostat give you + * permission to link this code with independent modules to produce an + * executable, regardless of the license terms of these independent + * modules, and to copy and distribute the resulting executable under + * terms of your choice, provided that you also meet, for each linked + * independent module, the terms and conditions of the license of that + * module. An independent module is a module which is not derived from + * or based on Thermostat code. If you modify Thermostat, you may + * extend this exception to your version of the software, but you are + * not obligated to do so. If you do not wish to do so, delete this + * exception statement from your version. + */ + +import customizableErrorMessageTemplate from './customizable-error-message.html'; + +export let customizableErrorMessageFunc = () => { + return { + restrict: 'E', + scope: { + errTitle: '<', + errMessage: '<', + dismissible: '<' + }, + template: customizableErrorMessageTemplate + }; +}; + +export default angular + .module('customizableErrorMessage.directive', []) + .directive('customizableErrorMessage', customizableErrorMessageFunc) + .name;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/app/shared/directives/customizable-error-message/customizable-error-message.directive.spec.js Wed Aug 16 12:47:29 2017 -0400 @@ -0,0 +1,93 @@ +/** + * Copyright 2012-2017 Red Hat, Inc. + * + * Thermostat is distributed under the GNU General Public License, + * version 2 or any later version (with a special exception described + * below, commonly known as the "Classpath Exception"). + * + * A copy of GNU General Public License (GPL) is included in this + * distribution, in the file COPYING. + * + * Linking Thermostat code with other modules is making a combined work + * based on Thermostat. Thus, the terms and conditions of the GPL + * cover the whole combination. + * + * As a special exception, the copyright holders of Thermostat give you + * permission to link this code with independent modules to produce an + * executable, regardless of the license terms of these independent + * modules, and to copy and distribute the resulting executable under + * terms of your choice, provided that you also meet, for each linked + * independent module, the terms and conditions of the license of that + * module. An independent module is a module which is not derived from + * or based on Thermostat code. If you modify Thermostat, you may + * extend this exception to your version of the software, but you are + * not obligated to do so. If you do not wish to do so, delete this + * exception statement from your version. + */ + +import directiveModule from './customizable-error-message.directive.js'; +import {customizableErrorMessageFunc} from './customizable-error-message.directive.js'; + +describe('customizableErrorMessage Directive', () => { + let compiledDirectiveElement; + let element = '<customizable-error-message err-title=errTitle err-message=errMessage> </customizable-error-message>'; + + beforeEach(angular.mock.module(directiveModule)); + + let initDummyModule = () => { + let compile, rootScope; + angular.mock.inject(($compile, $rootScope) => { + 'ngInject'; + compile = $compile; + rootScope = $rootScope; + }); + + rootScope.errTitle = 'foo'; + rootScope.errMessage = 'bar'; + + compiledDirectiveElement = compile(element)(rootScope); + rootScope.$digest(); + }; + + describe('customizableErrorMessage Directive.function', () => { + it('should return a valid object', () => { + let fnResult = customizableErrorMessageFunc(); + fnResult.should.have.ownProperty('template'); + fnResult.should.have.ownProperty('restrict'); + fnResult.should.have.ownProperty('scope'); + }); + }); + + describe('customizableErrorMessage Directive.content', () => { + beforeEach(initDummyModule); + + it('should be a valid object', () => { + should.exist(compiledDirectiveElement); + }); + + it('should insert the correct error title', () => { + compiledDirectiveElement.html().should.containEql('foo'); + }); + + it('should insert the correct error message', () => { + compiledDirectiveElement.html().should.containEql('bar'); + }); + }); + + describe('customizableErrorMessage Directive.content', () => { + + beforeEach(initDummyModule); + + it('should be a valid object', () => { + should.exist(compiledDirectiveElement); + }); + + it('should insert the correct error title', () => { + compiledDirectiveElement.html().should.containEql('foo'); + }); + + it('should insert the correct error message', () => { + compiledDirectiveElement.html().should.containEql('bar'); + }); + }); +});
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/app/shared/directives/customizable-error-message/customizable-error-message.html Wed Aug 16 12:47:29 2017 -0400 @@ -0,0 +1,8 @@ +<div ng-hide="showElement" class="alert alert-warning alert-dismissable" > + <button ng-show="{{dismissible}}" type="button" class="close" data-dismiss="alert" aria-hidden="true" ng-click="showElement=true"> + <span class="pficon pficon-close"></span> + </button> + + <span class="pficon pficon-warning-triangle-o"></span> + <strong>{{errTitle}}</strong> {{errMessage}} +</div>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/app/shared/directives/customizable-error-message/customizable-error-message.module.js Wed Aug 16 12:47:29 2017 -0400 @@ -0,0 +1,32 @@ +/** + * Copyright 2012-2017 Red Hat, Inc. + * + * Thermostat is distributed under the GNU General Public License, + * version 2 or any later version (with a special exception described + * below, commonly known as the "Classpath Exception"). + * + * A copy of GNU General Public License (GPL) is included in this + * distribution, in the file COPYING. + * + * Linking Thermostat code with other modules is making a combined work + * based on Thermostat. Thus, the terms and conditions of the GPL + * cover the whole combination. + * + * As a special exception, the copyright holders of Thermostat give you + * permission to link this code with independent modules to produce an + * executable, regardless of the license terms of these independent + * modules, and to copy and distribute the resulting executable under + * terms of your choice, provided that you also meet, for each linked + * independent module, the terms and conditions of the license of that + * module. An independent module is a module which is not derived from + * or based on Thermostat code. If you modify Thermostat, you may + * extend this exception to your version of the software, but you are + * not obligated to do so. If you do not wish to do so, delete this + * exception statement from your version. + */ + +import directive from './customizable-error-message.directive.js'; + +export default angular + .module('customizableErrorMessageDirective', [directive]) + .name;
--- a/src/app/shared/directives/customizableErrorMessageDirective/customizable-error-message.directive.js Tue Aug 15 17:28:33 2017 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -/** - * Copyright 2012-2017 Red Hat, Inc. - * - * Thermostat is distributed under the GNU General Public License, - * version 2 or any later version (with a special exception described - * below, commonly known as the "Classpath Exception"). - * - * A copy of GNU General Public License (GPL) is included in this - * distribution, in the file COPYING. - * - * Linking Thermostat code with other modules is making a combined work - * based on Thermostat. Thus, the terms and conditions of the GPL - * cover the whole combination. - * - * As a special exception, the copyright holders of Thermostat give you - * permission to link this code with independent modules to produce an - * executable, regardless of the license terms of these independent - * modules, and to copy and distribute the resulting executable under - * terms of your choice, provided that you also meet, for each linked - * independent module, the terms and conditions of the license of that - * module. An independent module is a module which is not derived from - * or based on Thermostat code. If you modify Thermostat, you may - * extend this exception to your version of the software, but you are - * not obligated to do so. If you do not wish to do so, delete this - * exception statement from your version. - */ - -import customizableErrorMessageTemplate from './customizable-error-message.html'; - -export let customizableErrorMessageFunc = () => { - return { - restrict: 'E', - scope: { - errTitle: '<', - errMessage: '<', - dismissible: '<' - }, - template: customizableErrorMessageTemplate - }; -}; - -export default angular - .module('customizableErrorMessage.directive', []) - .directive('customizableErrorMessage', customizableErrorMessageFunc) - .name;
--- a/src/app/shared/directives/customizableErrorMessageDirective/customizable-error-message.directive.spec.js Tue Aug 15 17:28:33 2017 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,93 +0,0 @@ -/** - * Copyright 2012-2017 Red Hat, Inc. - * - * Thermostat is distributed under the GNU General Public License, - * version 2 or any later version (with a special exception described - * below, commonly known as the "Classpath Exception"). - * - * A copy of GNU General Public License (GPL) is included in this - * distribution, in the file COPYING. - * - * Linking Thermostat code with other modules is making a combined work - * based on Thermostat. Thus, the terms and conditions of the GPL - * cover the whole combination. - * - * As a special exception, the copyright holders of Thermostat give you - * permission to link this code with independent modules to produce an - * executable, regardless of the license terms of these independent - * modules, and to copy and distribute the resulting executable under - * terms of your choice, provided that you also meet, for each linked - * independent module, the terms and conditions of the license of that - * module. An independent module is a module which is not derived from - * or based on Thermostat code. If you modify Thermostat, you may - * extend this exception to your version of the software, but you are - * not obligated to do so. If you do not wish to do so, delete this - * exception statement from your version. - */ - -import directiveModule from './customizable-error-message.directive.js'; -import {customizableErrorMessageFunc} from './customizable-error-message.directive.js'; - -describe('customizableErrorMessage Directive', () => { - let compiledDirectiveElement; - let element = '<customizable-error-message err-title=errTitle err-message=errMessage> </customizable-error-message>'; - - beforeEach(angular.mock.module(directiveModule)); - - let initDummyModule = () => { - let compile, rootScope; - angular.mock.inject(($compile, $rootScope) => { - 'ngInject'; - compile = $compile; - rootScope = $rootScope; - }); - - rootScope.errTitle = 'foo'; - rootScope.errMessage = 'bar'; - - compiledDirectiveElement = compile(element)(rootScope); - rootScope.$digest(); - }; - - describe('customizableErrorMessage Directive.function', () => { - it('should return a valid object', () => { - let fnResult = customizableErrorMessageFunc(); - fnResult.should.have.ownProperty('template'); - fnResult.should.have.ownProperty('restrict'); - fnResult.should.have.ownProperty('scope'); - }); - }); - - describe('customizableErrorMessage Directive.content', () => { - beforeEach(initDummyModule); - - it('should be a valid object', () => { - should.exist(compiledDirectiveElement); - }); - - it('should insert the correct error title', () => { - compiledDirectiveElement.html().should.containEql('foo'); - }); - - it('should insert the correct error message', () => { - compiledDirectiveElement.html().should.containEql('bar'); - }); - }); - - describe('customizableErrorMessage Directive.content', () => { - - beforeEach(initDummyModule); - - it('should be a valid object', () => { - should.exist(compiledDirectiveElement); - }); - - it('should insert the correct error title', () => { - compiledDirectiveElement.html().should.containEql('foo'); - }); - - it('should insert the correct error message', () => { - compiledDirectiveElement.html().should.containEql('bar'); - }); - }); -});
--- a/src/app/shared/directives/customizableErrorMessageDirective/customizable-error-message.html Tue Aug 15 17:28:33 2017 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ -<div ng-hide="showElement" class="alert alert-warning alert-dismissable" > - <button ng-show="{{dismissible}}" type="button" class="close" data-dismiss="alert" aria-hidden="true" ng-click="showElement=true"> - <span class="pficon pficon-close"></span> - </button> - - <span class="pficon pficon-warning-triangle-o"></span> - <strong>{{errTitle}}</strong> {{errMessage}} -</div>
--- a/src/app/shared/directives/customizableErrorMessageDirective/customizable-error-message.module.js Tue Aug 15 17:28:33 2017 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -/** - * Copyright 2012-2017 Red Hat, Inc. - * - * Thermostat is distributed under the GNU General Public License, - * version 2 or any later version (with a special exception described - * below, commonly known as the "Classpath Exception"). - * - * A copy of GNU General Public License (GPL) is included in this - * distribution, in the file COPYING. - * - * Linking Thermostat code with other modules is making a combined work - * based on Thermostat. Thus, the terms and conditions of the GPL - * cover the whole combination. - * - * As a special exception, the copyright holders of Thermostat give you - * permission to link this code with independent modules to produce an - * executable, regardless of the license terms of these independent - * modules, and to copy and distribute the resulting executable under - * terms of your choice, provided that you also meet, for each linked - * independent module, the terms and conditions of the license of that - * module. An independent module is a module which is not derived from - * or based on Thermostat code. If you modify Thermostat, you may - * extend this exception to your version of the software, but you are - * not obligated to do so. If you do not wish to do so, delete this - * exception statement from your version. - */ - -import directive from './customizable-error-message.directive.js'; - -export default angular - .module('customizableErrorMessageDirective', [directive]) - .name;