-
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.
Merge pull request #4150 from greenbone/Add-Appliance-logo-in-the-app…
…-header Add: Appliance logo in the app header and page title - opensight
- Loading branch information
Showing
25 changed files
with
710 additions
and
34 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,35 @@ | ||
/* SPDX-FileCopyrightText: 2024 Greenbone AG | ||
* | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
*/ | ||
|
||
import SvgIconWrapper from './SvgIconWrapper'; | ||
import Enterprise150Svg from 'web/components/icon/svg/Enterprise_150.svg'; | ||
import Enterprise400Svg from 'web/components/icon/svg/Enterprise_400.svg'; | ||
import Enterprise450Svg from 'web/components/icon/svg/Enterprise_450.svg'; | ||
import Enterprise600Svg from 'web/components/icon/svg/Enterprise_600.svg'; | ||
import Enterprise650Svg from 'web/components/icon/svg/Enterprise_650.svg'; | ||
import Enterprise5400Svg from 'web/components/icon/svg/Enterprise_5400.svg'; | ||
import Enterprise6500Svg from 'web/components/icon/svg/Enterprise_6500.svg'; | ||
import EnterpriseCenoSvg from 'web/components/icon/svg/Enterprise_CENO.svg'; | ||
import EnterpriseDecaSvg from 'web/components/icon/svg/Enterprise_DECA.svg'; | ||
import EnterpriseExaSvg from 'web/components/icon/svg/Enterprise_EXA.svg'; | ||
import EnterprisePetaSvg from 'web/components/icon/svg/Enterprise_PETA.svg'; | ||
import EnterpriseTeraSvg from 'web/components/icon/svg/Enterprise_TERA.svg'; | ||
|
||
const createEnterpriseComponent = Component => () => ( | ||
<SvgIconWrapper size={['150px', '150px']} component={Component} /> | ||
); | ||
|
||
export const Enterprise150 = createEnterpriseComponent(Enterprise150Svg); | ||
export const Enterprise400 = createEnterpriseComponent(Enterprise400Svg); | ||
export const Enterprise450 = createEnterpriseComponent(Enterprise450Svg); | ||
export const Enterprise600 = createEnterpriseComponent(Enterprise600Svg); | ||
export const Enterprise650 = createEnterpriseComponent(Enterprise650Svg); | ||
export const Enterprise5400 = createEnterpriseComponent(Enterprise5400Svg); | ||
export const Enterprise6500 = createEnterpriseComponent(Enterprise6500Svg); | ||
export const EnterpriseCeno = createEnterpriseComponent(EnterpriseCenoSvg); | ||
export const EnterpriseDeca = createEnterpriseComponent(EnterpriseDecaSvg); | ||
export const EnterpriseExa = createEnterpriseComponent(EnterpriseExaSvg); | ||
export const EnterprisePeta = createEnterpriseComponent(EnterprisePetaSvg); | ||
export const EnterpriseTera = createEnterpriseComponent(EnterpriseTeraSvg); |
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,23 @@ | ||
/* SPDX-FileCopyrightText: 2024 Greenbone AG | ||
* | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
*/ | ||
|
||
import PropTypes from 'web/utils/proptypes'; | ||
import SvgIcon from './svgicon'; | ||
|
||
const SvgIconWrapper = ({component: Component, size, ...props}) => ( | ||
<SvgIcon size={size} {...props}> | ||
{svgProps => <Component {...svgProps} />} | ||
</SvgIcon> | ||
); | ||
|
||
SvgIconWrapper.propTypes = { | ||
component: PropTypes.node.isRequired, | ||
size: PropTypes.oneOfType([ | ||
PropTypes.oneOf(['tiny', 'small', 'medium', 'large']), | ||
PropTypes.string, | ||
]), | ||
}; | ||
|
||
export default SvgIconWrapper; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 0 additions & 3 deletions
3
src/web/components/layout/__tests__/__snapshots__/pagetitle.jsx.snap
This file was deleted.
Oops, something went wrong.
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
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,39 @@ | ||
/* SPDX-FileCopyrightText: 2024 Greenbone AG | ||
* | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
*/ | ||
|
||
import {describe, test, expect} from '@gsa/testing'; | ||
import {render} from 'web/utils/testing'; | ||
import getLogo from 'web/components/structure/getLogo'; | ||
|
||
describe('getLogo', () => { | ||
const testCases = [ | ||
['gsm-150_label.svg', 'Enterprise150'], | ||
['gsm-400_label.svg', 'Enterprise400'], | ||
['gsm-400r2_label.svg', 'Enterprise400'], | ||
['gsm-450_label.svg', 'Enterprise450'], | ||
['gsm-450r2_label.svg', 'Enterprise450'], | ||
['gsm-600_label.svg', 'Enterprise600'], | ||
['gsm-600r2_label.svg', 'Enterprise600'], | ||
['gsm-650_label.svg', 'Enterprise650'], | ||
['gsm-650r2_label.svg', 'Enterprise650'], | ||
['gsm-5400_label.svg', 'Enterprise5400'], | ||
['gsm-6500_label.svg', 'Enterprise6500'], | ||
['gsm-ceno_label.svg', 'EnterpriseCeno'], | ||
['gsm-deca_label.svg', 'EnterpriseDeca'], | ||
['gsm-exa_label.svg', 'EnterpriseExa'], | ||
['gsm-peta_label.svg', 'EnterprisePeta'], | ||
['gsm-tera_label.svg', 'EnterpriseTera'], | ||
]; | ||
|
||
test.each(testCases)('returns %s for %s', (model, expectedTestId) => { | ||
const {getByTestId} = render(getLogo(model)); | ||
expect(getByTestId(expectedTestId)).toBeInTheDocument(); | ||
}); | ||
|
||
test('returns undefined for unknown model', () => { | ||
const result = getLogo('unknown_model.svg'); | ||
expect(result).toBeUndefined(); | ||
}); | ||
}); |
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,36 @@ | ||
/* SPDX-FileCopyrightText: 2024 Greenbone AG | ||
* | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
*/ | ||
|
||
import PropTypes from 'web/utils/proptypes'; | ||
|
||
import {applianceComponent} from 'web/utils/applianceData'; | ||
|
||
const getLogo = model => { | ||
const Component = applianceComponent[model]; | ||
return Component ? <Component /> : undefined; | ||
}; | ||
|
||
getLogo.propTypes = { | ||
model: PropTypes.oneOf([ | ||
'gsm-150_label.svg', | ||
'gsm-400_label.svg', | ||
'gsm-400r2_label.svg', | ||
'gsm-450_label.svg', | ||
'gsm-450r2_label.svg', | ||
'gsm-600_label.svg', | ||
'gsm-600r2_label.svg', | ||
'gsm-650_label.svg', | ||
'gsm-650r2_label.svg', | ||
'gsm-5400_label.svg', | ||
'gsm-6500_label.svg', | ||
'gsm-ceno_label.svg', | ||
'gsm-deca_label.svg', | ||
'gsm-exa_label.svg', | ||
'gsm-peta_label.svg', | ||
'gsm-tera_label.svg', | ||
]), | ||
}; | ||
|
||
export default getLogo; |
Oops, something went wrong.