diff --git a/src/app/cln/store/cln.reducers.ts b/src/app/cln/store/cln.reducers.ts
index 86237c26..a551f913 100644
--- a/src/app/cln/store/cln.reducers.ts
+++ b/src/app/cln/store/cln.reducers.ts
@@ -220,12 +220,22 @@ export const CLNReducer = createReducer(initCLNState,
}),
on(setPageSettings, (state, { payload }) => {
const newPageSettings: PageSettingsCLN[] = [];
- CLN_DEFAULT_PAGE_SETTINGS.forEach((page) => {
- const pageIdx = payload.findIndex((p) => p.pageId === page.pageId);
- if (pageIdx >= 0) {
- newPageSettings.push(payload[pageIdx]);
+ CLN_DEFAULT_PAGE_SETTINGS.forEach((defaultPage) => {
+ const pageSetting = payload.find((p) => p.pageId === defaultPage.pageId) || null;
+ if (pageSetting) {
+ const tablesSettings = JSON.parse(JSON.stringify(pageSetting.tables));
+ pageSetting.tables = []; // To maintain settings order
+ defaultPage.tables.forEach((defaultTable) => {
+ const tableSetting = tablesSettings.find((t) => t.tableId === defaultTable.tableId) || null;
+ if (tableSetting) {
+ pageSetting.tables.push(tableSetting);
+ } else {
+ pageSetting.tables.push(JSON.parse(JSON.stringify(defaultTable)));
+ }
+ });
+ newPageSettings.push(pageSetting);
} else {
- newPageSettings.push(page);
+ newPageSettings.push(JSON.parse(JSON.stringify(defaultPage)));
}
});
return {
diff --git a/src/app/shared/components/navigation/top-menu/top-menu.component.html b/src/app/shared/components/navigation/top-menu/top-menu.component.html
index 417f2820..e1683512 100644
--- a/src/app/shared/components/navigation/top-menu/top-menu.component.html
+++ b/src/app/shared/components/navigation/top-menu/top-menu.component.html
@@ -12,7 +12,7 @@
Settings
-
+
Help
diff --git a/src/app/shared/components/navigation/top-menu/top-menu.component.ts b/src/app/shared/components/navigation/top-menu/top-menu.component.ts
index 022b9a99..9f0a0060 100644
--- a/src/app/shared/components/navigation/top-menu/top-menu.component.ts
+++ b/src/app/shared/components/navigation/top-menu/top-menu.component.ts
@@ -3,7 +3,7 @@ import { Subject } from 'rxjs';
import { takeUntil, filter } from 'rxjs/operators';
import { Store } from '@ngrx/store';
import { Actions } from '@ngrx/effects';
-import { faCodeBranch, faCode, faCog, faLifeRing, faEject, faUserCog } from '@fortawesome/free-solid-svg-icons';
+import { faCodeBranch, faCode, faCog, faQuestion, faEject, faUserCog } from '@fortawesome/free-solid-svg-icons';
import { GetInfoRoot } from '../../../models/RTLconfig';
import { LoggerService } from '../../../services/logger.service';
@@ -29,7 +29,7 @@ export class TopMenuComponent implements OnInit, OnDestroy {
public faCodeBranch = faCodeBranch;
public faCode = faCode;
public faCog = faCog;
- public faLifeRing = faLifeRing;
+ public faQuestion = faQuestion;
public faEject = faEject;
public version = '';
public information: GetInfoRoot = {};
diff --git a/src/app/shared/components/node-config/page-settings/page-settings.component.ts b/src/app/shared/components/node-config/page-settings/page-settings.component.ts
index 2bdaada1..746040f7 100644
--- a/src/app/shared/components/node-config/page-settings/page-settings.component.ts
+++ b/src/app/shared/components/node-config/page-settings/page-settings.component.ts
@@ -27,7 +27,7 @@ export class PageSettingsComponent implements OnInit, OnDestroy {
public screenSizeEnum = ScreenSizeEnum;
public pageSizeOptions = PAGE_SIZE_OPTIONS;
public pageSettings: PageSettingsCLN[] = [];
- public initialPageSettings: PageSettingsCLN[] = CLN_DEFAULT_PAGE_SETTINGS;
+ public initialPageSettings: PageSettingsCLN[] = Object.assign([], CLN_DEFAULT_PAGE_SETTINGS);
public tableFieldsDef = CLN_TABLES_DEF;
public sortOrders = SORT_ORDERS;
public apiCallStatus: ApiCallStatusPayload | null = null;
@@ -48,7 +48,7 @@ export class PageSettingsComponent implements OnInit, OnDestroy {
this.errorMessage = this.apiCallStatus.message || null;
}
this.pageSettings = settings.pageSettings;
- this.initialPageSettings = JSON.parse(JSON.stringify(settings.pageSettings));
+ this.initialPageSettings = settings.pageSettings;
this.logger.info(settings);
});
this.actions.pipe(takeUntil(this.unSubs[1]), filter((action) => action.type === CLNActions.UPDATE_API_CALL_STATUS_CLN || action.type === CLNActions.SAVE_PAGE_SETTINGS_CLN)).
@@ -83,11 +83,10 @@ export class PageSettingsComponent implements OnInit, OnDestroy {
onResetPageSettings(prev: string) {
if (prev === 'current') {
this.errorMessage = null;
- this.pageSettings = this.initialPageSettings;
+ this.pageSettings = JSON.parse(JSON.stringify(this.initialPageSettings));
} else {
this.errorMessage = null;
- this.pageSettings = CLN_DEFAULT_PAGE_SETTINGS;
- this.onUpdatePageSettings();
+ this.pageSettings = JSON.parse(JSON.stringify(CLN_DEFAULT_PAGE_SETTINGS));
}
}