) => void;
value?: string;
+ project?: Project;
}
export function ProjectNamespaceControl({
@@ -283,6 +286,7 @@ export function ProjectNamespaceControl({
onChange,
value,
"data-cy": dataCy,
+ project,
}: ProjectNamespaceControlProps) {
const {
data: namespacesFirstPage,
@@ -392,6 +396,23 @@ export function ProjectNamespaceControl({
});
}, [allNamespaces, specificNamespace, specificNamespaceRequestId]);
+ const allNamespacesWithProject = useMemo(() => {
+ if (!project) {
+ return allNamespaces || [];
+ }
+ return [
+ {
+ id: project.id,
+ slug: `${project.namespace}/${project.slug}`,
+ creation_date: project.creation_date,
+ created_by: project.created_by,
+ namespace_kind: "project",
+ name: `${project.namespace}/${project.slug}`,
+ } as NamespaceResponse,
+ ...(allNamespaces || []),
+ ];
+ }, [allNamespaces, project]);
+
if (isFetching) {
return (
@@ -418,7 +439,7 @@ export function ProjectNamespaceControl({
hasMore={hasMore}
inputId={inputId}
isFetchingMore={namespacesPageResult.isFetching}
- namespaces={allNamespaces}
+ namespaces={allNamespacesWithProject}
onChange={onChange}
onFetchMore={onFetchMore}
/>
diff --git a/client/src/features/projectsV2/list/ProjectV2ListDisplay.tsx b/client/src/features/projectsV2/list/ProjectV2ListDisplay.tsx
index 131ce82c3f..dbd704f958 100644
--- a/client/src/features/projectsV2/list/ProjectV2ListDisplay.tsx
+++ b/client/src/features/projectsV2/list/ProjectV2ListDisplay.tsx
@@ -28,7 +28,7 @@ import { RtkOrNotebooksError } from "../../../components/errors/RtkErrorAlert";
import useGroupPermissions from "../../groupsV2/utils/useGroupPermissions.hook";
import PermissionsGuard from "../../permissionsV2/PermissionsGuard";
import { useGetUserQuery } from "../../usersV2/api/users.api";
-import { NamespaceKind } from "../api/namespace.api";
+import { NamespaceKind } from "../api/namespace.enhanced-api";
import { useGetProjectsQuery } from "../api/projectV2.enhanced-api";
import ProjectShortHandDisplay from "../show/ProjectShortHandDisplay";
diff --git a/tests/cypress/e2e/projectV2DataConnectorCredentials.spec.ts b/tests/cypress/e2e/projectV2DataConnectorCredentials.spec.ts
index e158846825..dedb744906 100644
--- a/tests/cypress/e2e/projectV2DataConnectorCredentials.spec.ts
+++ b/tests/cypress/e2e/projectV2DataConnectorCredentials.spec.ts
@@ -45,7 +45,10 @@ describe("Set up data connectors with credentials", () => {
it("set up data connector with failed connection test", () => {
fixtures
.testCloudStorage({ success: false })
- .postDataConnector({ namespace: "user1-uuid", visibility: "public" })
+ .postDataConnector({
+ namespace: "user1-uuid/test-2-v2-project",
+ visibility: "public",
+ })
.postDataConnectorProjectLink({
dataConnectorId: "ULID-5",
})
@@ -85,7 +88,7 @@ describe("Set up data connectors with credentials", () => {
cy.wait("@postDataConnector");
cy.getDataCy("data-connector-edit-body").should(
"contain.text",
- "The data connector user1-uuid/example-storage-without-credentials has been successfully added"
+ "The data connector user1-uuid/test-2-v2-project/example-storage-without-credentials has been successfully added"
);
cy.getDataCy("data-connector-edit-body").should(
"contain.text",
@@ -109,7 +112,10 @@ describe("Set up data connectors with credentials", () => {
it("set up data connector with credentials", () => {
fixtures
.testCloudStorage({ success: true })
- .postDataConnector({ namespace: "user1-uuid", visibility: "public" })
+ .postDataConnector({
+ namespace: "user1-uuid/test-2-v2-project",
+ visibility: "public",
+ })
.postDataConnectorProjectLink({ dataConnectorId: "ULID-5" })
.patchDataConnectorSecrets({
dataConnectorId: "ULID-5",
@@ -161,7 +167,7 @@ describe("Set up data connectors with credentials", () => {
cy.wait("@patchDataConnectorSecrets");
cy.getDataCy("data-connector-edit-body").should(
"contain.text",
- "The data connector user1-uuid/example-storage-with-credentials has been successfully added"
+ "The data connector user1-uuid/test-2-v2-project/example-storage-with-credentials has been successfully added"
);
cy.getDataCy("data-connector-edit-body").should(
"contain.text",
diff --git a/tests/cypress/e2e/projectV2setup.spec.ts b/tests/cypress/e2e/projectV2setup.spec.ts
index ec8bd6abf1..64e1182c2f 100644
--- a/tests/cypress/e2e/projectV2setup.spec.ts
+++ b/tests/cypress/e2e/projectV2setup.spec.ts
@@ -191,7 +191,10 @@ describe("Set up data connectors", () => {
.getDataConnector()
.getStorageSchema({ fixture: "cloudStorage/storage-schema-s3.json" })
.testCloudStorage({ success: false })
- .postDataConnector({ namespace: "user1-uuid", visibility: "public" })
+ .postDataConnector({
+ namespace: "user1-uuid/test-2-v2-project",
+ visibility: "public",
+ })
.postDataConnectorProjectLink({ dataConnectorId: "ULID-5" });
cy.visit("/v2/projects/user1-uuid/test-2-v2-project");
cy.wait("@readProjectV2");
@@ -239,7 +242,7 @@ describe("Set up data connectors", () => {
cy.wait("@postDataConnector");
cy.getDataCy("data-connector-edit-body").should(
"contain.text",
- "The data connector user1-uuid/example-storage-without-credentials has been successfully added"
+ "The data connector user1-uuid/test-2-v2-project/example-storage-without-credentials has been successfully added"
);
cy.getDataCy("data-connector-edit-body").should(
"contain.text",
@@ -342,7 +345,10 @@ describe("Set up data connectors", () => {
.getDataConnector()
.getStorageSchema({ fixture: "cloudStorage/storage-schema-s3.json" })
.testCloudStorage({ success: false })
- .postDataConnector({ namespace: "user1-uuid", visibility: "public" })
+ .postDataConnector({
+ namespace: "user1-uuid/test-2-v2-project",
+ visibility: "public",
+ })
.postDataConnectorProjectLink({ dataConnectorId: "ULID-5" });
cy.visit("/v2/projects/user1-uuid/test-2-v2-project");
cy.wait("@readProjectV2");
@@ -375,7 +381,7 @@ describe("Set up data connectors", () => {
cy.wait("@postDataConnector");
cy.getDataCy("data-connector-edit-body").should(
"contain.text",
- "The data connector user1-uuid/example-storage-without-credentials has been successfully added"
+ "The data connector user1-uuid/test-2-v2-project/example-storage-without-credentials has been successfully added"
);
cy.getDataCy("data-connector-edit-body").should(
"contain.text",