From f2eab26ad032b029b95a3dca868c3478b8ccf79a Mon Sep 17 00:00:00 2001 From: voltsrage Date: Tue, 11 Aug 2026 20:33:23 +0800 Subject: [PATCH] fix: fix ci issues and update styles to remove ui elements --- .gitea/workflows/ci.yml | 14 ++++++++ .../Fixtures/ApiFixture.cs | 21 +++++++++--- vigilcare-records-web/public/favicon.svg | 5 ++- vigilcare-records-web/src/assets/main.css | 11 +++++++ vigilcare-records-web/src/assets/vue.svg | 1 - .../src/components/AppHeader.vue | 11 +++++-- .../src/views/PatientHistoryView.vue | 8 ++--- .../src/views/QueueDashboardView.vue | 12 +++---- vigilcare-records-web/tailwind.config.js | 32 ++++++++++++------- 9 files changed, 85 insertions(+), 30 deletions(-) delete mode 100644 vigilcare-records-web/src/assets/vue.svg diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index d46ba1a..63f2acc 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -14,6 +14,18 @@ on: jobs: backend: runs-on: ubuntu-latest + # act_runner's docker executor runs steps inside their own job container — a + # sibling of the "docker compose" containers below — so "localhost" from inside + # the job container is NOT the Docker host and can't reach the published + # Postgres/Redis ports (this is what "Connection refused" on 127.0.0.1:5437 + # in the Test step means). The Test step below points at host.docker.internal + # instead; that hostname must resolve inside the job container, which on Linux + # requires the runner itself (not this workflow) to add + # `--add-host=host.docker.internal:host-gateway` — set + # `container: { options: "--add-host=host.docker.internal:host-gateway" }` in the + # act_runner's config.yaml. Docker Desktop runners already resolve this hostname + # out of the box. See docs/25-gitea-cicd-docker-deploy.md ("Runner requirement + # for Compose-based tests"). steps: - uses: actions/checkout@v4 @@ -62,6 +74,8 @@ jobs: - name: Test env: ASPNETCORE_ENVIRONMENT: "Testing" + CONNECTIONSTRINGS__DEFAULTCONNECTION: "Host=host.docker.internal;Port=5437;Database=vigilcare_records_test;Username=postgres;Password=password" + REDIS__CONNECTIONSTRING: "host.docker.internal:6383,defaultDatabase=1,allowAdmin=true" run: | dotnet test VigilCareRecords.sln -c Release --no-build \ --logger "trx;LogFileName=test-results.trx" \ diff --git a/VigilCareRecordsAPI.Tests/Fixtures/ApiFixture.cs b/VigilCareRecordsAPI.Tests/Fixtures/ApiFixture.cs index 8f44c58..87d0f9b 100644 --- a/VigilCareRecordsAPI.Tests/Fixtures/ApiFixture.cs +++ b/VigilCareRecordsAPI.Tests/Fixtures/ApiFixture.cs @@ -9,17 +9,30 @@ public class ApiFixture : WebApplicationFactory, IAsyncLifetime { // Override configuration to point at a test database — never run tests against // the development database; a botched rollback could corrupt seed data. + // + // Defaults assume Postgres/Redis are reachable on the host's loopback address + // (e.g. `docker compose up -d postgres redis` on a dev machine). CI runners that + // execute the test step inside its own job container (act_runner's default docker + // executor) can't reach ports published on the Docker *host* via "localhost" — + // set CONNECTIONSTRINGS__DEFAULTCONNECTION / REDIS__CONNECTIONSTRING (e.g. to + // host.docker.internal) in that environment to override. protected override void ConfigureWebHost(IWebHostBuilder builder) { builder.UseEnvironment("Testing"); builder.ConfigureAppConfiguration((_, config) => { + var connectionString = Environment.GetEnvironmentVariable("CONNECTIONSTRINGS__DEFAULTCONNECTION") + ?? "Host=localhost;Port=5437;Database=vigilcare_records_test;Username=postgres;Password=password"; + var redisConnectionString = Environment.GetEnvironmentVariable("REDIS__CONNECTIONSTRING") + ?? "localhost:6383,defaultDatabase=1,allowAdmin=true"; + var fhirBaseUrl = Environment.GetEnvironmentVariable("FHIR__BASEURL") + ?? "http://localhost/fhir"; + config.AddInMemoryCollection(new Dictionary { - ["ConnectionStrings:DefaultConnection"] = - "Host=localhost;Port=5437;Database=vigilcare_records_test;Username=postgres;Password=password", - ["Redis:ConnectionString"] = "localhost:6383,defaultDatabase=1,allowAdmin=true", - ["Fhir:BaseUrl"] = "http://localhost/fhir" + ["ConnectionStrings:DefaultConnection"] = connectionString, + ["Redis:ConnectionString"] = redisConnectionString, + ["Fhir:BaseUrl"] = fhirBaseUrl }); }); } diff --git a/vigilcare-records-web/public/favicon.svg b/vigilcare-records-web/public/favicon.svg index 6893eb1..bbe3f5d 100644 --- a/vigilcare-records-web/public/favicon.svg +++ b/vigilcare-records-web/public/favicon.svg @@ -1 +1,4 @@ - \ No newline at end of file + + + + diff --git a/vigilcare-records-web/src/assets/main.css b/vigilcare-records-web/src/assets/main.css index 4b49673..7a9644d 100644 --- a/vigilcare-records-web/src/assets/main.css +++ b/vigilcare-records-web/src/assets/main.css @@ -1,7 +1,15 @@ +@import url('https://fonts.googleapis.com/css2?family=Public+Sans:wght@400;500;600;700;800&display=swap'); + @tailwind base; @tailwind components; @tailwind utilities; +@layer base { + body { + @apply font-sans; + } +} + @layer components { .btn-primary { @apply bg-primary-600 text-white px-4 py-2 rounded-md @@ -37,6 +45,9 @@ @apply flex flex-wrap items-center gap-2 sm:gap-4; } .card { + @apply bg-white rounded-md border border-gray-200 p-4 sm:p-6; + } + .card-elevated { @apply bg-white rounded-lg shadow-md p-4 sm:p-6; } .split-pane { diff --git a/vigilcare-records-web/src/assets/vue.svg b/vigilcare-records-web/src/assets/vue.svg deleted file mode 100644 index 770e9d3..0000000 --- a/vigilcare-records-web/src/assets/vue.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/vigilcare-records-web/src/components/AppHeader.vue b/vigilcare-records-web/src/components/AppHeader.vue index 392dae2..2f32a18 100644 --- a/vigilcare-records-web/src/components/AppHeader.vue +++ b/vigilcare-records-web/src/components/AppHeader.vue @@ -1,6 +1,13 @@