You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "vincbeck (via GitHub)" <gi...@apache.org> on 2026/01/23 20:41:38 UTC
[PR] Add team to list variables and list connections pages [airflow]
vincbeck opened a new pull request, #60995:
URL: https://github.com/apache/airflow/pull/60995
Add team as column to list variable and list connection pages. I add it only if the multi-team mode is enabled.
Plus, I found out several bugs when I was testing edit variable and connection. I fix these bugs as part of this PR as well.
<!--
Thank you for contributing!
Please provide above a brief description of the changes made in this pull request.
Write a good git commit message following this guide: http://chris.beams.io/posts/git-commit/
Please make sure that your code changes are covered with tests.
And in case of new features or big changes remember to adjust the documentation.
Feel free to ping (in general) for the review if you do not see reaction for a few days
(72 Hours is the minimum reaction time you can expect from volunteers) - we sometimes miss notifications.
In case of an existing issue, reference it using one of the following:
* closes: #ISSUE
* related: #ISSUE
-->
---
##### Was generative AI tooling used to co-author this PR?
<!--
If generative AI tooling has been used in the process of authoring this PR, please
change below checkbox to `[X]` followed by the name of the tool, uncomment the "Generated-by".
-->
- [ ] Yes (please specify the tool below)
<!--
Generated-by: [Tool Name] following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
-->
---
* Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)** for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
* For fundamental code changes, an Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals)) is needed.
* When adding dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
* For significant user-facing changes create newsfragment: `{pr_number}.significant.rst` or `{issue_number}.significant.rst`, in [airflow-core/newsfragments](https://github.com/apache/airflow/tree/main/airflow-core/newsfragments).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add team to list variables and list connections pages [airflow]
Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on code in PR #60995:
URL: https://github.com/apache/airflow/pull/60995#discussion_r2732103501
##########
airflow-core/src/airflow/ui/src/pages/Connections/Connections.tsx:
##########
@@ -58,78 +59,91 @@ export type ConnectionBody = {
const getColumns = ({
allRowsSelected,
+ multiTeam,
onRowSelect,
onSelectAll,
selectedRows,
translate,
-}: { translate: TFunction } & GetColumnsParams): Array<ColumnDef<ConnectionResponse>> => [
- {
- accessorKey: "select",
- cell: ({ row }) => (
- <Checkbox
- borderWidth={1}
- checked={selectedRows.get(row.original.connection_id)}
- colorPalette="brand"
- onCheckedChange={(event) => onRowSelect(row.original.connection_id, Boolean(event.checked))}
- />
- ),
- enableHiding: false,
- enableSorting: false,
- header: () => (
- <Checkbox
- borderWidth={1}
- checked={allRowsSelected}
- colorPalette="brand"
- onCheckedChange={(event) => onSelectAll(Boolean(event.checked))}
- />
- ),
- meta: {
- skeletonWidth: 10,
+}: { translate: TFunction } & GetColumnsParams): Array<ColumnDef<ConnectionResponse>> => {
+ const columns: Array<ColumnDef<ConnectionResponse>> = [
+ {
+ accessorKey: "select",
+ cell: ({ row }) => (
+ <Checkbox
+ borderWidth={1}
+ checked={selectedRows.get(row.original.connection_id)}
+ colorPalette="brand"
+ onCheckedChange={(event) => onRowSelect(row.original.connection_id, Boolean(event.checked))}
+ />
+ ),
+ enableHiding: false,
+ enableSorting: false,
+ header: () => (
+ <Checkbox
+ borderWidth={1}
+ checked={allRowsSelected}
+ colorPalette="brand"
+ onCheckedChange={(event) => onSelectAll(Boolean(event.checked))}
+ />
+ ),
+ meta: {
+ skeletonWidth: 10,
+ },
+ },
+ {
+ accessorKey: "connection_id",
+ header: translate("connections.columns.connectionId"),
+ },
+ {
+ accessorKey: "conn_type",
+ header: translate("connections.columns.connectionType"),
+ },
+ {
+ accessorKey: "description",
+ header: translate("columns.description"),
+ },
+ {
+ accessorKey: "host",
+ header: translate("connections.columns.host"),
},
- },
- {
- accessorKey: "connection_id",
- header: translate("connections.columns.connectionId"),
- },
- {
- accessorKey: "conn_type",
- header: translate("connections.columns.connectionType"),
- },
- {
- accessorKey: "description",
- header: translate("columns.description"),
- },
- {
- accessorKey: "host",
- header: translate("connections.columns.host"),
- },
- {
- accessorKey: "port",
- header: translate("connections.columns.port"),
- },
- {
- accessorKey: "actions",
- cell: ({ row: { original } }) => (
- <Flex justifyContent="end">
- <TestConnectionButton connection={original} />
- <EditConnectionButton connection={original} disabled={selectedRows.size > 0} />
- <DeleteConnectionButton connectionId={original.connection_id} disabled={selectedRows.size > 0} />
- </Flex>
- ),
- enableSorting: false,
- header: "",
- meta: {
- skeletonWidth: 10,
+ {
+ accessorKey: "port",
+ header: translate("connections.columns.port"),
},
- },
-];
+ {
+ accessorKey: "actions",
+ cell: ({ row: { original } }) => (
+ <Flex justifyContent="end">
+ <TestConnectionButton connection={original} />
+ <EditConnectionButton connection={original} disabled={selectedRows.size > 0} />
+ <DeleteConnectionButton connectionId={original.connection_id} disabled={selectedRows.size > 0} />
+ </Flex>
+ ),
+ enableSorting: false,
+ header: "",
+ meta: {
+ skeletonWidth: 10,
+ },
+ },
+ ];
+
+ if (multiTeam) {
+ columns.splice(6, 0, {
+ accessorKey: "team_name",
+ header: translate("columns.team"),
+ });
+ }
Review Comment:
https://github.com/apache/airflow/pull/61123 Small adjustment so people do not copy/past this by mistake. (even if it's fine in this current form it could easily bait someone working on a similar component)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add team to list variables and list connections pages [airflow]
Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on code in PR #60995:
URL: https://github.com/apache/airflow/pull/60995#discussion_r2732007939
##########
airflow-core/src/airflow/ui/src/pages/Connections/Connections.tsx:
##########
@@ -58,78 +59,91 @@ export type ConnectionBody = {
const getColumns = ({
allRowsSelected,
+ multiTeam,
onRowSelect,
onSelectAll,
selectedRows,
translate,
-}: { translate: TFunction } & GetColumnsParams): Array<ColumnDef<ConnectionResponse>> => [
- {
- accessorKey: "select",
- cell: ({ row }) => (
- <Checkbox
- borderWidth={1}
- checked={selectedRows.get(row.original.connection_id)}
- colorPalette="brand"
- onCheckedChange={(event) => onRowSelect(row.original.connection_id, Boolean(event.checked))}
- />
- ),
- enableHiding: false,
- enableSorting: false,
- header: () => (
- <Checkbox
- borderWidth={1}
- checked={allRowsSelected}
- colorPalette="brand"
- onCheckedChange={(event) => onSelectAll(Boolean(event.checked))}
- />
- ),
- meta: {
- skeletonWidth: 10,
+}: { translate: TFunction } & GetColumnsParams): Array<ColumnDef<ConnectionResponse>> => {
+ const columns: Array<ColumnDef<ConnectionResponse>> = [
+ {
+ accessorKey: "select",
+ cell: ({ row }) => (
+ <Checkbox
+ borderWidth={1}
+ checked={selectedRows.get(row.original.connection_id)}
+ colorPalette="brand"
+ onCheckedChange={(event) => onRowSelect(row.original.connection_id, Boolean(event.checked))}
+ />
+ ),
+ enableHiding: false,
+ enableSorting: false,
+ header: () => (
+ <Checkbox
+ borderWidth={1}
+ checked={allRowsSelected}
+ colorPalette="brand"
+ onCheckedChange={(event) => onSelectAll(Boolean(event.checked))}
+ />
+ ),
+ meta: {
+ skeletonWidth: 10,
+ },
+ },
+ {
+ accessorKey: "connection_id",
+ header: translate("connections.columns.connectionId"),
+ },
+ {
+ accessorKey: "conn_type",
+ header: translate("connections.columns.connectionType"),
+ },
+ {
+ accessorKey: "description",
+ header: translate("columns.description"),
+ },
+ {
+ accessorKey: "host",
+ header: translate("connections.columns.host"),
},
- },
- {
- accessorKey: "connection_id",
- header: translate("connections.columns.connectionId"),
- },
- {
- accessorKey: "conn_type",
- header: translate("connections.columns.connectionType"),
- },
- {
- accessorKey: "description",
- header: translate("columns.description"),
- },
- {
- accessorKey: "host",
- header: translate("connections.columns.host"),
- },
- {
- accessorKey: "port",
- header: translate("connections.columns.port"),
- },
- {
- accessorKey: "actions",
- cell: ({ row: { original } }) => (
- <Flex justifyContent="end">
- <TestConnectionButton connection={original} />
- <EditConnectionButton connection={original} disabled={selectedRows.size > 0} />
- <DeleteConnectionButton connectionId={original.connection_id} disabled={selectedRows.size > 0} />
- </Flex>
- ),
- enableSorting: false,
- header: "",
- meta: {
- skeletonWidth: 10,
+ {
+ accessorKey: "port",
+ header: translate("connections.columns.port"),
},
- },
-];
+ {
+ accessorKey: "actions",
+ cell: ({ row: { original } }) => (
+ <Flex justifyContent="end">
+ <TestConnectionButton connection={original} />
+ <EditConnectionButton connection={original} disabled={selectedRows.size > 0} />
+ <DeleteConnectionButton connectionId={original.connection_id} disabled={selectedRows.size > 0} />
+ </Flex>
+ ),
+ enableSorting: false,
+ header: "",
+ meta: {
+ skeletonWidth: 10,
+ },
+ },
+ ];
+
+ if (multiTeam) {
+ columns.splice(6, 0, {
+ accessorKey: "team_name",
+ header: translate("columns.team"),
+ });
+ }
Review Comment:
We tend to never mutate objects because react diffing algorithm will compare references and not render the update if the object was mutated in place.
This is why you see a lot of:
```
const newArray = [...oldArray, ,newItem]
```
Here we are outside of a react component so it should be fine. (a new columns object is created on every render anyway)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add team to list variables and list connections pages [airflow]
Posted by "vincbeck (via GitHub)" <gi...@apache.org>.
vincbeck merged PR #60995:
URL: https://github.com/apache/airflow/pull/60995
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add team to list variables and list connections pages [airflow]
Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on code in PR #60995:
URL: https://github.com/apache/airflow/pull/60995#discussion_r2732103501
##########
airflow-core/src/airflow/ui/src/pages/Connections/Connections.tsx:
##########
@@ -58,78 +59,91 @@ export type ConnectionBody = {
const getColumns = ({
allRowsSelected,
+ multiTeam,
onRowSelect,
onSelectAll,
selectedRows,
translate,
-}: { translate: TFunction } & GetColumnsParams): Array<ColumnDef<ConnectionResponse>> => [
- {
- accessorKey: "select",
- cell: ({ row }) => (
- <Checkbox
- borderWidth={1}
- checked={selectedRows.get(row.original.connection_id)}
- colorPalette="brand"
- onCheckedChange={(event) => onRowSelect(row.original.connection_id, Boolean(event.checked))}
- />
- ),
- enableHiding: false,
- enableSorting: false,
- header: () => (
- <Checkbox
- borderWidth={1}
- checked={allRowsSelected}
- colorPalette="brand"
- onCheckedChange={(event) => onSelectAll(Boolean(event.checked))}
- />
- ),
- meta: {
- skeletonWidth: 10,
+}: { translate: TFunction } & GetColumnsParams): Array<ColumnDef<ConnectionResponse>> => {
+ const columns: Array<ColumnDef<ConnectionResponse>> = [
+ {
+ accessorKey: "select",
+ cell: ({ row }) => (
+ <Checkbox
+ borderWidth={1}
+ checked={selectedRows.get(row.original.connection_id)}
+ colorPalette="brand"
+ onCheckedChange={(event) => onRowSelect(row.original.connection_id, Boolean(event.checked))}
+ />
+ ),
+ enableHiding: false,
+ enableSorting: false,
+ header: () => (
+ <Checkbox
+ borderWidth={1}
+ checked={allRowsSelected}
+ colorPalette="brand"
+ onCheckedChange={(event) => onSelectAll(Boolean(event.checked))}
+ />
+ ),
+ meta: {
+ skeletonWidth: 10,
+ },
+ },
+ {
+ accessorKey: "connection_id",
+ header: translate("connections.columns.connectionId"),
+ },
+ {
+ accessorKey: "conn_type",
+ header: translate("connections.columns.connectionType"),
+ },
+ {
+ accessorKey: "description",
+ header: translate("columns.description"),
+ },
+ {
+ accessorKey: "host",
+ header: translate("connections.columns.host"),
},
- },
- {
- accessorKey: "connection_id",
- header: translate("connections.columns.connectionId"),
- },
- {
- accessorKey: "conn_type",
- header: translate("connections.columns.connectionType"),
- },
- {
- accessorKey: "description",
- header: translate("columns.description"),
- },
- {
- accessorKey: "host",
- header: translate("connections.columns.host"),
- },
- {
- accessorKey: "port",
- header: translate("connections.columns.port"),
- },
- {
- accessorKey: "actions",
- cell: ({ row: { original } }) => (
- <Flex justifyContent="end">
- <TestConnectionButton connection={original} />
- <EditConnectionButton connection={original} disabled={selectedRows.size > 0} />
- <DeleteConnectionButton connectionId={original.connection_id} disabled={selectedRows.size > 0} />
- </Flex>
- ),
- enableSorting: false,
- header: "",
- meta: {
- skeletonWidth: 10,
+ {
+ accessorKey: "port",
+ header: translate("connections.columns.port"),
},
- },
-];
+ {
+ accessorKey: "actions",
+ cell: ({ row: { original } }) => (
+ <Flex justifyContent="end">
+ <TestConnectionButton connection={original} />
+ <EditConnectionButton connection={original} disabled={selectedRows.size > 0} />
+ <DeleteConnectionButton connectionId={original.connection_id} disabled={selectedRows.size > 0} />
+ </Flex>
+ ),
+ enableSorting: false,
+ header: "",
+ meta: {
+ skeletonWidth: 10,
+ },
+ },
+ ];
+
+ if (multiTeam) {
+ columns.splice(6, 0, {
+ accessorKey: "team_name",
+ header: translate("columns.team"),
+ });
+ }
Review Comment:
https://github.com/apache/airflow/pull/61123 Small adjustment so people do not copy/past this by mistake.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add team to list variables and list connections pages [airflow]
Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on code in PR #60995:
URL: https://github.com/apache/airflow/pull/60995#discussion_r2732007939
##########
airflow-core/src/airflow/ui/src/pages/Connections/Connections.tsx:
##########
@@ -58,78 +59,91 @@ export type ConnectionBody = {
const getColumns = ({
allRowsSelected,
+ multiTeam,
onRowSelect,
onSelectAll,
selectedRows,
translate,
-}: { translate: TFunction } & GetColumnsParams): Array<ColumnDef<ConnectionResponse>> => [
- {
- accessorKey: "select",
- cell: ({ row }) => (
- <Checkbox
- borderWidth={1}
- checked={selectedRows.get(row.original.connection_id)}
- colorPalette="brand"
- onCheckedChange={(event) => onRowSelect(row.original.connection_id, Boolean(event.checked))}
- />
- ),
- enableHiding: false,
- enableSorting: false,
- header: () => (
- <Checkbox
- borderWidth={1}
- checked={allRowsSelected}
- colorPalette="brand"
- onCheckedChange={(event) => onSelectAll(Boolean(event.checked))}
- />
- ),
- meta: {
- skeletonWidth: 10,
+}: { translate: TFunction } & GetColumnsParams): Array<ColumnDef<ConnectionResponse>> => {
+ const columns: Array<ColumnDef<ConnectionResponse>> = [
+ {
+ accessorKey: "select",
+ cell: ({ row }) => (
+ <Checkbox
+ borderWidth={1}
+ checked={selectedRows.get(row.original.connection_id)}
+ colorPalette="brand"
+ onCheckedChange={(event) => onRowSelect(row.original.connection_id, Boolean(event.checked))}
+ />
+ ),
+ enableHiding: false,
+ enableSorting: false,
+ header: () => (
+ <Checkbox
+ borderWidth={1}
+ checked={allRowsSelected}
+ colorPalette="brand"
+ onCheckedChange={(event) => onSelectAll(Boolean(event.checked))}
+ />
+ ),
+ meta: {
+ skeletonWidth: 10,
+ },
+ },
+ {
+ accessorKey: "connection_id",
+ header: translate("connections.columns.connectionId"),
+ },
+ {
+ accessorKey: "conn_type",
+ header: translate("connections.columns.connectionType"),
+ },
+ {
+ accessorKey: "description",
+ header: translate("columns.description"),
+ },
+ {
+ accessorKey: "host",
+ header: translate("connections.columns.host"),
},
- },
- {
- accessorKey: "connection_id",
- header: translate("connections.columns.connectionId"),
- },
- {
- accessorKey: "conn_type",
- header: translate("connections.columns.connectionType"),
- },
- {
- accessorKey: "description",
- header: translate("columns.description"),
- },
- {
- accessorKey: "host",
- header: translate("connections.columns.host"),
- },
- {
- accessorKey: "port",
- header: translate("connections.columns.port"),
- },
- {
- accessorKey: "actions",
- cell: ({ row: { original } }) => (
- <Flex justifyContent="end">
- <TestConnectionButton connection={original} />
- <EditConnectionButton connection={original} disabled={selectedRows.size > 0} />
- <DeleteConnectionButton connectionId={original.connection_id} disabled={selectedRows.size > 0} />
- </Flex>
- ),
- enableSorting: false,
- header: "",
- meta: {
- skeletonWidth: 10,
+ {
+ accessorKey: "port",
+ header: translate("connections.columns.port"),
},
- },
-];
+ {
+ accessorKey: "actions",
+ cell: ({ row: { original } }) => (
+ <Flex justifyContent="end">
+ <TestConnectionButton connection={original} />
+ <EditConnectionButton connection={original} disabled={selectedRows.size > 0} />
+ <DeleteConnectionButton connectionId={original.connection_id} disabled={selectedRows.size > 0} />
+ </Flex>
+ ),
+ enableSorting: false,
+ header: "",
+ meta: {
+ skeletonWidth: 10,
+ },
+ },
+ ];
+
+ if (multiTeam) {
+ columns.splice(6, 0, {
+ accessorKey: "team_name",
+ header: translate("columns.team"),
+ });
+ }
Review Comment:
We tend to never mutate objects because react diffing algorithm will compare references and not render the update if the object was mutated in place.
This is why you see a lot of:
```
const newArray = [...oldArray, ,newItem]
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add team to list variables and list connections pages [airflow]
Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on code in PR #60995:
URL: https://github.com/apache/airflow/pull/60995#discussion_r2732007939
##########
airflow-core/src/airflow/ui/src/pages/Connections/Connections.tsx:
##########
@@ -58,78 +59,91 @@ export type ConnectionBody = {
const getColumns = ({
allRowsSelected,
+ multiTeam,
onRowSelect,
onSelectAll,
selectedRows,
translate,
-}: { translate: TFunction } & GetColumnsParams): Array<ColumnDef<ConnectionResponse>> => [
- {
- accessorKey: "select",
- cell: ({ row }) => (
- <Checkbox
- borderWidth={1}
- checked={selectedRows.get(row.original.connection_id)}
- colorPalette="brand"
- onCheckedChange={(event) => onRowSelect(row.original.connection_id, Boolean(event.checked))}
- />
- ),
- enableHiding: false,
- enableSorting: false,
- header: () => (
- <Checkbox
- borderWidth={1}
- checked={allRowsSelected}
- colorPalette="brand"
- onCheckedChange={(event) => onSelectAll(Boolean(event.checked))}
- />
- ),
- meta: {
- skeletonWidth: 10,
+}: { translate: TFunction } & GetColumnsParams): Array<ColumnDef<ConnectionResponse>> => {
+ const columns: Array<ColumnDef<ConnectionResponse>> = [
+ {
+ accessorKey: "select",
+ cell: ({ row }) => (
+ <Checkbox
+ borderWidth={1}
+ checked={selectedRows.get(row.original.connection_id)}
+ colorPalette="brand"
+ onCheckedChange={(event) => onRowSelect(row.original.connection_id, Boolean(event.checked))}
+ />
+ ),
+ enableHiding: false,
+ enableSorting: false,
+ header: () => (
+ <Checkbox
+ borderWidth={1}
+ checked={allRowsSelected}
+ colorPalette="brand"
+ onCheckedChange={(event) => onSelectAll(Boolean(event.checked))}
+ />
+ ),
+ meta: {
+ skeletonWidth: 10,
+ },
+ },
+ {
+ accessorKey: "connection_id",
+ header: translate("connections.columns.connectionId"),
+ },
+ {
+ accessorKey: "conn_type",
+ header: translate("connections.columns.connectionType"),
+ },
+ {
+ accessorKey: "description",
+ header: translate("columns.description"),
+ },
+ {
+ accessorKey: "host",
+ header: translate("connections.columns.host"),
},
- },
- {
- accessorKey: "connection_id",
- header: translate("connections.columns.connectionId"),
- },
- {
- accessorKey: "conn_type",
- header: translate("connections.columns.connectionType"),
- },
- {
- accessorKey: "description",
- header: translate("columns.description"),
- },
- {
- accessorKey: "host",
- header: translate("connections.columns.host"),
- },
- {
- accessorKey: "port",
- header: translate("connections.columns.port"),
- },
- {
- accessorKey: "actions",
- cell: ({ row: { original } }) => (
- <Flex justifyContent="end">
- <TestConnectionButton connection={original} />
- <EditConnectionButton connection={original} disabled={selectedRows.size > 0} />
- <DeleteConnectionButton connectionId={original.connection_id} disabled={selectedRows.size > 0} />
- </Flex>
- ),
- enableSorting: false,
- header: "",
- meta: {
- skeletonWidth: 10,
+ {
+ accessorKey: "port",
+ header: translate("connections.columns.port"),
},
- },
-];
+ {
+ accessorKey: "actions",
+ cell: ({ row: { original } }) => (
+ <Flex justifyContent="end">
+ <TestConnectionButton connection={original} />
+ <EditConnectionButton connection={original} disabled={selectedRows.size > 0} />
+ <DeleteConnectionButton connectionId={original.connection_id} disabled={selectedRows.size > 0} />
+ </Flex>
+ ),
+ enableSorting: false,
+ header: "",
+ meta: {
+ skeletonWidth: 10,
+ },
+ },
+ ];
+
+ if (multiTeam) {
+ columns.splice(6, 0, {
+ accessorKey: "team_name",
+ header: translate("columns.team"),
+ });
+ }
Review Comment:
Thanks for the PR.
We tend to never mutate objects because react diffing algorithm will compare references and not render the update if the object was mutated in place.
This is why you see a lot of:
```
const newArray = [...oldArray, ,newItem]
```
Here we are outside of a react component so it should be fine. (a new columns object is created on every render anyway)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org