caluma icon indicating copy to clipboard operation
caluma copied to clipboard

feat(analytics): provide option labels

Open winged opened this issue 2 years ago • 3 comments

Analytics now gives you the ability to not only extract slugs from choice questions, but the corresponding labels as well.

winged avatar Aug 23 '22 13:08 winged

Awesome @winged :tada:

Unfortunately the choice-questions are not correctly detected/handled and is_leaf is true. Here's part of the response as captured in the FE

                    {
                        "node": {
                            "id": "$SOME_ID",
                            "label": "chosenlabel",
                            "isLeaf": true,
                            "isValue": true,
                            "sourcePath": "document[foo].bar.baz",
                            "supportedFunctions": [
                                "VALUE",
                                "COUNT",
                                "MAX",
                                "MIN"
                            ],
                            "__typename": "AvailableField"
                        },
                        "__typename": "AvailableFieldEdge"
                    },

Just as a heads up: The same should also be implemented for Form. But this can also be done in a separate PR.

open-dynaMIX avatar Aug 24 '22 07:08 open-dynaMIX

Awesome @winged tada

Unfortunately the choice-questions are not correctly detected/handled and is_leaf is true. Here's part of the response as captured in the FE

                    {
                        "node": {
                            "id": "$SOME_ID",
                            "label": "chosenlabel",
                            "isLeaf": true,
                            "isValue": true,
                            "sourcePath": "document[foo].bar.baz",
                            "supportedFunctions": [
                                "VALUE",
                                "COUNT",
                                "MAX",
                                "MIN"
                            ],
                            "__typename": "AvailableField"
                        },
                        "__typename": "AvailableFieldEdge"
                    },

Just as a heads up: The same should also be implemented for Form. But this can also be done in a separate PR.

Nice catch with the leaf/value detection! Fixed it and added a test.

I'll do the form one in a separate PR if you don't find anything else to fix here :-)

winged avatar Aug 25 '22 13:08 winged

Awesome @winged :tada:

We're making progress. I can now add the label-field and also fetch the correct results. However, explicitly setting the language doesn't work yet:

{
    "errors": [
        {
            "message": "de",
            "locations": [
                {
                    "line": 10,
                    "column": 3
                }
            ],
            "path": [
                "analyticsTable",
                "availableFields"
            ]
        }
    ],
    "data": {
        "analyticsTable": {
            "id": "QW5hbHl0aWNzVGFibGU6ZmFjaGluZm9ybWF0aW9uZW4=",
            "availableFields": null,
            "__typename": "AnalyticsTable"
        }
    }
}

open-dynaMIX avatar Aug 29 '22 09:08 open-dynaMIX

@winged What's the status here?

open-dynaMIX avatar Sep 08 '22 11:09 open-dynaMIX