@acorex/platform 20.3.0-next.21 → 20.3.0-next.22

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.
@@ -14,7 +14,7 @@ import { AXDropdownModule } from '@acorex/components/dropdown';
14
14
  import { AXDropdownButtonModule } from '@acorex/components/dropdown-button';
15
15
  import * as i8 from '@acorex/platform/layout/components';
16
16
  import { AXPComponentSlotModule, AXPThemeLayoutBlockComponent, AXPThemeLayoutActionsComponent, AXPThemeLayoutHeaderComponent, AXPThemeLayoutContainerComponent, AXPThemeLayoutListComponent, AXPThemeLayoutListItemComponent, AXPThemeLayoutStartSideComponent } from '@acorex/platform/layout/components';
17
- import { AXPStickyDirective, AXPHomePageService, AXPEntityCommandScope } from '@acorex/platform/common';
17
+ import { AXPStickyDirective, AXPHomePageService, AXPCommonSettings, AXPSettingService, AXPEntityCommandScope } from '@acorex/platform/common';
18
18
  import * as i1 from '@acorex/cdk/drawer';
19
19
  import { AXDrawerDirectiveModule, AXDrawerContainerDirective } from '@acorex/cdk/drawer';
20
20
  import { AXDrawerModule } from '@acorex/components/drawer';
@@ -500,7 +500,7 @@ const AXPLayoutDetailsViewViewModel = signalStore(withState(() => {
500
500
  const cache = store.renderedTabsCache();
501
501
  return cache[pageId] || [];
502
502
  }),
503
- })), withMethods((store, evaluatorService = inject(AXPExpressionEvaluatorService), router = inject(Router), route = inject(ActivatedRoute), layout = inject(AXPLayoutThemeService), formatService = inject(AXFormatService), toastService = inject(AXToastService), translateService = inject(AXTranslationService)) => {
503
+ })), withMethods((store, evaluatorService = inject(AXPExpressionEvaluatorService), router = inject(Router), route = inject(ActivatedRoute), layout = inject(AXPLayoutThemeService), formatService = inject(AXFormatService), toastService = inject(AXToastService), translateService = inject(AXTranslationService), settingService = inject(AXPSettingService)) => {
504
504
  // Effect to automatically cache current tab when it changes
505
505
  effect(() => {
506
506
  const currentPage = store.currentPage();
@@ -833,6 +833,7 @@ const AXPLayoutDetailsViewViewModel = signalStore(withState(() => {
833
833
  status: AXPPageStatus.Submitting,
834
834
  });
835
835
  const result = await store.currentPage()?.execute?.(command, store.context());
836
+ const enableOperationToasts = await settingService.get(AXPCommonSettings.EnableOperationToasts);
836
837
  if (result?.success) {
837
838
  patchState(store, {
838
839
  previousContext: store.context(),
@@ -844,27 +845,31 @@ const AXPLayoutDetailsViewViewModel = signalStore(withState(() => {
844
845
  catch (error) {
845
846
  console.error('Failed to refresh page after save', error);
846
847
  }
847
- toastService.show({
848
- color: 'success',
849
- title: await translateService.translateAsync('@general:messages.generic.success.title'),
850
- content: await translateService.translateAsync('@general:messages.generic.success.description'),
851
- location: 'bottom-center',
852
- closeButton: true,
853
- timeOut: 3000,
854
- timeOutProgress: true,
855
- });
848
+ if (enableOperationToasts) {
849
+ toastService.show({
850
+ color: 'success',
851
+ title: await translateService.translateAsync('@general:messages.generic.success.title'),
852
+ content: await translateService.translateAsync('@general:messages.generic.success.description'),
853
+ location: 'bottom-center',
854
+ closeButton: true,
855
+ timeOut: 3000,
856
+ timeOutProgress: true,
857
+ });
858
+ }
856
859
  }
857
860
  else {
858
- toastService.show({
859
- color: 'danger',
860
- title: await translateService.translateAsync('@general:messages.generic.error.title'),
861
- content: result?.error?.message ||
862
- (await translateService.translateAsync('@general:messages.generic.error.description')),
863
- location: 'bottom-center',
864
- closeButton: true,
865
- timeOut: 3000,
866
- timeOutProgress: true,
867
- });
861
+ if (enableOperationToasts) {
862
+ toastService.show({
863
+ color: 'danger',
864
+ title: await translateService.translateAsync('@general:messages.generic.error.title'),
865
+ content: result?.error?.message ||
866
+ (await translateService.translateAsync('@general:messages.generic.error.description')),
867
+ location: 'bottom-center',
868
+ closeButton: true,
869
+ timeOut: 3000,
870
+ timeOutProgress: true,
871
+ });
872
+ }
868
873
  }
869
874
  patchState(store, {
870
875
  status: AXPPageStatus.Submitted,
@@ -1032,16 +1037,18 @@ class AXPLayoutDetailsViewComponent extends AXPPageLayoutBaseComponent {
1032
1037
  return null;
1033
1038
  }
1034
1039
  }
1035
- async getPageBadge() {
1036
- if (this.vm.isDirty()) {
1037
- return {
1038
- title: await this.translateService.translateAsync('@general:terms.interface.save-status.not-saved.title'),
1039
- color: 'warning',
1040
- description: await this.translateService.translateAsync('@general:terms.interface.save-status.not-saved.description'),
1041
- };
1042
- }
1043
- return null;
1044
- }
1040
+ // override async getPageBadge(): Promise<AXPBadge | null> {
1041
+ // if (this.vm.isDirty()) {
1042
+ // return {
1043
+ // title: await this.translateService.translateAsync('@general:terms.interface.save-status.not-saved.title'),
1044
+ // color: 'warning',
1045
+ // description: await this.translateService.translateAsync(
1046
+ // '@general:terms.interface.save-status.not-saved.description',
1047
+ // ),
1048
+ // };
1049
+ // }
1050
+ // return null;
1051
+ // }
1045
1052
  async onBackButtonClick() {
1046
1053
  // When back button is clicked in small layout, go back to page list
1047
1054
  if (!this.vm.showPages()) {