vickychijwani / quill

:ghost: [MOVED TO https://github.com/TryGhost/Ghost-Android] The beautiful Android app for your Ghost blog.
MIT License
554 stars 84 forks source link

Allow adding / removing tags in post editor #10

Closed vickychijwani closed 9 years ago

vickychijwani commented 9 years ago

This issue belongs to the create / edit post epic: #5.


Again, Ghost's PUT /posts call is very forgiving :)


Libraries for implementing UI:


Full HTTP request / response:

PUT /posts/<id>

Content-Type: application/json; charset=utf-8
Authorization: Bearer <access_token>

{
    "posts": [{
        "title": "<title>",
        "markdown": "<markdown>",
        "status": "draft",
        "tags": [{
            "name": "<tag1>"
        }, {
            "name": "<tag2>"
        }]
    }]
}

200 OK

{
    "posts": [{
        "id": 27,
        "uuid": "5f04e432-67e4-48be-a3b8-0a3beb3d5b0c",
        "title": "<title>",
        "slug": "<slug>",
        "markdown": "<markdown>",
        "html": "<html>",
        "image": null,
        "featured": false,
        "page": false,
        "status": "draft",
        "language": "en_US",
        "meta_title": null,
        "meta_description": null,
        "created_at": "2015-04-23T02:24:42.553Z",
        "created_by": 1,
        "updated_at": "2015-04-23T02:24:42.553Z",
        "updated_by": 1,
        "published_at": null,
        "published_by": null,
        "tags": [{
            "id": 12,
            "uuid": "fd9f1a43-ef3c-4b96-ba22-17b6f99e29c3",
            "name": "<tag1>",
            "slug": "<slug>",
            "description": null,
            "image": null,
            "hidden": false,
            "meta_title": null,
            "meta_description": null,
            "created_at": "2015-05-09T19:44:38.942Z",
            "created_by": 1,
            "updated_at": "2015-05-09T19:44:38.942Z",
            "updated_by": 1,
            "parent": null
        }, {
            "id": 13,
            "uuid": "a3724452-9932-4896-b3b7-7c92f4373cff",
            "name": "<tag2>",
            "slug": "<slug>",
            "description": null,
            "image": null,
            "hidden": false,
            "meta_title": null,
            "meta_description": null,
            "created_at": "2015-05-09T19:45:15.008Z",
            "created_by": 1,
            "updated_at": "2015-05-09T19:45:15.008Z",
            "updated_by": 1,
            "parent": null
        }],
        "author": 1,
        "url": "<slug>"
    }]
}
vickychijwani commented 7 years ago

Potential alternative chips input component for the future: https://github.com/pchmn/MaterialChipsInput

The current chips component we use is quite simple and fulfills like 95% of the UX goals I desire, while all the full-featured components I tried suffered from several issues or lacked important features. The only slightly ugly things with the current implementation are: (a) it always displays a trailing comma, and, (b) I couldn't get a 2-character delimiter like , (that's a comma followed by a space) to work.

UX considerations to keep in mind when evaluating alternatives: