Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch old with new integrations page #2310

Merged
merged 12 commits into from
Jun 23, 2023
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased

### Changed

- UI Updates for the integrations page ([#2310](https://github.com/grafana/oncall/pull/2310))

## v1.2.46 (2023-06-22)

### Added
Expand Down
38 changes: 20 additions & 18 deletions grafana-plugin/integration-tests/utils/integrations.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Page } from '@playwright/test';
import { clickButton, fillInInput, selectDropdownValue } from './forms';
import { clickButton } from './forms';
import { goToOnCallPage } from './navigation';

const CREATE_INTEGRATION_MODAL_TEST_ID_SELECTOR = 'div[data-testid="create-integration-modal"]';
Expand All @@ -9,7 +9,7 @@ export const openCreateIntegrationModal = async (page: Page): Promise<void> => {
await goToOnCallPage(page, 'integrations');

// open the create integration modal
(await page.waitForSelector('text=New integration to receive alerts')).click();
(await page.waitForSelector('text=New integration')).click();

// wait for it to pop up
await page.waitForSelector(CREATE_INTEGRATION_MODAL_TEST_ID_SELECTOR);
Expand All @@ -18,32 +18,34 @@ export const openCreateIntegrationModal = async (page: Page): Promise<void> => {
export const createIntegrationAndSendDemoAlert = async (
page: Page,
integrationName: string,
escalationChainName: string
_escalationChainName: string
): Promise<void> => {
await openCreateIntegrationModal(page);

// create a webhook integration
(await page.waitForSelector(`${CREATE_INTEGRATION_MODAL_TEST_ID_SELECTOR} >> text=Webhook`)).click();

// wait for the integrations settings modal to open up... and then close it
await clickButton({ page, buttonText: 'Open Escalations Settings' });
// fill in the required inputs
(await page.waitForSelector('input[name="verbal_name"]', { state: 'attached' })).fill(integrationName);
(await page.waitForSelector('textarea[name="description_short"]', { state: 'attached' })).fill("Here goes your integration description");

// update the integration name
await (await page.waitForSelector('div[data-testid="integration-header"] >> h4 >> button')).click();
await fillInInput(page, 'div[data-testid="edit-integration-name-modal"] >> input', integrationName);
await clickButton({ page, buttonText: 'Update' });
const grafanaUpdateBtn = page.getByTestId("update-integration-button");
await grafanaUpdateBtn.click();

const integrationSettingsElement = page.getByTestId('integration-settings');
/*
* TODO: This is slightly more complicated now, change this in next iteration */
// const integrationSettingsElement = page.getByTestId('integration-settings');

// assign the escalation chain to the integration
await selectDropdownValue({
page,
selectType: 'grafanaSelect',
placeholderText: 'Select Escalation Chain',
value: escalationChainName,
startingLocator: integrationSettingsElement,
});
// // assign the escalation chain to the integration
// await selectDropdownValue({
// page,
// selectType: 'grafanaSelect',
// placeholderText: 'Select Escalation Chain',
// value: escalationChainName,
// startingLocator: integrationSettingsElement,
// });

// send demo alert
await clickButton({ page, buttonText: 'Send demo alert', dataTestId: 'send-demo-alert' });
await clickButton({ page, buttonText: 'Send Alert', dataTestId: "submit-send-alert" })
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TemplateOptions } from 'pages/integration_2/Integration2.config';
import { TemplateOptions } from 'pages/integration/Integration.config';

export interface Template {
name: string;
Expand Down
8 changes: 5 additions & 3 deletions grafana-plugin/src/components/GForm/GForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,11 @@ class GForm extends React.Component<GFormProps, {}> {
return (
<>
{openFields.map(renderField)}
<Collapse isOpen={false} label="Notification settings" className={cx('collapse')}>
{collapsedfields.map(renderField)}
</Collapse>
{collapsedfields.length > 0 && (
<Collapse isOpen={false} label="Notification settings" className={cx('collapse')}>
{collapsedfields.map(renderField)}
</Collapse>
)}
</>
);
}}
Expand Down
16 changes: 0 additions & 16 deletions grafana-plugin/src/containers/AlertRules/AlertRules.helpers.ts

This file was deleted.

144 changes: 0 additions & 144 deletions grafana-plugin/src/containers/AlertRules/AlertRules.module.css

This file was deleted.

Loading