Skip to content

Commit

Permalink
Merge branch 'main' into source-code-info
Browse files Browse the repository at this point in the history
  • Loading branch information
ibolton336 authored Feb 16, 2024
2 parents 7047389 + 6217116 commit 0132a2c
Show file tree
Hide file tree
Showing 19 changed files with 253 additions and 89 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/issues.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Reconcile GitHub Issue (Comment)

on:
issues:
types:
- opened
- edited
- closed
- reopened
- labeled
- unlabeled
issue_comment:
types:
- created
- edited

concurrency:
group: reconcile-issue-${{ github.event.issue.number }}-${{ github.event_name }}
cancel-in-progress: true

jobs:
reconcile-issue:
if: github.event_name == 'issues' || github.event_name == 'pull_request'
secrets: inherit
uses: konveyor/release-tools/.github/workflows/reconcile-issue.yaml@main

reconcile-issue-comment:
if: github.event_name == 'issue_comment'
secrets: inherit
uses: konveyor/release-tools/.github/workflows/reconcile-issue-comment.yaml@main
16 changes: 16 additions & 0 deletions .github/workflows/pr-closed.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: PR Closed

on:
pull_request_target:
branches:
- main
types:
- closed

jobs:
cherry_pick_job:
permissions:
pull-requests: write
contents: write
if: github.event.pull_request.merged == true
uses: konveyor/release-tools/.github/workflows/cherry-pick.yml@main
1 change: 1 addition & 0 deletions client/public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,7 @@
"teamMember": "team member",
"ticket": "Ticket",
"trivialButMigratable": "Trivial but migratable",
"unassessedOrUnknown": "Unassessed or unknown",
"unassessed": "Unassessed",
"unassigned": "Not yet assigned",
"unknown": "Unknown",
Expand Down
25 changes: 24 additions & 1 deletion client/public/templates/questionnaire-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ sections:
risk: unknown
rationale: Lack of clarity on architecture can lead to unplanned issues.
mitigation: Conduct an architectural review.

- order: 3
text: Is your application's data storage cloud-optimized?
explanation: Evaluate if the data storage solution is optimized for cloud usage.
Expand All @@ -81,6 +80,30 @@ sections:
risk: yellow
rationale: Hybrid solutions may have integration complexities.
mitigation: Evaluate and optimize cloud integration points.
- order: 4
text: Are you currently using any form of container orchestration?
explanation: Determine if the application utilizes container orchestration tools like Kubernetes, Docker Swarm, etc.
excludeFor:
- category: Deployment
tag: Serverless
- category: Architecture
tag: Monolith
answers:
- order: 1
text: Kubernetes
risk: green
rationale: Kubernetes is a robust orchestrator for container management.
mitigation: Ensure Kubernetes configurations are optimized for cloud.
- order: 2
text: Docker Swarm
risk: green
rationale: Docker Swarm provides a simpler, yet effective, orchestration.
mitigation: Validate that Docker Swarm meets all cloud scalability requirements.
- order: 3
text: No Container Orchestration
risk: yellow
rationale: Lack of container orchestration can hinder cloud adaptability.
mitigation: Explore container orchestration options for better cloud integration.
thresholds:
red: 1
yellow: 30
Expand Down
3 changes: 0 additions & 3 deletions client/src/app/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ import { AppRoutes } from "./Routes";
import { DefaultLayout } from "./layout";
import { NotificationsProvider } from "./components/NotificationsContext";

import "@patternfly/patternfly/patternfly.css";
import "@patternfly/patternfly/patternfly-addons.css";

import "./app.css";

const App: React.FC = () => {
Expand Down
5 changes: 5 additions & 0 deletions client/src/app/api/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,7 @@ export interface Assessment
confidence?: number;
stakeholders?: Ref[];
stakeholderGroups?: Ref[];
required?: boolean;
}
export interface CategorizedTag {
category: TagCategory;
Expand Down Expand Up @@ -794,3 +795,7 @@ export interface AssessmentWithArchetypeApplications
extends AssessmentWithSectionOrder {
archetypeApplications: Ref[];
}
export interface AssessmentsWithArchetype {
archetype: Archetype;
assessments: Assessment[];
}
10 changes: 10 additions & 0 deletions client/src/app/dayjs.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import dayjs from "dayjs";
import isSameOrBefore from "dayjs/plugin/isSameOrBefore";
import utc from "dayjs/plugin/utc";
import timezone from "dayjs/plugin/timezone";
import customParseFormat from "dayjs/plugin/customParseFormat";

dayjs.extend(utc);
dayjs.extend(timezone);
dayjs.extend(customParseFormat);
dayjs.extend(isSameOrBefore);
15 changes: 3 additions & 12 deletions client/src/app/layout/SidebarApp/SidebarApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,26 +77,17 @@ export const SidebarApp: React.FC = () => {
{selectedPersona === PersonaKey.MIGRATION ? (
<NavList title="Global">
<NavItem>
<NavLink
to={Paths.applications + search}
activeClassName="pf-m-current"
>
<NavLink to={Paths.applications} activeClassName="pf-m-current">
{t("sidebar.applicationInventory")}
</NavLink>
</NavItem>
<NavItem>
<NavLink
to={Paths.archetypes + search}
activeClassName="pf-m-current"
>
<NavLink to={Paths.archetypes} activeClassName="pf-m-current">
{t("sidebar.archetypes")}
</NavLink>
</NavItem>
<NavItem>
<NavLink
to={Paths.reports + search}
activeClassName="pf-m-current"
>
<NavLink to={Paths.reports} activeClassName="pf-m-current">
{t("sidebar.reports")}
</NavLink>
</NavItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,12 @@ import keycloak from "@app/keycloak";
import {
RBAC,
RBAC_TYPE,
analysisReadScopes,
analysisWriteScopes,
analysesReadScopes,
applicationsWriteScopes,
assessmentReadScopes,
assessmentWriteScopes,
credentialsReadScopes,
credentialsWriteScopes,
dependenciesWriteScopes,
importsWriteScopes,
reviewsReadScopes,
reviewsWriteScopes,
tasksReadScopes,
tasksWriteScopes,
Expand Down Expand Up @@ -519,6 +515,14 @@ export const ApplicationsTable: React.FC = () => {
selectionState: { selectedItems: selectedRows },
} = tableControls;

const clearFilters = () => {
const currentPath = history.location.pathname;
const newSearch = new URLSearchParams(history.location.search);
newSearch.delete("filters");
history.push(`${currentPath}`);
filterToolbarProps.setFilterValues({});
};

const [
saveApplicationsCredentialsModalState,
setSaveApplicationsCredentialsModalState,
Expand All @@ -542,16 +546,12 @@ export const ApplicationsTable: React.FC = () => {
importWriteAccess = checkAccess(userScopes, importsWriteScopes),
applicationWriteAccess = checkAccess(userScopes, applicationsWriteScopes),
assessmentWriteAccess = checkAccess(userScopes, assessmentWriteScopes),
analysisWriteAccess = checkAccess(userScopes, analysisWriteScopes),
assessmentReadAccess = checkAccess(userScopes, assessmentReadScopes),
credentialsReadAccess = checkAccess(userScopes, credentialsReadScopes),
credentialsWriteAccess = checkAccess(userScopes, credentialsWriteScopes),
dependenciesWriteAccess = checkAccess(userScopes, dependenciesWriteScopes),
analysisReadAccess = checkAccess(userScopes, analysisReadScopes),
analysesReadAccess = checkAccess(userScopes, analysesReadScopes),
tasksReadAccess = checkAccess(userScopes, tasksReadScopes),
tasksWriteAccess = checkAccess(userScopes, tasksWriteScopes),
reviewsWriteAccess = checkAccess(userScopes, reviewsWriteScopes),
reviewsReadAccess = checkAccess(userScopes, reviewsReadScopes);
reviewsWriteAccess = checkAccess(userScopes, reviewsWriteScopes);

const areAppsInWaves = selectedRows.some(
(application) => application.migrationWave !== null
Expand Down Expand Up @@ -740,7 +740,7 @@ export const ApplicationsTable: React.FC = () => {
backgroundColor: "var(--pf-v5-global--BackgroundColor--100)",
}}
>
<Toolbar {...toolbarProps}>
<Toolbar {...toolbarProps} clearAllFilters={clearFilters}>
<ToolbarContent>
<ToolbarBulkSelector {...toolbarBulkSelectorProps} />
<FilterToolbar<Application, string> {...filterToolbarProps} />
Expand Down Expand Up @@ -1031,7 +1031,7 @@ export const ApplicationsTable: React.FC = () => {
},
]
: []),
...(analysisReadAccess && hasExistingAnalysis
...(analysesReadAccess && hasExistingAnalysis
? [
{
title: t("actions.analysisDetails"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
Divider,
Tooltip,
Label,
LabelGroup,
} from "@patternfly/react-core";
import spacing from "@patternfly/react-styles/css/utilities/Spacing/spacing";
import {
Expand Down Expand Up @@ -56,6 +57,7 @@ import { LabelsFromItems } from "@app/components/labels/labels-from-items/labels
import { RiskLabel } from "@app/components/RiskLabel";
import { ApplicationDetailFields } from "./application-detail-fields";
import { useFetchArchetypes } from "@app/queries/archetypes";
import { AssessedArchetypes } from "./components/assessed-archetypes";

export interface IApplicationDetailDrawerProps
extends Pick<IPageDrawerContentProps, "onCloseClick"> {
Expand Down Expand Up @@ -100,14 +102,6 @@ export const ApplicationDetailDrawer: React.FC<

const enableDownloadSetting = useSetting("download.html.enabled");

const assessedArchetypes =
application?.archetypes
?.map((archetypeRef) =>
archetypes.find((archetype) => archetype.id === archetypeRef.id)
)
.filter((fullArchetype) => fullArchetype?.assessed)
.filter(Boolean) || [];

const reviewedArchetypes =
application?.archetypes
?.map((archetypeRef) =>
Expand Down Expand Up @@ -210,16 +204,7 @@ export const ApplicationDetailDrawer: React.FC<
{t("terms.archetypesAssessed")}
</DescriptionListTerm>
<DescriptionListDescription>
{assessedArchetypes?.length ? (
assessedArchetypes.map((assessedArchetype) => (
<ArchetypeItem
key={assessedArchetype?.id}
archetype={assessedArchetype}
/>
))
) : (
<EmptyTextMessage message={t("terms.none")} />
)}
<AssessedArchetypes application={application} />
</DescriptionListDescription>
</DescriptionListGroup>

Expand All @@ -228,16 +213,18 @@ export const ApplicationDetailDrawer: React.FC<
{t("terms.archetypesReviewed")}
</DescriptionListTerm>
<DescriptionListDescription>
{reviewedArchetypes?.length ? (
reviewedArchetypes.map((reviewedArchetype) => (
<ArchetypeItem
key={reviewedArchetype?.id}
archetype={reviewedArchetype}
/>
))
) : (
<EmptyTextMessage message={t("terms.none")} />
)}
<LabelGroup>
{reviewedArchetypes?.length ? (
reviewedArchetypes.map((reviewedArchetype) => (
<ArchetypeItem
key={reviewedArchetype?.id}
archetype={reviewedArchetype}
/>
))
) : (
<EmptyTextMessage message={t("terms.none")} />
)}
</LabelGroup>
</DescriptionListDescription>
</DescriptionListGroup>
</DescriptionList>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import React from "react";
import { Application } from "@app/api/models";
import { Label, LabelGroup, Spinner } from "@patternfly/react-core";
import { EmptyTextMessage } from "@app/components/EmptyTextMessage";
import { useTranslation } from "react-i18next";
import { useFetchArchetypes } from "@app/queries/archetypes";
import { useFetchAllAssessmentsWithArchetypes } from "@app/queries/assessments";

interface IAssessedArchetypesProps {
application: Application | null;
}

export const AssessedArchetypes: React.FC<IAssessedArchetypesProps> = ({
application,
}) => {
const { t } = useTranslation();
const {
archetypes: applicationArchetypes,
isFetching: isFetchingArchetypes,
} = useFetchArchetypes(application);

const {
assessmentsWithArchetypes,
isLoading: isFetchingAllAssessmentsWithArchetypesLoading,
} = useFetchAllAssessmentsWithArchetypes(applicationArchetypes);

const assessedArchetypesWithARequiredAssessment = assessmentsWithArchetypes
?.filter((assessmentsWithArchetype) => {
return (
assessmentsWithArchetype.archetype.assessed &&
assessmentsWithArchetype.assessments.some(
(assessment) => assessment?.required === true
)
);
})
.map((assessmentsWithArchetype) => assessmentsWithArchetype.archetype);

if (isFetchingArchetypes || isFetchingAllAssessmentsWithArchetypesLoading) {
return <Spinner size="md" />;
}
return (
<LabelGroup>
{assessedArchetypesWithARequiredAssessment?.length ? (
assessedArchetypesWithARequiredAssessment?.map((archetype) => (
<Label key={archetype?.id}>{archetype?.name}</Label>
))
) : (
<EmptyTextMessage message={t("terms.none")} />
)}
</LabelGroup>
);
};
Loading

0 comments on commit 0132a2c

Please sign in to comment.