-
Notifications
You must be signed in to change notification settings - Fork 993
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #21737 - move about page to react
- Loading branch information
Showing
33 changed files
with
925 additions
and
155 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
module AboutHelper | ||
def plugins | ||
@plugins.map do |plugin| | ||
{:name => {name: plugin.name, url: plugin.url}, :description => plugin.description, | ||
:author => plugin.author, :version => plugin.version } | ||
end | ||
end | ||
|
||
def proxies | ||
@smart_proxies.map do |proxy| | ||
{:id => {:name => proxy.name, :id => proxy.id}, | ||
:features => proxy.features.map(&:name).to_sentence} | ||
end | ||
end | ||
|
||
def providers | ||
nil unless SETTINGS[:unattended] | ||
@providers.map do |provider| | ||
{:provider => provider[:friendly_name], | ||
:status => provider[:status] == :installed} | ||
end | ||
end | ||
|
||
def compute_resources | ||
nil unless SETTINGS[:unattended] | ||
@compute_resources.map do |compute| | ||
{:id => {:name => compute.name, :id => compute.id}, | ||
:type => compute.provider_friendly_name} | ||
end | ||
end | ||
|
||
def about_data | ||
{:compute => compute_resources, :proxy => proxies, :plugin => plugins, :provider => providers } | ||
end | ||
end |
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
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
32 changes: 32 additions & 0 deletions
32
webpack/assets/javascripts/react_app/common/EmptyStates.js
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,32 @@ | ||
export const computeResource = () => ({ | ||
header: __('Compute Resource'), | ||
description: __('Foreman supports creating and managing hosts on a number of virtualization and cloud services - referred to as “compute resources” - as well as bare metal hosts.'), | ||
// eslint-disable-next-line no-undef | ||
docUrl: `https://www.theforeman.org/manuals/${VERSION}/index.html#5.2ComputeResources`, | ||
action: { | ||
title: __('Create a compute resource'), | ||
url: '/compute_resources/new', | ||
}, | ||
}); | ||
|
||
export const plugin = () => ({ | ||
header: __('Plugin'), | ||
description: __('Plugins are tools to extend and modify the functionality of Foreman. Plugins offer custom functions and features so that each user can tailor their environment to their specific needs.'), | ||
// eslint-disable-next-line no-undef | ||
docUrl: `https://www.theforeman.org/manuals/${VERSION}/index.html#Plugins`, | ||
action: { | ||
title: __('Get a plugin'), | ||
url: 'https://projects.theforeman.org/projects/foreman/wiki/List_of_Plugins', | ||
}, | ||
}); | ||
|
||
export const smartProxy = () => ({ | ||
header: __('Smart Proxy'), | ||
description: __('The Smart Proxy provides an easy way to add or extended existing subsystems, via DHCP, DNS, Puppet, etc.'), | ||
// eslint-disable-next-line no-undef | ||
docUrl: `https://www.theforeman.org/manuals/${VERSION}/index.html#Smart-Proxy`, | ||
action: { | ||
title: __('Create a smart proxy'), | ||
url: '/smart_proxies/new', | ||
}, | ||
}); |
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
95 changes: 95 additions & 0 deletions
95
webpack/assets/javascripts/react_app/components/about/__snapshots__/about.test.js.snap
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,95 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`about page should render 1`] = ` | ||
<TabsWrapper | ||
id="about_tabs" | ||
tabs={ | ||
Array [ | ||
"Smart Proxies", | ||
"Available Providers", | ||
"Compute Resources", | ||
"Plugins", | ||
] | ||
} | ||
> | ||
<AboutProxyTable | ||
data={ | ||
Array [ | ||
Object { | ||
"features": "Facts, Logs, DNS, DHCP, and Puppet", | ||
"id": Object { | ||
"id": 1, | ||
"name": "regular", | ||
}, | ||
}, | ||
] | ||
} | ||
/> | ||
<AboutProviderTable | ||
data={ | ||
Array [ | ||
Object { | ||
"provider": "Libvirt", | ||
"status": true, | ||
}, | ||
Object { | ||
"provider": "oVirt", | ||
"status": true, | ||
}, | ||
Object { | ||
"provider": "EC2", | ||
"status": true, | ||
}, | ||
Object { | ||
"provider": "VMware", | ||
"status": true, | ||
}, | ||
Object { | ||
"provider": "OpenStack", | ||
"status": true, | ||
}, | ||
Object { | ||
"provider": "Rackspace", | ||
"status": true, | ||
}, | ||
Object { | ||
"provider": "Google", | ||
"status": true, | ||
}, | ||
] | ||
} | ||
/> | ||
<AboutComputeTable | ||
data={ | ||
Array [ | ||
Object { | ||
"id": Object { | ||
"id": 1, | ||
"name": "Libvirt", | ||
}, | ||
"type": "Libvirt", | ||
}, | ||
Object { | ||
"id": Object { | ||
"id": 2, | ||
"name": "Ovirt", | ||
}, | ||
"type": "Ovirt", | ||
}, | ||
] | ||
} | ||
/> | ||
<AboutPluginTable | ||
data={ | ||
Array [ | ||
Object { | ||
"author": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ex ea difficultate illae fallaciloquae", | ||
"description": "MaaS Discovery Plugin engine for Foreman", | ||
"name": "foreman_discovery", | ||
"version": "11.0.0", | ||
}, | ||
] | ||
} | ||
/> | ||
</TabsWrapper> | ||
`; |
Oops, something went wrong.