From 6d0faaa30ae7104593a19e54c8061ade9445caa4 Mon Sep 17 00:00:00 2001 From: Tharanidk Date: Fri, 28 Feb 2025 16:20:18 +0530 Subject: [PATCH 1/2] fix bugs of design assistant --- .../CreateAPIWithAI/components/AlertDialog.tsx | 2 +- .../components/ApiChatResponse.tsx | 15 +++------------ .../Listing/Landing/Menus/DesignAssistantMenu.jsx | 7 ------- .../Apis/Listing/components/TopMenu.jsx | 5 +++-- 4 files changed, 7 insertions(+), 22 deletions(-) diff --git a/portals/publisher/src/main/webapp/source/src/app/components/Apis/Create/CreateAPIWithAI/components/AlertDialog.tsx b/portals/publisher/src/main/webapp/source/src/app/components/Apis/Create/CreateAPIWithAI/components/AlertDialog.tsx index 091a25e3fe3..8c6815e63b1 100644 --- a/portals/publisher/src/main/webapp/source/src/app/components/Apis/Create/CreateAPIWithAI/components/AlertDialog.tsx +++ b/portals/publisher/src/main/webapp/source/src/app/components/Apis/Create/CreateAPIWithAI/components/AlertDialog.tsx @@ -218,7 +218,7 @@ const AlertDialog: React.FC = ({loading = false, taskStatus, s variant="contained" onClick={handleCreate} sx={{ marginRight: '10px', minWidth: '120px', height: '35px', display: 'flex', gap:1, alignItems: 'center'}} - disabled={loading || taskStatus == ''} + disabled={loading || taskStatus === '' || spec === ''} > {intl.formatMessage({ id: 'Apis.Create.Default.APICreateDefault.create.btn', diff --git a/portals/publisher/src/main/webapp/source/src/app/components/Apis/Create/CreateAPIWithAI/components/ApiChatResponse.tsx b/portals/publisher/src/main/webapp/source/src/app/components/Apis/Create/CreateAPIWithAI/components/ApiChatResponse.tsx index 4b5a62f7db1..da54dce320f 100644 --- a/portals/publisher/src/main/webapp/source/src/app/components/Apis/Create/CreateAPIWithAI/components/ApiChatResponse.tsx +++ b/portals/publisher/src/main/webapp/source/src/app/components/Apis/Create/CreateAPIWithAI/components/ApiChatResponse.tsx @@ -16,22 +16,13 @@ * specific language governing permissions and limitations * under the License. */ -import React, { useEffect, useState } from 'react'; -import { FormattedMessage, useIntl } from 'react-intl'; -import Accordion from '@mui/material/Accordion'; -import AccordionSummary from '@mui/material/AccordionSummary'; -import AccordionDetails from '@mui/material/AccordionDetails'; -import Tooltip from '@mui/material/Tooltip'; -import Grid from '@mui/material/Grid'; -import CheckCircleIcon from '@mui/icons-material/CheckCircle'; -import DangerousIcon from '@mui/icons-material/Dangerous'; -import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; +import React, { useState } from 'react'; +import { useIntl } from 'react-intl'; import AccountCircleIcon from '@mui/icons-material/AccountCircle'; import Box from '@mui/material/Box'; import { styled, alpha } from '@mui/material/styles'; -import { CircularProgress, Typography } from '@mui/material'; +import { Typography } from '@mui/material'; import xmlFormat from 'xml-formatter'; -import Utils from 'AppData/Utils'; import CustomizedAccordions from './CustomizedAccordions'; import Button from '@mui/material/Button'; import AutoAwesomeIcon from '@mui/icons-material/AutoAwesome'; diff --git a/portals/publisher/src/main/webapp/source/src/app/components/Apis/Listing/Landing/Menus/DesignAssistantMenu.jsx b/portals/publisher/src/main/webapp/source/src/app/components/Apis/Listing/Landing/Menus/DesignAssistantMenu.jsx index 4af2cac858d..889c52a70ea 100644 --- a/portals/publisher/src/main/webapp/source/src/app/components/Apis/Listing/Landing/Menus/DesignAssistantMenu.jsx +++ b/portals/publisher/src/main/webapp/source/src/app/components/Apis/Listing/Landing/Menus/DesignAssistantMenu.jsx @@ -1,4 +1,3 @@ -/* eslint-disable */ /* * Copyright (c) 2025, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. * @@ -24,12 +23,6 @@ import { app } from 'Settings'; import { isRestricted } from 'AppData/AuthManager'; import { styled } from '@mui/material/styles'; -const PREFIX = 'DesignAssistantMenu'; - -const classes = { - root: `${PREFIX}-root`, -}; - const StyledBox = styled(Box)(({ theme }) => ({ [`&`]: { display: 'flex', diff --git a/portals/publisher/src/main/webapp/source/src/app/components/Apis/Listing/components/TopMenu.jsx b/portals/publisher/src/main/webapp/source/src/app/components/Apis/Listing/components/TopMenu.jsx index b81a945a714..8b55388d6ac 100644 --- a/portals/publisher/src/main/webapp/source/src/app/components/Apis/Listing/components/TopMenu.jsx +++ b/portals/publisher/src/main/webapp/source/src/app/components/Apis/Listing/components/TopMenu.jsx @@ -192,7 +192,7 @@ function TopMenu(props) { /> )} - {/* Button to Create API with AI */} + {!query && !isAPIProduct && ( + + )} {showToggle && ( From 0d7b1f7519a77a95bfd6e4563a72695536e60201 Mon Sep 17 00:00:00 2001 From: Tharanidk Date: Fri, 28 Feb 2025 16:25:27 +0530 Subject: [PATCH 2/2] fix indentation issue --- .../Apis/Listing/components/TopMenu.jsx | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/portals/publisher/src/main/webapp/source/src/app/components/Apis/Listing/components/TopMenu.jsx b/portals/publisher/src/main/webapp/source/src/app/components/Apis/Listing/components/TopMenu.jsx index 8b55388d6ac..e5a76b1aac6 100644 --- a/portals/publisher/src/main/webapp/source/src/app/components/Apis/Listing/components/TopMenu.jsx +++ b/portals/publisher/src/main/webapp/source/src/app/components/Apis/Listing/components/TopMenu.jsx @@ -193,24 +193,24 @@ function TopMenu(props) { )} {!query && !isAPIProduct && ( - + )} {showToggle && (