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

Add alert bar component #17230

Draft
wants to merge 75 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
e789776
add alert bar component
sweta1308 Jul 30, 2024
9800572
Merge branch 'main' into alert-bar
sweta1308 Jul 30, 2024
8d832a5
updated as per comments
sweta1308 Jul 30, 2024
6e93bd1
Merge branch 'main' into alert-bar
sweta1308 Jul 30, 2024
15c64d6
updated as per comments
sweta1308 Jul 30, 2024
1caed64
updated alert bar component
sweta1308 Jul 31, 2024
e896c06
Merge branch 'main' into alert-bar
Sachin-chaurasiya Jul 31, 2024
ca7bafa
remove styles attributes
sweta1308 Jul 31, 2024
3f1dbd8
update styles
sweta1308 Jul 31, 2024
dd30c31
Merge branch 'main' into alert-bar
sweta1308 Jul 31, 2024
6dc6f64
Merge branch 'main' into alert-bar
Sachin-chaurasiya Jul 31, 2024
f87e47a
Merge branch 'main' into alert-bar
sweta1308 Jul 31, 2024
0c30bb1
add alert store and use alert in page layout
sweta1308 Jul 31, 2024
28d028b
Merge branch 'main' into alert-bar
Sachin-chaurasiya Jul 31, 2024
beb3e7c
update component to have reset method
sweta1308 Jul 31, 2024
d50634a
refactor: update reset calling method
sweta1308 Jul 31, 2024
3c00265
Merge branch 'main' into alert-bar
Sachin-chaurasiya Jul 31, 2024
2e6ad18
Merge branch 'main' into alert-bar
Sachin-chaurasiya Aug 1, 2024
feae113
Merge branch 'main' into alert-bar
Sachin-chaurasiya Aug 1, 2024
993a0ad
Merge branch 'main' into alert-bar
sweta1308 Aug 2, 2024
21535a0
Merge branch 'main' into alert-bar
sweta1308 Aug 2, 2024
42ec872
update reset method name
sweta1308 Aug 2, 2024
760b772
Merge branch 'main' into alert-bar
sweta1308 Aug 2, 2024
8f9bccf
updated as per feedbacks
sweta1308 Aug 2, 2024
0f12a12
refcator: update CrossIcon component usage
sweta1308 Aug 2, 2024
5a62c22
Merge branch 'main' into alert-bar
sweta1308 Aug 2, 2024
57927c0
chore: remove condition for CrossIcon
sweta1308 Aug 2, 2024
2073bfa
update animation for opening alert bar.
sweta1308 Aug 5, 2024
f48bb8d
Merge branch 'main' into alert-bar
sweta1308 Aug 5, 2024
e15b877
add autoCloseTimer to alert banner
sweta1308 Aug 5, 2024
3970cb6
remove cross icon component
sweta1308 Aug 5, 2024
7c16a64
add cross icon svg
sweta1308 Aug 5, 2024
eab3649
update to fix the height issue
sweta1308 Aug 5, 2024
6145a81
Merge branch 'main' into alert-bar
Sachin-chaurasiya Aug 5, 2024
f830beb
Merge branch 'main' into alert-bar
sweta1308 Aug 6, 2024
5f8eaf8
Merge branch 'main' into alert-bar
sweta1308 Aug 6, 2024
5ea9c29
Merge branch 'main' into alert-bar
sweta1308 Aug 6, 2024
664c828
Merge branch 'main' into alert-bar
sweta1308 Aug 6, 2024
1633888
Merge branch 'main' into alert-bar
Sachin-chaurasiya Aug 6, 2024
061c808
Merge branch 'main' into alert-bar
Sachin-chaurasiya Aug 6, 2024
06b9fb0
Merge branch 'main' into alert-bar
Sachin-chaurasiya Aug 6, 2024
79edf42
Merge branch 'main' into alert-bar
Sachin-chaurasiya Aug 7, 2024
f34995d
Merge branch 'main' into alert-bar
Sachin-chaurasiya Aug 7, 2024
d6dad5a
Merge branch 'main' into alert-bar
Sachin-chaurasiya Aug 7, 2024
772c408
Merge branch 'main' into alert-bar
Sachin-chaurasiya Aug 7, 2024
d8f12bd
Merge branch 'main' into alert-bar
Sachin-chaurasiya Aug 7, 2024
b3710b1
Merge branch 'main' into alert-bar
Sachin-chaurasiya Aug 8, 2024
be76be2
Merge branch 'main' into alert-bar
Sachin-chaurasiya Aug 8, 2024
cad15ff
Merge branch 'main' into alert-bar
Sachin-chaurasiya Aug 9, 2024
3707793
Merge branch 'main' into alert-bar
Sachin-chaurasiya Aug 9, 2024
46ea364
Merge branch 'main' into alert-bar
Sachin-chaurasiya Aug 9, 2024
c144736
Merge branch 'main' into alert-bar
Sachin-chaurasiya Aug 10, 2024
60e376c
Merge branch 'main' into alert-bar
Sachin-chaurasiya Aug 10, 2024
75c91f4
Merge branch 'main' into alert-bar
Sachin-chaurasiya Aug 11, 2024
229eb76
Merge branch 'main' into alert-bar
sweta1308 Aug 20, 2024
0eb761a
Merge branch 'main' into alert-bar
sweta1308 Aug 20, 2024
e95f918
Merge branch 'main' into alert-bar
sweta1308 Aug 21, 2024
5acc9bf
Merge branch 'main' into alert-bar
Sachin-chaurasiya Sep 3, 2024
c90f17c
Merge branch 'main' into alert-bar
sweta1308 Sep 4, 2024
8c3d968
Merge branch 'main' into alert-bar
sweta1308 Sep 4, 2024
5314897
Merge branch 'main' into alert-bar
sweta1308 Sep 16, 2024
1d88cff
Merge branch 'main' into alert-bar
Sachin-chaurasiya Sep 16, 2024
304e661
Merge branch 'main' into alert-bar
sweta1308 Sep 18, 2024
ea57b3e
Merge branch 'main' into alert-bar
sweta1308 Sep 19, 2024
1bc3307
Merge branch 'main' into alert-bar
sweta1308 Sep 19, 2024
e1e6181
fix height glitch issue when alert appears
sweta1308 Sep 20, 2024
5b94326
update the alert notification tests
sweta1308 Sep 20, 2024
a2a03a8
Merge branch 'main' into alert-bar
sweta1308 Sep 23, 2024
fafdc9d
Merge branch 'main' into alert-bar
sweta1308 Sep 24, 2024
c545756
update alert transition issue
sweta1308 Sep 24, 2024
f54efcf
Merge branch 'main' into alert-bar
sweta1308 Sep 25, 2024
f0791ca
revert the changes for height issue
sweta1308 Sep 25, 2024
fa6f712
resolve conflicts
Sachin-chaurasiya Oct 3, 2024
fc1c6fd
Merge branch 'main' into alert-bar
sweta1308 Oct 3, 2024
1d58d1b
Merge branch 'main' into alert-bar
sweta1308 Oct 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,13 @@ test.describe('Activity feed', () => {

await page.getByText('Accept Suggestion').click();

await toastNotification(page, /Task resolved successfully/);
await toastNotification(page, /Task resolved successfully/, 'success');

// Task 1 - Request to update tag to be resolved

await page.getByText('Accept Suggestion').click();

await toastNotification(page, /Task resolved successfully/);
await toastNotification(page, /Task resolved successfully/, 'success');

await checkTaskCount(page, 0, 2);
});
Expand Down Expand Up @@ -363,13 +363,13 @@ test.describe('Activity feed', () => {
await page.getByText('OK').click();
await resolveTask;

await toastNotification(page, /Task resolved successfully/);
await toastNotification(page, /Task resolved successfully/, 'success');

// Task 1 - Resolved the task

await page.getByText('Accept Suggestion').click();

await toastNotification(page, /Task resolved successfully/);
await toastNotification(page, /Task resolved successfully/, 'success');

await checkTaskCount(page, 0, 2);
});
Expand Down Expand Up @@ -412,7 +412,11 @@ test.describe('Activity feed', () => {

await page.getByRole('menuitem', { name: 'close' }).click();

await toastNotification(page, 'Task cannot be closed without a comment.');
await toastNotification(
page,
'Task cannot be closed without a comment.',
'warning'
);

// Close the task from the Button.Group, with comment is added.
await page.fill(
Expand All @@ -429,7 +433,7 @@ test.describe('Activity feed', () => {
await page.getByRole('menuitem', { name: 'close' }).click();
await commentWithCloseTask;

await toastNotification(page, 'Task closed successfully.');
await toastNotification(page, 'Task closed successfully.', 'success');

await checkTaskCount(page, 0, 1);
});
Expand Down Expand Up @@ -481,7 +485,7 @@ test.describe('Activity feed', () => {
await page.getByRole('menuitem', { name: 'close' }).click();
await commentWithCloseTask;

await toastNotification(page, 'Task closed successfully.');
await toastNotification(page, 'Task closed successfully.', 'success');
// open task count after closing one task
await checkTaskCount(page, 1, 1);

Expand Down Expand Up @@ -671,7 +675,8 @@ base.describe('Activity feed with Data Consumer User', () => {
// await toastNotification(page1, 'Task closed successfully.');
await toastNotification(
page1,
'An exception with message [Cannot invoke "java.util.List.stream()" because "owners" is null] was thrown while processing request.'
'An exception with message [Cannot invoke "java.util.List.stream()" because "owners" is null] was thrown while processing request.',
'error'
);

// TODO: Ashish - Enable them once issue is resolved from Backend https://github.com/open-metadata/OpenMetadata/issues/17059
Expand Down Expand Up @@ -737,7 +742,7 @@ base.describe('Activity feed with Data Consumer User', () => {

await page2.getByText('Accept Suggestion').click();

await toastNotification(page2, /Task resolved successfully/);
await toastNotification(page2, /Task resolved successfully/, 'success');

await page2.waitForLoadState('networkidle');

Expand Down Expand Up @@ -884,7 +889,7 @@ base.describe('Activity feed with Data Consumer User', () => {

await page2.getByText('OK').click();

await toastNotification(page2, /Task resolved successfully/);
await toastNotification(page2, /Task resolved successfully/, 'success');

// Accept the description task

Expand All @@ -906,7 +911,7 @@ base.describe('Activity feed with Data Consumer User', () => {

await page2.getByText('OK').click();

await toastNotification(page2, /Task resolved successfully/);
await toastNotification(page2, /Task resolved successfully/, 'success');

await afterActionUser2();
}
Expand Down Expand Up @@ -980,7 +985,8 @@ base.describe('Activity feed with Data Consumer User', () => {
await toastNotification(
page2,
// eslint-disable-next-line max-len
`Principal: CatalogPrincipal{name='${viewAllUser.responseData.name}'} operation EditDescription denied by role ${viewAllRoles.responseData.name}, policy ${viewAllPolicy.responseData.name}, rule editNotAllowed`
`Principal: CatalogPrincipal{name='${viewAllUser.responseData.name}'} operation EditDescription denied by role ${viewAllRoles.responseData.name}, policy ${viewAllPolicy.responseData.name}, rule editNotAllowed`,
'error'
);

await afterActionUser2();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ test.describe('Teams drag and drop should work properly', () => {
await dragAndDropElement(page, team, teamNameGroup);
await toastNotification(
page,
`You cannot move to this team as Team Type ${TEAM_TYPE_BY_NAME[team]} can't be Group children`
`You cannot move to this team as Team Type ${TEAM_TYPE_BY_NAME[team]} can't be Group children`,
'error'
);
}
});
Expand All @@ -132,7 +133,8 @@ test.describe('Teams drag and drop should work properly', () => {
await dragAndDropElement(page, team, teamNameDepartment);
await toastNotification(
page,
`You cannot move to this team as Team Type ${TEAM_TYPE_BY_NAME[team]} can't be Department children`
`You cannot move to this team as Team Type ${TEAM_TYPE_BY_NAME[team]} can't be Department children`,
'error'
);
}
});
Expand All @@ -143,7 +145,8 @@ test.describe('Teams drag and drop should work properly', () => {
await dragAndDropElement(page, teamNameBusiness, teamNameDivision);
await toastNotification(
page,
"You cannot move to this team as Team Type BusinessUnit can't be Division children"
"You cannot move to this team as Team Type BusinessUnit can't be Division children",
'error'
);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ test.describe('Add Nested Teams and Test TeamsSelectable', () => {

await toastNotification(
page,
`"${businessTeamName}" deleted successfully!`
`"${businessTeamName}" deleted successfully!`,
'success'
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@
*/
import { expect, test } from '@playwright/test';
import { GlobalSettingOptions } from '../../constant/settings';
import { descriptionBox, redirectToHomePage, uuid } from '../../utils/common';
import {
descriptionBox,
redirectToHomePage,
toastNotification,
uuid,
} from '../../utils/common';
import { settingClick } from '../../utils/sidebar';

const apiServiceConfig = {
Expand Down Expand Up @@ -89,10 +94,6 @@ test.describe('API service', () => {

await deleteResponse;

await expect(page.locator('.Toastify__toast-body')).toHaveText(
/deleted successfully!/
);

await page.click('.Toastify__close-button');
await toastNotification(page, /deleted successfully!/, 'success');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { expect, Page, test as base } from '@playwright/test';
import { PersonaClass } from '../../support/persona/PersonaClass';
import { UserClass } from '../../support/user/UserClass';
import { performAdminLogin } from '../../utils/admin';
import { redirectToHomePage } from '../../utils/common';
import { redirectToHomePage, toastNotification } from '../../utils/common';
import {
checkAllDefaultWidgets,
navigateToCustomizeLandingPage,
Expand Down Expand Up @@ -239,10 +239,10 @@ test.describe('Customize Landing Page Flow', () => {
.click();

// Verify the toast notification
const toastNotification = adminPage.locator('.Toastify__toast-body');

await expect(toastNotification).toContainText(
'Page layout updated successfully.'
await toastNotification(
adminPage,
'Page layout updated successfully.',
'success'
);

// Check if all widgets are present after resetting the layout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,8 @@ test.describe.serial('Persona operations', () => {

await toastNotification(
page,
`"${PERSONA_DETAILS.displayName}" deleted successfully!`
`"${PERSONA_DETAILS.displayName}" deleted successfully!`,
'success'
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ test.describe.serial('Data Insight Report Application', () => {
await page.click('[data-value="5"]');
await page.click('[data-testid="deploy-button"]');

await toastNotification(page, 'Application installed successfully');
await toastNotification(
page,
'Application installed successfully',
'success'
);

await expect(
page.locator('[data-testid="data-insights-report-application-card"]')
Expand All @@ -83,7 +87,7 @@ test.describe.serial('Data Insight Report Application', () => {
await page.click('[data-testid="hour-options"]');
await page.click('[title="01"]');
await page.click('.ant-modal-body [data-testid="deploy-button"]');
await toastNotification(page, 'Schedule saved successfully');
await toastNotification(page, 'Schedule saved successfully', 'success');

// Validate update config in the application
await expect(page.locator('[data-testid="cron-string"]')).toContainText(
Expand All @@ -95,7 +99,11 @@ test.describe.serial('Data Insight Report Application', () => {
await page.click('#root\\/sendToTeams');
await page.click('[data-testid="submit-btn"]');

await toastNotification(page, 'Configuration saved successfully');
await toastNotification(
page,
'Configuration saved successfully',
'success'
);

// Validate update config in the application

Expand All @@ -109,7 +117,11 @@ test.describe.serial('Data Insight Report Application', () => {
);

await page.click('[data-testid="run-now-button"]');
await toastNotification(page, 'Application triggered successfully');
await toastNotification(
page,
'Application triggered successfully',
'success'
);

const { apiContext } = await getApiContext(page);

Expand Down Expand Up @@ -149,7 +161,11 @@ test.describe.serial('Data Insight Report Application', () => {
await page.click('[data-testid="uninstall-button-title"]');
await page.click('[data-testid="save-button"]');

await toastNotification(page, 'Application uninstalled successfully');
await toastNotification(
page,
'Application uninstalled successfully',
'success'
);

await expect(
page.locator('[data-testid="data-insights-report-application-card"]')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ test.describe.serial(
// Click on deploy button
await page.click('.ant-modal-body [data-testid="deploy-button"]');

await toastNotification(page, 'Schedule saved successfully');
await toastNotification(page, 'Schedule saved successfully', 'success');

// Verify cron string
await expect(page.locator('[data-testid="cron-string"]')).toContainText(
Expand Down Expand Up @@ -101,7 +101,11 @@ test.describe.serial(
// Click on the save button
await page.click('[data-testid="save-button"]');

await toastNotification(page, 'Application uninstalled successfully');
await toastNotification(
page,
'Application uninstalled successfully',
'success'
);

await expect(
page.locator('[data-testid="data-insights-application-card"]')
Expand Down Expand Up @@ -215,4 +219,4 @@ test.describe.serial(
});
}
}
);
);
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ test('Table test case', PLAYWRIGHT_INGESTION_TAG_OBJ, async ({ page }) => {
);
await page.locator('button').filter({ hasText: 'Submit' }).click();
await updateTestCaseResponse;
await toastNotification(page, 'Test case updated successfully.');
await toastNotification(page, 'Test case updated successfully.', 'success');
await page.click(`[data-testid="edit-${NEW_TABLE_TEST_CASE.name}"]`);

await page.waitForSelector('#tableTestForm_params_columnName');
Expand Down Expand Up @@ -232,7 +232,7 @@ test('Column test case', PLAYWRIGHT_INGESTION_TAG_OBJ, async ({ page }) => {
);
await page.locator('button').getByText('Submit').click();
await updateTestCaseResponse;
await toastNotification(page, 'Test case updated successfully.');
await toastNotification(page, 'Test case updated successfully.', 'success');

await page.click(`[data-testid="edit-${NEW_COLUMN_TEST_CASE.name}"]`);
await page.waitForSelector('#tableTestForm_params_minLength');
Expand Down Expand Up @@ -464,7 +464,11 @@ test(
await page.locator('#tableTestForm_displayName').clear();
await page.fill('#tableTestForm_displayName', 'Updated display name');
await page.click('.ant-modal-footer >> text=Submit');
await toastNotification(page, 'Test case updated successfully.');
await toastNotification(
page,
'Test case updated successfully.',
'success'
);

await expect(
page.locator(`[data-testid="${testCaseName}"]`)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,8 @@ test.describe('Glossary tests', () => {

await toastNotification(
page,
/mutually exclusive and can't be assigned together/
/mutually exclusive and can't be assigned together/,
'error'
);

// Add non mutually exclusive tags
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ test.describe('Login configuration', () => {
// Click the save button
await page.click('[data-testid="save-button"]');

await toastNotification(page, 'Login Configuration updated successfully.');
await toastNotification(
page,
'Login Configuration updated successfully.',
'success'
);

// Assert the updated values
await expect(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ import {
UPDATED_RULE_NAME,
} from '../../constant/permission';
import { GlobalSettingOptions } from '../../constant/settings';
import { descriptionBox, redirectToHomePage } from '../../utils/common';
import {
descriptionBox,
redirectToHomePage,
toastNotification,
} from '../../utils/common';
import { validateFormNameFieldInput } from '../../utils/form';
import { settingClick } from '../../utils/sidebar';

Expand Down Expand Up @@ -258,8 +262,10 @@ test.describe('Policy page should work properly', () => {
await page.locator('[data-testid="delete-rule"]').click();

// Validate the error message
await expect(page.locator('.Toastify__toast-body')).toContainText(
ERROR_MESSAGE_VALIDATION.lastRuleCannotBeRemoved
await toastNotification(
page,
ERROR_MESSAGE_VALIDATION.lastRuleCannotBeRemoved,
'error'
);
});

Expand Down
Loading
Loading