@esfaenza/core 19.2.179 → 19.2.181
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.
|
@@ -14,8 +14,10 @@ export declare class EmbeddingComponent extends BaseComponent {
|
|
|
14
14
|
Pars: string;
|
|
15
15
|
QueryPars: string;
|
|
16
16
|
EmbeddingSuccesfull: boolean;
|
|
17
|
+
Reloading: boolean;
|
|
17
18
|
constructor(injector: Injector, emb: AppEmbeddingExtensions, location: Location);
|
|
18
19
|
ngOnInit(): void;
|
|
20
|
+
performNewEmbeddingOperations(module: string): void;
|
|
19
21
|
assignPageLoadParameters(reloadAllowed?: boolean): void;
|
|
20
22
|
static ɵfac: i0.ɵɵFactoryDeclaration<EmbeddingComponent, never>;
|
|
21
23
|
static ɵcmp: i0.ɵɵComponentDeclaration<EmbeddingComponent, "embedding", never, {}, {}, never, never, true, never>;
|
|
@@ -1736,25 +1736,46 @@ class EmbeddingComponent extends BaseComponent {
|
|
|
1736
1736
|
// TODO: Automatizzare
|
|
1737
1737
|
this.LocalhostModuleMap = {
|
|
1738
1738
|
"crm": "31813",
|
|
1739
|
-
"sii": "21645"
|
|
1739
|
+
"sii": "21645",
|
|
1740
|
+
"sales": "19112"
|
|
1740
1741
|
};
|
|
1741
1742
|
this.EmbeddingSuccesfull = true;
|
|
1743
|
+
this.Reloading = false;
|
|
1742
1744
|
}
|
|
1743
1745
|
ngOnInit() {
|
|
1744
1746
|
let route = this.injector.get(ActivatedRoute);
|
|
1747
|
+
route.url.subscribe(_ => { this.performNewEmbeddingOperations(null); });
|
|
1745
1748
|
route.params.pipe(debounceTime(100)).subscribe((res) => {
|
|
1746
|
-
this.
|
|
1747
|
-
this.Localhost = this.LocalhostModuleMap[this.Module];
|
|
1748
|
-
console.log(`Recognized a new navigation to the embedding component: ${this.Module} - ${this.CompletePath}`);
|
|
1749
|
-
let reloadAllowed = this.emb.IsReloadAllowed();
|
|
1750
|
-
if (this.Page && reloadAllowed) {
|
|
1751
|
-
this.Page = this.Pars = null;
|
|
1752
|
-
requestAnimationFrame(() => { this.assignPageLoadParameters(); });
|
|
1753
|
-
}
|
|
1754
|
-
else
|
|
1755
|
-
this.assignPageLoadParameters(reloadAllowed);
|
|
1749
|
+
this.performNewEmbeddingOperations(res["module"]);
|
|
1756
1750
|
});
|
|
1757
1751
|
}
|
|
1752
|
+
performNewEmbeddingOperations(module) {
|
|
1753
|
+
if (!module && !this.Module) {
|
|
1754
|
+
console.log(`Module parameter missing. Ignoring embed request`);
|
|
1755
|
+
return;
|
|
1756
|
+
}
|
|
1757
|
+
if (this.Reloading) {
|
|
1758
|
+
console.log(`Already reloading. Embedding ignored`);
|
|
1759
|
+
return;
|
|
1760
|
+
}
|
|
1761
|
+
if (module)
|
|
1762
|
+
this.Module = module;
|
|
1763
|
+
this.Localhost = this.LocalhostModuleMap[this.Module];
|
|
1764
|
+
this.Reloading = true;
|
|
1765
|
+
console.log(`Recognized a new navigation to the embedding component: ${this.Module} - ${this.CompletePath}`);
|
|
1766
|
+
let reloadAllowed = this.emb.IsReloadAllowed();
|
|
1767
|
+
if (this.Page && reloadAllowed) {
|
|
1768
|
+
this.Page = this.Pars = null;
|
|
1769
|
+
requestAnimationFrame(() => {
|
|
1770
|
+
this.assignPageLoadParameters();
|
|
1771
|
+
requestAnimationFrame(() => { this.Reloading = false; });
|
|
1772
|
+
});
|
|
1773
|
+
}
|
|
1774
|
+
else {
|
|
1775
|
+
this.assignPageLoadParameters(reloadAllowed);
|
|
1776
|
+
requestAnimationFrame(() => { this.Reloading = false; });
|
|
1777
|
+
}
|
|
1778
|
+
}
|
|
1758
1779
|
assignPageLoadParameters(reloadAllowed = true) {
|
|
1759
1780
|
// Esempio di Complete path: "/pages/embed/crm/leads/leads_search"
|
|
1760
1781
|
// Esempio di slices: ["", "pages", "embed", "crm", "leads", "leads_search"]
|