Skip to content

Commit 9b1ab1a

Browse files
committed
Merge branch 'slightly-cleaner-table-cells' of Arnei/opencast-admin-interface into r/17.x
Pull request #1436 Remove unnecessary html tags from table cells
2 parents 9e4246a + 9be9f3a commit 9b1ab1a

7 files changed

Lines changed: 74 additions & 74 deletions

File tree

src/components/configuration/partials/ThemesDateTimeCell.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ const ThemesDateTimeCell = ({
1515

1616
return (
1717
// Link template for creation date of themes
18-
<span>
18+
<>
1919
{t("dateFormats.date.short", {
2020
date: row.creationDate ? renderValidDate(row.creationDate) : "",
2121
})}
22-
</span>
22+
</>
2323
);
2424
};
2525

src/components/events/partials/EventsEndCell.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const EventsEndCell = ({
1515

1616
return (
1717
// Link template for start date of event
18-
<span>{t("dateFormats.time.short", { time: renderValidDate(row.end_date) })}</span>
18+
<>{t("dateFormats.time.short", { time: renderValidDate(row.end_date) })}</>
1919
);
2020
};
2121
export default EventsEndCell;

src/components/events/partials/EventsLocationCell.tsx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,18 @@ const EventsLocationCell = ({
3030
};
3131

3232
return (
33-
// Link template for location of event
34-
<ButtonLikeAnchor
35-
onClick={() => addFilter(row.location)}
36-
className={"crosslink"}
37-
// tooltipText={"EVENTS.EVENTS.TABLE.TOOLTIP.LOCATION"} // Disabled due to performance concerns
38-
>
39-
{row.location}
40-
</ButtonLikeAnchor>
33+
<>
34+
{ row.location &&
35+
// Link template for location of event
36+
<ButtonLikeAnchor
37+
onClick={() => addFilter(row.location)}
38+
className={"crosslink"}
39+
// tooltipText={"EVENTS.EVENTS.TABLE.TOOLTIP.LOCATION"} // Disabled due to performance concerns
40+
>
41+
{row.location}
42+
</ButtonLikeAnchor>
43+
}
44+
</>
4145
);
4246
};
4347

src/components/events/partials/EventsStartCell.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ const EventsStartCell = ({
1515

1616
return (
1717
// Link template for start date of event
18-
<span>
19-
{t("dateFormats.time.short", { time: renderValidDate(row.start_date) })}
20-
</span>
18+
<>{t("dateFormats.time.short", { time: renderValidDate(row.start_date) })}</>
2119
);
2220
};
2321

src/components/events/partials/PublishedCell.tsx

Lines changed: 47 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React, { useEffect, useState } from "react";
22
import { useTranslation } from "react-i18next";
33
import { Event } from "../../../slices/eventSlice";
4-
import { Tooltip } from "../../shared/Tooltip";
54
import ButtonLikeAnchor from "../../shared/ButtonLikeAnchor";
65
import { enrichPublications } from "../../../thunks/assetsThunks";
76
import { useAppDispatch } from "../../../store";
@@ -76,52 +75,54 @@ const PublishCell = ({
7675
&& publications[0].id === 'engage-player';
7776

7877
return (
79-
<div className="popover-wrapper">
80-
{onlyEngage && (
81-
// <Tooltip title={t("EVENTS.EVENTS.TABLE.TOOLTIP.PLAYER")}> // Disabled due to performance concerns
82-
<a href={publications[0].url} rel="noreferrer" target="_blank">
83-
<ButtonLikeAnchor>
84-
{t("YES")}
85-
</ButtonLikeAnchor>
86-
</a>
87-
// </Tooltip>
88-
)}
89-
{!onlyEngage && publications.length > 0 && (
90-
<>
91-
<ButtonLikeAnchor className="popover-wrapper__trigger">
92-
<span onClick={() => setShowPopup(!showPopup)}>{t("YES")}</span>
93-
</ButtonLikeAnchor>
94-
{showPopup && (
95-
<div className="js-popover popover" ref={containerPublications}>
96-
<div className="popover__header" />
97-
<div className="popover__content">
98-
{/* Show a list item for each publication of an event that isn't hidden*/}
99-
{publications.map((publication, key) =>
100-
!publication.hide ? (
101-
// Check if publications is enabled and choose icon according
102-
publication.enabled ? (
103-
<a
104-
href={publication.url}
105-
className="popover__list-item"
106-
target="_blank"
107-
rel="noreferrer"
108-
key={key}
109-
>
110-
<span>{publication.label ? t(publication.label as ParseKeys) : t(publication.name as ParseKeys)}</span>
111-
</a>
112-
) : (
113-
<ButtonLikeAnchor key={key} className="popover__list-item">
114-
<span>{publication.label ? t(publication.label as ParseKeys) : t(publication.name as ParseKeys)}</span>
115-
</ButtonLikeAnchor>
116-
)
117-
) : null
118-
)}
119-
</div>
120-
</div>
78+
<>
79+
{ publications.length > 0 &&
80+
<div className="popover-wrapper">
81+
{onlyEngage && (
82+
// <Tooltip title={t("EVENTS.EVENTS.TABLE.TOOLTIP.PLAYER")}> // Disabled due to performance concerns
83+
<a className="crosslink" href={publications[0].url} rel="noreferrer" target="_blank">
84+
{t("YES")}
85+
</a>
86+
// </Tooltip>
12187
)}
122-
</>
123-
)}
124-
</div>
88+
{!onlyEngage &&
89+
<>
90+
<ButtonLikeAnchor className="popover-wrapper__trigger">
91+
<span onClick={() => setShowPopup(!showPopup)}>{t("YES")}</span>
92+
</ButtonLikeAnchor>
93+
{showPopup && (
94+
<div className="js-popover popover" ref={containerPublications}>
95+
<div className="popover__header" />
96+
<div className="popover__content">
97+
{/* Show a list item for each publication of an event that isn't hidden*/}
98+
{publications.map((publication, key) =>
99+
!publication.hide ? (
100+
// Check if publications is enabled and choose icon according
101+
publication.enabled ? (
102+
<a
103+
href={publication.url}
104+
className="popover__list-item"
105+
target="_blank"
106+
rel="noreferrer"
107+
key={key}
108+
>
109+
<span>{publication.label ? t(publication.label as ParseKeys) : t(publication.name as ParseKeys)}</span>
110+
</a>
111+
) : (
112+
<ButtonLikeAnchor key={key} className="popover__list-item">
113+
<span>{publication.label ? t(publication.label as ParseKeys) : t(publication.name as ParseKeys)}</span>
114+
</ButtonLikeAnchor>
115+
)
116+
) : null
117+
)}
118+
</div>
119+
</div>
120+
)}
121+
</>
122+
}
123+
</div>
124+
}
125+
</>
125126
);
126127
};
127128

src/components/events/partials/SeriesDateTimeCell.tsx

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,16 @@ const SeriesDateTimeCell = ({
1313
}) => {
1414
return (
1515
<>
16-
{row.creation_date !== undefined && (() => {
17-
const creationDate = row.creation_date;
18-
return (
19-
<DateTimeCell
20-
resource="series"
21-
date={creationDate}
22-
filterName="CreationDate"
23-
fetchResource={fetchSeries}
24-
loadResourceIntoTable={loadSeriesIntoTable}
25-
// tooltipText="EVENTS.SERIES.TABLE.TOOLTIP.CREATION" // Disabled due to performance concerns
26-
/>
27-
);
28-
})()}
16+
{row.creation_date !== undefined &&
17+
<DateTimeCell
18+
resource="series"
19+
date={row.creation_date}
20+
filterName="CreationDate"
21+
fetchResource={fetchSeries}
22+
loadResourceIntoTable={loadSeriesIntoTable}
23+
// tooltipText="EVENTS.SERIES.TABLE.TOOLTIP.CREATION" // Disabled due to performance concerns
24+
/>
25+
}
2926
</>
3027
);
3128
};

src/components/users/partials/UsersRolesCell.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const UsersRolesCell = ({
4646
return displayRoles.join(', ');
4747
};
4848

49-
return <span>{getRoleString()}</span>;
49+
return <>{getRoleString()}</>;
5050
};
5151

5252
export default UsersRolesCell;

0 commit comments

Comments
 (0)