fix: update SubsectionTitleCell styling (AA-934) (#633)

This commit is contained in:
Carla Duarte
2021-09-08 10:48:55 -04:00
committed by GitHub
parent 5ec0fec0ff
commit 597ecb7b4e
4 changed files with 35 additions and 22 deletions

View File

@@ -51,7 +51,7 @@ function DetailedGradesTable({ intl }) {
Header: `${intl.formatMessage(messages.score)}`,
accessor: 'score',
headerClassName: 'justify-content-end h5 mb-0',
cellClassName: 'float-right text-right small',
cellClassName: 'float-right small',
},
]}
>

View File

@@ -52,7 +52,17 @@ function SubsectionTitleCell({ intl, subsection }) {
<Collapsible.Visible whenOpen><Icon src={ArrowDropUp} /></Collapsible.Visible>
</Collapsible.Trigger>
<span className="small d-inline ml-4 pl-1">
{gradesFeatureIsFullyLocked || subsection.learnerHasAccess ? '' : <Icon id={`detailedGradesBlockedIcon${subsection.blockKey}`} aria-label={intl.formatMessage(messages.noAcessToSubsection, { displayName })} className="mr-1 mt-1 d-inline-flex" style={{ height: '1rem', width: '1rem' }} src={Blocked} data-testid="blocked-icon" />}
{gradesFeatureIsFullyLocked || subsection.learnerHasAccess ? ''
: (
<Icon
id={`detailedGradesBlockedIcon${subsection.blockKey}`}
aria-label={intl.formatMessage(messages.noAccessToSubsection, { displayName })}
className="mr-1 mt-1 d-inline-flex"
style={{ height: '1rem', width: '1rem' }}
src={Blocked}
data-testid="blocked-icon"
/>
)}
{url ? (
<a
href={url}
@@ -68,7 +78,7 @@ function SubsectionTitleCell({ intl, subsection }) {
)}
</span>
</Row>
<Collapsible.Body>
<Collapsible.Body className="d-flex w-100">
<ProblemScoreDrawer problemScores={problemScores} subsection={subsection} />
</Collapsible.Body>
</Collapsible.Advanced>

View File

@@ -18,25 +18,28 @@ function AssignmentTypeCell({
gradesFeatureIsFullyLocked,
} = useModel('progress', courseId);
const lockedIcon = locked ? <Icon id={`assignmentTypeBlockedIcon${assignmentType}`} aria-label={intl.formatMessage(messages.noAcessToAssignmentType, { assignmentType })} className="mr-1 mt-1 d-inline-flex" style={{ height: '1rem', width: '1rem' }} src={Blocked} data-testid="blocked-icon" /> : '';
const lockedIcon = locked ? <Icon id={`assignmentTypeBlockedIcon${assignmentType}`} aria-label={intl.formatMessage(messages.noAccessToAssignmentType, { assignmentType })} className="mr-1 mt-1 d-inline-flex" style={{ height: '1rem', width: '1rem' }} src={Blocked} data-testid="blocked-icon" /> : '';
return (
<div className="small">
<span className="d-inline-flex">{lockedIcon}{assignmentType}</span>
{footnoteId && footnoteMarker && (
<sup>
<a
id={`${footnoteId}-ref`}
className="muted-link"
href={`#${footnoteId}-footnote`}
aria-describedby="grade-summary-footnote-label"
tabIndex={gradesFeatureIsFullyLocked ? '-1' : '0'}
aria-labelledby={`assignmentTypeBlockedIcon${assignmentType}`}
>
{footnoteMarker}
</a>
</sup>
)}
<div className="d-flex small">
<div className="d-flex">{lockedIcon}</div>
<div>
{assignmentType}&nbsp;
{footnoteId && footnoteMarker && (
<sup>
<a
id={`${footnoteId}-ref`}
className="muted-link"
href={`#${footnoteId}-footnote`}
aria-describedby="grade-summary-footnote-label"
tabIndex={gradesFeatureIsFullyLocked ? '-1' : '0'}
aria-labelledby={`assignmentTypeBlockedIcon${assignmentType}`}
>
{footnoteMarker}
</a>
</sup>
)}
</div>
</div>
);
}

View File

@@ -139,11 +139,11 @@ const messages = defineMessages({
id: 'progress.weightedGradeSummary',
defaultMessage: 'Your current weighted grade summary',
},
noAcessToAssignmentType: {
noAccessToAssignmentType: {
id: 'progress.noAcessToAssignmentType',
defaultMessage: 'You do not have access to assignments of type {assignmentType}',
},
noAcessToSubsection: {
noAccessToSubsection: {
id: 'progress.noAcessToSubsection',
defaultMessage: 'You do not have access to subsection {displayName}',
},