Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/boards/boards_util.js')
-rw-r--r--app/assets/javascripts/boards/boards_util.js31
1 files changed, 30 insertions, 1 deletions
diff --git a/app/assets/javascripts/boards/boards_util.js b/app/assets/javascripts/boards/boards_util.js
index a8b870f9b8e..f53d41dd0f4 100644
--- a/app/assets/javascripts/boards/boards_util.js
+++ b/app/assets/javascripts/boards/boards_util.js
@@ -1,6 +1,6 @@
import { sortBy, cloneDeep } from 'lodash';
import { getIdFromGraphQLId } from '~/graphql_shared/utils';
-import { ListType, NOT_FILTER } from './constants';
+import { ListType, NOT_FILTER, AssigneeIdParamValues } from './constants';
export function getMilestone() {
return null;
@@ -186,6 +186,35 @@ export function transformNotFilters(filters) {
}, {});
}
+export function getSupportedParams(filters, supportedFilters) {
+ return supportedFilters.reduce((acc, f) => {
+ /**
+ * TODO the API endpoint for the classic boards
+ * accepts assignee wildcard value as 'assigneeId' param -
+ * while the GraphQL query accepts the value in 'assigneWildcardId' field.
+ * Once we deprecate the classics boards,
+ * we should change the filtered search bar to use 'asssigneeWildcardId' as a token name.
+ */
+ if (f === 'assigneeId' && filters[f]) {
+ return AssigneeIdParamValues.includes(filters[f])
+ ? {
+ ...acc,
+ assigneeWildcardId: filters[f].toUpperCase(),
+ }
+ : acc;
+ }
+
+ if (filters[f]) {
+ return {
+ ...acc,
+ [f]: filters[f],
+ };
+ }
+
+ return acc;
+ }, {});
+}
+
// EE-specific feature. Find the implementation in the `ee/`-folder
export function transformBoardConfig() {
return '';