Skip to content

Commit

Permalink
Update Column Names according to new Design
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus Fichtner committed Mar 12, 2024
1 parent b478a8b commit 63af2af
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export const damFileTableFragment = gql`
...DamFileThumbnail
}
updatedAt
createdAt
importSourceType
}
${damFileThumbnailFragment}
Expand All @@ -49,6 +50,7 @@ export const damFolderTableFragment = gql`
numberOfChildFolders
isInboxFromOtherScope
updatedAt
createdAt
}
`;

Expand Down
57 changes: 50 additions & 7 deletions packages/admin/cms-admin/src/dam/DataGrid/FolderDataGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -393,10 +393,33 @@ const FolderDataGrid = ({
disableColumnMenu: true,
},
{
field: "size",
field: "type",
headerName: intl.formatMessage({
id: "comet.dam.file.size",
defaultMessage: "Size",
id: "comet.dam.file.format",
defaultMessage: "Type/Format",
}),
headerAlign: "left",
align: "left",
minWidth: 140,
renderCell: ({ row }) => {
if (isFile(row) && row.mimetype) {
return row.mimetype;
} else if (isFolder(row)) {
return intl.formatMessage({
id: "comet.dam.file.format.folder",
defaultMessage: "Folder",
});
}
},
sortable: false,
hideSortIcons: true,
disableColumnMenu: true,
},
{
field: "info",
headerName: intl.formatMessage({
id: "comet.dam.file.info",
defaultMessage: "Info",
}),
headerAlign: "right",
align: "right",
Expand All @@ -408,7 +431,7 @@ const FolderDataGrid = ({
return (
<FormattedMessage
id="comet.dam.folderSize"
defaultMessage="{number} {number, plural, one {item} other {items}}"
defaultMessage="{number} {number, plural, one {file} other {files}}"
values={{
number: row.numberOfFiles + row.numberOfChildFolders,
}}
Expand All @@ -420,14 +443,34 @@ const FolderDataGrid = ({
hideSortIcons: true,
disableColumnMenu: true,
},
{
field: "createdAt",
headerName: intl.formatMessage({
id: "comet.dam.file.creationDate",
defaultMessage: "Creation",
}),
headerAlign: "left",
align: "left",
minWidth: 180,
renderCell: ({ row }) => (
<div>
<FormattedDate value={row.createdAt} day="2-digit" month="2-digit" year="numeric" />
{", "}
<FormattedTime value={row.createdAt} />
</div>
),
sortable: false,
hideSortIcons: true,
disableColumnMenu: true,
},
{
field: "updatedAt",
headerName: intl.formatMessage({
id: "comet.dam.file.changeDate",
defaultMessage: "Change date",
defaultMessage: "Latest change",
}),
headerAlign: "right",
align: "right",
headerAlign: "left",
align: "left",
minWidth: 180,
renderCell: ({ row }) => (
<div>
Expand Down

0 comments on commit 63af2af

Please sign in to comment.