diff --git a/src/nextapp/components/publishing-popover/index.ts b/src/nextapp/components/publishing-popover/index.ts new file mode 100644 index 000000000..be17cea1a --- /dev/null +++ b/src/nextapp/components/publishing-popover/index.ts @@ -0,0 +1 @@ +export { default } from './publishing-popover'; diff --git a/src/nextapp/components/publishing-popover/publishing-popover.tsx b/src/nextapp/components/publishing-popover/publishing-popover.tsx new file mode 100644 index 000000000..23fc46a5b --- /dev/null +++ b/src/nextapp/components/publishing-popover/publishing-popover.tsx @@ -0,0 +1,120 @@ +import * as React from 'react'; +import { + Icon, + Text, + Link, + Flex, + Center, + Popover, + PopoverTrigger, + PopoverContent, + PopoverBody, + PopoverArrow, +} from '@chakra-ui/react'; +import { FaClock, FaMinusCircle, FaCheckCircle } from 'react-icons/fa'; + +interface PublishingPopoverProps { + status: string; +} + +const PublishingPopover: React.FC = ({ status }) => { + return ( + <> + {status === 'disabled' && ( + + +
+ + + Publishing disabled + +
+
+ + + + + + + Publishing disabled + + + + This means you still don't have permission to publish to the API + directory any API contained in this gateway. Request publishing + permission by{' '} + + adding an organization + {' '} + to your gateway. + + + +
+ )} + {status === 'pending' && ( + + +
+ + + Pending publishing permission + +
+
+ + + + + + + Pending publishing permission + + + + This means you submitted a request to enable publishing + permission and is pending your Organization Administrator + approval. + + + +
+ )} + {status === 'enabled' && ( + + +
+ + + Publishing enabled + +
+
+ + + + + + + Publishing enabled + + + + This means you are now allowed to publish to the API directory + any API contained in this gateway, so others can find and access + them. + + + +
+ )} + + ); +}; + +export default PublishingPopover; diff --git a/src/nextapp/pages/manager/gateways/index.tsx b/src/nextapp/pages/manager/gateways/index.tsx index 4466e79d6..c0027771f 100644 --- a/src/nextapp/pages/manager/gateways/index.tsx +++ b/src/nextapp/pages/manager/gateways/index.tsx @@ -10,21 +10,12 @@ import { Button, Flex, Spacer, - Center, useToast, Select, } from '@chakra-ui/react'; import Head from 'next/head'; import { gql } from 'graphql-request'; -import { - FaPlus, - FaLaptopCode, - FaRocket, - FaServer, - FaClock, - FaMinusCircle, - FaCheckCircle, -} from 'react-icons/fa'; +import { FaPlus, FaLaptopCode, FaRocket, FaServer } from 'react-icons/fa'; import { useQueryClient } from 'react-query'; import PageHeader from '@/components/page-header'; @@ -34,6 +25,7 @@ import { restApi, useApi } from '@/shared/services/api'; import NamespaceManager from '@/components/namespace-manager/namespace-manager'; import { Namespace } from '@/shared/types/query.types'; import SearchInput from '@/components/search-input'; +import PublishingPopover from '@/components/publishing-popover'; type GatewayActions = { title: string; @@ -275,39 +267,15 @@ const MyGatewaysPage: React.FC = () => { - {namespace.orgEnabled === false && !namespace.orgUpdatedAt && ( -
- - - Publishing disabled - -
- )} + {namespace.orgEnabled === false && + !namespace.orgUpdatedAt && ( + + )} {namespace.orgEnabled === false && namespace.orgUpdatedAt && ( -
- - - Pending publishing permission - -
+ )} {namespace.orgEnabled === true && ( -
- - - Publishing enabled - -
+ )} ))}