@acorex/platform 20.7.20 → 20.7.21

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.
@@ -1082,72 +1082,20 @@ class AXPLayoutDetailsViewComponent extends AXPPageLayoutBaseComponent {
1082
1082
  };
1083
1083
  }
1084
1084
  }
1085
- // override async getPageBadge(): Promise<AXPBadge | null> {
1086
- // if (this.vm.isDirty()) {
1087
- // return {
1088
- // title: await this.translateService.translateAsync('@general:terms.interface.save-status.not-saved.title'),
1089
- // color: 'warning',
1090
- // description: await this.translateService.translateAsync(
1091
- // '@general:terms.interface.save-status.not-saved.description',
1092
- // ),
1093
- // };
1094
- // }
1095
- // return null;
1096
- // }
1097
- // override async getPageStatus(): Promise<AXPPageStatus | null> {
1098
- // const adapter = this.vm.adapter();
1099
- // if (!adapter?.name) {
1100
- // return null;
1101
- // }
1102
- // // Parse entity name (format: "ModuleName.EntityName")
1103
- // const [moduleName, entityName] = adapter.name.split('.');
1104
- // if (!moduleName || !entityName) {
1105
- // return null;
1106
- // }
1107
- // try {
1108
- // // Get entity definition
1109
- // const entityDefinition = await this.entityRegistry.resolve(moduleName, entityName);
1110
- // if (!entityDefinition) {
1111
- // return null;
1112
- // }
1113
- // // Find status plugin
1114
- // const statusPlugin = entityDefinition.plugins?.find((p: any) => p.name === 'status');
1115
- // if (!statusPlugin?.options) {
1116
- // return null;
1117
- // }
1118
- // const statusOptions = statusPlugin.options as any;
1119
- // const statusField = statusOptions.field ?? 'statusId';
1120
- // const statusDefinitionKey = statusOptions.definition;
1121
- // // Get status definition key from property widget options if not in plugin options
1122
- // let definitionKey: string | undefined = typeof statusDefinitionKey === 'string' ? statusDefinitionKey : undefined;
1123
- // if (!definitionKey) {
1124
- // // Try to get from status property widget options
1125
- // const statusProperty = entityDefinition.properties?.find((p: any) => p.name === statusField);
1126
- // const widgetOptions = statusProperty?.schema?.interface?.options;
1127
- // if (widgetOptions?.['definitionKey']) {
1128
- // definitionKey = widgetOptions['definitionKey'];
1129
- // }
1130
- // }
1131
- // if (!definitionKey) {
1132
- // return null;
1133
- // }
1134
- // // Get current status value from entity context
1135
- // const entity = this.vm.context();
1136
- // const statusValue = entity?.[statusField];
1137
- // if (!statusValue) {
1138
- // return null;
1139
- // }
1140
- // return {
1141
- // definitionKey,
1142
- // value: typeof statusValue === 'string' ? statusValue : statusValue?.name ?? statusValue,
1143
- // dataPath: statusField,
1144
- // readonly: this.vm.currentPage()?.isReadonly ?? false,
1145
- // };
1146
- // } catch (error) {
1147
- // console.warn('Failed to get page status:', error);
1148
- // return null;
1149
- // }
1150
- // }
1085
+ async getPageBadge() {
1086
+ const adapter = this.vm.adapter();
1087
+ if (!adapter?.getPageBadge) {
1088
+ return null;
1089
+ }
1090
+ return adapter.getPageBadge(this.vm.context(), this.vm.isDirty());
1091
+ }
1092
+ async getPageStatus() {
1093
+ const adapter = this.vm.adapter();
1094
+ if (!adapter?.getPageStatus) {
1095
+ return null;
1096
+ }
1097
+ return adapter.getPageStatus(this.vm.context(), this.vm.currentPage());
1098
+ }
1151
1099
  /**
1152
1100
  * Get entity data for status chip component
1153
1101
  */