@snteam/amplify-angular-core 1.0.43 → 1.0.45

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.
@@ -2546,6 +2546,11 @@ class AmplifyModelService {
2546
2546
  // Final fallback - use a simple, predictable selection set
2547
2547
  const fallbackSelectionSet = this.generateSimpleFallbackSelectionSet(config);
2548
2548
  console.log('AmplifyModelService: Using simple fallback selection set:', fallbackSelectionSet);
2549
+ // Ensure we never return an empty array
2550
+ if (fallbackSelectionSet.length === 0) {
2551
+ console.warn('AmplifyModelService: Fallback selection set is empty, using minimal default');
2552
+ return ['id'];
2553
+ }
2549
2554
  return fallbackSelectionSet;
2550
2555
  }
2551
2556
  catch (error) {
@@ -2587,13 +2592,15 @@ class AmplifyModelService {
2587
2592
  generateSimpleFallbackSelectionSet(config) {
2588
2593
  const selectionSet = ['id'];
2589
2594
  if (config.fieldName) {
2590
- // Add the relationship field itself
2595
+ // Add the relationship field itself with basic nested fields
2591
2596
  selectionSet.push(config.fieldName);
2592
- // Add common nested fields
2593
- selectionSet.push(`${config.fieldName}.id`);
2594
- selectionSet.push(`${config.fieldName}.name`);
2595
- selectionSet.push(`${config.fieldName}.title`);
2597
+ // Add common nested fields that are likely to exist
2598
+ const commonFields = ['id', 'name', 'title', 'label', 'description'];
2599
+ for (const field of commonFields) {
2600
+ selectionSet.push(`${config.fieldName}.${field}`);
2601
+ }
2596
2602
  }
2603
+ console.log('AmplifyModelService: Generated simple fallback selection set:', selectionSet);
2597
2604
  return selectionSet;
2598
2605
  }
2599
2606
  setRelatedSub(config, baseId) {
@@ -5750,7 +5757,7 @@ return fields;
5750
5757
  'table',
5751
5758
  'table.id',
5752
5759
  'table.name',
5753
- 'table.title',
5760
+ 'table.label',
5754
5761
  'table.description'
5755
5762
  ],
5756
5763
  description: 'Configuration for ListView -> Table relationship'
@@ -5762,12 +5769,85 @@ return fields;
5762
5769
  'id',
5763
5770
  'formView',
5764
5771
  'formView.id',
5765
- 'formView.name',
5766
- 'formView.title',
5767
- 'formView.description'
5772
+ 'formView.label',
5773
+ 'formView.tableConfigId'
5768
5774
  ],
5769
5775
  description: 'Configuration for FormViewField -> FormView relationship'
5770
5776
  },
5777
+ {
5778
+ relationshipModel: 'FormView',
5779
+ fieldName: 'table',
5780
+ selectionSet: [
5781
+ 'id',
5782
+ 'table',
5783
+ 'table.id',
5784
+ 'table.name',
5785
+ 'table.label',
5786
+ 'table.description'
5787
+ ],
5788
+ description: 'Configuration for FormView -> TableConfig relationship'
5789
+ },
5790
+ {
5791
+ relationshipModel: 'FieldChoice',
5792
+ fieldName: 'fieldConfig',
5793
+ selectionSet: [
5794
+ 'id',
5795
+ 'fieldConfig',
5796
+ 'fieldConfig.id',
5797
+ 'fieldConfig.name',
5798
+ 'fieldConfig.label',
5799
+ 'fieldConfig.field_type'
5800
+ ],
5801
+ description: 'Configuration for FieldChoice -> FieldConfig relationship'
5802
+ },
5803
+ {
5804
+ relationshipModel: 'ListView',
5805
+ fieldName: 'formView',
5806
+ selectionSet: [
5807
+ 'id',
5808
+ 'formView',
5809
+ 'formView.id',
5810
+ 'formView.label',
5811
+ 'formView.tableConfigId'
5812
+ ],
5813
+ description: 'Configuration for ListView -> FormView relationship'
5814
+ },
5815
+ {
5816
+ relationshipModel: 'ListViewField',
5817
+ fieldName: 'listView',
5818
+ selectionSet: [
5819
+ 'id',
5820
+ 'listView',
5821
+ 'listView.id',
5822
+ 'listView.label',
5823
+ 'listView.tableConfigId'
5824
+ ],
5825
+ description: 'Configuration for ListViewField -> ListView relationship'
5826
+ },
5827
+ {
5828
+ relationshipModel: 'TableConfig',
5829
+ fieldName: 'defaultListView',
5830
+ selectionSet: [
5831
+ 'id',
5832
+ 'defaultListView',
5833
+ 'defaultListView.id',
5834
+ 'defaultListView.label',
5835
+ 'defaultListView.tableConfigId'
5836
+ ],
5837
+ description: 'Configuration for TableConfig -> ListView (defaultListView) relationship'
5838
+ },
5839
+ {
5840
+ relationshipModel: 'TableConfig',
5841
+ fieldName: 'defaultFormView',
5842
+ selectionSet: [
5843
+ 'id',
5844
+ 'defaultFormView',
5845
+ 'defaultFormView.id',
5846
+ 'defaultFormView.label',
5847
+ 'defaultFormView.tableConfigId'
5848
+ ],
5849
+ description: 'Configuration for TableConfig -> FormView (defaultFormView) relationship'
5850
+ },
5771
5851
  {
5772
5852
  relationshipModel: 'ServiceCustomer',
5773
5853
  fieldName: 'service',