@esfaenza/extensions 15.2.56 → 15.2.58
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.
|
@@ -1084,8 +1084,8 @@ class AppEmbeddingExtensions {
|
|
|
1084
1084
|
return;
|
|
1085
1085
|
// emb/crm/parties/parties_search?blabla --> parties/parties_search
|
|
1086
1086
|
let normalizedRequestedRoute = event.data.routerLink.split("?")[0].split("/").slice(2).join("/");
|
|
1087
|
-
///pages_ext/parties/parties_search?blabla --> parties/parties_search
|
|
1088
|
-
let normalizedFirstRoute = this.pushedHistories.length > 0 ? this.pushedHistories[0].from.split("?")[0].split("/").slice(
|
|
1087
|
+
///pages_ext/{module}/parties/parties_search?blabla --> parties/parties_search
|
|
1088
|
+
let normalizedFirstRoute = this.pushedHistories.length > 0 ? this.pushedHistories[0].from.split("?")[0].split("/").slice(3).join("/") : "";
|
|
1089
1089
|
// La route su cui sto navigando ora è uguale alla route in cui l'embedding è iniziato.
|
|
1090
1090
|
// Significa che devo simulare dei back fino a che non sono arrivato all'inizio
|
|
1091
1091
|
if (normalizedRequestedRoute == normalizedFirstRoute) {
|
|
@@ -1185,14 +1185,16 @@ class AppEmbeddingExtensions {
|
|
|
1185
1185
|
var replaceState = event?.data?.replaceState;
|
|
1186
1186
|
var current = event?.data?.current;
|
|
1187
1187
|
// Controllo se il router sta seguendo la chiamata attuale. Escludo i query params che sono gli unici che possono essere seccati dai replaceState
|
|
1188
|
-
// e che potrebbero fare del casino
|
|
1189
|
-
if (!window.location.href.includes(this.router.url.split("?")[0])) {
|
|
1188
|
+
// e che potrebbero fare del casino. Stesso discorso per i parametri semplici (ad esempio il parametro di wakeup)
|
|
1189
|
+
if (!window.location.href.includes(this.router.url.split("?")[0].split(";")[0])) {
|
|
1190
1190
|
console.warn("Doppia chiamata di navigazione, ignoro il secondo evento scoordinato dal router");
|
|
1191
1191
|
return;
|
|
1192
1192
|
}
|
|
1193
1193
|
let newRelativeUrl = this.router.createUrlTree([event?.data?.url]);
|
|
1194
1194
|
let baseUrl = window.location.href.replace(this.router.url.replace("?ignoreStorage=true", ''), '');
|
|
1195
|
-
|
|
1195
|
+
// pages/embed/crm
|
|
1196
|
+
let appPath = decodeURIComponent(newRelativeUrl.toString());
|
|
1197
|
+
let newUrl = baseUrl + appPath;
|
|
1196
1198
|
if (replaceState) {
|
|
1197
1199
|
this.pushedHistories.push({ _pushed: true, url: newUrl, from: current });
|
|
1198
1200
|
history.pushState({ _pushed: true }, "", newUrl);
|