feat: Filter cards by keyword with advanced capabilities (#713)

Closes #706
This commit is contained in:
Emmanuel Guyot
2024-04-22 23:15:31 +02:00
committed by GitHub
parent 0830db210c
commit 25a7a3bd3b
19 changed files with 267 additions and 1 deletions
+12
View File
@@ -80,4 +80,16 @@ export default class extends BaseModel {
default:
}
}
static findLabelsFromText(filterText, labels) {
const selectLabel = filterText.toLocaleLowerCase();
const matchingLabels = labels.filter((label) =>
label.name ? label.name.toLocaleLowerCase().startsWith(selectLabel) : false,
);
if (matchingLabels.length === 1) {
// Appens the user to the filter
return matchingLabels[0].id;
}
return null;
}
}