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

Feat : Support for Announcements listing in Activity Feed Tab and Announcement Tab in Service page #18993

Open
wants to merge 28 commits into
base: main
Choose a base branch
from

Conversation

shrushti2000
Copy link
Contributor

@shrushti2000 shrushti2000 commented Dec 10, 2024

  1. Added Announcements listing functionality in the Activity Feed Tab along with CRUD functionality.
  2. Added Announcements Tab in Service page which has Announcements listing with CRUD functionality.
  3. Redirect users to Announcements tab in Service page or subtab in Activity Feed respectively when clicked on the active announcement card.
  4. Removed the Announcements Drawer.
  5. Removed Announcement option from Manage Button

Note: The implementation for the count of announcements is currently not included in this PR. This will be added once the necessary backend changes are completed and available.

Announcements Listing in Activity Feed

Screen.Recording.2024-12-16.at.8.31.49.PM.2.3.1.mov

Announcements Listing in Service Page

Screen.Recording.2024-12-16.at.8.33.13.PM.1.1.1.mov

Update Manage Button
Screenshot 2024-12-16 at 8 45 54 PM

Type of change:

  • Bug fix
  • Improvement
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed.

@shrushti2000 shrushti2000 changed the title Feat : Support for Announcements listing in Activity Feed Tab and Announcement Tab in Service page WIP : Support for Announcements listing in Activity Feed Tab and Announcement Tab in Service page Dec 10, 2024
Copy link
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

Copy link
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

Copy link
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

Copy link
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

Comment on lines -813 to -817
await expect(page.getByTestId('announcement-error')).toContainText(
'No Announcements, Click on add announcement to add one.'
);

await page.getByTestId('add-announcement').click();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still have this for no announcement right? inside announcement tab?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, we have, added this check in the test

Comment on lines 802 to 807
if (isForActivityFeedTab) {
const activityFeedText = (await page
.getByText('Activity Feeds & Tasks')
.isVisible())
? 'Activity Feeds & Tasks'
: 'Activity Feeds';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we try it with selector instead of text? both should have same role-id I guess

Screenshot 2024-12-18 at 10 23 18 PM

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, used role id as the selector.

Comment on lines 883 to 897
// Edit the reply message
await page.hover('[data-testid="replies"] > [data-testid="main-message"]');
await page.waitForSelector('.ant-popover', { state: 'visible' });
await page.click('[data-testid="edit-message"]');

await page.fill(
'[data-testid="editor-wrapper"] .ql-editor',
'Reply message edited'
);

await page.click('[data-testid="save-button"]');

await expect(
page.locator('[data-testid="replies"] [data-testid="viewer-container"]')
).toHaveText('Reply message edited');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are missing this test

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done,Added this test

Comment on lines 900 to 905
if (isForActivityFeedTab) {
const activityFeedText = (await page
.getByText('Activity Feeds & Tasks')
.isVisible())
? 'Activity Feeds & Tasks'
: 'Activity Feeds';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

const callback = () => {
return;
};
await updateThreadData(threadId, postId, isThread, data, callback);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
await updateThreadData(threadId, postId, isThread, data, callback);
await updateThreadData(threadId, postId, isThread, data, noop);

can use noop

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

used noop

Comment on lines +521 to +541
<div
className="d-flex justify-between"
data-testid="announcement-sub-tab">
<Space align="center" size="small">
<AnnouncementsIcon
style={COMMON_ICON_STYLES}
{...ICON_DIMENSION}
/>
<span>{t('label.announcement-plural')}</span>
</Space>

<span>
{!isUserEntity &&
getCountBadge(
countData.data.conversationCount,
'',
activeTab === ActivityFeedTabs.ANNOUNCEMENTS
)}
</span>
</div>
),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we have tabLabel component which can be used here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, we have tabLabel component , but ig that's for the tabs ,not for the sub tabs. We can use this compo for sub tabs as well, but currently its not supporting icon display, which we require for sub tab.

Comment on lines 51 to 52
margin-bottom: 5px;
margin-right: 5px;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use our size variable instead hardcoded CSS values?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -264,6 +264,7 @@ const UserPopOverCard: FC<Props> = ({
<Link
className={classNames(
'assignee-item d-flex gap-1 cursor-pointer items-center',
'z-9 relative',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid using z-index

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -605,6 +605,7 @@
"in-lowercase": "in",
"in-open-metadata": "In OpenMetadata",
"in-review": "In Review",
"inactive": "Inactive",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please translate and update it with help of AI

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

{
name: t('label.announcement-plural'),
key: EntityTabs.ANNOUNCEMENT,
count: 0,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to replace it with actual count right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, that will be replaced when the backend changes are available for total announcements count in counts api call. Currently we are not fetching all the announcements (active & inactive both) all at once. Fetching only the selected announcement type ie. active or inactive.

Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
safe to test Add this label to run secure Github workflows on PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants