Git Product home page Git Product logo

predix-ui.github.io's Introduction

Predix UI

Netlify Status

This repo hosts predix-ui.com, the website for GE's Predix Design System. The site includes component demos, design and development guides, and additional tools for using the Predix Design System.

How to run on your machine

Install tools

If you don't have them already, you'll need node, bower, and gulp to be installed globally on your machine:

  1. Install node. This includes npm -- the node package manager.
  2. Install bower globally: $ npm install bower -g
  3. Install gulp globally: $ npm install gulp-cli -g

Clone the project and install dependencies

  1. Clone the project to your machine and open the folder:

    $ git clone https://github.com/predix-ui/predix-ui.github.io.git
    $ cd predix-ui.github.io
    
  2. Install dependencies:

    $ npm install
    $ bower install
    

Developing locally

As you are developing, you can see your changes by running gulp serve from your command line. This will build the project files, serve the site locally, and automatically refresh the site as you make changes.

Running a local build

When you think you are ready to deploy your changes, you can build the site locally to test how the changes will behave in production. The localBuild task runs additional tasks that simulate how the site will be built for production. Many of these tasks take a significant amount of time to run, so you should only run this command once you want test that your changes are ready to push to production.

To run a local build:

$ gulp localBuild
$ cd build/default

Serve the site using npm serve or any other static web server. To install npm serve run:

$ npm install -g static-server

Then you can run static-server from the build/default directory to serve the local build of the site.

Running a production build

You should never run the gulp prodBuild task manually. This task is run on Travis as part of our CI/CD process when a change is pushed to production.

Build a new component

Developing the component

  1. Generate a basic component structure using the generator-px-comp Yeoman generator.
  2. Write the code to create a new component in that folder. (Have fun! 🎉)
  3. Write tests for your component that are now passing. (Nice work! 💯)
  4. Publish your component on bower:
    $ bower register px-COMPONENT-NAME https://github.com/PredixDev/px-COMPONENT-NAME.git
    

Adding interactive documentation

All components should have an interactive documentation and demo page on the Predix Design System site. These documentation pages are built automatically by Travis CI for each component when a new release (i.e. a new tag) is pushed to Github.

Before you begin, you'll need to install the following tools:

  1. Ruby version 1.9.3 or higher (this could be tricky, and the ruby build that shipped with your system might be too old)
  2. Travis CLI ruby gem

Once you are ready you can:

  1. Enable the repository you'd like to build in Travis CI. Note: you only need to follow steps 1 & 2 of the Travis instructions.
  2. Run the following command, replacing "xxxxx" with your Sauce Labs username and key:
    $ travis encrypt "SAUCE_USERNAME=xxxxx SAUCE_ACCESS_KEY=xxxxx" --add
    
    (To find your Sauce Labs key, log into your account > select your name in the top right > select my account > click the "show" button under Access Key)
  3. Check the .travis.yml file with your newly encrypted credentials into git.

Adding the component to site nav and component gallery

  1. Add the component to bower.json:
"px-COMPONENT NAME": "^1.0.0"
  1. Add the component demo to the 'fragments' array in polymer.json:
"bower_components/px-COMPONENT-NAME/demo/px-COMPONENT-NAME-demo.html"
  1. Add the component to elements/px-catalog/pages.json:

    {
      "path": "px-COMPONENT-NAME",
      "label": "COMPONENT NAME",
      "module": "px-COMPONENT-NAME-demo",
      "entrypoint": "/bower_components/px-COMPONENT-NAME/demo/px-COMPONENT-NAME-demo.html",
      "keywords": [
        "px-COMPONENT-NAME",
        // Keywords will be used to search within the site nav
      ],
      "tags": [
        // Tags will be used to filter the Component Gallery
      ]
    }
    

    The ‘keywords’ array specifies search terms for the site nav. The ‘tags’ array specifies the tags used for filtering the component within the component gallery. Only use the tags already in use in the component gallery.

    Note: You do not need to manually edit tile-data.json and component-data.json These files will be generated for you based on the information you added to the pages.json file.

  2. Add the component gallery images to the raw-img/component-gallery directory. Make sure you add four images:

  • COMPONENT-NAME_dark.png

  • [email protected]

  • COMPONENT-NAME_light.png

  • [email protected]

    These images will be compressed and put in the img/component-gallery directory.

    Note: If the component should not be shown in the component gallery, add it to the 'ExcludedComponentsArray' in scripts/json-builder/create-components-info.js.

  1. Follow the instructions in the Running a local build section above to test your changes before pushing them to production.

Support and further information

If you find any bugs, have issues with the code, or want to request enhancements, file a issue on this Github repo.

Copyright

Copyright © 2019 GE Global Research. All rights reserved.

The copyright to the computer software herein is the property of GE Global Research. The software may be used and/or copied only with the written permission of GE Global Research or in accordance with the terms and conditions stipulated in the agreement/contract under which the software has been supplied.

predix-ui.github.io's People

Contributors

andrealperry avatar arcpato avatar benoitjchevalier avatar davidrleonard avatar evanjd avatar katemenkhaus avatar mdwragg avatar randyaskin avatar runn-vermel avatar skistz avatar talimarcus avatar

Stargazers

 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  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

predix-ui.github.io's Issues

FF& Safari: Getting two 404's on vis charts pages.

FF & Safari Only:
In predix-ui.com, loading any of the vis1.0 charts (timeseries, radar, polar, parallel, xy, pie) causes 2 404s :

https://img.shields.io/travis/PredixDev//master.svg?style=flat-squareFailed to load resource: the server responded with a status of 404 (HTTP/2.0 404)
https://img.shields.io/github/issues-raw/PredixDev//master.svg?style=flat-squareFailed to load resource: the server responded with a status of 404 (HTTP/2.0 404)

Screenshot:
screen shot 2017-03-14 at 6 26 06 pm

CSS styling documentation incomplete

Some of the component demos are missing the 'styling' section in the api. This is a crucial thing to document with the release of theming.
example of 'styling' section :
screen shot 2017-02-08 at 10 41 40 am

list of components that are missing 'styling':
App nav
Vis framework
Vis parallel coordinates
Vis Pie Chart
Vis Polar Chart
Vis Radar Chart
Vis Spark
Vis Timeseries
Vis XY Chart
Calendar Picker
Datetime Field
Datetime Picker
Datetime Range Field
Datetime Range Panel
Rangepicker

Explore running hydrolysis and generating API description object at buildtime

As we discussed, there may be an opportunity to analyse the component at build time, store away the resultant JSON in the GH pages branch and use that as input to the API viewer when the page is accessed.

This has the following advantages:

  • we don't have to ship/parse/use hydrolysis on the client.
  • service worker can cache the resultant json object describing the API.
  • others?

Code snippets/examples that show data binding should show different frameworks

Request from a customer:

"People are coming out of the woodwork, generally mad at me, because they can't get px components to work in their app. Turns out the problem is that they're pasting examples straight from the component docs, which don't take into account how data is bound in an ng2 app. Not the end of the world, a few examples and they're set straight."

For example, on the px-data-table page we have this data-binding snippet:

<px-data-table table-data="{{data}}"></px-data-table>

Which would be easy to translate to Angular 2+ binding:

<px-data-table [tableData]="data"></px-data-table>

Google does this on their docs today:

toggle-code-snippet

Think we should consider possibly doing something like this to increase copy-and-paste-ability of code snippets. We don't have to translate everything right away, but we could add the ability to show multiple code snippets and start to add Angular 1/Angular 2+/React/etc. examples as we go.

iOS Safari scroll bug

image

If you expand/collapse a category and then scroll, the above can happen where the menu disappears and the sidebar scrolls up weirdness.

Linking to sub-components

It would be nice if the child component pages (like px-data-table-column, etc) would also write to / read from the URL parameters so that we could link directly to those pages from the forums or whatever. They wouldn't necessarily need to show up in the left navigation, though I guess they could...

nav should collapse when on mobile

When on phone/narrow display the nav menu should collapse when the user has selected a nav item. Currently it hangs around and has to be manually closed.

github.io page doesn't work over https

FYI, the subpages on https://predixdev.github.io/predix-ui/ don't work over HTTPS. Chrome displays the following in the Console:

Mixed Content: The page at 'https://predixdev.github.io/predix-ui/' was loaded over HTTPS, but requested an insecure resource 'http://predixdev.github.io/px-progress-bar/px-progress-bar/'. This request has been blocked; the content must be served over HTTPS.

Suggested text change: Welcome to Predix UI paragraph on Home Page

Instead of "We've produced Predix UI as a set of user interface components that enable designers and developers to quickly and easily create Industrial Internet web applications that run on top of Predix services and data."

Consider: "Our user interface components enable you to quickly and easily create Industrial Internet web applications that run on dedicated Predix services and data."

Firefox: can't view whole navigation

When you scroll all the way down in the navigation in Firefox, you can't see half of Validation and none of View Header because the scroll body is going off the page.

screen shot 2017-03-23 at 11 31 57 am

build is error out with 'Error: spawn E2BIG'

The build is being stopped in travis by this error:
Error: spawn E2BIG
at exports._errnoException (util.js:949:11)
at ChildProcess.spawn (internal/child_process.js:302:11)
at exports.spawn (child_process.js:367:9)
at Object.exports.execFile (child_process.js:139:15)
at exports.exec (child_process.js:99:18)
at DestroyableTransform.flush [as _flush] (/home/travis/build/predix-ui/predix-ui.github.io/node_modules/gulp-git/lib/add.js:30:5)
at DestroyableTransform. (/home/travis/build/predix-ui/predix-ui.github.io/node_modules/gulp-git/node_modules/readable-stream/lib/_stream_transform.js:135:12)
at DestroyableTransform.g (events.js:286:16)
at emitNone (events.js:91:20)
at DestroyableTransform.emit (events.js:185:7)

seems to occur in the gulp.task('gitStuff', function() {};

Should investigate performance degradation on predix-ui.com when viewing vis components

Been experiencing major performance issues on predix-ui when loading vis related pages the past week or so and it's specially slow as of yesterday with IE11, FF and Safari. Seeing upwards of 20+ secs loading any of the chart pages on these browsers with IE being the slowest of the bunch. Chrome is also slow; however, not as much as the other browsers.

Don't have the time to do much analysis at the moment, but opening this issue to keep it on our radar for investigation if someone is free.

/cc @davidrleonard
/cc @runn-vermel

'cancelled' from home.html

There's a weird 'cancelled' status coming form home.html when the site first loads.

I think Lighthouse dings us for that as it looks like the site doesn't return a '200' when offline.

Warnings about long running scripts and missing px-theme-style file when loading demo pages.

Recently noticed a few warnings when loading component demo pages:

  1. Missing px-theme-style warnings.

  2. Violations: long running script and handler timestamps. This one seems to be specific to chrome's canary version 56 which I guess I am a lucky winner of and it can be taken care of by checking off/hide violations. But just filing this in case others have noticed it too. More details on stackoverflow:
    http://stackoverflow.com/questions/41218507/violation-long-running-javascript-task-took-xx-ms

I didn't exhaustively go through all the pages, but noticed these on slider: alert, colors, vis pages, etc...

Browser:

Chrome Version 56.0.2924.87 (64-bit)

Missing px-theme-styles Screenshot:

screen shot 2017-04-12 at 4 43 40 pm

Long running script Violation Screenshot:

screen shot 2017-04-12 at 4 36 01 pm

/cc @runn-vermel

Back button doesn't work

Using the back button on Android Chrome doesn't work. Changes URL but doesn't load the page :'(

Slider: API comments not being pulled properly to the demo page.

Slider demo page:
Properties section is missing almost all of the code comments. Comments are present in code(see 2nd screenshot/px-slider.es6.js) but not getting pulled properly.
Maybe a side effect of being a hybrid component?

API section on predix-ui:

screen shot 2017-04-12 at 4 16 17 pm

Code Comments:

screen shot 2017-04-12 at 4 17 03 pm

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.