-
Notifications
You must be signed in to change notification settings - Fork 64
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
Admin announcement feature #7067
base: main
Are you sure you want to change the base?
Admin announcement feature #7067
Conversation
c497d5b
to
0fdb818
Compare
/retest |
17ca387
to
1b38c1b
Compare
Otherwise, looking good! |
@csengerszabo |
1b38c1b
to
be40502
Compare
/retest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've left some feedback after reviewing the UI part. PTAL
modules/web/package-lock.json
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert changes in this file. If this needs to be updated then it should be done in separate PR.
if (data) { | ||
const adminAnnouncementsID = Object.keys(announcementsObject); | ||
const readAnnouncements = data.filter( | ||
(value, index, self) => self.indexOf(value) === index && adminAnnouncementsID.includes(value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious why do we need self.indexOf(value) === index
? Isn't this always true
? Also noticed this in announcement-banner component.
class="km-option-hover-bg" | ||
id="km-navbar-api-docs-btn" | ||
matRipple | ||
(click)="goToAPIDocs()"> | ||
API Documentation | ||
</div> | ||
|
||
<div *ngFor="let link of settings?.customLinks | kmLinkLocation: 'HelpPanel'" | ||
<div *ngIf="adminSettings?.displayAPIDocs" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check should be removed.
<div *ngIf="adminSettings?.displayAPIDocs" | |
<div *ngIf="adminSettings?.displayAPIDocs" |
class="km-option-hover-bg" | ||
matRipple | ||
(click)="openAnnouncementsDialog()"> | ||
Announcement |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit pick
Announcement | |
Announcements |
@@ -0,0 +1,163 @@ | |||
// Copyright 2024 The Kubermatic Kubernetes Platform contributors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update other newly added files as well.
// Copyright 2024 The Kubermatic Kubernetes Platform contributors. | |
// Copyright 2025 The Kubermatic Kubernetes Platform contributors. |
limitations under the License. | ||
--> | ||
|
||
<km-dialog-title>Announcement</km-dialog-title> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<km-dialog-title>Announcement</km-dialog-title> | |
<km-dialog-title>Announcements</km-dialog-title> |
class="km-mat-row"></tr> | ||
</table> | ||
<div class="km-row km-empty-list-msg" | ||
*ngIf="hasAnnouncements()">No announcements available.</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should will not be displayed if we don't have announcements which is the exact opposite of what we want here.
mat-icon-button | ||
(click)="markAsRead(element)" | ||
fxLayoutAlign="center center"> | ||
<i Class="km-icon-mask km-icon-show"></i> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets change this icon to checkmark ✔️)
return !this.announcements?.size; | ||
} | ||
|
||
markAsRead(announcement: string): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think instead of relying on parent component to update user settings, we should update them here. WDYT?
@@ -106,6 +106,7 @@ export enum AdminPanelView { | |||
Defaults = 'defaults', | |||
Limits = 'limits', | |||
Customization = 'customization', | |||
Announcement = 'announcement', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for the changes below.
Announcement = 'announcement', | |
Announcements = 'announcements', |
I'd let @Waseem826 review the PR since he is already on it. Just a side-note, please don't forget to create a testing ticket for this. |
be40502
to
3e56a71
Compare
3e56a71
to
7ecfa14
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What this PR does / why we need it:
Add a new feature to the admin page, allowing admins to broadcast announcements to users. Users will see the most recent announcement displayed as a banner across all pages and can view a list of all announcements by opening the announcement dialog from the help panel menu.
Admin- Announcement Page:
**add/edit announcement dialog: **
Announcement banner:
list of announcements dialog:
Which issue(s) this PR fixes:
Fixes #6645
What type of PR is this?
/kind feature
Does this PR introduce a user-facing change? Then add your Release Note here:
Documentation: