Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escape special characters +-&|!(){}[]^"~*?:\ - e.g. \+ \* \!
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
Answered
How to add a button to the window that appears when hashtag is focused

To add a button when the mouse cursor is focused on a hashtag, I created an Extension app with the command yo @finos/symphony and changed the following code snippet in controller.js.
I have not modified any files other than controller.js.
But when I launch the symphony app and focus the mouse cursor on the hashtag, the button is not added.
I would like to know the cause of this problem.

let appControllerService = SYMPHONY.services.register("app:controller")
let navService
let appId = 'test-extension'

let authenticate = () => {
    return $.post({
        url: '/bdk/v1/app/auth',
        success: res => $.when(res)
    })
}

let register = data => {
    let appToken = data["appToken"]
    return SYMPHONY.application.register(
            {
                appId: appId,
                tokenA: data["appToken"]
            },
            ['modules', 'applications-nav', 'extended-user-info'],
            ['app:controller']
    ).then(res => {
        res["tokenA"] = appToken
        let modulesService = SYMPHONY.services.subscribe("modules")

        let uiService = SYMPHONY.services.subscribe('ui');
        uiService.registerExtension(
            'hashtag',
            'hello-im',
            "app:controller", 
            {
                label: 'hashtag Button',
                data: {}
            }
        );

        navService = SYMPHONY.services.subscribe("applications-nav")
        navService.add('show-module', 'test-extension-app', 'app:controller')
        appControllerService.implement({
            select: id => {
                if (id === 'show-module') {
                    modulesService.show("test-app", {title: "test-extension-app"}, "app:controller", "https://localhost:10443/app.html")

                }
            },
            trigger: function(uiClass, id, payload, data) {
                if (uiClass == "hashtag") {
                console.log('hashtag button was registered on ' + data.datetime + '.');
                }
            }
        })

        return $.when(res)
    })
}

SYMPHONY.remote.hello()
        .then(authenticate)
        .then(register)
  
  
Posted one year ago
Edited one year ago
Votes Newest

Answers


Please review the new App Developer Kit guide on how to build a basic extension app with added buttons and handlers.
https://docs.developers.symphony.com/dev-tools/app-developer-kit/build-a-basic-extension-app

  
  
Posted one year ago
Yong Sheng Tan
39 × 2 Administrator
9K Views
1 Answer
one year ago
one year ago