-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add 'Manage' tab to Digital Twins page preview #957
Merged
prasadtalasila
merged 26 commits into
INTO-CPS-Association:feature/distributed-demo
from
VanessaScherma:manage
Oct 22, 2024
Merged
Changes from 17 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
09ada15
Add manage tab
cb4de3b
Merge branch 'INTO-CPS-Association:feature/distributed-demo' into manage
VanessaScherma 5e9edaa
Add Lifecycle section in Reconfigure
VanessaScherma 32a9914
Render images, tables and mathematical notation in DetailsDialog
VanessaScherma 912a9f1
Fix bug
VanessaScherma 4818067
Fix codeclimate issues
VanessaScherma 42299ae
Fix codeclimate issue
VanessaScherma c2773a8
Update preview tab
VanessaScherma 42a714a
Add unit tests
939e621
Rename functions
d75e747
Add yaml files to config files
d7ee4cc
Merge branch 'manage' of https://github.com/VanessaScherma/DTaaS into…
413d396
Little fix
VanessaScherma 4828566
Add yml files to config files
VanessaScherma a62b347
Update text description
VanessaScherma d957fbf
Update unit test
bae8bb7
Fix codeclimate issues
fe2182f
Fix codeclimate issue
5c12f3f
Update tests
517ad1b
Complete integration tests
621775b
Fix codeclimate issues
daebb10
Fix codeclimate issue
78335aa
Fix codeclimate issues
5ee7d39
Fix codeclimate issues
c6a7644
Updates
VanessaScherma dd7cc86
Update
VanessaScherma File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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
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
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,5 +1,4 @@ | ||
export interface Asset { | ||
name: string; | ||
description?: string; | ||
path: string; | ||
} |
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
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
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,28 @@ | ||
import * as React from 'react'; | ||
import { Dispatch, SetStateAction } from 'react'; | ||
import { Button } from '@mui/material'; | ||
|
||
interface DeleteButtonProps { | ||
setShowDelete: Dispatch<React.SetStateAction<boolean>>; | ||
} | ||
|
||
const handleToggleDeleteDialog = ( | ||
setShowDelete: Dispatch<SetStateAction<boolean>>, | ||
) => { | ||
setShowDelete(true); | ||
}; | ||
|
||
function DeleteButton({ setShowDelete }: DeleteButtonProps) { | ||
return ( | ||
<Button | ||
variant="contained" | ||
size="small" | ||
color="primary" | ||
onClick={() => handleToggleDeleteDialog(setShowDelete)} | ||
> | ||
Delete | ||
</Button> | ||
); | ||
} | ||
|
||
export default DeleteButton; |
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,35 @@ | ||
import * as React from 'react'; | ||
import { Dispatch, SetStateAction } from 'react'; | ||
import { Button } from '@mui/material'; | ||
import { useSelector } from 'react-redux'; | ||
import { selectDigitalTwinByName } from '../../store/digitalTwin.slice'; | ||
import DigitalTwin from '../../util/gitlabDigitalTwin'; | ||
|
||
interface DialogButtonProps { | ||
assetName: string; | ||
setShowDetails: Dispatch<React.SetStateAction<boolean>>; | ||
} | ||
|
||
export const handleToggleDetailsDialog = async ( | ||
digitalTwin: DigitalTwin, | ||
setShowDetails: Dispatch<SetStateAction<boolean>>, | ||
) => { | ||
await digitalTwin.getFullDescription(); | ||
setShowDetails(true); | ||
}; | ||
|
||
function DetailsButton({ assetName, setShowDetails }: DialogButtonProps) { | ||
const digitalTwin = useSelector(selectDigitalTwinByName(assetName)); | ||
return ( | ||
<Button | ||
variant="contained" | ||
size="small" | ||
color="primary" | ||
onClick={() => handleToggleDetailsDialog(digitalTwin, setShowDetails)} | ||
> | ||
Details | ||
</Button> | ||
); | ||
} | ||
|
||
export default DetailsButton; |
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,28 @@ | ||
import * as React from 'react'; | ||
import { Button } from '@mui/material'; | ||
import { Dispatch, SetStateAction } from 'react'; | ||
|
||
interface ReconfigureButtonProps { | ||
setShowReconfigure: Dispatch<SetStateAction<boolean>>; | ||
} | ||
|
||
export const handleToggleReconfigureDialog = ( | ||
setShowReconfigure: Dispatch<SetStateAction<boolean>>, | ||
) => { | ||
setShowReconfigure((prev) => !prev); | ||
}; | ||
|
||
function ReconfigureButton({ setShowReconfigure }: ReconfigureButtonProps) { | ||
return ( | ||
<Button | ||
variant="contained" | ||
size="small" | ||
color="primary" | ||
onClick={() => handleToggleReconfigureDialog(setShowReconfigure)} | ||
> | ||
Reconfigure | ||
</Button> | ||
); | ||
} | ||
|
||
export default ReconfigureButton; |
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
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are also "details" and "reconfigure" buttons. Why are they treated differently from delete button?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
onDelete
function is passed exclusively toAssetCardManage
, which includes the Delete button. This is because it is the only button that, in addition to having an API call viagitlabDigitalTwin
, must also modify the store via dispatch with thedeleteAsset
function.