Skip to content

Commit 994dfb4

Browse files
Merge pull request #32 from KonsumGandalf/sim-31
feat: Homepage, About, etc
2 parents 449b65d + 1370ed7 commit 994dfb4

File tree

133 files changed

+1614
-295
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+1614
-295
lines changed

libs/common/domain/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# common-domain
2+
3+
This library was generated with [Nx](https://nx.dev).
4+
5+
## Running unit tests
6+
7+
Run `nx test common-domain` to execute the unit tests.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
const nx = require('@nx/eslint-plugin');
2+
const baseConfig = require('../../../eslint.base.config.cjs');
3+
4+
module.exports = [
5+
...baseConfig,
6+
...nx.configs['flat/angular'],
7+
...nx.configs['flat/angular-template'],
8+
{
9+
files: ['**/*.ts'],
10+
rules: {
11+
'@angular-eslint/directive-selector': [
12+
'error',
13+
{
14+
type: 'attribute',
15+
prefix: 'lib',
16+
style: 'camelCase',
17+
},
18+
],
19+
'@angular-eslint/component-selector': [
20+
'error',
21+
{
22+
type: 'element',
23+
prefix: 'lib',
24+
style: 'kebab-case',
25+
},
26+
],
27+
},
28+
},
29+
{
30+
files: ['**/*.html'],
31+
// Override or add rules here
32+
rules: {},
33+
},
34+
];

libs/common/domain/jest.config.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
export default {
2+
displayName: 'common-domain',
3+
preset: '../../../jest.preset.js',
4+
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
5+
coverageDirectory: '../../../coverage/libs/common/domain',
6+
transform: {
7+
'^.+\\.(ts|mjs|js|html)$': [
8+
'jest-preset-angular',
9+
{
10+
tsconfig: '<rootDir>/tsconfig.spec.json',
11+
stringifyContentPathRegex: '\\.(html|svg)$',
12+
},
13+
],
14+
},
15+
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'],
16+
snapshotSerializers: [
17+
'jest-preset-angular/build/serializers/no-ng-attributes',
18+
'jest-preset-angular/build/serializers/ng-snapshot',
19+
'jest-preset-angular/build/serializers/html-comment',
20+
],
21+
};

libs/common/domain/project.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "common-domain",
3+
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
4+
"sourceRoot": "libs/common/domain/src",
5+
"prefix": "lib",
6+
"projectType": "library",
7+
"tags": ["domain:common", "type:util-feature"],
8+
"targets": {
9+
"test": {
10+
"executor": "@nx/jest:jest",
11+
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
12+
"options": {
13+
"jestConfig": "libs/common/domain/jest.config.ts"
14+
}
15+
},
16+
"lint": {
17+
"executor": "@nx/eslint:lint"
18+
}
19+
}
20+
}

libs/common/domain/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './lib/public-api';
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { HttpClient } from '@angular/common/http';
2+
import { inject, Injectable } from '@angular/core';
3+
import { IMethodRun } from '@simra/common-models';
4+
import { map, Observable } from 'rxjs';
5+
6+
@Injectable({
7+
providedIn: 'root'
8+
})
9+
export class MethodRunService {
10+
private _http = inject(HttpClient);
11+
12+
public getLastMethodRun(methodName: string) {
13+
return this._http.get<IMethodRun | undefined>(`/api/method-run/${methodName}`);
14+
}
15+
16+
public getDateOfLastMethodRun(methodName: string): Observable<Date | undefined> {
17+
return this.getLastMethodRun(methodName).pipe(
18+
map((methodRun) => {
19+
return methodRun?.createdDate;
20+
})
21+
);
22+
}
23+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './method-run.service';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './infrastructure/public-api';
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { setupZoneTestEnv } from 'jest-preset-angular/setup-env/zone';
2+
3+
setupZoneTestEnv({
4+
errorOnUnknownElements: true,
5+
errorOnUnknownProperties: true,
6+
});

libs/common/domain/tsconfig.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es2022",
4+
"forceConsistentCasingInFileNames": true,
5+
"strict": true,
6+
"noImplicitOverride": true,
7+
"noPropertyAccessFromIndexSignature": true,
8+
"noImplicitReturns": true,
9+
"noFallthroughCasesInSwitch": true
10+
},
11+
"files": [],
12+
"include": [],
13+
"references": [
14+
{
15+
"path": "./tsconfig.lib.json"
16+
},
17+
{
18+
"path": "./tsconfig.spec.json"
19+
}
20+
],
21+
"extends": "../../../tsconfig.base.json",
22+
"angularCompilerOptions": {
23+
"enableI18nLegacyMessageIdFormat": false,
24+
"strictInjectionParameters": true,
25+
"strictInputAccessModifiers": true,
26+
"strictTemplates": true
27+
}
28+
}

0 commit comments

Comments
 (0)