Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/next' into basemap_fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pelord committed Nov 29, 2024
2 parents 8770668 + d6480be commit 4c68422
Show file tree
Hide file tree
Showing 70 changed files with 2,378 additions and 3,449 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
run: npm audit --omit dev && npm audit signatures

- name: Quality
run: npm run circular-deps & npm run lint & npm run format.check
run: npm run circular-deps & npm run lint.ci & npm run format.check

- name: Test
run: npm run e2e & npm run test
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
run: npm audit --omit dev && npm audit signatures

- name: Quality
run: npm run circular-deps & npm run lint
run: npm run circular-deps & npm run lint.ci & npm run format.check

- name: Test
run: npm run e2e & npm run test
Expand Down
3,726 changes: 1,123 additions & 2,603 deletions package-lock.json

Large diffs are not rendered by default.

41 changes: 21 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"packages/*",
"projects/*"
],
"version": "18.0.0-next.1",
"version": "18.0.0-next.7",
"description": "IGO Library",
"author": "IGO Community",
"license": "MIT",
Expand All @@ -30,8 +30,9 @@
"build.doc": "compodoc -p tsconfig.json --disablePrivate --disableProtected --disableInternal --disableLifeCycleHooks --theme material",
"format.check": "prettier packages projects scripts --check --config .prettierrc",
"format": "npm run format --workspaces --if-present && npm run format.scripts",
"format.scripts": "prettier --write ./scripts/src/**/*.{ts,js,json}",
"format.scripts": "prettier --write ./scripts/src/**/*.{mts,ts,js,json}",
"lint": "ng lint",
"lint.ci": "ng lint --quiet",
"lint.fix": "ng lint --fix",
"e2e": "npm run prestart && npm run e2e -w demo",
"e2e.local": "npm run prestart &&npm run e2e.local -w demo",
Expand Down Expand Up @@ -82,33 +83,33 @@
"@angular-devkit/build-angular": "^18.2.1",
"@angular/cli": "^18.2.1",
"@angular/compiler-cli": "^18.2.1",
"@commitlint/cli": "^19.4.0",
"@commitlint/config-conventional": "^19.2.2",
"@commitlint/format": "^19.3.0",
"@commitlint/types": "^19.0.3",
"@commitlint/cli": "^19.6.0",
"@commitlint/config-conventional": "^19.6.0",
"@commitlint/format": "^19.5.0",
"@commitlint/types": "^19.5.0",
"@compodoc/compodoc": "^1.1.15",
"@cypress/schematic": "^2.5.1",
"@semantic-release/exec": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@semantic-release/github": "^10.1.0",
"@sentry/types": "^8.26.0",
"@stylistic/eslint-plugin": "^2.6.4",
"@semantic-release/github": "^11.0.0",
"@sentry/types": "^8.41.0",
"@stylistic/eslint-plugin": "^2.11.0",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@types/flexsearch": "^0.7.6",
"@types/geojson": "^7946.0.10",
"@types/hammerjs": "^2.0.36",
"@types/jasmine": "~4.3.0",
"@types/jasmine": "~5.1.0",
"@types/lodash-es": "^4.17.0",
"@types/node": "^20.10.0",
"@types/tinycolor2": "^1.4.4",
"angular-cli-ghpages": "^2.0.0",
"angular-eslint": "^18.3.0",
"angular-eslint": "^18.4.0",
"conventional-changelog-cli": "^5.0.0",
"copy-newer": "^2.1.2",
"cypress": "^13.13.0",
"del": "^7.1.0",
"eslint": "^9.9.0",
"execa": "^9.3.0",
"cypress": "^13.16.0",
"del": "^8.0.0",
"eslint": "^9.15.0",
"execa": "^9.5.0",
"jasmine-core": "~5.1.0",
"jasmine-spec-reporter": "~7.0.0",
"karma": "~6.4.2",
Expand All @@ -119,12 +120,12 @@
"lodash-es": "^4.17.21",
"madge": "^8.0.0",
"ng-packagr": "^18.2.1",
"prettier": "^3.3.0",
"sass": "^1.77.0",
"semantic-release": "^24.1.0",
"tsx": "^4.17.0",
"prettier": "^3.4.0",
"sass": "^1.81.0",
"semantic-release": "^24.2.0",
"tsx": "^4.19.0",
"typescript": "~5.5.4",
"typescript-eslint": "^8.2.0"
"typescript-eslint": "^8.16.0"
},
"madge": {
"detectiveOptions": {
Expand Down
2 changes: 1 addition & 1 deletion packages/auth/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@igo2/auth",
"version": "18.0.0-next.1",
"version": "18.0.0-next.7",
"description": "IGO Library",
"author": "IGO Community",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion packages/common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@igo2/common",
"version": "18.0.0-next.1",
"version": "18.0.0-next.7",
"description": "IGO Library",
"author": "IGO Community",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion packages/context/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@igo2/context",
"version": "18.0.0-next.1",
"version": "18.0.0-next.7",
"description": "IGO Library",
"author": "IGO Community",
"keywords": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ export class ContextService {
const source = layer.ol.getSource() as olVectorSource;
olFeatures = source.getFeatures();
}
const cleanedOlFeatures = this.exportService.generateFeature(
const cleanedOlFeatures = this.exportService.cleanFeatures(
olFeatures,
'GeoJSON',
'_featureStore'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,12 @@ export class LayerContextDirective implements OnInit, OnDestroy {
}
});

this.layerService
.createAsyncIdbLayers(context.uri)
.pipe(debounceTime(500))
.subscribe((layers: Layer[]) => this.handleAddLayers(layers));
if (this.configService.getConfig('offline')?.enable) {
this.layerService
.createAsyncIdbLayers(context.uri)
.pipe(debounceTime(500))
.subscribe((layers) => this.handleAddLayers(layers));
}
}

private handleAddLayers(layers: Layer[]) {
Expand Down
1 change: 1 addition & 0 deletions packages/core/analytics/src/analytics.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export class AnalyticsService {
(() => {
this.paq.push(['setTrackerUrl', url + '.php']);
this.paq.push(['setSiteId', this.options.id]);
this.paq.push(['setSecureCookie', location.protocol === 'https:']);
const g = document.createElement('script');
const s = document.getElementsByTagName('script')[0];
g.type = 'text/javascript';
Expand Down
4 changes: 2 additions & 2 deletions packages/core/config/src/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ export interface Version {
}

export const version: Version = {
lib: '18.0.0-next.1',
releaseDate: 1725378824462
lib: '18.0.0-next.7',
releaseDate: 1732800931298
};
1 change: 1 addition & 0 deletions packages/core/language/src/shared/language.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Observable } from 'rxjs';

export interface LanguageOptions {
prefix?: string | string[];
ignoreLibsLocale?: boolean;
}

export abstract class LanguageLoaderBase implements TranslateLoader {
Expand Down
99 changes: 66 additions & 33 deletions packages/core/language/src/shared/language.loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,57 +3,90 @@ import { HttpBackend, HttpClient } from '@angular/common/http';
import { ConfigService } from '@igo2/core/config';
import { ObjectUtils } from '@igo2/utils';

import { BehaviorSubject, first, forkJoin, map, switchMap, tap } from 'rxjs';
import {
BehaviorSubject,
Observable,
first,
forkJoin,
map,
of,
switchMap,
tap
} from 'rxjs';

import { LanguageLoaderBase } from './language.interface';
import { LanguageLoaderBase, LanguageOptions } from './language.interface';

export class LanguageLoader implements LanguageLoaderBase {
private httpClient: HttpClient;

private _isLoaded$ = new BehaviorSubject<boolean>(null);
isLoaded$ = this._isLoaded$.asObservable();

suffix = '.json';
prefix?: string | string[];
options: LanguageOptions;

constructor(handler: HttpBackend, options: LanguageOptions) {
this.httpClient = new HttpClient(handler);
this.options = options;
}

public getTranslation(lang: string): Observable<any> {
const igoLocale$ = this.httpClient.get(`locale/libs_locale/${lang}.json`);
if (!this.prefix) {
const prefix = this.options.prefix;
this.prefix = !prefix || Array.isArray(prefix) ? prefix : [prefix];
}

if (!this.prefix || this.prefix.length === 0) {
this._isLoaded$.next(true);
return this.options.ignoreLibsLocale ? of(undefined) : igoLocale$;
}

const appLocale$ = (this.prefix as string[]).map((prefix) =>
this.httpClient.get(`${prefix}${lang}${this.suffix}`)
);

const locale$ = [...appLocale$];

if (!this.options.ignoreLibsLocale) {
locale$.unshift(igoLocale$);
}

return forkJoin(locale$).pipe(
map((translations) => {
return translations.reduce(
(acc, current) => ObjectUtils.mergeDeep(acc, current),
{}
);
}),
tap(() => {
this._isLoaded$.next(true);
})
);
}
}

export class LanguageLoaderWithAsyncConfig extends LanguageLoader {
constructor(
handler: HttpBackend,
private configService: ConfigService,
private prefix?: string | string[],
private suffix = '.json'
prefix?: string | string[],
suffix = '.json'
) {
this.httpClient = new HttpClient(handler);
super(handler, undefined);
this.prefix = prefix;
this.suffix = suffix;
}

public getTranslation(lang: string): any {
const igoLocale$ = this.httpClient.get(`locale/libs_locale/${lang}.json`);
public getTranslation(lang: string): Observable<any> {
return this.configService.isLoaded$.pipe(
first((isLoaded) => isLoaded),
switchMap(() => {
if (this.configService && !this.prefix) {
const prefix = this.configService.getConfig('language.prefix');
this.prefix = !prefix || Array.isArray(prefix) ? prefix : [prefix];
}

if (!this.prefix || this.prefix.length === 0) {
this._isLoaded$.next(true);
return igoLocale$;
}

const appLocale$ = (this.prefix as string[]).map((prefix) =>
this.httpClient.get(`${prefix}${lang}${this.suffix}`)
);
this.options =
this.configService.getConfig<LanguageOptions>('language');

const locale$ = forkJoin([igoLocale$, ...appLocale$]);

return locale$.pipe(
map((translations) => {
return translations.reduce(
(acc, current) => ObjectUtils.mergeDeep(acc, current),
{}
);
}),
tap(() => {
this._isLoaded$.next(true);
})
);
return super.getTranslation(lang);
})
);
}
Expand Down
Loading

0 comments on commit 4c68422

Please sign in to comment.