-
Notifications
You must be signed in to change notification settings - Fork 80
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
feat(ui): delete objects from the ui #3261
Changes from 34 commits
69a8da7
fe1e350
4069205
873dc27
0162f69
314e57c
03b3910
62d0f32
9a16ad5
e81a313
77ffe64
eea58b0
b25cd1b
a58565d
6ce18b7
ee4dde1
77d5772
66c0dad
4796f40
119571b
3fadc2d
f819f80
0e97e19
629287b
d2c051a
c8d67fb
121cb37
3248926
e218391
1d25acd
59c9a32
5820182
33b354d
0893dd4
a8dcfbd
59716f1
387d6c3
17278be
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import {Box} from '@material-ui/core'; | ||
import {Box} from '@mui/material'; | ||
import React, {useMemo} from 'react'; | ||
|
||
import { | ||
|
@@ -9,9 +9,10 @@ import { | |
import {hexToRGB} from '../../../../../../../../common/css/utils'; | ||
import {parseRef, WeaveObjectRef} from '../../../../../../../../react'; | ||
import {Icon, IconNames} from '../../../../../../../Icon'; | ||
import {SmallRef} from '../../../../../Browse2/SmallRef'; | ||
import {objectRefDisplayName, SmallRef} from '../../../../../Browse2/SmallRef'; | ||
import {CallLink, ObjectVersionLink} from '../../../common/Links'; | ||
import {useWFHooks} from '../../../wfReactInterface/context'; | ||
import {isObjDeleteError} from '../../../wfReactInterface/utilities'; | ||
import {ObjectVersionKey} from '../../../wfReactInterface/wfDataModelHooksInterface'; | ||
import {EvaluationComparisonState} from '../../ecpState'; | ||
|
||
|
@@ -43,11 +44,10 @@ export const EvaluationModelLink: React.FC<{ | |
}> = props => { | ||
const {useObjectVersion} = useWFHooks(); | ||
const evaluationCall = props.state.summary.evaluationCalls[props.callId]; | ||
const modelObj = props.state.summary.models[evaluationCall.modelRef]; | ||
const objRef = useMemo( | ||
() => parseRef(modelObj.ref) as WeaveObjectRef, | ||
[modelObj.ref] | ||
); | ||
const objRef = useMemo(() => { | ||
Comment on lines
46
to
-50
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @tssweeney does this make sense? I think we actually never needed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. looks correct! |
||
return parseRef(evaluationCall.modelRef) as WeaveObjectRef; | ||
}, [evaluationCall.modelRef]); | ||
|
||
const objVersionKey = useMemo(() => { | ||
return { | ||
scheme: 'weave', | ||
|
@@ -69,10 +69,31 @@ export const EvaluationModelLink: React.FC<{ | |
]); | ||
const objectVersion = useObjectVersion(objVersionKey); | ||
|
||
if (isObjDeleteError(objectVersion.error)) { | ||
return ( | ||
<Box | ||
sx={{ | ||
height: '22px', | ||
flex: 1, | ||
minWidth: 0, | ||
overflow: 'hidden', | ||
whiteSpace: 'nowrap', | ||
textOverflow: 'ellipsis', | ||
fontWeight: 500, | ||
textDecoration: 'line-through', | ||
}}> | ||
<Box display="flex" alignItems="center"> | ||
<ModelIcon /> | ||
{objectRefDisplayName(objRef).label} | ||
</Box> | ||
</Box> | ||
); | ||
} | ||
|
||
return ( | ||
<ObjectVersionLink | ||
entityName={modelObj.entity} | ||
projectName={modelObj.project} | ||
entityName={objRef.entityName} | ||
projectName={objRef.projectName} | ||
objectName={objRef.artifactName} | ||
version={objRef.artifactVersion} | ||
versionIndex={objectVersion.result?.versionIndex ?? 0} | ||
|
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.
models can now be deleted!