@@ -27,6 +27,7 @@ import { USERS_WIDGET } from '@Pimcore/modules/user'
2727import { formatDataUnit } from '@Pimcore/utils/data-unit'
2828import { currentDomain } from '@Pimcore/app/config/app-config'
2929import { elementTypes } from '@Pimcore/types/enums/element/element-type'
30+ import { type ClassDefinitionListItem , useClassDefinitionCollectionQuery } from '@Pimcore/modules/class-definition/class-definition-slice-enhanced'
3031
3132export interface ISystemInfoModalProps {
3233 isOpen : boolean
@@ -40,11 +41,16 @@ export const SystemInfoModal = ({ isOpen, onClose, data }: ISystemInfoModalProps
4041 const currentUser = useUser ( )
4142 const { data : userList } = useUserGetCollectionQuery ( )
4243 const { openMainWidget } = useWidgetManager ( )
44+ const { data : classDefinitionData } = useClassDefinitionCollectionQuery ( )
4345
4446 if ( isNil ( data ) ) {
4547 return < > </ >
4648 }
4749
50+ const getByName = ( name : string ) : ClassDefinitionListItem | undefined => {
51+ return classDefinitionData ?. items ?. find ( ( classDefinition ) => classDefinition . name === name )
52+ }
53+
4854 const handleOpenUserManagement = ( userId : number ) : void => {
4955 const updConfig = {
5056 ...USERS_WIDGET ,
@@ -93,6 +99,7 @@ export const SystemInfoModal = ({ isOpen, onClose, data }: ISystemInfoModalProps
9399 )
94100 }
95101
102+ // system?
96103 return < Text type = "secondary" > User unknown</ Text >
97104 }
98105
@@ -106,16 +113,20 @@ export const SystemInfoModal = ({ isOpen, onClose, data }: ISystemInfoModalProps
106113 < FormKit formProps = { { initialValues : data } } >
107114 < FormKit . Panel >
108115 { renderInputItem ( { label : 'ID' , name : 'id' } ) }
109-
110116 { renderInputItem ( { label : 'Path' , name : 'fullPath' } ) }
111117
112- { data . type === 'image' && renderInputItem ( { label : 'Public URL' , value : `${ currentDomain } ${ data . fullPath } ` } ) }
118+ { data . elementType === elementTypes . dataObject && [
119+ renderInputItem ( { label : 'Parent ID' , name : 'parentId' } ) ,
120+ renderInputItem ( { label : 'Class ID' , value : getByName ( data . className ! ) ?. id ?? '' } ) ,
121+ renderInputItem ( { label : 'Class' , name : 'className' } ) ,
122+ renderInputItem ( { label : 'Type' , name : 'type' } )
123+ ] }
113124
125+ { data . type === 'image' && renderInputItem ( { label : 'Public URL' , value : `${ currentDomain } ${ data . fullPath } ` } ) }
114126 { data . elementType === elementTypes . asset && renderInputItem ( {
115127 label : 'Type' ,
116128 value : data . type + ' ' + ( ! isNil ( data . mimeType ) ? '(MIME: ' + data . mimeType + ')' : '' )
117129 } ) }
118-
119130 { data . fileSize > 0 && renderInputItem ( {
120131 label : 'File Size' ,
121132 value : formatDataUnit ( data . fileSize )
@@ -125,20 +136,16 @@ export const SystemInfoModal = ({ isOpen, onClose, data }: ISystemInfoModalProps
125136 label : 'Modification Date' ,
126137 value : formatDateTime ( { timestamp : data . modificationDate , dateStyle : 'full' , timeStyle : 'full' } )
127138 } ) }
128-
129139 { renderInputItem ( {
130140 label : 'Creation Date' ,
131141 value : formatDateTime ( { timestamp : data . creationDate , dateStyle : 'full' , timeStyle : 'full' } )
132142 } ) }
133-
134143 < Form . Item label = "User Modification" >
135144 < Text type = "secondary" > { getUserLabel ( data . userModification ) } </ Text >
136145 </ Form . Item >
137-
138146 < Form . Item label = "Owner" >
139147 { getUserLabel ( data . userModification ) }
140148 </ Form . Item >
141-
142149 { renderInputItem ( { label : 'Deeplink' , name : 'deeplink' } ) }
143150 </ FormKit . Panel
144151 > </ FormKit >
0 commit comments