Skip to content
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

feat: show logs on ui #198

Merged
merged 59 commits into from
Apr 22, 2019
Merged

feat: show logs on ui #198

merged 59 commits into from
Apr 22, 2019

Conversation

fsdiogo
Copy link
Collaborator

@fsdiogo fsdiogo commented Apr 17, 2019

Surfaces the console logs on to the UI, so user won't have to open their dev tools.

Closes #182.

mikeal and others added 30 commits January 2, 2019 19:55
- Fix trailing comma linter error
- Address merge conflicts while getting this branch up to date
with current site features.
Remove unused properties in lesson with no exercise
- Add dummy file tutorial lesson
- TODO: Figure out why exercise box isn't appearing
- Offer multiple boilerplates
- IN PROGRESS: Update instructions for building a lesson
- Update UI for file upload when `ifFileLesson` is true, adding upload
box and different instructions for submission
- Update lesson content to explain new exercise format
- Fix error preventing exercise box from appearing in file lessons
- Move "Step 2" header into `v-if` so that it only shows in lessons where
file uploaded is needed
- Remove unused console logs
- Add file tutorial to homepage
- Adjust dummy titles and descriptions
- Appease linter
- Make a consistent look and feel for the upload box and the resulting
box that shows what files you've uploaded
- TODO: Figure out how to make new file icon be aqua like the add one
- Make formatting consistent between reset text links
- Add checkmark icons when you upload your code and when you change the
code in the editor
- Add border to file upload box when file is dragged over it
- Print filenames from actual array of uploaded files
- Fix issue where file explorer was opening twice on click
- Add args to run function
- Edit code in File-Basics/01.vue to be what would be the successful code
for an add lesson (TODO: remove part of this code and update validation
elsewhere)
- Change document icon to aqua SVG
- Fix formatting of <ul> element for better design when multiple files are
uploaded
- Disable submit button in file lesson when !uploadedFiles
- Add a note indicating this and make it even more prominent during
hover over disabled button (have to hack it with a span b/c disabled
buttons don't have a hover property)
- Disallow folder upload since we can't access the details we need in
the browser. Users can successfully upload either a single file or
multiple files through either drag-and-drop or selection.

Pair programmed with @mikeal
- Add a 2nd lesson to file tutorial series
- Update dummy content in both lessons
- TODO: Fix error messages in lesson 1
- TODO: Create real content for lesson 2
- Change opacity rather than font weight when user hovers over disabled
submit button's parent element. (Warning that you need to upload a file
now does not appear until that hover thanks to 0 opacity.)
- Minor text edits based on feedback from design team.
- Complete lesson 1 exercise
- TODO: Fix error which prevents fail/success messages from showing if
 you try to submit the default code as your code
- Add exercise to practice adding a file to IPFS.
- TODO: Fix validation
- More attempts to get the right info to use for validation
- TODO: Actually validate
- Update package-lock.json based on automatic changes during `npm install`
- Reorder existing content and create a third lesson
- Adjust lesson 1 to be text only
- TODO: Validation is broken in lessons 2 and 3 with error:
Uncaught (in promise) TypeError: IPFS.createNode is not a function
    at eval (Lesson.vue?99a6:351)
Remove old console logs
- Remove unused `code` and `validate ` props from text-only lessons,
which were causing error messages
- Add changes made previously to fix More Tutorials button links
- Update dependencies
- Use `new IPFS` instead of `IPFS.createNode`
- Pair programmed with @mikeal
- Remove unneeded console logs in File-Lesson.vue
- Edit console logs and success messages in File-Basics/02.vue to
declutter console so user can see `files` array as directed
@fsdiogo fsdiogo self-assigned this Apr 17, 2019
@fsdiogo
Copy link
Collaborator Author

fsdiogo commented Apr 17, 2019

We should merge #111 so people can then branch of code and work on features without getting blocked.

To review this you can check commit 23b293a and f814ce2, but #111 has to be merged first.

@fsdiogo
Copy link
Collaborator Author

fsdiogo commented Apr 17, 2019

Added syntax highlighting to the outputs:

sh

@fsdiogo
Copy link
Collaborator Author

fsdiogo commented Apr 18, 2019

@terichadbourne this is ready for review, can you take a look at the code and the instructions for adding this?

To test you'll have to uncomment the MFS lessons and pass the Lesson 3.

@terichadbourne
Copy link
Member

terichadbourne commented Apr 19, 2019

@fsdiogo I don't know if it happened in this PR or earlier, but I see this in the standard lesson boilerplate:
const code = `const CID = require('cids')

const run = async () => {
/* your code here */
}
return run
`

Can we remove const CID = require('cids')? The code const is what's shown in the exercise box and I'd like it as streamlined as possible. This also looks like something only some authors might need. How else can we get CID functionality accessible without cluttering the editor? (Note that I don't see this line in the file upload boilerplate.)

@terichadbourne
Copy link
Member

@fsdiogo I made two commits here.

The first makes it so that it only adds a "step 3" header when it's a file upload lesson, since normal lessons don't have step 1 and step 2 labels.

The second is a bunch of tweaks to the instructions for developing lessons in general.

Feel free to merge this PR if my changes look okay to you!

@fsdiogo
Copy link
Collaborator Author

fsdiogo commented Apr 22, 2019

Can we remove const CID = require('cids')?

Yeah, we can remove it AFAIK.

How else can we get CID functionality accessible without cluttering the editor?

To get that functionality we only need to pass the modules to the data, so we don't need to clutter code with that.

const modules = { cids: require('cids') }

export default {
  components: {
    Lesson
  },
  data: () => {
    return { text, validate, code, modules }
  }
}
</script>

@fsdiogo fsdiogo merged commit f78bb3a into code Apr 22, 2019
@fsdiogo fsdiogo deleted the feat/show-logs-on-ui branch April 22, 2019 09:53
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.

Feature: Surface console logs into the UI
3 participants