From 16b6107206f5842e7faa4eccb693626f0f3dd64b Mon Sep 17 00:00:00 2001 From: Roland Schneider Date: Thu, 22 May 2025 08:12:09 +0200 Subject: [PATCH] [yoga-6] add pricePostfix and price description --- dev.sh | 5 ++++ .../src/components/price.item.component.tsx | 5 ++-- .../api/yoga-price.ts | 8 +++++++ .../api/yoga-single-service.ts | 4 ++++ .../api/yoga-price.ts | 8 +++++++ .../content-types/yoga-price/schema.json | 23 +++++++++++++------ yoga-cms/types/generated/contentTypes.d.ts | 7 ++++++ 7 files changed, 51 insertions(+), 9 deletions(-) create mode 100755 dev.sh diff --git a/dev.sh b/dev.sh new file mode 100755 index 0000000..587ae69 --- /dev/null +++ b/dev.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +cd environment/dev/docker-compose/yogastic +docker compose up -d + diff --git a/yoga-app/src/components/price.item.component.tsx b/yoga-app/src/components/price.item.component.tsx index 556d31a..cc6c343 100644 --- a/yoga-app/src/components/price.item.component.tsx +++ b/yoga-app/src/components/price.item.component.tsx @@ -7,7 +7,7 @@ export interface Props{ config: YogaPrice_Plain } -export function PriceItemComponent({config: {header,option1,option2,price,icon, image,buttonText}} : Props){ +export function PriceItemComponent({config: {header, description, option1,option2,price,pricePostfix, icon, image,buttonText}} : Props){ // there are some issues with the strapi generated types const iconFile: StrapiFile = icon as StrapiFile; const imageFile: StrapiFile = image as StrapiFile; @@ -28,6 +28,7 @@ export function PriceItemComponent({config: {header,option1,option2,price,icon,

{header}

+

{description}

{price} FT - /per month + { pricePostfix && {pricePostfix} }
{buttonText} diff --git a/yoga-app/src/types/generated-strapi-interfaces/api/yoga-price.ts b/yoga-app/src/types/generated-strapi-interfaces/api/yoga-price.ts index f121f16..5910a25 100644 --- a/yoga-app/src/types/generated-strapi-interfaces/api/yoga-price.ts +++ b/yoga-app/src/types/generated-strapi-interfaces/api/yoga-price.ts @@ -14,6 +14,8 @@ export interface YogaPrice { price?: number; icon?: { data: Media }; image?: { data: Media }; + pricePostfix?: string; + description?: string; }; } export interface YogaPrice_Plain { @@ -25,6 +27,8 @@ export interface YogaPrice_Plain { price?: number; icon?: Media_Plain; image?: Media_Plain; + pricePostfix?: string; + description?: string; } export interface YogaPrice_NoRelations { @@ -36,6 +40,8 @@ export interface YogaPrice_NoRelations { price?: number; icon?: number; image?: number; + pricePostfix?: string; + description?: string; } export interface YogaPrice_AdminPanelLifeCycle { @@ -47,4 +53,6 @@ export interface YogaPrice_AdminPanelLifeCycle { price?: number; icon?: AdminPanelRelationPropertyModification; image?: AdminPanelRelationPropertyModification; + pricePostfix?: string; + description?: string; } diff --git a/yoga-app/src/types/generated-strapi-interfaces/api/yoga-single-service.ts b/yoga-app/src/types/generated-strapi-interfaces/api/yoga-single-service.ts index bcfab73..d09adba 100644 --- a/yoga-app/src/types/generated-strapi-interfaces/api/yoga-single-service.ts +++ b/yoga-app/src/types/generated-strapi-interfaces/api/yoga-single-service.ts @@ -13,6 +13,7 @@ export interface YogaSingleService { image?: { data: Media }; imageAlt?: string; name?: string; + article?: string; locale: string; localizations?: { data: YogaSingleService[] }; }; @@ -25,6 +26,7 @@ export interface YogaSingleService_Plain { image?: Media_Plain; imageAlt?: string; name?: string; + article?: string; locale: string; localizations?: YogaSingleService_Plain[]; } @@ -37,6 +39,7 @@ export interface YogaSingleService_NoRelations { image?: number; imageAlt?: string; name?: string; + article?: string; locale: string; localizations?: YogaSingleService[]; } @@ -49,6 +52,7 @@ export interface YogaSingleService_AdminPanelLifeCycle { image?: AdminPanelRelationPropertyModification; imageAlt?: string; name?: string; + article?: string; locale: string; localizations?: YogaSingleService[]; } diff --git a/yoga-cms/generated-strapi-interfaces/api/yoga-price.ts b/yoga-cms/generated-strapi-interfaces/api/yoga-price.ts index f121f16..5910a25 100644 --- a/yoga-cms/generated-strapi-interfaces/api/yoga-price.ts +++ b/yoga-cms/generated-strapi-interfaces/api/yoga-price.ts @@ -14,6 +14,8 @@ export interface YogaPrice { price?: number; icon?: { data: Media }; image?: { data: Media }; + pricePostfix?: string; + description?: string; }; } export interface YogaPrice_Plain { @@ -25,6 +27,8 @@ export interface YogaPrice_Plain { price?: number; icon?: Media_Plain; image?: Media_Plain; + pricePostfix?: string; + description?: string; } export interface YogaPrice_NoRelations { @@ -36,6 +40,8 @@ export interface YogaPrice_NoRelations { price?: number; icon?: number; image?: number; + pricePostfix?: string; + description?: string; } export interface YogaPrice_AdminPanelLifeCycle { @@ -47,4 +53,6 @@ export interface YogaPrice_AdminPanelLifeCycle { price?: number; icon?: AdminPanelRelationPropertyModification; image?: AdminPanelRelationPropertyModification; + pricePostfix?: string; + description?: string; } diff --git a/yoga-cms/src/api/yoga-price/content-types/yoga-price/schema.json b/yoga-cms/src/api/yoga-price/content-types/yoga-price/schema.json index af86cf8..691853b 100644 --- a/yoga-cms/src/api/yoga-price/content-types/yoga-price/schema.json +++ b/yoga-cms/src/api/yoga-price/content-types/yoga-price/schema.json @@ -4,7 +4,8 @@ "info": { "singularName": "yoga-price", "pluralName": "yoga-prices", - "displayName": "YogaPrice" + "displayName": "YogaPrice", + "description": "" }, "options": { "draftAndPublish": true @@ -27,24 +28,32 @@ "type": "integer" }, "icon": { + "type": "media", + "multiple": false, + "required": false, "allowedTypes": [ "images", "files", "videos", "audios" - ], - "type": "media", - "multiple": false + ] }, "image": { + "type": "media", + "multiple": false, + "required": false, "allowedTypes": [ "images", "files", "videos", "audios" - ], - "type": "media", - "multiple": false + ] + }, + "pricePostfix": { + "type": "string" + }, + "description": { + "type": "text" } } } diff --git a/yoga-cms/types/generated/contentTypes.d.ts b/yoga-cms/types/generated/contentTypes.d.ts index c203adb..5481a63 100644 --- a/yoga-cms/types/generated/contentTypes.d.ts +++ b/yoga-cms/types/generated/contentTypes.d.ts @@ -34,6 +34,10 @@ export interface AdminApiToken extends Struct.CollectionTypeSchema { minLength: 1; }> & Schema.Attribute.DefaultTo<''>; + encryptedKey: Schema.Attribute.Text & + Schema.Attribute.SetMinMaxLength<{ + minLength: 1; + }>; expiresAt: Schema.Attribute.DateTime; lastUsedAt: Schema.Attribute.DateTime; lifespan: Schema.Attribute.BigInteger; @@ -1638,6 +1642,7 @@ export interface ApiYogaPriceComponentYogaPriceComponent export interface ApiYogaPriceYogaPrice extends Struct.CollectionTypeSchema { collectionName: 'yoga_prices'; info: { + description: ''; displayName: 'YogaPrice'; pluralName: 'yoga-prices'; singularName: 'yoga-price'; @@ -1650,6 +1655,7 @@ export interface ApiYogaPriceYogaPrice extends Struct.CollectionTypeSchema { createdAt: Schema.Attribute.DateTime; createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> & Schema.Attribute.Private; + description: Schema.Attribute.Text; header: Schema.Attribute.String; icon: Schema.Attribute.Media<'images' | 'files' | 'videos' | 'audios'>; image: Schema.Attribute.Media<'images' | 'files' | 'videos' | 'audios'>; @@ -1662,6 +1668,7 @@ export interface ApiYogaPriceYogaPrice extends Struct.CollectionTypeSchema { option1: Schema.Attribute.String; option2: Schema.Attribute.String; price: Schema.Attribute.Integer; + pricePostfix: Schema.Attribute.String; publishedAt: Schema.Attribute.DateTime; updatedAt: Schema.Attribute.DateTime; updatedBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &