diff --git a/.github/workflows/docker-prerelease-ui.yml b/.github/workflows/docker-prerelease-ui.yml new file mode 100644 index 00000000..ca8bdd80 --- /dev/null +++ b/.github/workflows/docker-prerelease-ui.yml @@ -0,0 +1,49 @@ +name: Build and Push Docker Images on PR Merge + +on: + push: + branches: + - main + paths: + - 'aas-web-ui/**' + +jobs: + build-and-push-prerelease: + runs-on: ubuntu-latest + + steps: + # Step 1: Checkout the repository + - name: Checkout Code + uses: actions/checkout@v4 + + # Step 2: Set up Docker Buildx + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: linux/amd64,linux/arm64,linux/arm/v7 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + # Step 3: Log in to Docker Hub + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_HUB_USER }} + password: ${{ secrets.DOCKER_HUB_TOKEN }} + + # Step 4: Build and Push Docker Image with Fixed Pre-release Tag + - name: Build and Push Docker Image (Pre-release) + uses: docker/build-push-action@v6 + with: + context: ./aas-web-ui + file: ./aas-web-ui/Dockerfile + push: true + platforms: linux/amd64,linux/arm64,linux/arm/v7 + tags: | + eclipsebasyx/aas-gui:SNAPSHOT + + # Step 5: Verify the Push + - name: Verify Docker Image + run: | + docker pull eclipsebasyx/aas-gui:SNAPSHOT diff --git a/.github/workflows/docker-release-ui.yml b/.github/workflows/docker-release-ui.yml new file mode 100644 index 00000000..8a83beca --- /dev/null +++ b/.github/workflows/docker-release-ui.yml @@ -0,0 +1,56 @@ +name: Build and Push Docker Images on Release + +on: + release: + types: [published] + +jobs: + build-and-push-release: + runs-on: ubuntu-latest + + steps: + # Step 1: Checkout the repository + - name: Checkout Code + uses: actions/checkout@v4 + + # Step 2: Set up Docker Buildx + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: linux/amd64,linux/arm64,linux/arm/v7 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + # Step 3: Log in to Docker Hub + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_HUB_USER }} + password: ${{ secrets.DOCKER_HUB_TOKEN }} + + # Step 4: Extract Release Tag as Date + - name: Extract Release Tag + id: extract_tag + run: | + # Assuming the release tag is in yymmdd format + TAG_NAME=${GITHUB_REF#refs/tags/} + echo "TAG_NAME=${TAG_NAME}" >> $GITHUB_ENV + + # Step 5: Build and Push Docker Images + - name: Build and Push Docker Images + uses: docker/build-push-action@v6 + with: + context: ./aas-web-ui + file: ./aas-web-ui/Dockerfile + push: true + platforms: linux/amd64,linux/arm64,linux/arm/v7 + tags: | + eclipsebasyx/aas-gui:${{ env.TAG_NAME }} + eclipsebasyx/aas-gui:latest + + # Step 6: Verify the Push + - name: Verify Docker Images + run: | + docker pull eclipsebasyx/aas-gui:${{ env.TAG_NAME }} + docker pull eclipsebasyx/aas-gui:latest diff --git a/aas-web-ui/.gitignore b/aas-web-ui/.gitignore index f19186b5..18148f3f 100644 --- a/aas-web-ui/.gitignore +++ b/aas-web-ui/.gitignore @@ -19,4 +19,7 @@ pnpm-debug.log* *.ntvs* *.njsproj *.sln -*.sw? \ No newline at end of file +*.sw? + +# coverages +/coverage \ No newline at end of file diff --git a/aas-web-ui/package.json b/aas-web-ui/package.json index dbff155f..9c4db570 100644 --- a/aas-web-ui/package.json +++ b/aas-web-ui/package.json @@ -6,10 +6,15 @@ "license": "MIT", "scripts": { "dev": "vite", - "build": "vue-tsc --noEmit && vite build", + "prebuild": "vitest run && vue-tsc --noEmit", + "build": "vite build", "preview": "vite preview", "lint:check": "eslint ./", - "lint:fix": "eslint --fix ./" + "lint:fix": "eslint --fix ./", + "test": "vitest", + "test:watch": "vitest --watch", + "test:coverage": "vitest run --coverage", + "test:ui": "vitest --ui" }, "dependencies": { "@fontsource/roboto": "^5.0.14", @@ -25,35 +30,41 @@ "roboto-fontface": "*", "three": "^0.169.0", "uuid": "^10.0.0", - "vue": "^3.5.12", - "vue-router": "^4.4.5", + "vue": "^3.5.13", + "vue-router": "^4.5.0", "vue3-apexcharts": "^1.7.0", "vuetify": "^3.7.4", "webfontloader": "^1.0.0" }, "devDependencies": { "@eslint/js": "^9.13.0", + "@testing-library/vue": "^8.1.0", "@types/eslint__js": "^8.42.3", "@types/leaflet": "^1.9.13", - "@types/lodash": "^4.17.7", + "@types/lodash": "^4.17.13", "@types/md5": "^2.3.5", "@types/node": "^22.8.7", "@types/three": "^0.169.0", "@types/uuid": "^10.0.0", "@types/webfontloader": "^1.6.38", "@vitejs/plugin-vue": "^5.1.4", + "@vitest/coverage-istanbul": "2.1.8", + "@vitest/ui": "^2.1.8", + "@vue/test-utils": "^2.4.6", "eslint": "^9.11.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-prettier": "^5.2.1", "eslint-plugin-promise": "^7.1.0", "eslint-plugin-simple-import-sort": "^12.1.1", - "eslint-plugin-vue": "^9.28.0", + "eslint-plugin-vue": "^9.32.0", + "jsdom": "^25.0.1", "prettier": "^3.3.3", "sass": "^1.79.4", "typescript": "^5.5.4", - "typescript-eslint": "^8.8.1", - "vite": "^5.4.10", + "typescript-eslint": "^8.15.0", + "vite": "^5.4.11", "vite-plugin-vuetify": "^2.0.4", + "vitest": "^2.1.8", "vue-tsc": "^2.1.4" } } diff --git a/aas-web-ui/src/components/Dashboard/Dashboard.vue b/aas-web-ui/src/components/Dashboard/Dashboard.vue index e22d7464..7085d678 100644 --- a/aas-web-ui/src/components/Dashboard/Dashboard.vue +++ b/aas-web-ui/src/components/Dashboard/Dashboard.vue @@ -33,13 +33,10 @@ {{ 'Are you sure?' }} -
+
+ Careful! You are about to delete the whole + {{ selectedGroup.groupName }} ' Dashboard. +
Type the Dashboard Name to proceed.
-
{{ 'Bills of Material:' }}
+
+ {{ nameToDisplay(submodelElementData, 'Bills of Material') }} +
+ + {{ descriptionToDisplay(submodelElementData) }} +
diff --git a/aas-web-ui/src/components/Plugins/Submodels/ContactInformation.vue b/aas-web-ui/src/components/Plugins/Submodels/ContactInformation.vue index 16b72e94..6110175d 100644 --- a/aas-web-ui/src/components/Plugins/Submodels/ContactInformation.vue +++ b/aas-web-ui/src/components/Plugins/Submodels/ContactInformation.vue @@ -3,8 +3,13 @@ -
{{ 'Contact Information:' }}
+
+ {{ nameToDisplay(submodelElementData, 'Contact Information') }} +
+ + {{ descriptionToDisplay(submodelElementData) }} +
diff --git a/aas-web-ui/src/components/Plugins/Submodels/DigitalNameplate.vue b/aas-web-ui/src/components/Plugins/Submodels/DigitalNameplate.vue index 00c36de7..69f4ba05 100644 --- a/aas-web-ui/src/components/Plugins/Submodels/DigitalNameplate.vue +++ b/aas-web-ui/src/components/Plugins/Submodels/DigitalNameplate.vue @@ -3,8 +3,13 @@ -
{{ 'Digital Nameplate:' }}
+
+ {{ nameToDisplay(submodelElementData, 'Digital Nameplate') }} +
+ + {{ descriptionToDisplay(submodelElementData) }} +
diff --git a/aas-web-ui/src/components/Plugins/Submodels/HandoverDocumentation.vue b/aas-web-ui/src/components/Plugins/Submodels/HandoverDocumentation.vue index 8e3fdc1d..b85b4044 100644 --- a/aas-web-ui/src/components/Plugins/Submodels/HandoverDocumentation.vue +++ b/aas-web-ui/src/components/Plugins/Submodels/HandoverDocumentation.vue @@ -3,8 +3,13 @@ -
{{ 'Handover Documentation:' }}
+
+ {{ nameToDisplay(submodelElementData, 'Handover Documentation') }} +
+ + {{ descriptionToDisplay(submodelElementData) }} +
@@ -17,7 +22,7 @@ - {{ document.idShort }} + {{ nameToDisplay(document) }} @@ -228,7 +233,7 @@ {{ - idProperty.idShort + nameToDisplay(idProperty) }} diff --git a/aas-web-ui/src/components/Plugins/Submodels/TechnicalData.vue b/aas-web-ui/src/components/Plugins/Submodels/TechnicalData.vue index afaff932..5e950eb6 100644 --- a/aas-web-ui/src/components/Plugins/Submodels/TechnicalData.vue +++ b/aas-web-ui/src/components/Plugins/Submodels/TechnicalData.vue @@ -3,8 +3,13 @@ -
{{ 'Technical Data:' }}
+
+ {{ nameToDisplay(submodelElementData, 'Technical Data') }} +
+ + {{ descriptionToDisplay(submodelElementData) }} +
diff --git a/aas-web-ui/src/components/Plugins/Submodels/TimeSeriesData.vue b/aas-web-ui/src/components/Plugins/Submodels/TimeSeriesData.vue index f80da456..2ad58753 100644 --- a/aas-web-ui/src/components/Plugins/Submodels/TimeSeriesData.vue +++ b/aas-web-ui/src/components/Plugins/Submodels/TimeSeriesData.vue @@ -3,8 +3,13 @@ -
{{ 'Time Series Data:' }}
+
+ {{ nameToDisplay(submodelElementData, 'Time Series Data') }} +
+ + {{ descriptionToDisplay(submodelElementData) }} +
diff --git a/aas-web-ui/src/components/SubmodelElementView.vue b/aas-web-ui/src/components/SubmodelElementView.vue index 24cc24eb..044b51d8 100644 --- a/aas-web-ui/src/components/SubmodelElementView.vue +++ b/aas-web-ui/src/components/SubmodelElementView.vue @@ -49,7 +49,7 @@ :semantic-title="'SemanticID'"> - + + "> + diff --git a/aas-web-ui/src/components/SubmodelElements/Entity.vue b/aas-web-ui/src/components/SubmodelElements/Entity.vue index 89220238..23c536a1 100644 --- a/aas-web-ui/src/components/SubmodelElements/Entity.vue +++ b/aas-web-ui/src/components/SubmodelElements/Entity.vue @@ -13,7 +13,7 @@ @@ -36,7 +36,7 @@ v-if="entityObject.specificAssetIds && entityObject.specificAssetIds.length > 0" class="px-1 pb-1 py-2 mb-3"> diff --git a/aas-web-ui/src/components/SubmodelElements/ReferenceElement.vue b/aas-web-ui/src/components/SubmodelElements/ReferenceElement.vue index 613fb445..00b0d52a 100644 --- a/aas-web-ui/src/components/SubmodelElements/ReferenceElement.vue +++ b/aas-web-ui/src/components/SubmodelElements/ReferenceElement.vue @@ -21,15 +21,15 @@