[英]I cannot publish Editor addon on google workspace marketplace -Menu options not shown after App is installed
I have applied to publish an editor add-on on the Google workspace marketplace.我已申请在 Google 工作区市场上发布一个编辑器插件。
I have applied to publish an editor add-on on the Google workspace marketplace, but it has been rejected for the following reasons我已申请在 Google 工作区市场上发布编辑器插件,但由于以下原因被拒绝
Menu - Menu options not shown after App is installed.菜单 - 安装应用程序后不显示菜单选项。 Please ensure that the add-on correctly uses onInstall() and onOpen() to populate its menu.请确保插件正确使用 onInstall() 和 onOpen() 来填充其菜单。 The menu items populate when the add-on is first installed and when a different file is opened.首次安装插件和打开不同文件时会填充菜单项。 See Editor add-on authorization.请参阅编辑器附加授权。
In the test of the editor add-on in my environment, the menu is displayed without any problem.在我的环境中测试编辑器插件,菜单显示没有任何问题。
Here is the code.这是代码。 *The contents of unrelated functions are omitted. *无关功能的内容被省略。
function GlobalVar(userLocale){
if(userLocale === null) userLocale = 'ja';
return {
TITLE: (userLocale == 'ja') ? 'こぴぺ' : 'Copipe', //アドオンのタイトル
VERSION: '1.1.2', //アプリのバージョン
}
}
function onInstall(e){
onOpen(e);
}
function onOpen(e){
var menu = SpreadsheetApp.getUi().createAddonMenu();
var userLocale = Session.getActiveUserLocale(); //ユーザーが使用している言語判定
if(userLocale != 'ja') userLocale = 'en'; //日本語以外の場合は英語表記にする
var itemInfo = {
Item1 : {func:'display_sidebar', ja: '操作パネル表示', en: 'Show Sidebar'},
Item2 : {func:'dispVersion', ja: 'バージョン情報',en: 'about version'}
};
menu.addItem(itemInfo.Item1[userLocale],itemInfo.Item1.func)
.addSeparator()
.addItem(itemInfo.Item2[userLocale],itemInfo.Item2.func);
menu.addToUi(); //メニューを追加
}
function askEnabled(){
let userLocale = Session.getActiveUserLocale();
let title = GlobalVar(userLocale).TITLE;
let msg = userLocale === 'ja' ? "スクリプトが有効になりました\nもう一度メニュー画面を開いてサイドバーを表示させてください" : "The script has been enabled.\nOpen the menu screen again to display the sidebar.";
let ui = SpreadsheetApp.getUi();
ui.alert(title, msg, ui.ButtonSet.OK);
onOpen();
};
function display_sidebar(){
let userLocale = Session.getActiveUserLocale(); //ユーザーが使用している言語判定
let SidebarHTML = HtmlService.createTemplateFromFile('sidebar');
SidebarHTML.LANGUAGE = userLocale; //サイドバーに言語情報を送る
let Sidebar = SidebarHTML.evaluate().setTitle(GlobalVar(userLocale).TITLE);
SpreadsheetApp.getUi().showSidebar(Sidebar); //サイドバーを表示
}
function dispVersion(){
let userLocale = Session.getActiveUserLocale(); //ユーザーが使用している言語判定
Browser.msgBox(GlobalVar(userLocale).TITLE + " Version",'Version: ' +GlobalVar(userLocale).VERSION, Browser.Buttons.OK);
}
function toolTask(TASK_ORDER){
return toolTaskRun().start(TASK_ORDER);
}
function toolTaskRun() {
return {
SPRED: null,
SHEET: null,
JOB: null,
INFO: null,
TAG_NAME: '_copipe_',
init: function(){
this.SPRED = SpreadsheetApp.getActiveSpreadsheet();
this.SHEET = this.SPRED.getActiveSheet();
},
start: function(TASK_ORDER){
},
copy: function(){
},
paste: function(TAISHO){
},
moveRows: function(){
},
moveColumns: function(){
},
zettai: function(MODE){
}
};
}
Apart from this, I load my own libraries.除此之外,我还加载了自己的库。
The manifesto is below.宣言如下。
{
"timeZone": "Asia/Tokyo",
"exceptionLogging": "STACKDRIVER",
"runtimeVersion": "V8",
"dependencies": {
"libraries": [
{
"userSymbol": "SetNamedRange",
"version": "0",
"libraryId": "1M0tYhnFHYkxl0IXsDju8NWTvWHZWBY8H4-Z7eFOIKyi26p-Ymmtu7C7r",
"developmentMode": true
}
]
},
"oauthScopes": [
"https://www.googleapis.com/auth/spreadsheets",
"https://www.googleapis.com/auth/script.container.ui",
"https://www.googleapis.com/auth/userinfo.email"
]
}
I have no idea what to change.我不知道要改变什么。 Can someone please tell me what to do?有人可以告诉我该怎么做吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.