Skip to content

Commit

Permalink
fix: initial module setup
Browse files Browse the repository at this point in the history
  • Loading branch information
HenryT-CG committed Jan 10, 2024
1 parent e83b47e commit d649f2f
Show file tree
Hide file tree
Showing 46 changed files with 3,949 additions and 6,510 deletions.
16 changes: 7 additions & 9 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
/node_modules

# IDEs and editors
.vscode/
/.idea
.project
.classpath
Expand All @@ -25,14 +24,13 @@
!.vscode/extensions.json

# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
testem.log
/typings
yarn-error.log
.sass-cache
.gitlab*
.scannerwork
connect.lock
reports
typings
*.log

# e2e
/e2e/*.js
Expand Down
12 changes: 8 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@
"ignorePatterns": [
".angular/**",
".husky/**",
"coverage/**",
".github/**",
".scannerwork/**",
"reports/**",
"dist/**",
"helm/**",
"node_modules/**",
"src/app/generated/**",
"src/app/api/*",
"src/app/model/*"
"src/app/model/*",
"src/**/*.ico",
"src/**/*.svg"
],
"overrides": [
{
Expand All @@ -35,15 +39,15 @@
"error",
{
"type": "attribute",
"prefix": "app",
"prefix": "ps",
"style": "camelCase"
}
],
"@angular-eslint/component-selector": [
"warn",
{
"type": "element",
"prefix": "app",
"prefix": "ps",
"style": "kebab-case"
}
],
Expand Down
13 changes: 13 additions & 0 deletions .github/changelog.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
sections:
- title: Major changes
labels:
- "release/super-feature"
- title: Complete changelog
labels:
- "bug"
- "enhancement"
- "dependencies"
template: |
{{ range $section := .Sections }}{{ if $section.Items }}### {{ $section.GetTitle }}{{ range $item := $section.Items }}
* [#{{ $item.GetID }}]({{ $item.GetURL }}) - {{ $item.GetTitle }}{{ end }}{{ end }}
{{ end }}
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: npm
directory: "/"
schedule:
interval: daily
labels:
- dependencies
15 changes: 15 additions & 0 deletions .github/workflows/build-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Build Feature Branch

on:
workflow_dispatch:
push:
branches:
- '**'
- '!main'
- '!fix/[0-9]+.[0-9]+.x'

jobs:
branch:
uses: onecx/ci-angular/.github/workflows/build-branch.yml@v1
secrets: inherit

9 changes: 9 additions & 0 deletions .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Build Pull Request

on:
pull_request:

jobs:
pr:
uses: onecx/ci-angular/.github/workflows/build-pr.yml@v1
secrets: inherit
9 changes: 9 additions & 0 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Build Release
on:
push:
tags:
- '**'
jobs:
release:
uses: onecx/ci-angular/.github/workflows/build-release.yml@v1
secrets: inherit
21 changes: 21 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Build

on:
workflow_dispatch:
push:
branches:
- 'main'
- 'fix/[0-9]+.[0-9]+.x'
paths-ignore:
- '.gitignore'
- 'CODEOWNERS'
- 'LICENSE'
- '*.md'
- '*.adoc'
- '*.txt'
- '.all-contributorsrc'

jobs:
build:
uses: onecx/ci-angular/.github/workflows/build.yml@v1
secrets: inherit
8 changes: 8 additions & 0 deletions .github/workflows/create-fix-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: Create Fix Branch
on:
workflow_dispatch:
jobs:
fix:
uses: onecx/ci-common/.github/workflows/create-fix-branch.yml@v1
secrets: inherit

7 changes: 7 additions & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: Create Release Version
on:
workflow_dispatch:
jobs:
release:
uses: onecx/ci-common/.github/workflows/create-release.yml@v1
secrets: inherit
17 changes: 17 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Update documentation
on:
push:
branches: [ main ]
paths:
- 'docs/**'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Trigger website update
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.CI_PAT }}
repository: onecx/docs
event-type: dispatch-build-website
12 changes: 12 additions & 0 deletions .github/workflows/sonar-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Sonar Pull Request

on:
workflow_run:
workflows: ["Build Pull Request"]
types:
- completed

jobs:
pr:
uses: onecx/ci-angular/.github/workflows/angular-pr-sonar.yml@v1
secrets: inherit
15 changes: 8 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ chrome-profiler-events*.json
speed-measure-plugin*.json

# IDEs and editors
/.idea
.idea
.project
.classpath
.c9/
Expand All @@ -32,12 +32,13 @@ speed-measure-plugin*.json
.history/*

# misc
/.angular/cache
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
/typings
.angular/cache
.sass-cache
.gitlab*
.scannerwork
connect.lock
reports
typings
*.log
*.sh

Expand Down
5 changes: 4 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
.angular/**
.husky/**
.docusaurus/
.github/**
.scannerwork/
.prettierignore
coverage/**
.browserslistrc
dist/**
helm/**
nginx/**
reports/**
node_modules
CHANGELOG.md
README.md
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ FROM harbor.1000kit.org/1000kit/spa-base:v1
# Copy applicaiton build
COPY nginx/locations.conf $DIR_LOCATION/locations.conf
# Copy applicaiton build
COPY dist/theme-mgmt-ui/ $DIR_HTML
COPY dist/product-store-ui/ $DIR_HTML

#Optional extend list of application environments
#ENV CONFIG_ENV_LIST BFF_URL,APP_BASE_HREF
# Application environments default values
ENV BFF_URL http://tkit-menu-management-bff:8080/
ENV APP_BASE_HREF /theme-mgmt/
ENV APP_BASE_HREF /product-store/

RUN chmod 775 -R $DIR_HTML/assets
USER 1001
12 changes: 6 additions & 6 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
"onecx-product-store-ui": {
"projectType": "application",
"schematics": {},
"root": "./",
"root": "",
"sourceRoot": "src",
"prefix": "app",
"prefix": "ps",
"architect": {
"build": {
"builder": "ngx-build-plus:browser",
"options": {
"preserveSymlinks": true,
"outputPath": "dist",
"outputPath": "dist/onecx-product-store-ui",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
Expand Down Expand Up @@ -67,7 +67,6 @@
"with": "src/environments/environment.prod.ts"
}
],
"outputHashing": "all",
"extraWebpackConfig": "webpack.prod.config.js"
}
},
Expand Down Expand Up @@ -108,13 +107,14 @@
"karmaConfig": "karma.conf.js",
"assets": ["src/favicon.ico", "src/assets"],
"styles": ["src/styles.scss"],
"scripts": []
"scripts": [],
"codeCoverageExclude": ["src/app/test/**", "src/app/generated/**"]
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": ["**/*.ts", "**/*.js", "src/**/*.html"]
"lintFilePatterns": ["**/*.ts", "**/*.js", "**/*.html"]
}
}
}
Expand Down
22 changes: 8 additions & 14 deletions helm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
apiVersion: v2
name: theme-mgmt-ui
version: ${project.version}
description: Helm chart for theme-mgmt-ui deployment.
home: https://gitlab.com/1000kit/apps/tkit-portal/portal-theme-ui
name: onecx-product-store-ui
version: 0.0.0
description: OneCX Product Store UI.
home: https://github.com/onecx/onecx-product-store-ui
keywords:
- onecx
- portal
- 1000kit
- menu
- microfrontend
- product-store
sources:
- https://gitlab.com/1000kit/apps/tkit-portal/portal-theme-ui.git
- https://github.com/onecx/onecx-product-store-ui
maintainers:
- name: OneCX Developer Team
email: [email protected]
dependencies:
# https://gitlab.com/1000kit/infra/helm/angular.git
- name: angular
- name: helm-angular-app
version: ^0
repository: https://harbor.1000kit.org/chartrepo/1000kit/
# repository: file:///home/mat/projects/tkit/helm/angular
repository: oci://ghcr.io/onecx/charts
alias: app
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": "ONECX_PRODUCT_STORE_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": "./ProductStoreMgmtModule",
"displayName": "ProductStoreMgmtModule",
"moduleType": "ANGULAR",
"wcTagName": "UPMF",
"appVersion": "{{ .Chart.Version }}",
"note": "Theme mgmt module auto import via MF operator",
"note": "Product Store module auto import via MF operator",
"contact": "[email protected]"
}
17 changes: 8 additions & 9 deletions helm/permissions.csv
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
PERMISSION NAME;PERMISSION_KEY;portal-mgmt-admin;portal-mgmt-user;
Theme create;THEME#CREATE;x;;
Theme delete;THEME#DELETE;x;;
Theme edit;THEME#EDIT;x;;
Theme save;THEME#SAVE;x;;
Theme import;THEME#IMPORT;x;;
Theme export;THEME#EXPORT;x;;
Theme detail page;THEME#VIEW;x;x;
Theme search page;THEME#SEARCH;x;x;
PERMISSION NAME;PERMISSION_KEY;onecx-product-store-admin;onecx-product-store-user
View Product Store;PRODUCT_STORE#VIEW;x;x
View/Search Products in Product Store;PRODUCT#SEARCH;x;x
View Product Details in Product Store;PRODUCT#VIEW;x;x
Edit Product Details in Product Store;PRODUCT#EDIT;x;
Delete Products in Product Store;PRODUCT#DELETE;x;
Edit Microfrontends;MICROFRONTEND#EDIT;x;
Delete Microfrontends;MICROFRONTEND#DELETE;x;
2 changes: 1 addition & 1 deletion helm/templates/mf-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: 'theme-mgmt-ui-mf-config'
name: 'product-store-mgmt-ui-mf-config'
data:
microfrontend: |-
{{ tpl (.Files.Get "microfrontend.json") . | indent 4 }}
Loading

0 comments on commit d649f2f

Please sign in to comment.