[Custom Components] Unable to update inherited editform values
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- angular, typescript
- 領域
- frontend
調査の方向性
継承された Components.components.radio.editForm エントリポイントから始め、記載された Formio および Angular のバージョンでカスタムの values オーバーライドを再現します。親と子の edit-form プロパティがどのようにマージされるかを追跡し、そのうえで label や reorder などのフィールドが親で更新され、既存の子のオーバーライドが引き続き機能することを確認します。
索引モデルが issue の本文から書いたものです。
説明
Environment:
formiojs: ^4.14.1
formio/angular : ^5.3.0-rc.2
angular:13.3.11
I'm making a custom radio component, inheriting the radio editFormfrom formio, as an example below:
import { Components } from 'formiojs';
const COMPONENT_OPTIONS: FormioCustomComponentInfo = {
type: 'custom-radio',
selector: 'custom-radio',
title: 'Radio',
group: 'basic',
icon: 'stop-circle-o',
editForm: Components.components.radio.editForm, <----------------------
schema: {tableView: true},
fieldOptions: ['key', 'label', 'values','value', 'disabled', 'validate']
};
The base code equivalent of the values field is as follows:
{
"type": "datagrid",
"input": true,
"label": "Values",
"key": "values",
"tooltip": "The radio button values that can be picked for this field. Values are text submitted with the form data. Labels are text that appears next to the radio buttons on the form.",
"weight": 10,
"reorder": true,
"defaultValue": [
{
"label": "",
"value": ""
}
],
"components": [
{
"label": "Label",
"key": "label",
"input": true,
"type": "textfield"
},
{
"label": "Value",
"key": "value",
"input": true,
"type": "textfield",
"allowCalculateOverride": true,
"calculateValue": "value = _.camelCase(row.label);",
"validate": {
"required": true
}
},
{
"type": "select",
"input": true,
"weight": 180,
"label": "Shortcut",
"key": "shortcut",
"tooltip": "The shortcut key for this option.",
"dataSrc": "custom",
"valueProperty": "value",
"template": "{{ item.label }}",
"data": {}
}
]
}
In the editform of my custom component I'm doing this:
{
key: "values",
label: "test", //not working
reorder: false, //not working
components: [
{
key: "shortcut",
ignore: true, //working
},
{
key: "value",
label: "test2", //working
}
],
calculateValue(context) {
console.log(context.value); //working
return context.value;
}
}
However, no changes to the parent component (values) are reflected.
What I managed to change was the child components.
How can I modify data, such as label, reorder, among others of the parent component?
- 主要言語
- TypeScript
- スター
- 706
- フォーク
- 493
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
formio/angular のほかの issue
-
question
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
-
[BUG] <form-builder> move icon is missing再び着手できるかも @PrathameshHegde が 99 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンbug
-
question
難易度 2/5 1〜3時間 初心者へのやさしさ 25/100
-
[BUG] "Left (Right-aligned)" label position causes misaligned error messages and descriptions再び着手できるかも @Victoriya25 が 363 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンbug
-
question
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
似ている issue
-
bot:ai-assisted component:platform-js status:untriaged
難易度 1/5 1時間未満 初心者へのやさしさ 74/100
midnightntwrk/platform-js#38 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
ranxianglei/billion-context#7068 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
mybigday/whisper.rn#348 ·
-
enhancement severity:low
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
Battle-Cattle/BCUK-Bot-4#1075 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
ilan-pinto/roaring-lions#1552 ·
メンテナーはふだん 1 日以内に返信