This is an automated email from the ASF dual-hosted git repository.

ganning pushed a commit to branch resource-approval
in repository https://gitbox.apache.org/repos/asf/airavata-portals.git

commit ec494f80bfaf98488d582950c4effcdee721dfc2
Merge: 34d41d03b 0e96d24a1
Author: ganning127 <[email protected]>
AuthorDate: Sat Aug 9 23:35:30 2025 -0400

    Merge branch 'author-roles' of https://github.com/apache/airavata-portals 
into resource-approval

 airavata-research-portal/src/App.tsx               |  19 ---
 .../src/components/add/ConfirmRepoDetails.tsx      | 190 +++++++++++----------
 .../src/components/home/ResourceCard.tsx           |  31 ++--
 .../src/components/resources/ResourceDetails.tsx   |  17 +-
 .../interfaces/Requests/CreateResourceRequest.tsx  |   5 +-
 .../src/interfaces/ResourceAuthor.ts               |  12 ++
 .../src/interfaces/ResourceType.ts                 |  12 +-
 7 files changed, 145 insertions(+), 141 deletions(-)

diff --cc airavata-research-portal/src/components/resources/ResourceDetails.tsx
index 0ea38ba0d,b293a5e56..1ddd72e18
--- a/airavata-research-portal/src/components/resources/ResourceDetails.tsx
+++ b/airavata-research-portal/src/components/resources/ResourceDetails.tsx
@@@ -43,21 -43,18 +43,22 @@@ import 
    RepositoryResource,
    Resource,
  } from "@/interfaces/ResourceType";
 -import {Tag} from "@/interfaces/TagType";
 -import {isValidImaage, resourceTypeToColor} from "@/lib/util";
 -import {ResourceTypeBadge} from "./ResourceTypeBadge";
 -import {ResourceTypeEnum} from "@/interfaces/ResourceTypeEnum";
 -import {ModelSpecificBox} from "../models/ModelSpecificBox";
 -import {NotebookSpecificDetails} from "../notebooks/NotebookSpecificDetails";
 -import {RepositorySpecificDetails} from 
"../repositories/RepositorySpecificDetails";
 -import {CONTROLLER} from "@/lib/controller";
 -import {DatasetSpecificDetails} from "../datasets/DatasetSpecificDetails";
 -import {ResourceOptions} from "@/components/resources/ResourceOptions.tsx";
 -import {toaster} from "@/components/ui/toaster.tsx";
 -import {ResourceAuthor} from "@/interfaces/ResourceAuthor.ts";
 +import { Tag } from "@/interfaces/TagType";
 +import { isValidImaage, resourceTypeToColor } from "@/lib/util";
 +import { ResourceTypeBadge } from "./ResourceTypeBadge";
 +import { ResourceTypeEnum } from "@/interfaces/ResourceTypeEnum";
 +import { ModelSpecificBox } from "../models/ModelSpecificBox";
 +import { NotebookSpecificDetails } from 
"../notebooks/NotebookSpecificDetails";
 +import { RepositorySpecificDetails } from 
"../repositories/RepositorySpecificDetails";
 +import { CONTROLLER } from "@/lib/controller";
 +import { DatasetSpecificDetails } from "../datasets/DatasetSpecificDetails";
 +import { ResourceOptions } from "@/components/resources/ResourceOptions.tsx";
 +import { toaster } from "@/components/ui/toaster.tsx";
 +import { PrivacyEnum } from "@/interfaces/PrivacyEnum.ts";
 +import { PrivateResourceTooltip } from 
"@/components/resources/PrivateResourceTooltip.tsx";
 +import { useAuth } from "react-oidc-context";
 +import { ResourceVerification } from "./ResourceVerification";
++import { ResourceAuthor } from "@/interfaces/ResourceAuthor.ts";
  
  async function getResource(id: string) {
    const response = await api.get(`${CONTROLLER.resources}/public/${id}`);
@@@ -107,147 -104,138 +108,149 @@@ const ResourceDetails = () => 
  
    const goToResources = () => {
      navigate(
 -        "/resources?resourceTypes=REPOSITORY%2CNOTEBOOK%2CDATASET%2CMODEL"
 -    )
 -  }
 +      "/resources?resourceTypes=REPOSITORY%2CNOTEBOOK%2CDATASET%2CMODEL"
 +    );
 +  };
  
    return (
 -      <>
 -        <Container maxW="breakpoint-lg" mx="auto" p={4} mt={16}>
 -          <Box>
 -            <Button
 -                variant="plain"
 -                p={0}
 -                onClick={goToResources}
 -            >
 -              <HStack
 -                  alignItems="center"
 -                  mb={4}
 -                  display="inline-flex"
 -                  _hover={{
 -                    bg: "gray.300",
 -                  }}
 -                  p={1}
 -                  rounded="md"
 -              >
 -                <Icon>
 -                  <BiArrowBack/>
 -                </Icon>
 -                Back
 -              </HStack>
 -            </Button>
 -          </Box>
 -
 -          <HStack
 -              alignItems={"flex-start"}
 +    <>
 +      <Container maxW="breakpoint-lg" mx="auto" p={4} mt={16}>
 +        <Box>
 +          <Button variant="plain" p={0} onClick={goToResources}>
 +            <HStack
 +              alignItems="center"
                mb={4}
 -              gap={8}
 -              justifyContent="space-between"
 -          >
 -            <Box w={'full'}>
 -              <ResourceTypeBadge type={resource.type}/>
 +              display="inline-flex"
 +              _hover={{
 +                bg: "gray.300",
 +              }}
 +              p={1}
 +              rounded="md"
 +            >
 +              <Icon>
 +                <BiArrowBack />
 +              </Icon>
 +              Back
 +            </HStack>
 +          </Button>
 +        </Box>
  
 -              <HStack mt={2} justifyContent={'space-between'} 
alignItems={'center'} flexWrap={'wrap'}>
 -                <Heading as="h1" size="4xl">
 -                  {resource.name}
 -                </Heading>
 +        <HStack
 +          alignItems={"flex-start"}
 +          mb={4}
 +          gap={8}
 +          justifyContent="space-between"
 +        >
 +          <Box w={"full"}>
 +            <HStack gap={2} flexWrap="wrap">
 +              <ResourceTypeBadge type={resource.type} />
 +              <ResourceVerification
 +                resource={resource}
 +                setResource={setResource}
 +              />
 +            </HStack>
 +            <HStack
 +              mt={1}
 +              justifyContent={"space-between"}
 +              alignItems={"center"}
 +              flexWrap={"wrap"}
 +            >
 +              <Heading as="h1" size="4xl">
 +                {resource.name}
 +              </Heading>
  
 +              <HStack>
 +                {resource.privacy === PrivacyEnum.PRIVATE && (
 +                  <PrivateResourceTooltip />
 +                )}
                  <ResourceOptions
 -                    resource={resource}
 -                    onDeleteSuccess={goToResources}
 -                    deleteable={true}
 -                    onUnStarSuccess={() => {
 -                    }}
 +                  resource={resource}
 +                  onDeleteSuccess={goToResources}
 +                  deleteable={true}
 +                  onUnStarSuccess={() => {}}
                  />
 -
                </HStack>
 +            </HStack>
  
 -              <HStack mt={2}>
 -                {resource.tags.map((tag: Tag) => (
 -                    <Badge
 -                        key={tag.id}
 -                        size="lg"
 -                        rounded="md"
 -                        colorPalette={resourceTypeToColor(resource.type)}
 -                    >
 -                      {tag.value}
 -                    </Badge>
 -                ))}
 -              </HStack>
 +            <HStack mt={2}>
 +              {resource.tags.map((tag: Tag) => (
 +                <Badge
 +                  key={tag.id}
 +                  size="lg"
 +                  rounded="md"
 +                  colorPalette={resourceTypeToColor(resource.type)}
 +                >
 +                  {tag.value}
 +                </Badge>
 +              ))}
 +            </HStack>
  
-             <HStack mt={8}>
-               {resource.authors.map((author: string) => {
 -              <HStack mt={8} wrap={'wrap'}>
 -                {resource.authors.map((author: ResourceAuthor) => {
 -                  return (
 -                      <HStack>
 -                        <Avatar.Root shape="full" size="xs">
 -                          <Avatar.Fallback name={author.authorId}/>
 -                          <Avatar.Image src={author.authorId}/>
 -                        </Avatar.Root>
 -
 -                        <Box>
 -                          <Text fontWeight="bold" 
fontSize={'sm'}>{author.authorId}</Text>
 -                        </Box>
 -                      </HStack>
 -                  )
 -                })}
 -              </HStack>
 -            </Box>
 -
 -            <Box>
 -              {validImage && (
 -                  <Image
 -                      src={resource.headerImage}
 -                      alt="Notebook Header"
 -                      rounded="md"
 -                      maxW="300px"
 -                  />
 -              )}
 -            </Box>
 -          </HStack>
 -
 -          <Separator my={6}/>
 -          <Box>
 -            <Heading fontWeight="bold" size="2xl">
 -              About
 -            </Heading>
++            <HStack mt={8} wrap={"wrap"}>
++              {resource.authors.map((author: ResourceAuthor) => {
 +                return (
-                   <HStack key={author}>
-                     <Avatar.Root shape="full" size="xl">
-                       <Avatar.Fallback name={author} />
-                       <Avatar.Image src={author} />
++                  <HStack>
++                    <Avatar.Root shape="full" size="xs">
++                      <Avatar.Fallback name={author.authorId} />
++                      <Avatar.Image src={author.authorId} />
 +                    </Avatar.Root>
  
 -            <Text>{resource.description}</Text>
 +                    <Box>
-                       <Text fontWeight="bold">{author}</Text>
++                      <Text fontWeight="bold" fontSize={"sm"}>
++                        {author.authorId}
++                      </Text>
 +                    </Box>
 +                  </HStack>
 +                );
 +              })}
 +            </HStack>
            </Box>
  
 -          <Separator my={8}/>
 -
            <Box>
 -            {(resource.type as ResourceTypeEnum) ===
 -                ResourceTypeEnum.REPOSITORY && (
 -                    <RepositorySpecificDetails
 -                        repository={resource as RepositoryResource}
 -                    />
 -                )}
 -
 -            {(resource.type as ResourceTypeEnum) === ResourceTypeEnum.DATASET 
&& (
 -                <DatasetSpecificDetails dataset={resource as 
DatasetResource}/>
 +            {validImage && (
 +              <Image
 +                src={resource.headerImage}
 +                alt="Notebook Header"
 +                rounded="md"
 +                maxW="300px"
 +              />
              )}
 +          </Box>
 +        </HStack>
  
 -            {(resource.type as ResourceTypeEnum) === ResourceTypeEnum.MODEL 
&& (
 -                <ModelSpecificBox model={resource as ModelResource}/>
 -            )}
 +        <Separator my={6} />
 +        <Box>
 +          <Heading fontWeight="bold" size="2xl">
 +            About
 +          </Heading>
  
 -            {(resource.type as ResourceTypeEnum) ===
 -                ResourceTypeEnum.NOTEBOOK && (
 -                    <NotebookSpecificDetails notebook={resource as 
NotebookResource}/>
 -                )}
 -          </Box>
 -        </Container>
 -      </>
 +          <Text>{resource.description}</Text>
 +        </Box>
 +
 +        <Separator my={8} />
 +
 +        <Box>
 +          {(resource.type as ResourceTypeEnum) ===
 +            ResourceTypeEnum.REPOSITORY && (
 +            <RepositorySpecificDetails
 +              repository={resource as RepositoryResource}
 +            />
 +          )}
 +
 +          {(resource.type as ResourceTypeEnum) === ResourceTypeEnum.DATASET 
&& (
 +            <DatasetSpecificDetails dataset={resource as DatasetResource} />
 +          )}
 +
 +          {(resource.type as ResourceTypeEnum) === ResourceTypeEnum.MODEL && (
 +            <ModelSpecificBox model={resource as ModelResource} />
 +          )}
 +
 +          {(resource.type as ResourceTypeEnum) ===
 +            ResourceTypeEnum.NOTEBOOK && (
 +            <NotebookSpecificDetails notebook={resource as NotebookResource} 
/>
 +          )}
 +        </Box>
 +      </Container>
 +    </>
    );
  };
  

Reply via email to