Commit e5dc4875 authored by Zack Cuddy's avatar Zack Cuddy Committed by Andrew Fontaine

Global Search - Project Filter sets Group

There was a bug where the filter was no longer being set.
It seems that the /projects API return was changed.
parent 6fccc84a
......@@ -27,7 +27,7 @@ export default {
handleProjectChange(project) {
// This determines if we need to update the group filter or not
const queryParams = {
...(project.namespace_id && { [GROUP_DATA.queryParam]: project.namespace_id }),
...(project.namespace?.id && { [GROUP_DATA.queryParam]: project.namespace.id }),
[PROJECT_DATA.queryParam]: project.id,
};
......
---
title: Global Search - Project Filter sets Group
merge_request: 52015
author:
type: fixed
......@@ -26,7 +26,7 @@ export const MOCK_GROUPS = [
export const MOCK_PROJECT = {
name: 'test project',
namespace_id: MOCK_GROUP.id,
namespace: MOCK_GROUP,
nameWithNamespace: 'test group test project',
id: 'test_1',
};
......@@ -34,13 +34,13 @@ export const MOCK_PROJECT = {
export const MOCK_PROJECTS = [
{
name: 'test project',
namespace_id: MOCK_GROUP.id,
namespace: MOCK_GROUP,
name_with_namespace: 'test group test project',
id: 'test_1',
},
{
name: 'test project 2',
namespace_id: MOCK_GROUP.id,
namespace: MOCK_GROUP,
name_with_namespace: 'test group test project 2',
id: 'test_2',
},
......
......@@ -99,7 +99,7 @@ describe('ProjectFilter', () => {
it('calls setUrlParams with project id, group id, then calls visitUrl', () => {
expect(setUrlParams).toHaveBeenCalledWith({
[GROUP_DATA.queryParam]: MOCK_PROJECT.namespace_id,
[GROUP_DATA.queryParam]: MOCK_PROJECT.namespace.id,
[PROJECT_DATA.queryParam]: MOCK_PROJECT.id,
});
expect(visitUrl).toHaveBeenCalled();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment