Coder Social home page Coder Social logo

ko-genius's People

Contributors

cameronprattedwards avatar

Stargazers

 avatar  avatar  avatar

ko-genius's Issues

Failing tests (possibly) due to missing lib

Looks like the lib ../genius-base-spec.js is not included in the project, which is probably causing three failing tests:

Resource flags should be ko.observables FAILED
        TypeError: undefined is not a function
            at null.<anonymous> (/path/to/ko-genius/ko-genius-spec.js:32:17)
Collections should be observable arrays FAILED
        TypeError: undefined is not a function
            at null.<anonymous> (/path/to/ko-genius/ko-genius-spec.js:84:17)
Resource requests should parse queries into resources FAILED
        TypeError: undefined is not a function
            at null.<anonymous> (/path/to/ko-genius/ko-genius-spec.js:182:17)
Executed 10 of 10 (3 FAILED) (0.052 secs / 0.046 secs)

I wonder if you'd consider adding a package.json and any instructions for running the tests / contributing to the project?

Synchronising viewmodel with serverdata

After first quering serverdata, the viewmodel is not updated when new serverdata is pulled down.

1. Usecase: Requering
  1. User is shown the page/view
  2. Knockout/ko-genius pulls data from server
  3. User updates an input field and leave the field
  4. Knockout/ko-genius updates the viewmodel and sets isDirty = true
  5. User sees the row is marked as changed
  6. User want to reverse all changes and click a (Knockout-bound) refresh button
  7. Knockout/ko-genius issues a new GET-request (via a $query() call)
  8. Server serves a new set of data
  9. User still sees the row is marked as changed and the old values on the page/view
  10. Knockout/ko-genius has not updated its viewmodel
2. Usecase (based on 1. Usecase): State change
  1. User is shown the page/view
  2. Knockout/ko-genius pulls data from server
  3. User updates an input field and leave the field
  4. Knockout/ko-genius updates the viewmodel and sets isDirty = true
  5. User sees the row is marked as changed
    *User saves the updated values
  6. Knockout/ko-genius pushes the updated entity to server with a PUT-request
  7. Server respond with 200 - OK
  8. Ko-genius fails with:
    SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data return genius.config.ajax.parseJs().call(this, JSON.parse(response));
  9. User still sees the row is marked as changed
  10. Knockout/ko-genius has not updated its entity state
  11. What does ko-genius expect as responce from af PUT-request?
3. Usecase: Deletion
  1. User is shown the page/view
  2. Knockout/ko-genius pulls data from server
  3. User marks a row/record and delete it by clicking a (Knockout-bound) delete button
  4. Knockout/ko-genius issues a DELETE-request (via a $delete() call)
  5. Server respond with 200 - OK
  6. User still sees the row is marked as deleted, when in fact the record is not only marked for deletion it is removed from the server
  7. Should the DELETE-request not first be issued when user saves the changes made?
    If not is the isDeleted needless

You can see the context here: https://github.com/KalnaBube/FormKit/blob/master/App/ViewParts/SYS001.phtml
Please note that this code is work-in-progress, and nowhere in a production ready state.

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.