From 0e96d24a10fa7a49a86463fc674d955924f58215 Mon Sep 17 00:00:00 2001 From: ganning127 Date: Sat, 19 Jul 2025 14:13:35 -0700 Subject: [PATCH 1/3] support adding author roles --- airavata-research-portal/src/App.tsx | 19 -- .../src/components/add/ConfirmRepoDetails.tsx | 190 +++++++++--------- .../src/components/home/ResourceCard.tsx | 31 +-- .../components/resources/ResourceDetails.tsx | 17 +- .../Requests/CreateResourceRequest.tsx | 5 +- .../src/interfaces/ResourceAuthor.ts | 12 ++ .../src/interfaces/ResourceType.ts | 12 +- 7 files changed, 144 insertions(+), 142 deletions(-) create mode 100644 airavata-research-portal/src/interfaces/ResourceAuthor.ts diff --git a/airavata-research-portal/src/App.tsx b/airavata-research-portal/src/App.tsx index 4df295780..7e9a503a6 100644 --- a/airavata-research-portal/src/App.tsx +++ b/airavata-research-portal/src/App.tsx @@ -1,22 +1,3 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - import {useColorMode} from "./components/ui/color-mode"; import {Route, Routes, useLocation, useNavigate} from "react-router"; import Home from "./components/home"; diff --git a/airavata-research-portal/src/components/add/ConfirmRepoDetails.tsx b/airavata-research-portal/src/components/add/ConfirmRepoDetails.tsx index 360eda2f9..8ad90c96e 100644 --- a/airavata-research-portal/src/components/add/ConfirmRepoDetails.tsx +++ b/airavata-research-portal/src/components/add/ConfirmRepoDetails.tsx @@ -1,10 +1,11 @@ -import { PrivacyEnum } from "@/interfaces/PrivacyEnum"; -import { CreateResourceRequest } from "@/interfaces/Requests/CreateResourceRequest"; +import {PrivacyEnum} from "@/interfaces/PrivacyEnum"; +import {CreateResourceRequest} from "@/interfaces/Requests/CreateResourceRequest"; import api from "@/lib/api"; -import { CONTROLLER } from "@/lib/controller"; +import {CONTROLLER} from "@/lib/controller"; import { Button, Code, + createListCollection, Field, HStack, Input, @@ -13,11 +14,10 @@ import { Text, Textarea, VStack, - createListCollection, } from "@chakra-ui/react"; -import { toaster } from "../ui/toaster"; -import { useNavigate } from "react-router"; -import { useState } from "react"; +import {toaster} from "../ui/toaster"; +import {useNavigate} from "react-router"; +import {useState} from "react"; const privacyOptions = createListCollection({ items: Object.keys(PrivacyEnum).map((key) => ({ @@ -27,10 +27,10 @@ const privacyOptions = createListCollection({ }); export const ConfirmRepoDetails = ({ - createResourceRequest, - setCreateResourceRequest, - githubUrl, -}: { + createResourceRequest, + setCreateResourceRequest, + githubUrl, + }: { createResourceRequest: CreateResourceRequest; setCreateResourceRequest: (data: CreateResourceRequest) => void; githubUrl: string; @@ -42,8 +42,8 @@ export const ConfirmRepoDetails = ({ try { setLoading(true); await api.post( - `${CONTROLLER.resources}/repository?githubUrl=${githubUrl}`, - createResourceRequest + `${CONTROLLER.resources}/repository?githubUrl=${githubUrl}`, + createResourceRequest ); toaster.create({ @@ -52,7 +52,7 @@ export const ConfirmRepoDetails = ({ type: "success", }); navigate( - "/resources?resourceTypes=REPOSITORY%2CNOTEBOOK%2CDATASET%2CMODEL" + "/resources?resourceTypes=REPOSITORY%2CNOTEBOOK%2CDATASET%2CMODEL" ); } catch (error) { console.error("Error adding repository:", error); @@ -66,87 +66,89 @@ export const ConfirmRepoDetails = ({ } }; + console.log(createResourceRequest); + return ( - <> - - - To make any changes, please modify the cybershuttle.yml{" "} - file in your GitHub repository. - - - Repository Name - - - - Repository URL - - - - Description -