From edb888b10e9234aa34d54b7ca996b03dc1ed86bc Mon Sep 17 00:00:00 2001 From: Andrea Tabone Date: Tue, 19 Sep 2023 12:52:52 +0200 Subject: [PATCH] cleaning Signed-off-by: at670475 --- .../frontend/src/assets/scss/_components.scss | 1 - .../FeedbackButton/FeedbackButton.css | 296 ------------- .../FeedbackButton/FeedbackButton.jsx | 118 ----- .../FeedbackButton/FeedbackButton.test.jsx | 36 -- .../FeedbackButtonContainer.jsx | 22 - .../FeedbackButtonContainer.test.jsx | 36 -- .../FeedbackButton/_feedbackButton.scss | 0 .../components/FeedbackForm/FeedbackForm.jsx | 418 ------------------ .../components/FeedbackForm/FeedbackForm.scss | 79 ---- .../FeedbackForm/FeedbackForm.test.jsx | 36 -- .../frontend/src/components/Footer/Footer.jsx | 261 ++--------- .../frontend/src/components/Header/Header.jsx | 10 +- 12 files changed, 53 insertions(+), 1260 deletions(-) delete mode 100644 api-catalog-ui/frontend/src/components/FeedbackButton/FeedbackButton.css delete mode 100644 api-catalog-ui/frontend/src/components/FeedbackButton/FeedbackButton.test.jsx delete mode 100644 api-catalog-ui/frontend/src/components/FeedbackButton/FeedbackButtonContainer.jsx delete mode 100644 api-catalog-ui/frontend/src/components/FeedbackButton/FeedbackButtonContainer.test.jsx delete mode 100644 api-catalog-ui/frontend/src/components/FeedbackButton/_feedbackButton.scss delete mode 100644 api-catalog-ui/frontend/src/components/FeedbackForm/FeedbackForm.jsx delete mode 100644 api-catalog-ui/frontend/src/components/FeedbackForm/FeedbackForm.scss delete mode 100644 api-catalog-ui/frontend/src/components/FeedbackForm/FeedbackForm.test.jsx diff --git a/api-catalog-ui/frontend/src/assets/scss/_components.scss b/api-catalog-ui/frontend/src/assets/scss/_components.scss index dd072694aa..52b83c5698 100644 --- a/api-catalog-ui/frontend/src/assets/scss/_components.scss +++ b/api-catalog-ui/frontend/src/assets/scss/_components.scss @@ -3,7 +3,6 @@ @import "../../components/Header/header"; @import "../../components/Tile/tile"; @import "../../components/Dashboard/dashboard"; -@import "../../components/FeedbackForm/FeedbackForm"; @import "../../components/Search/search"; @import "../../components/Login/login"; @import "../../components/Spinner/spinner"; diff --git a/api-catalog-ui/frontend/src/components/FeedbackButton/FeedbackButton.css b/api-catalog-ui/frontend/src/components/FeedbackButton/FeedbackButton.css deleted file mode 100644 index 288359896a..0000000000 --- a/api-catalog-ui/frontend/src/components/FeedbackButton/FeedbackButton.css +++ /dev/null @@ -1,296 +0,0 @@ -body { - background-color: #EFEFEF !important; - background-image: none; -} - -a { - text-decoration: none; -} - -#grid-container { - width : 100%; - height: 100%; - justify-items: center; - padding: 0 3rem 3rem 36px; - display: grid; - grid-gap: 20px; - margin-left: auto; - margin-right: auto; -} - -.api-heading { - color: #58606e ; - text-align: center; - font-weight: 440; - margin-top: auto; -} - -#api-heading-id { - /*disabled for Zowe Catalog*/ - display: none; -} - -.info-headers { - display: inline-flex; - font-size: 12px; - margin-left: 39px; -} - -#info-headers-div { - margin-top: -22px; - margin-left: 740px; - margin-bottom: -15px; - float: right; - /*disabled for Zowe Catalog*/ - display: none; -} - -.footer-links { - font-size: 18px; - width: 119px; - flex-direction: column; - line-height: 25px; -} - -.footer-container { - position: relative; - color: black; -} - -#footer-menu-separator { - width: 2px; - height: 202px; - background-color: #1d5bbf; -} - -.links { - color: #000000; - font-size: 14px; -} - -.MuiContainer-root.MuiContainer-maxWidthLg { - display: flex; - flex-direction: column; - align-items: flex-start; - gap: 10px; - width: auto; -} - -.info-headers-footer { - display: flex; - width: 46px; - flex-direction: column; -} - -#col-1 { - display: flex; - flex-direction: column; - align-items: flex-start; - gap: 10px; -} - -.filtering-container { - grid-row: 1; - grid-column: 1/-1; - margin-left: 0; - width: 100%; - justify-items: left; - float: left; - grid-template-columns: 422px; - grid-template-rows: auto auto; -} - -.filtering-container { - float: left; -} - -.MuiInputBase-root.MuiInput-root.MuiInput-underline:before { - border-bottom: none; -} - -.MuiInputBase-root.MuiInput-root.MuiInput-underline:after { - border: none; -} - -.MuiInputBase-root.MuiInput-root.MuiInput-underline:hover:not(.Mui-disabled):before { - border-bottom: none; -} - -#search { - height: 50px; - width: 422px; - margin-top: -20px; - margin-left: auto; - margin-right: auto; - background: #FFFFFF; - border: 1px solid #C9C8C5; -} - -#search .MuiInputBase-root { - width: 100%; -} - -#search-input > svg { - margin-left: 168px; -} - -/* For Firefox */ -@-moz-document url-prefix() { - #search > div > div > div > #search-icon { - margin-left: 125px; - } - #search-input > svg { - margin-left: 125px; - } -} - - -#search_no_results { - color: #1d5bbf; -} - -.no-tiles-container { - margin-left: 2rem; - text-align: left; - overflow: hidden; - width: 100%; -} - -@media only screen and (max-width: 950px) { - #grid-container { - grid-template-columns: auto; - } -} - -@media only screen and (max-width: 530px) { - .filtering-container { - grid-template-columns: 360px; - } - - #grid-container { - grid-template-columns: 360px; - padding-left: 1rem; - padding-right: 1rem; - } -} - -@media only screen and (max-width: 600px) { - .filtering-container { - grid-template-columns: 320px; - } - - #grid-container { - grid-template-columns: 320px; - padding-left: 1rem; - padding-right: 1rem; - } -} - -@media (min-width: 972px) { - .apis { - background-image: url(../../assets/images/background.svg); - } -} - -/* Custom styles for IE10 and above */ -@media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) { - #grid-container { - width : 100%; - height: 100%; - padding: 0 3rem 3rem 36px; - display: flex; - flex-direction: column; - } - - #grid-container > #grid-tile { - margin-bottom: 20px; - } - - .filtering-container { - margin-left: 0; - width: 100%; - justify-items: left; - float: left; - } - - .no-tiles-container { - margin-left: 2rem; - text-align: left; - overflow: hidden; - width: 100%; - } - - @media only screen and (max-width: 530px) { - #grid-container { - padding-left: 1rem; - padding-right: 1rem; - } - } - - @media only screen and (max-width: 600px) { - #grid-container { - padding-left: 1rem; - padding-right: 1rem; - } - } -} - -#dash-buttons { - margin: -48px 140px; - float: right; -} -#dash-buttons > span { - margin-right: 10px; -} - -#refresh-api-button, #onboard-wizard-button, #wizard-done-button, #wizard-cancel-button, #onboard-wizard-button.MuiButton-label, .wizardForm .MuiButton-label, .wizardForm button.MuiButtonBase-root.MuiButton-root.MuiButton-text { - font-size: 16px; - height: 2em; - color: #3272d9; - background-color: #ffffff; - margin-right: 10px; -} - -#refresh-api-button:hover, #onboard-wizard-button:hover, #wizard-done-button:hover, #wizard-cancel-button:hover, #onboard-wizard-button.MuiButton-label:hover, .wizardForm .MuiButton-label:hover, .wizardForm button.MuiButtonBase-root.MuiButton-root.MuiButton-text:hover { - background-color: #F4F7FA; - border: none; -} - -.MuiButton-root, .MuiButton-label, #onboard-wizard-button.MuiButton-label { - text-transform: capitalize; -} - -#separator { - /*disabled for Zowe Catalog*/ - display: none; - background-color: #1d5bbf; - height: 5px; - width: 120px; -} - -#separator2 { - background-color: #1d5bbf; - margin-bottom: auto; - margin-top: auto; - height: 2px; - width: 1096px; - display: block; -} - -#top-right-buttons { - display: contents; -} - -@media only screen and (max-width: 1120px) { - #dash-buttons { - margin: 0; - float: none; - } - #search { - width: auto; - } - #separator2 { - width: 100%; - } -} - diff --git a/api-catalog-ui/frontend/src/components/FeedbackButton/FeedbackButton.jsx b/api-catalog-ui/frontend/src/components/FeedbackButton/FeedbackButton.jsx index 1b8927e77c..567479c4b2 100644 --- a/api-catalog-ui/frontend/src/components/FeedbackButton/FeedbackButton.jsx +++ b/api-catalog-ui/frontend/src/components/FeedbackButton/FeedbackButton.jsx @@ -7,121 +7,3 @@ * * Copyright Contributors to the Zowe Project. */ -import { Fab } from '@material-ui/core'; -import { Component } from 'react'; -import FeedbackImage from '../../assets/images/square-envelope.svg'; -import FeedbackForm from '../FeedbackForm/FeedbackForm'; -import { feedbackService } from '../../feedbackServices'; - -export default class FeedbackButton extends Component { - constructor(props) { - super(props); - this.state = { - isDialogOpen: false, - formToken: '', - }; - this.handleDialogClose = this.handleDialogClose.bind(this); - this.handleDialogOpen = this.handleDialogOpen.bind(this); - } - - handleDialogOpen = () => { - this.setState({ - isDialogOpen: true, - }); - }; - - handleDialogClose = () => { - this.setState({ isDialogOpen: false }); - }; - - componentDidMount() { - feedbackService.getToken().then( - (rsp) => { - // eslint-disable-next-line no-console - console.log(rsp); - this.setState({ formToken: rsp }); - }, - (error) => { - // if (error.messageNumber === 'ZWEAT413E') { - // dispatch(invalidPassword(error)); - // } else if (error.messageNumber === 'ZWEAT412E') { - // dispatch(expiredPassword(error)); - // } else { - // dispatch(failure(error)); - // } - } - ); - } - - // componentWillUnmount() { - // } - - // handleSearch = (value) => { - // }; - - // refreshStaticApis = () => { - // }; - - render() { - const { noFloat, leftPlacement } = this.props; - const { isDialogOpen, formToken } = this.state; - - const submit = (data) => { - // eslint-disable-next-line no-console - console.log('submitting data'); - // eslint-disable-next-line no-console - console.log(data); - feedbackService.submitFeedback().then( - (rsp) => { - // eslint-disable-next-line no-console - console.log(rsp); - }, - (error) => { - // if (error.messageNumber === 'ZWEAT413E') { - // dispatch(invalidPassword(error)); - // } else if (error.messageNumber === 'ZWEAT412E') { - // dispatch(expiredPassword(error)); - // } else { - // dispatch(failure(error)); - // } - } - ); - }; - - return ( -
- {isDialogOpen && ( - - )} -
- { - document.body.classList.remove('mobile-menu-open'); - this.handleDialogOpen(); - }} - > - {noFloat && ( - - )} - Give us Feedback - -
-
- ); - } -} diff --git a/api-catalog-ui/frontend/src/components/FeedbackButton/FeedbackButton.test.jsx b/api-catalog-ui/frontend/src/components/FeedbackButton/FeedbackButton.test.jsx deleted file mode 100644 index 42b1d33fb9..0000000000 --- a/api-catalog-ui/frontend/src/components/FeedbackButton/FeedbackButton.test.jsx +++ /dev/null @@ -1,36 +0,0 @@ -/* - * This program and the accompanying materials are made available under the terms of the - * Eclipse Public License v2.0 which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-v20.html - * - * SPDX-License-Identifier: EPL-2.0 - * - * Copyright Contributors to the Zowe Project. - */ -import { render } from '@testing-library/react'; -import '@testing-library/jest-dom/extend-expect'; -import configureStore from 'redux-mock-store'; -import { Provider } from 'react-redux'; -import FeedbackButton from './FeedbackButton'; - -const mockStore = configureStore(); - -describe('Feedback Button Container', () => { - let store; - let container; - beforeEach(() => { - store = mockStore(); - const history = { - push: jest.fn(), - }; - container = render( - - - - ); - }); - - it('should render the container', () => { - expect(container).not.toBeNull(); - }); -}); diff --git a/api-catalog-ui/frontend/src/components/FeedbackButton/FeedbackButtonContainer.jsx b/api-catalog-ui/frontend/src/components/FeedbackButton/FeedbackButtonContainer.jsx deleted file mode 100644 index b75970900a..0000000000 --- a/api-catalog-ui/frontend/src/components/FeedbackButton/FeedbackButtonContainer.jsx +++ /dev/null @@ -1,22 +0,0 @@ -/* - * This program and the accompanying materials are made available under the terms of the - * Eclipse Public License v2.0 which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-v20.html - * - * SPDX-License-Identifier: EPL-2.0 - * - * Copyright Contributors to the Zowe Project. - */ -import { connect } from 'react-redux'; -import FeedbackButton from './FeedbackButton'; -import { createLoadingSelector } from '../../selectors/selectors'; - -const loadingSelector = createLoadingSelector(['FETCH_TILES']); - -const mapStateToProps = (state) => ({ - isLoading: loadingSelector(state), -}); - -const mapDispatchToProps = {}; - -export default connect(mapStateToProps, mapDispatchToProps)(FeedbackButton); diff --git a/api-catalog-ui/frontend/src/components/FeedbackButton/FeedbackButtonContainer.test.jsx b/api-catalog-ui/frontend/src/components/FeedbackButton/FeedbackButtonContainer.test.jsx deleted file mode 100644 index 24c5b9587d..0000000000 --- a/api-catalog-ui/frontend/src/components/FeedbackButton/FeedbackButtonContainer.test.jsx +++ /dev/null @@ -1,36 +0,0 @@ -/* - * This program and the accompanying materials are made available under the terms of the - * Eclipse Public License v2.0 which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-v20.html - * - * SPDX-License-Identifier: EPL-2.0 - * - * Copyright Contributors to the Zowe Project. - */ -import { render } from '@testing-library/react'; -import '@testing-library/jest-dom/extend-expect'; -import { Provider } from 'react-redux'; -import configureStore from 'redux-mock-store'; -import FeedbackButtonContainer from './FeedbackButtonContainer'; - -const mockStore = configureStore(); - -describe('Feedback Button Container', () => { - let store; - let container; - beforeEach(() => { - store = mockStore(); - const history = { - push: jest.fn(), - }; - container = render( - - - - ); - }); - - it('should render the container', () => { - expect(container).not.toBeNull(); - }); -}); diff --git a/api-catalog-ui/frontend/src/components/FeedbackButton/_feedbackButton.scss b/api-catalog-ui/frontend/src/components/FeedbackButton/_feedbackButton.scss deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/api-catalog-ui/frontend/src/components/FeedbackForm/FeedbackForm.jsx b/api-catalog-ui/frontend/src/components/FeedbackForm/FeedbackForm.jsx deleted file mode 100644 index f802ddcf4f..0000000000 --- a/api-catalog-ui/frontend/src/components/FeedbackForm/FeedbackForm.jsx +++ /dev/null @@ -1,418 +0,0 @@ -/* - * This program and the accompanying materials are made available under the terms of the - * Eclipse Public License v2.0 which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-v20.html - * - * SPDX-License-Identifier: EPL-2.0 - * - * Copyright Contributors to the Zowe Project. - */ -import React from 'react'; -import { Button } from '@material-ui/core'; -import { useForm } from 'react-hook-form'; -import Dialog from '@mui/material/Dialog'; -import DialogContent from '@mui/material/DialogContent'; -import DialogTitle from '@mui/material/DialogTitle'; -import closeIcon from '../../assets/images/xmark.svg'; -import { feedbackService } from '../../feedbackServices'; -import './FeedbackForm.scss'; - -export default function FeedbackForm(props) { - const { - register, - handleSubmit, - formState: { errors }, - } = useForm(); - const formInfo = { - elqFormName: 'FM_281', - elqSiteId: '3805888', - hiddenFormName: 'MSD_FY23_GEN_API-Feedback_0_Contact-Us_MKT_FM_281', - hiddenDivision: 'MSD', - hiddenProductSolution: 'GEN', - }; - const onSubmit = (data) => { - // need to get submission token from https://s3805888.t.eloqua.com/e/formsubmittoken?elqSiteID=3805888 - // save token - // post to https://s3805888.t.eloqua.com/e/f2 - // 3805888 - // form281 - // Couldn't spread on data, copy by hand. - const temp = { - comments1: data.comments1, - firstName: data.firstName, - lastName: data.lastName, - emailAddress: data.emailAddress, - jobTitle: data.jobTitle, - country: data.country, - optIn: 'on', - }; - // Need to get the form token in this object. Maybe pass it via props down? - const combinedData = { ...formInfo, ...temp }; - // eslint-disable-next-line no-console - console.log(combinedData); - props.formSubmission(combinedData); - }; - - const onClose = () => { - props.handleDialog(); - }; - - return ( - - - Feedback Form - {/* Close doesn't work */} - - - - -
-

Do you have feedback for us?

-
- -