@nettyapps/ntybase 21.1.18 → 21.1.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -479,7 +479,8 @@ class NettyAppsBase {
479
479
  constructor() {
480
480
  effect(() => {
481
481
  const name = this.pageName();
482
- if (name) {
482
+ const isEmbedded = this._isEmbedded();
483
+ if (name && !isEmbedded) {
483
484
  const translationKey = name.startsWith('@') ? name : `@${name}`;
484
485
  this.translateService.stream(translationKey).subscribe((translated) => {
485
486
  if (translated == translationKey) {
@@ -1364,7 +1365,6 @@ class NettyAgGridBase extends NettyAppsBase {
1364
1365
  allowLog = signal(false, ...(ngDevMode ? [{ debugName: "allowLog" }] : []));
1365
1366
  allowRead = signal(true, ...(ngDevMode ? [{ debugName: "allowRead" }] : []));
1366
1367
  // Parse query parameters
1367
- // Parse query parameters
1368
1368
  queryParameterGUID = toSignal(this.routerActive.queryParamMap.pipe(map((params) => params.get('parameters')), map((value) => this.parseOrReturnValue(value))), {
1369
1369
  initialValue: null, // set initial value to null
1370
1370
  });
@@ -2496,7 +2496,7 @@ class NettyAgGridSaveBase extends NettyAppsBase {
2496
2496
  if (this.viewMode() === 'dialog' && this.dialogData) {
2497
2497
  return this.dialogData.parameters || '';
2498
2498
  }
2499
- if (this.parameters) {
2499
+ if (this.parameters()) {
2500
2500
  try {
2501
2501
  return JSON.parse(this.parameters());
2502
2502
  }
@@ -2612,6 +2612,20 @@ class NettyAgGridSaveBase extends NettyAppsBase {
2612
2612
  error: (err) => this.alertService.showError('@updateFailed', err),
2613
2613
  });
2614
2614
  }
2615
+ /**
2616
+ * Create new record
2617
+ */
2618
+ async createNewData() {
2619
+ // If no GUID provided, initialize a new record
2620
+ let newRecord = this.createNewRecord();
2621
+ newRecord = await lastValueFrom(this.nettyAppsProxy.initRecord(newRecord))
2622
+ .catch((er) => {
2623
+ console.error('@initRecordFailed:', er);
2624
+ return this.createNewRecord();
2625
+ });
2626
+ this.initializeFormData(newRecord);
2627
+ this.updateValid.set(true);
2628
+ }
2615
2629
  /**
2616
2630
  * Load data from API based on GUID
2617
2631
  * Handles both new record creation and existing record editing
@@ -2620,15 +2634,7 @@ class NettyAgGridSaveBase extends NettyAppsBase {
2620
2634
  async loadDetailData() {
2621
2635
  const guid = this.getGuidFromParameters();
2622
2636
  if (!guid) {
2623
- // If no GUID provided, initialize a new record
2624
- let newRecord = this.createNewRecord();
2625
- newRecord = await lastValueFrom(this.nettyAppsProxy.initRecord(newRecord))
2626
- .catch((er) => {
2627
- console.error('@initRecordFailed:', er);
2628
- return this.createNewRecord();
2629
- });
2630
- this.initializeFormData(newRecord);
2631
- this.updateValid.set(true);
2637
+ await this.createNewData();
2632
2638
  return;
2633
2639
  }
2634
2640
  // Fetch existing record from API