fix(Dashboard): changes required by linter

This commit is contained in:
Joao Victor 2022-04-26 18:18:44 -03:00
parent 868355cf40
commit c3f9bf3ff7
4 changed files with 36 additions and 9 deletions

View File

@ -87,14 +87,18 @@ class App extends React.Component {
const cDecoded = decodeURIComponent(document.cookie); const cDecoded = decodeURIComponent(document.cookie);
const cArr = cDecoded.split('; '); const cArr = cDecoded.split('; ');
cArr.forEach((val) => { cArr.forEach((val) => {
if (val.indexOf(`${cookieName}=`) === 0) learningDashboardAccessToken = val.substring((`${cookieName}=`).length); if (val.indexOf(`${cookieName}=`) === 0) {
learningDashboardAccessToken = val.substring((`${cookieName}=`).length);
}
}); });
// Extend AccessToken lifetime by 7d (in each access) // Extend AccessToken lifetime by 7d (in each access)
if (learningDashboardAccessToken !== '') { if (learningDashboardAccessToken !== '') {
const cookieExpiresDate = new Date(); const cookieExpiresDate = new Date();
cookieExpiresDate.setTime(cookieExpiresDate.getTime() + (3600000 * 24 * 7)); cookieExpiresDate.setTime(cookieExpiresDate.getTime() + (3600000 * 24 * 7));
document.cookie = `ld-${meetingId}=${learningDashboardAccessToken}; expires=${cookieExpiresDate.toGMTString()}; path=/;SameSite=None;Secure`; document.cookie = `ld-${meetingId}=${learningDashboardAccessToken}; \
expires=${cookieExpiresDate.toGMTString()}; \
path=/;SameSite=None;Secure`;
} }
} }

View File

@ -34,7 +34,12 @@ function Card(props) {
} }
return ( return (
<div className={`flex items-start justify-between p-3 bg-white rounded shadow border-l-4 ${cardClass}`}> <div
className={
`flex items-start justify-between p-3 bg-white \
rounded shadow border-l-4 ${cardClass}`
}
>
<div className="w-70"> <div className="w-70">
<p className="text-lg font-semibold text-gray-700"> <p className="text-lg font-semibold text-gray-700">
{ number } { number }

View File

@ -147,13 +147,21 @@ class StatusTable extends React.Component {
aria-label={tsToHHmmss(start - periods[0].start)} aria-label={tsToHHmmss(start - periods[0].start)}
> >
<a <a
href={`/bigbluebutton/presentation/${meetingId}/${meetingId}/${slide.presentationId}/svg/${slide.pageNum}`} href={
`/bigbluebutton/presentation/\
${meetingId}/${meetingId}/${slide.presentationId}\
/svg/${slide.pageNum}`
}
className="block border-2 border-gray-300" className="block border-2 border-gray-300"
target="_blank" target="_blank"
rel="noreferrer" rel="noreferrer"
> >
<img <img
src={`/bigbluebutton/presentation/${meetingId}/${meetingId}/${slide.presentationId}/thumbnail/${slide.pageNum}`} src={
`/bigbluebutton/presentation/\
${meetingId}/${meetingId}/${slide.presentationId}\
/thumbnail/${slide.pageNum}`
}
alt={intl.formatMessage({ alt={intl.formatMessage({
id: 'app.learningDashboard.statusTimelineTable.thumbnail', id: 'app.learningDashboard.statusTimelineTable.thumbnail',
defaultMessage: 'Presentation thumbnail', defaultMessage: 'Presentation thumbnail',
@ -257,7 +265,10 @@ class StatusTable extends React.Component {
const redress = '(0.375rem / 2)'; const redress = '(0.375rem / 2)';
return ( return (
<div <div
className={`h-1.5 ${width} bg-gray-200 absolute inset-x-0 z-10 ${roundedLeft} ${roundedRight}`} className={
`h-1.5 ${width} bg-gray-200 absolute \
inset-x-0 z-10 ${roundedLeft} ${roundedRight}`
}
style={{ style={{
top: `calc(50% - ${redress})`, top: `calc(50% - ${redress})`,
left: `${isRTL ? offsetRight : offsetLeft}%`, left: `${isRTL ? offsetRight : offsetLeft}%`,
@ -285,7 +296,12 @@ class StatusTable extends React.Component {
defaultMessage: emojiConfigs[emoji.name].defaultMessage, defaultMessage: emojiConfigs[emoji.name].defaultMessage,
})} })}
> >
<i className={`${emojiConfigs[emoji.name].icon} text-sm bbb-icon-timeline`} /> <i
className={
`${emojiConfigs[emoji.name].icon} \
text-sm bbb-icon-timeline`
}
/>
</div> </div>
); );
}) } }) }

View File

@ -211,11 +211,13 @@ const UserDatailsComponent = (props) => {
<div <div
className="min-w-[40%] text-ellipsis text-center overflow-hidden" className="min-w-[40%] text-ellipsis text-center overflow-hidden"
title={mostCommonAnswer title={mostCommonAnswer
? `${String.fromCharCode(mostCommonAnswer.charCodeAt(0) - 32)}${mostCommonAnswer.substring(1)}` ? `${String.fromCharCode(mostCommonAnswer.charCodeAt(0) - 32)}\
${mostCommonAnswer.substring(1)}`
: null} : null}
> >
{ mostCommonAnswer { mostCommonAnswer
? `${String.fromCharCode(mostCommonAnswer.charCodeAt(0) - 32)}${mostCommonAnswer.substring(1)}` ? `${String.fromCharCode(mostCommonAnswer.charCodeAt(0) - 32)}\
${mostCommonAnswer.substring(1)}`
: intl.formatMessage({ : intl.formatMessage({
id: 'app.learningDashboard.usersTable.notAvailable', id: 'app.learningDashboard.usersTable.notAvailable',
defaultMessage: 'N/A', defaultMessage: 'N/A',