Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),

#### Backend Core

- **Map**: `POST /api/config/client/short-url` shortens a viewer map URL when the caller can open that application and territory. A public visitor with no cookie is allowed. `sitmun.short-url.provider` defaults to `none`. A provider I/O failure returns `Short URL provider failed` ([sitmun-backend-core#272](https://github.com/sitmun/sitmun-backend-core/issues/272)).
- **Profile**: Client profile layers publish ordered `featureInfoFields` for `INFO` cartography parameters. The list is omitted when empty. Labels come from `STM_TRANSLATION` on `CartographyParameter.value` ([sitmun-backend-core#268](https://github.com/sitmun/sitmun-backend-core/pull/268), [#77](https://github.com/sitmun/sitmun-application-stack/issues/77)).

#### Admin Application
Expand All @@ -18,9 +19,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),

#### Viewer Application

- **Map**: A share link keeps the current map route and stores the view in `mapState`. Opening that link restores the extent, a non-default background, catalog layers that were turned on, reordered, or changed (including their opacity, sublayers, stacking order, and the selected layer of a radio group), drawings, an imported file, a shared feature, and the 3D camera. A missing background, layer, drawing, or file does not stop the rest of the restore. The browser does not call tinyurl.com. A failed shorten shows a map-language message ([sitmun-viewer-app#189](https://github.com/sitmun/sitmun-viewer-app/issues/189)).
- **Map**: A non-empty field list replaces the full GetFeatureInfo property table, in order, with the translated label. `T`, `N`, `F`, `U`, `P`, and `I` follow the map locale. `AUTO` keeps API-SITNA detection. `feature.data` is not rewritten ([sitmun-viewer-app#179](https://github.com/sitmun/sitmun-viewer-app/pull/179), [#77](https://github.com/sitmun/sitmun-application-stack/issues/77)).
- **Map**: The field list follows the profile layer id, including a WMS group child. Identify highlights do not persist. The identify popup is solid white after a drag. The MIA report docks to the map and closes when the next identify has no MIA layer ([sitmun-viewer-app#187](https://github.com/sitmun/sitmun-viewer-app/pull/187)).

#### Stack

- **Development**: `profiles/development-lvh.env` announces the stack as `http://lvh.me:9000`. The air-gapped default stays `localhost`.

#### Profile-level

- **Liquibase**: Development changelog 78 sets a description, a metadata URL, and a dataset URL on folder Adreces (tree node 12339) in Visor IDEBarcelona. Gestió municipal (node 12338) stays empty ([sitmun-viewer-app#173](https://github.com/sitmun/sitmun-viewer-app/issues/173)).
Expand Down
17 changes: 6 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ The stack has four main components:
# For Oracle
cp profiles/oracle.env .env

# Local named host (lvh.me resolves to 127.0.0.1). Open http://lvh.me:9000
cp profiles/development-lvh.env .env

# Edit environment variables for production
nano .env
```
Expand Down Expand Up @@ -478,15 +481,7 @@ Admin, viewer, and normal WMS/WFS proxy flows work without it. Root Playwright m

#### Frontend Configuration

```typescript
// Environment configuration for Angular apps
export const environment = {
production: boolean,
apiBaseURL: string,
logLevel: LogLevel,
hashLocationStrategy: boolean,
};
```
Admin `environment.ts` uses `apiBaseURL`. Viewer `environment.ts` uses `apiUrl` and `hashLocationStrategy`. Viewer `hashLocationStrategy` is `false` in `environment.ts` and `true` in `environment.prod.ts`. The production configuration is the only Docker build that compiles `environment.prod.ts`.

#### Backend Configuration

Expand Down Expand Up @@ -684,7 +679,7 @@ The frontend applications (Admin and Viewer) support three build configurations
| Configuration | Use Case | API URL | Source Maps | Optimization |
| -------------- | -------------------- | ------------------------ | ----------- | ------------- |
| `development` | Local `ng serve` | `localhost:9000/backend` | Yes | No |
| `docker-dev` | Docker debugging | Template-based | Yes | No |
| `docker-dev` | Docker debugging | `localhost:9000/backend` (`environment.ts`) | Yes | No |
| `production` | Docker production | Template-based | No | Yes |

#### Local Development
Expand Down Expand Up @@ -725,7 +720,7 @@ For debugging issues in a Docker environment, use the `docker-dev` configuration
ENVIRONMENT=development docker compose build front
```

This creates unoptimized builds with source maps enabled, while still using the template-based API URL configuration for Docker.
This creates unoptimized builds with source maps. `docker-dev` has no `fileReplacements` entry, so the image compiles `environment.ts` and calls `http://localhost:9000/backend`. The envsubst output in `environment.prod.ts` is compiled only by the production configuration.

#### Environment Files

Expand Down
12 changes: 10 additions & 2 deletions e2e/viewer/gfi-field-list.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,15 @@ async function identifyWithFieldList(page: Page, featureInfoFields: FieldSeed[])
throw new Error(`profile has no layer whose names include ${LAYER_NAME}`);
}
layer.featureInfoFields = featureInfoFields;
body.tasks = body.tasks ?? [];
// Toponímia is the seeded MIA parent. MIA removes that layer from the attribute popup.
body.tasks = (body.tasks ?? []).filter((task) => {
const typeId = task['typeId'];
const cartographyId = task['cartographyId'];
return !(
typeId === 16 &&
String(cartographyId) === String(QUERYABLE_LEAF_CARTOGRAPHY_ID)
);
});
body.tasks.push({
id: 'e2e-more-info',
name: TASK_NAME,
Expand All @@ -57,7 +65,7 @@ async function identifyWithFieldList(page: Page, featureInfoFields: FieldSeed[])
(response) =>
response.url().includes('/config/client/profile/') && response.ok(),
);
await loginAndOpenMap(page);
await loginAndOpenMap(page, { requireMiaParent: false });
const profileBody = (await (await profileSeen).json()) as ProfileBody;
await loadQueryableLeafIntoCapas(page);
await enableCapasGfi(page);
Expand Down
16 changes: 10 additions & 6 deletions e2e/viewer/helpers/mia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ export async function loginAndOpenMap(
territoryId?: number;
/** Cartography id of the expected type-16 MIA parent (default Toponímia 6). */
miaCartographyId?: number | string;
/** Set false when the spec removes that MIA parent so the attribute popup can render. */
requireMiaParent?: boolean;
},
): Promise<void> {
const appId = options?.appId ?? APP_ID;
Expand Down Expand Up @@ -73,12 +75,14 @@ export async function loginAndOpenMap(
profileBody.tasks?.some((task) => task['ui-control'] === 'sitna.moreInfoAdvanced'),
'profile must include sitna.moreInfoAdvanced (setup task-availability)',
).toBeTruthy();
expect(
profileBody.tasks?.some(
(task) => task.typeId === 16 && String(task.cartographyId) === miaCartographyId,
),
`profile must include MIA parent on cartography ${miaCartographyId}`,
).toBeTruthy();
if (options?.requireMiaParent !== false) {
expect(
profileBody.tasks?.some(
(task) => task.typeId === 16 && String(task.cartographyId) === miaCartographyId,
),
`profile must include MIA parent on cartography ${miaCartographyId}`,
).toBeTruthy();
}
await page.locator('#tc-slot-toc').waitFor({ state: 'attached', timeout: 90_000 });
await page.locator('.tc-tools-panel').evaluate((panel) => {
panel.classList.remove('tc-collapsed-right');
Expand Down
2 changes: 1 addition & 1 deletion front/admin/sitmun-admin-app
Submodule sitmun-admin-app updated 1 files
+4 −4 README.md
66 changes: 66 additions & 0 deletions profiles/development-lvh.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
###############################################################################
# Development stack announced as http://lvh.me:9000
#
# lvh.me resolves to 127.0.0.1. Nginx forwards that name in X-Forwarded-Host.
# Open the stack at http://lvh.me:9000. A shared link is accepted when its host
# is lvh.me.
#
# The air-gapped default stays profiles/development.env (PUBLIC_HOSTNAME
# localhost). Production sets PUBLIC_HOSTNAME to the real site name.
#
# Usage:
# 1. cp profiles/development-lvh.env .env
# 2. docker compose up -d --force-recreate front
###############################################################################

COMPOSE_PROFILES=postgres
# Opt-in example: COMPOSE_PROFILES=postgres,demo,mbtiles

# --- Base URL ---
PUBLIC_URL_SCHEME=http
PUBLIC_HOSTNAME=lvh.me
PUBLIC_PORT=9000
PUBLIC_NON_STANDARD_PORT=1
PUBLIC_BASE_PATH=/

# --- Container ---
# LOCAL_PORT=9000
# LOCAL_BASE_PATH=/
ENVIRONMENT=development

# --- Database ---
# SITMUN_CONFIG_DIR=development/backend
# DATABASE_TYPE=postgres
# DATABASE_URL=jdbc:postgresql://postgres:5432/
# DATABASE=sitmun3
# DATABASE_USERNAME=sitmun3
# DATABASE_PASSWORD=sitmun3

# --- Liquibase (development seed) ---
# Development profile uses profiles/development/backend with extensive dev/demo data:
# - 42 Liquibase changesets including tourism data, test users, and sample configurations
# - SPRING_LIQUIBASE_CONTEXTS=dev (hardcoded in application.yml)
# Production profiles use minimal seed data (only 7 base changesets)

# --- Hibernate ---
# JPA/Hibernate settings are configured via Spring profiles:
# - Dialect loaded from application-postgres.yml (PostgreSQLDialect)
# - DDL mode defaults to 'none' (Liquibase manages schema)
# Uncomment to override:
# SPRING_JPA_HIBERNATE_DDL_AUTO=none

# --- Proxy ---
# FORCE_USE_OF_PROXY=true

# --- Security ---
# MIDDLEWARE_SECRET=your-secure-secret-here

# --- Development Mode ---
# Spring Boot profile automatically set to match DATABASE_TYPE (postgres)
# Logging levels use defaults from application.yml:
# - LOGGING_LEVEL_ROOT=INFO
# - LOGGING_LEVEL_ORG_SITMUN=DEBUG
# Uncomment to override:
# SPRING_PROFILES_ACTIVE=postgres
# LOGGING_LEVEL_ROOT=INFO
# LOGGING_LEVEL_ORG_SITMUN=DEBUG
Loading