Moves file to the shared directory to make it available for every module.
Also renames the file, because it will be refactored.
Fixes: https://tracker.ceph.com/issues/37916
Signed-off-by: Sebastian Krah <skrah@suse.com>
+++ /dev/null
-import { LogColorPipe } from './log-color.pipe';
-
-describe('LogColorPipe', () => {
- const pipe = new LogColorPipe();
-
- it('create an instance', () => {
- expect(pipe).toBeTruthy();
- });
-
- it('transforms "INF"', () => {
- const value = { priority: '[INF]' };
- expect(pipe.transform(value)).toBe('');
- });
-
- it('transforms "WRN"', () => {
- const value = { priority: '[WRN]' };
- const result = {
- color: '#ffa500',
- 'font-weight': 'bold'
- };
- expect(pipe.transform(value)).toEqual(result);
- });
-
- it('transforms "ERR"', () => {
- const value = { priority: '[ERR]' };
- const result = { color: '#FF2222' };
- expect(pipe.transform(value)).toEqual(result);
- });
-
- it('transforms others', () => {
- const value = { priority: '[foo]' };
- expect(pipe.transform(value)).toBe('');
- });
-});
+++ /dev/null
-import { Pipe, PipeTransform } from '@angular/core';
-
-@Pipe({
- name: 'logColor'
-})
-export class LogColorPipe implements PipeTransform {
- transform(value: any, args?: any): any {
- if (value.priority === '[INF]') {
- return ''; // Inherit
- } else if (value.priority === '[WRN]') {
- return {
- color: '#ffa500',
- 'font-weight': 'bold'
- };
- } else if (value.priority === '[ERR]') {
- return { color: '#FF2222' };
- } else {
- return '';
- }
- }
-}
--- /dev/null
+import { LogColorPipe } from './log-color.pipe';
+
+describe('LogColorPipe', () => {
+ const pipe = new LogColorPipe();
+
+ it('create an instance', () => {
+ expect(pipe).toBeTruthy();
+ });
+
+ it('transforms "INF"', () => {
+ const value = { priority: '[INF]' };
+ expect(pipe.transform(value)).toBe('');
+ });
+
+ it('transforms "WRN"', () => {
+ const value = { priority: '[WRN]' };
+ const result = {
+ color: '#ffa500',
+ 'font-weight': 'bold'
+ };
+ expect(pipe.transform(value)).toEqual(result);
+ });
+
+ it('transforms "ERR"', () => {
+ const value = { priority: '[ERR]' };
+ const result = { color: '#FF2222' };
+ expect(pipe.transform(value)).toEqual(result);
+ });
+
+ it('transforms others', () => {
+ const value = { priority: '[foo]' };
+ expect(pipe.transform(value)).toBe('');
+ });
+});
--- /dev/null
+import { Pipe, PipeTransform } from '@angular/core';
+
+@Pipe({
+ name: 'logColor'
+})
+export class LogColorPipe implements PipeTransform {
+ transform(value: any, args?: any): any {
+ if (value.priority === '[INF]') {
+ return ''; // Inherit
+ } else if (value.priority === '[WRN]') {
+ return {
+ color: '#ffa500',
+ 'font-weight': 'bold'
+ };
+ } else if (value.priority === '[ERR]') {
+ return { color: '#FF2222' };
+ } else {
+ return '';
+ }
+ }
+}