Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query for unsupported properties #21

Open
EdwardHinkle opened this issue Apr 16, 2019 · 2 comments
Open

Query for unsupported properties #21

EdwardHinkle opened this issue Apr 16, 2019 · 2 comments

Comments

@EdwardHinkle
Copy link

EdwardHinkle commented Apr 16, 2019

This is a branch off of #8 (comment), where that issue is focused on hiding client supported UI fields that a server doesn't support.

This issue is about helping a Micropub client add support for properties that they don't support (yet). The hope is that overtime the client would add customized support for each property, but this would help build a bridge while properties are experimental and allow for people to customize their software a bit more.

Use Cases:
There are some properties that have large server support but not much client support such as: visibility, post-status and location-visibility. This would allow a user who has a server that supports those and finds those necessary properties to be able to use any Micropub client that supports this functionality.

Also, there are cases where a server has custom properties. For example, my server, abode, has the idea of channels. This likely will never be a property that a large number of servers use and thus will never officially become supported. But causes me to either have to not use certain Micropub clients or overloading the syndication behavior to essentially do things that aren't syndication such as apply a channel to the post.

@EdwardHinkle
Copy link
Author

Rather than a separate query, this is likely just an extension of the Supported Properties query

@EdwardHinkle
Copy link
Author

The initial brainstorm on #8 needed some refinement based on various UI libraries, etc. I've modified it based on feedback from @grantcodes as well as looking at UI libraries. Below the new version for discussion/iteration/destruction:

properties: [
  {
    "uid": "visibility",
    "name": "Visibility",
    "predefined": true,
    "multiple": false,
    "default": "private", 
    "options": [
      {
         "uid": "public",
         "name": "public"
      },
     {
         "uid": "private",
         "name": "private"
      },
     {
         "uid": "unlisted",
         "name": "unlisted"
      }
    ]
  },
  {
    "uid": "categories",
    "name": "Tags",
    "predefined": false,
    "multiple": true,
    "default": [],
    "optionsQuery": "categories" // This is the query sent (?q=categories) to retrieve the options
  },
  {
    "uid": "syndicate-to",
    "name": "Syndication",
    "predefined": true,
    "multiple": true,
    "default": [],
    "options": [
      {
        "uid": "uid of object",
        "name": "display name of object"
      },
      {
        "uid": "twitter-service",
        "name": "Twitter Username"
      },
     {
        "uid": "github-service",
        "name": "GitHub Username"
      },
    ]
  }
]

There are a couple notable changes and things to think through about this model.
I changed it from being a dictionary object to an array of objects with uid being the property id. This is based on looking at other Micropub queries and approaches. It's better for everything in Micropub to use similar approaches.

name is the user facing label just like the Query for Supported Vocabulary.

predefined isn't the best name, but it's the idea whether you can send ANY value or only the ones chosen by the server.

multiple is boolean because in reality a field is either going to be single choice or unlimited.

default could either be ALWAYS an array or it could mirror the multiple attribute. I kind of feel like if multiple is false, default should be a string of the uid from the options. But if it simplifies things, I'm not opposed to it always being an array and if multiple is false, then the client grabs index 0 of default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant