Skip to content

Commit

Permalink
fix: add Project to wellKnownColletions (#1254)
Browse files Browse the repository at this point in the history
  • Loading branch information
vivzhang authored Oct 3, 2023
1 parent 86cf91f commit 82eb6a1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
20 changes: 19 additions & 1 deletion packages/common/src/search/wellKnownCatalog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,24 @@ function getAllCollectionsMap(i18nScope: string, entityType: EntityType): any {
],
},
} as IHubCollection,
project: {
key: "project",
label: `{{${i18nScope}collection.projects:translate}}`,
targetEntity: entityType,
include: [],
scope: {
targetEntity: entityType,
filters: [
{
predicates: [
{
type: getFamilyTypes("project"),
},
],
},
],
},
} as IHubCollection,
};
}

Expand All @@ -359,7 +377,7 @@ function getAllCollectionsMap(i18nScope: string, entityType: EntityType): any {
* @returns a list of WellKnownCollection definition strings
*/
function getDefaultCollectionNames(): WellKnownCollection[] {
return ["appAndMap", "dataset", "document", "feedback", "site"];
return ["appAndMap", "dataset", "document", "feedback", "site", "project"];
}

/**
Expand Down
3 changes: 3 additions & 0 deletions packages/common/test/search/wellKnownCatalog.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ describe("WellKnownCatalog", () => {
"document",
"feedback",
"site",
"project",
]);
chk = getWellKnownCatalog("mockI18nScope", "favorites", "item", options);
expect(chk.scopes).toBeDefined();
Expand All @@ -47,6 +48,7 @@ describe("WellKnownCatalog", () => {
"document",
"feedback",
"site",
"project",
]);
});
it("returns the expected catalog for groups", () => {
Expand Down Expand Up @@ -178,6 +180,7 @@ describe("WellKnownCatalog", () => {
"document",
"feedback",
"site",
"project",
]);
expect(chk[1].scope.filters[0].predicates[0].type).toEqual([
"CSV Collection",
Expand Down

0 comments on commit 82eb6a1

Please sign in to comment.