Skip to content

Commit

Permalink
Add provider field in product detail (#142)
Browse files Browse the repository at this point in the history
* fix: default dropdown values for type and technology in app create

* feat: add prod detail provider field

* fix: prod props tests

---------

Co-authored-by: Christian Badura <[email protected]>
  • Loading branch information
cbadura and Christian Badura authored Jun 12, 2024
1 parent bad6e46 commit 7f1b156
Show file tree
Hide file tree
Showing 11 changed files with 53 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
<label for="product_detail_item_iconName">{{ 'PRODUCT.ICON_NAME' | translate }}</label>
</span>
</div>

<div class="w-full sm:w-10 md:w-9 lg:w-6 px-3">
<span class="p-float-label" [title]="'PRODUCT.TOOLTIPS.CLASSIFICATIONS' | translate">
<input
Expand All @@ -120,6 +121,23 @@
</span>
</div>

<div class="w-full sm:w-12 md:w-9 lg:w-12 px-3">
<span class="p-float-label" [title]="'PRODUCT.TOOLTIPS.PROVIDER' | translate">
<textarea
pInputTextarea
class="w-full"
autoresize="true"
rows="1"
id="product_detail_item_provider"
[pTooltip]="'PRODUCT.PROVIDER' | translate"
tooltipPosition="top"
tooltipEvent="focus"
formControlName="provider"
></textarea>
<label for="product_detail_item_provider">{{ 'PRODUCT.PROVIDER' | translate }}</label>
</span>
</div>

<div class="w-full sm:w-12 md:w-9 lg:w-12 px-3">
<span class="p-float-label" [title]="'PRODUCT.TOOLTIPS.DESCRIPTION' | translate">
<textarea
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const mockForm = new FormGroup<ProductDetailForm>({
]),
version: new FormControl<string | null>(null, [Validators.required, Validators.maxLength(255)]),
description: new FormControl<string | null>(null, [Validators.maxLength(255)]),
provider: new FormControl<string | null>(null, [Validators.maxLength(255)]),
imageUrl: new FormControl<string | null>(null, [Validators.maxLength(255)]),
basePath: new FormControl<string | null>(null, [Validators.required, Validators.maxLength(255)]),
displayName: new FormControl<string | null>(null, [
Expand Down Expand Up @@ -165,6 +166,7 @@ describe('ProductPropertyComponent', () => {
name: new FormControl<string | null>('name'),
version: new FormControl<string | null>('version'),
description: new FormControl<string | null>(null),
provider: new FormControl<string | null>(null, [Validators.maxLength(255)]),
imageUrl: new FormControl<string | null>(null),
basePath: new FormControl<string | null>('path'),
displayName: new FormControl<string | null>('display'),
Expand All @@ -187,6 +189,8 @@ describe('ProductPropertyComponent', () => {
name: new FormControl<string | null>('name'),
version: new FormControl<string | null>('version'),
description: new FormControl<string | null>(null),
provider: new FormControl<string | null>(null, [Validators.maxLength(255)]),

imageUrl: new FormControl<string | null>(null),
basePath: new FormControl<string | null>('path'),
displayName: new FormControl<string | null>('display'),
Expand All @@ -209,6 +213,8 @@ describe('ProductPropertyComponent', () => {
name: new FormControl<string | null>('name'),
version: new FormControl<string | null>('version'),
description: new FormControl<string | null>(null),
provider: new FormControl<string | null>(null, [Validators.maxLength(255)]),

imageUrl: new FormControl<string | null>(null),
basePath: new FormControl<string | null>('path'),
displayName: new FormControl<string | null>('display'),
Expand Down Expand Up @@ -249,6 +255,8 @@ describe('ProductPropertyComponent', () => {
name: new FormControl<string | null>('name'),
version: new FormControl<string | null>('version'),
description: new FormControl<string | null>(null),
provider: new FormControl<string | null>(null, [Validators.maxLength(255)]),

imageUrl: new FormControl<string | null>(null),
basePath: new FormControl<string | null>('path'),
displayName: new FormControl<string | null>('display'),
Expand Down Expand Up @@ -290,6 +298,8 @@ describe('ProductPropertyComponent', () => {
name: new FormControl<string | null>('name'),
version: new FormControl<string | null>('version'),
description: new FormControl<string | null>(null),
provider: new FormControl<string | null>(null, [Validators.maxLength(255)]),

imageUrl: new FormControl<string | null>(null),
basePath: new FormControl<string | null>('path'),
displayName: new FormControl<string | null>('display'),
Expand Down Expand Up @@ -329,6 +339,8 @@ describe('ProductPropertyComponent', () => {
name: new FormControl<string | null>('name'),
version: new FormControl<string | null>('version'),
description: new FormControl<string | null>(null),
provider: new FormControl<string | null>(null, [Validators.maxLength(255)]),

imageUrl: new FormControl<string | null>(null),
basePath: new FormControl<string | null>('path'),
displayName: new FormControl<string | null>('display'),
Expand All @@ -352,6 +364,8 @@ describe('ProductPropertyComponent', () => {
name: new FormControl<string | null>('name'),
version: new FormControl<string | null>('version'),
description: new FormControl<string | null>(null),
provider: new FormControl<string | null>(null, [Validators.maxLength(255)]),

imageUrl: new FormControl<string | null>(null),
basePath: new FormControl<string | null>('path'),
displayName: new FormControl<string | null>('display'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export interface ProductDetailForm {
name: FormControl<string | null>
version: FormControl<string | null>
description: FormControl<string | null>
provider: FormControl<string | null>
imageUrl: FormControl<string | null>
basePath: FormControl<string | null>
displayName: FormControl<string | null>
Expand Down Expand Up @@ -75,6 +76,7 @@ export class ProductPropertyComponent implements OnChanges, OnInit {
displayName: new FormControl(null, [Validators.required, Validators.minLength(2), Validators.maxLength(255)]),
version: new FormControl(null, [Validators.required, Validators.maxLength(255)]),
description: new FormControl(null, [Validators.maxLength(255)]),
provider: new FormControl(null, [Validators.maxLength(255)]),
imageUrl: new FormControl(null, [Validators.maxLength(255)]),
basePath: new FormControl(null, [Validators.required, Validators.maxLength(255)]),
iconName: new FormControl(null, [Validators.maxLength(255)]),
Expand Down Expand Up @@ -127,6 +129,7 @@ export class ProductPropertyComponent implements OnChanges, OnInit {
name: this.formGroup.value['name'],
version: this.formGroup.value['version'],
description: this.formGroup.value['description'],
provider: this.formGroup.value['provider'],
imageUrl: this.formGroup.controls['imageUrl'].value,
basePath: this.formGroup.value['basePath'],
displayName: this.formGroup.value['displayName'],
Expand All @@ -151,6 +154,7 @@ export class ProductPropertyComponent implements OnChanges, OnInit {
name: this.productName,
version: this.formGroup.value['version'],
description: this.formGroup.value['description'],
provider: this.formGroup.value['provider'],
imageUrl: this.formGroup.controls['imageUrl'].value,
basePath: this.formGroup.value['basePath'],
displayName: this.formGroup.value['displayName'],
Expand Down
1 change: 1 addition & 0 deletions src/app/shared/generated/model/createProductRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ export interface CreateProductRequest {
iconName?: string;
classifications?: Array<string>;
undeployed?: boolean;
provider?: string;
}

1 change: 1 addition & 0 deletions src/app/shared/generated/model/product.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@ export interface Product {
iconName?: string;
classifications?: Array<string>;
undeployed?: boolean;
provider?: string;
}

1 change: 1 addition & 0 deletions src/app/shared/generated/model/productAbstract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@ export interface ProductAbstract {
*/
classifications?: Array<string>;
undeployed?: boolean;
provider?: string;
}

1 change: 1 addition & 0 deletions src/app/shared/generated/model/productAndWorkspaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@ export interface ProductAndWorkspaces {
iconName?: string;
classifications?: Array<string>;
undeployed?: boolean;
provider?: string;
}

1 change: 1 addition & 0 deletions src/app/shared/generated/model/updateProductRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ export interface UpdateProductRequest {
iconName?: string;
classifications?: Array<string>;
undeployed?: boolean;
provider?: string;
}

9 changes: 8 additions & 1 deletion src/assets/api/openapi-bff.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
openapi: 3.0.3
info:
title: onecx-product-store-bff
Expand Down Expand Up @@ -869,6 +868,8 @@ components:
type: string
undeployed:
type: boolean
provider:
type: string
UpdateProductRequest:
type: object
required:
Expand Down Expand Up @@ -897,6 +898,8 @@ components:
type: string
undeployed:
type: boolean
provider:
type: string
ProductDetails:
type: object
properties:
Expand Down Expand Up @@ -957,6 +960,8 @@ components:
type: string
undeployed:
type: boolean
provider:
type: string
ProductAndWorkspaces:
type: object
allOf:
Expand Down Expand Up @@ -995,6 +1000,8 @@ components:
type: string
undeployed:
type: boolean
provider:
type: string
OffsetDateTime:
format: date-time
type: string
Expand Down
2 changes: 2 additions & 0 deletions src/assets/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@
"VERSION": "Version",
"DESCRIPTION": "Beschreibung",
"DISPLAY_NAME": "Anzeigename",
"PROVIDER": "Anbieter",
"OPERATOR": "Erzeugt durch",
"OPERATOR.MANUAL": "Manuell",
"OPERATOR.DEPLOYMENT": "Deployment Operator",
Expand All @@ -270,6 +271,7 @@
"NAME": "Eindeutiger Name der Applikation",
"VERSION": "Version der Applikation",
"DESCRIPTION": "Beschreibung der Applikation",
"PROVIDER": "Anbieterinformation, sollte bei der Bereitstellung mitgeliefert werden (Helm chart)",
"DISPLAY_NAME": "Anzeigename der Applikation",
"OPERATOR": "Wie wurde die Applikation angelegt? Wird bei der Erstellung der Applikation bestimmt.",
"IMAGE_URL": "URL für ein Image ausserhalb des Application Stores",
Expand Down
2 changes: 2 additions & 0 deletions src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@
"NAME": "Name",
"VERSION": "Version",
"DESCRIPTION": "Description",
"PROVIDER": "Provider",
"DISPLAY_NAME": "Display Name",
"OPERATOR": "Created by",
"OPERATOR.MANUAL": "Manual",
Expand All @@ -270,6 +271,7 @@
"NAME": "Unique Name of the Application",
"VERSION": "Version of the Application",
"DESCRIPTION": "Description of the Application",
"PROVIDER": "Provider information, should be included in the deployment descriptor (Helm chart)",
"DISPLAY_NAME": "Display Name of the Application",
"OPERATOR": "How the Application was created? Set at creation time",
"IMAGE_URL": "URL for an image outside the Application Store",
Expand Down

0 comments on commit 7f1b156

Please sign in to comment.