@arsedizioni/ars-utils 18.2.270 → 18.2.272

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.
@@ -1678,7 +1678,7 @@ class ClipperUtils {
1678
1678
  * @param modules : the modules list
1679
1679
  * @returns the list of availbale sort options
1680
1680
  */
1681
- static getClipperAvailableSortOptions(module = undefined, params = undefined) {
1681
+ static getClipperAvailableSortOptions(modules = undefined, params = undefined) {
1682
1682
  const options = [
1683
1683
  { name: "Data decrescente", value: ClipperSort.DateDesc },
1684
1684
  { name: "Data crescente", value: ClipperSort.DateAsc },
@@ -1691,22 +1691,16 @@ class ClipperUtils {
1691
1691
  if (params && ClipperSearchUtils.isTextQuery(params)) {
1692
1692
  sortOptions.push(options[4]);
1693
1693
  }
1694
- if (module) {
1695
- if (module === ClipperModule.Ricerca) {
1694
+ if (modules) {
1695
+ if ((modules.length === 2 && modules.filter(x => x === ClipperModule.NormativaVigente || x === ClipperModule.GazzetteBollettiniEFontiDiverse).length === 2)
1696
+ || (modules.length === 1 && modules[0] === ClipperModule.NormativaVigente)) {
1696
1697
  sortOptions.push(options[0]);
1697
1698
  sortOptions.push(options[1]);
1698
1699
  sortOptions.push(options[2]);
1699
1700
  sortOptions.push(options[3]);
1700
1701
  sortOptions.push(options[5]);
1701
1702
  }
1702
- else if (module === ClipperModule.NormativaVigente) {
1703
- sortOptions.push(options[0]);
1704
- sortOptions.push(options[1]);
1705
- sortOptions.push(options[2]);
1706
- sortOptions.push(options[3]);
1707
- sortOptions.push(options[5]);
1708
- }
1709
- else if (module === ClipperModule.GazzetteBollettiniEFontiDiverse) {
1703
+ else if (modules.length === 1 && modules[0] === ClipperModule.GazzetteBollettiniEFontiDiverse) {
1710
1704
  sortOptions.push(options[2]);
1711
1705
  sortOptions.push(options[3]);
1712
1706
  }