diff --git a/Dockerfile b/Dockerfile index 2178163..f3c7326 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,5 +12,5 @@ COPY dist/onecx-product-store-ui/ $DIR_HTML ENV BFF_URL http://onecx-product-store-bff:8080/ ENV APP_BASE_HREF /product-store/ -RUN chmod 775 -R $DIR_HTML/assets +RUN chmod 775 -R "$DIR_HTML"/assets USER 1001 diff --git a/src/app/app.component.scss b/src/app/app.component.scss deleted file mode 100644 index e69de29..0000000 diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 254f014..260fa1f 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,8 +1,7 @@ import { Component } from '@angular/core' @Component({ selector: 'ps-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.scss'] + templateUrl: './app.component.html' }) export class AppComponent { title = 'product-store-ui' diff --git a/src/app/product-store/product-detail/product-detail.component.ts b/src/app/product-store/product-detail/product-detail.component.ts index 9f8d9be..a1f6f20 100644 --- a/src/app/product-store/product-detail/product-detail.component.ts +++ b/src/app/product-store/product-detail/product-detail.component.ts @@ -216,7 +216,7 @@ export class ProductDetailComponent implements OnInit { } public onCreate(data: any) { this.product = data - this.changeMode === 'VIEW' + this.changeMode = 'VIEW' this.router.navigate(['./../', this.product?.name], { relativeTo: this.route }) } public onChange(nameChanged: boolean) { @@ -225,7 +225,7 @@ export class ProductDetailComponent implements OnInit { this.close() } else { this.getProduct() - this.changeMode === 'VIEW' + this.changeMode = 'VIEW' this.prepareTranslations() } } diff --git a/src/app/product-store/product-detail/product-intern/product-intern.component.html b/src/app/product-store/product-detail/product-intern/product-intern.component.html index 1a527a4..a29face 100644 --- a/src/app/product-store/product-detail/product-intern/product-intern.component.html +++ b/src/app/product-store/product-detail/product-intern/product-intern.component.html @@ -72,79 +72,3 @@ - - diff --git a/src/app/product-store/product-detail/product-props/product-props.component.ts b/src/app/product-store/product-detail/product-props/product-props.component.ts index 9f244b9..f6c6c11 100644 --- a/src/app/product-store/product-detail/product-props/product-props.component.ts +++ b/src/app/product-store/product-detail/product-props/product-props.component.ts @@ -139,7 +139,6 @@ export class ProductPropertyComponent implements OnChanges { }) .subscribe({ next: () => { - this.changeMode === 'VIEW' this.msgService.success({ summaryKey: 'ACTIONS.EDIT.PRODUCT.OK' }) this.productChanged.emit(this.productName !== this.formGroup.value['name']) }, @@ -148,12 +147,14 @@ export class ProductPropertyComponent implements OnChanges { } private displaySaveError(err: any) { - err.error && err.error.errorCode && err.error.errorCode === 'MERGE_ENTITY_FAILED' // 'PERSIST_ENTITY_FAILED' - ? this.msgService.error({ - summaryKey: 'ACTIONS.' + this.changeMode + '.PRODUCT.NOK', - detailKey: 'VALIDATION.PRODUCT.UNIQUE_CONSTRAINT' - }) - : this.msgService.error({ summaryKey: 'ACTIONS.' + this.changeMode + '.PRODUCT.NOK' }) + if (err.error && err.error.errorCode && err.error.errorCode === 'MERGE_ENTITY_FAILED') { + this.msgService.error({ + summaryKey: 'ACTIONS.' + this.changeMode + '.PRODUCT.NOK', + detailKey: 'VALIDATION.PRODUCT.UNIQUE_CONSTRAINT' + }) + } else { + this.msgService.error({ summaryKey: 'ACTIONS.' + this.changeMode + '.PRODUCT.NOK' }) + } } /** File Handling diff --git a/src/app/shared/can-active-guard.service.ts b/src/app/shared/can-active-guard.service.ts index 2e78bf9..52dbbd9 100644 --- a/src/app/shared/can-active-guard.service.ts +++ b/src/app/shared/can-active-guard.service.ts @@ -12,7 +12,7 @@ const DEFAULT_LANG = 'en' export class CanActivateGuard implements CanActivate { constructor(private txService: TranslateService, private config: ConfigurationService) {} - /* eslint-disable @typescript-eslint/no-unused-vars */ /* TODO: is route and state needed */ + /* eslint-disable @typescript-eslint/no-unused-vars */ canActivate( route: ActivatedRouteSnapshot, state: RouterStateSnapshot diff --git a/src/app/shared/image-container/image-container.component.ts b/src/app/shared/image-container/image-container.component.ts index d9f4efa..b7f6fa3 100644 --- a/src/app/shared/image-container/image-container.component.ts +++ b/src/app/shared/image-container/image-container.component.ts @@ -24,7 +24,7 @@ export class ImageContainerComponent implements OnChanges { // if image Url does not start with a http the api-prefix ... // ...then it stored in the backend. So we need to put prefix in front - if (this.imageUrl && !this.imageUrl.match(/^(http|https)/g) && this.imageUrl.indexOf(this.apiPrefix) !== 0) { + if (this.imageUrl && !this.imageUrl.match(/^(http|https)/g) && !this.imageUrl.startsWith(this.apiPrefix)) { this.imageUrl = this.apiPrefix + this.imageUrl } } diff --git a/src/app/shared/label.resolver.ts b/src/app/shared/label.resolver.ts index 538e552..7f923cc 100644 --- a/src/app/shared/label.resolver.ts +++ b/src/app/shared/label.resolver.ts @@ -3,11 +3,11 @@ import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/r import { TranslateService } from '@ngx-translate/core' import { Observable } from 'rxjs' -//dont use `providedIn root` - wont work when we are in shell +// don't use 'providedIn root' - wont work when we are in shell @Injectable() export class LabelResolver implements Resolve { constructor(private translate: TranslateService) {} - /* eslint-disable @typescript-eslint/no-unused-vars */ /* TODO: is state needed */ + /* eslint-disable @typescript-eslint/no-unused-vars */ resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): string | Observable | Promise { return route.data['breadcrumb'] ? this.translate.instant(route.data['breadcrumb']) : route.routeConfig?.path } diff --git a/src/assets/silent-check-sso.html b/src/assets/silent-check-sso.html index ffe492c..d243dec 100644 --- a/src/assets/silent-check-sso.html +++ b/src/assets/silent-check-sso.html @@ -1,4 +1,8 @@ - + + + + Post Message +