Skip to content

Commit

Permalink
fix(ui): commits changes from merged main
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinS-git committed Nov 14, 2024
2 parents 3c3f933 + c9190d0 commit 562c708
Show file tree
Hide file tree
Showing 135 changed files with 3,670 additions and 1,759 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"@cloudoperators/juno-ui-components": minor
---

Migrate AppShellProvider and CodeBlock to TypeScript
Migrate the ContextMenu component to TypeScript
5 changes: 5 additions & 0 deletions .changeset/nice-moons-watch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cloudoperators/juno-ui-components": minor
---

Migrate NativeSelect, NativeSelectionOption and NativeSelectOptionGroup components to TypeScript
5 changes: 5 additions & 0 deletions .changeset/shaggy-pots-repeat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cloudoperators/juno-ui-components": minor
---

Migrate Form, FormRow and FormSection components to TypeScript
13 changes: 13 additions & 0 deletions apps/greenhouse/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# @cloudoperators/juno-app-greenhouse

## 0.3.4

### Patch Changes

- eea5de6: The pagination is added to the list of component instances for a selected service on the service details page.
- Updated dependencies [63a951c]
- Updated dependencies [5a4e3d1]
- Updated dependencies [7cb142d]
- Updated dependencies [eea5de6]
- Updated dependencies [a278544]
- @cloudoperators/juno-ui-components@2.29.0
- @cloudoperators/juno-app-heureka@2.10.0

## 0.3.3

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion apps/greenhouse/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cloudoperators/juno-app-greenhouse",
"version": "0.3.3",
"version": "0.3.4",
"orgAdminVersion": "latest",
"author": "UI-Team",
"contributors": [
Expand Down
14 changes: 14 additions & 0 deletions apps/heureka/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# @cloudoperators/juno-app-heureka

## 2.10.0

### Minor Changes

- eea5de6: The pagination is added to the list of component instances for a selected service on the service details page.

### Patch Changes

- Updated dependencies [63a951c]
- Updated dependencies [5a4e3d1]
- Updated dependencies [7cb142d]
- Updated dependencies [a278544]
- @cloudoperators/juno-ui-components@2.29.0

## 2.9.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion apps/heureka/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cloudoperators/juno-app-heureka",
"version": "2.9.2",
"version": "2.10.0",
"author": "UI-Team",
"contributors": [
"Hoda Noori, Arturo Reuschenbach Pucernau",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const sumTotalInstances = (versions) => {
const ComponentsListItem = ({ item }) => {
return (
<DataGridRow>
<DataGridCell>{item?.node?.name}</DataGridCell>
<DataGridCell>{item?.node?.ccrn}</DataGridCell>
<DataGridCell>{item?.node?.type}</DataGridCell>
<DataGridCell>{item?.node?.componentVersions?.totalCount}</DataGridCell>
<DataGridCell>{sumTotalInstances(item?.node?.componentVersions?.edges)}</DataGridCell>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,23 +77,23 @@ const IssueMatchesDetails = () => {
<DataGridHeadCell>Service Name</DataGridHeadCell>

<DataGridCell>
<LoadElement elem={issue?.componentInstance?.service?.name} />
<LoadElement elem={issue?.componentInstance?.service?.ccrn} />
</DataGridCell>
</DataGridRow>

<DataGridRow>
<DataGridHeadCell>Support Group Name</DataGridHeadCell>

<DataGridCell>
<LoadElement elem={listOfCommaSeparatedObjs(issue?.componentInstance?.service?.supportGroups, "name")} />
<LoadElement elem={listOfCommaSeparatedObjs(issue?.componentInstance?.service?.supportGroups, "ccrn")} />
</DataGridCell>
</DataGridRow>

<DataGridRow>
<DataGridHeadCell>Component Name</DataGridHeadCell>

<DataGridCell>
<LoadElement elem={issue?.componentInstance?.componentVersion?.component?.name} />
<LoadElement elem={issue?.componentInstance?.componentVersion?.component?.ccrn} />
</DataGridCell>
</DataGridRow>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ const IssueMatchesListItem = ({ item }) => {
<div className={cellSeverityClasses(severity)}>{severity}</div>
</DataGridCell>
<DataGridCell>{item?.node?.issue?.primaryName}</DataGridCell>
<DataGridCell>{item?.node?.componentInstance?.service?.name}</DataGridCell>
<DataGridCell>{item?.node?.componentInstance?.service?.ccrn}</DataGridCell>
<DataGridCell>{extractedCcrn}</DataGridCell>
<DataGridCell>
{listOfCommaSeparatedObjs(item?.node?.componentInstance?.service?.supportGroups, "name")}
{listOfCommaSeparatedObjs(item?.node?.componentInstance?.service?.supportGroups, "ccrn")}
</DataGridCell>
<DataGridCell>{item?.node?.status}</DataGridCell>
<DataGridCell>{formatDate(item?.node?.targetRemediationDate)}</DataGridCell>
Expand Down
86 changes: 86 additions & 0 deletions apps/heureka/src/components/services/ComponentInstancesList.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors
* SPDX-License-Identifier: Apache-2.0
*/

import React from "react"
import { useQuery } from "@tanstack/react-query"
import {
ContentHeading,
Container,
DataGrid,
DataGridRow,
DataGridCell,
DataGridHeadCell,
} from "@cloudoperators/juno-ui-components"
import { useGlobalsQueryClientFnReady, useGlobalsQueryOptions, useGlobalsActions } from "../StoreProvider"
import LoadElement from "../shared/LoadElement"
import { severityString, highestSeverity } from "../shared/Helper"
import PaginationComponent from "../shared/PaginationComponent"
import HintNotFound from "../shared/HintNotFound"

const ComponentInstancesList = ({ serviceCcrn }) => {
const queryOptions = useGlobalsQueryOptions("ComponentInstancesOfService")
const { setQueryOptions } = useGlobalsActions()
const queryClientFnReady = useGlobalsQueryClientFnReady()

const { data, isLoading } = useQuery({
queryKey: [
"ComponentInstancesOfService",
{
...queryOptions,
filter: { serviceCcrn: [serviceCcrn] },
},
],
enabled: !!queryClientFnReady && !!serviceCcrn,
})

const items = data?.ComponentInstances?.edges || []

return (
<>
<ContentHeading className="mt-8 mb-2" heading="Component Instances" />
<DataGrid columns={4}>
<DataGridRow>
<DataGridHeadCell>Component</DataGridHeadCell>
<DataGridHeadCell>Version</DataGridHeadCell>
<DataGridHeadCell>Total Number of Issues</DataGridHeadCell>
<DataGridHeadCell>Highest Severity</DataGridHeadCell>
</DataGridRow>
{isLoading ? (
<DataGridRow>
<DataGridCell colSpan={4}>
<Container py>
<LoadElement />
</Container>
</DataGridCell>
</DataGridRow>
) : items.length === 0 ? (
<HintNotFound text="No component instances available." />
) : (
items.map((componentInstance, i) => (
<DataGridRow key={i}>
<DataGridCell>{componentInstance?.node?.ccrn}</DataGridCell>
<DataGridCell className="break-all overflow-hidden">
{componentInstance?.node?.componentVersion?.version}
</DataGridCell>
<DataGridCell>{componentInstance?.node?.issueMatches?.totalCount}</DataGridCell>
<DataGridCell>
{severityString(highestSeverity(componentInstance?.node?.issueMatches?.edges))}
</DataGridCell>
</DataGridRow>
))
)}
</DataGrid>
<PaginationComponent
queryKey="ComponentInstancesOfService"
queryOptions={queryOptions}
entityName="ComponentInstances"
setQueryOptions={setQueryOptions}
countData={data}
/>
</>
)
}

export default ComponentInstancesList
37 changes: 5 additions & 32 deletions apps/heureka/src/components/services/ServicesDetails.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,16 @@ import { useQuery, useMutation } from "@tanstack/react-query"
import LoadElement from "../shared/LoadElement"
import { useActions as messageActions } from "@cloudoperators/juno-messages-provider"
import { parseError } from "../../helpers"
import { listOfCommaSeparatedObjs, severityString, highestSeverity } from "../shared/Helper"
import { listOfCommaSeparatedObjs } from "../shared/Helper"
import ComponentInstancesList from "./ComponentInstancesList"

const ServicesDetail = () => {
const showServiceDetail = useGlobalsShowServiceDetail()
const queryClientFnReady = useGlobalsQueryClientFnReady()
const { addMessage, resetMessages } = messageActions()

const serviceElem = useQuery({
queryKey: ["ServicesDetails", { filter: { serviceName: [showServiceDetail] } }],
queryKey: ["ServicesDetails", { filter: { serviceCcrn: [showServiceDetail] } }],
enabled: !!queryClientFnReady && !!showServiceDetail,
})

Expand Down Expand Up @@ -216,41 +217,13 @@ const ServicesDetail = () => {
<DataGridRow>
<DataGridHeadCell nowrap={true}>Support Group</DataGridHeadCell>
<DataGridCell>
<LoadElement elem={<ul>{listOfCommaSeparatedObjs(service?.supportGroups, "name")}</ul>} />
<LoadElement elem={<ul>{listOfCommaSeparatedObjs(service?.supportGroups, "ccrn")}</ul>} />
</DataGridCell>
</DataGridRow>
</DataGrid>

<Container py px={false}>
<ContentHeading className="mt-8 mb-2" heading="Component Instances" />
<DataGrid columns={4}>
<DataGridRow>
<DataGridHeadCell>Component</DataGridHeadCell>
<DataGridHeadCell>Version</DataGridHeadCell>
<DataGridHeadCell>Total Number of Issues</DataGridHeadCell>
<DataGridHeadCell>Highest Severity</DataGridHeadCell>
</DataGridRow>
{!service?.componentInstances?.edges && (
<DataGridRow colSpan={4}>
<Container py>
<LoadElement />
</Container>
</DataGridRow>
)}

{service?.componentInstances?.edges?.map((componentInstance, i) => (
<DataGridRow key={i}>
<DataGridCell>{componentInstance?.node?.ccrn}</DataGridCell>
<DataGridCell className="break-all overflow-hidden">
{componentInstance?.node?.componentVersion?.version}
</DataGridCell>
<DataGridCell>{componentInstance?.node?.issueMatches?.totalCount}</DataGridCell>
<DataGridCell>
{severityString(highestSeverity(componentInstance?.node?.issueMatches?.edges))}
</DataGridCell>
</DataGridRow>
))}
</DataGrid>
<ComponentInstancesList serviceCcrn={showServiceDetail} />
</Container>
</>
)
Expand Down
10 changes: 5 additions & 5 deletions apps/heureka/src/components/services/ServicesListItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,27 @@ const ServicesListItem = ({ item }) => {
}, [item])

const handleClick = () => {
if (showServiceDetail === service?.name && showPanel === constants.PANEL_SERVICE) {
if (showServiceDetail === service?.ccrn && showPanel === constants.PANEL_SERVICE) {
{
setShowServiceDetail(null)
setShowPanel(constants.PANEL_NONE)
}
} else {
setShowServiceDetail(service?.name)
setShowServiceDetail(service?.ccrn)
setShowPanel(constants.PANEL_SERVICE)
}
}

return (
<DataGridRow
className={`cursor-pointer ${
showServiceDetail === service?.name && showPanel === constants.PANEL_SERVICE ? "active" : ""
showServiceDetail === service?.ccrn && showPanel === constants.PANEL_SERVICE ? "active" : ""
}`}
onClick={() => handleClick()}
>
<DataGridCell>{service?.name}</DataGridCell>
<DataGridCell>{service?.ccrn}</DataGridCell>
<DataGridCell>{listOfCommaSeparatedObjs(service?.owners, "name")}</DataGridCell>
<DataGridCell>{listOfCommaSeparatedObjs(service?.supportGroups, "name")}</DataGridCell>
<DataGridCell>{listOfCommaSeparatedObjs(service?.supportGroups, "ccrn")}</DataGridCell>
<DataGridCell>{service?.metadata?.componentInstanceCount}</DataGridCell>
<DataGridCell>{service?.metadata?.issueMatchCount}</DataGridCell>
</DataGridRow>
Expand Down
6 changes: 3 additions & 3 deletions apps/heureka/src/components/shared/HintNotFound.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
*/

import React from "react"
import { Stack } from "@cloudoperators/juno-ui-components"
import { Container } from "@cloudoperators/juno-ui-components"

const HintNotFound = ({ text }) => {
return (
<Stack alignment="center" distribution="center" direction="vertical" className="h-full">
<Container py px="false">
<span>{text}</span>
</Stack>
</Container>
)
}

Expand Down
Loading

0 comments on commit 562c708

Please sign in to comment.