tin-spa 20.6.7 → 20.6.9
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.
- package/fesm2022/tin-spa.mjs +13 -14
- package/fesm2022/tin-spa.mjs.map +1 -1
- package/package.json +1 -1
package/fesm2022/tin-spa.mjs
CHANGED
|
@@ -1773,12 +1773,16 @@ class AuthService {
|
|
|
1773
1773
|
this.UpdateRole(data.role);
|
|
1774
1774
|
this.updateLoggedUserFullName(data.firstName);
|
|
1775
1775
|
this.updateTenantName(data.tenantName);
|
|
1776
|
+
if (data.userName)
|
|
1777
|
+
this.UpdateCurrentUser(data.userName); // Changed: Restore username after silent refresh
|
|
1776
1778
|
// Store session data in active storage
|
|
1777
1779
|
this.storage.store(Constants.AUTH_TOKEN, data.token);
|
|
1778
1780
|
this.storage.store(Constants.AUTH_TOKEN_EXPIRE, data.expiration);
|
|
1779
1781
|
this.storage.store(Constants.AUTH_ROLES, JSON.stringify(data.role));
|
|
1780
1782
|
this.storage.store(Constants.AUTH_NAME, data.firstName);
|
|
1781
1783
|
this.storage.store(Constants.AUTH_TENANT_NAME, data.tenantName);
|
|
1784
|
+
if (data.userName)
|
|
1785
|
+
this.storage.store(Constants.AUTH_USER, data.userName); // Changed: Persist username so checkAuthentication finds AUTH_USER after app restart
|
|
1782
1786
|
// Store refresh token persistently if provided (always in localStorage)
|
|
1783
1787
|
if (data.refreshToken) {
|
|
1784
1788
|
this.storage.storePersistent(Constants.AUTH_REFRESH_TOKEN, data.refreshToken);
|
|
@@ -1889,7 +1893,7 @@ class AuthService {
|
|
|
1889
1893
|
resolve(true);
|
|
1890
1894
|
}
|
|
1891
1895
|
else {
|
|
1892
|
-
// Changed:
|
|
1896
|
+
// Changed: Server explicitly rejected the token (revoked/expired) — safe to clear
|
|
1893
1897
|
const currentToken = this.storage.getPersistent(Constants.AUTH_REFRESH_TOKEN);
|
|
1894
1898
|
if (currentToken === refreshToken) {
|
|
1895
1899
|
this.storage.removePersistent(Constants.AUTH_REFRESH_TOKEN);
|
|
@@ -1901,13 +1905,8 @@ class AuthService {
|
|
|
1901
1905
|
},
|
|
1902
1906
|
error: () => {
|
|
1903
1907
|
this.isRefreshing = false;
|
|
1904
|
-
// Changed:
|
|
1905
|
-
|
|
1906
|
-
if (currentToken === refreshToken) {
|
|
1907
|
-
this.storage.removePersistent(Constants.AUTH_REFRESH_TOKEN);
|
|
1908
|
-
this.storage.removePersistent(Constants.AUTH_REFRESH_TOKEN_EXPIRE);
|
|
1909
|
-
this.storage.removePersistent(Constants.AUTH_REMEMBER_ME);
|
|
1910
|
-
}
|
|
1908
|
+
// Changed: Network error (device waking up, no connectivity) — do NOT clear the refresh token.
|
|
1909
|
+
// The token may still be valid; next visibility change or 401 interceptor will retry.
|
|
1911
1910
|
resolve(false);
|
|
1912
1911
|
}
|
|
1913
1912
|
});
|
|
@@ -16913,12 +16912,12 @@ class AccountingDashboardComponent {
|
|
|
16913
16912
|
constructor() {
|
|
16914
16913
|
this.summaryTiles = {
|
|
16915
16914
|
tiles: [
|
|
16915
|
+
{ name: 'inflows', alias: 'Inflows (MTD)', color: '#4caf50', icon: 'arrow_downward', style: 'icon', info: 'MTD cash inflows' }, // Changed: Cash inflows tile
|
|
16916
|
+
{ name: 'outflows', alias: 'Outflows (MTD)', color: '#f44336', icon: 'arrow_upward', style: 'icon', info: 'MTD cash outflows' }, // Changed: Cash outflows tile
|
|
16917
|
+
{ name: 'netCashFlow', alias: 'Net Cash Flow', color: '#2196f3', icon: 'swap_vert', style: 'icon', info: 'Net cash movement' }, // Changed: Net cash flow tile
|
|
16916
16918
|
{ name: 'revenue', alias: 'Revenue (MTD)', color: '#4caf50', icon: 'trending_up', style: 'icon', info: 'MTD revenue' },
|
|
16917
16919
|
{ name: 'expenses', alias: 'Expenses (MTD)', color: '#f44336', icon: 'trending_down', style: 'icon', info: 'MTD expenses' },
|
|
16918
|
-
{ name: '
|
|
16919
|
-
{ name: 'cashBalance', alias: 'Cash & Bank', color: '#ff9800', icon: 'account_balance_wallet', style: 'icon', info: 'Cash + bank total' }, // Changed: Replaced outstandingAR
|
|
16920
|
-
{ name: 'totalLiabilities', alias: 'Liabilities', color: '#9c27b0', icon: 'credit_card', style: 'icon', info: 'Total liabilities' }, // Changed: Replaced outstandingAP
|
|
16921
|
-
{ name: 'transactionsMTD', alias: 'Transactions', color: '#607d8b', icon: 'swap_horiz', style: 'icon', info: 'Posted this period' }, // Changed: Replaced overdueInvoices
|
|
16920
|
+
{ name: 'cashBalance', alias: 'Cash & Bank', color: '#ff9800', icon: 'account_balance_wallet', style: 'icon', info: 'Cash + bank total' },
|
|
16922
16921
|
],
|
|
16923
16922
|
loadAction: { url: 'accounts/dashboard-summary/x' },
|
|
16924
16923
|
loadInit: true
|
|
@@ -21375,8 +21374,8 @@ class OverviewDashboardComponent {
|
|
|
21375
21374
|
{ name: 'expenses', alias: 'Expenses (MTD)', color: '#f44336', icon: 'trending_down', style: 'icon', info: 'MTD expenses' },
|
|
21376
21375
|
{ name: 'netProfit', alias: 'Net Profit (MTD)', color: '#2196f3', icon: 'account_balance', style: 'icon', info: 'MTD profit' },
|
|
21377
21376
|
{ name: 'stockValue', alias: 'Stock Value', color: '#ff9800', icon: 'inventory_2', style: 'icon', info: 'Inventory value' },
|
|
21378
|
-
{ name: '
|
|
21379
|
-
{ name: '
|
|
21377
|
+
{ name: 'netCashFlow', alias: 'Net Cash Flow', color: '#9c27b0', icon: 'swap_vert', style: 'icon', info: 'Net cash movement' }, // Changed: Replaced totalLiabilities with net cash flow
|
|
21378
|
+
{ name: 'cashBalance', alias: 'Cash & Bank', color: '#e91e63', icon: 'account_balance_wallet', style: 'icon', info: 'Cash + bank total' },
|
|
21380
21379
|
],
|
|
21381
21380
|
loadAction: { url: 'dashboard/overview/summary' },
|
|
21382
21381
|
loadInit: true
|