Skip to content

Commit 993b8f5

Browse files
updated the SystemInfoModal
1 parent c3f34ed commit 993b8f5

File tree

3 files changed

+132
-114
lines changed

3 files changed

+132
-114
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ export type ISystemInfoModalData = Element & {
1818
creationDate: number | null
1919
userOwner: number
2020
userModification: number | null
21+
fileSize: number
22+
mimeType: string | null
2123
}
2224

2325
export interface SystemInfoModalContextProps {

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

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*/
1010

1111
import React from 'react'
12-
import { isNil, isUndefined } from 'lodash'
12+
import { isNil, isNull, isUndefined } from 'lodash'
1313
import { useTranslation } from 'react-i18next'
1414
import Link from 'antd/es/typography/Link'
1515
import { Modal } from '@Pimcore/components/modal/modal'
@@ -24,6 +24,7 @@ import { useUser } from '@Pimcore/modules/auth/hooks/use-user'
2424
import { Flex } from '@Pimcore/components/flex/flex'
2525
import { useWidgetManager } from '@Pimcore/modules/widget-manager/hooks/use-widget-manager'
2626
import { USERS_WIDGET } from '@Pimcore/modules/user'
27+
import { formatDataUnit } from '@Pimcore/utils/data-unit'
2728

2829
export interface ISystemInfoModalProps {
2930
isOpen: boolean
@@ -103,22 +104,37 @@ export const SystemInfoModal = ({ isOpen, onClose, data }: ISystemInfoModalProps
103104
<FormKit formProps={ { initialValues: data } }>
104105
<FormKit.Panel>
105106
{renderInputItem({ label: 'ID', name: 'id' })}
107+
106108
{renderInputItem({ label: 'Path', name: 'fullPath' })}
107-
{renderInputItem({ label: 'Type', name: 'type' })}
109+
110+
{renderInputItem({
111+
label: 'Type',
112+
value: `${data.type} ${!isNull(data.mimeType) ? `(MIME: ${data.mimeType})` : ''}`
113+
})}
114+
115+
{data.fileSize > 0 && renderInputItem({
116+
label: 'File Size',
117+
value: formatDataUnit(data.fileSize)
118+
})}
119+
108120
{renderInputItem({
109121
label: 'Modification Date',
110122
value: formatDateTime({ timestamp: data.modificationDate, dateStyle: 'full', timeStyle: 'full' })
111123
})}
124+
112125
{renderInputItem({
113126
label: 'Creation Date',
114127
value: formatDateTime({ timestamp: data.creationDate, dateStyle: 'full', timeStyle: 'full' })
115128
})}
129+
116130
<Form.Item label="User Modification">
117131
<Text type="secondary">{getUserLabel(data.userModification, 'system')}</Text>
118132
</Form.Item>
133+
119134
<Form.Item label="Owner">
120135
{getUserLabel(20, 'User unknown')}
121136
</Form.Item>
137+
122138
{renderInputItem({ label: 'Deeplink', name: 'deeplink' })}
123139
</FormKit.Panel
124140
></FormKit>

0 commit comments

Comments
 (0)