From 4eb66684daeb6a3c263887b08278ecf00a16fe37 Mon Sep 17 00:00:00 2001 From: Mouriya Date: Tue, 17 Sep 2024 10:06:46 +0900 Subject: [PATCH] =?UTF-8?q?=E4=B8=8D=E9=81=A9=E5=88=87=E3=81=AA=E3=83=95?= =?UTF-8?q?=E3=82=A3=E3=83=AB=E3=82=BF=E3=83=BC=E6=9D=A1=E4=BB=B6=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../actions/cascading-dropdown-selectors.ts | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/plugin/kintone-addins/src/actions/cascading-dropdown-selectors.ts b/plugin/kintone-addins/src/actions/cascading-dropdown-selectors.ts index ea84ae1..78199b6 100644 --- a/plugin/kintone-addins/src/actions/cascading-dropdown-selectors.ts +++ b/plugin/kintone-addins/src/actions/cascading-dropdown-selectors.ts @@ -121,7 +121,7 @@ namespace DropDownConfig { value: fieldData.value, index: fieldCodeToIndexMap.get(fieldCode), })) - .filter((item) => item.index !== undefined || item.index !== null) + .filter((item) => item.index !== undefined) .sort((a, b) => a.index! - b.index!) ) .forEach((recordArray) => { @@ -168,7 +168,7 @@ namespace DropDownConfig { // 指定された階層と値のドロップダウンメニューオプションを取得 export const getOptions = (level: number, value: string): string[] => { - const key = level === 0 ? "0_TOP" : buildKey(level -1 , value); + const key = level === 0 ? "0_TOP" : buildKey(level - 1, value); return dictionary[key] || []; }; } @@ -195,7 +195,7 @@ export class CascadingDropDownAction implements IAction { console.log(this.actionProps); console.log(this.props); - + const result: IActionResult = { canNext: true, result: "" }; try { @@ -217,9 +217,11 @@ export class CascadingDropDownAction implements IAction { // ページの状態を処理 async #handlePageState(appId: string) { - // kintoneのパスのパラメータは奇妙に#を使用しているため、ここで標準的な記号に置き換えて、後でURLツールを使用してrequestパラメータを検索しやすくします - const currentState = getPageState(window.location.href.replace('#','?'), appId); + const currentState = getPageState( + window.location.href.replace("#", "?"), + appId + ); switch (currentState.type) { case "app": @@ -266,7 +268,7 @@ new CascadingDropDownAction(); namespace DropdownContainer { let fieldList: IFieldList[]; let columMapValueArray: IFieldList[]; - let columMapArray: [number, IFieldList][]; + let columMapArray: [number, IFieldList][]; const columnMap: Map = new Map(); const selects: Map = new Map(); let state: Record = {}; @@ -371,7 +373,9 @@ namespace DropdownContainer { ): void => { let select; if (!initSelect) { - select = selects.get(fieldCode)?.querySelector("select"); + select = selects + .get(fieldCode) + ?.querySelector("select"); if (!select) { console.error( `フィールド ${fieldCode} のドロップダウンメニュー要素が見つかりません`