-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Refactors Account class and improves tests - Updates the package version of react website --------- Co-authored-by: Jeevika Sirwani <[email protected]>
- Loading branch information
1 parent
bfe3227
commit eaa22d5
Showing
5 changed files
with
46 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@into-cps-association/dtaas-web", | ||
"version": "0.3.2", | ||
"version": "0.3.3", | ||
"description": "Web client for Digital Twin as a Service (DTaaS)", | ||
"main": "index.tsx", | ||
"author": "prasadtalasila <[email protected]> (http://prasad.talasila.in/)", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,23 @@ | ||
import * as React from 'react'; | ||
import Layout from 'page/Layout'; | ||
import AccountTabs from './AccountTabs'; | ||
import { Typography } from '@mui/material'; | ||
import TabComponent from 'components/tab/TabComponent'; | ||
import { TabData } from 'components/tab/subcomponents/TabRender'; | ||
import tabs from './AccountTabData'; | ||
|
||
const DTContent: React.FC = () => ( | ||
<Layout> | ||
<AccountTabs /> | ||
</Layout> | ||
); | ||
function AccountContent() { | ||
const AccountTab: TabData[] = tabs.map((tab) => ({ | ||
label: tab.label, | ||
body: <Typography variant="body1">{tab.body}</Typography>, | ||
})); | ||
|
||
const DigitalTwins: React.FC = () => <DTContent />; /* jshint ignore:line */ | ||
export default DigitalTwins; | ||
return ( | ||
<Layout> | ||
<TabComponent assetType={AccountTab} scope={[]} /> | ||
</Layout> | ||
); | ||
} | ||
|
||
export default function Account() { | ||
return <AccountContent />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { ITabs } from 'route/IData'; | ||
|
||
const tabs: ITabs[] = [ | ||
{ | ||
label: 'Profile', | ||
body: `Profile - potentially visible to other users.`, | ||
}, | ||
{ | ||
label: 'Settings', | ||
body: `Account settings - private to a user.`, | ||
}, | ||
]; | ||
|
||
export default tabs; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import * as React from 'react'; | ||
import Account from 'route/auth/Account'; | ||
import tabs from 'route/auth/AccountTabData'; | ||
import { InitRouteTests, itDisplaysContentOfTabs } from '../testUtils'; | ||
|
||
describe('Account Page', () => { | ||
const tabLabels: string[] = []; | ||
tabs.forEach((tab) => tabLabels.push(tab.label)); | ||
InitRouteTests(<Account />); | ||
|
||
itDisplaysContentOfTabs(tabs); | ||
}); |