Skip to content

Commit

Permalink
added bff (#14)
Browse files Browse the repository at this point in the history
* added bff

* feat: fixed basepath and import/export and indexhtml

* Update index.html

* fix: helm configuration, changed role names and set default port to 4200

* fix: harmonize sonar config

* fix: correct ui test config and import translations

---------

Co-authored-by: Henry Taeschner <[email protected]>
Co-authored-by: Henry Täschner <[email protected]>
  • Loading branch information
3 people authored Jan 9, 2024
1 parent 01d0d07 commit 7ec54cb
Show file tree
Hide file tree
Showing 151 changed files with 2,222 additions and 9,890 deletions.
4 changes: 2 additions & 2 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@
"builder": "ngx-build-plus:dev-server",
"options": {
"browserTarget": "onecx-theme-ui:build",
"port": 5020,
"publicHost": "http://localhost:5020",
"port": 4200,
"publicHost": "http://localhost:4200",
"extraWebpackConfig": "webpack.config.js",
"proxyConfig": "proxy.conf.js"
},
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-theme-ui
version: 0.0.0
description: Onecx theme UI.
description: OneCX Theme UI.
home: https://github.com/onecx/onecx-theme-ui
keywords:
- theme
Expand Down
8 changes: 4 additions & 4 deletions helm/microfrontend.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"id": "THEME_MFE",
"id": "THEME_UI",
{{- if .Values.app.routing.hostName }}
"remoteEntry": "https://{{ .Values.app.routing.hostName }}{{ .Values.app.routing.path }}remoteEntry.js",
{{- else if .Values.global.hostName }}
Expand All @@ -11,11 +11,11 @@
{{- else if .Values.global.hostName }}
"remoteBaseUrl": "https://{{ .Values.global.hostName }}{{ .Values.app.routing.path }}",
{{- end }}
"exposedModule": "./ThemeModule",
"displayName": "ThemeModule",
"exposedModule": "./ThemeMgmtModule",
"displayName": "ThemeMgmtModule",
"moduleType": "ANGULAR",
"wcTagName": "UPMF",
"appVersion": "{{ .Chart.Version }}",
"note": "Theme mgmt module auto import via MF operator",
"note": "Theme Mgmt module auto import via MF operator",
"contact": "[email protected]"
}
2 changes: 1 addition & 1 deletion helm/permissions.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PERMISSION NAME;PERMISSION_KEY;portal-mgmt-admin;portal-mgmt-user;
PERMISSION NAME;PERMISSION_KEY;onecx-theme-admin;onecx-theme-user;
Theme create;THEME#CREATE;x;;
Theme delete;THEME#DELETE;x;;
Theme edit;THEME#EDIT;x;;
Expand Down
22 changes: 15 additions & 7 deletions helm/values.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,34 @@
app:
name: ui
image:
repository: "onecx/onecx-theme-svc"
repository: 'onecx/onecx-theme-ui'
routing:
enabled: true
operator:
apm:
enabled: false
keycloak:
enabled: true
client: "{ \n \"clientId\": \"theme-mgmt-ui\",\n \"enabled\": true,\n \"description\": \"Keycloak client for theme-mgmt-ui\",\n \"redirectUris\": [\"*\"],\n \"webOrigins\": [\"*\"],\n \"publicClient\": true,\n \"protocol\": \"openid-connect\"\n}"
client: |-
{
"clientId": "theme-mgmt-ui",
"enabled": true,
"description": "Keycloak client for theme-mgmt-ui",
"redirectUris": ["*"],
"webOrigins": ["*"],
"publicClient": true,
"protocol": "openid-connect"
}
roles: |-
[
{
"name": "onecx-portal-admin",
"description": "OneCX portal platform admin"
"name": "onecx-theme-admin",
"description": "OneCX Theme admin"
},
{
"name": "onecx-portal-user",
"description": "OneCX portal platform user"
"name": "onecx-theme-user",
"description": "OneCX Theme user"
}
]
# PIPE Config

20 changes: 11 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,34 @@
{
"name": "onecx-theme-ui",
"private": true,
"version": "0.0.0",
"license": "Apache-2.0",
"contributors": [
"OneCX Development Team <[email protected]>"
],
"config": {
"openapiYaml": "src/assets/api/portal-mgmt-api.yaml",
"openapiYaml": "src/assets/api/themes-bff-api.yaml",
"openapiOutput": "src/app/generated"
},
"scripts": {
"build": "ng build",
"clean": "npm cache clean --force",
"clean": "npm cache clean --force && npm run clean-angular",
"clean-angular": "ng cache clean",
"start": "ng serve --configuration=development --proxy-config=proxy.conf.js",
"prepare": "husky install",
"lint": "ng lint",
"eslint": "eslint --ext .js,.ts src",
"eslint": "eslint --quiet --ext .js,.ts src/**",
"format": "ng lint --fix",
"browsers": "npx browserslist",
"sonar": "npx sonarqube-scanner -Dproject.settings=sonar-local-project.properties",
"test": "ng test",
"test:ci": "ng test --watch=false --browsers=ChromeHeadless --code-coverage",
"karma": "rm -rf reports && npm run test:ci",
"sonar": "npx sonarqube-scanner -Dproject.settings=sonar-local-project.properties",
"apigen-cleanup": "rm -rf $npm_package_config_openapiOutput",
"apigen-format": "npx prettier $npm_package_config_openapiYaml --write && npx prettier $npm_package_config_openapiOutput/**/* --write",
"apigen-generate": "openapi-generator-cli generate -i $npm_package_config_openapiYaml -g typescript-angular -c apigen.yaml -o $npm_package_config_openapiOutput --type-mappings AnyType=object",
"apigen-generate": "openapi-generator-cli generate -i $npm_package_config_openapiYaml -g typescript-angular -c apigen.yaml -o $npm_package_config_openapiOutput --type-mappings=AnyType=object,set=Array",
"apigen": "npm run apigen-cleanup && npm run apigen-generate && npm run apigen-format"
},
"private": true,
"husky": {
"hooks": {
"pre-commit": "pretty-quick --staged"
Expand All @@ -38,9 +42,7 @@
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"codeCoverageExclude": [
"src/app/generated/**/*",
"src/app/**/*.spec.ts",
"src/app/test/**/*"
"src/app/generated/**/*"
]
}
},
Expand Down
6 changes: 3 additions & 3 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 = {
'/portal-api': {
target: 'http://tkit-portal-server',
'/themes-bff': {
target: 'http://onecx-theme-bff',
secure: false,
pathRewrite: {
'^.*/portal-api': ''
'^.*/themes-bff': ''
},
changeOrigin: true,
logLevel: 'debug',
Expand Down
122 changes: 22 additions & 100 deletions src/app/generated/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -2,111 +2,33 @@
.openapi-generator-ignore
README.md
api.module.ts
api/adminUserInternal.service.ts
api/api.ts
api/avatarV1.service.ts
api/feedbackV1.service.ts
api/imageV1.service.ts
api/menuItemsInternal.service.ts
api/microfrontendRegistrationInternal.service.ts
api/microfrontendV1.service.ts
api/portalImportRequestV1.service.ts
api/portalInternal.service.ts
api/portalItemsV1.service.ts
api/portalLegacy.service.ts
api/portalV1.service.ts
api/supportTicketV1.service.ts
api/themes.service.ts
api/userInfoV1.service.ts
api/userProfileV1.service.ts
configuration.ts
encoder.ts
git_push.sh
index.ts
model/accountSettingsDTO.ts
model/accountSettingsDTOLayoutAndThemeSettings.ts
model/accountSettingsDTOLocaleAndTimeSettings.ts
model/accountSettingsDTOPrivacySettings.ts
model/accountSettingsDTOv1.ts
model/accountSettingsDTOv1LayoutAndThemeSettings.ts
model/accountSettingsDTOv1LocaleAndTimeSettings.ts
model/accountSettingsDTOv1PrivacySettings.ts
model/colorScheme.ts
model/colorSchemeV1.ts
model/createMicrofrontendDTOv1.ts
model/createPortalDTO.ts
model/createThemeDTO.ts
model/errorResponseDTO.ts
model/feedbackDTOv1.ts
model/imageInfoDTOv1.ts
model/importRequestDTOv1.ts
model/importRequestDTOv1Portal.ts
model/importRequestDTOv1ThemeImportData.ts
model/layoutAndThemeDTO.ts
model/layoutAndThemeDTOv1.ts
model/localeAndTimeSettingsDTO.ts
model/localeAndTimeSettingsDTOv1.ts
model/membershipDTO.ts
model/membershipRolesDTO.ts
model/menuItemDetailsDTO.ts
model/menuItemListDTO.ts
model/menuItemStructureDTO.ts
model/menuItemStructureDTOv1.ts
model/menuItemStructureDtoLegacy.ts
model/menuMode.ts
model/menuModeV1.ts
model/menuStructureListDTO.ts
model/microfrontendDTOv1.ts
model/microfrontendRegistrationDTO.ts
model/microfrontendRegistrationDTOv1.ts
model/microfrontendRegistrationInputDTO.ts
model/microfrontendRegistrationRequestDTO.ts
model/createThemeRequest.ts
model/createThemeResponse.ts
model/eximTheme.ts
model/exportThemeRequest.ts
model/getThemeResponse.ts
model/getThemesResponse.ts
model/importThemeResponse.ts
model/importThemeResponseStatus.ts
model/models.ts
model/moduleTypeV1.ts
model/permissionDTO.ts
model/portalAddressDTO.ts
model/portalAddressDTOv1.ts
model/portalDTO.ts
model/portalDTOv1.ts
model/portalIdentifierDTO.ts
model/portalIdentifierDTOv1.ts
model/portalImportDTOv1.ts
model/portalMenuItemDTO.ts
model/portalMenuItemDTOv1.ts
model/portalSearchCriteriaDTO.ts
model/preferencesDTO.ts
model/preferencesDTOv1.ts
model/privacySettingsDTO.ts
model/privacySettingsDTOv1.ts
model/resetPasswordDTOv1.ts
model/restException.ts
model/restExceptionDTO.ts
model/scope.ts
model/scopeV1.ts
model/searchItemDTOv1.ts
model/searchItemTypeV1.ts
model/searchTemplateDTOv1.ts
model/searchTemplateSearchCriteria.ts
model/status.ts
model/subjectLinkDTO.ts
model/subjectLinkDTOv1.ts
model/supportTicketDTOv1.ts
model/themeDTO.ts
model/themeDTOv1.ts
model/updateMicrofrontend200Response.ts
model/updateMicrofrontendDTOv1.ts
model/updatePortalDTO.ts
model/updateThemeDTO.ts
model/userInfoDTOv1.ts
model/userPersonAddressDTO.ts
model/userPersonAddressDTOv1.ts
model/userPersonDTO.ts
model/userPersonDTOv1.ts
model/userPersonPhoneDTO.ts
model/userPersonPhoneDTOv1.ts
model/userProfileDTO.ts
model/userProfileDTOAccountSettings.ts
model/userProfileDTOv1.ts
model/userProfileDTOv1AccountSettings.ts
model/userProfileDTOv1Avatar.ts
model/pagingResponse.ts
model/problemDetailInvalidParam.ts
model/problemDetailParam.ts
model/problemDetailResponse.ts
model/searchThemeRequest.ts
model/searchThemeResponse.ts
model/theme.ts
model/themeSnapshot.ts
model/themeUpdateCreate.ts
model/updateThemeRequest.ts
model/updateThemeResponse.ts
model/validationConstraint.ts
model/workspace.ts
param.ts
variables.ts
2 changes: 1 addition & 1 deletion src/app/generated/.openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.0.1
7.2.0
Loading

0 comments on commit 7ec54cb

Please sign in to comment.