turbogui-angular 20.2.0 → 20.3.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.
|
@@ -984,10 +984,6 @@ class DialogService extends SingletoneStrictClass {
|
|
|
984
984
|
if (!this._isEnabled) {
|
|
985
985
|
return;
|
|
986
986
|
}
|
|
987
|
-
// If there are dialogs that should close on navigation and a history state was pushed, pop it
|
|
988
|
-
if (this._activeCloseableDialogs > 0 && window.history.state?.dialogOpen) {
|
|
989
|
-
history.back();
|
|
990
|
-
}
|
|
991
987
|
for (const dialogRef of this._activeDialogInstances) {
|
|
992
988
|
dialogRef.close({ index: -1 });
|
|
993
989
|
}
|
|
@@ -1675,6 +1671,20 @@ class RouterBaseService {
|
|
|
1675
1671
|
getCurrentRoute() {
|
|
1676
1672
|
return this._currentRoute.getValue();
|
|
1677
1673
|
}
|
|
1674
|
+
/**
|
|
1675
|
+
* The current route title, translated using the LocalesService.
|
|
1676
|
+
* This is updated automatically after each navigation event if the title manager is initialized.
|
|
1677
|
+
*/
|
|
1678
|
+
getCurrentRouteTitle() {
|
|
1679
|
+
return this._currentRouteTitle;
|
|
1680
|
+
}
|
|
1681
|
+
/**
|
|
1682
|
+
* The current browser title, which may include prefixes or suffixes.
|
|
1683
|
+
* This is updated automatically after each navigation event if the title manager is initialized.
|
|
1684
|
+
*/
|
|
1685
|
+
getCurrentBrowserTitle() {
|
|
1686
|
+
return this._currentBrowserTitle;
|
|
1687
|
+
}
|
|
1678
1688
|
/**
|
|
1679
1689
|
* Gets the current value of the route absolute URL synchronously.
|
|
1680
1690
|
*
|
|
@@ -1719,6 +1729,7 @@ class RouterBaseService {
|
|
|
1719
1729
|
* { path: '', component: HomePageComponent,
|
|
1720
1730
|
* data: { titleKey: 'HOME', titleBundle: 'turbodepot/user-interface'} },
|
|
1721
1731
|
*
|
|
1732
|
+
* @param localesService An instance of the LocalesService to be used for translations.
|
|
1722
1733
|
* @param prefix A text to be added before the computed title.
|
|
1723
1734
|
* @param sufix A text to be added after the computed title.
|
|
1724
1735
|
*/
|
|
@@ -1744,14 +1755,18 @@ class RouterBaseService {
|
|
|
1744
1755
|
* @param sufix A text to be added after the computed title.
|
|
1745
1756
|
*/
|
|
1746
1757
|
updateTitleFromCurrentRoute(prefix, sufix) {
|
|
1758
|
+
this._currentRouteTitle = '';
|
|
1759
|
+
this._currentBrowserTitle = '';
|
|
1747
1760
|
let currentRoute = this.router.routerState.snapshot.root;
|
|
1748
1761
|
while (currentRoute.firstChild) {
|
|
1749
1762
|
currentRoute = currentRoute.firstChild;
|
|
1750
1763
|
}
|
|
1751
1764
|
const data = currentRoute.data;
|
|
1752
1765
|
if (data['titleKey'] && data['titleBundle']) {
|
|
1753
|
-
this.
|
|
1766
|
+
this._currentRouteTitle = this._localesService.t(data['titleKey'], data['titleBundle']);
|
|
1754
1767
|
}
|
|
1768
|
+
this._currentBrowserTitle = prefix + this._currentRouteTitle + sufix;
|
|
1769
|
+
this.titleService.setTitle(this._currentBrowserTitle);
|
|
1755
1770
|
}
|
|
1756
1771
|
/**
|
|
1757
1772
|
* Navigates to the specified route.
|
|
@@ -1761,6 +1776,12 @@ class RouterBaseService {
|
|
|
1761
1776
|
navigateTo(route) {
|
|
1762
1777
|
this.router.navigate(['/' + route]);
|
|
1763
1778
|
}
|
|
1779
|
+
/**
|
|
1780
|
+
* Automatically called when the service is destroyed.
|
|
1781
|
+
* We use it to clean up subscriptions and other resources.
|
|
1782
|
+
*
|
|
1783
|
+
* Usially not necessary to call this manually.
|
|
1784
|
+
*/
|
|
1764
1785
|
ngOnDestroy() {
|
|
1765
1786
|
this._routerSubscription?.unsubscribe();
|
|
1766
1787
|
// Clean up BehaviorSubject
|