Skip to content
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

fix: Display the domain url for links that was previously missing #1694

Merged
merged 6 commits into from
Apr 2, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: Display domain url for links in shared files again
knipec committed Mar 27, 2024
commit 2fa167c7f84efec79edd3bfcc91ccdb5691d436c
64 changes: 46 additions & 18 deletions src/sharedData/components/SharedDataEntryBase.js
Original file line number Diff line number Diff line change
@@ -56,6 +56,7 @@ const SharedDataEntryBase = props => {
ShareComponent,
fileSize,
resourceType,
domain,
} = props;
const [isEditingName, setIsEditingName] = useState(false);
const [isEditingDescription, setIsEditingDescription] = useState(false);
@@ -162,6 +163,45 @@ const SharedDataEntryBase = props => {
[dataEntry, owner]
);

const LinkInfo = ({ domain }) => {
return (
<Grid
item
xs={4}
md={2}
order={{ xs: 5, md: 4 }}
sx={{ wordWrap: 'break-word' }}
>
{domain}
</Grid>
);
};

const FileInfo = ({ fileSize, resourceType }) => {
return (
<>
<Grid
item
xs={2}
md={1}
order={{ xs: 5, md: 4 }}
sx={{ wordWrap: 'break-word', textTransform: 'uppercase' }}
>
{resourceType}
</Grid>
<Grid
item
xs={2}
md={1}
order={{ xs: 6, md: 5 }}
sx={{ wordWrap: 'break-word' }}
>
{fileSize}
</Grid>
</>
);
};

return (
<ListItem sx={{ p: 0, flexDirection: 'column' }}>
<Grid
@@ -212,24 +252,12 @@ const SharedDataEntryBase = props => {
</Grid>

<Grid item xs={1} order={{ xs: 4 }} display={{ md: 'none' }} />
<Grid
item
xs={2}
md={1}
order={{ xs: 5, md: 4 }}
sx={{ wordWrap: 'break-word', textTransform: 'uppercase' }}
>
{resourceType}
</Grid>
<Grid
item
xs={2}
md={1}
order={{ xs: 6, md: 5 }}
sx={{ wordWrap: 'break-word' }}
>
{fileSize}
</Grid>
{dataEntry.entryType === 'LINK' ? (
<LinkInfo domain={domain} />
) : (
<FileInfo fileSize={fileSize} resourceType={resourceType} />
)}

<Grid item xs={7} order={{ xs: 7 }} display={{ md: 'none' }} />
<Grid item xs={1} order={{ xs: 7 }} display={{ md: 'none' }} />
<Grid item xs={11} md={3} order={{ xs: 8, md: 6 }}>
2 changes: 1 addition & 1 deletion src/sharedData/components/SharedDataEntryLink.js
Original file line number Diff line number Diff line change
@@ -88,7 +88,7 @@ const SharedDataEntryLink = props => {
/>
)}
DownloadComponent={DownloadComponent}
info={domain}
domain={domain}
/>
);
};