gr2m / gr2m/github-project

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

Open
#42 0 comments 0 reactions 0 assignees View on GitHub
feature Pull Request welcome
Dominant language
JavaScript
Stars
36
Forks
10
PR merge metrics
No merged PRs in 30d

Description

### 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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.