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: add createdAfter filtering to the Notifications #23173

Merged
merged 3 commits into from
Feb 27, 2024

Conversation

mareklibra
Copy link
Contributor

@mareklibra mareklibra commented Feb 22, 2024

Hey, I just made a Pull Request!

The notifications can be newly filtered based on the Created Date field.

The filter on the UI side contains a list of predefined values instead of exact date+time selection.

✔️ Checklist

  • A changeset describing the change and affected packages. (more info)
  • Added or updated documentation
  • Tests for new functionality and regression tests for bug fixes
  • Screenshots attached (for UI changes)
  • All your commits have a Signed-off-by line in the message. (more info)

Depends on (needs rebase):

@backstage-goalie
Copy link
Contributor

backstage-goalie bot commented Feb 22, 2024

Changed Packages

Package Name Package Path Changeset Bump Current Version
@backstage/plugin-notifications-backend plugins/notifications-backend patch v0.0.1
@backstage/plugin-notifications plugins/notifications patch v0.0.1

@mareklibra
Copy link
Contributor Author

Screenshot from 2024-02-22 12-07-39


Screenshot from 2024-02-22 12-07-54

Copy link
Contributor

github-actions bot commented Feb 22, 2024

Uffizzi Cluster pr-23173 was deleted.

@mareklibra mareklibra force-pushed the filterCreated branch 2 times, most recently from c81e1a8 to 38261ab Compare February 22, 2024 13:03
@backstage-goalie
Copy link
Contributor

Thanks for the contribution!
All commits need to be DCO signed before they are reviewed. Please refer to the the DCO section in CONTRIBUTING.md or the DCO status for more info.

Signed-off-by: Marek Libra <marek.libra@gmail.com>
Signed-off-by: Marek Libra <marek.libra@gmail.com>
Signed-off-by: Marek Libra <marek.libra@gmail.com>
Copy link
Member

@Rugvip Rugvip left a comment

Choose a reason for hiding this comment

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

Nice! 👍

All comments optional, could be addressed in followup PRs too

@@ -98,6 +98,9 @@ export class DatabaseNotificationsStore implements NotificationsStore {
options: NotificationGetOptions | NotificationModifyOptions,
) => {
const { user } = options;
const isSQLite = this.db.client.config.client.includes('sqlite3');
// const isPsql = this.db.client.config.client.includes('pg');
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// const isPsql = this.db.client.config.client.includes('pg');

🧹

@@ -204,6 +204,13 @@ export async function createRouter(
opts.read = false;
// or keep undefined
}
if (req.query.created_after) {
const sinceEpoch = Date.parse(req.query.created_after.toString());
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const sinceEpoch = Date.parse(req.query.created_after.toString());
const sinceEpoch = Date.parse(String(req.query.created_after));

Ever so slightly more safer way to convert to a string, in case of undefined / null

@Rugvip Rugvip merged commit afe2983 into backstage:master Feb 27, 2024
30 checks passed
Copy link
Contributor

Thank you for contributing to Backstage! The changes in this pull request will be part of the 1.24.0 release, scheduled for Tue, 19 Mar 2024.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants