From bef731d6d1f1c250ba83dc310dd9988d68af94e8 Mon Sep 17 00:00:00 2001 From: unknown <n.santhanam@redkarma.eu> Date: Tue, 18 Aug 2020 13:35:17 +0530 Subject: [PATCH] TMSS-297 Function and variable names updated --- SAS/TMSS/frontend/tmss_webapp/src/App.js | 14 +++++++------- .../src/layout/components/AppBreadcrumb.js | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/SAS/TMSS/frontend/tmss_webapp/src/App.js b/SAS/TMSS/frontend/tmss_webapp/src/App.js index 19b52034e06..c35c53eb523 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/App.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/App.js @@ -23,7 +23,7 @@ class App extends Component { layoutMode: 'static', currentMenu: '', currentPath: '/', - currentPageName:'', + PageTitle:'', staticMenuInactive: false, overlayMenuActive: false, mobileMenuActive: false, @@ -32,7 +32,7 @@ class App extends Component { this.onToggleMenu = this.onToggleMenu.bind(this); this.onSidebarClick = this.onSidebarClick.bind(this); this.onMenuItemClick = this.onMenuItemClick.bind(this); - this.setCurrentPageName = this.setCurrentPageName.bind(this); + this.setPageTitle = this.setPageTitle.bind(this); this.menu = [ {label: 'Dashboard', icon: 'pi pi-fw pi-home', to:'/dashboard'}, @@ -90,9 +90,9 @@ class App extends Component { return window.innerWidth > 1024; } - setCurrentPageName(currentPageName) { - if (currentPageName !== this.state.currentPageName) { - this.setState({ currentPageName }) + setPageTitle(PageTitle) { + if (PageTitle !== this.state.PageTitle) { + this.setState({ PageTitle }) } } @@ -116,9 +116,9 @@ class App extends Component { <Router basename={ this.state.currentPath }> <AppMenu model={this.menu} onMenuItemClick={this.onMenuItemClick} /> <div className="layout-main"> - <AppBreadCrumbWithRouter setCurrentPageName={this.setCurrentPageName} /> + <AppBreadCrumbWithRouter setPageTitle={this.setPageTitle} /> {/* Display current pagename */} - <h2>{this.state.currentPageName}</h2> + <h2>{this.state.PageTitle}</h2> <RoutedContent /> </div> </Router> diff --git a/SAS/TMSS/frontend/tmss_webapp/src/layout/components/AppBreadcrumb.js b/SAS/TMSS/frontend/tmss_webapp/src/layout/components/AppBreadcrumb.js index eec54bcbc70..7c966d34bb8 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/layout/components/AppBreadcrumb.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/layout/components/AppBreadcrumb.js @@ -27,13 +27,13 @@ export class AppBreadcrumb extends Component { onRoute() { const { breadcrumbs } = this.state; - const { setCurrentPageName } = this.props; + const { setPageTitle } = this.props; const currentRoute = routes.find(route => matchPath(this.props.location.pathname, {path: route.path, exact: true, strict: true})); //for intial route ,there wont be any route object so it failed if(!currentRoute){ return; } - setCurrentPageName(currentRoute.pageTitle); + setPageTitle(currentRoute.pageTitle); if (!breadcrumbs.length) { this.setState({ breadcrumbs: [{...this.props.location, name: currentRoute.name}] }); return; -- GitLab