Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin-Admin #36

Merged
merged 22 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
cdd9a8c
[plugin-admin] initial commit
TilmanHaupt Mar 18, 2024
b5bf051
[plugin-admin] added icon for condition
TilmanHaupt Mar 18, 2024
11db184
[plugin-admin] hide optionValues with prefix greenhouse
TilmanHaupt Mar 19, 2024
7c58cfb
[plugin-admin] PluginDetails are triggered via id change
TilmanHaupt Mar 19, 2024
be802e7
[plugin-admin] deeplinks fo details enabled
TilmanHaupt Mar 19, 2024
e9d504d
[plugin-admin] pluginList last col reduce width
TilmanHaupt Mar 19, 2024
b0a85eb
[plugin-admin] implement tests for useAPI
TilmanHaupt Mar 19, 2024
994780d
[plugin-admin] Tests for createPluginConfig
TilmanHaupt Mar 19, 2024
7e6e764
[plugin-admin] Fix colorbug tailwind, overflow DataGrid
TilmanHaupt Mar 20, 2024
e676f65
[plugin-admin] Added heading for details
TilmanHaupt Mar 20, 2024
e7f371b
[plugin-admin] datagrid supports hover and active
TilmanHaupt Mar 21, 2024
8f03988
[plugin-admin] Changed UI of PluginDetail
TilmanHaupt Mar 21, 2024
5b9ba85
[plugin-admin] clean up, panel can close via click on list
TilmanHaupt Mar 22, 2024
8f1d64b
[plugin-admin] handling in UI of undefined values and arrays
TilmanHaupt Mar 22, 2024
8dc41b4
[plugin-admin] Disabled plugins are now shown
TilmanHaupt Mar 25, 2024
90ef801
[plugin-admin] comments for the application
TilmanHaupt Mar 25, 2024
b045eb6
Automatic application of license header
Mar 25, 2024
0c84655
[plugin-admin] Cleaned Code, Correct Licence
TilmanHaupt Mar 26, 2024
741c6d4
[plugin-admin] store is now sliced in global and pluginstore
TilmanHaupt Mar 26, 2024
30a0c19
[plugin-admin] tests for sorting of pluginConfig
TilmanHaupt Mar 26, 2024
4fb76b2
[plugin-admin] tests if external service URL are build correctly
TilmanHaupt Mar 26, 2024
fc63943
[plugin-admin] update name
TilmanHaupt Mar 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[plugin-admin] comments for the application
  • Loading branch information
TilmanHaupt committed Mar 25, 2024
commit 90ef801811a79f2f8c82f6e18e1a3bf019ddbd9c
1 change: 1 addition & 0 deletions ui/plugin-admin/src/components/Plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { useGlobalsActions, useShowDetailsFor } from "./StoreProvider"

import { Icon } from "juno-ui-components"

// renders a single plugin row
const Plugin = (props) => {
const plugin = props.plugin
const { setShowDetailsFor } = useGlobalsActions()
Expand Down
1 change: 1 addition & 0 deletions ui/plugin-admin/src/components/PluginDetail.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
TabPanel,
} from "juno-ui-components"

// Renders the plugin details panel
const PluginDetail = () => {
const pluginConfig = usePluginConfig()
const { setShowDetailsFor } = useGlobalsActions()
Expand Down
1 change: 1 addition & 0 deletions ui/plugin-admin/src/components/PluginList.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
import { usePluginConfig } from "./StoreProvider"
import Plugin from "./Plugin"

// Renders the list of plugins
const PluginList = () => {
const pluginConfig = usePluginConfig()

Expand Down
7 changes: 5 additions & 2 deletions ui/plugin-admin/src/hooks/useAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { useGlobalsActions } from "../components/StoreProvider"

import { getResourceStatusFromKubernetesConditions } from "../../../utils/resourceStatus"

// Extracts the external services from the object and creates links which are used in the plugin list / detail
export const buildExternalServicesUrls = (exposedServices) => {
// extract url and the name from the object and create a link
if (!exposedServices) return null

const links = []
Expand All @@ -22,19 +22,22 @@ export const buildExternalServicesUrls = (exposedServices) => {
return links
}

// Creates a flat object from the plugin config data
export const createPluginConfig = (items) => {
let allPlugins = []

items.forEach((item) => {
// unknown is used as a last fallback, should not happen
const id = item?.metadata?.name ? item.metadata?.name : "Unknown"
const name = item?.spec?.displayName ? item.spec.displayName : id
const disabled = item?.spec?.disabled
const version = item?.status?.version
const clusterName = item?.spec?.clusterName
// build urls and name in a array of objects
const externalServicesUrls = buildExternalServicesUrls(
item?.status?.exposedServices
)
const statusConditions = item?.status?.statusConditions?.conditions
// get a status object with icon and text for the plugin from imported function
const readyStatus = statusConditions
? getResourceStatusFromKubernetesConditions(statusConditions)
: null
Expand Down
Loading