Skip to content

Enhancement: Extract method for getting filters for column#2405

Open
Koc wants to merge 1 commit intomainfrom
feature/extract-filter-for-column-method
Open

Enhancement: Extract method for getting filters for column#2405
Koc wants to merge 1 commit intomainfrom
feature/extract-filter-for-column-method

Conversation

@Koc
Copy link
Copy Markdown
Contributor

@Koc Koc commented Mar 15, 2026

During work on #2387 I've realized that we have some code duplication. Let's extract it into separate function. This logic going to be extended in the mentioned PR:

export function getFiltersForColumn(column, viewSetting) {
	if (viewSetting?.filter?.length > 0) {
		return viewSetting.filter.filter(filter => {
			if (filter.columnId !== column.id) {
				return false
			}
			if (filter.operator.id === FilterIds.ContainsItem) {
				return filter.value.length > 0
			}

			return true
		})
	}
	return []
}

Signed-off-by: Kostiantyn Miakshyn <molodchick@gmail.com>
@Koc Koc requested review from blizzz and enjeck as code owners March 15, 2026 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant