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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- **Languages**: Set as Default no longer stays disabled after open. Default-language lookups use a single `/api/` slash so Spring Security 7 accepts `findByName`.
- **Grids**: AG Grid 32 registers `CommunityFeaturesModule` so text/select cell editors mount. Date columns use the Instant-safe `datePicker` editor with `cellDataType: false` so Positions Alta/Baja edit no longer throws in `DateStringCellEditor`.
- **Tests**: Jest specs match Angular 22 realities (`ng-reflect-*` opt-in, HostListener rename, `@if (; as)` syntax, jsdom Location, FileReader under Node 24) and use a 30s default timeout.

- **Layers**: An Image feature-information field stores max width and max height in its options. The picture address stays unchanged.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@ import { MatDialog } from '@angular/material/dialog';
import { MatSnackBar } from '@angular/material/snack-bar';

import { AgGridModule } from '@ag-grid-community/angular';
import { CellClickedEvent, ColDef, FilterChangedEvent, GridApi, GridReadyEvent, ModuleRegistry } from '@ag-grid-community/core';
import {
CellClickedEvent,
ColDef,
CommunityFeaturesModule,
FilterChangedEvent,
GridApi,
GridReadyEvent,
ModuleRegistry,
} from '@ag-grid-community/core';
import { InfiniteRowModelModule } from '@ag-grid-community/infinite-row-model';
import { TranslateModule, TranslateService } from '@ngx-translate/core';
import { debounceTime, forkJoin, tap } from 'rxjs';
Expand Down Expand Up @@ -35,7 +43,7 @@ import {
import { filterEnabledLanguages } from '@app/services/ui-language.resolver';
import { config } from '@config';

ModuleRegistry.registerModules([InfiniteRowModelModule]);
ModuleRegistry.registerModules([CommunityFeaturesModule, InfiniteRowModelModule]);

@Component({
selector: 'app-literal-translations',
Expand Down
11 changes: 8 additions & 3 deletions src/app/domain/translation/services/language.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export class LanguageService extends RestService<Language> {
*/
getCurrentDefaultLanguage(): Observable<string> {
return new Observable(observer => {
this.http.get<{ value: string }>(`${this.resourceService.getResourceUrl()}/configuration-parameters/search/findByName?name=language.default`)
this.http.get<{ value: string }>(this.apiUrl('configuration-parameters/search/findByName?name=language.default'))
.subscribe({
next: (config) => {
observer.next(config.value);
Expand All @@ -105,7 +105,7 @@ export class LanguageService extends RestService<Language> {
*/
previewDefaultLanguageChange(from: string, to: string): Observable<DefaultLanguageChangePreview> {
return this.http.post<DefaultLanguageChangePreview>(
`${this.resourceService.getResourceUrl()}/language-default/change-preview`,
this.apiUrl('language-default/change-preview'),
{ from, to },
{context: new HttpContext().set(SUPPRESS_HTTP_NOTIFICATION, true)}
);
Expand All @@ -116,9 +116,14 @@ export class LanguageService extends RestService<Language> {
*/
applyDefaultLanguageChange(request: DefaultLanguageChangeRequest): Observable<DefaultLanguageChangeResult> {
return this.http.post<DefaultLanguageChangeResult>(
`${this.resourceService.getResourceUrl()}/language-default/change`,
this.apiUrl('language-default/change'),
request,
{context: new HttpContext().set(SUPPRESS_HTTP_NOTIFICATION, true)}
);
}

/** Avoid `…/api//path` from getResourceUrl()'s trailing slash (401 under Spring Security 7). */
private apiUrl(path: string): string {
return `${this.resourceService.getResourceUrl().replace(/\/$/, '')}/${path.replace(/^\//, '')}`;
}
}
8 changes: 5 additions & 3 deletions src/app/frontend-gui/src/lib/data-grid/data-grid.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {MatTooltipModule} from '@angular/material/tooltip';

import {AgGridModule} from '@ag-grid-community/angular';
import {ClientSideRowModelModule} from '@ag-grid-community/client-side-row-model';
import {GridOptions, ModuleRegistry} from '@ag-grid-community/core';
import {CommunityFeaturesModule, GridOptions, ModuleRegistry} from '@ag-grid-community/core';
import {CsvExportModule} from '@ag-grid-community/csv-export';
import {InfiniteRowModelModule} from '@ag-grid-community/infinite-row-model';
import {TranslateModule, TranslateService} from '@ngx-translate/core';
Expand Down Expand Up @@ -61,9 +61,11 @@ import {DialogMessageComponent} from '../dialog-message/dialog-message.component
import {EditableLinkRendererComponent} from '../editable-link-renderer/editable-link-renderer.component';
import {RouterLinkRendererComponent} from '../router-link-renderer/router-link-renderer.component';

// Removed jQuery dependency

// AG Grid 32 moved editors/filters into CommunityFeaturesModule; without it,
// inline editors never mount. Date columns still use the grid's datePicker
// component (Instant-safe); CommunityFeaturesModule covers text/select editors.
ModuleRegistry.registerModules([
CommunityFeaturesModule,
ClientSideRowModelModule,
InfiniteRowModelModule,
CsvExportModule
Expand Down
7 changes: 6 additions & 1 deletion src/app/services/utils.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,10 @@ export class UtilsService {
filter: 'agDateColumnFilter',
filterParams: this.getDateFilterParams(options),
editable: editable ?? false,
// HAL Instant ISO strings are not AG Grid dateString (YYYY-MM-DD). Leaving
// cellDataType on lets DataTypeModule infer "text", then
// agDateStringCellEditor crashes: getDateParserFunction is not a function.
cellDataType: false,
emptyValueKey: options?.emptyValueKey,
headerTooltip: options?.headerTooltipKey
? this.getTranslate(options.headerTooltipKey)
Expand All @@ -444,7 +448,8 @@ export class UtilsService {
}
return this.getDateFormated(data);
},
cellEditor: 'agDateStringCellEditor',
// Native datePicker parses Instant via Date(); agDateStringCellEditor does not.
cellEditor: 'datePicker',
cellClass: (editable ?? false) ? null : 'read-only-cell'
};
}
Expand Down
Loading