Skip to content

Enhancement: Extract method for getting filters for column#2405

Merged
Koc merged 1 commit intomainfrom
feature/extract-filter-for-column-method
Apr 15, 2026
Merged

Enhancement: Extract method for getting filters for column#2405
Koc merged 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 []
}

@Koc
Copy link
Copy Markdown
Contributor Author

Koc commented Apr 14, 2026

@samin-z sadly your approval has not power here 😿

image

@samin-z
Copy link
Copy Markdown
Contributor

samin-z commented Apr 15, 2026

@samin-z sadly your approval has not power here 😿

@Koc you should be able to do it now :)

@Koc Koc merged commit c155d34 into main Apr 15, 2026
52 checks passed
@Koc Koc deleted the feature/extract-filter-for-column-method branch April 15, 2026 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants