Giter Site home page Giter Site logo

api-browser's Introduction

Siren.js API Browser

Development

# install dependencies
$ pnpm install

# run the app locally in development mode
$ pnpm dev
# or
$ pnpm start
# the page will automatically reload as you make edits

# build the app for production to the `dist` folder
$ pnpm build

Deployment

Any push to main kicks off the GitHub action that builds the app and deploys it to GitHub pages.

api-browser's People

Contributors

dillonredding avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

api-browser's Issues

Add autocomplete attributes

Getting the following error with fields whose type is password

[DOM] Input elements should have autocomplete attributes (suggested: "current-password"): (More info: https://goo.gl/9p2vKq)
<input class=​"input" type=​"password" name=​"password">​

Support for passing adhoc headers

When needing to pass security, it would be great to have a way to put adhoc headers maybe at the top somewhere so I can pass an authorization header with some value to go through the screen. Doing specific security level support would be great but I think realistically, the most valuable is just to let me put something there.

Resolve embedded links

Might be nice to have an option to resolve embedded links rather than follow them.

Should that be the default behavior? Some users may always want to just follow embedded links.

Should there be a setting for that? Perhaps we update the default behavior and add a "Follow embedded links" setting.

Should we present both options each time? This feels cumbersome to users.

Support for “select” type

With support for the radio type to perform like a select drop-down box, support should also be added for the select type to perform similarly. Some thought may be needed to support multiple selections but as a version 1 supporting select one should be supported.

Misaligned Property Names and Values

Properties with an empty string value may cause misalignment.

For example, if an API serves up these properties:

{
  "foo": "bar",
  "bar": "",
  "baz": 42
}

This is displayed:

image

This is caused by displaying names and values in independent columns.

Display Original JSON Text

In addition to the current state source JSON, we should also preserve and display the original JSON text

Update README

Need to update README.md to better describe what the project is, how it works with the Siren.js Client, and how it renders Actions as forms for submission.

Support radio fields

Would like to support radio fields.

I propose an options extension. It would be an array of objects, each of which contain a value and optional title properties. The value property is the value that the ancestor field's value is set to when that option is picked. The title is a string to customize the label, which defaults to the option's stringified value.

{
  "name": "hogwartsHouse",
  "type": "radio",
  "options": [
    { "title": "Gryffindor", "value": "g" },
    { "title": "Hufflepuff", "value": "h" },
    { "title": "Ravenclaw", "value": "r" },
    { "title": "Slytherin", "value": "s" }
  ]
}

I think this is simpler and clearer than either extension here or here.

As for how this field is displayed, I propose using a <select> drop-drown element instead of actual radio buttons, despite the type name. Radio buttons are clunky and provide poor UX since you can't deselect a radio button. A drop-down on the other hand provides a much better UX since we can easily include a default "Select one..." (or some other label) option whose value defaults to the field's value, which could be null or undefined (absent). That way, the field can be deselected by setting the field's value back to what it was when picking the default "Select one.." option. Something like this.

Relaxed Mode

Currently the browser only supports parsing application/vnd.siren+json. Might be nice to have a "relaxed" mode setting that parses plain JSON (application/json) as Siren.

Modals Don't Close After Navigation

When opening (for example) an embedded entity modal, then fetching that entity, the modal will reopen with an new embedded entity, if the fetched entity has an embedded entity with the same index as the first.

Allow configuring Siren.js client

Would like to add some functionality to allow users to configure settings (e.g., custom headers, caching, following redirects) for the Siren.js client follow and submit functions.

Add About/Help section

Would like to add a pop-up that provides an overview of how the browser works and what extensions it supports. Here are a few call outs:

  1. Use of Siren.js client
  2. How checkboxes work with true/false
  3. Radio options extension

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.