-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add: Added a new message type for the case that a CPE or a CVE cannot…
… be found
- Loading branch information
Showing
4 changed files
with
129 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* Copyright (C) 2018-2022 Greenbone AG | ||
* | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Affero General Public License | ||
* as published by the Free Software Foundation, either version 3 | ||
* of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
import React from 'react'; | ||
|
||
import {isDefined} from 'gmp/utils/identity'; | ||
|
||
import Divider from 'web/components/layout/divider'; | ||
import Layout from 'web/components/layout/layout'; | ||
|
||
import StNonAvailableIcon from 'web/components/icon/stnonavailableicon'; | ||
|
||
import PropTypes from 'web/utils/proptypes'; | ||
|
||
import MessageContainer from './messagecontainer'; | ||
|
||
const Message = ({ | ||
message, | ||
details, | ||
children, | ||
'data-testid': dataTestId, | ||
...props | ||
}) => ( | ||
<MessageContainer data-testid={dataTestId}> | ||
<Divider margin="15px" align={['start', 'start']}> | ||
<StNonAvailableIcon size="medium" /> | ||
<Layout {...props}> | ||
<Divider> | ||
<b data-testid="message">{message}</b> | ||
{isDefined(details) && ( | ||
<span data-testid="message-details">{details}</span> | ||
)} | ||
</Divider> | ||
{children} | ||
</Layout> | ||
</Divider> | ||
</MessageContainer> | ||
); | ||
|
||
Message.propTypes = { | ||
'data-testid': PropTypes.string, | ||
details: PropTypes.string, | ||
message: PropTypes.string, | ||
}; | ||
|
||
export default Message; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* Copyright (C) 2018-2022 Greenbone AG | ||
* | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Affero General Public License | ||
* as published by the Free Software Foundation, either version 3 | ||
* of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
import styled from 'styled-components'; | ||
|
||
import Layout from 'web/components/layout/layout'; | ||
|
||
const MessageContainer = styled(Layout)` | ||
padding: 15px; | ||
margin: 15px 15px 15px 15px; | ||
border: 1px solid; | ||
`; | ||
|
||
export default MessageContainer; | ||
|
||
// vim: set ts=2 sw=2 tw=80: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters