Skip to content

Commit 26b930b

Browse files
updated the SystemInfoModal
1 parent 2a35c2a commit 26b930b

File tree

10 files changed

+161
-153
lines changed

10 files changed

+161
-153
lines changed

assets/js/src/core/modules/element/components/system-info-modal/provider/system-info-modal-provider.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export type ISystemInfoModalData = Element & {
2222
userModification: number | null
2323
fileSize: number
2424
mimeType: string | null
25+
className?: string
2526
}
2627

2728
export interface SystemInfoModalContextProps {

assets/js/src/core/modules/element/components/system-info-modal/system-info-modal.tsx

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import { USERS_WIDGET } from '@Pimcore/modules/user'
2727
import { formatDataUnit } from '@Pimcore/utils/data-unit'
2828
import { currentDomain } from '@Pimcore/app/config/app-config'
2929
import { elementTypes } from '@Pimcore/types/enums/element/element-type'
30+
import { type ClassDefinitionListItem, useClassDefinitionCollectionQuery } from '@Pimcore/modules/class-definition/class-definition-slice-enhanced'
3031

3132
export 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>

public/build/2156db50-a750-4a63-8f69-d377c116600f/entrypoints.json

Lines changed: 0 additions & 24 deletions
This file was deleted.

public/build/2156db50-a750-4a63-8f69-d377c116600f/manifest.json

Lines changed: 0 additions & 46 deletions
This file was deleted.

public/build/69d8b1b1-f850-43ca-b8b6-c04580489c3d/entrypoints.json renamed to public/build/44c438fb-18a3-41c0-97d4-7a12eb82a7e1/entrypoints.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)