-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #172 from ReCodEx/broken-flag
Reflect exercise.isBroken flag in the UI.
- Loading branch information
Showing
13 changed files
with
196 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { FormattedMessage } from 'react-intl'; | ||
import Icon from 'react-fontawesome'; | ||
import { OverlayTrigger, Tooltip } from 'react-bootstrap'; | ||
|
||
const ExercisePrefixIcons = ({ id, isLocked, isBroken, ...props }) => | ||
<span> | ||
{isLocked && | ||
<span> | ||
<OverlayTrigger | ||
placement="right" | ||
overlay={ | ||
<Tooltip id={id}> | ||
<FormattedMessage | ||
id="app.ExercisePrefixIcons.isLocked" | ||
defaultMessage="Exercise is locked by the author and cannot be assigned." | ||
/> | ||
</Tooltip> | ||
} | ||
> | ||
<Icon {...props} name="lock" className="text-warning" /> | ||
</OverlayTrigger> | ||
| ||
</span>} | ||
{isBroken && | ||
<span> | ||
<OverlayTrigger | ||
placement="right" | ||
overlay={ | ||
<Tooltip id={id}> | ||
<FormattedMessage | ||
id="app.exercise.isBroken" | ||
defaultMessage="Exercise configuration is incorrect and needs fixing" | ||
/> | ||
</Tooltip> | ||
} | ||
> | ||
<Icon {...props} name="medkit" className="text-danger" /> | ||
</OverlayTrigger> | ||
| ||
</span>} | ||
</span>; | ||
|
||
ExercisePrefixIcons.propTypes = { | ||
id: PropTypes.any.isRequired, | ||
isLocked: PropTypes.bool.isRequired, | ||
isBroken: PropTypes.bool.isRequired | ||
}; | ||
|
||
export default ExercisePrefixIcons; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.