Skip to content

Commit

Permalink
Merge branch 'main' into mta-1961
Browse files Browse the repository at this point in the history
  • Loading branch information
ibolton336 committed Jan 18, 2024
2 parents 6593690 + 629cb61 commit e28d0b9
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 58 deletions.
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
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
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);
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 @@ -542,16 +538,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 @@ -1031,7 +1023,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 @@ -210,16 +211,18 @@ 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")} />
)}
<LabelGroup>
{assessedArchetypes?.length ? (
assessedArchetypes.map((assessedArchetype) => (
<ArchetypeItem
key={assessedArchetype?.id}
archetype={assessedArchetype}
/>
))
) : (
<EmptyTextMessage message={t("terms.none")} />
)}
</LabelGroup>
</DescriptionListDescription>
</DescriptionListGroup>

Expand All @@ -228,16 +231,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
Expand Up @@ -186,15 +186,15 @@ export const ApplicationLandscape: React.FC<IApplicationLandscapeProps> = ({
<Donut
isAssessment={false}
id="landscape-donut-unassessed"
value={landscapeData.unassessed}
value={landscapeData.unassessed + landscapeData.unknown}
total={landscapeData.applicationsCount}
color={RISK_LIST.unknown.hexColor}
riskLabel={
<Link to={getRisksUrl(["unknown"])}>
{`${t("terms.unassessed")}/${t("terms.unknown")}`}
</Link>
}
riskTitle={t("terms.unassessed")}
riskTitle={t("terms.unassessedOrUnknown")}
/>
</FlexItem>
</Flex>
Expand Down
13 changes: 1 addition & 12 deletions client/src/app/rbac.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,18 +110,7 @@ export const archetypesWriteScopes = [
"archetypes:delete",
];

export const analysisWriteScopes = [
"applications.analysis:put",
"applications.analysis:post",
"applications.analysis:delete",
"archetypes.analysis:put",
"archetypes.analysis:post",
"archetypes.analysis:delete",
];
export const analysisReadScopes = [
"applications.analysis:get",
"archetypes.analysis:get",
];
export const analysesReadScopes = ["applications.analyses:get"];

export const assessmentWriteScopes = [
"applications.assessments:put",
Expand Down
14 changes: 5 additions & 9 deletions client/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import "@patternfly/patternfly/patternfly.css";
import "@patternfly/patternfly/patternfly-addons.css";

import React from "react";
import ReactDOM from "react-dom";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
Expand All @@ -7,16 +10,9 @@ import ENV from "@app/env";
import App from "@app/App";
import reportWebVitals from "@app/reportWebVitals";
import { KeycloakProvider } from "@app/components/KeycloakProvider";
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);
import "@app/dayjs";
import "@app/i18n";

const queryClient = new QueryClient();

Expand Down

0 comments on commit e28d0b9

Please sign in to comment.