Skip to content

Commit

Permalink
Merge branch 'main' into Refine-tag-name-filter
Browse files Browse the repository at this point in the history
  • Loading branch information
rszwajko authored Dec 3, 2024
2 parents 49726f5 + 9e1b026 commit 22fc3e6
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# - https://github.com/konveyor/tackle2-ui/pull/1781

# Builder image
FROM registry.access.redhat.com/ubi9/nodejs-20:1-59.1726663413 as builder
FROM registry.access.redhat.com/ubi9/nodejs-20:9.5 as builder

USER 1001
COPY --chown=1001 . .
Expand All @@ -21,7 +21,7 @@ RUN \
npm run dist

# Runner image
FROM registry.access.redhat.com/ubi9/nodejs-20-minimal:1-63
FROM registry.access.redhat.com/ubi9/nodejs-20-minimal:9.5

# Add ps package to allow liveness probe for k8s cluster
# Add tar package to allow copying files with kubectl scp
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ Konveyor UI component
| branch | last merge CI | last merge image build | nightly CI |
| :---------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| main | [![CI (repo level)](https://github.com/konveyor/tackle2-ui/actions/workflows/ci-repo.yml/badge.svg?branch=main&event=push)](https://github.com/konveyor/tackle2-ui/actions/workflows/ci-repo.yml?query=branch%3Amain+event%3Apush) | [![Multiple Architecture Image Build](https://github.com/konveyor/tackle2-ui/actions/workflows/image-build.yaml/badge.svg?branch=main&event=push)](https://github.com/konveyor/tackle2-ui/actions/workflows/image-build.yaml?query=branch%3Amain+event%3Apush) | [![Nightly CI (repo level @main)](https://github.com/konveyor/tackle2-ui/actions/workflows/nightly-ci-repo.yaml/badge.svg?branch=main&event=schedule)](https://github.com/konveyor/tackle2-ui/actions/workflows/nightly-ci-repo.yaml?query=branch%3Amain+event%3Aschedule) |
| release-0.6 | [![CI (repo level)](https://github.com/konveyor/tackle2-ui/actions/workflows/ci-repo.yml/badge.svg?branch=release-0.6&event=push)](https://github.com/konveyor/tackle2-ui/actions/workflows/ci-repo.yml?query=branch%3Arelease-0.6+event%3Apush) | [![Multiple Architecture Image Build](https://github.com/konveyor/tackle2-ui/actions/workflows/image-build.yaml/badge.svg?branch=release-0.6&event=push)](https://github.com/konveyor/tackle2-ui/actions/workflows/image-build.yaml?query=branch%3Arelease-0.6+event%3Apush) | [![CI (repo level)](https://github.com/konveyor/tackle2-ui/actions/workflows/ci-repo.yml/badge.svg?branch=release-0.6&event=schedule)](https://github.com/konveyor/tackle2-ui/actions/workflows/ci-repo.yml?query=branch%3Arelease-0.6+event%3Aschedule) |
| release-0.5 | [![CI (repo level)](https://github.com/konveyor/tackle2-ui/actions/workflows/ci-repo.yml/badge.svg?branch=release-0.5&event=push)](https://github.com/konveyor/tackle2-ui/actions/workflows/ci-repo.yml?query=branch%3Arelease-0.5+event%3Apush) | [![Multiple Architecture Image Build](https://github.com/konveyor/tackle2-ui/actions/workflows/image-build.yaml/badge.svg?branch=release-0.5&event=push)](https://github.com/konveyor/tackle2-ui/actions/workflows/image-build.yaml?query=branch%3Arelease-0.5+event%3Apush) | [![CI (repo level)](https://github.com/konveyor/tackle2-ui/actions/workflows/ci-repo.yml/badge.svg?branch=release-0.5&event=schedule)](https://github.com/konveyor/tackle2-ui/actions/workflows/ci-repo.yml?query=branch%3Arelease-0.5+event%3Aschedule) |
| release-0.4 | [![CI (repo level)](https://github.com/konveyor/tackle2-ui/actions/workflows/ci-repo.yml/badge.svg?branch=release-0.4&event=push)](https://github.com/konveyor/tackle2-ui/actions/workflows/ci-repo.yml?query=branch%3Arelease-0.4+event%3Apush) | [![Multiple Architecture Image Build](https://github.com/konveyor/tackle2-ui/actions/workflows/image-build.yaml/badge.svg?branch=release-0.4&event=push)](https://github.com/konveyor/tackle2-ui/actions/workflows/image-build.yaml?query=branch%3Arelease-0.4+event%3Apush) | [![CI (repo level)](https://github.com/konveyor/tackle2-ui/actions/workflows/ci-repo.yml/badge.svg?branch=release-0.4&event=schedule)](https://github.com/konveyor/tackle2-ui/actions/workflows/ci-repo.ymlquery=branch%3Arelease-0.4+event%3Aschedule) |
| release-0.3 | [![CI (repo level)](https://github.com/konveyor/tackle2-ui/actions/workflows/ci-repo.yml/badge.svg?branch=release-0.3&event=push)](https://github.com/konveyor/tackle2-ui/actions/workflows/ci-repo.yml?query=branch%3Arelease-0.3+event%3Apush) | [![Multiple Architecture Image Build](https://github.com/konveyor/tackle2-ui/actions/workflows/image-build.yaml/badge.svg?branch=release-0.3&event=push)](https://github.com/konveyor/tackle2-ui/actions/workflows/image-build.yaml?query=branch%3Arelease-0.3+event%3Apush) | [![CI (repo level)](https://github.com/konveyor/tackle2-ui/actions/workflows/ci-repo.yml/badge.svg?branch=release-0.3&event=schedule)](https://github.com/konveyor/tackle2-ui/actions/workflows/ci-repo.yml?query=branch%3Arelease-0.3+event%3Aschedule) |

| branch | last merge e2e CI | nightly e2e CI |
| :---------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| main | [![CI (global konveyor CI)](https://github.com/konveyor/tackle2-ui/actions/workflows/ci-global.yml/badge.svg?branch=main&event=push)](https://github.com/konveyor/tackle2-ui/actions/workflows/ci-global.yml?query=branch%3Amain+event%3Apush) | [![Nightly CI (global konveyor CI @main)](https://github.com/konveyor/tackle2-ui/actions/workflows/nightly-ci-global.yaml/badge.svg?branch=main&event=schedule)](https://github.com/konveyor/tackle2-ui/actions/workflows/nightly-ci-global.yaml?query=branch%3Amain+event%3Aschedule) |
| release-0.6 | [![CI (global konveyor CI)](https://github.com/konveyor/tackle2-ui/actions/workflows/ci-global.yml/badge.svg?branch=release-0.6&event=push)](https://github.com/konveyor/tackle2-ui/actions/workflows/ci-global.yml?query=branch%3Arelease-0.6+event%3Apush) | [![CI (global konveyor CI)](https://github.com/konveyor/tackle2-ui/actions/workflows/ci-global.yml/badge.svg?branch=release-0.6&event=schedule)](https://github.com/konveyor/tackle2-ui/actions/workflows/ci-global.yml?query=branch%3Arelease-0.6+event%3Aschedule) |
| release-0.5 | [![CI (global konveyor CI)](https://github.com/konveyor/tackle2-ui/actions/workflows/ci-global.yml/badge.svg?branch=release-0.5&event=push)](https://github.com/konveyor/tackle2-ui/actions/workflows/ci-global.yml?query=branch%3Arelease-0.5+event%3Apush) | [![CI (global konveyor CI)](https://github.com/konveyor/tackle2-ui/actions/workflows/ci-global.yml/badge.svg?branch=release-0.5&event=schedule)](https://github.com/konveyor/tackle2-ui/actions/workflows/ci-global.yml?query=branch%3Arelease-0.5+event%3Aschedule) |
| release-0.4 | [![CI (global konveyor CI)](https://github.com/konveyor/tackle2-ui/actions/workflows/ci-global.yml/badge.svg?branch=release-0.4&event=push)](https://github.com/konveyor/tackle2-ui/actions/workflows/ci-global.yml?query=branch%3Arelease-0.4+event%3Apush) | [![CI (global konveyor CI)](https://github.com/konveyor/tackle2-ui/actions/workflows/ci-global.yml/badge.svg?branch=release-0.4&event=schedule)](https://github.com/konveyor/tackle2-ui/actions/workflows/ci-global.yml?query=branch%3Arelease-0.4+event%3Aschedule) |
| release-0.3 | [![CI (global konveyor CI)](https://github.com/konveyor/tackle2-ui/actions/workflows/ci-global.yml/badge.svg?branch=release-0.3&event=push)](https://github.com/konveyor/tackle2-ui/actions/workflows/ci-global.yml?query=branch%3Arelease-0.3+event%3Apush) | [![CI (global konveyor CI)](https://github.com/konveyor/tackle2-ui/actions/workflows/ci-global.yml/badge.svg?branch=release-0.3&event=schedule)](https://github.com/konveyor/tackle2-ui/actions/workflows/ci-global.yml?query=branch%3Arelease-0.3+event%3Aschedule) |
Expand Down
7 changes: 7 additions & 0 deletions client/public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"accept": "Accept",
"back": "Back",
"cancel": "Cancel",
"cancelTasks": "Cancel tasks",
"checkDocumentation": "Check documentation",
"clearAllFilters": "Clear all filters",
"clearRepositoryNotSupported": "This action is disabled when RWX volumes are not available",
Expand Down Expand Up @@ -107,7 +108,9 @@
"dialog": {
"message": {
"applicationsBulkDelete": "The selected application(s) will be deleted.",
"TasksBulkCancel": "The selected task(s) will be canceled.",
"delete": "This action cannot be undone.",
"cancel": "This action cannot be undone.",
"discardAssessment": "The assessment(s) for <1>{{applicationName}}</1> will be discarded. Do you wish to continue?",
"discardReview": "The review for <1>{{applicationName}}</1> will be discarded. Do you wish to continue?",
"leavePage": "Are you sure you want to leave this page? Be sure to save your changes, or they will be lost.",
Expand All @@ -124,7 +127,9 @@
"copyApplicationAssessmentAndReviewFrom": "Copy {{what}} assessment and review",
"copyApplicationAssessmentFrom": "Copy {{what}} assessment",
"delete": "Delete {{what}}?",
"cancel": "Cancel {{what}}?",
"deleteWithName": "Delete {{what}} \"{{name}}\"?",
"cancelWithName": "Cancel {{what}} \"{{name}}\"?",
"discard": "Discard {{what}}?",
"download": "Download {{what}}",
"edit": "Edit {{what}}",
Expand Down Expand Up @@ -180,6 +185,7 @@
"blockedDeleteApplication": "Cannot delete {{what}} because it is associated with an application.",
"blockedDeleteTarget": "Cannot delete {{what}} because it is associated with a target.",
"defaultBlockedDelete": "Cannot delete {{what}} because it is associated with another object.",
"cannotDeleteJobFunctionWithStakeholders": "Cannot remove a Job function associated with stakeholder(s)",
"cannotDeleteApplicationsAssignedToMigrationWave": "Cannot delete applications that are assigned to a migration wave.",
"cannotDeleteNonEmptyTagCategory": "Cannot delete a tag category that contains tags.",
"continueConfirmation": "Yes, continue",
Expand Down Expand Up @@ -481,6 +487,7 @@
"tagCategoryDeleted": "Tag category deleted",
"tagCategories": "Tag categories",
"tasks": "Tasks",
"task": "Task",
"teamMember": "team member",
"terminated": "Terminated",
"ticket": "Ticket",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ export const ApplicationsTable: React.FC = () => {

const history = useHistory();
const token = keycloak.tokenParsed;

// ----- State for the modals
const [saveApplicationModalState, setSaveApplicationModalState] = useState<
"create" | DecoratedApplication | null
Expand Down Expand Up @@ -156,7 +155,9 @@ export const ApplicationsTable: React.FC = () => {
const [applicationsToDelete, setApplicationsToDelete] = useState<
DecoratedApplication[]
>([]);

const [tasksToCancel, setTasksToCancel] = useState<DecoratedApplication[]>(
[]
);
const [assessmentToDiscard, setAssessmentToDiscard] =
useState<DecoratedApplication | null>(null);

Expand Down Expand Up @@ -214,7 +215,7 @@ export const ApplicationsTable: React.FC = () => {

const isTaskCancellable = (application: DecoratedApplication) => {
const task = application.tasks.currentAnalyzer;
return !TaskStates.Terminal.includes(task?.state ?? "");
return !!task && !TaskStates.Terminal.includes(task?.state ?? "");
};

// TODO: Review the refetchInterval calculation for the application list
Expand Down Expand Up @@ -272,7 +273,6 @@ export const ApplicationsTable: React.FC = () => {
});
}
);

const discardReview = async (application: DecoratedApplication) => {
if (application.review) {
deleteReview({
Expand All @@ -297,7 +297,6 @@ export const ApplicationsTable: React.FC = () => {
});
}
);

const discardAssessment = async (application: DecoratedApplication) => {
if (application.assessments) {
application.assessments.forEach((assessment) => {
Expand Down Expand Up @@ -575,6 +574,23 @@ export const ApplicationsTable: React.FC = () => {
>
{t("actions.delete")}
</DropdownItem>,
...(tasksReadAccess && tasksWriteAccess
? [
<DropdownItem
key="applications-bulk-cancel"
isDisabled={
!selectedRows.some((application: DecoratedApplication) =>
isTaskCancellable(application)
)
}
onClick={() => {
handleCancelBulkAnalysis();
}}
>
{t("actions.cancelAnalysis")}
</DropdownItem>,
]
: []),
...(credentialsReadAccess
? [
<DropdownItem
Expand Down Expand Up @@ -638,6 +654,12 @@ export const ApplicationsTable: React.FC = () => {
})
);
};
const handleCancelBulkAnalysis = () => {
const runningTasksToCancel = selectedRows.filter((application) =>
isTaskCancellable(application)
);
setTasksToCancel(runningTasksToCancel);
};

const assessSelectedApp = async (application: DecoratedApplication) => {
setApplicationToAssess(application);
Expand Down Expand Up @@ -1149,6 +1171,37 @@ export const ApplicationsTable: React.FC = () => {
if (ids) bulkDeleteApplication({ ids: ids });
}}
/>
<ConfirmDialog
title={t(
tasksToCancel.length > 1
? "dialog.title.cancel"
: "dialog.title.cancelWithName",
{
what:
tasksToCancel.length > 1
? t("terms.tasks").toLowerCase()
: t("terms.task").toLowerCase(),
name: tasksToCancel.length === 1 && tasksToCancel[0].name,
}
)}
titleIconVariant={"warning"}
isOpen={tasksToCancel.length > 0}
message={`${
tasksToCancel.length > 1 ? t("dialog.message.TasksBulkCancel") : ""
} ${t("dialog.message.cancel")}`}
aria-label="Tasks bulk cancel"
confirmBtnVariant={ButtonVariant.danger}
confirmBtnLabel={t("actions.cancelTasks")}
cancelBtnLabel={t("actions.cancel")}
onCancel={() => setTasksToCancel([])}
onClose={() => setTasksToCancel([])}
onConfirm={() => {
tasksToCancel.forEach((application) => {
cancelAnalysis(application);
});
setTasksToCancel([]);
}}
/>
<ConfirmDialog
title={t("dialog.title.discard", {
what: t("terms.assessment").toLowerCase(),
Expand Down
8 changes: 5 additions & 3 deletions client/src/app/pages/controls/job-functions/job-functions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {
import { Table, Tbody, Td, Th, Thead, Tr } from "@patternfly/react-table";

import { AppPlaceholder } from "@app/components/AppPlaceholder";
import { AppTableActionButtons } from "@app/components/AppTableActionButtons";
import { ConditionalRender } from "@app/components/ConditionalRender";
import { ConfirmDialog } from "@app/components/ConfirmDialog";
import { getAxiosErrorMessage } from "@app/utils/utils";
Expand All @@ -37,6 +36,7 @@ import {
import { useLocalTableControls } from "@app/hooks/table-controls";
import { CubesIcon } from "@patternfly/react-icons";
import { RBAC, RBAC_TYPE, controlsWriteScopes } from "@app/rbac";
import { ControlTableActionButtons } from "../ControlTableActionButtons";

export const JobFunctions: React.FC = () => {
const { t } = useTranslation();
Expand Down Expand Up @@ -215,9 +215,11 @@ export const JobFunctions: React.FC = () => {
<Td width={90} {...getTdProps({ columnKey: "name" })}>
{jobFunction.name}
</Td>
<AppTableActionButtons
<ControlTableActionButtons
isDeleteEnabled={!!jobFunction.stakeholders}
tooltipMessage="Cannot remove a Job function associated with stakeholder(s)"
deleteTooltipMessage={t(
"message.cannotDeleteJobFunctionWithStakeholders"
)}
onEdit={() => setCreateUpdateModalState(jobFunction)}
onDelete={() => deleteRow(jobFunction)}
/>
Expand Down

0 comments on commit 22fc3e6

Please sign in to comment.