Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions airflow-core/src/airflow/ui/src/pages/Providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
* specific language governing permissions and limitations
* under the License.
*/

// TODO: Allow providers to define custom documentation URLs

import { Box, Heading, Link } from "@chakra-ui/react";
import type { ColumnDef } from "@tanstack/react-table";
import type { TFunction } from "i18next";
Expand All @@ -30,22 +33,29 @@ import { ErrorAlert } from "src/components/ErrorAlert";
import { urlRegex } from "src/constants/urlRegex";

const createColumns = (translate: TFunction): Array<ColumnDef<ProviderResponse>> => [
{
accessorKey: "package_name",
cell: ({ row: { original } }) => (
{
accessorKey: "package_name",
cell: ({ row: { original } }) => {
const documentationUrl =
original?.project_urls?.documentation ??
`https://airflow.apache.org/docs/${original.package_name}/${original.version}/`;

return (
<Link
aria-label={original.package_name}
color="fg.info"
href={`https://airflow.apache.org/docs/${original.package_name}/${original.version}/`}
href={documentationUrl}
rel="noopener noreferrer"
target="_blank"
>
{original.package_name}
</Link>
),
enableSorting: false,
header: translate("providers.columns.packageName"),
);
},
enableSorting: false,
header: translate("providers.columns.packageName"),
},

{
accessorKey: "version",
cell: ({ row: { original } }) => original.version,
Expand Down