From d93e6a996e60fb6abce9a870cef6b2d57bfa70fd Mon Sep 17 00:00:00 2001 From: Herbert Eiselt Date: Fri, 7 Jun 2019 17:40:50 +0200 Subject: SDNR Add missing status bar to ODLUX Framework Modify framework and adapt all apps Issue-ID: SDNC-789 Signed-off-by: Herbert Eiselt Change-Id: I1ea0a3df6c3f6db08f2bd7a21eb3b4cbf230a08a Signed-off-by: Herbert Eiselt --- sdnr/wt/odlux/framework/src/actions/titleActions.ts | 6 +++--- .../odlux/framework/src/components/routing/appFrame.tsx | 15 ++++++++------- sdnr/wt/odlux/framework/src/components/titleBar.tsx | 8 +++++++- .../framework/src/handlers/applicationStateHandler.ts | 8 +++++--- sdnr/wt/odlux/framework/src/models/applicationInfo.ts | 8 ++++++-- sdnr/wt/odlux/framework/src/services/restService.ts | 4 ++-- sdnr/wt/odlux/framework/src/utilities/elasticSearch.ts | 11 +++++------ sdnr/wt/odlux/framework/src/views/frame.tsx | 2 +- 8 files changed, 37 insertions(+), 25 deletions(-) (limited to 'sdnr/wt/odlux/framework/src') diff --git a/sdnr/wt/odlux/framework/src/actions/titleActions.ts b/sdnr/wt/odlux/framework/src/actions/titleActions.ts index b641bab95..4e5174d59 100644 --- a/sdnr/wt/odlux/framework/src/actions/titleActions.ts +++ b/sdnr/wt/odlux/framework/src/actions/titleActions.ts @@ -1,10 +1,10 @@ import { Action } from '../flux/action'; -import { IconType } from '../models/iconDefinition'; +import { IconType } from '../models/iconDefinition'; export class SetTitleAction extends Action { - - constructor(public title: string, public icon?: IconType) { + + constructor(public title: string, public icon?: IconType, public appId?: string) { super(); } } \ No newline at end of file diff --git a/sdnr/wt/odlux/framework/src/components/routing/appFrame.tsx b/sdnr/wt/odlux/framework/src/components/routing/appFrame.tsx index 55b249246..06ad5b434 100644 --- a/sdnr/wt/odlux/framework/src/components/routing/appFrame.tsx +++ b/sdnr/wt/odlux/framework/src/components/routing/appFrame.tsx @@ -5,29 +5,30 @@ import connect, { Connect } from '../../flux/connect'; import { SetTitleAction } from '../../actions/titleActions'; import { AddErrorInfoAction } from '../../actions/errorActions'; -import { IconType } from '../../models/iconDefinition'; +import { IconType } from '../../models/iconDefinition'; export interface IAppFrameProps { title: string; icon?: IconType; + appId?: string } -/** - * Represents a component to wich will embed each single app providing the +/** + * Represents a component to wich will embed each single app providing the * functionality to update the title and implement an exeprion border. */ export class AppFrame extends React.Component { - + public render(): JSX.Element { return ( -
+
{ this.props.children }
) } - + public componentDidMount() { - this.props.dispatch(new SetTitleAction(this.props.title, this.props.icon)); + this.props.dispatch(new SetTitleAction(this.props.title, this.props.icon, this.props.appId)); } public componentDidCatch(error: Error | null, info: object) { this.props.dispatch(new AddErrorInfoAction({ error, info })); diff --git a/sdnr/wt/odlux/framework/src/components/titleBar.tsx b/sdnr/wt/odlux/framework/src/components/titleBar.tsx index a3ba571ec..230dda400 100644 --- a/sdnr/wt/odlux/framework/src/components/titleBar.tsx +++ b/sdnr/wt/odlux/framework/src/components/titleBar.tsx @@ -69,12 +69,18 @@ class TitleBarComponent extends React.Component - + { state.framework.applicationState.icon ? () : null } { state.framework.applicationState.title } +
+ { state.framework.applicationRegistraion && Object.keys(state.framework.applicationRegistraion).map(key => { + const reg = state.framework.applicationRegistraion[key]; + return reg && reg.statusBarElement && || null + })} + { state.framework.authenticationState.user ? (