GregTrevellick / VsixTwitterWidget

A VSTS extension to display tweets on project dashboards.
https://goo.gl/TWLBjj
MIT License
2 stars 2 forks source link

Take user as a parameter. #1

Open ostreifel opened 6 years ago

ostreifel commented 6 years ago

Dashboard widget should allow specifying the target twitter handle through configuration of the widget.

GregTrevellick commented 6 years ago

If I get chance I'll add this, but only if I can get configuration working at all. No matter how I tried before launch I could not get configuration working, even just for simple resizing of the widget. I could get the config option in hamburger appearing if I put caneditname:true in the manifest but the widget then failed to load. Right now I don't have time to pursue the cause.

ostreifel commented 6 years ago

I used to have the contributions graph setup to handle widget configuration.

scripts for

ostreifel commented 6 years ago

Only major difference would be in this case the twitter widget should return unconfigured b/c there isn't an obvious twitter handle to default to.

VSS.require("TFS/Dashboards/WidgetHelpers", function (WidgetHelpers) {

    //https://docs.microsoft.com/en-us/vsts/extend/develop/styles-from-widget-sdk?view=vsts
    WidgetHelpers.IncludeWidgetStyles();
    WidgetHelpers.IncludeWidgetConfigurationStyles();

    var registerWidget = function () {
        return {
            load: function (widgetSettings) {
                if (!widgetSettings || !widgetSettings.handle) {
                    return WidgetHelpers.WidgetStatusHelper.Unconfigured();
                }
                loadTwitterWidget(widgetSettings.handle);
                return WidgetHelpers.WidgetStatusHelper.Success();
            }
        }
    }

    VSS.register(vssRegisterName, registerWidget);

    VSS.notifyLoadSucceeded();
});
GregTrevellick commented 6 years ago

Thanks Otto, hopefully this will be of use when I get time to investigate. Cheers, Greg