From ff1e2a79750606e2f736720d344e132630de57b1 Mon Sep 17 00:00:00 2001 From: Anna Tsybel Date: Wed, 27 May 2026 17:42:19 +0200 Subject: [PATCH] cms/new-branding: remove unneccessary field in cms/landing --- cms/src/collections/FeaturedNews.ts | 2 - cms/src/collections/NewsItems.ts | 8 - cms/src/migrations/20260527_153646.json | 1398 +++++++++++++++++ cms/src/migrations/20260527_153646.ts | 19 + cms/src/migrations/index.ts | 8 +- cms/src/payload-types.ts | 10 +- .../components/blog/ArticleCard/index.scss | 21 +- .../src/components/blog/ArticleCard/index.tsx | 32 +- .../src/components/blog/Info/index.tsx | 12 +- new-branding/src/lib/axios/types.ts | 9 +- 10 files changed, 1481 insertions(+), 38 deletions(-) create mode 100644 cms/src/migrations/20260527_153646.json create mode 100644 cms/src/migrations/20260527_153646.ts diff --git a/cms/src/collections/FeaturedNews.ts b/cms/src/collections/FeaturedNews.ts index 3a2afe3..b5e9161 100644 --- a/cms/src/collections/FeaturedNews.ts +++ b/cms/src/collections/FeaturedNews.ts @@ -37,12 +37,10 @@ export const FeaturedNews: GlobalConfig = { { name: 'source', type: 'text', - required: true, }, { name: 'sourceUrl', type: 'text', - required: true, }, { required: true, diff --git a/cms/src/collections/NewsItems.ts b/cms/src/collections/NewsItems.ts index d87dfc0..6ce76f5 100644 --- a/cms/src/collections/NewsItems.ts +++ b/cms/src/collections/NewsItems.ts @@ -29,21 +29,13 @@ export const NewsItems: CollectionConfig = { }, }, }, - { - name: 'categoryLabel', - type: 'text', - required: true, - defaultValue: 'News', - }, { name: 'source', type: 'text', - required: true, }, { name: 'sourceUrl', type: 'text', - required: true, }, { name: 'type', diff --git a/cms/src/migrations/20260527_153646.json b/cms/src/migrations/20260527_153646.json new file mode 100644 index 0000000..4f78157 --- /dev/null +++ b/cms/src/migrations/20260527_153646.json @@ -0,0 +1,1398 @@ +{ + "version": "7", + "dialect": "postgresql", + "tables": { + "public.users_sessions": { + "name": "users_sessions", + "schema": "", + "columns": { + "_order": { + "name": "_order", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "_parent_id": { + "name": "_parent_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "id": { + "name": "id", + "type": "varchar", + "primaryKey": true, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": false + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "users_sessions_order_idx": { + "name": "users_sessions_order_idx", + "columns": [ + { + "expression": "_order", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "users_sessions_parent_id_idx": { + "name": "users_sessions_parent_id_idx", + "columns": [ + { + "expression": "_parent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "users_sessions_parent_id_fk": { + "name": "users_sessions_parent_id_fk", + "tableFrom": "users_sessions", + "tableTo": "users", + "columnsFrom": [ + "_parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.users": { + "name": "users", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "role": { + "name": "role", + "type": "enum_users_role", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'admin'" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "created_at": { + "name": "created_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "email": { + "name": "email", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "reset_password_token": { + "name": "reset_password_token", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "reset_password_expiration": { + "name": "reset_password_expiration", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": false + }, + "salt": { + "name": "salt", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "hash": { + "name": "hash", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "login_attempts": { + "name": "login_attempts", + "type": "numeric", + "primaryKey": false, + "notNull": false, + "default": 0 + }, + "lock_until": { + "name": "lock_until", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "users_updated_at_idx": { + "name": "users_updated_at_idx", + "columns": [ + { + "expression": "updated_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "users_created_at_idx": { + "name": "users_created_at_idx", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "users_email_idx": { + "name": "users_email_idx", + "columns": [ + { + "expression": "email", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.media": { + "name": "media", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "alt": { + "name": "alt", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "created_at": { + "name": "created_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "url": { + "name": "url", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "thumbnail_u_r_l": { + "name": "thumbnail_u_r_l", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "filename": { + "name": "filename", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "mime_type": { + "name": "mime_type", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "filesize": { + "name": "filesize", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "width": { + "name": "width", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "height": { + "name": "height", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "focal_x": { + "name": "focal_x", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "focal_y": { + "name": "focal_y", + "type": "numeric", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "media_updated_at_idx": { + "name": "media_updated_at_idx", + "columns": [ + { + "expression": "updated_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "media_created_at_idx": { + "name": "media_created_at_idx", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "media_filename_idx": { + "name": "media_filename_idx", + "columns": [ + { + "expression": "filename", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.news_types": { + "name": "news_types", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "label": { + "name": "label", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "created_at": { + "name": "created_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "news_types_updated_at_idx": { + "name": "news_types_updated_at_idx", + "columns": [ + { + "expression": "updated_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "news_types_created_at_idx": { + "name": "news_types_created_at_idx", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.news_items": { + "name": "news_items", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "title": { + "name": "title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "date": { + "name": "date", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true + }, + "source": { + "name": "source", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "source_url": { + "name": "source_url", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "type_id": { + "name": "type_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "color_theme": { + "name": "color_theme", + "type": "enum_news_items_color_theme", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'warm-orange'" + }, + "thumbnail_id": { + "name": "thumbnail_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "created_at": { + "name": "created_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "news_items_type_idx": { + "name": "news_items_type_idx", + "columns": [ + { + "expression": "type_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "news_items_thumbnail_idx": { + "name": "news_items_thumbnail_idx", + "columns": [ + { + "expression": "thumbnail_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "news_items_updated_at_idx": { + "name": "news_items_updated_at_idx", + "columns": [ + { + "expression": "updated_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "news_items_created_at_idx": { + "name": "news_items_created_at_idx", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "news_items_type_id_news_types_id_fk": { + "name": "news_items_type_id_news_types_id_fk", + "tableFrom": "news_items", + "tableTo": "news_types", + "columnsFrom": [ + "type_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "news_items_thumbnail_id_media_id_fk": { + "name": "news_items_thumbnail_id_media_id_fk", + "tableFrom": "news_items", + "tableTo": "media", + "columnsFrom": [ + "thumbnail_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.payload_kv": { + "name": "payload_kv", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "key": { + "name": "key", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "data": { + "name": "data", + "type": "jsonb", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "payload_kv_key_idx": { + "name": "payload_kv_key_idx", + "columns": [ + { + "expression": "key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.payload_locked_documents": { + "name": "payload_locked_documents", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "global_slug": { + "name": "global_slug", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "created_at": { + "name": "created_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "payload_locked_documents_global_slug_idx": { + "name": "payload_locked_documents_global_slug_idx", + "columns": [ + { + "expression": "global_slug", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "payload_locked_documents_updated_at_idx": { + "name": "payload_locked_documents_updated_at_idx", + "columns": [ + { + "expression": "updated_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "payload_locked_documents_created_at_idx": { + "name": "payload_locked_documents_created_at_idx", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.payload_locked_documents_rels": { + "name": "payload_locked_documents_rels", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "order": { + "name": "order", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "parent_id": { + "name": "parent_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "path": { + "name": "path", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "users_id": { + "name": "users_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "media_id": { + "name": "media_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "news_types_id": { + "name": "news_types_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "news_items_id": { + "name": "news_items_id", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "payload_locked_documents_rels_order_idx": { + "name": "payload_locked_documents_rels_order_idx", + "columns": [ + { + "expression": "order", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "payload_locked_documents_rels_parent_idx": { + "name": "payload_locked_documents_rels_parent_idx", + "columns": [ + { + "expression": "parent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "payload_locked_documents_rels_path_idx": { + "name": "payload_locked_documents_rels_path_idx", + "columns": [ + { + "expression": "path", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "payload_locked_documents_rels_users_id_idx": { + "name": "payload_locked_documents_rels_users_id_idx", + "columns": [ + { + "expression": "users_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "payload_locked_documents_rels_media_id_idx": { + "name": "payload_locked_documents_rels_media_id_idx", + "columns": [ + { + "expression": "media_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "payload_locked_documents_rels_news_types_id_idx": { + "name": "payload_locked_documents_rels_news_types_id_idx", + "columns": [ + { + "expression": "news_types_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "payload_locked_documents_rels_news_items_id_idx": { + "name": "payload_locked_documents_rels_news_items_id_idx", + "columns": [ + { + "expression": "news_items_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "payload_locked_documents_rels_parent_fk": { + "name": "payload_locked_documents_rels_parent_fk", + "tableFrom": "payload_locked_documents_rels", + "tableTo": "payload_locked_documents", + "columnsFrom": [ + "parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "payload_locked_documents_rels_users_fk": { + "name": "payload_locked_documents_rels_users_fk", + "tableFrom": "payload_locked_documents_rels", + "tableTo": "users", + "columnsFrom": [ + "users_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "payload_locked_documents_rels_media_fk": { + "name": "payload_locked_documents_rels_media_fk", + "tableFrom": "payload_locked_documents_rels", + "tableTo": "media", + "columnsFrom": [ + "media_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "payload_locked_documents_rels_news_types_fk": { + "name": "payload_locked_documents_rels_news_types_fk", + "tableFrom": "payload_locked_documents_rels", + "tableTo": "news_types", + "columnsFrom": [ + "news_types_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "payload_locked_documents_rels_news_items_fk": { + "name": "payload_locked_documents_rels_news_items_fk", + "tableFrom": "payload_locked_documents_rels", + "tableTo": "news_items", + "columnsFrom": [ + "news_items_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.payload_preferences": { + "name": "payload_preferences", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "key": { + "name": "key", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "value": { + "name": "value", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "created_at": { + "name": "created_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "payload_preferences_key_idx": { + "name": "payload_preferences_key_idx", + "columns": [ + { + "expression": "key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "payload_preferences_updated_at_idx": { + "name": "payload_preferences_updated_at_idx", + "columns": [ + { + "expression": "updated_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "payload_preferences_created_at_idx": { + "name": "payload_preferences_created_at_idx", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.payload_preferences_rels": { + "name": "payload_preferences_rels", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "order": { + "name": "order", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "parent_id": { + "name": "parent_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "path": { + "name": "path", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "users_id": { + "name": "users_id", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "payload_preferences_rels_order_idx": { + "name": "payload_preferences_rels_order_idx", + "columns": [ + { + "expression": "order", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "payload_preferences_rels_parent_idx": { + "name": "payload_preferences_rels_parent_idx", + "columns": [ + { + "expression": "parent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "payload_preferences_rels_path_idx": { + "name": "payload_preferences_rels_path_idx", + "columns": [ + { + "expression": "path", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "payload_preferences_rels_users_id_idx": { + "name": "payload_preferences_rels_users_id_idx", + "columns": [ + { + "expression": "users_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "payload_preferences_rels_parent_fk": { + "name": "payload_preferences_rels_parent_fk", + "tableFrom": "payload_preferences_rels", + "tableTo": "payload_preferences", + "columnsFrom": [ + "parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "payload_preferences_rels_users_fk": { + "name": "payload_preferences_rels_users_fk", + "tableFrom": "payload_preferences_rels", + "tableTo": "users", + "columnsFrom": [ + "users_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.payload_migrations": { + "name": "payload_migrations", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "batch": { + "name": "batch", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "created_at": { + "name": "created_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "payload_migrations_updated_at_idx": { + "name": "payload_migrations_updated_at_idx", + "columns": [ + { + "expression": "updated_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "payload_migrations_created_at_idx": { + "name": "payload_migrations_created_at_idx", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.featured_news": { + "name": "featured_news", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "title": { + "name": "title", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "label": { + "name": "label", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "default": "'News'" + }, + "date": { + "name": "date", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": true + }, + "source": { + "name": "source", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "source_url": { + "name": "source_url", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "thumbnail_id": { + "name": "thumbnail_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp(3) with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "featured_news_thumbnail_idx": { + "name": "featured_news_thumbnail_idx", + "columns": [ + { + "expression": "thumbnail_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "featured_news_thumbnail_id_media_id_fk": { + "name": "featured_news_thumbnail_id_media_id_fk", + "tableFrom": "featured_news", + "tableTo": "media", + "columnsFrom": [ + "thumbnail_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": { + "public.enum_users_role": { + "name": "enum_users_role", + "schema": "public", + "values": [ + "superadmin", + "admin" + ] + }, + "public.enum_news_items_color_theme": { + "name": "enum_news_items_color_theme", + "schema": "public", + "values": [ + "coral-red", + "warm-orange", + "deep-olive", + "emerald-green", + "soft-gray" + ] + } + }, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": {}, + "_meta": { + "schemas": {}, + "tables": {}, + "columns": {} + }, + "id": "3408a2f8-2254-4e8e-8486-901dea49815e", + "prevId": "00000000-0000-0000-0000-000000000000" +} \ No newline at end of file diff --git a/cms/src/migrations/20260527_153646.ts b/cms/src/migrations/20260527_153646.ts new file mode 100644 index 0000000..5f75679 --- /dev/null +++ b/cms/src/migrations/20260527_153646.ts @@ -0,0 +1,19 @@ +import { MigrateUpArgs, MigrateDownArgs, sql } from '@payloadcms/db-postgres' + +export async function up({ db, payload, req }: MigrateUpArgs): Promise { + await db.execute(sql` + ALTER TABLE "news_items" ALTER COLUMN "source" DROP NOT NULL; + ALTER TABLE "news_items" ALTER COLUMN "source_url" DROP NOT NULL; + ALTER TABLE "featured_news" ALTER COLUMN "source" DROP NOT NULL; + ALTER TABLE "featured_news" ALTER COLUMN "source_url" DROP NOT NULL; + ALTER TABLE "news_items" DROP COLUMN "category_label";`) +} + +export async function down({ db, payload, req }: MigrateDownArgs): Promise { + await db.execute(sql` + ALTER TABLE "news_items" ALTER COLUMN "source" SET NOT NULL; + ALTER TABLE "news_items" ALTER COLUMN "source_url" SET NOT NULL; + ALTER TABLE "featured_news" ALTER COLUMN "source" SET NOT NULL; + ALTER TABLE "featured_news" ALTER COLUMN "source_url" SET NOT NULL; + ALTER TABLE "news_items" ADD COLUMN "category_label" varchar DEFAULT 'News' NOT NULL;`) +} diff --git a/cms/src/migrations/index.ts b/cms/src/migrations/index.ts index 594d5d3..b6effa8 100644 --- a/cms/src/migrations/index.ts +++ b/cms/src/migrations/index.ts @@ -1,5 +1,6 @@ import * as migration_20260522_081701 from './20260522_081701'; import * as migration_20260522_100831 from './20260522_100831'; +import * as migration_20260527_153646 from './20260527_153646'; export const migrations = [ { @@ -10,6 +11,11 @@ export const migrations = [ { up: migration_20260522_100831.up, down: migration_20260522_100831.down, - name: '20260522_100831' + name: '20260522_100831', + }, + { + up: migration_20260527_153646.up, + down: migration_20260527_153646.down, + name: '20260527_153646' }, ]; diff --git a/cms/src/payload-types.ts b/cms/src/payload-types.ts index 486c217..a67fec7 100644 --- a/cms/src/payload-types.ts +++ b/cms/src/payload-types.ts @@ -188,9 +188,8 @@ export interface NewsItem { id: number; title: string; date: string; - categoryLabel: string; - source: string; - sourceUrl: string; + source?: string | null; + sourceUrl?: string | null; type: number | NewsType; colorTheme: 'coral-red' | 'warm-orange' | 'deep-olive' | 'emerald-green' | 'soft-gray'; thumbnail?: (number | null) | Media; @@ -336,7 +335,6 @@ export interface NewsTypesSelect { export interface NewsItemsSelect { title?: T; date?: T; - categoryLabel?: T; source?: T; sourceUrl?: T; type?: T; @@ -395,8 +393,8 @@ export interface FeaturedNew { description: string; label: string; date: string; - source: string; - sourceUrl: string; + source?: string | null; + sourceUrl?: string | null; thumbnail: number | Media; updatedAt?: string | null; createdAt?: string | null; diff --git a/new-branding/src/components/blog/ArticleCard/index.scss b/new-branding/src/components/blog/ArticleCard/index.scss index 8e5e173..4aeef8b 100644 --- a/new-branding/src/components/blog/ArticleCard/index.scss +++ b/new-branding/src/components/blog/ArticleCard/index.scss @@ -18,8 +18,8 @@ } } - .article-card__source { - border-bottom: 1px solid color-mix(in srgb, $color 44.5%, black); + .article-card__preview-divider { + background: linear-gradient(180deg, color-mix(in srgb, $color 44.5%, black) 0%, transparent 100%); } } @@ -60,6 +60,13 @@ object-fit: cover; } + &__top-side { + display: flex; + gap: 10px; + align-items: center; + justify-content: space-between; + } + &__placeholder { position: relative; width: 100%; @@ -78,6 +85,16 @@ } } + &__preview-divider { + position: absolute; + bottom: 10px; + left: 50%; + width: calc(100% - 38px); + transform: translateX(-50%); + height: 0.7px; + pointer-events: none; + } + &__article { @include text-geist-mono("400-10"); display: flex; diff --git a/new-branding/src/components/blog/ArticleCard/index.tsx b/new-branding/src/components/blog/ArticleCard/index.tsx index 9b8dfbf..2cec29a 100644 --- a/new-branding/src/components/blog/ArticleCard/index.tsx +++ b/new-branding/src/components/blog/ArticleCard/index.tsx @@ -4,7 +4,10 @@ import "./index.scss"; import { Post } from "@/lib/axios/types"; import { formatPostDate } from "@/lib/date"; -export const ArticleCard: React.FC = ({ categoryLabel, source, title, date, thumbnail, sourceUrl, colorTheme }) => { +export const ArticleCard: React.FC = ({ type, source, title, date, thumbnail, sourceUrl, colorTheme }) => { + const hasSource = !!source; + const hasSourceUrl = !!sourceUrl; + return (
@@ -14,22 +17,31 @@ export const ArticleCard: React.FC = ({ categoryLabel, source, title, date
Article
- {source} + {hasSource && hasSourceUrl && {source}} +
)} - - - + {hasSourceUrl && hasSource && ( + + + + )}
- {categoryLabel} -

{source}

+
+ {type?.label} + {hasSource && hasSourceUrl &&

{source}

} +

- - {title} - + {hasSourceUrl && hasSource ? ( + + {title} + + ) : ( + title + )}


diff --git a/new-branding/src/components/blog/Info/index.tsx b/new-branding/src/components/blog/Info/index.tsx index 9daf584..916f33b 100644 --- a/new-branding/src/components/blog/Info/index.tsx +++ b/new-branding/src/components/blog/Info/index.tsx @@ -38,10 +38,14 @@ export const BlogInfo: React.FC<{ isLoading: boolean; featured: FeaturedNews | u
- - Read on {featured?.source} - - + {featured?.sourceUrl ? ( + + Read on {featured?.source ?? "source"} + + + ) : ( + <> + )}
diff --git a/new-branding/src/lib/axios/types.ts b/new-branding/src/lib/axios/types.ts index d80cb65..cb29b62 100644 --- a/new-branding/src/lib/axios/types.ts +++ b/new-branding/src/lib/axios/types.ts @@ -21,9 +21,8 @@ export type Post = { id: number; title: string; date: string; - categoryLabel: string; - source: string; - sourceUrl: string; + source?: string; + sourceUrl?: string; type: PostType | null; colorTheme: ColorTheme; thumbnail: PostThumbnail | null; @@ -51,7 +50,7 @@ export type FeaturedNews = { description: string; date: string; label: string; - source: string; - sourceUrl: string; + source?: string; + sourceUrl?: string; thumbnail: PostThumbnail | null; };