Skip to content

Commit

Permalink
Merge branch 'main' into mta-2400
Browse files Browse the repository at this point in the history
  • Loading branch information
ibolton336 authored Mar 11, 2024
2 parents 4f6c0de + 333cc04 commit 3d840b8
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 60 deletions.
8 changes: 4 additions & 4 deletions INTERNATIONALIZATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ locales: ["en", "es", "myLanguageCode"]
npm extract
```

The previous command created a file `public/locales/{myLanguageCode}/translation.json`; the content of this file should be the translated new language. As a reference you can use the english version of the translation located at [public/locales/en/translation.json](https://github.com/konveyor/tackle-ui/blob/main/public/locales/en/translation.json)
The previous command created a file `public/locales/{myLanguageCode}/translation.json`; the content of this file should be the translated new language. As a reference you can use the english version of the translation located at [public/locales/en/translation.json](https://github.com/konveyor/tackle2-ui/blob/main/client/public/locales/en/translation.json)

> As soon as you feel confident, open a new Pull Request with your changes and make it part of the official repository.
## How to see the new translation in action?

To see your changes in action you will need to start Tackle UI in development mode. For starting Tackle UI in development mode follow the instruction at [Starting the UI](https://github.com/konveyor/tackle-ui#starting-the-ui)
To see your changes in action you will need to start Tackle UI in development mode. For starting Tackle UI in development mode follow the instruction at [Development section](https://github.com/konveyor/tackle2-ui/blob/main/README.md#development)

Steps:

- Start Tackle UI in dev mode following [Starting the UI](https://github.com/konveyor/tackle-ui#starting-the-ui) instructions.
- Start Tackle UI in dev mode following the instructions in the [Development section](https://github.com/konveyor/tackle2-ui/blob/main/README.md#development).
- Go to Keycloak http://localhost:8180/auth/admin/ and use `username=admin, password=admin`. Go to `Realm settings > themes > Supported locales` and select the new language you are adding. Finally click on `Save`.
- Go to http://localhost:3000/ and you should be redirected to the Login page where you are able to select your new language.

Expand All @@ -45,4 +45,4 @@ At this point you should be able to see your new language already translated int
## Why the questionnaire (assessment process) is not translated?

The questionnaire is data comming from https://github.com/konveyor/tackle-pathfinder hence the translation to a new language of the questionnaire should be done in that repository.
To accommodate diverse user needs, including internationalization, our custom assessment module supports the uploading of YAML files. This flexibility allows for the easy adaptation of assessments to different languages or specific requirements. If you're looking to offer assessments in a new language, simply create and upload a YAML file tailored to that language.
41 changes: 26 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,25 @@ $ minikube config set memory 10240
$ minikube config set cpus 4
```

From a terminal with administrator access (but not logged in as root), run:
Note: Depending on your driver, administrator access may be required. Common choices include Docker for container-based virtualization and KVM for hardware-assisted virtualization on Linux systems. If you're not sure which driver is best for you or if you're encountering compatibility issues, Minikube also supports auto-selecting a driver based on your system's capabilities and installed software.

From a terminal run:

```sh
$ minikube start --addons=dashboard --addons=ingress
```

Note: We need to enable the dashboard and ingress addons. The dashboard addon installs the dashboard service that exposes the Kubernetes objects in a user interface. The ingress addon allows us to create Ingress CRs to expose the Tackle UI and Tackle Hub API.

Since the olm addon is disabled until OLM issue [2534](https://github.com/operator-framework/operator-lifecycle-manager/issues/2534) is resolved we need to install the [OLM manually](https://github.com/operator-framework/operator-lifecycle-manager/releases) i.e. for version `v0.27.0` we can use:

```sh
$ minikube start --addons=dashboard --addons=ingress --addons=olm
curl -L https://github.com/operator-framework/operator-lifecycle-manager/releases/download/v0.27.0/install.sh -o install.sh
chmod +x install.sh
./install.sh v0.27.0
```

Note: We need to enable the dashboard, ingress and olm addons. The dashboard addon installs the dashboard service that exposes the Kubernetes objects in a user interface. The ingress addon allows us to create Ingress CRs to expose the Tackle UI and Tackle Hub API. The olm addon allows us to use an operator to deploy Tackle.
See also official Konveyor instructions for [Provisioning Minikube](https://konveyor.github.io/konveyor/installation/#provisioning-minikube).

### Configuring kubectl for minikube

Expand Down Expand Up @@ -83,7 +95,9 @@ You will need `kubectl` on your PATH and configured to control minikube in order
### Installing the Konveyor operator
The [konveyor/operator git repository](https://github.com/konveyor/operator) provides a script to install Tackle locally using `kubectl`. You can [inspect its source here](https://github.com/konveyor/operator/blob/main/hack/install-tackle.sh). This script creates the `konveyor-tackle` namespace, CatalogSource, OperatorGroup, Subscription and Tackle CR, then waits for deployments to be ready.
Follow the official instructions for [Installing Konveyor Operator](https://konveyor.github.io/konveyor/installation/#installing-konveyor-operator)
Alternatively, the [konveyor/operator git repository](https://github.com/konveyor/operator) provides a script to install Tackle locally using `kubectl`. You can [inspect its source here](https://github.com/konveyor/operator/blob/main/hack/install-tackle.sh). This script creates the `konveyor-tackle` namespace, CatalogSource, OperatorGroup, Subscription and Tackle CR, then waits for deployments to be ready.
#### Customizing the install script (optional)
Expand Down Expand Up @@ -126,7 +140,7 @@ $ npm run start:dev
## Understanding the local development environment
Tackle2 runs in a Kubernetes compatible environment (Openshift, Kubernetes or minikube) and is usually deployed with Tackle2 Operator (OLM).
Tackle2 runs in a Kubernetes compatible environment (i.e. Openshift, Kubernetes or minikube) and is usually deployed with Tackle2 Operator (OLM).
Although the UI pod has access to tackle2 APIs from within the cluster, the UI can also be executed outside the cluster and access Tackle APIs endpoints by proxy.
The React and Patternfly based UI is composed of web pages served by an http server with proxy capabilities.
Expand Down Expand Up @@ -182,26 +196,23 @@ port and only show the URL instead of opening the default browser directly:
$ minikube dashboard --port=18080 --url=true
```
Second, we can use the `kubectl proxy` command to enable access to the dashboard. The following
command sets up the proxy to listen on any network interface (useful for remote access), to the
18080/tcp port (easy to remember), and with requests filtering disabled (less secure, but necessary):
Second, we can use the `kubectl port-forward` command to enable access to the dashboard:
```sh
$ kubectl proxy --address=0.0.0.0 --port 18080 --disable-filter=true
$ kubectl port-forward svc/kubernetes-dashboard -n kubernetes-dashboard 30090:80
```
We can now access the minikube dashboard through the proxy. Use the following URL as a template,
replacing the IP address with your workstation IP address:
`http://192.168.0.1:18080/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/#/`
We can now access the minikube dashboard on `http://localhost:30090`
## Troubleshooting
Note - The steps described are executed on a Fedora 35 workstation, but will likely work on any recent Linux distribution.
The only prerequisites are to enable virtualization extensions in the BIOS/EFI of the machine, to install libvirt and to add our user to the libvirt group.
Note - The steps described are executed on a Fedora 38 workstation, but will likely work on any recent Linux distribution.
- For minikube setups that rely on virtualization, the only prerequisites are to enable virtualization extensions in the BIOS/EFI of the machine, to install libvirt and to add our user to the libvirt group.
- Ensure that your minikube installation directory is available in your `$PATH` environment variable. This is usually `/usr/local/bin/` or something similar depending on your OS of choice.
- The following command gives us the IP address assigned to the virtual machine created by Minikube.
- The following command gives us the IP address assigned to the node created by Minikube.
It's used when interacting with tackle UI image installed on the minikube cluster.
```sh
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@ import {
DescriptionListTerm,
DescriptionListDescription,
} from "@patternfly/react-core";
import spacing from "@patternfly/react-styles/css/utilities/Spacing/spacing";

import { Application, Archetype, Review } from "@app/api/models";
import { useFetchReviewById } from "@app/queries/reviews";
import { useFetchArchetypes } from "@app/queries/archetypes";
import { useFetchReviews } from "@app/queries/reviews";

import { EmptyTextMessage } from "@app/components/EmptyTextMessage";
import { PROPOSED_ACTION_LIST, EFFORT_ESTIMATE_LIST } from "@app/Constants";
import { ReviewLabel } from "./review-label";
import spacing from "@patternfly/react-styles/css/utilities/Spacing/spacing";

export type ReviewDrawerLabelItem = {
review?: Review | null;
Expand All @@ -23,10 +26,11 @@ export const ReviewFields: React.FC<{
application?: Application | null;
archetype?: Archetype | null;
reviews?: Review[];
}> = ({ application, archetype, reviews }) => {
}> = ({ application, archetype }) => {
const { archetypes } = useFetchArchetypes();
const { t } = useTranslation();

const { reviews } = useFetchReviews();
const { review: appReview } = useFetchReviewById(application?.review?.id);
const { review: archetypeReview } = useFetchReviewById(archetype?.review?.id);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ import {
useDeleteAssessmentMutation,
useFetchAssessments,
} from "@app/queries/assessments";
import { useDeleteReviewMutation, useFetchReviews } from "@app/queries/reviews";
import { useDeleteReviewMutation } from "@app/queries/reviews";
import { useFetchIdentities } from "@app/queries/identities";
import { useFetchTagsWithTagItems } from "@app/queries/tags";

Expand Down Expand Up @@ -117,7 +117,6 @@ export const ApplicationsTable: React.FC = () => {
const { pushNotification } = React.useContext(NotificationsContext);

const { identities } = useFetchIdentities();
const { reviews, isFetching: isFetchingReviews } = useFetchReviews();

const [saveApplicationModalState, setSaveApplicationModalState] =
React.useState<"create" | Application | null>(null);
Expand Down Expand Up @@ -1080,7 +1079,6 @@ export const ApplicationsTable: React.FC = () => {
applications={applications}
assessments={assessments}
archetypes={archetypes}
reviews={reviews}
onCloseClick={clearActiveItem}
onEditClick={() => setSaveApplicationModalState(activeItem)}
task={activeItem ? getTask(activeItem) : null}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as React from "react";
import { Link } from "react-router-dom";
import { useTranslation } from "react-i18next";

import {
TextContent,
Text,
Expand All @@ -24,6 +25,9 @@ import {
LabelGroup,
} from "@patternfly/react-core";
import spacing from "@patternfly/react-styles/css/utilities/Spacing/spacing";
import CheckCircleIcon from "@patternfly/react-icons/dist/esm/icons/check-circle-icon";
import ExclamationCircleIcon from "@patternfly/react-icons/dist/esm/icons/exclamation-circle-icon";

import {
Application,
Identity,
Expand All @@ -32,41 +36,39 @@ import {
Ref,
Archetype,
AssessmentWithSectionOrder,
Review,
} from "@app/api/models";
import {
IPageDrawerContentProps,
PageDrawerContent,
} from "@app/components/PageDrawerContext";
import { COLOR_HEX_VALUES_BY_NAME } from "@app/Constants";
import { useFetchFacts } from "@app/queries/facts";
import { useFetchIdentities } from "@app/queries/identities";
import { useSetting } from "@app/queries/settings";
import { getKindIdByRef } from "@app/utils/model-utils";

import {
getDependenciesUrlFilteredByAppName,
getIssuesSingleAppSelectedLocation,
} from "@app/pages/issues/helpers";
import { ApplicationTags } from "../application-tags";
import { COLOR_HEX_VALUES_BY_NAME } from "@app/Constants";
import {
IPageDrawerContentProps,
PageDrawerContent,
} from "@app/components/PageDrawerContext";
import { EmptyTextMessage } from "@app/components/EmptyTextMessage";
import { SimpleDocumentViewerModal } from "@app/components/SimpleDocumentViewer";
import { useFetchFacts } from "@app/queries/facts";
import { useFetchIdentities } from "@app/queries/identities";
import { useSetting } from "@app/queries/settings";
import { getKindIdByRef } from "@app/utils/model-utils";
import DownloadButton from "./components/download-button";
import CheckCircleIcon from "@patternfly/react-icons/dist/esm/icons/check-circle-icon";
import ExclamationCircleIcon from "@patternfly/react-icons/dist/esm/icons/exclamation-circle-icon";
import { ApplicationFacts } from "./application-facts";
import { ReviewFields } from "./review-fields";
import { LabelsFromItems } from "@app/components/labels/labels-from-items/labels-from-items";
import { RiskLabel } from "@app/components/RiskLabel";
import { ApplicationDetailFields } from "./application-detail-fields";
import { ReviewFields } from "@app/components/detail-drawer/review-fields";

import { ApplicationTags } from "../application-tags";
import { AssessedArchetypes } from "./components/assessed-archetypes";
import DownloadButton from "./components/download-button";
import { ApplicationDetailFields } from "./application-detail-fields";
import { ApplicationFacts } from "./application-facts";

export interface IApplicationDetailDrawerProps
extends Pick<IPageDrawerContentProps, "onCloseClick"> {
application: Application | null;
task: Task | undefined | null;
applications?: Application[];
assessments?: AssessmentWithSectionOrder[];
reviews?: Review[];
archetypes?: Archetype[];
onEditClick: () => void;
}
Expand All @@ -85,7 +87,6 @@ export const ApplicationDetailDrawer: React.FC<
onCloseClick,
application,
assessments,
reviews,
archetypes,
task,
onEditClick,
Expand Down Expand Up @@ -455,7 +456,7 @@ export const ApplicationDetailDrawer: React.FC<
eventKey={TabKey.Reviews}
title={<TabTitleText>{t("terms.review")}</TabTitleText>}
>
<ReviewFields application={application} reviews={reviews} />
<ReviewFields application={application} />
</Tab>
</Tabs>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import "./archetype-detail-drawer.css";
import React, { useMemo } from "react";
import { useTranslation } from "react-i18next";
import { Link } from "react-router-dom";

import {
TextContent,
Expand All @@ -17,19 +18,17 @@ import {
TabTitleText,
} from "@patternfly/react-core";
import spacing from "@patternfly/react-styles/css/utilities/Spacing/spacing";

import { dedupeArrayOfObjects } from "@app/utils/utils";
import { Paths } from "@app/Paths";
import { serializeFilterUrlParams } from "@app/hooks/table-controls";
import { Archetype, Ref, Review, Tag, TagRef } from "@app/api/models";

import { EmptyTextMessage } from "@app/components/EmptyTextMessage";
import { PageDrawerContent } from "@app/components/PageDrawerContext";

import { dedupeArrayOfObjects } from "@app/utils/utils";
import { LabelsFromItems } from "@app/components/labels/labels-from-items/labels-from-items";
import { ReviewFields } from "@app/pages/applications/components/application-detail-drawer/review-fields";
import { ReviewFields } from "@app/components/detail-drawer/review-fields";
import { RiskLabel } from "@app/components/RiskLabel";
import { LabelsFromItems } from "@app/components/labels/labels-from-items/labels-from-items";
import { LabelsFromTags } from "@app/components/labels/labels-from-tags/labels-from-tags";
import { serializeFilterUrlParams } from "@app/hooks/table-controls";
import { Paths } from "@app/Paths";
import { Link } from "react-router-dom";

export interface IArchetypeDetailDrawerProps {
onCloseClick: () => void;
Expand Down
Loading

0 comments on commit 3d840b8

Please sign in to comment.