From f6d7bf9ce9c26fc503decc322514fb96c0c9ccc2 Mon Sep 17 00:00:00 2001 From: Machac Date: Mon, 20 Oct 2025 14:14:29 +0200 Subject: [PATCH 1/6] Release/7.0.0-rc15 --- package.json | 2 +- projects/netgrif-components-core/package.json | 2 +- projects/netgrif-components/package.json | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 7533010c5..098b954d3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@netgrif/components-project", - "version": "7.0.0-rc.14", + "version": "7.0.0-rc.15", "description": "Netgrif Application Engine Frontend project. Project includes angular libraries as base for NAE applications.", "homepage": "https://components.netgrif.com", "license": "SEE LICENSE IN LICENSE", diff --git a/projects/netgrif-components-core/package.json b/projects/netgrif-components-core/package.json index 54c4c38eb..0cc2bcdbf 100644 --- a/projects/netgrif-components-core/package.json +++ b/projects/netgrif-components-core/package.json @@ -1,6 +1,6 @@ { "name": "@netgrif/components-core", - "version": "7.0.0-rc.14", + "version": "7.0.0-rc.15", "description": "Netgrif Application engine frontend core Angular library", "homepage": "https://components.netgrif.com", "license": "SEE LICENSE IN LICENSE", diff --git a/projects/netgrif-components/package.json b/projects/netgrif-components/package.json index 842cd37f6..e1ae0d78b 100644 --- a/projects/netgrif-components/package.json +++ b/projects/netgrif-components/package.json @@ -1,6 +1,6 @@ { "name": "@netgrif/components", - "version": "7.0.0-rc.14", + "version": "7.0.0-rc.15", "description": "Netgrif Application Engine frontend Angular components", "homepage": "https://components.netgrif.com", "license": "SEE LICENSE IN LICENSE", @@ -29,7 +29,7 @@ "nae frontend" ], "peerDependencies": { - "@netgrif/components-core": "7.0.0-rc.14", + "@netgrif/components-core": "7.0.0-rc.15", "@angular-material-components/datetime-picker": "~16.0.0", "@angular-material-components/moment-adapter": "~16.0.0", "@angular/animations": "~17.1.0", From f717a5891a72dbdbbce83e5b5acb02efde7200df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Kov=C3=A1=C4=8Dik?= Date: Tue, 4 Nov 2025 15:28:10 +0100 Subject: [PATCH 2/6] [NAE-2251] NAE - Map field options are not translated - add resolving i18n to panels --- .../filter/models/case-search-request-body.ts | 6 +++- .../abstract/panel-with-immediate-data.ts | 34 ++++++++++++++----- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/projects/netgrif-components-core/src/lib/filter/models/case-search-request-body.ts b/projects/netgrif-components-core/src/lib/filter/models/case-search-request-body.ts index c90158987..9e9883e38 100644 --- a/projects/netgrif-components-core/src/lib/filter/models/case-search-request-body.ts +++ b/projects/netgrif-components-core/src/lib/filter/models/case-search-request-body.ts @@ -82,7 +82,11 @@ export interface PetriNetSearchRequest { /** * Queried PetriNet identifier */ - identifier: string; + identifier?: string; + /** + * Queried PetriNet mongo ID + */ + processId?: string; } /** diff --git a/projects/netgrif-components-core/src/lib/panel/abstract/panel-with-immediate-data.ts b/projects/netgrif-components-core/src/lib/panel/abstract/panel-with-immediate-data.ts index 1fed87e5e..30b1a91ab 100644 --- a/projects/netgrif-components-core/src/lib/panel/abstract/panel-with-immediate-data.ts +++ b/projects/netgrif-components-core/src/lib/panel/abstract/panel-with-immediate-data.ts @@ -7,6 +7,7 @@ import {FeaturedValue} from './featured-value'; import {CurrencyPipe} from '@angular/common'; import {ImmediateData} from '../../resources/interface/immediate-data'; import {OverflowService} from '../../header/services/overflow.service'; +import {I18nFieldValue} from "../../data-fields/i18n-field/models/i18n-field-value"; @Component({ selector: 'ncc-abstract-panel-with-immediate', @@ -35,33 +36,37 @@ export abstract class AbstractPanelWithImmediateDataComponent extends AbstractPa case 'dateTime': return { value: toMoment(immediate.value as NaeDate).format(DATE_TIME_FORMAT_STRING), - icon: 'event', type: immediate.type + icon: 'event', + type: immediate.type }; case 'enumeration': - return {value: immediate.value.defaultValue, icon: undefined, type: immediate.type}; + return {value: this.getTranslation(immediate.value), icon: undefined, type: immediate.type}; case 'multichoice': return { - value: immediate.value.map(it => it.defaultValue).join(', '), + value: immediate.value.map(it => this.getTranslation(it)).join(', '), icon: undefined, type: immediate.type }; case 'enumeration_map': return { - value: immediate.options[immediate.value].defaultValue, + value: this.getTranslation(immediate.options[immediate.value]), icon: undefined, type: immediate.type }; case 'multichoice_map': return { value: immediate.value.map(it => - immediate.options[it].defaultValue).join(', '), icon: undefined, type: immediate.type + this.getTranslation(immediate.options[it])).join(', '), + icon: undefined, + type: immediate.type }; case 'file': return {value: immediate.value?.name, icon: 'insert_drive_file', type: immediate.type}; case 'fileList': return { value: immediate.value?.namesPaths.map(obj => obj.name).join(', '), - icon: 'file_copy', type: immediate.type + icon: 'file_copy', + type: immediate.type }; case 'userList': return {value: immediate.value?.userValues.map(obj => obj.fullName).join(', '), icon: 'account_circle', type: immediate.type}; @@ -74,9 +79,13 @@ export abstract class AbstractPanelWithImmediateDataComponent extends AbstractPa }; case 'button': return { - value: (immediate as any).placeholder && (immediate as any).placeholder.defaultValue !== undefined - ? (immediate as any).placeholder.defaultValue : (immediate.name && immediate.name.defaultValue !== undefined - ? immediate.name.defaultValue : this._translate.instant('dialog.submit')), + value: (immediate as any).placeholder?.defaultValue !== undefined + ? this.getTranslation((immediate as any).placeholder) + : ( + immediate.name?.defaultValue !== undefined + ? this.getTranslation(immediate.name) + : this._translate.instant('dialog.submit') + ), icon: undefined, type: immediate.type }; case 'filter': @@ -101,6 +110,13 @@ export abstract class AbstractPanelWithImmediateDataComponent extends AbstractPa } } + protected getTranslation(i18n: I18nFieldValue): string { + const locale = this._translate.currentLang; + return (i18n && locale in i18n.translations) + ? i18n.translations[locale] + : i18n?.defaultValue; + } + protected formatCurrencyPipe(value: any, code: string, fraction: number, locale: string, type: string) { return { value: From 8ea72467e3e2761b581f8229381e6e7dc8a37a54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Kov=C3=A1=C4=8Dik?= Date: Tue, 4 Nov 2025 15:43:47 +0100 Subject: [PATCH 3/6] [NAE-2251] NAE - Map field options are not translated - fix tests --- .../lib/panel/case-panel/abstract-case-panel.component.spec.ts | 2 +- .../src/lib/panel/case-panel/case-panel.component.spec.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/netgrif-components-core/src/lib/panel/case-panel/abstract-case-panel.component.spec.ts b/projects/netgrif-components-core/src/lib/panel/case-panel/abstract-case-panel.component.spec.ts index a64acb106..b20f90872 100644 --- a/projects/netgrif-components-core/src/lib/panel/case-panel/abstract-case-panel.component.spec.ts +++ b/projects/netgrif-components-core/src/lib/panel/case-panel/abstract-case-panel.component.spec.ts @@ -163,7 +163,7 @@ class TestWrapperComponent { {stringId: 'date', title: 'string', type: 'date', value: [2020, 1, 1, 10, 10]}, {stringId: 'string', title: 'string', type: 'string', value: 'dasdsadsad'}, {stringId: 'dateTime', title: 'string', type: 'dateTime', value: [2020, 1, 1, 10, 10]}, - {stringId: 'enum', title: 'string', type: 'enumeration', value: {defaultValue: 'dasd'}}, + {stringId: 'enum', title: 'string', type: 'enumeration', value: {defaultValue: 'dasd', translations: {}}}, ] }; } diff --git a/projects/netgrif-components/src/lib/panel/case-panel/case-panel.component.spec.ts b/projects/netgrif-components/src/lib/panel/case-panel/case-panel.component.spec.ts index 86047b8d6..ce35de387 100644 --- a/projects/netgrif-components/src/lib/panel/case-panel/case-panel.component.spec.ts +++ b/projects/netgrif-components/src/lib/panel/case-panel/case-panel.component.spec.ts @@ -104,7 +104,7 @@ class TestWrapperComponent { {stringId: 'date', title: 'string', type: 'date', value: [2020, 1, 1, 10, 10]}, {stringId: 'string', title: 'string', type: 'string', value: 'dasdsadsad'}, {stringId: 'dateTime', title: 'string', type: 'dateTime', value: [2020, 1, 1, 10, 10]}, - {stringId: 'enum', title: 'string', type: 'enumeration', value: {defaultValue: 'dasd'}}, + {stringId: 'enum', title: 'string', type: 'enumeration', value: {defaultValue: 'dasd', translations: {}}}, ] }; } From 92c22c5359de1f9f27b47a9c8c6881cb0b3364bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Kov=C3=A1=C4=8Dik?= Date: Mon, 10 Nov 2025 14:19:09 +0100 Subject: [PATCH 4/6] [NAE-2251] NAE - Map field options are not translated - fix according to PR --- .../abstract/panel-with-immediate-data.ts | 25 +++++++++++-------- .../lib/resources/interface/immediate-data.ts | 7 +++++- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/projects/netgrif-components-core/src/lib/panel/abstract/panel-with-immediate-data.ts b/projects/netgrif-components-core/src/lib/panel/abstract/panel-with-immediate-data.ts index 30b1a91ab..9d6dd5644 100644 --- a/projects/netgrif-components-core/src/lib/panel/abstract/panel-with-immediate-data.ts +++ b/projects/netgrif-components-core/src/lib/panel/abstract/panel-with-immediate-data.ts @@ -78,15 +78,18 @@ export abstract class AbstractPanelWithImmediateDataComponent extends AbstractPa icon: undefined, type: immediate.type }; case 'button': + let buttonValue: string; + if ((immediate as any).placeholder?.defaultValue !== undefined) { + buttonValue = this.getTranslation((immediate as any).placeholder); + } else if (immediate.name?.defaultValue !== undefined) { + buttonValue = this.getTranslation(immediate.name); + } else { + buttonValue = this._translate.instant('dialog.submit'); + } return { - value: (immediate as any).placeholder?.defaultValue !== undefined - ? this.getTranslation((immediate as any).placeholder) - : ( - immediate.name?.defaultValue !== undefined - ? this.getTranslation(immediate.name) - : this._translate.instant('dialog.submit') - ), - icon: undefined, type: immediate.type + value: buttonValue, + icon: undefined, + type: immediate.type }; case 'filter': return { @@ -110,11 +113,11 @@ export abstract class AbstractPanelWithImmediateDataComponent extends AbstractPa } } - protected getTranslation(i18n: I18nFieldValue): string { + protected getTranslation(i18n: I18nFieldValue | undefined): string { const locale = this._translate.currentLang; - return (i18n && locale in i18n.translations) + return (i18n && i18n.translations && locale in i18n.translations) ? i18n.translations[locale] - : i18n?.defaultValue; + : (i18n?.defaultValue ?? ''); } protected formatCurrencyPipe(value: any, code: string, fraction: number, locale: string, type: string) { diff --git a/projects/netgrif-components-core/src/lib/resources/interface/immediate-data.ts b/projects/netgrif-components-core/src/lib/resources/interface/immediate-data.ts index c207fcc1e..da9bbedec 100644 --- a/projects/netgrif-components-core/src/lib/resources/interface/immediate-data.ts +++ b/projects/netgrif-components-core/src/lib/resources/interface/immediate-data.ts @@ -1,6 +1,7 @@ import {FilterMetadata} from '../../search/models/persistance/filter-metadata'; import {FormatFilter} from '../../data-fields/models/format-filter'; import {Component} from '../../data-fields/models/component'; +import {I18nFieldTranslations} from "../../data-fields/i18n-field/models/i18n-field-value"; /** * @ignore @@ -47,5 +48,9 @@ export interface ImmediateData { /** * Only for enumeration_map and multichoice_map */ - options?: { defaultValue?: string }; + options?: { + defaultValue?: string, + key?: string; + translations?: I18nFieldTranslations; + }; } From 8af27f297dbd722579b438dde7c14198fd2a078c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Kov=C3=A1=C4=8Dik?= Date: Mon, 10 Nov 2025 14:25:17 +0100 Subject: [PATCH 5/6] [NAE-2251] NAE - Map field options are not translated - fix according to PR --- .../src/lib/resources/interface/immediate-data.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/projects/netgrif-components-core/src/lib/resources/interface/immediate-data.ts b/projects/netgrif-components-core/src/lib/resources/interface/immediate-data.ts index da9bbedec..8c7d33bbd 100644 --- a/projects/netgrif-components-core/src/lib/resources/interface/immediate-data.ts +++ b/projects/netgrif-components-core/src/lib/resources/interface/immediate-data.ts @@ -49,8 +49,10 @@ export interface ImmediateData { * Only for enumeration_map and multichoice_map */ options?: { - defaultValue?: string, - key?: string; - translations?: I18nFieldTranslations; + [k: string]: { + defaultValue?: string, + key?: string; + translations?: I18nFieldTranslations; + } }; } From 42b46b62c0c1f2c716783bcae5f8490669583b52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Kov=C3=A1=C4=8Dik?= Date: Mon, 10 Nov 2025 14:46:13 +0100 Subject: [PATCH 6/6] [NAE-2251] NAE - Map field options are not translated - fix according to PR --- .../src/lib/resources/interface/immediate-data.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/projects/netgrif-components-core/src/lib/resources/interface/immediate-data.ts b/projects/netgrif-components-core/src/lib/resources/interface/immediate-data.ts index 8c7d33bbd..9e5554333 100644 --- a/projects/netgrif-components-core/src/lib/resources/interface/immediate-data.ts +++ b/projects/netgrif-components-core/src/lib/resources/interface/immediate-data.ts @@ -1,7 +1,7 @@ import {FilterMetadata} from '../../search/models/persistance/filter-metadata'; import {FormatFilter} from '../../data-fields/models/format-filter'; import {Component} from '../../data-fields/models/component'; -import {I18nFieldTranslations} from "../../data-fields/i18n-field/models/i18n-field-value"; +import {I18nFieldValue} from "../../data-fields/i18n-field/models/i18n-field-value"; /** * @ignore @@ -49,10 +49,6 @@ export interface ImmediateData { * Only for enumeration_map and multichoice_map */ options?: { - [k: string]: { - defaultValue?: string, - key?: string; - translations?: I18nFieldTranslations; - } + [k: string]: I18nFieldValue }; }