Skip to content

Commit

Permalink
Fix/use pia lib v4 (#28)
Browse files Browse the repository at this point in the history
* feat: use pia lib v4 and move generated to shared

* feat: use pia lib v4 and move generated to shared

* feat: exclude search tests
  • Loading branch information
HenryT-CG authored Feb 1, 2024
1 parent 5fa4fe1 commit 0ef5888
Show file tree
Hide file tree
Showing 81 changed files with 311 additions and 825 deletions.
5 changes: 2 additions & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@
"dist/**",
"helm/**",
"node_modules/**",
"src/app/generated/**",
"src/app/api/*",
"src/app/model/*",
"src/app/shared/generated/**",
"src/assets/api/*",
"src/**/*.ico",
"src/**/*.svg"
],
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/create-new-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Create new build

on:
workflow_dispatch:

jobs:
build:
uses: onecx/ci-common/.github/workflows/create-new-build.yml@v1
secrets: inherit
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ README.md
Dockerfile
*.log
*.sh
src/app/generated/**
src/app/shared/generated/**
src/app/api/*
src/app/model/*
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ COPY dist/onecx-product-store-ui/ $DIR_HTML

# Application environments default values
ENV BFF_URL http://onecx-product-store-bff:8080/
ENV APP_BASE_HREF /product-store/
ENV APP_BASE_HREF /

RUN chmod 775 -R "$DIR_HTML"/assets
USER 1001
7 changes: 1 addition & 6 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,7 @@
"assets": ["src/favicon.ico", "src/assets"],
"styles": ["src/styles.scss"],
"scripts": [],
"codeCoverageExclude": [
"**/*.module.ts",
"src/app/test/**",
"src/app/environments/**",
"src/app/generated/**"
]
"codeCoverageExclude": ["**/*.module.ts", "src/app/environments/**", "src/app/shared/generated/**"]
}
},
"lint": {
Expand Down
2 changes: 1 addition & 1 deletion helm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: onecx-product-store-ui
version: 0.0.0
description: OneCX Product Store UI.
description: OneCX Product Store UI
home: https://github.com/onecx/onecx-product-store-ui
keywords:
- product-store
Expand Down
21 changes: 0 additions & 21 deletions helm/microfrontend.json

This file was deleted.

8 changes: 0 additions & 8 deletions helm/permissions.csv

This file was deleted.

14 changes: 0 additions & 14 deletions helm/templates/apm-csv.cm.yaml

This file was deleted.

7 changes: 0 additions & 7 deletions helm/templates/mf-config.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion nginx/locations.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
location @@APP_BASE_HREF {
location @@APP_BASE_HREFbff {
proxy_pass @@BFF_URL;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
Expand Down
46 changes: 23 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"config": {
"openapiYaml": "src/assets/api/product-store-bff-api.yaml",
"openapiOutput": "src/app/generated"
"openapiOutput": "src/app/shared/generated"
},
"scripts": {
"build": "ng build",
Expand Down Expand Up @@ -49,11 +49,11 @@
"@ngneat/falso": "^6.4.0",
"@ngx-translate/core": "^14.0.0",
"@ngx-translate/http-loader": "^7.0.0",
"@onecx/accelerator": "^3.7.1",
"@onecx/integration-interface": "^3.7.1",
"@onecx/keycloak-auth": "^3.7.1",
"@onecx/portal-integration-angular": "^3.7.1",
"@onecx/portal-layout-styles": "^3.7.1",
"@onecx/accelerator": "^4.1.2",
"@onecx/integration-interface": "^4.1.2",
"@onecx/keycloak-auth": "^4.1.2",
"@onecx/portal-integration-angular": "^4.1.2",
"@onecx/portal-layout-styles": "^4.1.2",
"file-saver": "^2.0.5",
"i18n-iso-countries": "^7.6.0",
"ngx-color": "^8.0.3",
Expand Down
4 changes: 2 additions & 2 deletions proxy.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ const bypassFn = function (req, res) {
}

const PROXY_CONFIG = {
'/product-store-bff': {
'/bff': {
target: 'http://onecx-product-store-bff',
secure: false,
pathRewrite: {
'^.*/product-store-bff': ''
'^.*/bff': ''
},
changeOrigin: true,
logLevel: 'debug',
Expand Down
2 changes: 1 addition & 1 deletion sonar-local-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ sonar.testExecutionReportPaths=reports/sonarqube_report.xml
sonar.sourceEncoding=UTF-8
#sonar.sources=src/app
#sonar.working.directory=dist/sonar
sonar.coverage.exclusions=*.ts,*.js,src/*.ts,src/**/*.module.ts,src/environments/*,src/assets/**/*,src/app/generated/**/*,src/app/test/*
sonar.coverage.exclusions=*.ts,*.js,src/*.ts,src/**/*.module.ts,src/environments/*,src/assets/**/*,src/app/shared/generated/**/*
#sonar.exclusions=src/app/generated/**/*
#sonar.cpd.exclusions=
#sonar.tests=src/app
Expand Down
10 changes: 5 additions & 5 deletions src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { TestBed } from '@angular/core/testing'
import { AppComponent } from './app.component'
import { RouterTestingModule } from '@angular/router/testing'
import { NO_ERRORS_SCHEMA } from '@angular/core'

describe('AppComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [RouterTestingModule],
declarations: [AppComponent]
declarations: [AppComponent],
schemas: [NO_ERRORS_SCHEMA]
}).compileComponents()
})

Expand All @@ -16,9 +16,9 @@ describe('AppComponent', () => {
expect(app).toBeTruthy()
})

it(`should have as title 'product-store-ui'`, () => {
it(`should have as title 'onecx-product-store-ui'`, () => {
const fixture = TestBed.createComponent(AppComponent)
const app = fixture.componentInstance
expect(app.title).toEqual('product-store-ui')
expect(app.title).toEqual('onecx-product-store-ui')
})
})
2 changes: 1 addition & 1 deletion src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ import { Component } from '@angular/core'
templateUrl: './app.component.html'
})
export class AppComponent {
title = 'product-store-ui'
title = 'onecx-product-store-ui'
}
64 changes: 45 additions & 19 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,35 +1,61 @@
import { APP_INITIALIZER, CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA, NgModule } from '@angular/core'
import { CommonModule } from '@angular/common'
import { HttpClient, HttpClientModule } from '@angular/common/http'
import { RouterModule, Routes } from '@angular/router'
import { BrowserModule } from '@angular/platform-browser'
import { BrowserAnimationsModule } from '@angular/platform-browser/animations'
import { TranslateService } from '@ngx-translate/core'
import { DialogService } from 'primeng/dynamicdialog'
import { Observable } from 'rxjs'
import { TranslateLoader, TranslateModule, TranslateService } from '@ngx-translate/core'

import { APP_CONFIG, PortalCoreModule } from '@onecx/portal-integration-angular'
import {
APP_CONFIG,
AppStateService,
createTranslateLoader,
translateServiceInitializer,
PortalCoreModule,
UserService
} from '@onecx/portal-integration-angular'
import { KeycloakAuthModule } from '@onecx/keycloak-auth'

import { AppComponent } from './app.component'
import { environment } from '../environments/environment'

// standalone app: ensure translations are loaded during app init
function initializer(translate: TranslateService): () => Observable<any> {
console.log('App module initializer')
return () => {
translate.addLangs(['en', 'de'])
const browserLang = translate.getBrowserLang()
return translate.use(browserLang?.match(/en|de/) ? browserLang : 'en')
}
}
import { environment } from 'src/environments/environment'

const routes: Routes = [{ path: '', pathMatch: 'full' }]
@NgModule({
bootstrap: [AppComponent],
declarations: [AppComponent],
imports: [BrowserModule, KeycloakAuthModule, BrowserAnimationsModule, PortalCoreModule.forRoot('product-store-ui')],
imports: [
CommonModule,
BrowserModule,
HttpClientModule,
KeycloakAuthModule,
BrowserAnimationsModule,
RouterModule.forRoot(routes, {
initialNavigation: 'enabledBlocking',
enableTracing: true
}),
PortalCoreModule.forRoot('onecx-product-store-ui'),
TranslateModule.forRoot({
isolate: true,
loader: {
provide: TranslateLoader,
useFactory: createTranslateLoader,
deps: [HttpClient, AppStateService]
}
})
],
providers: [
DialogService,
{ provide: APP_CONFIG, useValue: environment },
{ provide: APP_INITIALIZER, useFactory: initializer, multi: true, deps: [TranslateService] }
{
provide: APP_INITIALIZER,
useFactory: translateServiceInitializer,
multi: true,
deps: [UserService, TranslateService]
}
],
schemas: [NO_ERRORS_SCHEMA, CUSTOM_ELEMENTS_SCHEMA]
})
export class AppModule {}
export class AppModule {
constructor() {
console.info('App Module constructor')
}
}
Loading

0 comments on commit 0ef5888

Please sign in to comment.