Skip to content

Commit bd41e69

Browse files
authored
feat(agora): migration About and related components (AG-1545) (#2837)
1 parent 5632759 commit bd41e69

Some content is hidden

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

67 files changed

+1590
-160
lines changed

apps/agora/app/src/app/app.routes.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import { Route } from '@angular/router';
22

33
export const routes: Route[] = [
4+
{
5+
path: 'about',
6+
loadChildren: () => import('@sagebionetworks/agora/about').then((routes) => routes.routes),
7+
},
48
{
59
path: 'not-found',
610
loadChildren: () => import('@sagebionetworks/agora/not-found').then((routes) => routes.routes),

apps/agora/app/src/test-setup.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
// @ts-expect-error https://thymikee.github.io/jest-preset-angular/docs/getting-started/test-environment
2-
import 'jest-preset-angular/setup-jest';
32
globalThis.ngJest = {
43
testEnvironmentOptions: {
54
errorOnUnknownElements: true,
65
errorOnUnknownProperties: true,
76
},
87
};
8+
9+
import 'jest-preset-angular/setup-jest';

jest.config.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
const { getJestProjects } = require('@nx/jest');
1+
import { getJestProjectsAsync } from '@nx/jest';
22

3-
export default {
4-
projects: getJestProjects(),
5-
};
3+
export default async () => ({
4+
projects: await getJestProjectsAsync(),
5+
});

libs/agora/about/.eslintrc.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"extends": ["../../../.eslintrc.json"],
3+
"ignorePatterns": ["!**/*"],
4+
"env": {
5+
"jest": true
6+
},
7+
"overrides": [
8+
{
9+
"files": ["*.ts"],
10+
"extends": [
11+
"plugin:@nx/angular",
12+
"plugin:@angular-eslint/template/process-inline-templates",
13+
"plugin:jest/recommended"
14+
],
15+
"rules": {
16+
"@angular-eslint/directive-selector": [
17+
"error",
18+
{
19+
"type": "attribute",
20+
"prefix": "agora",
21+
"style": "camelCase"
22+
}
23+
],
24+
"@angular-eslint/component-selector": [
25+
"error",
26+
{
27+
"type": "element",
28+
"prefix": "agora",
29+
"style": "kebab-case"
30+
}
31+
]
32+
}
33+
},
34+
{
35+
"files": ["*.html"],
36+
"extends": ["plugin:@nx/angular-template"],
37+
"rules": {}
38+
}
39+
]
40+
}

libs/agora/about/.hintrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": ["../../../.hintrc"]
3+
}

libs/agora/about/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# agora-about
2+
3+
This library was generated with [Nx](https://nx.dev).
4+
5+
## Running unit tests
6+
7+
Run `nx test agora-about` to execute the unit tests.

libs/agora/about/jest.config.ts

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

libs/agora/about/project.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"name": "agora-about",
3+
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
4+
"projectType": "library",
5+
"sourceRoot": "libs/agora/about/src",
6+
"prefix": "agora",
7+
"targets": {
8+
"test": {
9+
"executor": "@nx/jest:jest",
10+
"outputs": ["{workspaceRoot}/coverage/libs/agora/about"],
11+
"options": {
12+
"jestConfig": "libs/agora/about/jest.config.ts"
13+
}
14+
},
15+
"lint": {
16+
"executor": "@nx/eslint:lint"
17+
},
18+
"lint-fix": {
19+
"executor": "@nx/eslint:lint",
20+
"options": {
21+
"fix": true
22+
}
23+
},
24+
"lint-html": {
25+
"executor": "nx:run-commands",
26+
"options": {
27+
"commands": ["hint src/**/*.html"],
28+
"cwd": "libs/agora/about",
29+
"parallel": false
30+
}
31+
}
32+
},
33+
"tags": ["type:feature", "scope:agora", "language:typescript"],
34+
"implicitDependencies": []
35+
}

libs/agora/about/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './lib/about.routes';
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<div class="section section-hero">
2+
<div class="section-inner">
3+
<div class="container-sm">
4+
<h1 class="h2">About</h1>
5+
</div>
6+
</div>
7+
</div>
8+
9+
<div class="section">
10+
<div class="section-inner">
11+
<div class="container-sm">
12+
<agora-wiki [wikiId]="wikiId" [className]="className"></agora-wiki>
13+
</div>
14+
</div>
15+
</div>

0 commit comments

Comments
 (0)