Giter Club home page Giter Club logo

origin-web-common's Introduction

OpenShift Common Web Services

The common services used for the OpenShift Management Console.

Build Status

Contributing

Getting started

  1. Install Nodejs and npm
  2. Install grunt-cli and bower by running npm install -g grunt-cli bower (may need to be run with sudo)
  3. Install dependencies by running npm install and bower install
  4. Build and run tests by running grunt build

Before opening a pull request

Please configure your editor to use the following settings to avoid common code inconsistencies and dirty diffs:

  • Use soft-tabs set to two spaces.
  • Trim trailing white space on save.
  • Set encoding to UTF-8.
  • Add new line at end of files.

Or configure your editor to utilize .editorconfig, which will apply these settings automatically.

Then:

  1. If needed, run grunt build to update the files under the dist directory
  2. Run the spec tests with grunt test
  3. Rebase and squash changes to a single commit

origin-web-common's People

Contributors

benjaminapetersen avatar cdcabrera avatar danmcp avatar david-martin avatar dtaylor113 avatar jcantrill avatar jeff-phillips-18 avatar juanvallejo avatar jwforres avatar liggitt avatar rhamilto avatar sg00dwin avatar spadgett avatar therealjon avatar

Stargazers

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

origin-web-common's Issues

Simply Filters

the toArray filter should probably just be:

.filter('toArray', function() {
return _.toArray;
})

the hashSize filter should be deprecated and replaced with a size filter:

.filter('size', function() {
return _.size;
});

grunt build fails with node 8

I ran npm install before grunt build.

Might be related to #133

$ grunt build
>> Local Npm module "grunt-cli" not found. Is it installed?
Loading "grunt-karma.js" tasks...ERROR
>> TypeError: Cannot read property 'prototype' of undefined

Running "build" task

Running "clean:all" (clean) task
Cleaning "dist/less"...OK
Cleaning "dist/origin-web-common-services.js"...OK
Cleaning "dist/origin-web-common-ui.js"...OK
Cleaning "dist/origin-web-common.css"...OK
Cleaning "dist/origin-web-common.js"...OK
Cleaning "dist/origin-web-common.min.js"...OK
Cleaning "dist/scripts"...OK

Running "ngtemplates:dist" (ngtemplates) task
File dist/scripts/templates.js created.

Running "concat:ui" (concat) task
File "dist/origin-web-common-ui.js" created.

Running "concat:services" (concat) task
File "dist/origin-web-common-services.js" created.

Running "concat:dist" (concat) task
File "dist/origin-web-common.js" created.

Running "copy:main" (copy) task
Copied 12 files

Running "ngAnnotate:dist" (ngAnnotate) task
>> 1 file successfully generated.

Running "less:production" (less) task
>> 1 stylesheet created.

Running "uglify:build" (uglify) task
File "dist/origin-web-common.min.js" created.
Warning: Task "karma" not found. Use --force to continue.

Aborted due to warnings.

cc @cdcabrera

The deleteLink directive should be simplified

There's a lot of code in this directive for handling other types and then special handling for projects. I wonder if we shouldn't have a separate, simpler directive just for projects and leave the other in origin-web-console.

DataService data.by('metadata.namespace') clobbers data

We often do:

var foo = data.by('metadata.name');
// foo = {name1: {}, name2: {}, name3: {}}

Which seems to assume that each key will be a single object. But:

var foo = data.by('metadata.namespace');
// should be able to create arrays:
// foo = {namespace1: [many], namespace2: [many], namespace3: [many]}

But instead the last object will win, clobbering all of the previously assigned objects.

var foo = data.by('metadata.namespace');
// should be able to create arrays:
// foo = {namespace1: {oops}, namespace2: {oops}, namespace3: {oops}}

The simple fix that would break all of our code (yay, all the things!) would be to always return an array:

var foo = data.by('metadata.name');
// foo = {name1: [{}], name2: [{}], name3: [{}]}
var foo2 = data.by('metadata.namespace');
// foo = {namespace1: [{}], namespace2: [{}], namespace3: [{}]}

I'm not sure if there is a realistic way to fix this. If not, an alt might be to update it to something like data.byName() & eliminate the implication that it should be able to sort by any key (but even that would be a big refactor).

@spadgett

Notifications services needs to be in openshiftCommonUI module.

In order to use the notifications service in mock mode, the service needs to be in the openshiftCommonUI module rather than the openshiftCommonServices module. The openshiftCommonServices module should be limited to services which interact with the backend.

NotificationsService memory leak and issues

The notification service leaks memory because it keeps all notifications even after they're no longer displayed.

Also, isNotificationVisible should return false if it's drawer only. The intended use of this function was to avoid showing two toast notifications.

Some additional comments by @spadgett:

"I think it would be better to just not keep an array of notifications. Notification service addNotification just broadcasts a message and is done then the toasts notification component can make sure it's not showing the same one twice and drawer tracks current notifications and if they've been cleared itself"

Another issue is that there is now way for user to 'restore' permanently hidden notifications.

Determine if we can use a label filter to exclude old replication controllers

Need to investigate if we can use label filter to exclude old replication controllers in the DataService.list call when retrieving applications. If you're not pruning old deployments, you can potentially have a lot of old replication controllers for previous deployments. It would be nice to exclude these using the API rather than filtering on the client.

Notifications with onClick handlers can leak memory

While converting in-page alerts to toasts, I noticed that some alerts have an onClick action that references the controller $scope. This will prevent $scope from ever being garbage collected since NotificationsService holds on to the notification object indefinitely. We need to find a way to avoid memory links while still having onClick support.

We don't have any instances of this yet, but it's preventing switching some alerts to toasts and could be an easy mistake to make.

@jwforres @jeff-phillips-18 FYI

Handle subresources from different API groups during discovery

The web console currently doesn't handle subresources that have a different group than the parent. For instance, the apps/v1 API resource list has a scale subresource from autoscaling/v1.

GET https://127.0.0.1:8443/apis/apps/v1
...
    {
      "name": "deployments/scale",
      "singularName": "",
      "namespaced": true,
      "group": "autoscaling",
      "version": "v1",
      "kind": "Scale",
      "verbs": [
        "get",
        "patch",
        "update"
      ]
    }

cc @jwforres @liggitt @benjaminapetersen

/assign
/kind bug
/priority p2

Travis isn't passing

We need to get Travis passing so we can validate PRs aren't breaking anything.

Ensure derivative service of DataService match function signatures when possible

Per this comment originally, if possible lets match DataService API when we create new services to abstract away logic:

// example:
DataService.get(resource, name, context, opts)
// current:
BindingService.bindService(context, name, application)
// ideal:
BindingService.bindService(name, context, opts) // where application prob could be part of context or opts, depending on its internal usage 

I'm a fan of these services to keep controllers, directives, etc clean, just want to make sure we maintain consistency.

@jwforres @jeff-phillips-18

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.