From 72c238a4dcbfa91ce83333c1afcf961ebdf0d2d4 Mon Sep 17 00:00:00 2001 From: pluja Date: Thu, 22 May 2025 22:38:41 +0000 Subject: [PATCH] Release 2025-05-22-16vM --- .platform/hooks/predeploy/01_dump_database.sh | 4 + docker-compose.yml | 2 +- web/Dockerfile | 7 +- web/{docker-entrypoint.sh => migrate.sh} | 4 +- web/src/components/Button.astro | 6 +- web/src/components/ServiceCard.astro | 26 +- web/src/components/ServicesFilters.astro | 31 +- .../components/ServicesSearchResults.astro | 110 ++++- web/src/constants/commentStatusFilters.ts | 8 +- web/src/pages/admin/comments.astro | 3 +- web/src/pages/health.ts | 16 + web/src/pages/index.astro | 443 +++++++++--------- 12 files changed, 392 insertions(+), 268 deletions(-) create mode 100644 .platform/hooks/predeploy/01_dump_database.sh rename web/{docker-entrypoint.sh => migrate.sh} (87%) create mode 100644 web/src/pages/health.ts diff --git a/.platform/hooks/predeploy/01_dump_database.sh b/.platform/hooks/predeploy/01_dump_database.sh new file mode 100644 index 0000000..de1feb1 --- /dev/null +++ b/.platform/hooks/predeploy/01_dump_database.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +pwd +just dump-db \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index c86b674..f9b7310 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -70,7 +70,7 @@ services: expose: - 4321 healthcheck: - test: ["CMD", "curl", "-k", "--silent", "--fail", "http://localhost:4321"] + test: ["CMD", "curl", "-k", "--silent", "--fail", "http://localhost:4321/health"] interval: 10s timeout: 5s retries: 5 diff --git a/web/Dockerfile b/web/Dockerfile index 07585de..9d3ec87 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -19,9 +19,8 @@ ENV HOST=0.0.0.0 ENV PORT=4321 EXPOSE 4321 -# Add entrypoint script and make it executable -COPY docker-entrypoint.sh /usr/local/bin/ -RUN chmod +x /usr/local/bin/docker-entrypoint.sh +# Add knm-migrate command script and make it executable +COPY migrate.sh /usr/local/bin/knm-migrate +RUN chmod +x /usr/local/bin/knm-migrate -ENTRYPOINT ["docker-entrypoint.sh"] CMD ["node", "./dist/server/entry.mjs"] diff --git a/web/docker-entrypoint.sh b/web/migrate.sh similarity index 87% rename from web/docker-entrypoint.sh rename to web/migrate.sh index 8396032..93ad942 100644 --- a/web/docker-entrypoint.sh +++ b/web/migrate.sh @@ -16,6 +16,4 @@ for trigger_file in prisma/triggers/*.sql; do fi done -# Start the application -echo "Starting the application..." -exec "$@" +echo "Migrations completed." diff --git a/web/src/components/Button.astro b/web/src/components/Button.astro index 6a8f95a..9b87bd2 100644 --- a/web/src/components/Button.astro +++ b/web/src/components/Button.astro @@ -19,6 +19,7 @@ type Props = Polymorphic< dataAstroReload?: boolean children?: never disabled?: boolean + inlineIcon?: boolean } > @@ -143,6 +144,7 @@ const { role, dataAstroReload, disabled, + inlineIcon, ...htmlProps } = Astro.props @@ -164,11 +166,11 @@ const ActualTag = disabled && Tag === 'a' ? 'span' : Tag {...dataAstroReload && { 'data-astro-reload': dataAstroReload }} {...htmlProps} > - {!!icon && } + {!!icon && } {!!label && {label}} { !!endIcon && ( - + {endIcon} ) diff --git a/web/src/components/ServiceCard.astro b/web/src/components/ServiceCard.astro index 6aca091..32cf512 100644 --- a/web/src/components/ServiceCard.astro +++ b/web/src/components/ServiceCard.astro @@ -88,12 +88,26 @@ const overallScoreInfo = makeOverallScoreInfo(overallScore)

{name}{ statusIcon && ( - - + + {[ + , + verificationStatus === 'VERIFICATION_FAILED' && ( + SCAM + ), + ]} ) } diff --git a/web/src/components/ServicesFilters.astro b/web/src/components/ServicesFilters.astro index e4d98ea..6e6cea5 100644 --- a/web/src/components/ServicesFilters.astro +++ b/web/src/components/ServicesFilters.astro @@ -304,9 +304,16 @@ const { /> { - options.attributesByCategory.map(({ category, attributes }) => ( + options.attributesByCategory.map(({ categoryInfo, attributes }) => (
- {category} + +
    {attributes.map((attribute) => { @@ -371,11 +378,9 @@ const {