summaryrefslogtreecommitdiffstats
path: root/sdnr/wt/odlux/apps/demoApp/src/views
diff options
context:
space:
mode:
authorsai-neetha <sai-neetha.phulmali@highstreet-technologies.com>2023-03-20 08:05:47 +0100
committerhighstreetherbert <herbert.eiselt@highstreet-technologies.com>2023-03-29 19:06:25 +0200
commit15e2d3a29b0d1a304965e34f114a911e5a7abdb3 (patch)
tree711ef5616aceb115a1081cccd152eeae0e87bc79 /sdnr/wt/odlux/apps/demoApp/src/views
parentac5e2dc8f1ee4d5549f7260374e8164d52b07f55 (diff)
Odlux Update
Add eslint and custom icons update Issue-ID: CCSDK-3871 Signed-off-by: sai-neetha <sai-neetha.phulmali@highstreet-technologies.com> Change-Id: If6b676128cc9cff0437a5dc54f85eaafd3b8c586 Signed-off-by: highstreetherbert <herbert.eiselt@highstreet-technologies.com>
Diffstat (limited to 'sdnr/wt/odlux/apps/demoApp/src/views')
-rw-r--r--sdnr/wt/odlux/apps/demoApp/src/views/authorsList.tsx32
-rw-r--r--sdnr/wt/odlux/apps/demoApp/src/views/editAuthor.tsx6
2 files changed, 22 insertions, 16 deletions
diff --git a/sdnr/wt/odlux/apps/demoApp/src/views/authorsList.tsx b/sdnr/wt/odlux/apps/demoApp/src/views/authorsList.tsx
index b56058d36..5d9f13a55 100644
--- a/sdnr/wt/odlux/apps/demoApp/src/views/authorsList.tsx
+++ b/sdnr/wt/odlux/apps/demoApp/src/views/authorsList.tsx
@@ -15,7 +15,7 @@
* the License.
* ============LICENSE_END==========================================================================
*/
-import * as React from 'react';
+import React from 'react';
import { withRouter, RouteComponentProps } from 'react-router-dom';
import Table from '@mui/material/Table';
@@ -25,22 +25,28 @@ import TableHead from '@mui/material/TableHead';
import TableRow from '@mui/material/TableRow';
import Paper from '@mui/material/Paper'; // means border
-import connect from '../../../../framework/src/flux/connect';
+import { connect } from '../../../../framework/src/flux/connect';
import { loadAllAuthorsAsync } from '../actions/authorActions';
import { IAuthor } from '../models/author';
interface IAuthorsListProps {
- authors: IAuthor[],
- busy: boolean,
- onLoadAllAuthors: () => void
+ authors: IAuthor[];
+ busy: boolean;
+ onLoadAllAuthors: () => void;
}
class AuthorsListComponent extends React.Component<RouteComponentProps & IAuthorsListProps> {
render(): JSX.Element {
const { authors, busy } = this.props;
- return (
+ return busy
+ ? (
+ <Paper>
+ Loading
+ </Paper>
+ )
+ : (
<Paper>
<Table padding="normal" >
<TableHead>
@@ -52,7 +58,7 @@ class AuthorsListComponent extends React.Component<RouteComponentProps & IAuthor
</TableHead>
<TableBody>
{authors.map(author => (
- <TableRow key={author.id} onClick={(e) => this.editAuthor(author)}>
+ <TableRow key={author.id} onClick={(_e) => this.editAuthor(author)}>
<TableCell>{author.id}</TableCell>
<TableCell>{author.firstName}</TableCell>
<TableCell>{author.lastName}</TableCell>
@@ -61,15 +67,15 @@ class AuthorsListComponent extends React.Component<RouteComponentProps & IAuthor
</TableBody>
</Table>
</Paper>
- );
- };
+ );
+ }
public componentDidMount() {
this.props.onLoadAllAuthors();
}
private editAuthor = (author: IAuthor) => {
- author && this.props.history.push(this.props.match.path + '/' + author.id);
+ if (author) this.props.history.push(this.props.match.path + '/' + author.id);
};
}
@@ -77,11 +83,11 @@ export const AuthorsList = withRouter(
connect(
({ demo: state }) => ({
authors: state.listAuthors.authors,
- busy: state.listAuthors.busy
+ busy: state.listAuthors.busy,
}),
(dispatcher) => ({
onLoadAllAuthors: () => {
- dispatcher.dispatch(loadAllAuthorsAsync)
- }
+ dispatcher.dispatch(loadAllAuthorsAsync);
+ },
}))(AuthorsListComponent));
export default AuthorsList;
diff --git a/sdnr/wt/odlux/apps/demoApp/src/views/editAuthor.tsx b/sdnr/wt/odlux/apps/demoApp/src/views/editAuthor.tsx
index 92f671234..0da619ba2 100644
--- a/sdnr/wt/odlux/apps/demoApp/src/views/editAuthor.tsx
+++ b/sdnr/wt/odlux/apps/demoApp/src/views/editAuthor.tsx
@@ -15,10 +15,10 @@
* the License.
* ============LICENSE_END==========================================================================
*/
-import * as React from 'react';
+import React from 'react';
import { withRouter, RouteComponentProps } from 'react-router-dom';
-type EditAuthorProps = RouteComponentProps<{ authorId: string}>;
+type EditAuthorProps = RouteComponentProps<{ authorId: string }>;
class EditAuthorComponent extends React.Component<EditAuthorProps> {
render(): JSX.Element {
@@ -26,7 +26,7 @@ class EditAuthorComponent extends React.Component<EditAuthorProps> {
<div>
<h2>Edit Author { this.props.match.params.authorId }</h2>
</div>
- )
+ );
}
}