-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: [AXIMST-28] added edit modals for xblocks (#223)
* feat: [AXIMST-28] added edit modals for xblocks * refactor: added postMessages * refactor: modals refactoring * refactor: code refactoring * refactor: after rebase * refactor: styles refactoring * refactor: code refactoring * refactor: create iframe component * refactor: error handling * fix: fixed tests * refactor: removed error handling * refactor: refactoring after review feat: added move modal and tests feat: added alert for successful unit movement feat: added alert logic refactor: code refactoring refactor: some refactoring refactor: code refactoring refactor: code refactoring refactor: refactoring after review refactor: after second review refactor: after rebase refactor: code refactoring refactor: tests refactoring
- Loading branch information
1 parent
087c82c
commit d10c912
Showing
18 changed files
with
620 additions
and
78 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { forwardRef } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
import { IFRAME_FEATURE_POLICY } from './constants'; | ||
|
||
const CourseIFrame = forwardRef(({ title, ...props }, ref) => ( | ||
<iframe | ||
title={title} | ||
// allowing 'autoplay' is required to allow the video XBlock to control the YouTube iframe it has. | ||
allow={IFRAME_FEATURE_POLICY} | ||
referrerPolicy="origin" | ||
frameBorder={0} | ||
scrolling="no" | ||
ref={ref} | ||
sandbox={[ | ||
'allow-forms', | ||
'allow-modals', | ||
'allow-popups', | ||
'allow-popups-to-escape-sandbox', | ||
'allow-presentation', | ||
'allow-same-origin', // This is only secure IF the IFrame source | ||
// is served from a completely different domain name | ||
// e.g. labxchange-xblocks.net vs www.labxchange.org | ||
'allow-scripts', | ||
'allow-top-navigation-by-user-activation', | ||
].join(' ')} | ||
{...props} | ||
/> | ||
)); | ||
|
||
CourseIFrame.propTypes = { | ||
title: PropTypes.string.isRequired, | ||
}; | ||
|
||
export default CourseIFrame; |
Oops, something went wrong.