Skip to content

feat(notifications): require users and groups to be of the form namespace/name #1352

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

Merged
merged 1 commit into from
Mar 21, 2024

Conversation

ydayagi
Copy link
Contributor

@ydayagi ydayagi commented Mar 19, 2024

@ydayagi ydayagi requested a review from a team as a code owner March 19, 2024 09:56
@@ -30,31 +30,23 @@ export async function createNotification(
let isUser = false;

// validate users
if (Array.isArray(req.targetGroups) && req.targetGroups.length > 0) {
if (
req.targetGroups &&
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we do not need this check since it is included in the Array.isArray()
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray

Copy link
Contributor

Choose a reason for hiding this comment

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

Or is it just to make the TypeScript happy?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

exactly. unfortunately, the compiler understands the 'undefined' check but not the 'isArray' check.

}

// validate groups
if (Array.isArray(req.targetUsers) && req.targetUsers.length > 0) {
if (
req.targetUsers &&
Copy link
Contributor

Choose a reason for hiding this comment

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

likewise

Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.7% Duplication on New Code

See analysis details on SonarCloud

@openshift-ci openshift-ci bot added the lgtm label Mar 21, 2024
@mareklibra
Copy link
Contributor

/lgtm

Copy link

openshift-ci bot commented Mar 21, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mareklibra

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit 5e54670 into janus-idp:main Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants