I have developed a SharePoint WebPart that I want to use in my Teams. In this WebPart I can hot-swapping several properties: width, height... but when I try to use this WebPart in Teams, I can't customize this properties and is a necessary thing.
In the manifest file, I have declared a staticTab because I need to pin the icon in the left menu.
"staticTabs": [
{
"entityId": "example",
"name": "exampleName",
"contentUrl": "https://{teamSiteDomain}/_layouts/15/TeamsLogon.aspx?SPFX=true&dest=/_layouts/15/teamshostedapp.aspx%3FopenPropertyPane=true%26teams%26personal%26componentId=XXXXXXXXXXXXXXXXXXXXXXXXXXXX%26forceLocale={locale}",
"scopes": [
"personal"
]
}
],
Somebody know how I could have a static tab and customize the properties?
On the other hand, If I try, from the the catalog, to click on "sync button between SP & Teams" it doesn't works.
Kind regards!
Related
I have to use adaptive cards in certain situation. When I use these cards, I need to have some buttons that can perform different actions when clicked. Previously, I have been using Hero Cards to return data and create the buttons. I have found that postBack (for hero cards) is the way to accept the button output most effectively for me. Unfortunately, adaptive cards doesn’t seem to have postBack. Instead, I need to use Action.Submit. However, when I do this, I end up with the text from the button showing as part of the conversation. I don’t want that and need it to be consistent with postBack. I tried to use the method from this comment https://github.com/Microsoft/AdaptiveCards/issues/558 (the guy has the exact same ask as me) but, it doesn’t seem to work anymore (from 2017). Any suggestions? I'm using SDK V4 and the basic bot NodeJS build found in the Azure portal.
Thanks for the help in advance
Adding the code for more detail:
var card = {
"type": "AdaptiveCard",
"version": "1.0",
"body": [
{"type": "TextBlock",
"text": answer},
table],
"actions" : [{
"type": "Action.Submit",
"title": wrap(promptQuestions[0]),
"data": promptQuestions[0]
},
{
"type": "Action.Submit",
"title": wrap(promptQuestions[1]),
"data": promptQuestions[1]
}]
}
console.log(card)
return CardFactory.adaptiveCard(card);
Submit action data is supposed to be an object and not a string. See my blog post for more information: https://blog.botframework.com/2019/07/02/using-adaptive-cards-with-the-microsoft-bot-framework/
I'm developing a Chome extension. When you click on the extension icon, the contextMenu is accessible by a right-click and a left-click.
Actually, I don't have a browserAction in my manifest.json, so my problem is my icon is grayed out. The solution is to add a browserAction. But if I add a browserAction, the left-click don't show the default menu, but shows nothing.
What I want is a colored icon and when I left-click that the default Chrome extension popup is opened.
Default Chrome Extension popup example:
My manifest.json
{
"manifest_version": 2,
"name": "Awesome app",
"version": "0.1",
"background": {
"scripts": ["background.js"],
"persistent": true
},
"permissions": [
"storage",
"contextMenus"
],
"icons": {
"16": "icons/se16.png",
"32": "icons/se32.png",
"158": "icons/se158.png"
}
}
Can someone help me?
It's not possible to have the default menu AND a colorful icon because the very presence of "browser_action" key means the extension wants to interact with the user and instructs the browser to either delegate icon click event to background page script in chrome.browserAction.onClicked listener or show a popup window if "default_popup" is declared in manifest or the popup was set programmatically via chrome.browserAction.setPopup.
The only way to "ignore" the click event in browserAction API is to disable the icon via chrome.browserAction.disable which will gray it out thus defeating the initial goal.
Well, you can show/do something useful on click. The default menu isn't very useful, anyway.
I successfully created my first Chrome extension. It now runs only when the extension icon is clicked instead of on the background, and that is great. However, I would like to add more actions to my extension I have been trying to use an extension popup to run other functions but I can't make it work. It doesn't have to be like that, so I am open for suggestions. I do not want to use context menus. I want people to click on the extension icon and show them a "menu".
Right now my extension only alerts a message when it finds a valid page (from mydomain.com), and it finds a hidden field with the name "returnURL". It alerts the value.
I would like to be able to add the ability to click on the icon but instead show an options menu with multiple options.
Something like this:
Click on the extension icon and show two options
Get Response URL (this option will run the current functionality I have now)
Do something else (So I could have another function to execute on the
loaded page)
...and more options if I needed to add them on future versions of my extension.
How do I modify my extension to do that.
Here is my code:
manifest.json
{
"name": "Get Response URL",
"version": "1.0",
"manifest_version": 2,
"browser_action": {
"default_icon": "mkto_icon.png",
"name": "Click to get URL"
},
"background":{
"scripts":["background.js"]
},
"permissions":["http://mydomain.com/*"]
}
background.js
chrome.browserAction.onClicked.addListener(function (tab) { //Fired when User Clicks ICON
if (tab.url.indexOf("http://mydomain.com/") != -1) { // Inspect whether the place where user clicked matches with our list of URL
chrome.tabs.executeScript(tab.id, {
"file": "contentscript.js"
}, function () { // Execute your code
console.log("Script Executed .. "); // Notification on Completion
});
}
});
contentscript.js
if (document.getElementsByName("returnURL")){
alert("\nThe Response URL on this form is:\n\n" + document.getElementsByName("returnURL")[0].value);
}
I followed the documentation I found on the Google Extensions developer site but I couldn't make it work. Your help is much appreciated.
You cannot have a real menu with a Chrome extension. You can however show an HTML page when the button is clicked (a pop-up). You can style this HTML page in a way that looks similar to a menu:
"browser_action": {
"default_icon": "mkto_icon.png",
"default_title": "Click here to open menu",
"default_popup": "popup.html"
},
Add a file popup.html to you extension and whatever content you want to show up. Scripts loaded by the pop-up page can load content scripts and communicate with them just like the background page.
For reference: browser actions documentation.
Is there a way to add a page_action in an extension that already implements browser_action?
I'd like to use the browser_action to display a popup with a list of bookmarks while use the page_action to give the user a way to bookmark the current page and load it in the list.
You can only have one among app, browser_action, page_action and theme in your manifest till date. So, you can not have browser action and page action together.
// Pick one (or none)
"browser_action": {...},
"page_action": {...},
"theme": {...},
"app": {...},
Work Around
Use two different Extensions with cross extension message communication.
References
Manifest File
I've been struggling with this for 3 days. The documentation for the QSelectSection is the class itself, and the QuickDialog docs are minimal at best.
I'm trying to use the QSelectSection using the QuickDialog framework. I have it working for most of the controls (after diving head first into the code to see how the component works) but this one has beaten me. From my understanding, and the way the other controls work, this should dump the selected item values into the alerts array within my controller. I want to put as much in the JSON as I can, and only use the controller to store/submit the details if this is possible.
The JSON below generates the dialog and my multi select form. Awesome, but for some reason when I scroll the select section off screen, my values are gone. When I submit the form, the app does not see my selected items. When I try to use "controllerAction" to store these values, the app just crashes.
{
"grouped": true,
"title": "MyTitle",
"controllerName": "LOrderViewController",
"sections": [
{
"title": "Notifications",
"type": "QSelectSection",
"bind": "selectedItems:alerts",
"multipleAllowed": true,
"items": [
"Email Alerts",
"App Alerts"
],
"footer": "My Footer text."
}
...
]
}
What am I missing? What code is required in my controller, how can I trigger that code?
Am I better off scrapping QuickDialog for something that is better documented, or just stick with native methods?
Love the concept of QuickDialog, but the same isn't holding true for me with this taking so long to learn.