@guillotinaweb/react-gmi 0.28.4 → 0.29.0

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.
@@ -5670,6 +5670,15 @@ function PanelItems() {
5670
5670
  get
5671
5671
  } = Ctx.registry;
5672
5672
  const fnName = get('searchEngineQueryParamsFunction', SearchEngine);
5673
+
5674
+ if (sortParsed === undefined) {
5675
+ const defaultSortValue = Ctx.registry.getDefaultSortValue(Ctx.context['@type'], {
5676
+ key: 'id',
5677
+ direction: 'des'
5678
+ });
5679
+ sortParsed = parser(`_sort_${defaultSortValue.direction}=${defaultSortValue.key}}`);
5680
+ }
5681
+
5673
5682
  const qsParsed = Ctx.client[fnName]({
5674
5683
  path: Ctx.path,
5675
5684
  start: page * PageSize,
@@ -8582,7 +8591,8 @@ const registry = {
8582
8591
  },
8583
8592
  fieldsToFilter: {
8584
8593
  UserManager: ['id', 'email', 'user_name']
8585
- }
8594
+ },
8595
+ defaultSortValue: {}
8586
8596
  };
8587
8597
 
8588
8598
  const get$2 = (key, param, fallback = undefined) => {
@@ -8642,6 +8652,10 @@ const getFieldsToFilter = (type, fallback) => {
8642
8652
  return registry.fieldsToFilter[type] || fallback;
8643
8653
  };
8644
8654
 
8655
+ const getDefaultSortValue = (type, fallback) => {
8656
+ return registry.defaultSortValue[type] || fallback;
8657
+ };
8658
+
8645
8659
  const defaultComponent = context => {
8646
8660
  return context.is_folderish ? FolderCtx : ItemCtx;
8647
8661
  };
@@ -8663,6 +8677,7 @@ function useRegistry(data) {
8663
8677
  getProperties,
8664
8678
  getItemsColumn,
8665
8679
  getFieldsToFilter,
8680
+ getDefaultSortValue,
8666
8681
  getSchemas
8667
8682
  };
8668
8683
  }