generated from openedx/frontend-template-application
-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mfrank/rename variables #17
Merged
Merged
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
The Frontend Plugin Framework uses the env.config.js file to extract the layout configuration for the plugins. | ||
|
||
The PluginSlot will find the configuration by the provided ID which matches a key inside the `pluginSlots` object | ||
|
||
Note: having both .env and env.config.js files will follow a predictable order, in which non-empty values in the | ||
JS-based config will overwrite the .env environment variables. | ||
|
||
frontend-platform's getConfig loads configuration in the following sequence: | ||
- .env file config | ||
- optional handlers (commonly used to merge MFE-specific config in via additional process.env variables) | ||
- env.config.js file config | ||
- runtime config | ||
*/ | ||
|
||
/** TODO: Examples still need to be set up as part of APER-3042 https://2u-internal.atlassian.net/browse/APER-3042 */ | ||
|
||
// module.exports = { | ||
// pluginSlots: { | ||
// example_plugin_slot: { | ||
// keepDefault: false, | ||
// plugins: [ | ||
// { | ||
// id: 'example_plugin', | ||
// type: 'IFRAME_PLUGIN', | ||
// url: 'http://localhost:{PORT}/{ROUTE}', | ||
// }, | ||
// ], | ||
// }, | ||
// }, | ||
// }; |
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 |
---|---|---|
|
@@ -35,7 +35,7 @@ const PluginContainerIframe = ({ | |
config, fallback, className, ...props | ||
}) => { | ||
const { url } = config; | ||
const { title, scrolling } = props; | ||
const { title } = props; | ||
const [mounted, setMounted] = useState(false); | ||
const [ready, setReady] = useState(false); | ||
|
||
|
@@ -68,7 +68,6 @@ const PluginContainerIframe = ({ | |
title={title} | ||
src={url} | ||
allow={IFRAME_FEATURE_POLICY} | ||
scrolling={scrolling} | ||
referrerPolicy="origin" // The sent referrer will be limited to the origin of the referring page: its scheme, host, and port. | ||
className={classNames( | ||
'border border-0 w-100', | ||
|
@@ -85,17 +84,19 @@ const PluginContainerIframe = ({ | |
export default PluginContainerIframe; | ||
|
||
PluginContainerIframe.propTypes = { | ||
/** Configuration for the Plugin in this container — i.e pluginSlot[id].example_plugin */ | ||
config: pluginConfigShape, | ||
/** Custom fallback component used when component is not ready (i.e. "loading") */ | ||
fallback: PropTypes.node, | ||
scrolling: PropTypes.oneOf(['auto', 'yes', 'no']), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This attribute has been deprecated for iframes. I think it may have been causing some of the scrollbars we were seeing before. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#deprecated_attributes |
||
/** Accessible label for the iframe */ | ||
title: PropTypes.string, | ||
/** Classes to apply to the iframe */ | ||
className: PropTypes.string, | ||
}; | ||
|
||
PluginContainerIframe.defaultProps = { | ||
config: null, | ||
fallback: null, | ||
scrolling: 'auto', | ||
title: null, | ||
className: null, | ||
}; |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need this TODO and commented out code in here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point on this commented out code in here. Could a lot of this exist in the README since there's already a section there about how the config should be set up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes good call outs. I will move it to the README. I blame my mucus infused brain for attempting to push a full file of comments 😅