mirror of
https://github.com/ansible/awx.git
synced 2026-05-17 14:27:42 -02:30
add organization column notification template list (#13998)
This commit is contained in:
@@ -178,6 +178,7 @@ function NotificationTemplatesList() {
|
|||||||
<HeaderCell sortKey="name">{t`Name`}</HeaderCell>
|
<HeaderCell sortKey="name">{t`Name`}</HeaderCell>
|
||||||
<HeaderCell>{t`Status`}</HeaderCell>
|
<HeaderCell>{t`Status`}</HeaderCell>
|
||||||
<HeaderCell sortKey="notification_type">{t`Type`}</HeaderCell>
|
<HeaderCell sortKey="notification_type">{t`Type`}</HeaderCell>
|
||||||
|
<HeaderCell sortKey="organization">{t`Organization`}</HeaderCell>
|
||||||
<HeaderCell>{t`Actions`}</HeaderCell>
|
<HeaderCell>{t`Actions`}</HeaderCell>
|
||||||
</HeaderRow>
|
</HeaderRow>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,10 @@ const mockTemplates = {
|
|||||||
url: '/notification_templates/1',
|
url: '/notification_templates/1',
|
||||||
type: 'slack',
|
type: 'slack',
|
||||||
summary_fields: {
|
summary_fields: {
|
||||||
|
organization: {
|
||||||
|
id: 1,
|
||||||
|
name: 'Foo',
|
||||||
|
},
|
||||||
recent_notifications: [
|
recent_notifications: [
|
||||||
{
|
{
|
||||||
status: 'success',
|
status: 'success',
|
||||||
@@ -36,6 +40,10 @@ const mockTemplates = {
|
|||||||
id: 2,
|
id: 2,
|
||||||
url: '/notification_templates/2',
|
url: '/notification_templates/2',
|
||||||
summary_fields: {
|
summary_fields: {
|
||||||
|
organization: {
|
||||||
|
id: 2,
|
||||||
|
name: 'Bar',
|
||||||
|
},
|
||||||
recent_notifications: [],
|
recent_notifications: [],
|
||||||
user_capabilities: {
|
user_capabilities: {
|
||||||
delete: true,
|
delete: true,
|
||||||
@@ -48,6 +56,10 @@ const mockTemplates = {
|
|||||||
id: 3,
|
id: 3,
|
||||||
url: '/notification_templates/3',
|
url: '/notification_templates/3',
|
||||||
summary_fields: {
|
summary_fields: {
|
||||||
|
organization: {
|
||||||
|
id: 3,
|
||||||
|
name: 'Test',
|
||||||
|
},
|
||||||
recent_notifications: [
|
recent_notifications: [
|
||||||
{
|
{
|
||||||
status: 'failed',
|
status: 'failed',
|
||||||
|
|||||||
@@ -121,6 +121,13 @@ function NotificationTemplateListItem({
|
|||||||
{NOTIFICATION_TYPES[template.notification_type] ||
|
{NOTIFICATION_TYPES[template.notification_type] ||
|
||||||
template.notification_type}
|
template.notification_type}
|
||||||
</Td>
|
</Td>
|
||||||
|
<Td dataLabel={t`Oragnization`}>
|
||||||
|
<Link
|
||||||
|
to={`/organizations/${template.summary_fields.organization.id}/details`}
|
||||||
|
>
|
||||||
|
<b>{template.summary_fields.organization.name}</b>
|
||||||
|
</Link>
|
||||||
|
</Td>
|
||||||
<ActionsTd dataLabel={t`Actions`}>
|
<ActionsTd dataLabel={t`Actions`}>
|
||||||
<ActionItem visible tooltip={t`Test notification`}>
|
<ActionItem visible tooltip={t`Test notification`}>
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
@@ -12,6 +12,10 @@ const template = {
|
|||||||
notification_type: 'slack',
|
notification_type: 'slack',
|
||||||
name: 'Test Notification',
|
name: 'Test Notification',
|
||||||
summary_fields: {
|
summary_fields: {
|
||||||
|
organization: {
|
||||||
|
id: 1,
|
||||||
|
name: 'Foo',
|
||||||
|
},
|
||||||
user_capabilities: {
|
user_capabilities: {
|
||||||
edit: true,
|
edit: true,
|
||||||
copy: true,
|
copy: true,
|
||||||
@@ -39,7 +43,7 @@ describe('<NotificationTemplateListItem />', () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const cells = wrapper.find('Td');
|
const cells = wrapper.find('Td');
|
||||||
expect(cells).toHaveLength(5);
|
expect(cells).toHaveLength(6);
|
||||||
expect(cells.at(1).text()).toEqual('Test Notification');
|
expect(cells.at(1).text()).toEqual('Test Notification');
|
||||||
expect(cells.at(2).text()).toEqual('Success');
|
expect(cells.at(2).text()).toEqual('Success');
|
||||||
expect(cells.at(3).text()).toEqual('Slack');
|
expect(cells.at(3).text()).toEqual('Slack');
|
||||||
@@ -133,6 +137,10 @@ describe('<NotificationTemplateListItem />', () => {
|
|||||||
template={{
|
template={{
|
||||||
...template,
|
...template,
|
||||||
summary_fields: {
|
summary_fields: {
|
||||||
|
organization: {
|
||||||
|
id: 3,
|
||||||
|
name: 'Test',
|
||||||
|
},
|
||||||
user_capabilities: {
|
user_capabilities: {
|
||||||
copy: false,
|
copy: false,
|
||||||
edit: false,
|
edit: false,
|
||||||
|
|||||||
Reference in New Issue
Block a user