Giter Site home page Giter Site logo

science.mozilla.org's Introduction

This project was sunsetted in September 2018. More information can be found at the ScienceLab wiki.

Build Status Uses Mofo Standards

science.mozilla.org

Requirements for Development

  • node
  • npm

Setup for Development

  • git clone https://github.com/mozilla/science.mozilla.org.git
  • cd science.mozilla.org
  • npm install
  • npm start

Customizing Your Development Environment

By default the app will use the configuration file located in config/defaults.env, which contains the following environment variables:

  • SCIENCE_API : The web service that provides data to the Events, Study Groups, Resources, and Projects sections.
  • WP_API : The service that provides content from the Science team's WordPress blog. This is used to fetch the data to build the Blog overview and detail views.

If you want to override the default settings, you can create a .env file in the project root and set values as needed.

Folder and File Structure

app
├── assets
│   ├── favicons <- Assorted favicons.
│   └── img <- General image assets.
├── js <- Non-React JavaScript code.
├── react <- JSX and associated SCSS files.
│   ├── components <- JSX components that are used between multiple views and associated SCSS.
│   └── pages <- View-specific JSX and SCSS.
└── scss <- General application SCSS

config
└── defaults.env <- Default environment variables. Edit `/.env` for local overrides.

dist <- Contains compiled code. Don't edit these files directly!

Linting and Code Standards

All JS and SCSS code must pass our code conventions as defined by several linting systems. You can test your local code by running npm test. Pull requests must pass before being merged.

JavaScript

For JavaScript, this project extends the Mozilla Foundation's ESLint rule set. The specific extensions can be seen in .eslintrc.yaml. Refer to ESLint's documentation for an explanation of the rules.

SCSS

For SCSS, we use StyleLint with the standard configuration. See StyleLint's rules documentation for more information.

It's highly recommended that you add plugins to your editor of choice that can read the local "RC" files in the root of the codebase, .eslintrc.yaml and .stylelintrc, so you can see errors as they occur.

Bootstrap

This site uses version 4 of the Bootstrap framework as well as a custom Mozilla Foundation theme.

Use Bootstrap 4 classes whenever possible, rather than writing additional SCSS.

Refer to this page for a demonstration of the non-standard and overridden components available to you. The demo also contains color variables that you can use. Whenever possible, use a color variable instead of hard coding a color value.

Additional Conventions

  • Files should be named with hyphenated-lowercase.
  • Code indentation is two spaces.

Git Flow

This project uses GitHub Flow as per the MoFo Standards.

To submit a PR:

  • Create a feature branch in this repo (or your own fork if you don't have appropriate permissions)
  • Once the feature is ready, open a pull request against the master branch
  • A review build will be automatically spun up if the new branch is on the Mozilla fork. Otherwise tag a Mozilla Foundation engineer to spin one up.
  • Once merged in, master maps to Staging
  • Once verified on staging, a MoFo engineer can promote it to production using Heroku.

science.mozilla.org's People

Contributors

abbycabs avatar akshatnitd avatar alanmoo avatar alicoding avatar amjadm61 avatar anamikad avatar arush0311 avatar auremoser avatar djbarnwal avatar gideonthomas avatar gvn avatar hassenpy avatar hghusarr avatar karanjthakkar avatar mahmud2011 avatar narendrashetty avatar parimatrix avatar patjouk avatar paulmenzel avatar pomax avatar rahulkrishnan98 avatar stevenzhang123 avatar xuanxu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

science.mozilla.org's Issues

Thumbnail scaling

Many of the thumbnails for Collaborate project stubs get cropped in weird places; suggest fixing thumbnail width and scaling height proportionally, with no crop.

Ideas for user profiles

Max suggested doing something like http://usesthis.com/ for open science; could work great for our user profiles if we want to make them fancier someday; getting people to talk about what they do & use could help build connections & collaborations.

Upgrade Discourse

Discourse needs to be upgraded because there might be new features that we can try to see if we can grow our community. One example is the, "Groups" feature.

Deliverable listing on Collaborate

Need a button during the listing creation step to add new fields to the 'Main Deliverable' section; as is, you have to save and reload the form every time you want to add a new bullet point.

Proposal: delay requesting the public_repo scope

Currently we request the public_repo scope with GitHub authentication upon log in. This helps us encourage users to fork code -- remixing is an important skills for learning and building tools helping science on the web. We don't want to loose this functionality, especially since we'll be using this for our upcoming community blogging system.

Problem:
public_scope is an admittedly permissive scope, giving us write access to all repos the users has access to, including organization repos. We don't actually need or want this -- neither does some of our community: #11

Proposal:
The best compromise I can think of now, is to request no scope upon log in. Then, when a user wants to take part in Collaborate, request public_scope. This would require rewriting some of our authentication code and we'd have less smooth user process around Collaborate. We'll also have to consider how we'll work with tiered scopes with the new blogging system - which will be built around forking.

My biggest concern with this approach is the fact that our future plans are tied around forking and encouraging more interaction with code.

Collaborate 'more information' links broken

It appears that some database references got flipped when submitting projects - the text of the anchor tag and the href attribute are getting swapped after submitting a project to the database and reloading the submission, breaking the 'More Information' links on all new projects.

403 page

Return a nice page letting users they need to log in / don't have permissions to view this page.

Will be nicer for users AND will probably fix cloudfront issue (see #35)

Can't see proposed projects on Collaborate

How do I find projects for review at Collaborate? You mentioned there were a bunch waiting, but I only see 'active' projects - this is perhaps an account settings thing, since I had to make a new account and sign in with that.

Login via GitHub prompts to authorize application to access private organization data and modify public organization data

Congrats on the the launch of the new site!

I read this with great interest...

We’ve also added to the “Join” button a social hack for those new to GitHub. When you hit the button, you’ll be prompted to introduce yourself in the project’s “issues” section (essentially a forum but in the project repository).

... and clicked "Join Us" and then "Sign Up via GitHub" right away. What I expected to see was the normal "Mozilla Science Lab would like to know your email address" message that you see when you log in to http://forum.mozillascience.org like this:

authorize_mozilla_science_lab_-_2015-02-14_17 46 02

Instead I saw this somewhat alarming message that says "This organization allows the application to access private organization data and modify public organization data" for each of the organizations that I'm an "owner" of:

oauth-github-mozillascience

The "Learn more about OAuth" link in the screen shot goes to https://help.github.com/articles/connecting-with-third-party-applications/ and says "Applications can request access for either public or private repositories on a user-wide level. This is one of the most expansive configurations you can permit, so accept it with caution!"

Because of this I'm concerned and haven't signed up yet. Are these permissions necessary?

COC Page

Looking at the pages of the site, there is a coc.jade page which isn't being linked anywhere. I think it should unless it's only for new users when they join the site. Even if it's that, I think it should be linked somewhere viable for everyone to see.

Github pop-up respawns in an infinite loop when I try to sign up for a forum account

Hi MozScience,

As you might have guessed from the issue title, I ran into a strange error when trying to sign up for an account on the forum. Basically, the window requesting authorization from Github re-spawned in an endless loop, making it impossible for me to fill out the user info form (username, real name, etc) About my configuration:

-Mac OS X 10.10
-Firefox 36.0.1 (Ghostery installed)
-Already logged into Github

I switched to Safari temporarily (where I wasn't logged into Github), and was able to sign up there. Let me know if there are any things you'd like me to try or if you need any other details about my setup that could potentially be causing the problem.

Opening page changes

"Learn" and "Connect" should link to those sections on http://mozillascience.org/get-involved/
And an IRC channel link on the contact page

https://wiki.mozilla.org/IRC

https://kiwiirc.com/client/irc.mozilla.org/sciencelab

[12:59:21]  <wking>  In this case, I just think the opening page's "Learn" and "Connect" 
should link to those sections on http://mozillascience.org/get-involved/
[12:59:44]  <belkinsa>   And have the irc channel link on the contact page
[13:00:04]  <belkinsa>   Or where wking suggested.
[13:00:39]  <wking>  belkinsa: yeah, I think that "Connect" section is the contact page ;)
[13:01:56]  <wking>  A link to https://wiki.mozilla.org/IRC and 
https://kiwiirc.com/client/irc.mozilla.org/sciencelab or similar would be nice as well ;)
[13:02:14]  <belkinsa>   +1

Collaborate admin view broken

Visiting the admin view for Collaborate returns:

TypeError: /app/views/collaborate/admin.jade:38
   36|                 a(href='/projects/' + project.slug)=project.title
   37|               td
 > 38|                 each l, ind in project.lead
   39|                   a(href='/u/' + l.username)=l.name
   40|                   if ind != project.lead.length-1
   41|                     | ,&nbsp;

Cannot read property 'length' of null
   at jade_debug.unshift.lineno (eval at <anonymous> (/app/node_modules/jade/lib/index.js:218:8), <anonymous>:1243:31)
   at jade_debug.unshift.lineno (eval at <anonymous> (/app/node_modules/jade/lib/index.js:218:8), <anonymous>:1294:4)
   at eval (eval at <anonymous> (/app/node_modules/jade/lib/index.js:218:8), <anonymous>:1532:4)
   at eval (eval at <anonymous> (/app/node_modules/jade/lib/index.js:218:8), <anonymous>:1553:22)
   at res (/app/node_modules/jade/lib/index.js:219:38)
   at Object.exports.renderFile (/app/node_modules/jade/lib/index.js:380:38)
   at View.exports.renderFile [as engine] (/app/node_modules/jade/lib/index.js:370:21)
   at View.render (/app/node_modules/express/lib/view.js:76:8)
   at Function.app.render (/app/node_modules/express/lib/application.js:527:10)
   at ServerResponse.res.render (/app/node_modules/express/lib/response.js:900:7)
   at EventEmitter.<anonymous> (/app/routes/projects.js:71:13)
   at EventEmitter.<anonymous> (/app/node_modules/mongoose/node_modules/mpromise/lib/promise.js:175:45)
   at EventEmitter.emit (events.js:95:17)
   at Promise.safeEmit (/app/node_modules/mongoose/node_modules/mpromise/lib/promise.js:81:21)
   at Promise.fulfill (/app/node_modules/mongoose/node_modules/mpromise/lib/promise.js:94:24)
   at /app/node_modules/mongoose/lib/query.js:1902:26 

Implement delete user

Data practices:

"If a user deletes their data, it is permanently purged from the database (after a maximum period of time 14 days)."

Link and title fields swap on every save for the 'More Info' section of Collaborate projects

Under the more info section of the Collaborate project, there are two fields to add a display title and link. Every time I save the page, the values of these fields swap places. This shows up in the live version of the page (the link URL is displayed, with the value of the link being the "title" field), so it's not just a display bug on the form. Saving the page again will cause the fields to swap once more, so edits are possible but require saving the page twice.

login troubles

kmolo over at the Open Hatch forum mentioned she was having some troubles logging into the MSL forum. Her question as follows:

I tried to login in the MozSci forum to post a reply, but, even though I 'authorize[d the] application,' I got the following error message:

'Sorry, there was an error authorizing your Github account. Perhaps you did not approve authorization?'

...I turned off all pop-up blocking in both Chrome and Firefox, but no success (possibly a problem with the ACLs on my workplace firewall).

FELLOW FOR SCIENCE button mobile reponsive issue

BECOME A MOZILLA FELLOW FOR SCIENCE button is getting out of the mobile screen which makes the whole site not responsive. It will be okay if we remove .pure-button {white-space: nowrap;} from pure-min.css line 11.

screenshot_2015-08-01-03-11-50
screenshot_2015-08-01-03-11-59
screenshot_2015-08-08-20-23-49

Community Focus

Our /about page now lists contributors to the science lab. What can do to help surface our awesome community of makers and contributors?

Right now, to be list on the page users must have one of:

  1. Lead a project in Collaborate
  2. Be a facilitator at an event (just MozFest 2014 and Toronto Code Sprint for now)
  3. Written a blog post for us (doesn't include guest posts -- probably should)

What else can we do surface our contributors? Should we list everyone who logs in here?

RSS feed working?

It's unclear if the blog's RSS feed is working. Svetlana added it to the open science planet (http://science.okfn.org/blog/), but I'm not seeing any MSL posts popping up there, and things are working on her end for other people, soooo....

Tags or categories visible on blog

I tried setting tags and categories on the latest blog post per @kaythaney's request, but I don't see them appearing anywhere on the post (like so people can navigate to a list of just that tag / category).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.