gr2m / gr2m/github-project

Pass `field` context as third argument to `matchFieldOptionValue()`

オープン
#42 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
feature Pull Request welcome
主要言語
JavaScript
スター
36
フォーク
10
PR マージ指標
30日以内にマージされた PR はありません

説明

### Please avoid duplicates

- [X] I checked [all open feature requests](https://github.com/gr2m/github-project/issues?q=is%3Aissue+is%3Aopen+label%3Afeature) and none of them matched my problem.

### What’s missing?

The current `matchFieldOptionValue` constructor options receives two arguments

```js
function (fieldOptionValue, userValue) {
// return true or false
}
```

I suggest we pass a 3rd `context` argument

```js
function (fieldOptionValue, userValue, context) {
// return true or false
}
```

`context` would look like this

```js
{
field: {
name: "My Field",
userName: "myField",
// maybe also `type`, and `options`, but we could add that later
}
}
```

That way we could add more context in future, e.g. `project`, which would be the current project instance.

### Why?

The way options are matched might differ depending on the field

### Alternatives you tried

:shrug

### Would you be interested in contributing the feature?

- [ ] yes

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

リポジトリで `matchFieldOptionValue()` と、そのコンストラクターオプションおよび呼び出し箇所を検索します。フィールドデータがどのように matcher に到達するかを追跡し、既存の 2 引数コールバックを壊さずに、提案された `context.field` オブジェクトを定義して渡します。フィールド依存のマッチングでフィールドコンテキストを読み取ることができ、関連する既存のテストが引き続き通過すれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript
領域
api
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。