mirror of
https://github.com/ansible/awx.git
synced 2026-02-15 02:00:01 -03:30
updating PR issues updated snapshot test
This commit is contained in:
@@ -126,7 +126,6 @@ class Organization extends Component {
|
||||
|
||||
const tabsPaddingOverride = {
|
||||
padding: '0',
|
||||
borderBottom: '1px solid black'
|
||||
};
|
||||
|
||||
const canSeeNotificationsTab = me.is_system_auditor || isNotifAdmin || isAuditorOfThisOrg;
|
||||
|
||||
@@ -281,11 +281,34 @@ class OrganizationsList extends Component {
|
||||
} = this.state;
|
||||
const { match } = this.props;
|
||||
|
||||
let deleteToolTipContent;
|
||||
|
||||
if (selected.some(row => !row.summary_fields.user_capabilities.delete)) {
|
||||
deleteToolTipContent = (
|
||||
<div>
|
||||
<Trans>
|
||||
You dont have permission to delete the following Organizations:
|
||||
</Trans>
|
||||
{selected
|
||||
.filter(row => !row.summary_fields.user_capabilities.delete)
|
||||
.map(row => (
|
||||
<div key={row.id}>
|
||||
{row.name}
|
||||
</div>
|
||||
))
|
||||
}
|
||||
</div>
|
||||
);
|
||||
} else if (selected.length === 0) {
|
||||
deleteToolTipContent = i18nMark('Select a row to delete');
|
||||
} else {
|
||||
deleteToolTipContent = i18nMark('Delete');
|
||||
}
|
||||
|
||||
const disableDelete = (
|
||||
selected.length === 0
|
||||
|| selected.some(row => !row.summary_fields.user_capabilities.delete)
|
||||
);
|
||||
const deleteToolTipContent = disableDelete ? i18nMark('Select a row to delete') : i18nMark('Delete');
|
||||
|
||||
return (
|
||||
<I18n>
|
||||
@@ -330,6 +353,7 @@ class OrganizationsList extends Component {
|
||||
<Fragment>
|
||||
<DataListToolbar
|
||||
addUrl={`${match.url}/add`}
|
||||
addBtnToolTipContent={i18nMark('Add Organization')}
|
||||
isAllSelected={selected.length === results.length}
|
||||
sortedColumnKey={sortedColumnKey}
|
||||
sortOrder={sortOrder}
|
||||
@@ -338,27 +362,8 @@ class OrganizationsList extends Component {
|
||||
onSort={this.onSort}
|
||||
onSelectAll={this.onSelectAll}
|
||||
onOpenDeleteModal={this.handleOpenOrgDeleteModal}
|
||||
disableDeleteIcon={disableDelete}
|
||||
deleteIconStyling={disableDelete ? 'awx-ToolBarBtn awx-ToolBarBtn--disabled'
|
||||
: 'awx-ToolBarBtn'}
|
||||
|
||||
deleteTooltip={
|
||||
selected.some(row => !row.summary_fields.user_capabilities.delete) ? (
|
||||
<div>
|
||||
<Trans>
|
||||
You dont have permission to delete the following Organizations:
|
||||
</Trans>
|
||||
{selected
|
||||
.filter(row => !row.summary_fields.user_capabilities.delete)
|
||||
.map(row => (
|
||||
<div key={row.id}>
|
||||
{row.name}
|
||||
</div>
|
||||
))
|
||||
}
|
||||
</div>
|
||||
) : deleteToolTipContent
|
||||
}
|
||||
disableDelete={disableDelete}
|
||||
deleteTooltip={deleteToolTipContent}
|
||||
showDelete
|
||||
showSelectAll
|
||||
showAdd={canAdd}
|
||||
@@ -374,7 +379,6 @@ class OrganizationsList extends Component {
|
||||
teamCount={o.summary_fields.related_field_counts.teams}
|
||||
isSelected={selected.some(row => row.id === o.id)}
|
||||
onSelect={() => this.onSelect(o)}
|
||||
onOpenOrgDeleteModal={this.handleOpenOrgDeleteModal}
|
||||
/>
|
||||
))}
|
||||
</ul>
|
||||
|
||||
Reference in New Issue
Block a user