-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
07a7475
commit e9397ab
Showing
28 changed files
with
428 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export const rendererAppPort = 4200; | ||
export const rendererAppName = 'servicebus-browser'; // options.name.split('-')[0] + '-web' | ||
export const electronAppName = 'servicebus-browser'; | ||
export const rendererAppName = 'Servicebus Browser'; // options.name.split('-')[0] + '-web' | ||
export const electronAppName = 'Servicebus Browser'; | ||
export const updateServerUrl = 'https://deployment-server-url.com'; // TODO: insert your update server url here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# @service-bus-browser/logs-components | ||
|
||
This library was generated with [Nx](https://nx.dev). | ||
|
||
## Running unit tests | ||
|
||
Run `nx test @service-bus-browser/logs-components` to execute the unit tests. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
const nx = require('@nx/eslint-plugin'); | ||
const baseConfig = require('../../../eslint.config.js'); | ||
|
||
module.exports = [ | ||
...baseConfig, | ||
...nx.configs['flat/angular'], | ||
...nx.configs['flat/angular-template'], | ||
{ | ||
files: ['**/*.ts'], | ||
rules: { | ||
'@angular-eslint/directive-selector': [ | ||
'error', | ||
{ | ||
type: 'attribute', | ||
prefix: 'sbb-logs', | ||
style: 'camelCase', | ||
}, | ||
], | ||
'@angular-eslint/component-selector': [ | ||
'error', | ||
{ | ||
type: 'element', | ||
prefix: 'sbb-logs', | ||
style: 'kebab-case', | ||
}, | ||
], | ||
}, | ||
}, | ||
{ | ||
files: ['**/*.html'], | ||
// Override or add rules here | ||
rules: {}, | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
export default { | ||
displayName: '@service-bus-browser/logs-components', | ||
preset: '../../../jest.preset.js', | ||
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'], | ||
coverageDirectory: '../../../coverage/libs/logs/components', | ||
transform: { | ||
'^.+\\.(ts|mjs|js|html)$': [ | ||
'jest-preset-angular', | ||
{ | ||
tsconfig: '<rootDir>/tsconfig.spec.json', | ||
stringifyContentPathRegex: '\\.(html|svg)$', | ||
}, | ||
], | ||
}, | ||
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'], | ||
snapshotSerializers: [ | ||
'jest-preset-angular/build/serializers/no-ng-attributes', | ||
'jest-preset-angular/build/serializers/ng-snapshot', | ||
'jest-preset-angular/build/serializers/html-comment', | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "@service-bus-browser/logs-components", | ||
"$schema": "../../../node_modules/nx/schemas/project-schema.json", | ||
"sourceRoot": "libs/logs/components/src", | ||
"prefix": "sbb-logs", | ||
"projectType": "library", | ||
"tags": [], | ||
"targets": { | ||
"test": { | ||
"executor": "@nx/jest:jest", | ||
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"], | ||
"options": { | ||
"jestConfig": "libs/logs/components/jest.config.ts" | ||
} | ||
}, | ||
"lint": { | ||
"executor": "@nx/eslint:lint" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './lib/logs-list/logs-list.component' |
3 changes: 3 additions & 0 deletions
3
libs/logs/components/src/lib/log-line/log-line.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<pre | ||
[style.--color]="logLineColor()" | ||
>{{logLine().loggedAt | date:'YYYY-MM-dd HH:mm:ss' }} - {{logLine().severity}}: {{logLine().message}}</pre> |
7 changes: 7 additions & 0 deletions
7
libs/logs/components/src/lib/log-line/log-line.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
pre { | ||
--color: 'inherit'; | ||
margin: 0; | ||
font-size: 12px; | ||
padding: 4px 1rem; | ||
color: var(--color); | ||
} |
28 changes: 28 additions & 0 deletions
28
libs/logs/components/src/lib/log-line/log-line.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { Component, input, computed } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { LogLine } from '@service-bus-browser/logs-contracts'; | ||
|
||
@Component({ | ||
selector: 'sbb-logs-log-line', | ||
imports: [CommonModule], | ||
templateUrl: './log-line.component.html', | ||
styleUrl: './log-line.component.scss', | ||
}) | ||
export class LogLineComponent { | ||
logLine = input.required<LogLine>(); | ||
logLineColor = computed<string>(() => { | ||
const logLevel = this.logLine().severity; | ||
switch (logLevel) { | ||
case 'info': | ||
return 'var(--p-blue-400)'; | ||
case 'warn': | ||
return 'var(--p-amber-500)'; | ||
case 'error': | ||
return 'var(--p-red-400)'; | ||
case 'critical': | ||
return 'var(--p-red-900)'; | ||
default: | ||
return 'var(--p-slate-400)'; | ||
} | ||
}); | ||
} |
9 changes: 9 additions & 0 deletions
9
libs/logs/components/src/lib/logs-list/logs-list.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<p-virtual-scroller | ||
[items]="logs()" | ||
[itemSize]="20" | ||
scrollHeight="20rem" | ||
> | ||
<ng-template #item let-item let-options="options"> | ||
<sbb-logs-log-line [logLine]="item" [ngClass]="{'odd': options.index % 2 === 1}"></sbb-logs-log-line> | ||
</ng-template> | ||
</p-virtual-scroller> |
8 changes: 8 additions & 0 deletions
8
libs/logs/components/src/lib/logs-list/logs-list.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
sbb-logs-log-line { | ||
display: block; | ||
height: 20px; | ||
|
||
&.odd { | ||
background: var(--p-surface-100); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
libs/logs/components/src/lib/logs-list/logs-list.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Component, input } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { LogLine } from '@service-bus-browser/logs-contracts'; | ||
import { Scroller } from 'primeng/scroller'; | ||
import { LogLineComponent } from '../log-line/log-line.component'; | ||
|
||
@Component({ | ||
selector: 'sbb-logs-list', | ||
imports: [CommonModule, Scroller, LogLineComponent], | ||
templateUrl: './logs-list.component.html', | ||
styleUrl: './logs-list.component.scss', | ||
}) | ||
export class LogsListComponent { | ||
logs = input.required<LogLine[]>(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { setupZoneTestEnv } from 'jest-preset-angular/setup-env/zone'; | ||
|
||
setupZoneTestEnv({ | ||
errorOnUnknownElements: true, | ||
errorOnUnknownProperties: true, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es2022", | ||
"forceConsistentCasingInFileNames": true, | ||
"strict": true, | ||
"noImplicitOverride": true, | ||
"noPropertyAccessFromIndexSignature": true, | ||
"noImplicitReturns": true, | ||
"noFallthroughCasesInSwitch": true | ||
}, | ||
"files": [], | ||
"include": [], | ||
"references": [ | ||
{ | ||
"path": "./tsconfig.lib.json" | ||
}, | ||
{ | ||
"path": "./tsconfig.spec.json" | ||
} | ||
], | ||
"extends": "../../../tsconfig.base.json", | ||
"angularCompilerOptions": { | ||
"enableI18nLegacyMessageIdFormat": false, | ||
"strictInjectionParameters": true, | ||
"strictInputAccessModifiers": true, | ||
"strictTemplates": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"outDir": "../../../dist/out-tsc", | ||
"declaration": true, | ||
"declarationMap": true, | ||
"inlineSources": true, | ||
"types": [] | ||
}, | ||
"exclude": [ | ||
"src/**/*.spec.ts", | ||
"src/test-setup.ts", | ||
"jest.config.ts", | ||
"src/**/*.test.ts" | ||
], | ||
"include": ["src/**/*.ts"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"outDir": "../../../dist/out-tsc", | ||
"module": "commonjs", | ||
"target": "es2016", | ||
"types": ["jest", "node"] | ||
}, | ||
"files": ["src/test-setup.ts"], | ||
"include": [ | ||
"jest.config.ts", | ||
"src/**/*.test.ts", | ||
"src/**/*.spec.ts", | ||
"src/**/*.d.ts" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,15 @@ | ||
import { EnvironmentProviders, Provider } from '@angular/core'; | ||
import { provideState } from '@ngrx/store'; | ||
import { logsFeature } from './lib/logs.store'; | ||
|
||
export * as LogsActions from './lib/logs.actions'; | ||
export * as LogsSelectors from './lib/logs.selectors'; | ||
|
||
export function provideLogsState(): ( | ||
| Provider | ||
| EnvironmentProviders | ||
)[] { | ||
return [ | ||
provideState(logsFeature), | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
import { createFeatureSelector } from '@ngrx/store'; | ||
import { createFeatureSelector, createSelector } from '@ngrx/store'; | ||
import { featureKey, LogsState } from './logs.store'; | ||
|
||
const featureSelector = createFeatureSelector<LogsState>(featureKey); | ||
|
||
export const selectLogs = featureSelector; | ||
export const selectLogs = createSelector( | ||
featureSelector, | ||
(state) => state.logs | ||
) |
Oops, something went wrong.