Skip to content

Add external library selection #194

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

Merged
merged 29 commits into from
Jul 16, 2018
Merged

Add external library selection #194

merged 29 commits into from
Jul 16, 2018

Conversation

remo5000
Copy link
Contributor

@remo5000 remo5000 commented Jul 12, 2018

Features

  • Add source library files added to public folder
    • Sound
    • Graphics
  • Playground can select libraries for usage (in addition to chapter)
  • Assessment & Grading gets library set based on question
  • Mock library has make_sourcesound, array_test and draw_connected added as externals

Dependencies

  • Requires js-slang with externals: string[] support (0.1.3)

@coveralls
Copy link

coveralls commented Jul 12, 2018

Pull Request Test Coverage Report for Build 296

  • 20 of 51 (39.22%) changed or added relevant lines in 11 files are covered.
  • 20 unchanged lines in 4 files lost coverage.
  • Overall coverage increased (+0.05%) to 26.059%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/containers/PlaygroundContainer.ts 0 1 0.0%
src/containers/academy/grading/GradingWorkspaceContainer.ts 1 2 50.0%
src/actions/workspaces.ts 3 5 60.0%
src/components/workspace/ControlBar.tsx 5 8 62.5%
src/reducers/workspaces.ts 0 6 0.0%
src/sagas/index.ts 1 8 12.5%
src/components/academy/grading/GradingWorkspace.tsx 0 11 0.0%
Files with Coverage Reduction New Missed Lines %
src/components/academy/grading/index.tsx 1 31.58%
src/components/workspace/ControlBar.tsx 1 26.87%
src/reducers/workspaces.ts 2 12.09%
src/sagas/index.ts 16 25.42%
Totals Coverage Status
Change from base Build 284: 0.05%
Covered Lines: 715
Relevant Lines: 2324

💛 - Coveralls

@remo5000 remo5000 changed the title [WIP] Add library support [WIP] Add external library selection Jul 13, 2018
remo5000 added 6 commits July 13, 2018 14:41
This was supposed to use to the same one as Assessment, but was not
updated. It has been upated now, my bad.
Note that the changes in Grading already reflect this
This is to allow easier reset of workspaces
@remo5000 remo5000 changed the title [WIP] Add external library selection Add external library selection Jul 13, 2018
Copy link
Member

@ning-y ning-y left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your CI is failing as well. https://travis-ci.org/source-academy/cadet-frontend/builds/403438035

There's a button to restart the travis build on the top right of the travis website.

@@ -68,7 +71,8 @@ class Playground extends React.Component<IPlaygroundProps, PlaygroundState> {
hasShareButton: true,
isRunning: this.props.isRunning,
queryString: this.props.queryString,
sourceChapter: this.props.sourceChapter
sourceChapter: this.props.sourceChapter,
sourceLibrary: this.props.sourceLibrary
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really think this should be renamed externalLibrary. If no objections, please remember to change the directory name under ./public/ where these libraries are stored, as well as the state property, etc.

* Checks if there is a need to reset the workspace, then executes
* a dispatch (in the props) if needed.
*
* @param props the props passed to the component
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a useful param tag can it be removed? Description at line 118 is fine, though.

@@ -4,6 +4,7 @@ import {
CHANGE_ACTIVE_TAB,
CHANGE_CHAPTER,
CHANGE_EDITOR_WIDTH,
CHANGE_LIBRARY,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CHANGE_EXTERNALS, since the prop name to workspace is externals. Mirrors CHANGE_CHAPTER for prop name of chapter.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I'm going to be adding externals into the state in another PR, is it alright if I handle it there? As of now, this semantically makes sense as I change the playgroundLibrary property in the state.

handleChapterSelect?: (i: IChapter, e: React.ChangeEvent<HTMLSelectElement>) => void
handleLibrarySelect?: (i: ILibrary, e: React.ChangeEvent<HTMLSelectElement>) => void
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer sourceExternals and handleExternalsSelect.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed as above, I can incorporate this as well since they are the change in naming.

tsconfig.json Outdated
@@ -19,6 +19,7 @@
},
"exclude": [
"node_modules",
"public/sourceLibs",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

externalLibs, or external_lib since we're dealing with URLs

@ning-y ning-y merged commit 337577d into master Jul 16, 2018
@remo5000 remo5000 mentioned this pull request Jul 16, 2018
8 tasks
@ning-y ning-y deleted the library-support branch July 17, 2018 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants