@arsedizioni/ars-utils 18.4.94 → 18.4.96

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.
@@ -67,8 +67,8 @@ var ClipperModuleGroup;
67
67
  (function (ClipperModuleGroup) {
68
68
  ClipperModuleGroup[ClipperModuleGroup["Home"] = 0] = "Home";
69
69
  ClipperModuleGroup[ClipperModuleGroup["NormativaVigente"] = 1] = "NormativaVigente";
70
- ClipperModuleGroup[ClipperModuleGroup["RimaniAggiornato"] = 2] = "RimaniAggiornato";
71
- ClipperModuleGroup[ClipperModuleGroup["Contributi"] = 3] = "Contributi";
70
+ ClipperModuleGroup[ClipperModuleGroup["UltimeNovit\u00E0"] = 2] = "UltimeNovit\u00E0";
71
+ ClipperModuleGroup[ClipperModuleGroup["ParApprofondire"] = 3] = "ParApprofondire";
72
72
  ClipperModuleGroup[ClipperModuleGroup["DGInfo"] = 4] = "DGInfo";
73
73
  ClipperModuleGroup[ClipperModuleGroup["Giurisprudenza"] = 5] = "Giurisprudenza";
74
74
  ClipperModuleGroup[ClipperModuleGroup["Calendario"] = 11] = "Calendario";
@@ -105,7 +105,7 @@ var ClipperModel;
105
105
  ClipperModel[ClipperModel["MetodiDiAnalisi"] = 14] = "MetodiDiAnalisi";
106
106
  ClipperModel[ClipperModel["GiurisprudenzaRecente"] = 18] = "GiurisprudenzaRecente";
107
107
  ClipperModel[ClipperModel["Segnalazioni"] = 20] = "Segnalazioni";
108
- ClipperModel[ClipperModel["RimaniAggiornato"] = 21] = "RimaniAggiornato";
108
+ ClipperModel[ClipperModel["UltimeNovit\u00E0"] = 21] = "UltimeNovit\u00E0";
109
109
  })(ClipperModel || (ClipperModel = {}));
110
110
  const ClipperModels = [
111
111
  { value: ClipperModel.AggiornamentoNormativo, name: "Testi storici" },
@@ -123,8 +123,8 @@ const ClipperModuleGroups = [
123
123
  { name: "Ultime novità", value: ClipperModuleGroup.Home },
124
124
  { name: "Ricerca", value: ClipperModuleGroup.Ricerca },
125
125
  { name: "Normativa vigente", value: ClipperModuleGroup.NormativaVigente },
126
- { name: "Rimani aggiornato", value: ClipperModuleGroup.RimaniAggiornato },
127
- { name: "Contributi", value: ClipperModuleGroup.Contributi },
126
+ { name: "Rimani aggiornato", value: ClipperModuleGroup.UltimeNovità },
127
+ { name: "Contributi", value: ClipperModuleGroup.ParApprofondire },
128
128
  { name: "DG Info", value: ClipperModuleGroup.DGInfo },
129
129
  { name: "Calendario", value: ClipperModuleGroup.Calendario },
130
130
  { name: "Archivio", value: ClipperModuleGroup.Archivio }
@@ -1605,6 +1605,40 @@ class ClipperDashboard {
1605
1605
  states.push([ClipperModule.QuesitiECasiRisolti, this.items().find((x) => x.id == ClipperModule.QuesitiECasiRisolti)?.unreadItems ?? 0]);
1606
1606
  return states;
1607
1607
  });
1608
+ this.unreadItemsByModel = computed(() => {
1609
+ const states = [];
1610
+ this.items().forEach(item => {
1611
+ if (item.models) {
1612
+ item.models.forEach(itemModel => {
1613
+ states.push([itemModel.id, itemModel.unreadItems]);
1614
+ });
1615
+ }
1616
+ else {
1617
+ if (item.id == ClipperModule.News) {
1618
+ states.push([ClipperModel.News, item.unreadItems]);
1619
+ }
1620
+ else if (item.id == ClipperModule.GazzetteBollettiniEFontiDiverse) {
1621
+ states.push([ClipperModel.AggiornamentoNormativo, item.unreadItems]);
1622
+ }
1623
+ else if (item.id == ClipperModule.QuesitiECasiRisolti) {
1624
+ states.push([ClipperModel.Quesiti, item.unreadItems]);
1625
+ }
1626
+ else if (item.id == ClipperModule.AllerteAlimentari) {
1627
+ states.push([ClipperModel.AllerteAlimentari, item.unreadItems]);
1628
+ }
1629
+ else if (item.id == ClipperModule.Approfondimenti) {
1630
+ states.push([ClipperModel.Articoli, item.unreadItems]);
1631
+ }
1632
+ else if (item.id == ClipperModule.ModificheAbrogazioniERinvii) {
1633
+ states.push([ClipperModel.Coordinamento, item.unreadItems]);
1634
+ }
1635
+ else if (item.id == ClipperModule.Giurisprudenza) {
1636
+ states.push([ClipperModel.Juris, item.unreadItems]);
1637
+ }
1638
+ }
1639
+ });
1640
+ return states;
1641
+ });
1608
1642
  }
1609
1643
  /**
1610
1644
  * Update unread items
@@ -1633,13 +1667,7 @@ class ClipperDashboard {
1633
1667
  */
1634
1668
  getUnreadItems(module, model) {
1635
1669
  if (model) {
1636
- let item = this.items()?.find((x) => x.id == module);
1637
- if (item) {
1638
- let itemModel = item.models.find(x => x.id === model);
1639
- if (itemModel) {
1640
- return itemModel.unreadItems;
1641
- }
1642
- }
1670
+ return this.unreadItemsByModel()?.find((x) => x[0] === model)?.[1];
1643
1671
  }
1644
1672
  return this.unreadItems()?.find((x) => x[0] === module)?.[1];
1645
1673
  }