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