Skip to content

Commit eb9a22a

Browse files
authored
feature: Enable component catalogs (#1) (#2)
1 parent ba44961 commit eb9a22a

93 files changed

Lines changed: 22295 additions & 1 deletion

File tree

Some content is hidden

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

.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Editor configuration, see https://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.ts]
12+
quote_type = single
13+
14+
[*.md]
15+
max_line_length = off
16+
trim_trailing_whitespace = false

.gitignore

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files.
2+
3+
# Compiled output
4+
/dist
5+
/tmp
6+
/out-tsc
7+
/bazel-out
8+
9+
# Node
10+
/node_modules
11+
npm-debug.log
12+
yarn-error.log
13+
14+
# IDEs and editors
15+
.idea/
16+
.project
17+
.classpath
18+
.c9/
19+
*.launch
20+
.settings/
21+
*.sublime-workspace
22+
23+
# Visual Studio Code
24+
.vscode/*
25+
!.vscode/settings.json
26+
!.vscode/tasks.json
27+
!.vscode/launch.json
28+
!.vscode/extensions.json
29+
.history/*
30+
31+
# Miscellaneous
32+
/.angular/cache
33+
.sass-cache/
34+
/connect.lock
35+
/coverage
36+
/libpeerconnection.log
37+
testem.log
38+
/typings
39+
40+
# System files
41+
.DS_Store
42+
Thumbs.db
43+
44+
/build/

.npmrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@boehringer-ingelheim:registry=https://nexus-ods.apps.eu-dev.ocp.aws.boehringer.com/repository/npm-group/
2+
@appshell:registry=https://nexus-ods.apps.eu-dev.ocp.aws.boehringer.com/repository/appshell/
3+
strict-ssl=false
4+
email=no-reply@opendevstack.org

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
repos:
2+
- repo: https://github.com/gitleaks/gitleaks
3+
rev: v8.18.4
4+
hooks:
5+
- id: gitleaks

.vscode/extensions.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846
3+
"recommendations": ["angular.ng-template"]
4+
}

.vscode/launch.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
3+
"version": "0.2.0",
4+
"configurations": [
5+
{
6+
"name": "ng serve",
7+
"type": "chrome",
8+
"request": "launch",
9+
"preLaunchTask": "npm: start",
10+
"url": "http://localhost:4200/"
11+
},
12+
{
13+
"name": "ng test",
14+
"type": "chrome",
15+
"request": "launch",
16+
"preLaunchTask": "npm: test",
17+
"url": "http://localhost:9876/debug.html"
18+
}
19+
]
20+
}

.vscode/tasks.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
// For more information, visit: https://go.microsoft.com/fwlink/?LinkId=733558
3+
"version": "2.0.0",
4+
"tasks": [
5+
{
6+
"type": "npm",
7+
"script": "start",
8+
"isBackground": true,
9+
"problemMatcher": {
10+
"owner": "typescript",
11+
"pattern": "$tsc",
12+
"background": {
13+
"activeOnStart": true,
14+
"beginsPattern": {
15+
"regexp": "(.*?)"
16+
},
17+
"endsPattern": {
18+
"regexp": "bundle generation complete"
19+
}
20+
}
21+
}
22+
},
23+
{
24+
"type": "npm",
25+
"script": "test",
26+
"isBackground": true,
27+
"problemMatcher": {
28+
"owner": "typescript",
29+
"pattern": "$tsc",
30+
"background": {
31+
"activeOnStart": true,
32+
"beginsPattern": {
33+
"regexp": "(.*?)"
34+
},
35+
"endsPattern": {
36+
"regexp": "bundle generation complete"
37+
}
38+
}
39+
}
40+
}
41+
]
42+
}

Jenkinsfile

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// See https://www.opendevstack.org/ods-documentation/ for usage and customization.
2+
3+
@Library('ods-jenkins-shared-library@4.x') _
4+
5+
odsComponentPipeline(
6+
imageStreamTag: 'ods/jenkins-agent-nodejs22:4.x',
7+
branchToEnvironmentMapping: [
8+
'master': 'dev'
9+
],
10+
sonarQubeBranch: '*'
11+
) { context ->
12+
odsComponentFindOpenShiftImageOrElse(context) {
13+
stageBuild(context)
14+
stageUnitTest(context)
15+
odsComponentStageScanWithSonar(context)
16+
odsComponentStageBuildOpenShiftImage(context)
17+
}
18+
odsComponentStageRolloutOpenShiftDeployment(context)
19+
}
20+
21+
def stageBuild(def context) {
22+
stage('Build') {
23+
withEnv(["TAGVERSION=${context.tagversion}", "NEXUS_HOST=${context.nexusHost}"]) {
24+
sh 'npm install'
25+
if ('master'.equals(context.gitBranch)) {
26+
sh 'npm run build'
27+
} else {
28+
sh 'npm run build -- --source-map=true'
29+
}
30+
}
31+
sh "cp -r dist/${context.componentId} docker/dist"
32+
}
33+
}
34+
35+
def stageUnitTest(def context) {
36+
stage('Unit Test') {
37+
sh 'npm run test'
38+
}
39+
}

README.md

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,50 @@
1-
# ods-component-catalogs-front
1+
# AppShell in Angular
2+
3+
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 18.2.1 using the AppShell library (v18.0.1) and Angular Material (v17.0.0).
4+
5+
The AppShell is a framework and foundation to boost the development of modern web applications on the EDP. The framework provides commonly used capabilities in frontend and backend application components.
6+
7+
With the Appshell, we are offering design templates "ready to use" so any platform can optimize the efforts by using our adaptable templates, promoting consistency between platforms but also guaranteeing following the Digital Design System of our company and complying with Web Content Accessibility Guidelines.
8+
9+
## Configuring the local environment
10+
11+
In order for a developer to work locally, the file `proxy.conf.json` needs to be updated to use the proper backend host in the `target` property.
12+
In addition, the `public/config/config.json` needs to be updated accordingly. Using a different azure application if needed and also selecting the catalogId.
13+
The catalogId is the result of encoding the relative route of the catalog definition within the bitbucket host that the backend uses. For example, the current value is for: /projects/DSMC/repos/catalog/browse/Catalog.yaml?at=refs/heads/master. If you need to encode a new value, you can run the following command and then paste the value in the config file:
14+
> echo /projects/DSMC/repos/catalog/browse/Catalog.yaml?at=refs/heads/master | base64 -w 0
15+
16+
If you have the config.json and the proxy.conf.json files properly configured, the application should work without updating anything else.
17+
18+
## Development server
19+
20+
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files.
21+
22+
## Code scaffolding
23+
24+
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
25+
26+
## Build
27+
28+
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.
29+
30+
## Running unit tests
31+
32+
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
33+
34+
## Running end-to-end tests
35+
36+
Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
37+
38+
## Further help
39+
40+
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
41+
42+
## Generate the API client
43+
44+
In order to generate a new client, you can update the contents of the `openapi.yaml` file in the root directory with the latest version of the contract and then execute the script `npm run generate-api-client`
45+
46+
## How to use the AppShell library
47+
48+
For detailed instructions on how to use the AppShell library, including available components, their inputs, outputs, and expected parameters, please refer to our comprehensive guide on Confluence.
49+
50+
[Access the Library Guide](https://confluence.biscrum.com/x/T9rTGw)

angular.json

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"component-catalog-front": {
7+
"projectType": "application",
8+
"schematics": {
9+
"@schematics/angular:component": {
10+
"style": "scss"
11+
}
12+
},
13+
"root": "",
14+
"sourceRoot": "src",
15+
"prefix": "app",
16+
"architect": {
17+
"build": {
18+
"builder": "@angular-devkit/build-angular:application",
19+
"options": {
20+
"outputPath": "dist/component-catalog-front",
21+
"index": "src/index.html",
22+
"stylePreprocessorOptions": {
23+
"includePaths": [
24+
"node_modules/@appshell/ngx-appshell"
25+
]
26+
},
27+
"browser": "src/main.ts",
28+
"polyfills": [
29+
"zone.js"
30+
],
31+
"tsConfig": "tsconfig.app.json",
32+
"inlineStyleLanguage": "scss",
33+
"assets": [
34+
{
35+
"glob": "**/*",
36+
"input": "public"
37+
}
38+
],
39+
"styles": [
40+
"src/styles.scss",
41+
"@boehringer-ingelheim/theme/palette/palette.css"
42+
],
43+
"scripts": []
44+
},
45+
"configurations": {
46+
"production": {
47+
"budgets": [
48+
{
49+
"type": "initial",
50+
"maximumWarning": "2MB",
51+
"maximumError": "4MB"
52+
},
53+
{
54+
"type": "anyComponentStyle",
55+
"maximumWarning": "2kB",
56+
"maximumError": "4kB"
57+
}
58+
],
59+
"outputHashing": "all"
60+
},
61+
"development": {
62+
"optimization": false,
63+
"extractLicenses": false,
64+
"sourceMap": true
65+
}
66+
},
67+
"defaultConfiguration": "production"
68+
},
69+
"serve": {
70+
"builder": "@angular-devkit/build-angular:dev-server",
71+
"configurations": {
72+
"production": {
73+
"buildTarget": "component-catalog-front:build:production"
74+
},
75+
"development": {
76+
"buildTarget": "component-catalog-front:build:development"
77+
}
78+
},
79+
"defaultConfiguration": "development"
80+
},
81+
"lint": {
82+
"builder": "@angular-eslint/builder:lint",
83+
"options": {
84+
"lintFilePatterns": [
85+
"src/**/*.ts",
86+
"src/**/*.html"
87+
]
88+
}
89+
},
90+
"extract-i18n": {
91+
"builder": "@angular-devkit/build-angular:extract-i18n"
92+
},
93+
"test": {
94+
"builder": "@angular-devkit/build-angular:karma",
95+
"options": {
96+
"polyfills": [
97+
"zone.js",
98+
"zone.js/testing"
99+
],
100+
"tsConfig": "tsconfig.spec.json",
101+
"inlineStyleLanguage": "scss",
102+
"assets": [
103+
{
104+
"glob": "**/*",
105+
"input": "public"
106+
}
107+
],
108+
"styles": [],
109+
"scripts": [],
110+
"codeCoverageExclude": ["**/mock-**", "**/openapi/**"],
111+
"karmaConfig": "karma.conf.js"
112+
}
113+
}
114+
}
115+
}
116+
},
117+
"cli": {
118+
"analytics": false
119+
}
120+
}

0 commit comments

Comments
 (0)