aboutsummaryrefslogtreecommitdiffstats
path: root/sdnr/wt/odlux/apps/helpApp/src
diff options
context:
space:
mode:
Diffstat (limited to 'sdnr/wt/odlux/apps/helpApp/src')
-rw-r--r--sdnr/wt/odlux/apps/helpApp/src/components/subMenuEntry.tsx14
-rw-r--r--sdnr/wt/odlux/apps/helpApp/src/handlers/helpAppRootHandler.ts4
-rw-r--r--sdnr/wt/odlux/apps/helpApp/src/index.html2
-rw-r--r--sdnr/wt/odlux/apps/helpApp/src/plugin.tsx10
-rw-r--r--sdnr/wt/odlux/apps/helpApp/src/services/helpService.ts4
-rw-r--r--sdnr/wt/odlux/apps/helpApp/src/views/helpApplication.tsx16
6 files changed, 25 insertions, 25 deletions
diff --git a/sdnr/wt/odlux/apps/helpApp/src/components/subMenuEntry.tsx b/sdnr/wt/odlux/apps/helpApp/src/components/subMenuEntry.tsx
index 72bb39e39..2328b12b3 100644
--- a/sdnr/wt/odlux/apps/helpApp/src/components/subMenuEntry.tsx
+++ b/sdnr/wt/odlux/apps/helpApp/src/components/subMenuEntry.tsx
@@ -13,23 +13,23 @@ import { TocTreeNode } from '../models/tocNode';
const TocTree = TreeView as any as TreeViewCtorType<TocTreeNode>;
const mapProps = (state: IApplicationStoreState) => ({
- helpToc: state.helpApp.toc,
- helpBusy: state.helpApp.busy
+ helpToc: state.help.toc,
+ helpBusy: state.help.busy
});
const mapDisp = (dispatcher: IDispatcher) => ({
- requestDocument: (node: TocTreeNode) => dispatcher.dispatch(new NavigateToApplication("helpApp", node.uri))
+ requestDocument: (node: TocTreeNode) => dispatcher.dispatch(new NavigateToApplication("help", node.uri))
});
const SubMenuEntryComponent: React.SFC<Connect<typeof mapProps, typeof mapDisp>> = (props) => {
return props.helpToc
? (
- <TocTree items={ props.helpToc } contentProperty={ "label" } childrenProperty={ "nodes" } depthOffset={ 1 }
+ <TocTree items={ props.helpToc } contentProperty={ "label" } childrenProperty={ "nodes" } depthOffset={ 1 }
useFolderIcons={ false } enableSearchBar={ false } onItemClick={ props.requestDocument } />
)
- : (
- <ListItemText >Loading ...</ListItemText>
- )
+ : (
+ <ListItemText >Loading ...</ListItemText>
+ )
};
export const SubMenuEntry = connect(mapProps, mapDisp)(SubMenuEntryComponent);
diff --git a/sdnr/wt/odlux/apps/helpApp/src/handlers/helpAppRootHandler.ts b/sdnr/wt/odlux/apps/helpApp/src/handlers/helpAppRootHandler.ts
index efdc6e83d..b9ddc50af 100644
--- a/sdnr/wt/odlux/apps/helpApp/src/handlers/helpAppRootHandler.ts
+++ b/sdnr/wt/odlux/apps/helpApp/src/handlers/helpAppRootHandler.ts
@@ -14,14 +14,14 @@ export interface IHelpAppStoreState {
declare module '../../../../framework/src/store/applicationStore' {
interface IApplicationStoreState {
- helpApp: IHelpAppStoreState
+ help: IHelpAppStoreState
}
}
const helpAppStoreStateInit: IHelpAppStoreState = {
busy: false,
toc: undefined,
- content: undefined,
+ content: undefined,
currentPath: undefined
};
diff --git a/sdnr/wt/odlux/apps/helpApp/src/index.html b/sdnr/wt/odlux/apps/helpApp/src/index.html
index 2d20410e0..6865db051 100644
--- a/sdnr/wt/odlux/apps/helpApp/src/index.html
+++ b/sdnr/wt/odlux/apps/helpApp/src/index.html
@@ -17,7 +17,7 @@
// run the application
require(["app", "helpApp"], function (app, helpApp) {
helpApp.register();
- app("./app.tsx")
+ app("./app.tsx").runApplication();
});
</script>
</body>
diff --git a/sdnr/wt/odlux/apps/helpApp/src/plugin.tsx b/sdnr/wt/odlux/apps/helpApp/src/plugin.tsx
index d1cf80804..f871ab9d9 100644
--- a/sdnr/wt/odlux/apps/helpApp/src/plugin.tsx
+++ b/sdnr/wt/odlux/apps/helpApp/src/plugin.tsx
@@ -1,6 +1,6 @@
// app configuration and main entry point for the app
-import * as React from "react";
+import * as React from "react";
import { withRouter, RouteComponentProps, Route, Switch, Redirect } from 'react-router-dom';
import { faFirstAid } from '@fortawesome/free-solid-svg-icons'; // select app icon
@@ -18,7 +18,7 @@ import { SubMenuEntry } from "./components/subMenuEntry";
import '!style-loader!css-loader!highlight.js/styles/default.css';
const mapProps = (state: IApplicationStoreState) => ({
-
+
});
const mapDisp = (dispatcher: IDispatcher) => ({
@@ -31,7 +31,7 @@ let currentHelpPath: string | undefined = undefined;
const HelpApplicationRouteAdapter = connect(mapProps, mapDisp)((props: RouteComponentProps<{ '0'?: string }> & Connect<typeof mapProps, typeof mapDisp>) => {
if (currentHelpPath !== props.match.params["0"]) {
- // route parameter has changed
+ // route parameter has changed
currentHelpPath = props.match.params["0"] || undefined;
// Hint: This timeout is need, since it is not recommended to change the state while rendering is in progress !
window.setTimeout(() => {
@@ -54,7 +54,7 @@ const App = withRouter((props: RouteComponentProps) => (
export async function register() {
const applicationApi = applicationManager.registerApplication({
- name: "helpApp",
+ name: "help",
icon: faFirstAid,
rootComponent: App,
rootActionHandler: helpAppRootHandler,
@@ -63,7 +63,7 @@ export async function register() {
});
// start the initial toc request after the application store is initalized
- const store = await applicationApi.applicationStoreInitialized;
+ const store = await applicationApi.applicationStoreInitialized;
store.dispatch(requestTocAsyncAction);
} \ No newline at end of file
diff --git a/sdnr/wt/odlux/apps/helpApp/src/services/helpService.ts b/sdnr/wt/odlux/apps/helpApp/src/services/helpService.ts
index 480cdd04e..800e0b47f 100644
--- a/sdnr/wt/odlux/apps/helpApp/src/services/helpService.ts
+++ b/sdnr/wt/odlux/apps/helpApp/src/services/helpService.ts
@@ -9,7 +9,7 @@ class HelpService {
public async getDocument(path: string): Promise<string | null> {
// check if the result is allready in the cache
if (this.documents[path]) return Promise.resolve(this.documents[path]);
-
+
// request the document
const result = await requestRest<string>(`/help/${ path }`.replace(/\/{2,}/i, '/'));
if (result) {
@@ -23,7 +23,7 @@ class HelpService {
if (this.tocNodeCollection) return Promise.resolve(this.tocNodeCollection);
// request the table of contents
- const result = await requestRest<TocNodeCollection>('/help/?meta');
+ const result = await requestRest<TocNodeCollection>('/help/?meta', undefined, false);
if (result !== false) {
const mapNodesCollection = (col: TocNodeCollection): TocTreeNode[] => {
return Object.keys(col).reduce <TocTreeNode[]>((acc, key) => {
diff --git a/sdnr/wt/odlux/apps/helpApp/src/views/helpApplication.tsx b/sdnr/wt/odlux/apps/helpApp/src/views/helpApplication.tsx
index dedb93607..54f708458 100644
--- a/sdnr/wt/odlux/apps/helpApp/src/views/helpApplication.tsx
+++ b/sdnr/wt/odlux/apps/helpApp/src/views/helpApplication.tsx
@@ -11,8 +11,8 @@ import { Markdown } from "../components/markdown";
import '!style-loader!css-loader!github-markdown-css/github-markdown.css'
const mapProps = (state: IApplicationStoreState) => ({
- content: state.helpApp.content,
- currentPath: state.helpApp.currentPath
+ content: state.help.content,
+ currentPath: state.help.currentPath
});
type HelpApplicationComponentProps = Connect<typeof mapProps>;
@@ -22,27 +22,27 @@ class HelpApplicationComponent extends React.Component<HelpApplicationComponentP
/**
* Initializes a new instance.
*/
- constructor(props: HelpApplicationComponentProps) {
+ constructor (props: HelpApplicationComponentProps) {
super(props);
-
+
this.renderer = new marked.Renderer();
this.renderer.link = (href: string, title: string, text: string) => {
// check if href is rel or abs
const absUrlMatch = href.trim().match(/^https?:\/\//i);
- return `<a href="${ absUrlMatch ? href : resolvePath('#/helpApp/', this.props.currentPath || '/', href) }" title="${ title }" >${ text }</a>`
+ return `<a href="${absUrlMatch ? href : resolvePath('#/help/', this.props.currentPath || '/', href)}" title="${title}" >${text}</a>`
};
this.renderer.image = (href: string, title: string) => {
- return `<img src="${ resolvePath('/help/', this.props.currentPath || '/', href) }" alt="${ title }" />`
+ return `<img src="${resolvePath('/help/', this.props.currentPath || '/', href)}" alt="${title}" />`
};
}
render(): JSX.Element {
return this.props.content ? (
- <Markdown text={ this.props.content } markedOptions={ { renderer: this.renderer } } className="markdown-body"
- style={{ maxWidth: "960px", margin: "1.5em auto" }} />
+ <Markdown text={this.props.content} markedOptions={{ renderer: this.renderer }} className="markdown-body"
+ style={{ maxWidth: "960px", margin: "1.5em auto" }} />
) : (<h2>Loading ...</h2>)
}