Skip to content

Commit

Permalink
Merge pull request #391 from catenax-ng/main
Browse files Browse the repository at this point in the history
Chore: minor improvements
  • Loading branch information
ds-mwesener authored Dec 13, 2023
2 parents 8cf74fa + b8b12a4 commit 5ff46fe
Show file tree
Hide file tree
Showing 11 changed files with 159 additions and 91 deletions.
95 changes: 75 additions & 20 deletions .github/workflows/argo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,18 @@ on:
- E2E-A/E2E-B
- int-a/int-b
testdata_version:
description: Which Testdata Version CX_Testdata_MessagingTest_v<X.X.X>.json
description: Which Testdata Version CX_Testdata_MessagingTest_v<X.X.X>.json e.g., 1.1.12"
required: true
argo_token:
description: Argo Token
required: true
hard_refresh:
type: choice
description: Do you want a Hard Refresh? (+5min execution time)
required: true
options:
- Yes
- No

env:
ARGO_TEST_REGISTRY: "https://argo.dev.demo.catena-x.net/api/v1/applications/tracex-dt-registry-test"
Expand Down Expand Up @@ -73,14 +80,58 @@ env:
ARGO_INT_B_RegistryReload: "https://traceability-int-b.int.demo.catena-x.net/api/registry/reload"

jobs:
test_input:
runs-on: ubuntu-latest
steps:

- name: Checkout-Repository
uses: actions/checkout@v4

- name: mask token
run: |
ARGO_TOKEN=$(jq -r '.inputs.argo_token' $GITHUB_EVENT_PATH)
echo ::add-mask::$ARGO_TOKEN
echo ARGO_TOKEN=$ARGO_TOKEN >> $GITHUB_ENV
- name: Check Testdata Version Format
run: |
if [[ ! "${{ github.event.inputs.testdata_version }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Invalid Testdata Version format. Please use X.X.X, e.g., 1.1.12"
exit 1
fi
- name: Check Argo Token
run: |
source ./.github/argo/argo_config.sh
if [ "${{ github.event.inputs.environment }}" == "Dev/Test" ]; then
resources="${DEV_TEST_RESOURCES[2]}"
elif [ "${{ github.event.inputs.environment }}" == "E2E-A/E2E-B" ]; then
resources="${E2E_RESOURCES[2]}"
elif [ "${{ github.event.inputs.environment }}" == "int-a/int-b" ]; then
resources="${INT_RESOURCES[2]}"
fi
data=$(curl -X GET -H "Authorization: Bearer ${{ env.ARGO_TOKEN }}" "$resources")
status_app=$(echo "$data" | jq -r '.status.sync.status')
if [ $status_app != null ]; then
echo "Argo Token is valid."
else
echo "Argo Token is invalid."
exit 1
fi
print_environment:
needs: test_input
runs-on: ubuntu-latest
steps:
- name: ${{ github.event.inputs.environment }}
run: |
echo "### inputs" >> $GITHUB_STEP_SUMMARY
echo "- environment: ${{ github.event.inputs.environment }}" >> $GITHUB_STEP_SUMMARY
hard_refresh_environment:
needs: print_environment
Expand All @@ -100,19 +151,23 @@ jobs:
run: |
source ./.github/argo/argo_config.sh
if [ "${{ github.event.inputs.environment }}" == "Dev/Test" ]; then
resources=("${DEV_TEST_RESOURCES[@]}")
elif [ "${{ github.event.inputs.environment }}" == "E2E-A/E2E-B" ]; then
resources=("${E2E_RESOURCES[@]}")
elif [ "${{ github.event.inputs.environment }}" == "int-a/int-b" ]; then
resources=("${INT_RESOURCES[@]}")
if [ "${{ github.event.inputs.hard_refresh }}" == "true" ]; then
if [ "${{ github.event.inputs.environment }}" == "Dev/Test" ]; then
resources=("${DEV_TEST_RESOURCES[@]}")
elif [ "${{ github.event.inputs.environment }}" == "E2E-A/E2E-B" ]; then
resources=("${E2E_RESOURCES[@]}")
elif [ "${{ github.event.inputs.environment }}" == "int-a/int-b" ]; then
resources=("${INT_RESOURCES[@]}")
fi
for resource in "${resources[@]}"; do
curl -X GET -H "Authorization: Bearer ${{ env.ARGO_TOKEN }}" "$resource?refresh=hard&appNamespace=argocd"
done
sleep 40
elif [ "${{ github.event.inputs.hard_refresh }}" == "false" ]; then
echo "Hard refresh skipped"
fi
for resource in "${resources[@]}"; do
curl -X GET -H "Authorization: Bearer ${{ env.ARGO_TOKEN }}" "$resource?refresh=hard&appNamespace=argocd"
done
sleep 40
delete_environment:
needs: hard_refresh_environment
runs-on: ubuntu-latest
Expand Down Expand Up @@ -168,14 +223,14 @@ jobs:
old_TargetRevision2=$(echo "$json_data2" | jq -r '.spec.source.targetRevision')
if [ "$old_TargetRevision1" != "$new_target_revision" ]; then
updated_json=$(echo "$json_data1" | jq ".spec.source.targetRevision = \"$new_target_revision\"")
curl -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer ${{ env.ARGO_TOKEN }}" -d "$updated_json" "$ARGO_TEST_TRACE_X_INSTANCE"
updated_json1=$(echo "$json_data1" | jq ".spec.source.targetRevision = \"$new_target_revision\"")
curl -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer ${{ env.ARGO_TOKEN }}" -d "$updated_json1" "$ARGO_TEST_TRACE_X_INSTANCE"
echo "Target Revision for Test overwritten"
fi
if [ "$old_TargetRevision2" != "$new_target_revision" ]; then
updated_json=$(echo "$json_data2" | jq ".spec.source.targetRevision = \"$new_target_revision\"")
curl -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer ${{ env.ARGO_TOKEN }}" -d "$updated_json" "$ARGO_DEV_TRACE_X_INSTANCE"
updated_json2=$(echo "$json_data2" | jq ".spec.source.targetRevision = \"$new_target_revision\"")
curl -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer ${{ env.ARGO_TOKEN }}" -d "$updated_json2" "$ARGO_DEV_TRACE_X_INSTANCE"
echo "Target Revision for Dev overwritten"
fi
Expand All @@ -188,14 +243,14 @@ jobs:
old_TargetRevision2=$(echo "$json_data2" | jq -r '.spec.source.targetRevision')
if [ "$old_TargetRevision1" != "$new_target_revision" ]; then
updated_json=$(echo "$json_data1" | jq ".spec.source.targetRevision = \"$new_target_revision\"")
curl -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer ${{ env.ARGO_TOKEN }}" -d "$updated_json" "$ARGO_E2E_A_TRACE_X_INSTANCE"
updated_json1=$(echo "$json_data1" | jq ".spec.source.targetRevision = \"$new_target_revision\"")
curl -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer ${{ env.ARGO_TOKEN }}" -d "$updated_json1" "$ARGO_E2E_A_TRACE_X_INSTANCE"
echo "Target Revision for e2e-a overwritten"
fi
if [ "$old_TargetRevision2" != "$new_target_revision" ]; then
updated_json=$(echo "$json_data2" | jq ".spec.source.targetRevision = \"$new_target_revision\"")
curl -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer ${{ env.ARGO_TOKEN }}" -d "$updated_json" "$ARGO_E2E_B_TRACE_X_INSTANCE"
updated_json2=$(echo "$json_data2" | jq ".spec.source.targetRevision = \"$new_target_revision\"")
curl -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer ${{ env.ARGO_TOKEN }}" -d "$updated_json2" "$ARGO_E2E_B_TRACE_X_INSTANCE"
echo "Target Revision for e2e-b overwritten"
fi
Expand Down
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres
to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


## [UNRELEASED - DD.MM.YYYY]

## [10.0.0 - 12.12.2024]
### Added
- new filtering capabilities ( receivedQualityAlertIdsInStatusActive, sentQualityAlertIdsInStatusActive, receivedQualityInvestigationIdsInStatusActive, sentQualityInvestigationIdsInStatusActive )
- Validation check if table-settings correct and reset on invalid state
Expand All @@ -19,6 +19,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
- Added BPN column to parts table
- Emit change check to observables in frontend
- Added an Entity Relationship Model (ERM) into the Architecture Documentation to visually represent our tables and their relationships.
- Added a step for testing input and included an option for a hard refresh in Argo Workflow
- Added manufacturer_id to assets_as_planned
- Added local filtering and auto complete for notifications

Expand Down
8 changes: 4 additions & 4 deletions charts/traceability-foss/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ home: https://eclipse-tractusx.github.io/
sources:
- https://github.com/eclipse-tractusx/traceability-foss
type: application
version: 1.3.22
appVersion: "9.0.0-rc3"
version: 1.3.24
appVersion: "10.0.0"
dependencies:
- name: frontend
repository: "file://charts/frontend"
version: 1.3.22
version: 1.3.24
- name: backend
repository: "file://charts/backend"
version: 1.3.22
version: 1.3.24
- name: postgresql
repository: https://charts.bitnami.com/bitnami
version: 12.1.6
Expand Down
6 changes: 3 additions & 3 deletions charts/traceability-foss/charts/backend/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
#
apiVersion: v2
name: backend
description: A Helm chart for Traceability backend application
description: A Helm chart for Traceability backend application.
type: application
version: 1.3.22
appVersion: "9.0.0-rc3"
version: 1.3.24
appVersion: "10.0.0"
dependencies:
- name: postgresql
repository: https://charts.bitnami.com/bitnami
Expand Down
6 changes: 3 additions & 3 deletions charts/traceability-foss/charts/frontend/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#
apiVersion: v2
name: frontend
description: A Helm chart for Traceability frontend application
description: A Helm chart for Traceability frontend application.
type: application
version: 1.3.22
appVersion: "9.0.0-rc3"
version: 1.3.24
appVersion: "10.0.0"
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name" : "trace-x",
"version" : "9.0.0-rc3",
"version" : "10.0.0",
"scripts" : {
"analyze" : "ng build --configuration=production --stats-json && webpack-bundle-analyzer dist/stats.json",
"build:prod" : "ng build --output-hashing=all --configuration=debugProd --base-href /{baseHrefPlaceholder}/ --deploy-url /{baseHrefPlaceholder}/ ",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,24 @@
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/

import { ChangeDetectorRef, Component, ViewChild } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { ALERT_BASE_ROUTE, getRoute } from '@core/known-route';
import { AlertDetailFacade } from '@page/alerts/core/alert-detail.facade';
import { AlertHelperService } from '@page/alerts/core/alert-helper.service';
import { AlertsFacade } from '@page/alerts/core/alerts.facade';
import { NotificationMenuActionsAssembler } from '@shared/assembler/notificationMenuActions.assembler';
import { NotificationCommonModalComponent } from '@shared/components/notification-common-modal/notification-common-modal.component';
import { TableSortingUtil } from '@shared/components/table/table-sorting.util';
import { MenuActionConfig, TableEventConfig, TableHeaderSort } from '@shared/components/table/table.model';
import { createDeeplinkNotificationFilter } from '@shared/helper/notification-helper';
import { NotificationTabInformation } from '@shared/model/notification-tab-information';
import { Notification, NotificationStatusGroup, NotificationType } from '@shared/model/notification.model';
import { TranslationContext } from '@shared/model/translation-context.model';
import { Subscription } from 'rxjs';
import {ChangeDetectorRef, Component, ViewChild} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {ALERT_BASE_ROUTE, getRoute} from '@core/known-route';
import {AlertDetailFacade} from '@page/alerts/core/alert-detail.facade';
import {AlertHelperService} from '@page/alerts/core/alert-helper.service';
import {AlertsFacade} from '@page/alerts/core/alerts.facade';
import {NotificationMenuActionsAssembler} from '@shared/assembler/notificationMenuActions.assembler';
import {
NotificationCommonModalComponent
} from '@shared/components/notification-common-modal/notification-common-modal.component';
import {TableSortingUtil} from '@shared/components/table/table-sorting.util';
import {MenuActionConfig, TableEventConfig, TableHeaderSort} from '@shared/components/table/table.model';
import {createDeeplinkNotificationFilter} from '@shared/helper/notification-helper';
import {NotificationTabInformation} from '@shared/model/notification-tab-information';
import {Notification, NotificationStatusGroup, NotificationType} from '@shared/model/notification.model';
import {TranslationContext} from '@shared/model/translation-context.model';
import {Subscription} from 'rxjs';
import {NotificationChannel} from "@shared/components/multi-select-autocomplete/table-type.model";

@Component({
selector: 'app-alerts',
Expand Down Expand Up @@ -133,7 +136,7 @@ export class AlertsComponent {
protected readonly NotificationType = NotificationType;

filterNotifications(filterContext: any) {
if(filterContext.channel === 'RECEIVER') {
if(filterContext.channel === NotificationChannel.RECEIVER) {
this.alertsFacade.setReceivedAlerts(this.pagination.page, this.pagination.pageSize, this.alertReceivedSortList,null, filterContext.filter);
} else {
this.alertsFacade.setQueuedAndRequestedAlerts(this.pagination.page, this.pagination.pageSize, this.alertQueuedAndRequestedSortList, null, filterContext.filter);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,24 @@
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/

import { ChangeDetectorRef, Component, ViewChild } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { getRoute, INVESTIGATION_BASE_ROUTE } from '@core/known-route';
import { InvestigationDetailFacade } from '@page/investigations/core/investigation-detail.facade';
import { InvestigationHelperService } from '@page/investigations/core/investigation-helper.service';
import { NotificationMenuActionsAssembler } from '@shared/assembler/notificationMenuActions.assembler';
import { NotificationCommonModalComponent } from '@shared/components/notification-common-modal/notification-common-modal.component';
import { TableSortingUtil } from '@shared/components/table/table-sorting.util';
import { MenuActionConfig, TableEventConfig, TableHeaderSort } from '@shared/components/table/table.model';
import { createDeeplinkNotificationFilter } from '@shared/helper/notification-helper';
import { NotificationTabInformation } from '@shared/model/notification-tab-information';
import { Notification, NotificationStatusGroup, NotificationType } from '@shared/model/notification.model';
import { TranslationContext } from '@shared/model/translation-context.model';
import { Subscription } from 'rxjs';
import { InvestigationsFacade } from '../core/investigations.facade';
import {ChangeDetectorRef, Component, ViewChild} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {getRoute, INVESTIGATION_BASE_ROUTE} from '@core/known-route';
import {InvestigationDetailFacade} from '@page/investigations/core/investigation-detail.facade';
import {InvestigationHelperService} from '@page/investigations/core/investigation-helper.service';
import {NotificationMenuActionsAssembler} from '@shared/assembler/notificationMenuActions.assembler';
import {
NotificationCommonModalComponent
} from '@shared/components/notification-common-modal/notification-common-modal.component';
import {TableSortingUtil} from '@shared/components/table/table-sorting.util';
import {MenuActionConfig, TableEventConfig, TableHeaderSort} from '@shared/components/table/table.model';
import {createDeeplinkNotificationFilter} from '@shared/helper/notification-helper';
import {NotificationTabInformation} from '@shared/model/notification-tab-information';
import {Notification, NotificationStatusGroup, NotificationType} from '@shared/model/notification.model';
import {TranslationContext} from '@shared/model/translation-context.model';
import {Subscription} from 'rxjs';
import {InvestigationsFacade} from '../core/investigations.facade';
import {NotificationChannel} from "@shared/components/multi-select-autocomplete/table-type.model";

@Component({
selector: 'app-investigations',
Expand Down Expand Up @@ -130,7 +133,7 @@ export class InvestigationsComponent {
protected readonly NotificationType = NotificationType;

filterNotifications(filterContext: any) {
if(filterContext.channel === 'RECEIVER') {
if(filterContext.channel === NotificationChannel.RECEIVER) {
this.investigationsFacade.setReceivedInvestigation(this.pagination.page, this.pagination.pageSize, this.investigationReceivedSortList, null, filterContext.filter /*Filter */);

} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,24 @@
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/

import { DatePipe, registerLocaleData } from '@angular/common';
import {DatePipe, registerLocaleData} from '@angular/common';
import localeDe from '@angular/common/locales/de';
import localeDeExtra from '@angular/common/locales/extra/de';
import { Component, EventEmitter, Inject, Injector, Input, LOCALE_ID, OnChanges, ViewChild } from '@angular/core';
import { FormControl } from '@angular/forms';
import { DateAdapter, MAT_DATE_LOCALE } from '@angular/material/core';
import { MatDatepickerInputEvent } from '@angular/material/datepicker';
import { MatSelectChange } from '@angular/material/select';
import {Component, EventEmitter, Inject, Injector, Input, LOCALE_ID, OnChanges, ViewChild} from '@angular/core';
import {FormControl} from '@angular/forms';
import {DateAdapter, MAT_DATE_LOCALE} from '@angular/material/core';
import {MatDatepickerInputEvent} from '@angular/material/datepicker';
import {MatSelectChange} from '@angular/material/select';
import {
AutocompleteStrategy,
AutocompleteStrategyMap,
} from '@shared/components/multi-select-autocomplete/autocomplete-strategy';
import { TableType } from '@shared/components/multi-select-autocomplete/table-type.model';
import { FormatPartSemanticDataModelToCamelCasePipe } from '@shared/pipes/format-part-semantic-data-model-to-camelcase.pipe';
import { PartsService } from '@shared/service/parts.service';
import { firstValueFrom } from 'rxjs';
import {TableType} from '@shared/components/multi-select-autocomplete/table-type.model';
import {
FormatPartSemanticDataModelToCamelCasePipe
} from '@shared/pipes/format-part-semantic-data-model-to-camelcase.pipe';
import {PartsService} from '@shared/service/parts.service';
import {firstValueFrom} from 'rxjs';

@Component({
selector: 'app-multiselect',
Expand Down Expand Up @@ -167,7 +169,7 @@ export class MultiSelectAutocompleteComponent implements OnChanges {
if (this.selectedValue?.length > 1) {
suffix = (' + ' + (this.selectedValue?.length - 1)) + ' ' + this.placeholderMultiple;
}
debugger;

// apply CamelCase to semanticDataModel labels
if (this.filterColumn === 'semanticDataModel') {
displayValue = [ this.formatPartSemanticDataModelToCamelCasePipe.transformModel(this.selectedValue[0]), suffix ];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
********************************************************************************/

import {AfterViewInit, Component, EventEmitter, Input, Output, TemplateRef, ViewChild} from '@angular/core';
import {TableType} from '@shared/components/multi-select-autocomplete/table-type.model';
import {NotificationChannel, TableType} from '@shared/components/multi-select-autocomplete/table-type.model';
import {
CreateHeaderFromColumns,
DisplayColumns,
Expand Down Expand Up @@ -96,7 +96,7 @@ export class NotificationTabComponent implements AfterViewInit {

filterActivated(notificationFilter: any): void {
this.notificationFilter = notificationFilter;
const channel = notificationFilter['createdBy'] ? 'RECEIVER' : 'SENDER';
const channel = notificationFilter['createdBy'] ? NotificationChannel.RECEIVER : NotificationChannel.SENDER;
if (this.notificationType === NotificationType.INVESTIGATION) {
this.investigationsFilterChanged.emit({
channel: channel,
Expand Down
Loading

0 comments on commit 5ff46fe

Please sign in to comment.