mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 18:09:57 -03:30
Add instance node type to associate modal.
This commit is contained in:
parent
9ee9de76b5
commit
bba2a264ea
@ -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({
|
||||
<OptionsList
|
||||
displayKey={displayKey}
|
||||
contentError={contentError}
|
||||
columns={columns}
|
||||
deselectItem={handleSelect}
|
||||
header={header}
|
||||
isLoading={isLoading}
|
||||
|
||||
@ -23,6 +23,7 @@ const ModalList = styled.div`
|
||||
`;
|
||||
|
||||
function OptionsList({
|
||||
columns,
|
||||
contentError,
|
||||
deselectItem,
|
||||
displayKey,
|
||||
@ -44,6 +45,20 @@ function OptionsList({
|
||||
sortSelectedItems,
|
||||
value,
|
||||
}) {
|
||||
const buildHeaderRow = (
|
||||
<HeaderRow qsConfig={qsConfig}>
|
||||
{columns?.length > 0 ? (
|
||||
columns.map((col) => (
|
||||
<HeaderCell
|
||||
key={col.key}
|
||||
sortKey={col.key}
|
||||
>{t`${col.name}`}</HeaderCell>
|
||||
))
|
||||
) : (
|
||||
<HeaderCell sortKey="name">{t`Name`}</HeaderCell>
|
||||
)}
|
||||
</HeaderRow>
|
||||
);
|
||||
let selectionPreview = null;
|
||||
if (value.length > 0) {
|
||||
if (isSelectedDraggable) {
|
||||
@ -82,11 +97,7 @@ function OptionsList({
|
||||
toolbarSearchableKeys={searchableKeys}
|
||||
toolbarRelatedSearchableKeys={relatedSearchableKeys}
|
||||
hasContentLoading={isLoading}
|
||||
headerRow={
|
||||
<HeaderRow qsConfig={qsConfig}>
|
||||
<HeaderCell sortKey="name">{t`Name`}</HeaderCell>
|
||||
</HeaderRow>
|
||||
}
|
||||
headerRow={buildHeaderRow}
|
||||
onRowClick={selectItem}
|
||||
renderRow={(item, index) => (
|
||||
<CheckboxListItem
|
||||
@ -95,6 +106,8 @@ function OptionsList({
|
||||
itemId={item.id}
|
||||
name={multiple ? item[displayKey] : name}
|
||||
label={item[displayKey]}
|
||||
columns={columns}
|
||||
item={item}
|
||||
isSelected={value.some((i) => i.id === item.id)}
|
||||
onSelect={() => selectItem(item)}
|
||||
onDeselect={() => deselectItem(item)}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user