How to have a Google Workspace Add-on homepageTrigger multiple times?
@PierrickVoulet đang làm issue này rồi.
Từ ngày 13/12/2023.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
We have a Google Workspace add-on that operates via a sidebar, so we use homepageTrigger so that the user can open the sidebar from the right hand menu.
This works well - but only once per page load - so if the user opens the sidebar, closes it and attempts to reopen via the right hand menu we instead get this page:
How instead can we have the homepageTrigger function run every time?
Here is the appsscript.json:
{
"timeZone": "Australia/Sydney",
"exceptionLogging": "STACKDRIVER",
"runtimeVersion": "V8",
"dependencies": {
"enabledAdvancedServices": [
{
"userSymbol": "Drive",
"serviceId": "drive",
"version": "v2"
}
]
},
"oauthScopes": [
"https://www.googleapis.com/auth/script.scriptapp",
"https://www.googleapis.com/auth/documents.currentonly",
"https://www.googleapis.com/auth/spreadsheets",
"https://www.googleapis.com/auth/presentations",
"https://www.googleapis.com/auth/script.container.ui",
"https://www.googleapis.com/auth/drive",
"https://www.googleapis.com/auth/drive.apps.readonly",
"https://www.googleapis.com/auth/script.external_request",
"https://www.googleapis.com/auth/script.locale",
"https://www.googleapis.com/auth/userinfo.email"
],
"urlFetchWhitelist": [
"https://cm234-wgs-1.icognition.cloud/",
"https://docs.google.com/feeds/download/documents/export/Export",
"https://docs.google.com/spreadsheets/export",
"https://docs.google.com/feeds/download/presentations/Export"
],
"addOns": {
"common": {
"name": "Content Manager",
"logoUrl": "https://cm234-wgs-1.icognition.cloud/CMServiceApiGoogle/TrimIcon/W64h64/trim.png",
"homepageTrigger": {
"runFunction": "showSidebar",
"enabled": true
}
},
"sheets": {},
"docs": {},
"slides": {}
}
}
Here is the function it is calling (when I add a log line at the start of this function it is only ever called once):
function showSidebar() {
var sidebarName = "sidebar";
if (getRecordUri() !== 0) {
sidebarName = "existing_record_sidebar";
}
var ui =
HtmlService.createHtmlOutputFromFile(sidebarName).setTitle(
"Content Manager",
);
getUi().showSidebar(ui);
}
- Ngôn ngữ chính
- JavaScript
- Star
- 5.2k
- Fork
- 2k
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của googleworkspace/apps-script-samples
-
Alvin Litana MirasolĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 1/100
googleworkspace/apps-script-samples#659 · 1 bình luận · 1 reaction ·
-
Password resetĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
googleworkspace/apps-script-samples#654 · 2 reaction ·
-
cod gsĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 10/100
googleworkspace/apps-script-samples#651 · 1 reaction ·
-
tespogromeĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 1/100
googleworkspace/apps-script-samples#624 · 1 reaction ·
-
Get_order_manually.gsCó thể làm lại được @vinay-google đã nhận 226 ngày trước và không có pull request nào đang mở. Đang mở
googleworkspace/apps-script-samples#616 · 1 người được giao ·
Tất cả issue của googleworkspace/apps-script-samples
Issue tương tự
-
Complexity: Small P-Feature: Projects page ready for merge team role: back end/devOps role: front end size: 0.25pt
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 67/100
bellingcat/toolkit#905 ·
-
self-care self-care:docs-build-time-investigator
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 76/100
githubnext/gh-aw-cao#14191 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
effort:low impact:medium RAG status: auto-triaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
mastra-ai/mastra#25229 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
sugarlabs/musicblocks#8984 ·
Maintainer thường phản hồi trong vòng 1 ngày