Skip to content

Commit

Permalink
feat: refactor create new project to use rtk
Browse files Browse the repository at this point in the history
  • Loading branch information
andre-code committed Dec 8, 2022
1 parent 8a7ffd3 commit 3a52f26
Show file tree
Hide file tree
Showing 9 changed files with 233 additions and 226 deletions.
4 changes: 4 additions & 0 deletions client/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import { AddDataset } from "./dataset/addtoproject/DatasetAdd.container";
import { DatasetCoordinator } from "./dataset/Dataset.state";
import AppContext from "./utils/context/appContext";
import { setupWebSocket } from "./websocket";
import { NewProjectCoordinator } from "./project/new/ProjectNew.state";

export const ContainerWrap = ({ children, fullSize = false }) => {
const classContainer = !fullSize ? "container-xxl py-4 mt-2 renku-container" : "w-100";
Expand Down Expand Up @@ -113,6 +114,9 @@ function CentralContentContainer(props) {
key="newProject"
model={props.model}
user={props.user}
coordinator={
new NewProjectCoordinator(
props.client, props.model.subModel("newProject"), props.model.subModel("projects"))}
{...p}
/></ContainerWrap>}
/>
Expand Down
2 changes: 2 additions & 0 deletions client/src/dataset/addtoproject/addDatasetNewProject.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { NewProject } from "../../project/new";
import { Loader } from "../../utils/components/Loader";
import { WarnAlert } from "../../utils/components/Alert";
import AppContext from "../../utils/context/appContext";
import { NewProjectCoordinator } from "../../project/new/ProjectNew.state";

/**
* incubator-renku-ui
Expand Down Expand Up @@ -86,6 +87,7 @@ const AddDatasetNewProject = (
importingDataset={true}
startImportDataset={startImportDataset}
user={user}
coordinator={new NewProjectCoordinator(client, model.subModel("newProject"), model.subModel("projects"))}
/>
);

Expand Down
2 changes: 1 addition & 1 deletion client/src/features/projects/ProjectApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const projectApi = createApi({
baseQuery: fetchBaseQuery({ baseUrl: "/ui-server/api" }),
endpoints: (builder) => ({
getNamespaces: builder.query({
query: (arg) => ({ url: "/namespaces", method: "GET" }),
query: (ownerOnly?: boolean) => ({ url: `/namespaces${ownerOnly ? "?owned_only=true" : ""}`, method: "GET" }),
}),
getGroupByPath: builder.query<any, string>({
query: (projectPath) => {
Expand Down
Loading

0 comments on commit 3a52f26

Please sign in to comment.