From bba2a264ea46f56a294422f99ec79892b4273ef9 Mon Sep 17 00:00:00 2001 From: Kia Lam Date: Thu, 2 Sep 2021 20:01:03 -0400 Subject: [PATCH] Add instance node type to associate modal. --- .../AssociateModal/AssociateModal.js | 5 ++++ .../src/components/OptionsList/OptionsList.js | 23 +++++++++++++++---- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/awx/ui/src/components/AssociateModal/AssociateModal.js b/awx/ui/src/components/AssociateModal/AssociateModal.js index 5ccd6e59c8..d5236699aa 100644 --- a/awx/ui/src/components/AssociateModal/AssociateModal.js +++ b/awx/ui/src/components/AssociateModal/AssociateModal.js @@ -18,6 +18,10 @@ const QS_CONFIG = (order_by = 'name') => function AssociateModal({ header = t`Items`, + columns = [ + { key: 'hostname', name: 'Name' }, + { key: 'node_type', name: 'Node Type' }, + ], title = t`Select Items`, onClose, onAssociate, @@ -123,6 +127,7 @@ function AssociateModal({ + {columns?.length > 0 ? ( + columns.map((col) => ( + {t`${col.name}`} + )) + ) : ( + {t`Name`} + )} + + ); let selectionPreview = null; if (value.length > 0) { if (isSelectedDraggable) { @@ -82,11 +97,7 @@ function OptionsList({ toolbarSearchableKeys={searchableKeys} toolbarRelatedSearchableKeys={relatedSearchableKeys} hasContentLoading={isLoading} - headerRow={ - - {t`Name`} - - } + headerRow={buildHeaderRow} onRowClick={selectItem} renderRow={(item, index) => ( i.id === item.id)} onSelect={() => selectItem(item)} onDeselect={() => deselectItem(item)}